6Lo 6LoWP WPAN AN an and d IP IPv6 v6 Antonio Lin Colina, - - PowerPoint PPT Presentation

6lo 6lowp wpan an an and d ip ipv6 v6
SMART_READER_LITE
LIVE PREVIEW

6Lo 6LoWP WPAN AN an and d IP IPv6 v6 Antonio Lin Colina, - - PowerPoint PPT Presentation

UD UDP on on 6Lo 6LoWP WPAN AN an and d IP IPv6 v6 Antonio Lin Colina, Zolertia Co Conti tiki ki Stac ack HTTP, CoAP, MQTT, Application WebSockets TCP, UDP Transport IPv6/IPv4, RPL Network/Routing Adaptation 6LoWPAN


slide-1
SLIDE 1

UD UDP on

  • n

6Lo 6LoWP WPAN AN an and d IP IPv6 v6

Antonio Liñán Colina, Zolertia

slide-2
SLIDE 2

Co Conti tiki ki Stac ack

slide-3
SLIDE 3

CSMA/CA ContikiMAC, CSL IEEE 802.15.4 6LoWPAN TCP, UDP IPv6/IPv4, RPL HTTP, CoAP, MQTT, WebSockets

Application Transport Network/Routing Adaptation MAC (medium access control) Radio duty cycling (RDC) Radio (PHY)

slide-4
SLIDE 4

CSMA/CA ContikiMAC, CSL IEEE 802.15.4 6LoWPAN TCP, UDP IPv6/IPv4, RPL HTTP, CoAP, MQTT, WebSockets

Application Transport Network/Routing Adaptation MAC (medium access control) Radio duty cycling (RDC) Radio (PHY)

slide-5
SLIDE 5

RPL: L: IPv6 6 Routi ting ng Proto tocol col for Low po power er and d Loss ssy Networ tworks

Directed Acyclic Graph (DAG) Destination Oriented DAG (DODAG)

https://tools.ietf.org/id/draft-ietf-roll-rpl-19.txt

ICMPv6 Pv6 contr trol messag ages

  • DAG Information Object (DIO): sends DODAG information downwards
  • Destination Advertisement Object (DAO): sends destination information upwards
  • DAG Information Solicitation (DIS): requests a DIO
slide-6
SLIDE 6

RPL: L: IPv6 6 Routi ting ng Proto tocol col for Low po power er and d Loss ssy Networ tworks

https://tools.ietf.org/id/draft-ietf-roll-rpl-19.txt

  • 1. Nodes periodically send link-local multicast DIO

messages

  • 2. Nodes listen for DIOs and use their information to

join a new DODAG, or to maintain an existing DODAG

  • 3. Nodes may use a DIS message to solicit a DIO
  • 4. Based on information in the DIOs the node chooses

parents that minimize path cost to the DODAG root

slide-7
SLIDE 7
slide-8
SLIDE 8

CSMA/CA ContikiMAC, CSL IEEE 802.15.4 6LoWPAN TCP, UDP IPv6/IPv4, RPL HTTP, CoAP, MQTT, WebSockets

Application Transport Network/Routing Adaptation MAC (medium access control) Radio duty cycling (RDC) Radio (PHY)

slide-9
SLIDE 9
slide-10
SLIDE 10
slide-11
SLIDE 11
slide-12
SLIDE 12

https://tools.ietf.org/html/draft-ietf-6lowpan-hc-06

core/net/ipv6/sicslowpan.c platforms/z1/contiki-conf.h

slide-13
SLIDE 13

CSMA/CA ContikiMAC, CSL IEEE 802.15.4 6LoWPAN TCP, UDP IPv6/IPv4, RPL HTTP, CoAP, MQTT, WebSockets

Application Transport Network/Routing Adaptation MAC (medium access control) Radio duty cycling (RDC) Radio (PHY)

slide-14
SLIDE 14
slide-15
SLIDE 15
slide-16
SLIDE 16

02 02-ipv6 ipv6

slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19

