wireless sensor networks (wsns) - uni-bremen.de · 5 comnets fringe internet (billion nodes) wsns /...
TRANSCRIPT
ComNets
Dr. Ing. Koojana Kuladinithi
ComNets, TZI, University of Bremen
Wireless Sensor Networks (WSNs)
ComNets 2
IETF Standards for WSNs
Module 10: IP Adaptation Layer 6LOWPAN (IPv6 over Low power WPAN)
Module 11: IP routing RPL (Routing Over Low power and Lossy networks)
Module 12: Application Protocol CoAP (Constrained Application Protocol)
TCP/IP Protocol Stack IP based WSN Protocol Stack
ComNets 3
Module 10: IP Adaptation Layer
Introduction to WSNs (Wireless Sensor Networks)
IPv6 Protocol
6LoWPAN Adaptation Layer Header compression
Optimized neighbor discovery protocols
Fragmentation
ComNets 4
Introduction to WSN
Sensor Node Limited in energy, computational power, storage capacity, transmission range & data
rate
TelosB
UC Berkeley:
Smart Dust
TelosB mote: MSP430 microcontroller with 10kB RAM
16-bit RISC with 48K Program Flash
IEEE 802.15.4 compliant radio (< 250 kbps)
1MB external data flash
Runs TinyOS 1.1.10 or higher
Two AA batteries/USB
1.8 mA (active); 5.1uA (sleep)
WSN: Wireless Sensor Networks A collection of embedded tiny devices (sensors) with networking capabilities
Temperature, humidity, pressure, light, orientation, vibration, gas, etc
ComNets 5
Fringe Internet
(Billion nodes)
WSNs / Wireless Embedded Internet
Using the Internet in very low power devices Consists of embedded, low power devices connected to the Internet (sensors, machines, RFIDs, etc)
Also called as embedded fringe/ Internet of Things (IoT)
Core Internet
(Million nodes)
Image Source: http://6lowpan.net/the-book/
ComNets 7
A Single Node vs Wireless Sensor Network
Extended range of sensing: Cover a wider area
Extended functionality: Sensor nodes can not only perform sensing functionality, but also provide
forwarding service
Redundancy: Multiple nodes close to each other increase fault tolerance
ComNets 8
WSN Applications
Home and building automation The use of sensors and control to improve the operations and efficiency of a
building
Industrial automation
Real time environmental monitoring and forecasting
Logistic - http://intelligentcontainer.com/
Tracking Use of active tags on people, equipment and supplies. Tracking results are used
in asset management
Smart metering The use of electricity, gas, water can be reduced and better controlled through
more intelligent metering (use of intelligent lighting control, HVAC – heating , ventilation and air conditioning control)
ComNets 9
Evolution of Wireless Sensor Networks
Image Source: http://6lowpan.net/the-book/
Scalability Price
Cabling
Cables
Proprietary radio + network
2000 1980s 2006
Vendor lock-in
Increased Productivity
ZigBee
Complex middleware
6lowpan Internet
Open development and portability
Z-Wave, prop. ISM etc.
ZigBee and WHART
Any vendor 6lowpan ISA100
2008 ->
ComNets 10
Relationship of Standards
Image Source: http://6lowpan.net/the-book/
IPSO: IP for Smart Object
OGC: Open Geospatial Consortium
ETSI: European Telecommunications Standards Institute
ISA: Industrial Standardisation for Automation
IETF: Internet Engineering Task Force
CORE: Constrained RESTful Environments
ROLL: Routing Over Low power Lossy networks
6LOWPAN: IPv6 over Lower power Wireless PAN
ComNets 11
Why IP based ?
Allows the use of existing network infrastructure: IP based devices can be connected
easily to other IP networks
IP-based technologies have existed for decades (very well known, have been proven to work and scale)
IP technology is specified in an open and free way
Tools for managing, commissioning and diagnosing already exist
Issues
Bandwidth and frame size (e.g. IPv6 frame size 1280 bytes, IEEE 802.15.4 frame size 127 bytes)
- Web services (HTTP, SOAP & XML)
Power and duty cycle - assumption of IP is that a device is always connected
Reliability - e.g. TCP is not able to differentiate between packets dropped because of congestion or a packets
lost on wireless links)
Routing - IP routing is designed for a single broadcast domain. Not work in a mesh of short-range connections
ComNets 13
IPv4 vs IPv6 Addressing
Image source: Indeterminant (Wikipeida)
128-bit IPv6 address = 64-bit prefix + 64-bit Interface ID (IID)
128-bit IPv6 address : each 16 bit values (four hex digits) separated by colons, one sequence of all-zero 16-
bit values can be replaced by a double colon indicating a longer sequence of zeros
ComNets 14
IPv6 Address Configuration
64-bit network Prefix 64-bit Suffix / Interface Identifier (IID)
EUI 64-bit
IEEE 15.4 short addresses
Stateless Address Auto Configuration
Stateful Address Configuration
DHCPv6
ComNets 15
IPv6 Address: 64 bit IID
64-bit IEEE EUI-64 bit (Extended Unique Identifier)
24-bit OUI (Organizationally Unique Identifier)
40-bit of extension identifier decided by the manufacturer 0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OUI |L|M| OUI (Cont.) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Extension identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Example: MAC address: 00:1D:BA:06:37:64 converts to 64-bit IID IID: 00:1D:BA:FF:FE:06:37:64 - Based on MAC address
Network Prefix: 2001:db8:1:2::/64
Full IPv6 Address : 2001:db8:1:2:021D:BAFF:FE06:3764
Only L bit was set – Universally assigned
M bit was not set – Unicast address
Appendix A RFC 4291: IP Version 6 Addressing Architecture
ComNets 16
IPv6 Address: 64 bit IID, Cont.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| PAN ID |0| PAN ID (cont) | 0 | 0 | F | F |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| F | E | 0 | 0 | 16 bit short address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
64-bit IID based on 15.4 short address
ComNets 17
IPv6 Addresses in Hexadecimal Notation
Long form Abbreviated form Explanation
2001:DB8:0.0:8:800:200C.417A 2001:DB8::8:800:200C:417A A unicast address
FF01:0:0:0:0:0:0:101 FF01::101 A multicast address
0:0:0:0:0:0:0:1 ::1 Loopback address
FE80:0:0:0: FE80:: A Link Local address
ComNets 18
IPv6 Neighbor Discovery
RFC 4861 ND: How hosts and routers interact with each other on the same link
IPv6 is the format - ND is the brain
“One-hop routing protocol”
defined in RFC4861
Finding Routers
Router Solicitation / Router Advertisement
Finding Neighbors
Neighbor Solicitation / Neighbor Acknowledgement
Detecting Duplicate Addresses using NS/NA
Address resolution using NS/NA
Neighbor Unreachability Detection using NS/NA
Image Source: http://6lowpan.net/the-book/
ND: Neighbor Discovery NS: Neighbor Solicitation
NA: Neighbor Advertisement DAD: Duplicate Address Detection
ComNets 19
IPv6 Header
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Traffic Class | Flow Label |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Payload Length | Next Header | Hop Limit |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Source Address +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Destination Address +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The extension header mechanism provides extensibility to support future services for
security, mobility, and others, without redesign of the basic protocol
6 bits: DSCP (Differentiated Services Control Point),
group traffic to different classes
2 bits: Explicit Congestion Notification (ECN) RFC3168
The packet header in IPv6 is simpler than that used in IPv4. IPv6 routers do not perform
fragmentation
The IPv6 header is not protected by a checksum.
IPv6 routers do not need to recompute a checksum when header fields (such as the hop limit change)
The TTL field of IPv4 has been renamed to Hop Limit
ComNets 21
802.15.4 MAC Frame
127 bytes MAX
FC
DS
N
DS
TP
AN
DS
T
SR
CP
AN
MA
C
Payl
oad
FC
S
SR
C
Security
Num of bytes: 2 1 0/2 2/8 0/2 2/8 0/5/6/10/14 variable 2
FC
DS
N
DS
TP
AN
DS
T
MA
C
Payl
oad
FC
S
SR
C
802.15.4 MAC frame with 64 bit addresses (without any security option)
21 B
104 bytes
2 B
ComNets 22
IP over 802.15.4
Header overhead Standard IPv6 header is 40 bytes [RFC 2460]
Entire 802.15.4 MTU is 127 bytes
Fragmentation IPv6 requires all links support 1280 byte packets [RFC 2460] – Min. MTU of IPv6 is 1280
bytes
A full IPv6 packet does not fit into 802.15.4 frame size
Application payload Transport header
net payload IP header
link payload MAC header FCS
40 B + options
1280 Bytes
127 Bytes MAX ?
ComNets 23
What is 6LoWPAN?
6LoWPAN : IPv6 over Low-power Wireless Personal Area Networks
Defined by IETF standards (draft-ietf-6lowpan-hc)
RFC 4944
RFC 6282
Header compression Stateless
Context based
Neighbor discovery draft-ietf-6lowpan-nd (RFC 6775)
Minimal use of code and memory
Direct end-to-end Internet integration
IPv6
Image Source: http://6lowpan.net/the-book/
ComNets 24
Protocol Stack
Image Source: http://6lowpan.net/the-book/
Low power wireless technologies
ComNets 25
6LoWPAN Architecture
LoWPANs are stub networks Nodes (Host/Router)
Simple LoWPAN A collection of nodes which shares a
common IPv6 address prefix
Single Edge Router (handles compressions & ND, IPv4 interconnectivity)
Extended LoWPAN Multiple Edge Routers with common
backbone link
Ad-hoc LoWPAN Not connected to the Internet
Image Source: http://6lowpan.net/the-book/
ND: Neighbor Discovery R: Routers, H: Host
ComNets 26
WSNs: Addressing
IPv6 addresses are typically formed using Network Prefix: Prefix of the LoWPAN
IID: Link Layer address of the wireless interface (64bit EUI / 16 bit short address)
Flat LL addressing for all the devices Support unique long addresses (EUI-64)
Configurable short addresses (usually 8-16 bits in length)
Also support broadcast (0xFFFF in IEEE 802.15.4), but do not support native multicast
ComNets 27
Addressing : Example 6LoWPAN
Assumption: LoWPAN uses IEEE 802.15.4 and IP routing
Edge Router
Configures IPv6 prefix to its 802.15.4 wireless interface (2001:300a:1::/48)
Advertizes IPv6 prefix to nodes in the LoWPAN
LoWPAN node IPv6 address with a 64-bit IID
Receives generated IPv6 address with a 16 bit IID (HOST :: 1 -> 2001:300a:1::1)
Routing Packets sent within LoWPAN do not require to
have IPv6 network prefix inline
Packets destined outside LoWPAN -> require to have IPv6 address inline
Image Source: http://6lowpan.net/the-book/
ComNets 28
6LoWPAN: IP Header Compression
net payload
8 B
Src IP Dest IP V|TC| FL|L|NH|HL
16 B 16 B
Link Packet
2 Bytes of 6LoWPAN adaptation headers ( dispatch + HC1)
3 B
net payload DST SRC FCS SN
FC HL
Eliminate all fields in the IPv6 header that can be derived from the 802.15.4 header Version (V) : always v6 and no need to be sent
Traffic Class (TC) & Flow Label (FL) : zero
Length (L) : derived from link frame length
Next Header (NH) : UDP, TCP, or ICMP
Source address (Src IP) : derived from link address
Destination address (Dest IP) : derived from link address
Network IP Packet
PAN
ComNets 29
Compressed IPv6 Header
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Traffic Class | Flow Label |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Payload Length | Next Header | Hop Limit |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Source Address +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ +
| |
+ Destination Address +
| |
+ +
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
derive from 802.15.4 header
derive from 802.15.4 header
v6 zeros
In 802.15.4 header
Uncompressed
IPv6 address Interface identifier generated from EUID64 or Pan ID & short address
Hop Limit is the only incompressible IPv6 header field
ComNets 30
LoWPAN Dispatch Header
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Typ| Value | type-specific header
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Dispatch
00 Not a LoWPAN headdr
01 LoWPAN IPv6 addressing header
10 LoWPAN Mesh header
11 LoWPAN Fragmentation Header
000001 – IPv6 Uncompressed IPv6 Addresses
000010 - LOWPAN_HC1 - LOWPAN_HC1 compressed IPv6
-----
010000 - LOWPAN_BC0 - LOWPAN_BC0 broadcast
-------
Dispatch : To understand what is coming
How it is compressed: HC1, HC2…
ComNets 31
HC1 : Stateless Header Compression
C NH
Source Address Encoding
0 15 HC1
Zero or more uncompressed fields follow in order
Additional HC2 compression header follows
00 Prefix sent in-line, IID sent in-line
01 Prefix sent in-line, IID derived from L2
10 Prefix = link local, IID sent in-line
11 Prefix = link local, IID derived from L2 Destination Address Encoding
Traffic and Flow Label zero (compressed)
Next Header Field
00 uncompressed, 01 UDP, 10 TCP, 11 ICMP
01000010 7
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Typ| Value | type-specific header
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Dispatch
LOWPAN_HC1
compressed IPv6
DAE SAE
ComNets 32
HC2: Stateless Header Compression
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Port | Destination Port |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Length | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| UDP Payload ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
UDP Port numbers : 61616 – 61631
UDP: HC2 - 8 bytes header is compressed to 3 bytes source port = P + 4 bits, where p = 61616 (0xF0B0)
destination port = P + 4 bits
Length = (Payload of IPv6 header - length of any extension headers present between the IPv6 header and the UDP header)
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|S_Port | D_Port| Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
ComNets 33
HC2 : Stateless Header Compression
C NH
Source Port is compressed
0 15
HC1
uncompressed fields follow in order 01000010 7
DAE SAE S D L
HC2 Dispatch (LowPAN IPv6 – HC1)
Destination Port is compressed
Length is compressed
3 bytes of 6LoWPAN Adaptation Headers
ComNets 34
6LoWPAN Headers
Full IPv6 Packet over 802.15.4 with 64bit addressing
21 B 2 B 40 B 8 B 55 B
FC
DS
N
DS
TP
AN
DS
T
net
Payl
oad
FC
S
SR
C
IPv6
UD
P
Dis
patc
h
1 B
FC
DS
N
DS
TP
AN
DS
T
net
Payl
oad
FC
S
SR
C
Dis
patc
h
HC
1
HC
2
IPv6
UD
P
21 B 2 B
1B
97 B 3 B
3B
7 B
Compressed IPv6 Packet over 802.15.4 with 64bit addressing
ComNets 35
Best-case HC1/HC2 compressed IPv6 Packet
Dispatch HC1 header HC2 header
| LOWPAN_HC1 |SAE|DAE|C|NH |1|S|D|L|---------| Non Compre. data
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0 1 0 0 0 0 1 0|1 1|1 1|1|0 1|1|1|1|1|---------| Hop Limit |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|S_Port | D_Port| Checksum | UDP Data ….
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
ComNets 36
Is Stateless Header Compression Enough?
Stateless header compression for IPv6 packets (LOWPAN_HC1 & LOWPAN_HC2) -> reduce relatively large IPv6 and UDP headers down to few bytes Most effective for link local unicast communication
Limitations of HC1 & HC2 Link local communications are mainly used for local protocols (neigbor discovery,
DHCPv6, etc) within a LoWPAN network. Application layer protocols use global IPv6 addresses
- HC1 should carry 64 bit prefix when using global addresses
- HC1 should carry 128 bits address when using multicast communication
- IPv6 next headers cannot be encoded efficiently
ComNets 37
Context-based Header Compression
Enhancements to HC1 & HC2 Hop limit (either 1 or 64)
Compression of IPv6 next header fields (LOWPAN_NHC), e.g. IPv6-in-IPv6 tunneling
Compression of UDP checksum
Compression Format for IPv6 Datagrams in Low Power and Lossy Networks(6LoWPAN) – RFC6282 Enables compression of global addresses
Adds an additional context, when joining the LoWPAN. Context should be synchronized between compressor and decompressor
ComNets 38
6LoWPAN IPHC Base Encoding
TF: Traffic Class, Flow Label:
00: ECN + DSCP + 4-bit Pad + Flow Label (4 bytes)
01: ECN + 2-bit Pad + Flow Label (3 bytes), DSCP is elided
10: ECN + DSCP (1 byte), Flow Label is elided
11: Traffic Class and Flow Label are elided.
0 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| 0 | 1 | 1 | TF |NH | HLIM |CID|SAC| SAM | M |DAC| DAM |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
IPHC base header
NH: Next Header:
0: Full 8 bits for Next Header are carried in-line.
1: The Next Header field is compressed and the next header is encoded using LOWPAN_NHC
HLIM: Hop Limit: 00: The Hop Limit field is carried in-line. 01: The Hop Limit field is compressed and the hop limit is 1. 10: The Hop Limit field is compressed and the hop limit is 64. 11: The Hop Limit field is compressed and the hop limit is 255.
CID: Context Identifier Extension: 0: No additional 8-bit Context Identifier Extension is used. If context-based compression is specified in either SAC or DAC, context 0 is used. 1: An additional 8-bit Context Identifier Extension field immediately follows the DAM field.
SAC: Source Address Compression 0: Source address compression uses stateless compression. 1: Source address compression uses stateful, context-based compression.
ComNets 39
6LoWPAN IPHC Base Encoding : TF Field
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|ECN| DSCP | - | Flow Label |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|ECN| | Flow Label |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
|ECN| DSCP | |
+-+-+-+-+-+-+-+-+
TF = 00
TF = 01
TF = 10
TF = 11 No bits
TF: Traffic Class, Flow Label:
00: ECN + DSCP + 4-bit Pad + Flow Label (4 bytes)
01: ECN + 2-bit Pad + Flow Label (3 bytes), DSCP is elided
10: ECN + DSCP (1 byte), Flow Label is elided
11: Traffic Class and Flow Label are elided.
ComNets 40
SAC/SAM values in 6LoWPAN IPHC
SAC SAM Inline bits
0 00 128 Full address (inline), no compression
0 01 64 First 64 bit is elided (FE80:0:0:0:xxxx:xxxx:xxxx:xxxx)
0 10 16 First 112 bit are elided (FE80:0:0:0:0000:00FF:FE00:XXXX)
0 11 0 128 bit are elided (LL address is derived from MAC header)
1 00 - Unspecified address
1 01 64 64 bit network prefix from the context + 64bit IID sent inline
1 10 16 112 bit from the context + 16 bit short address sent inline
1 11 0 128 bit address from the context
SAC: Source Address Compression, SAM: Source Address Mode:
DAC (Destination Address Compression) and DAM (Destination Address Mode) operations also similar:
ComNets 41
Exchanage of Context Information
6LoWPAN Context Option (6CO) defined in RFC 6775
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length |Context Length | Res |C| CID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reserved | Valid Lifetime |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. .
. Context Prefix .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
6LoWPAN Context Identifier Option (CID) defined in RFC 6775
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0|1|1|TF |N| HL|C|S|SAM|M|D|DAM| SCI | DCI | ..net. headers
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
CID Extension
IPHC base header
ComNets 43
IPv6 Neighbor Discovery
Image Source: http://6lowpan.net/the-book/
ND: Neighbor Discovery NS: Neighbor Solicitation
NA: Neighbor Advertisement DAD: Duplicate Address Detection
Standard ND for IPv6 (RFC 4861 ND) assumes:
A single link for an IPv6 subnet prefix
Nodes are always on
Heavy use of multicast traffic
ComNets 44
IPv6 vs 6LoWPAN Neighbor Discovery
ND: Neighbor Discovery NS: Neighbor Solicitation
NA: Neighbor Advertisement
DAD: Duplicate Address Detection
SLLAO: Source Link Layer Address Option
PIO: Prefix Information Option ARO: Address Registration Option
6CO: 6LoWPAN Context Option
ABRO: Authorative Border Router Option
IPv6 ND (RFC 4861) – Mulicast 6LoWPAN ND (RFC 6775) - Unicast
ComNets 45
6LoWPAN Neighbor Discovery
Elimination of multicast-based address resolution for hosts. A host address registration feature using a new option in unicast Neighbor Solicitation and Neighbor Advertisement messages
Host-initiated interactions to allow for sleeping hosts. It removes the need for periodic or unsolicited Router Advertisements from routers to hosts
A new Neighbor Discovery option to distribute 6LoWPAN header compression context to hosts (6CO – 6LoWPAN Context Option)
Multi-hop distribution of prefix and 6LoWPAN header compression context to hostsn (the ABRO )
No Duplicate Address Detection (DAD) is performed if EUI-64 based IPv6 addresses are used (as these addresses are assumed to be globally unique). DAD is optional if DHCPv6 is used to assign addresses
Optional multihop duplicate address detection which uses two new ICMPv6 message types (DAR and DAC messages)
ComNets 46
6LoWPAN – Duplicate Address Detection
DAR: Duplicate Address Registration
DAC: Duplicate Address Confirmation
ComNets 48
6LoWPAN Fragmentation
net payload
8 B
Src IP Dest IP V|TC| FL|L|NH|HL
16 B 16 B
Multiple Link Packets
FCS IP F1
FCS IP F2
15.4 MAC FCS IP Fn
IP packets are too large to fit in a 802.15.4 frame are fragmented into multiple frames
Network Packet
15.4 MAC
15.4 MAC
ComNets 49
Fragmentation
All fragments of an IP packet carry the same “tag” Assigned sequentially at source of fragmentation
Each specifies tag, size, and position
Do not have to arrive in order
Time limit for entire set of fragments
First fragment – Header Type = 11000
Subsequent fragments - Header Type = 11100
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1 1 0 0 0| datagram_size | datagram_tag |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1 1 1 0 0| datagram_size | datagram_tag |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|datagram_offset|
+-+-+-+-+-+-+-+-+
ComNets 50
Reassembly of Fragmented Packets
The recipient of link fragments uses the following to rebuild whole packet
sender's 802.15.4 source address
the destination's 802.15.4 address
datagram_size
datagram_tag
ComNets 51
IPv6-LoWPAN Router Stack
Summary: 6LoWPAN Features
Addressing: supports for e.g. 64-bit and 16-bit 802.15.4 addressing
Efficient header compression
IPv6 base and extension headers, UDP header Useful with low-power link layers such as IEEE 802.15.4, narrowband ISM and power-line
communications
Optimized neighbour discovery protocol
Unicast, multicast and broadcast support
Multicast is compressed and mapped to broadcast
Fragmentation
1280 byte IPv6 MTU -> 127 byte 802.15.4 frames
Support for IP routing (e.g. IETF RPL)
Support for use of link-layer mesh (e.g. 802.15.5)
Image Source: http://6lowpan.net/the-book/
ComNets 52
6LoWPAN Operations – to Start Functioning
In order for a 6LoWPAN network to start functioning:
1. Link-layer connectivity between nodes (commissioning) Compatible physical and link-layer settings (modulation, channel, addressing, security, etc..)
2. Network layer address configuration, discovery of neighbors, registrations (bootstrapping)
3. Routing algorithm sets up paths (route initialization)
4. Continuous maintenance of 1-3
ComNets 54
Hardware Platforms
TelosB/TmoteSky: TI MSP430 + CC2420
Mica family: Atmel AVR + CC1000
iMote2: Intel Xscale + CC2420
SunSpot: ARM920T + CC2420
Sensinode
Zolertia
Meshnetics
...
More on: http://www.snm.ethz.ch/Main/HomePage
[Image Source:
The Sensor Network Museum]
ComNets 56
Operating Systems for WSNs
Well, more than ‚just‘ an OS: Applications
Drivers for Chips, Sensors
Development Environment, Compiler, Bootstrap Loader, Debugger
Simulation Tools
TinyOS http://www.tinyos.net/
nesC (Network Embedded Systems C)
Atmel, MSP430, ...
Contiki http://www.sics.se/contiki/
C
C64, Atari, Atmel, MSP430, ...
VM images available
ComNets 57
Simulation Tools
TOSSIM Shared Library of the OS & application, C/Python simulation scripts
http://docs.tinyos.net/index.php/TOSSIM
Event-based simulation
Cooja/MSPsim Java with Contiki applications
http://sourceforge.net/apps/mediawiki/contiki/index.php?title=Cooja
More: http://www.comnets.uni-bremen.de/~mab/cruise/simulation-tool-
comparison-matrix.html (Outdated)
ComNets 58
Acknowledgement
Some content and figures on these slides are taken from http://6lowpan.net/wp-content/uploads/2009/12/6lowpan-book-slides-full-20091206.pdf, under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/