1 of 51

Internet of Things

Lecture 4 - IPv6 and 6LoWPAN

2 of 51

Network Protocols

2

Lecture 5 - IPv6 & 6LoWPAN

IPv4

  • Exhausted in 2011
  • 32-bit address

IPv6

  • 128-bit addresses
  • Large IoT networks
  • Resource consuming

6LoWPAN

  • Adaptation layer
  • Header compression
  • Fragmentation

3 of 51

IPv6

3

4 of 51

IPv6 Addressing

  • 128 bits
    • 8 groups of 16-bit hexadecimal values separated by colons (:)

  • Prefix
    • number of 1s from subnet mask

4

Lecture 5 - IPv6 & 6LoWPAN

5 of 51

IPv6 - Shorter Address

  • Rule 1 : Zero Compression
    • omit groups of consecutive zeros
    • double colon (::)
    • only once in the address
  • Rule 2: omit leading zeros from each group

5

Lecture 5 - IPv6 & 6LoWPAN

6 of 51

Zero Compression

6

Lecture 5 - IPv6 & 6LoWPAN

7 of 51

Zero Compression

7

Lecture 5 - IPv6 & 6LoWPAN

8 of 51

Omit Leading Zeros

8

Lecture 5 - IPv6 & 6LoWPAN

9 of 51

Combining both rules

9

Lecture 5 - IPv6 & 6LoWPAN

10 of 51

IPv6 Address Types

  • Unicast
    • identifies a single node or interface
    • traffic forwarded to a single interface
  • Multicast
    • identifies a group of nodes or interfaces
    • traffic forwarded to all the nodes in the group
  • Anycast
    • unicast address assigned to multiple devices
    • traffic forwarded to the nearest node in the group

10

Lecture 5 - IPv6 & 6LoWPAN

11 of 51

IPv6 Unicast Addresses

  • Network ID - administratively assigned
  • Host ID - manually or auto-configured
    • Random
    • DHCPv6
    • EUI-64 format (based on MAC)

11

Source: IPv6 Deployment Guide, Cisco Systems

Lecture 5 - IPv6 & 6LoWPAN

12 of 51

Global Unicast Address

  • Routable and reachable across the Internet

  • Widespread generic use

  • Hierarchical to allow address aggregation

  • Identified by their three high-level bits set to 001 (2000::/3).

12

Lecture 5 - IPv6 & 6LoWPAN

13 of 51

Global Unicast Address

13

Source: IPv6 Deployment Guide, Cisco Systems

Lecture 5 - IPv6 & 6LoWPAN

14 of 51

Global Unicast Address

  • Global prefix (32 bits)
    • assigned by IANA to a service provider
  • SLA (16 bits)
    • assigned by service provider to a customer
  • LAN ID (16 bits)
    • individual LANs within the customer site
  • Host ID (64 bits)
    • EUI-64 format

14

Lecture 5 - IPv6 & 6LoWPAN

15 of 51

Unique Local Unicast Addresses

  • Similar to private IPv4 addresses

  • Used for local communication, inter-site VPNs

  • Not routable on the Internet
    • routing would require IPv6 NAT

15

Lecture 5 - IPv6 & 6LoWPAN

16 of 51

Unique Local Unicast Addresses

16

Source: IPv6 Deployment Guide, Cisco Systems

Lecture 5 - IPv6 & 6LoWPAN

17 of 51

Unique Local Unicast Addresses

  • Starts with FD00 (7 bits)
  • Global ID (40 bits)
    • defined by the administrator of the local domain
    • do not have to be aggregated
  • Subnet ID (16 bits)
    • defined by the administrator of the local domain
    • hierarchical -> route summarization
  • Interface ID (64 bits) = Host ID

17

Lecture 5 - IPv6 & 6LoWPAN

18 of 51

Link Local Unicast Addresses

  • Communication between two IPv6 devices on the same link

  • Automatically assigned by device when IPv6 is enabled

  • Not routable addresses
    • Their scope is link-specific only

  • Start with FE80 (10 bits)

18

Lecture 5 - IPv6 & 6LoWPAN

19 of 51

Link Local Unicast Addresses

  • Remaining 54 bits = zero / any manually configured value

19

Source: IPv6 Deployment Guide, Cisco Systems

Lecture 5 - IPv6 & 6LoWPAN

20 of 51

IPv6 Multicast Addresses

  • 8-bit prefix, FF00::/8 (1111 1111).
    • the second octet = the lifetime and scope of the address

  • Always destination address

20

Lecture 5 - IPv6 & 6LoWPAN

21 of 51

IPv6 Multicast Addresses

21

Source: IPv6 Deployment Guide, Cisco Systems

Lecture 5 - IPv6 & 6LoWPAN

22 of 51

