6 Low Pan
6 Low Pan
Area Networks
IPv4 versus IPv6
IPv4 IPv6
Developed IETF 1974 IEF 1998
Length (bits) 32 128
No. of Addresses 2^32 2^128
Notation Dotted Decimal Hexadecimal
Dynamic Allocation of DHCP SLAAC/ DHCPv6
addresses
IPSec Optional Compulsory
IPv4 versus IPv6
IPv4 IPv6
Header Size Variable Fixed
Header Checksum Yes No
Header Options Yes No
Broadcast Addresses Yes No
Multicast Address No Yes
IPv4 Header Format
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
Ver IHL Type of Service Total Length
• RFC6282 Features:
• New HC (IPv6 header) and NHC (Next-header) compression
• Support for global address compression (with contexts)
• Support for IPv6 extension header compression
• Support for UDP
• Support for compact multicast address compression
[RFC2373]
IPv6 Addressing
• 128-bit IPv6 address Interface ID (IID)
64-bit prefix + 64-bit
• The 64-bit prefix is hierarchical
• Identifies the network you are on and where it is globally
• The 64-bit IID identifies the network interface
• Must be unique for that network
• Typically is formed statelessly from the interface MAC address
• Called Stateless Address Autoconfiguration (RFC4862)
• There are different kinds of IPv6 addresses
• Loopback (0::1) and Unspecified (0::0)
• Unicast with global (e.g. 2001::) or link-local (FE80::) scope
• Multicast addresses (starts with FF::)
• Anycast addresses (special-purpose unicast address)
6LoWPAN Addressing
• IPv6 addresses are compressed in 6LoWPAN
• A LoWPAN works on the principle of
• flat address spaces (wireless network is one IPv6 subnet)
• with unique MAC addresses (e.g. 64-bit or 16-bit)
• 6LoWPAN compresses IPv6 addresses by
• Eliding the IPv6 prefix
• Global prefix known by all nodes in network
• Link-local prefix indicated by header compression format
• Compressing the IID
• Elided for link-local communication
• Compressed for multihop dst/src addresses
• Compressing with a well-known “context”
• Multicast addresses are compressed
6LoWPAN Addressing
• Forming addresses out of 16-bit short addresses
• Pseudo 48-bit address is formed in two steps:
(1) 16_bit_PAN:16_zero_bits
(2) 32_bits_as_specified_previously:16_bit_short_address
|
+
+
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
|
+
+ Destinatio Address +
UDP |
+
Source Port
n
| Destination Port |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
| |
+ +
| Length | Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
| |
Payload
+
| UDP Payload ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+
Encoding of IPv6 Header Fields [RFC4944]
+-------+-------+-------+-------+---------+---------+---------+
| M Typ | M Hdr | F Typ | F Hdr | HC1 Dsp | HC1 Hdr | Payload |
+-------+-------+-------+-------+---------+---------+---------+
+-------+-------+-------+-------+---------+---------+---------+
| M Typ | M Hdr | B Dsp | B Hdr | HC1 Dsp | HC1 Hdr | Payload |
+-------+-------+-------+-------+---------+---------+---------+
Dispatch Type and Header
The dispatch type is defined by a zero bit as the first bit and a one bit as the second bit.
The dispatch type and header are shown here:
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| Dispatch | type-specific header
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The dispatch value may be treated as an unstructured namespace. Only a few symbols are
required to represent current LoWPAN functionality. Although some additional savings could
be achieved by encoding additional functionality into the dispatch byte, these measures
would tend to constrain the ability to address future alternatives.
Dispatch Value Bit Pattern
Pattern Header Type
+------------+-----------------------------------------------+
| 00 xxxxxx | NALP - Not a LoWPAN frame |
| 01 000001 | IPv6 - Uncompressed IPv6 Addresses |
| 01 000010 | LOWPAN_HC1 - LOWPAN_HC1 compressed IPv6 |
| 01 000011 | reserved - Reserved for future use |
| ... | reserved - Reserved for future use |
| 01 | reserved - Reserved for future use |
| 01 010000
00111 | LOWPAN_BC0 - LOWPAN_BC0 broadcast |
1 01 010001 | reserved
| - Reserved for future use |
| ... | reserved - Reserved for future use |
| 01 | reserved - Reserved for future use |
11111
0
| 01 111111 | ESC - Additional Dispatch byte follows |
| 10 xxxxxx | MESH - Mesh Header |
| 11 000xxx | FRAG1 - Fragmentation Header (first) |
| 11 001000 | reserved - Reserved for future use |
| 11 ... reserved
100xxx | FRAGN Reserved for future
- Fragmentation Header use
(subsequent)||
| 11 101000 || reserved
reserved - Reserved for future use |
| ... 01111 | reserved - Reserved for future use |
1 11 111111 | reserved
| - Reserved for future use |
+------------+-----------------------------------------------+
Header Comparison
LoWPAN dispatch
[RFC6282]
LoWPAN UDP/IPv6 Headers
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Dispatch with LOWPAN_IPHC | LOWPAN_NHC | Src | Dst |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| UDP Checksum | UDP Payload ...
6 Bytes
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Payload
[RFC6282]
IP Header Compression (IPHC)
LOWPAN_IPHC Header
+-------------------------------------+----------------------------
| Dispatch + LOWPAN_IPHC (2-3 octets) | In-line IPv6 Header Fields
+-------------------------------------+----------------------------
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 |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+
| 1 | 1 | 1 | 0 | EID |NH |
+---+---+---+---+---+---+---+---+
+----------------+---------------------------
| var-len NHC ID | compressed next header...
+----------------+---------------------------
0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+
| 1 | 1 | 1 | 1 | 0 | C | P |
+---+---+---+---+---+---+---+---+
C = Checksum Compression
P = UDP Port Compression
6LoWPAN
Fragmentation
Fragmentation
• IPv6 requires underlying links to support Minimum
Transmission Units (MTUs) of at least 1280 bytes
• IEEE 802.15.4 leaves approximately 80-100 bytes of
payload!
• RFC4944 defines fragmentation and reassembly of IPv6
• The performance of large IPv6 packets fragmented over
low-power wireless mesh networks is poor!
• Lost fragments cause whole packet to be retransmitted
• Low-bandwidth and delay of the wireless channel
• 6LoWPAN application protocols should avoid fragmentation
• Compression should be used on existing IP application protocols
when used over 6LoWPAN if possible
Fragmentation
• Impact of fragmentation in LoWPANs
• Assumptions
• p Uncorrelated packet loss probability
• n Number of fragments
• Probability of datagram loss: 1-(1-p)n
Fragmentation
Encodes the size of the entire IP packet
Initial Fragment before link-layer fragmentation
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| datagram_size | datagram_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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1 1 1 0 0| datagram_size | datagram_tag |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|datagram_offset|
+-+-+-+-+-+-+-+-+
Bootstrapping
6LoWPAN Setup & Operation
• Autoconfiguration is important in embedded
networks
L5 Mechanisms
L3 Mechanisms
L2 Mechanisms
Layer-2 Mechanisms
• Internet security is usually thought of as end-to-end
• In wireless networks the channel itself is very vulnerable
• The channel is easy to overhear
• Nodes and packets are easy to spoof
• The goals of security at the data-link layer
• Protect the wireless network against attackers
• Increase robustness against attacks
• IEEE 802.15.4 provides built-in encryption
• Based on the 128-bit Advanced Encryption Standard (AES)
• Counter with CBC-MAC mode (CCM)
• Provides both encryption and an integrity check
• Most chips include an AES-128 hardware engine
Layer-3 Mechanisms
• End-to-end security can be provided by IP
• Protects the entire path between two end-points
• The IPsec standard [RFC4301] defined IP security
• Two packet formats are defined:
• Authentication Header (AH) in [RFC4302]
• Integrity protection and authentication only
• Encapsulating Security Payload (ESP) [RFC4303]
• Also encrypts for confidentiality