Why do we need 6LoWPAN for IoT Systems?

Ahmed Khaled
10 min readAug 9, 2024

--

The environments -like our homes, offices, and cities- we live and work in are full of devices; some can give us data (and we call them sensors); some can take actions (and we call them actuators), and some connect such sensors and actuators with other devices, further external systems, and users (and we call them edge devices). Connecting such devices (or things) to build interactions and applications is what we can refer to as the Internet of Things (IoT) — depending on which angle you consider, there are a lot of other definitions, but let’s keep this simple definition for now and refine it more and more as we speak!

One core design aspect as you architect your IoT system is selecting the optimal communication mechanism given your requirements and the expected applications. Such choice depends on a wide range of aspects, including the type of deployed IoT things, their capabilities, the need for interoperability with other existing systems, the cost of installation and maintenance, and the need to integrate security. In contrast with the non-IP choices, IP-based communications are well-established and easy to integrate to communicate with the other IP-based networks at minimal cost — a very promising choice!

Edge devices and more powerful IoT things (with continuous sources of power) can utilize the standard TCP/IP protocol stack and the Internet Protocol (e.g., IPv4, IPv6) for communications between each other or with external servers or cloud-based platforms. However, an IoT system -as a special form of a distributed system- in most cases engages low-power embedded devices. Such devices can be deployed in tens, hundreds, or even thousands and are expected to sense, process, communicate, and interact. The vast majority of such IoT things are typically battery-operated and have limited processing powers and restricted capabilities — so utilizing the standard TCP/IP protocol stack, including the traditional IP, might not be the optimal choice for the efficient operation of your IoT system!

By taking one step back, we can notice that such low-power IoT things -after being deployed in an environment (e.g., parking garage, agricultural area)- are engaged in periodic reporting of small amounts of data sensed and collected from such an environment. A large percentage of such IoT things is not expected to interact directly with users or cloud platforms; we usually interact and communicate with them through an IoT edge.

Is there a lightweight IP version for such low-power IoT devices and systems?! — yes, 6LoWPAN!

6LoWPAN -or IPv6 over Low-Power Wireless Personal Area Networks- is an adaptation for IPv6 to transport IP datagrams on Low-Rate Wireless Personal Area Network (LR-WPAN) — or what is referred to as the IEEE 802.15.4 based networks. In this short article, let’s discuss what 6LoWPAN is, but before that, let’s first take a quick look at what IEEE 802.15.4 is!

IEEE 802.15 and 802.15.4 — what are all these numbers?!

We usually use a wide range of communication technologies like Ethernet, Wi-Fi, and WiMax to implement systems; such technologies follow certain standards prepared and presented by working groups. We use certain numbers to refer to a collection of standards about certain technologies. For example, IEEE 802.3 is a working group that focuses on the technology of Ethernet and IEEE 802.11 is a working group that focuses on the technology of Wi-Fi. Under the umbrella of each working group, there are task groups that address certain specifications and requirements.

IEEE 802.15 is a working group that prepares and presents a collection of standards to build Wireless Personal Area Networks (WPAN), and -under this working group- there are task groups that target related but more specific projects. For example, IEEE 802.15.1 is the task group that focuses on the technology of Bluetooth as a form of WPAN with certain requirements. Back to our IoT system with the low-power IoT things, we can view such a scenario as a special type of WPAN. This shifts our focus to IEEE 802.15.4 — the collection of standards that address low-rate wireless personal area networks (LR-WANs).

Taking the OSI network model as our reference, the 802.15.4 standard defines the lower two layers of the network stack — the Physical (PHY) and the Media Access Control (MAC) layers — for the operation of LR-WPAN networks. The PHY is responsible for the actual transmission and reception of packets using modulation and demodulation techniques, along with other tasks related to synchronization and timing. The MAC layer is responsible for detecting and correcting errors and handling collisions. The rest of the layers are designed and defined by the other standards (e.g., 6LoWPAN, as we will discuss here) and technologies (e.g., Zigbee) to offer specific functionalities (e.g., Applications, higher-level communication, and networking services).

IEEE 802.15.4’s core features

In a lot of scenarios, changing or replacing batteries for IoT devices in large networks can be very difficult and costly. The 802.15.4 allows mesh networking in a power-efficient and cost-effective way.

  • Lower Data Rates: The 802.15.4’s main focus is on enabling data rates suitable for the operation of battery-powered devices (e.g., sensors). The standard data transfer rates range from 40 to 250 Kbit/s; the lower the data rate, the less power is consumed, and the less frequently the battery is replaced.
  • Small Data Frames: The data frames in 802.15.4 are kept in small sizes for faster transmission and to avoid the need for retransmissions in the case of radio interference or noise.
  • Different Frequency Bands: The 802.15.4 specifies that communication can occur in the 868 MHz, the 902–928 MHz, or the 2.4GHz Industrial Scientific and Medical (ISM) bands. The lower frequencies face fewer issues with interference, while the higher frequencies offer higher speed with shorter duty cycles on transmitting and receiving, thus conserving power. The 868 MHz band is available for European use, whereas the 902 MHz band is for the United States and Canada. The 2.4 GHz band is more popular as it is open in most countries worldwide.
  • Range: The typical range for 802.15.4 communication is roughly 200 meters for outdoor environments (in a line-of-sight test) and a typical range of 30 meters for indoor environments. Higher power transceivers and powerful antennas can extend such range.

Such features make the 802.15.4 an attractive option for low-power systems like IoT and WSNs, where ultra-low power consumption is a core requirement.

IEEE 802.15.4’s Network Structure

