Vous êtes sur la page 1sur 25

6LoWPAN

David E. Culler
University of California, Berkeley

Jonathan Hui
Cisco Systems, Inc.

Zach Shelby
Sensinode

November 30th, 2010

6LoWPAN what it means for smart objects


Low-Power Wireless Embedded devices can now be connected using familiar networking technology,
like ethernet and like WiFi (but even where wiring is not viable) (but even where power is not plentiful)

All of these can interoperate in real applications Interoperate with traditional computing infrastructure Utilize modern security techniques Application Requirements and Capacity Planning dictate how the network is organized,
not artifacts of the underlying technology

Low Power Wireless Internet

LoWPAN -Extended IP Network

IP Network
(powered)

IP/ LoWPAN Router IP Device

IP/ LoWPAN Sensor Router

Wireless links

802.15.4 Class Lifetime (days) Net Size BW (kbps) Range (m) WPAN 100-1000+ 65535 20-250 1-75+ Low Power, Large Scale, Low Cost

802.15.1 WPAN 1-7 7 720 1-10+ Cable Replacement

802.15.3 WPAN Powered 243 11,000+ 10 Cable Replacement

802.11 WLAN 0.1-5 30 11,000+ 1-100

802.3 LAN Powered 1024 100,000+ 185 (wired)

Goals

Throughput

Throughput

6LoWPAN is an Adaptation Layer


Diverse Object and Data Models (HTML, XML, , BacNet, )
7: app 4: xport 3: net 2: link Serial X3T9.5 Modem FDDI ISDN Sonet DSL GPRS 1: phy

Application (Telnet, FTP, SMTP, SNMP, HTTP) Transport (UDP/IP, TCP/IP) Network (IPv6) Link
802.3 802.5 802.3a Ethernet Token Ring 802.3i Ethernet 802.3y Ethernet 10b2 802.3ab Ethernet 10bT 802.3an Ethernet 100bT Ethernet 1000bT 1G bT 6LoWPAN 802.11 802.11a WiFi 802.11b WiFi 802.11g WiFi 802.11n WiFi WiFi 802.15.4 LoWPAN

6LoWPAN Adaptation Needs


Transport Header (UDP, TCP) Application Payload (HTTP, Modbus, BACnet)

8-20+ bytes

IPv6

Network Payload

40+ bytes Min MTU Requirement of 1280


Link Header Link Payload

802.15.4 MTU = 127 bytes

Minimum MTU >> 802.15.4 MTU Fragmentation 48+ byte UDP IPv6 Header Header Compression Defines a Chained Header format via Dispatch
Analogous to IPv6 Header stack

6LoWPAN Fragmentation
802.15.4-2006 has a link MTU of 127 bytes IPv6 requires a min link MTU of 1280 bytes 6LoWPAN must provide fragmentation
802.15.4 IPv6 Datagram

802.15.4

Frag Frag Frag

IPv6 Datagram (Frag 1) IPv6 Datagram (Frag 2) IPv6 Datagram (Frag N)

802.15.4 802.15.4

6LoWPAN Fragmentation
802.15.4 Frag IPv6 Datagram (Frag 1)

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

1 1 0 0 0

dgram_size

dgram_tag

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 2 3 4 5 6 7 8 9

1 1 1 0 0

dgram_size

dgram_tag

dgram_offset

Size: size of datagram in bytes


Included in all fragments to simplify buffer allocation

Tag: identifies all fragments of a datagram Offset: location of fragment in 8-byte units
Elided in first fragment

6LoWPAN Header Compression


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

IPv6 Header

0 4 8 12 16 24 28 32 36 40

Ver

Traffic Class Payload Length

Flow Label Next Header Source Address Hop Limit

Destination Address

Use little state and do no depend on flows Common values for header fields => compact forms
Version is always 6 Traffic Class and Flow Label are zero Payload Length always derived from L2 header Source and Destination Addrs are link-local and derived from L2 addrs

IPv6 Header Compression


0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5

TF

NH

HLIM

CID SAC

SAM

DAC

DAM

In-line IPv6 Header Bits

TF (Traffic Class and Flow Label)


0: Carried Inline (ECN+DSCP+Flow), 1: ECN+Flow, 2: ECN+DSCP, 3: All zero

NH (Next Header compression)


