6LoWPAN

6LoWPAN means IPv6 over Low-Power Wireless Personal Area Networks. It is an adaptation layer that lets IPv6 operate over IEEE 802.15.4.

Why it is needed

  1. IEEE 802.15.4 has a maximum PHY payload of 127 bytes, and MAC/security headers leave roughly tens of bytes for application data. IPv6 requires every link to support an MTU of at least 1280 bytes, so a full IPv6 packet cannot fit.
  2. A 40-byte IPv6 header plus transport headers consumes a large fraction of a tiny frame.
  3. Manual configuration is unsuitable for billions of constrained devices; IPv6 autoconfiguration must account for 16-bit and 64-bit 802.15.4 addresses.

Adaptation features

  • Encapsulation header stack: optional headers are chained as needed, for example mesh addressing, broadcast, fragmentation, and compression dispatch headers.
  • Fragmentation/reassembly: a large IPv6 datagram is split into link-layer fragments and reconstructed before delivery to the upper layer. The first fragment carries a datagram size and tag; subsequent fragments carry the size, tag, and an offset in 8-byte units. The tag identifies fragments belonging to one datagram.
  • Stateless address autoconfiguration: a device derives a link-local IPv6 interface identifier from its 802.15.4 short or extended address without a DHCP allocation table. For a 64-bit address this uses modified EUI-64; short addresses are expanded using PAN/address information.
  • Header compression: HC1/HC2 and later IPHC/NHC omit fields that can be derived from context, such as link-local addresses, zero traffic class/flow label, and known transport protocol fields. IPHC improves compression for routed/global and multicast addresses and separates network/transport compression more cleanly.
  • Mesh addressing/forwarding: optional sub-IP mesh headers support multi-hop forwarding, but routing/network formation is not the same as the 802.15.4 MAC standard itself.

Fragment-offset calculation

The datagram offset is measured in multiples of 8 bytes. If each fragment has 72 bytes of payload, fragment 5 begins after four fragments:

start = 4 × 72 = 288 bytes
fragment offset = 288 / 8 = 36

The total 555-byte datagram determines how many fragments are needed, but not the offset of fragment 5 once the fixed payload size is given.

Important distinction

6LoWPAN fragmentation is below IPv6 and does not replace all IP fragmentation. It supplies the link-specific fragmentation required by the tiny 802.15.4 MTU; an IPv6 datagram is reconstructed before the upper layer sees it. Do not write that it “eliminates IP fragmentation entirely.”

HC1/HC2: when useful

They work especially well for local/link-local communication when IPv6 fields are inferable and UDP is used with compressible ports. They are less useful for routed/global or multicast destinations, non-default traffic fields, extension headers, or other cases where fields must be sent uncompressed. IPHC/NHC addresses these limitations.

Sources

  • master-cs/raw/iot/3.3-IoT_Internetworking-6LoWPAN.md
  • master-cs/raw/iot/Question Sheet Week 3.md
  • master-cs/raw/iot/2021 alte klausur.md