examples/zolertia/tutorial/02-ipv6/01-udp-local-multicast/Makefile

This flag enables IPv6 support

slide-20
SLIDE 20

examples/zolertia/tutorial/02-ipv6/01-udp-local-multicast

slide-21
SLIDE 21

examples/zolertia/tutorial/02-ipv6/01-udp-local-multicast

slide-22
SLIDE 22

examples/zolertia/tutorial/02-ipv6/example.h

slide-23
SLIDE 23

examples/zolertia/tutorial/02-ipv6/01-udp-local-multicast

slide-24
SLIDE 24

examples/zolertia/tutorial/02-ipv6/01-udp-local-multicast

slide-25
SLIDE 25

examples/zolertia/tutorial/02-ipv6/01-udp-local-multicast

slide-26
SLIDE 26

examples/zolertia/tutorial/02-ipv6/01-udp-local-multicast

slide-27
SLIDE 27

examples/zolertia/tutorial/02-ipv6/01-udp-local-multicast

slide-28
SLIDE 28

examples/zolertia/tutorial/02-ipv6/01-udp-local-multicast

LQI 97-104 indicates a good demodulation RSSI close to -95dBm is the limit

slide-29
SLIDE 29

examples/zolertia/tutorial/02-ipv6/01-udp-local-multicast

slide-30
SLIDE 30

examples/zolertia/tutorial/02-ipv6/01-udp-local-multicast

How to improve

  • ve our
  • ur range:
  • Increase the transmission power
  • Use antennas with higher gain
  • Increase antenna’s height
  • Use directive antennas

Thumb-rule: every 6dB we double the range

Antena 2.4GHz 5dBi “whip”

Image from Rokland LLC

slide-31
SLIDE 31

examples/zolertia/tutorial/02-ipv6/03-sniffer + wireshark

slide-32
SLIDE 32

core/net/ipv6/sicslowpan.c

slide-33
SLIDE 33
slide-34
SLIDE 34

In a term rminal inal make sniffer.upload python sensniff.py --non-interactive -d /dev/ttyUSB0 -b 115200 In anothe

  • ther term

rmina inal sudo wireshark -i /tmp/sensniff

slide-35
SLIDE 35
slide-36
SLIDE 36
slide-37
SLIDE 37

examples/zolertia/tutorial/02-ipv6/02-border-router Border der Router er The node talks to the host through the USB, it receives a /64 prefix from tunslip6. The node handles all the processing and it is limited by its resources IEEE EE 802. 2.15. 5.4/ 4/6L 6LoWP

  • WPAN

AN Red inalámbrica 2.4GHz Tunne nnel inter erfac ace e – tun0 n0 The tunslip6 script creates a tunnel interface, forwards data from IPv6 to/from the 6LoWPAN network

A A node node as s Border er-Rout

  • uter

er

slide-38
SLIDE 38

examples/zolertia/tutorial/02-ipv6/02-border-router Slip Radio io The host controls the node through the USB, it sends commands to drive the radio Native ive Border der-Route

  • uter

The host acts as the router, it has more routing and processing capabilities

A A node node as s s slip-radi adio,

  • , nati

tive ve Border er-Rout uter er

IEEE EE 802. 2.15. 5.4/ 4/6L 6LoWP

  • WPAN

AN Red inalámbrica 2.4GHz

slide-39
SLIDE 39

examples/zolertia/tutorial/02-ipv6/02-border-router Ethe herne rnet t Borde der-Router

  • uter

It uses IP64 (NAT64 + DNS64), allows to communicate to IPv6/IPv4 without an external application

Node + Et Etherne rnet t (IP6 P64) 4)

IEEE EE 802. 2.15. 5.4/ 4/6L 6LoWP

  • WPAN

AN Red inalámbrica 2.4GHz

slide-40
SLIDE 40

examples/zolertia/tutorial/02-ipv6/02-border-router

slide-41
SLIDE 41

examples/zolertia/tutorial/02-ipv6/02-border-router

slide-42
SLIDE 42