0: Carried Inline, 1: Next Header is compressed

HLIM (Hop Limit = Inline, 1, 64, 255)


0: Carried Inline, 1: 1, 2: 64, 3: 255

CID (Context Identifier Extension)


0: No 1-byte CID identifier, 1: 1-byte identifier follows

SAC/DAC (Source/Destination Address Compression)


0: Stateless, 1: Context-based

SAM/DAM (Source/Destination Address Mode)


0: 16 bytes inline, 1: 8 bytes inline, 2: 2 bytes inline, 3: elided

M (Multicast Destination)
0: Destination is not multicast, 1: Destination is multicast

6LoWPAN Header Compression


Traffic Class and 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 4 5 6 7 8 9 0 1

TF = 00

IPHC

ECN

DSCP

rsv

Flow Label

Inline IPv6 Bits

0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3

TF = 01

IPHC

ECN rsv
0 1 2 3 4 5 6 7

Flow Label

Inline IPv6 Bits

[DSCP = 0]

TF = 10 TF = 11

IPHC

ECN

DSCP

Inline IPv6 Bits

[Flow Label = 0]

IPHC

Inline IPv6 Bits

[ECN=0, DSCP=0, Flow Label=0]

11

6LoWPAN Header Compression


Next Header
NH = 0 NH = 1
IPHC Inline IPv6 Bits Next Header Inline IPv6 Bits Uncompressed Next Header

IPHC

Inline IPv6 Bits

Inline IPv6 Bits

NHC

Uncompressed Next Header

Hop Limit
HLIM = 00 HLIM = 01 HLIM = 10 HLIM = 11
IPHC Inline IPv6 Bits Hop Limit Inline IPv6 Bits

IPHC

Inline IPv6 Bits

[Hop Limit = 1] [Hop Limit = 64] [Hop Limit = 255]

IPHC

Inline IPv6 Bits

IPHC

Inline IPv6 Bits

12

6LoWPAN Header Compression


IPv6 Unicast Address
IPv6 Addr Prefix Interface Identifier

128 bits

Prefix
Addrs within 6LoWPAN typically contain common prefix Nodes typically communicate with one or few central devices Establish state (contexts) for such prefixes only state maintenance Support for up to 16 contexts

Interface Identifier
Typically derived from L2 addr during autoconfiguration Elide when Interface Identifier can be derived from L2 header

6LoWPAN Header Compression


IPv6 Unicast Address
IPv6 Addr Prefix Interface Identifier

128 bits

Source/Destination Address Mode


SAM/DAM = 00 SAM/DAM = 01 SAM/DAM = 10
IPv6 Address Bits [0,127]

IPv6 Address Bits [64,127]

[64-bit prefix elided]

Bits [112,127]

[112-bit prefix elided]

SAM/DAM = 11 [Full 128-bit address elided, IID derived from link-layer]

14

6LoWPAN Header Compression


IPv6 Unicast Address
IPv6 Addr Prefix Interface Identifier

128 bits

IPv6 Prefix Stateless Mode (SAC/DAC=0)


Prefix is link-local (fe80::/10)

Context-based Mode (SAC/DAC=1)


Prefix taken from stored contexts (up to 16 contexts) CID = 0, use ContextID = 0 CID = 1, include 4-bit ContextID for source & destination

15

6LoWPAN Header Compression


IPv6 Multicast Address
GroupIDs typically consume a small number of bits

DAM = 00

0xFF

Flags Scope

Group Identifier Bits [0,111]

DAM = 01

Flags Scope

Group Identifier Bits [64,111]

(Solicited Node Mcast)

DAM = 10

Flags Scope

Group Identifier Bits [80,111]

(All DHCP Servers/Relays)

DAM = 11

Group ID Bits [104,112]

[Flags = 0, Scope = 2] (Link-local All-Nodes, AllRouters)

6LoWPAN Header Compression


Each compressed header indicates if the next header is also compressed Following control byte(s) include next header identifier
Framework for defining arbitrary Next Header compression methods

802.15.4
v 6 s ed I P es d r s e mp es o pr i s c om C P v6 I w o H

Compressed IPv6 Hdr


d se

Compressed UDP Hdr

ow

is

co

e pr

6LoWPAN Header Compression


UDP Header
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 4

Source Port Length