To build a WPAN, the 802.15.4 standard allows different network topologies that range from a decentralized peer-to-peer to a more centralized star topology. For the operation of a WPAN, the standard defines two types of devices: full-function device (FFD) and reduced-function device (RFD).

  • An FFD (also referred to as a router) is a more powerful device in terms of processing and power capabilities, can interact with any device (RFDs or other FFDs) in the network, and can relay communications from one point to another.
  • An RFD (also referred to as end-device) can be any other device in your IoT system (e.g., battery-operated sensor) and only communicates with FFDs.

An FFD can serve as a coordinator to set up and manage the WPAN and store information about connected devices. Typically, a PAN coordinator does not run on a battery and has a dedicated source of power. Every 802.15.4 needs at least one FFD for a small-scale network; while in larger networks, you may require more FFDs. In the second case, the network can be a large mesh or a tree structure connecting FFDs. FFDs can then coordinate different areas or clusters within the network and relay communication to higher or global levels.

IEEE 802.15.4’s Communication Styles

The 802.15.4 standard provides two main types of communication: beacon-based and beaconless.

In a beacon-based communication, a coordinator allows a device to enter the WPAN and transmits network beacons telling each of the connected devices when to use the channel. With no need for the continuous sending of data, an RFD can enter a sleep mode and wake up periodically for interactions, enabling very low power consumption.

In beaconless communication, all devices are in a receiving mode all the time, allowing the full use of the channel. However, the devices need to sense if the channel is clear from traffic (from other devices) before using it to send data. To mange the shared frequency space of the ISM bands, 802.15.4 utilizes some form of carrier sense multiple access with collision aviodance (CSMA/CA).

6LoWPAN — can we bring IP protocol to low-power devices?

The limited address space offered by IPv4 was the main motivation for the transition to IPv6. With the 128 bits offered by IPv6, we have a massive address space to accommodate evolving large-scale distributed systems like IoT. However, the typical size of an IPv6 datagram may still be not optimal for low-power IoT things — we need an adaptation layer. Such a layer resides between the network layer (layer three that hosts IPv6) and the IEEE 802.15.4 MAC layer.

The combination of IPv6 and the adaptation layer over IEEE 802.15.4 PHY and MAC layers (instead of the TCP/IP network model) creates the 6LoWPAN protocol stack — as shown below:

The adaptation layer performs a set of core functionalities that include:

  • Header compression: The typical header of IPv6 is 40 bytes and can be reduced way further to 10 bytes using IP header compression. An IPv6 address, as an IPv4, is divided into two parts: the network prefix (64 bits that tell us which network) and the host address (64 bits that tell us which device within certain network). Since the typical scenario is routing within one single network for local communication only, the header compression can take advantage of such a point. On the other hand, based on the size (the number of devices) of your 6LoWPAN-based network, the host address can also be further compressed to save more space.
  • Fragmentation: The adaptation layer also enables the transmission of IPv6 datagrams (that may be up to 1280 bytes) over IEEE 802.15.4-based network using dedicated fragmentation (127 bytes packets) and reassembly mecahnisms.

It is worth mentioning that a 6LoWPAN-based network is still an IP-based network, so the network prefix in the address can be configured to enable the global addressing of 6LoWPAN devices. For a 6LoWPAN-based network to be directly connected to another IP-based network, we need a tunneling mechnaism done through a border router — that is referred to as an Edge Router device. A LoWPAN edge router is typically connected to the Internet or another IP network over a backhaul link such as cellular. A LoWPAN edge router can also utilize IPv6 neighbor discovery and addressing mechanisms and maintain a table of devices to avoid IP address collisions and keep track of sleeping devices

… and what about the rest of 6LoWPAN Protocol Stack?

Above IEEE 802.15.4, any of the standard transport protocols (e.g., TCP, UDP) of TCP/IP layer 4 and any higher level application protocols (e.g., HTTP, SSH) of layer 5 can be used.

The transport layer generates communication sessions between applications running on end devices. UDP is preferred for being a lightweight connectionless transport protocol. UDP provides a lower overhead compared to TCP, with additional features such as reliability and security added as necessary.

The application layer protocols are responsible for data formatting and schemes. Protocols like HTTP running over TCP can present a large overhead for low-power networks, so it is not a typical communication option within 6LoWPAN-based networks. HTTP, however, can still be used by LoWPAN edge routers to communicate with the Internet and other IP-based networks. As an alternative, there are other application layer protocols that can work for low-power IoT things. One of the most commonly used protocols is the constrained application protocol (COAP), a message protocol running over UDP.

6LoWPAN and 802.15.4 standards, with all of the discussed flexibility and features, can be utilized in a wide range of applications that include healthcare, home automation, smart grid, and environmental and industrial monitoring.

…. I hope you find this article useful, and please feel free to reach out if you have any comments (i like discussions) or a related resource/tutorial you would like to share!

If you are an enthusiast about the Internet of Things (IoT) and distributed systems like myself, you might also be lost in the never-ending technologies, protocols, and fuzzy keywords that pop up as we read, design, or implement our systems (e.g., What are the differences between AMQP and MQTT?, Can we use HTTP for IoT?, Why don’t we use TinyOS for small sensors?, …. ).

As I enjoy learning about these topics and considering them in the IoT and Systems-related classes I teach, I also like summarizing such topics to help link and connect them together under the name of “IoTMadeSimple

Would you like to learn more?

Here are some recommended references:

--

--

Ahmed Khaled
Ahmed Khaled

Written by Ahmed Khaled

0 Followers

I am a systems enthusiast who likes to write short articles on distributed systems, data management and modeling, and the Internet of Things (IoT)!

No responses yet