examples/zolertia/tutorial/02-ipv6/02-border-router

slide-43
SLIDE 43
slide-44
SLIDE 44

UD UDP6 6 Se Serve ver r + + cl client ient

slide-45
SLIDE 45

examples/zolertia/tutorial/02-ipv6/03-client-and-server

We We need need th the follo lowing wing:

A A Border der Router er (running nning on

  • n a Z1 mote)

cd examples/zolertia/tutorial/02-ipv6/02-border-router make border-router.upload && make connect-router PREFIX=aaaa::1/64 An An UDP Client nt (running unning on

  • n a Z1 mote)

cd examples/zolertia/tutorial/02-ipv6/03-udp-client-and-server make 03-udp-client.upload MOTES=/dev/ttyUSB1 && make login MOTES=/dev/ttyUSB1 The UDP serve ver r (runn nning ing on

  • n the Raspb

pberr erry Pi) A Python script named “IFTTT_client.py” or “UDPServer.py” cd examples/zolertia/tutorial/02-ipv6/03-udp-client-and-server python UDPServer.py or alternatively Python IFTTT_client.py

  • Always make a “make motelist” to know what USB ports the Z1 motes are using, remember

to write down the Product ID numbers to help recognizing the devices! If you are unsure about what application is running in a Z1 mote, use “make login” with the MOTES argument and press the RESET button, it will show the name of the process running ;-)

slide-46
SLIDE 46

examples/zolertia/tutorial/02-ipv6/03-client-and-server 03 03-udp dp-cli lient nt Node ID: 0x4567 aaaa::c30c:0:0:4567 Receives the aaaa::/64 prefix from the Border Router when joining the DAG. Sends an UDP packet to aaaa::1 Border der Router er Node ID: 0x1234 aaaa::c30c:0:0:1234 Receives the prefix from tunslip6 (over the USB) when the tunnel “tun0” is created with tunslip6 Tunnel nnel interface “tun0” aaaa::1/64 Created when running the tunslip6 script in the host. Is a virtual tunnel interface, it sends the aaaa::/64 prefix to the Border Router. The Raspberry Pi will have a “tun0” interface with an aaaa::1/64 address

1 2 3

USB conne nnecti ction

  • n to

/dev/t /ttyU yUSB SB0 6LoWPAN Wireless network 2.4GHz When the UDP Server runs in the host, it will use the same address as the host, in this case the aaaa::1/64. 4 In the “contiki/tools” location, to create a tunnel type: sudo ./tunslip6 -s /dev/ttyUSB0 –t tun0 aaaa::1/64

slide-47
SLIDE 47

examples/zolertia/tutorial/02-ipv6/03-client-and-server UDPSer erve ver.py Publish the received data to a topic MQTT MQTT broker er iot.eclipse.org 03 03-udp dp-cli lient nt Sends temperature, acceleration and battery data to the UDP server Border der Router er IPv6/6LoWPAN Mqtt_c tt_client. lient.py Subscribed to the topic, when the UDPServer publishes something we received the message

slide-48
SLIDE 48

examples/zolertia/tutorial/02-ipv6/03-client-and-server core/net/ip/udp-socket.h

slide-49
SLIDE 49

examples/zolertia/tutorial/02-ipv6/03-client-and-server

slide-50
SLIDE 50

examples/zolertia/tutorial/02-ipv6/03-client-and-server

slide-51
SLIDE 51

examples/zolertia/tutorial/02-ipv6/03-client-and-server

slide-52
SLIDE 52

python UDPServer.py

examples/zolertia/tutorial/02-ipv6/03-client-and-server

slide-53
SLIDE 53

python mqtt_client.py

examples/zolertia/tutorial/02-ipv6/03-client-and-server This is the topic

slide-54
SLIDE 54

An Antonio

  • nio Li

Liñán án Colina lina

Twitter: @4Li6NaN LinkedIn: Antonio Liñan Colina github.com/alignan hackster.io/alinan

alinan@zolertia.com antonio.lignan@gmail.com