1 of 47

Internet of Things

Lecture 5 - IPv6 and 6LoWPAN

2 of 47

Network Protocols

2

Lecture 5 - IPv6 & 6LoWPAN

IPv4

  • Exhausted in 2011
  • 32-bit address

IPv6

  • 128-bit addresses
  • Fit for large IoT networks
  • Not enough resources on low power devices

6LoWPAN

  • Adaptation layer
  • Header compression
  • Fragmentation

3 of 47

IPv6

3

4 of 47

IPv6 Addressing

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

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

4

Lecture 5 - IPv6 & 6LoWPAN

5 of 47

Zero Compression

5

Lecture 5 - IPv6 & 6LoWPAN

6 of 47

Zero Compression

6

Lecture 5 - IPv6 & 6LoWPAN

7 of 47

Omit Leading Zeros

7

Lecture 5 - IPv6 & 6LoWPAN

8 of 47

Combining both rules

8

Lecture 5 - IPv6 & 6LoWPAN

9 of 47

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

9

Lecture 5 - IPv6 & 6LoWPAN

10 of 47

IPv6 Unicast Addresses

  • Network ID - administratively assigned
  • Host ID - manually or auto-configured
    • Random
    • DHCPv6
    • EUI-64 format

10

Source: IPv6 Deployment Guide, Cisco Systems

Lecture 5 - IPv6 & 6LoWPAN

11 of 47

Global Unicast Address

  • Routable and reachable across the Internet

  • Widespread generic use

  • Structured as a hierarchy to allow address aggregation

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

11

Lecture 5 - IPv6 & 6LoWPAN

12 of 47

Global Unicast Address

12

Source: IPv6 Deployment Guide, Cisco Systems

Lecture 5 - IPv6 & 6LoWPAN

13 of 47

Global Unicast Address

  • Global prefix
    • assigned by IANA to a service provider
  • SLA / subnet ID
    • assigned by service provider to a customer
  • LAN ID
    • individual networks within the customer site
  • Host / interface ID
    • 64 bits
    • EUI-64 format

13

Lecture 5 - IPv6 & 6LoWPAN

14 of 47

Unique Local Unicast Addresses

  • Similar to private IPv4 addresses

  • Used for local communications, inter-site VPNs

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

14

Lecture 5 - IPv6 & 6LoWPAN

15 of 47

Unique Local Unicast Addresses

15

Source: IPv6 Deployment Guide, Cisco Systems

Lecture 5 - IPv6 & 6LoWPAN

16 of 47

Unique Local Unicast Addresses

  • Starts with FD00
  • Global ID
    • do not have to be aggregated
    • defined by the administrator of the local domain
  • Subnet ID
    • defined by the administrator of the local domain
    • hierarchical - route summarization
  • Interface ID

16

Lecture 5 - IPv6 & 6LoWPAN

17 of 47

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

  • Identified by the first 10 bits (FE80)

17

Lecture 5 - IPv6 & 6LoWPAN

18 of 47

Link Local Unicast Addresses

  • Remaining 54 bits = zero / any manually configured value

18

Source: IPv6 Deployment Guide, Cisco Systems

Lecture 5 - IPv6 & 6LoWPAN

19 of 47

IPv6 Multicast Addresses

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

  • Always destination address

19

Lecture 5 - IPv6 & 6LoWPAN

20 of 47

IPv6 Multicast Addresses

20

Source: IPv6 Deployment Guide, Cisco Systems

Lecture 5 - IPv6 & 6LoWPAN

21 of 47

6LoWPAN

21

22 of 47

6LoWPAN Standard

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

22

Lecture 5 - IPv6 & 6LoWPAN

23 of 47

6LoWPAN Standard

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

23

Lecture 5 - IPv6 & 6LoWPAN

24 of 47

Network Architecture

  • 6LoWPAN mesh network
  • Edge router (6LBR)
    • Generates & manages 6LoWPAN network
    • Transfers between 6LoWPAN nodes and the Internet
    • Transfers between 6LowPAN nodes
    • Network level

24

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

Lecture 5 - IPv6 & 6LoWPAN

25 of 47

Network Architecture

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

25

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

Lecture 5 - IPv6 & 6LoWPAN

26 of 47

Networking Stack

26

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

Lecture 5 - IPv6 & 6LoWPAN

27 of 47

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

27

Lecture 5 - IPv6 & 6LoWPAN

28 of 47

IETF - RFC 6282

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

28

Lecture 5 - IPv6 & 6LoWPAN

29 of 47

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 NDP
    • Duplicate address detection (DAD)

29

Lecture 5 - IPv6 & 6LoWPAN

30 of 47

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

30

Lecture 5 - IPv6 & 6LoWPAN

31 of 47

Header Compression

  1. Between nodes from the local network
    • exclude both link-local addresses
    • useful for routing protocols
  2. Destination is external but prefix is known
    • exclude src addr & dest prefix
    • include only destination interface ID
  3. Destination is external and prefix is not known
    • exclude source interface ID

31

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

Lecture 5 - IPv6 & 6LoWPAN

32 of 47

Fragmentation

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

  • Depends on the type of routing
  • mesh-under routing:
    • packets are reassembled at the destination
    • quick routing of fragments, reduced delay
    • if a single fragment is lost the whole packet must be retransmitted

32

Lecture 5 - IPv6 & 6LoWPAN

33 of 47

Fragmentation

  • route-over routing:
    • packet is reconstructed at each hop
    • hops are devices with more resources - store all fragments

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

33

Lecture 5 - IPv6 & 6LoWPAN

34 of 47

Stacked headers

3 types of sub-headers:

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

34

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

Lecture 5 - IPv6 & 6LoWPAN

35 of 47

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

35

Lecture 5 - IPv6 & 6LoWPAN

36 of 47

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

36

Lecture 5 - IPv6 & 6LoWPAN

37 of 47

Routing

  • Mesh-under
    • 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

37

Lecture 5 - IPv6 & 6LoWPAN

38 of 47

Routing

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

38

Lecture 5 - IPv6 & 6LoWPAN

39 of 47

Routing

39

Lecture 5 - IPv6 & 6LoWPAN

40 of 47

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

40

Lecture 5 - IPv6 & 6LoWPAN

41 of 47

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

41

Lecture 5 - IPv6 & 6LoWPAN

42 of 47

Auto-configuration

  • Auto-configuration
    • 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)

42

Lecture 5 - IPv6 & 6LoWPAN

43 of 47

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

43

Lecture 5 - IPv6 & 6LoWPAN

44 of 47

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

44

Lecture 5 - IPv6 & 6LoWPAN

45 of 47

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

45

Lecture 5 - IPv6 & 6LoWPAN

46 of 47

Bibliography

46

Lecture 5 - IPv6 & 6LoWPAN

47 of 47

Keywords

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

47

Lecture 5 - IPv6 & 6LoWPAN