6LoWPAN

22

23 of 51

6LoWPAN Standard

  • Internet Engineering Task Force (IETF)
    • TCP, UDP, HTTP, CoAP, RPL, etc.
  • 6LoWPAN Working Group
    • IPv6 communication in LLN
  • Most important standards:
    • RFC 4944 - first 6LoWPAN standard
    • RFC 6282 - header compression
    • RFC 6775 - neighbor discovery

23

Lecture 5 - IPv6 & 6LoWPAN

24 of 51

6LoWPAN Standard

  • Initially only over IEEE 802.15.4
  • Adapted to work with other low-power technologies
    • Bluetooth Smart
    • Wi-Fi low-power

24

Lecture 5 - IPv6 & 6LoWPAN

25 of 51

Network Architecture

  • 6LoWPAN mesh network
  • Edge router (6LBR)
    • Generates & manages 6LoWPAN network
    • Transfers between 6LoWPAN nodes and the Internet
    • Transfers between 6LoWPAN nodes
    • Transfers between 6LoWPAN nodes
    • Works at network layer

25

Source: Olsson, Jonas. "6LoWPAN demystified." Texas Instruments 13 (2014).

Lecture 5 - IPv6 & 6LoWPAN

26 of 51

Network Architecture

  • Routers (6LR)
    • Routes traffic from one node to another
  • Hosts (6LN)
    • Do not route traffic
    • Low power nodes
    • Duty-cycle

26

Source: Olsson, Jonas. "6LoWPAN demystified." Texas Instruments 13 (2014).

Lecture 5 - IPv6 & 6LoWPAN

27 of 51

Networking Stack

27

Source: Olsson, Jonas. "6LoWPAN demystified." Texas Instruments 13 (2014).

Lecture 5 - IPv6 & 6LoWPAN

28 of 51

IPv6 over IEEE 802.15.4

  • Main challenges for using IPv6 over 802.15.4
    • IPv6 MTU is 1280 bytes
    • 802.15.4 frame size is 127 bytes
    • IPv6 has MTU 10 times larger
    • IPv6 - 40 bytes headers, TCP - 20 bytes, UDP - 8 bytes
    • Solution: Fragmentation & header compression

28

Lecture 5 - IPv6 & 6LoWPAN

29 of 51

IETF - RFC 6282

  • Encapsulation of IPv6 packet into 802.15.4 frame => RFC 6282
  • 1. Header compression
    • Stateless and context-based compression
    • The elimination of header fields that can be derived from other headers (data link)
      • Determine IPv6 addresses and field sizes
    • Shared context example: same network prefix

29

Lecture 5 - IPv6 & 6LoWPAN

30 of 51

IETF - RFC 6282

  • 2. Fragmentation
    • Fragment data to fit in 802.15.4 frames
  • 3. Stateless auto-configuration
    • 6LoWPAN nodes generate their own addresses
    • Uses Neighbor Discovery Protocol (NDP)
      • Duplicate address detection (DAD)

30

Lecture 5 - IPv6 & 6LoWPAN

31 of 51

Header Compression

  • Stateless & shared-context compression
  • IPv6 address
    • 128 bits
    • network prefix on 64 bits + interface ID on 64 bits
  • Interface ID - derived from MAC address
    • 802.15.4 MAC address

31

Lecture 5 - IPv6 & 6LoWPAN

32 of 51

Header Compression

  • 1. Between 2 nodes from the local network
    • exclude both link-local addresses
    • link-local address derived from MAC
    • => 2 bytes header
    • useful for routing protocols
    • cannot be used to communicate outside the local network

32

Image source: Olsson, Jonas. "6LoWPAN demystified." Texas Instruments 13 (2014).

Lecture 5 - IPv6 & 6LoWPAN

33 of 51

Header Compression

  • 2. Destination is external but prefix is known (our IPv6 network)
    • exclude source address & destination prefix
    • include only destination interface ID
    • 12 bytes

33

Image source: Olsson, Jonas. "6LoWPAN demystified." Texas Instruments 13 (2014).

Lecture 5 - IPv6 & 6LoWPAN

34 of 51

Header Compression

  • 3. Destination is external and prefix is not known
    • exclude source interface ID (determined from MAC)

34

Image source: Olsson, Jonas. "6LoWPAN demystified." Texas Instruments 13 (2014).

Lecture 5 - IPv6 & 6LoWPAN

35 of 51

Fragmentation

  • Packets are divided into smaller segments
  • Additional information in the headers for the reassembly

  • Depends on the type of routing
    • mesh-under routing
    • route-over routing

35

Lecture 5 - IPv6 & 6LoWPAN

36 of 51

Fragmentation

  • Mesh-under routing (data link layer):
    • packets are reassembled at the destination
    • quick routing of fragments, reduced delay
    • if a single fragment is lost the whole packet must be retransmitted

