Why IP for IoT

Using the Internet Protocol lets IoT devices join the internet directly, with standard tools and end-to-end addressing. IPv4 has too few addresses for billions of devices, so IoT uses IPv6, which has 128-bit addresses. But IPv6 headers are large, and the IEEE 802.15.4 radio frame is only 127 bytes, so adaptation is needed.

6LoWPAN

IPv6 over Low-power Wireless Personal Area Networks (6LoWPAN) is an adaptation layer between IPv6 and 802.15.4. It provides header compression (an IPv6 header of 40 bytes can shrink to a few bytes), fragmentation and reassembly (IPv6 needs a minimum link MTU of 1,280 bytes, so larger packets are split into small frames) and mesh routing support. A border router connects the 6LoWPAN network to the ordinary IPv6 internet.

Thread

Thread is an open, IP-based mesh networking protocol for smart homes, built on 802.15.4 and 6LoWPAN. It is IPv6 native, has no single point of failure (any router-capable device can lead), is self-healing, uses AES encryption, and joins the internet through a border router. It works with the Matter standard for home devices. Device roles include router, end device and leader.

Integration with Cloud Networks

Devices reach the cloud directly (Wi-Fi, cellular) or through a gateway or border router. The cloud receives data through MQTT, HTTPS or CoAP endpoints, authenticates devices with certificates or tokens, stores and analyses data, and sends commands back. Good integration uses protocol translation at the gateway, buffering when the link is down, device registry and identity, secure channels (TLS), and over-the-air updates. Typical flow: sensor, gateway, internet, cloud IoT hub, database and dashboard.

Definition: 6LoWPAN. An adaptation layer that lets IPv6 packets travel over low-power 802.15.4 radios by compressing headers and fragmenting large packets into small frames.

Table 2.5: 6LoWPAN and Thread

Item 6LoWPAN Thread
Role Adaptation layer for IPv6 on 802.15.4 Full mesh networking protocol
Key feature Header compression, fragmentation Self-healing mesh, no single point of failure
Link to internet Border router Border router
Typical use Sensor networks Smart homes, with Matter

Example 2.5: Payload per frame with header compression

Problem: An 802.15.4 frame carries at most 127 bytes. Assume 25 bytes of MAC overhead. An IPv6 header (40 bytes) with UDP (8 bytes) is 48 bytes uncompressed, or about 6 bytes after 6LoWPAN compression (assumed). Find the payload per frame in both cases and the number of frames for 300 bytes of data.

Solution:

  1. Space after MAC = 127 − 25 = 102 bytes.
  2. Uncompressed payload = 102 − 48 = 54 bytes; compressed payload = 102 − 6 = 96 bytes.
  3. Frames for 300 bytes uncompressed = ceil(300/54) = 6.
  4. Frames compressed = ceil(300/96) = 4.

Result: Compression raises the payload from 54 to 96 bytes and reduces the frames from 6 to 4, which saves energy. (Fragmentation headers are ignored in this simplified count.)

import math
frame, mac, data = 127, 25, 300
for name, hdr in (("plain", 48), ("6LoWPAN", 6)):
    pay = frame - mac - hdr
    print(name, "payload:", pay, "frames:", math.ceil(data / pay))

Output

plain payload: 54 frames: 6
6LoWPAN payload: 96 frames: 4

Common mistakes

  • Assuming a full IPv6 header fits comfortably in a 127-byte frame.
  • Connecting devices to the cloud without authentication.
  • Forgetting a border router between the low-power network and the internet.
  • Relying on one gateway with no buffering for outages.

Key takeaways

  • IPv6 gives enough addresses; 6LoWPAN adapts it to 802.15.4.
  • 6LoWPAN: header compression, fragmentation, border router.
  • Thread: IPv6 mesh for smart homes, works with Matter.
  • Cloud integration: secure endpoint, identity, buffering, OTA updates.

Practice questions

  1. Why is 6LoWPAN needed?
  2. What is the role of a border router?
  3. Name two features of Thread.

Answers to the practice questions

  1. IPv6 packets are too large for 127-byte 802.15.4 frames, so headers must be compressed and packets fragmented.
  2. It connects the low-power network to the IPv6 internet.
  3. IPv6 mesh with no single point of failure and encrypted, self-healing operation.

Sources

  • Official BCA syllabus Internet of Things, course code 25BCA406DS01, Unit II