M 13lpn
M 13lpn
Raj Jain
Washington University in Saint Louis
Saint Louis, MO 63130
[email protected]
These slides and audio/video recordings of this class lecture are at:
http://www.cse.wustl.edu/~jain/cse570-15/
Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse570-15/ ©2015 Raj Jain
13-1
Overview
6LowPAN
Adaptation Layer
Address Formation
Compression
RPL
RPL Concepts
RPL Control Messages
RPL Data Forwarding
13-2
IoT Ecosystem
Applications Smart Health, Smart Home, Smart Grid Security Management
Smart Transport, Smart Workspaces, …
TCG, IEEE 1905,
Session MQTT, CoRE, DDS, AMQP , … Oath 2.0, IEEE 1451,
Routing 6LowPAN, RPL, 6Lo, 6tsch, Thread, SMACK, …
6-to-nonIP , … SASL,
ISASecure,
Datalink WiFi, Bluetooth Smart, Zigbee Smart, ace,
Z-Wave, DECT/ULE, 3G/LTE, NFC, CoAP,
Weightless, HomePlug GP, 802.11ah, DTLS,
802.15.4, G.9959, WirelessHART, Dice
DASH7, ANT+ , LoRaWAN, …
Software Mbed, Homekit, AllSeen, IoTvity,
ThingWorks, EVRYTHNG , …
Operating Systems Linux, Android, Contiki-OS, TinyOS, …
Hardware ARM, Arduino, Raspberry Pi, ARC-EM4,
Mote, Smart Dust, Tmote Sky, …
13-3
IEEE 802.15.4
Wireless Personal Area Network (WPAN)
Allows mesh networking.
Full function nodes can forward packets to other nodes.
A PAN coordinator (like WiFi Access Point) allows nodes to
join the network.
Nodes have 64-bit addresses
Coordinator assigns 16-bit short address for use during the
association
Maximum frame size is 127 bytes
More details in CSE 574 wireless networking course
http://www.cse.wustl.edu/~jain/cse574-14/index.html
13-4
EUI64 Addresses
Ethernet addresses: 48 bit MAC
Unicast Universal Organizationally Manufacturer
Multicast Local Unique ID (OUI) Assigned
1b 1b 22b 24b
13-5
6LowPAN
IPv6 over Low Power Wireless Personal Area Networks
How to transmit IPv6 datagrams (elephants)
over low power IoT devices (mice)?
Issues:
1. IPv6 address formation: 128-bit IPv6 from 64-bit EUI64
2. Maximum Transmission Unit (MTU): IPv6 at least 1280
bytes vs. IEEE 802.15.4 standard packet size is 127 bytes
802.15.4 Header Security Option Payload
25B 21B 81B
3. Address Resolution: 128b or 16B IPv6 addresses. 802.15.4
devices use 64 bit (no network prefix) or 16 bit addresses
4. Optional mesh routing in datalink layer
Need destination and intermediate addresses.
Ref: G. Montenegro, et al., “Transmission of IPv6 Packets over IEEE 802.15.4 Networks,” RFC 4944, Sep 2007, http://tools.ietf.org/pdf/rfc4944
Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse570-15/ ©2015 Raj Jain
13-6
6LowPAN Adaptation Layer
5. MAC-level retransmissions versus end-to-end:
Optional hop-by-hop ack feature of 802.15.4 is used but
the max number of retransmissions is kept low (to avoid
overlapping L2 and L4 retransmissions)
6. Extension Headers: 8b or less Shannon-coded dispatch
header type
102: Mesh addressing header (2-bit dispatch)
11x002: Destination Processing Fragment header (5-bit)
010100002: Hop-by-hop LowPAN Broadcast header (8-
bit)
7. IPv6 and UDP header compression
Frame Seq. Adrs [Security] Disp Ext Disp Ext Disp Ext IPv6
Control # bits Hdr bits Hdr bits Hdr Payload
2B 1B 0-20B 0-21B
Ref: O. Hersent, et al., “The Internet of Things: Key Applications and Protocols,” Wiley, 2013, 344 pp., ISBN: 9781119994350 (Safari Book)
Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse570-15/ ©2015 Raj Jain
13-7
IPv6 Address Formation
Link-Local IPv6 address = FE80::U-bit formatted EUI64
Example:
EUI64 Local Address = 40::1 = 0100 0000::0000 0001
U-bit formatted EUI64 = 0::1
IPv6 Link-local address = FE80::1 = 1111 1110 1000
0000::1
IEEE 802.15.4 allows nodes to have 16-bit short addresses
and each PAN has a 16-bit PAN ID.
1st bit of Short address and PAN ID is Unicast/Multicast
The 2nd bit of Short Address and PAN ID is Local/Universal.
You can broadcast to all members of a PAN or to all PANs.
IPv6 Link Local Address = FE80 :: PAN ID : Short Address
Use 0 if PAN ID is unknown.
2nd bit of PAN ID should always be zero since it is always
local. 2nd most significant = 6th bit from right)
Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse570-15/ ©2015 Raj Jain
13-8
Homework 13A
What is the IPv6 Link-Local address for a IEEE 802.15.4 node whose
EUI64 address in hex is 0000::0002. Indicate your final answer in hex
without using ::
EUI64 in Binary =
U-bit EUI64 Binary =
U-bit EUI64 Hex =
IPv6 Link Local Address =
13-9
Mesh Addressing Header
Dispatch = 102 (2 bits) Mesh Addressing Header
MAC header contains per-hop source and destination
Original source and destination addresses are saved in Mesh
addressing header
A 4-bit hops-left field is decremented at each hop
Originator P1 P2 P3 Final
13-10
6LowPAN Broadcast Header
For Mesh broadcast/multicast
A new sequence number is put in every broadcast message by
the originator
Dispatch Sequence
010100002 Number
8b 8b
13-11
6LowPAN Fragment Header
Dispatch = 11x00 (5 bits) Fragment Header
Full packet size in the first fragment’s fragment header
Datagram tag = sequence number
Fragments of the same packet
Fragment Offset in multiples of 8 bytes
Other Fragments: 11100 IP Pkt Size Datagram tag Datagram Offset Payload
5b 11b 16b 8b
13-12
IP+UDP Header Compression: Stateless
Called HC1-HC2 compression (not recommended)
IP version field is omitted
Flow label field if zero is omitted and C=1
Only 4b UDP ports are sent if between 61616-61631 (F0Bx)
UDP length field is omitted. IP addresses are compressed.
HC1 Header HC2 Header
Dispatch SA DA C NH 0 S D L Uncompressed
01000010 Encoding Encoding Fields
UDP Length omitted
UDP Dest Port 61616-61631
Prefix IID UDP Src Port 61616-61631
00 Uncompressed Uncompressed 00 Next Hdr inline
01 Uncompressed Derived from L2 01 Next Hdr= 17 (UDP)
10 FE80::/80 omitted Uncompressed 10 Next Hdr = 1 (ICMP)
11 FE80::/64 omitted Derived from L2 11 Next Hdr = 6 (TCP)
Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse570-15/ ©2015 Raj Jain
13-13
Context Based Compression
HC1 works only with link-local addresses
Need globally routable IPv6 addresses for outside nodes
IPHC uses a 3b dispatch code and a 13-bit base header
Disp TF NH Hop CID SAC SAM M DAC DAM SCI DCI Uncompressed
011 Limit IPv6 fields
3b 2b 1b 2b 1b
2b 1b 1b1b 2b 4b 4b
Source Adr Mode Source/Dest Context IDs if CID=1
Traffic Next Header Source Adr Compression Multicast Destination
Class, uses Predefined hop limit = SAC SAM Address
Flow LowPAN_NHC uncompressed (00),
DAC DAM
Label 1, 64, 255 0 00 No compression
00 ECN+DSCP+4b pad+ 0 01 First 64-bits omitted
20b Flow label (4 Bytes) 0 10 First 112 bits omitted
01 ECN +2b pad + 12b Flow 0 11 128 bits omitted. Get from L2
label (2 Bytes), DSCP omitted 1 00 Unspecified Address ::
10 ECN+DSCP (1B), Flow label omitted 1 01 First 64 bits from context
1 10 First 112 bits from context
11 ECN+DSCP+Flow label omitted
1 11 128 bits from context and L2
Ref: O. Hersent, et al., “The Internet of Things: Key Applications and Protocols,” Wiley, 2013, 344 pp., ISBN: 9781119994350 (Safari Book)
Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse570-15/ ©2015 Raj Jain
13-14
Context Based Compression (Cont)
If the next header uses LowPAN_NHC
For IPv6 base extension headers:
13-15
6LowPAN: Summary
3 New Headers:
Mesh addressing: Intermediate addresses
13-16
Routing Protocol for Low-Power and Lossy
Networks (RPL)
Developed by IETF Routing over Low-Power and Lossy
Networks (ROLL) working group
Low-Power and Lossy Networks (LLN) Routers have
constraints on processing, memory, and energy.
Can’t use OSPF, OLSR, RIP, AODV, DSR, etc
LLN links have high loss rate, low data rates, and instability
expensive bits, dynamically formed topology
Covers both wireless and wired networks
Requires bidirectional links. May be symmetric/asymmetric.
Ideal for n-to-1 (data sink) communications,
e.g., meter reading
1-to-n and 1-to-1 possible with some extra work.
Multiple LLN instances on the same physical networks
Ref: T. Winder, Ed., et al., "RPL: IPv6 Routing Protocol for Low-Power and Lossy Networks," IETF RFC 6550, Mar 2012,
https://ietf.org/doc/rfc6550/
Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse570-15/ ©2015 Raj Jain
13-17
RPL Concepts
Directed Acyclic Graph (DAG): No cycles DAG
Root: No outgoing edge
Destination-Oriented DAG (DODAG): Single
root
Up: Towards root
Down: Away from root
Objective Function: Minimize energy, latency, … DODAG
Rank: Distance from root using specified objective Root
RPL Instance: One or more DODAGs. Rank=1
A node may belong to multiple RPL instances.Rank=2
Up
DODAG ID: IPv6 Adr of the root
DODAG Version: Current version of the One RPL
Instance
DODAG. Every time a new DODAG is
computed with the same root, its version
incremented.
Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse570-15/ ©2015 Raj Jain
13-18
RPL Concepts (Cont)
Goal: Reachability goal, e.g., connected to
database
Grounded: Root can satisfy the goal
Floating: Not grounded. Only in-DODAG
communication.
Parent: Immediate successor towards the root
Sub-DODAG: Sub tree rooted at this node
Storing: Nodes keep routing tables for sub-
DODAG
Non-Storing: Nodes know only parent.
Do not keep a routing table.
13-19
RPL Control Messages
1. DODAG Information Object (DIO):
Downward RPL instance multicasts
Allows other nodes to discover an RPL
instance and join it
DIS
2. DODAG Information Solicitation (DIS):
New
Link-Local multicast request for DIO
(neighbor discovery).
Do you know of any DODAGs? New Old
3. Destination Advertisement Object (DAO):
DIS
From child to parents or root.
DIO
Can I join you as a child on DODAG #x?
DAO
4. DAO Ack: Yes, you can! Or Sorry, you cant!
DAO-Ack
5. Consistency Check: Challenge/response
messages for security
Ref: S. Kuryla, “RPL:IPv6 Routing Protocol for Low Power and Lossy Networks,”
http://cnds.eecs.jacobs-university.de/courses/nds-2010/kuryla-rpl.pdf
Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse570-15/ ©2015 Raj Jain
13-20
DODAG Formation Example
1. A multicasts DIOs that it’s member of 1 1 A A 3
1
DODAG ID itself with Rank 0. B 3 4 C B DAO C
DIO
2. B, C, D, E hear and determine that D E D E
their rank (distance) is 1, 1, 3, 4,
respectively from A
4 A A
3. B, C, D, E send DAOs to A.
B C B C
4. A accepts all DAO-Ack Rank 1 Rank 1
E E
5. B and C multicast DIOs D D
Rank 3 Rank 4
6. D hears those and determines that its A A
distance from B and C is 1, 2 5 8
B C B C
7. E hears both B, C and determines that DIO DAO
E DAO
1 1
its distance from B and C is 2, 1 D
2 E D
8. D sends a DAO to B 9 A A
E sends a DAO to C
B C B C
9. B sends a DAO-Ack to D DAO-Ack
C sends a DAO-Ack to E D E D E
Rank 2 Rank 2
Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse570-15/ ©2015 Raj Jain
13-21
RPL Data Forwarding
Case 1: To the root (n-to-1)
Address to root and give to parent R
Case 2: A to B C D
2A: Storing (Everyone keeps a routing table)
A B E
Forward up from A to common parent
13-22
Homework 13B
A. Which of the following is not a DODAG and why?
B. What is the direction of Link A? (Up or Down):
C. Assuming each link has a distance of 1, what is the rank of
node B?
D. Show the paths from B to C if the DODAG is non-storing.
E. Show the paths from D to E if the DODAG is storing.
D E
B
C
13-23
RPL Summary
13-24
Summary
13-25
Reading List
O. Hersent, et al., “The Internet of Things: Key Applications and
Protocols,” Wiley, 2013, 344 pp., ISBN: 9781119994350 (Safari Book)
G. Montenegro, et al., “Transmission of IPv6 Packets over IEEE 802.15.4
Networks,” RFC 4944, Sep 2007, http://tools.ietf.org/pdf/rfc4944
J. Hui and P. Thubert, “Compression Format for IPv6 Datagrams over IEEE
802.15.4-Based Networks,” IETF RFC 6282, Sep 2011,
http://tools.ietf.org/pdf/rfc6282
T. Winder, Ed., et al., "RPL: IPv6 Routing Protocol for Low-Power and
Lossy Networks," IETF RFC 6550, Mar 2012,
https://ietf.org/doc/rfc6550/
S. Kuryla, “RPL: IPv6 Routing Protocol for Low Power and Lossy
Networks,”
http://cnds.eecs.jacobs-university.de/courses/nds-2010/kuryla-rpl.pdf
13-26
Wikipedia Links
http://en.wikipedia.org/wiki/6LoWPAN
http://en.wikipedia.org/wiki/IEEE_802.15.4
http://en.wikipedia.org/wiki/MAC_address
http://en.wikipedia.org/wiki/IPv6
http://en.wikipedia.org/wiki/IPv6_address
http://en.wikipedia.org/wiki/Organizationally_unique_identifier
http://en.wikipedia.org/wiki/IPv6_packet
http://en.wikipedia.org/wiki/Link-local_address
13-27
References
N. Kushalnagar, et al., "IPv6 over Low-Power Wireless Personal Area
Networks (6LoWPANs): Overview, Assumptions, Problem Statement, and
Goals", IETF RFC 4919, Aug 2007, http://www.rfc-
editor.org/rfc/pdfrfc/rfc4919.txt.pdf
E. Kim, et al., "Design and Application Spaces for IPv6 over Low-Power
Wireless Personal Area Networks (6LoWPANs)," IETF RFC 6568, Apr
2012, http://www.rfc-editor.org/rfc/pdfrfc/rfc6568.txt.pdf
E. Kim, et al., "Problem Statement and Requirements for IPv6 over Low-
Power Wireless Personal Area Network (6LoWPAN) Routing," IETF RFC
6606, May 2012, http://www.rfc-editor.org/rfc/pdfrfc/rfc6606.txt.pdf
Z. Shelby, et al., "Neighbor Discovery Optimization for IPv6 over Low-
Power Wireless Personal Area Networks (6LoWPANs), IETF RFC 6775,
Nov. 2012, http://www.rfc-editor.org/rfc/pdfrfc/rfc6775.txt.pdf
13-28
References (Cont)
"Routing Requirements for Urban Low-Power and Lossy Networks," IETF
RFC 5548, May 2009, https://ietf.org/doc/rfc5548/
"Industrial Routing Requirements in Low-Power and Lossy Networks,"
IETF RFC 5673, Oct 2009, https://ietf.org/doc/rfc5673/
"Home Automation Routing Requirements in Low-Power and Lossy
Networks," IETF RFC 5826, Apr 2010, https://ietf.org/doc/rfc5826/
"Building Automation Routing Requirements in Low-Power and Lossy
Networks," IETF RFC 5867, Jun 2010, https://ietf.org/doc/rfc5867/
"The Trickle Algorithm," IETF RFC 6206, Mar 2011,
https://ietf.org/doc/rfc6206/
"RPL: IPv6 Routing Protocol for Low-Power and Lossy Networks," IETF
RFC 6550, Mar 2012, https://ietf.org/doc/rfc6550/
"Routing Metrics Used for Path Calculation in Low-Power and Lossy
Networks," IETF RFC 6551, Mar 2012, https://ietf.org/doc/rfc6551/
"Objective Function Zero for the Routing Protocol for Low-Power and
Lossy Networks (RPL)," IETF RFC 6552, Mar 2012,
https://ietf.org/doc/rfc6552/
13-29
References (Cont)
"The Minimum Rank with Hysteresis Objective Function," IETF RFC 6719,
Sep 2012, https://ietf.org/doc/rfc6719/
"Reactive Discovery of Point-to-Point Routes in Low-Power and Lossy
Networks," IETF RFC 6997, Aug 2013, https://ietf.org/doc/rfc6997/
"A Mechanism to Measure the Routing Metrics along a Point-to-Point
Route in a Low-Power and Lossy Network," IETF RFC 6998, Aug 2013,
https://ietf.org/doc/rfc6998/
13-30
Acronyms
6LowPAN IPv6 over Low Power Wireless Personal Area Network
AODV Ad-hoc On-demand Distance Vector
AQMP Advanced Queueing Message Protcol
ARC-EM4 Name of a product
ARM Acorn RISC Machine
CC Consistency Check
CID Context ID
CoAP Constrained Application Protocol
CoRE Constrained Restful Environment
DA Destination Address
DAC Destination Address Compression
DAG Directed Acyclic Graph
DAM Destination Address Mode
DAO DODAG Advertisement Object
DCI Destination Context ID
DDS Data Distribution Service
Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse570-15/ ©2015 Raj Jain
13-31
Acronyms (Cont)
DECT Digital Enhanced Cordless Communication
DIO DODAG Information Object
DIS DODAG Information Solicitation
DODAG Destination Oriented Directed Acyclic Graph
DSCP Differentiated Services Control Point
DSR Dynamic Source Routing
DTLS Datagram Transport Level Security
ECN Explicit Congestion Notification
EID IPv6 Extension Header ID
EUI Extended Unique Id
GP GreenPHY
HC Header Compression
HC1-HC2 Header Compression 1 and Header Compression 2
ICMP IP Control Message Protocol
ID Identifier
IEEE Institution of Electrical and Electronic Engineers
Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse570-15/ ©2015 Raj Jain
13-32
Acronyms (Cont)
IETF Internet Engineering Task Force
IID Interface Identifier
IoT Internet of Things
IP Internet Protocol
IPHC IP Header Compression
IPv6 Internet Protocol Version 6
ISASecure Security certification by
LLN Low-Power and Lossy Networks
LoRaWAN Long Range Wide Area Network
LTE Long-Term Evolution
MAC Media Access Control
MTU Maximum Transmission Unit
NFC Near Field Communication
NH Next Header
NHC Next Header Compression
OLSR On-Demand Link State Routing
Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse570-15/ ©2015 Raj Jain
13-33
Acronyms (Cont)
OSPF Open Shortest Path Forwarding
PAN Personal Area Network
RFC Request for Comments
RIP Routing Information Protocol
ROLL Routing over Low-Power and Lossy Networks
RPL Routing Protocol for Low-Power and Lossy Networks
SA Source Address
SAC Source Address Compression
SAM Source Address Mode
SASL Simple Authentication and Security Layer
SCI Source Context ID
SMACK Simplified Mandatory Access Control Kernel
TCG Trusted Computing Group
TCP Transmission Control Protocol
TF Traffic Class, Flow Label
TinyOS Tiny Operating System
Washington University in St. Louis http://www.cse.wustl.edu/~jain/cse570-15/ ©2015 Raj Jain
13-34
Acronyms (Cont)
UDP User Datagram Protocol
ULE Ultra Low Energy
WiFi Wireless Fidelity
WirelessHART Wireless Highway Addressable Remote Transducer
Protocol
WPAN Wireless Personal Area Network
13-35