36

Lecture 5 - IPv6 & 6LoWPAN

37 of 51

Fragmentation

  • Route-over routing (network layer):
    • packet is reconstructed at each hop
    • hops are devices with more resources - store all fragments

  • Avoid fragmentation - consumes resources
    • small payload
    • header compression

37

Lecture 5 - IPv6 & 6LoWPAN

38 of 51

6LoWPAN Stacked headers

3 types of sub-headers:

  • mesh addressing
    • multi-hop topology
    • forward packets
  • fragmentation
    • identify fragments
  • header compression

38

Image source: Olsson, Jonas. "6LoWPAN demystified." Texas Instruments 13 (2014).

Lecture 5 - IPv6 & 6LoWPAN

39 of 51

Fragment header

  • IPv6 packet is bigger than 802.15.4 frame => fragmentation
  • 3 fields:
    • datagram size
      • whole payload size
    • datagram tag
      • identify a set of fragments of the same payload
    • datagram offset
      • location of fragment in payload

39

Lecture 5 - IPv6 & 6LoWPAN

40 of 51

Mesh addressing header

  • Used in multi-hop topologies for routing
  • 3 fields:
    • hop limit
      • decremented at each hop
      • drop packet when hop limit reaches 0
    • source address
    • destination address
      • 802.15.4 MAC addresses - 16 or 64 bits

40

Lecture 5 - IPv6 & 6LoWPAN

41 of 51

Routing

41

Lecture 5 - IPv6 & 6LoWPAN

42 of 51

Mesh-under Routing

  • Uses 802.15.4 MAC addresses to forward packets
  • Forwarding is done at link layer
  • IP subnet
  • The edge router is the only IP router
  • A single broadcast domain
  • All messages are sent to all nodes
  • Fit for small networks

42

Lecture 5 - IPv6 & 6LoWPAN

43 of 51

Route-over Routing

  • Works at network layer
  • Each node is an IP router
  • Each node implements all functionality (including DAD)
  • Recommended for large networks
  • Scalability
  • RPL is a route-over protocol

43

Lecture 5 - IPv6 & 6LoWPAN

44 of 51

Link-local Address

  • Auto-generate IPv6 link-local address
  • Link-local address derived from 802.15.4 address (64 or 16 bits)
  • Link-local prefix is FE80::/64

44

Lecture 5 - IPv6 & 6LoWPAN

45 of 51

Link-local Address

  • Mesh-under routing
    • local-link address is sufficient to communicate within the local 6LoWPAN network
    • cannot be used for communicating outside the local network
  • Router-over routing
    • local-link address for communicating only with direct neighbors
    • for multi-hop communication it needs routable address

45

Lecture 5 - IPv6 & 6LoWPAN

46 of 51

Auto-configuration

  • Auto-configuration of global unicast addresses
    • IPv6 = network prefix + 802.15.4 MAC address
  • Advantage of deriving the IPv6 address from 802.15.4 MAC address
    • eliminate some fields to compress headers
  • Same prefix in the network
    • also good for header compression
    • prefix is discovered through RS/RA messages (NDP)

46

Lecture 5 - IPv6 & 6LoWPAN

47 of 51

Neighbor Discovery Protocol (NDP)

  • RFC 6775 - Neighbor Discovery for 6LoWPAN
  • Used for discovering neighbor devices
  • Maintain information about available devices
  • Configure default routes
  • Propagate configuration parameters
  • Critical for auto-configuration
    • discover network prefix
    • discover duplicates

47

Lecture 5 - IPv6 & 6LoWPAN

48 of 51

Neighbor Discovery Protocol

  • 4 types of messages:
    • Router solicitation (RS)
    • Router advertisement (RA)
    • Neighbor solicitation (NS)
    • Neighbor advertisement (NA)

  • RS/RA
    • discover routers
    • find network prefix - used in auto-configuration

48

Lecture 5 - IPv6 & 6LoWPAN

49 of 51

Neighbor Discovery

  • NS/NA
    • find duplicate addresses (DAD)
    • node generates address and sends NS for verification
    • if it receives NA with duplicate flag, the address is not unique
    • finding neighbours
    • detect when neighbours are not available

  • Using these 4 messages a node can auto-generate a unique address

49

Lecture 5 - IPv6 & 6LoWPAN

50 of 51

Bibliography

50

Lecture 5 - IPv6 & 6LoWPAN

51 of 51

Keywords

  • IPv6
  • Unicast address
  • Multicast address
  • Anycast address
  • 6LoWPAN
  • Header compression
  • Fragmentation
  • Routing
  • Auto-configuration

51

Lecture 5 - IPv6 & 6LoWPAN