Destination Port Checksum

Assume common values for header fields and define compact forms
Ports within 61616 to 61632 (4 bits) Length derived from IPv6 Length Checksum may be elided if other integrity checks are in use (e.g. Ipsec)

No definition for TCP or ICMPv6


0 1 2 3 4 5 6 7

C (Checksum): 0: Inline, 1: Elide P (Ports): 0: Inline 1: Elide first 8 bits of Dest Port 2: Elide first 8 bits of Source Port 3: Elide first 12 bits of Source and Dest Ports

Example: Link-Local Unicast


Len = 50 FCF DSN DSTPAN

Link Hdr

DST = 00-17-3B-00-AA-BB-CC-DD SRC = 00-17-3B-00-11-22-33-44

IPv6 Hdr

Ver = 6

Traffic Class = 0 Payload Length

Flow Label = 0 Next Header = UDP Source Prefix = fe80::/64 Hop Limit = 1 Derived from link hdr Compact forms

Source IID = 0217:3B00:AABB:CCDD Dest Prefix = fe80::/64 Dest IID = 0217:3B00:1122:3344

UDP Hdr

Source Port Length 1 2 1 1 2

Destination Port Checksum

802.15.4

48-byte UDP/IPv6 Hdr 7 bytes

Example: Global Unicast


Len = 50 FCF DSN DSTPAN

Link Hdr

DST = 00-17-3B-00-AA-BB-CC-DD SRC = 00-17-3B-00-11-22-33-44

IPv6 Hdr

Ver = 6

Traffic Class = 0 Payload Length

Flow Label = 0 Next Header = UDP Source IID = ::1234 Hop Limit = 23 Derived from link hdr Compact forms Derived from context Destination Port Checksum

Source Prefix = 2001:5a8:4:3721::/64 Dest Prefix = 2001:5a8:4:3721::/64 Dest IID = ::ABCD

UDP Hdr

Source Port Length 1 2 1 2 2 1 1

802.15.4

48-byte UDP/IPv6 Hdr 12 bytes

Example: Link-Local Multicast


Len = 50 FCF DSN DSTPAN

Link Hdr

DST = 00-17-3B-00-AA-BB-CC-DD SRC = 00-17-3B-00-11-22-33-44

IPv6 Hdr

Ver = 6

Traffic Class = 0 Payload Length

Flow Label = 0 Next Header = UDP Source Prefix = fe80::/64 Hop Limit = 255 Derived from link hdr Compact forms Dest Prefix = ff02::1

Source IID = 0217:3B00:AABB:CCDD

UDP Hdr

Source Port Length 1 2 1 1 1 2

Destination Port Checksum

802.15.4

48-byte UDP/IPv6 Hdr 8 bytes

Neighbor Discovery in 6LoWPAN


IPv6 Neighbor Discovery defines [RFC4861]
How hosts discover routers and prefixes How nodes resolve L2 addresses from IP addresses How nodes perform unreachability detection

But ND was originally designed for


LAN (e.g. Ethernet) connected interfaces Always-on equipment such as PCs

6LoWPAN has unique requirements


Both single-hop mesh and multi-hop IP routed networks Lossy and asymmetric radio environment Frequent multicast traffic is expensive Address resolution is not required Unique EUI-64 addresses Hosts may be sleeping to preserve energy

6LoWPAN ND at a Glance

LoWPAN in an IP Stack
LoWPAN 802.15.4 1% of 802.11 power, easier to embed, as easy to use. 8-16 bit MCUs with KBs, not MBs. Off 99% of the time

Web Services
XML / RPC / REST / SOAP / OSGI HTTP / FTP / SNMP TCP / UDP IP Ethernet Sonet 802.11

ya w t a G yx o P e / r

802.15.4,

IETF 6lowpan

24

Conclusion
6LoWPAN turns IEEE 802.15.4 into the next IP-enabled link Provides open-systems based interoperability among lowpower devices over IEEE 802.15.4 Provides interoperability between low-power devices and existing IP devices, using standard routing techniques Paves the way for further standardization of communication functions among low-power IEEE 802.15.4 devices Offers watershed leverage of a huge body of IP-based operations, management and communication services and tools Great ability to work within the resource constraints of lowpower, low-memory, low-bandwidth devices like WSN

25