scieee AI-readable full text Open interactive document viewer

Wmediumd for 802.15.4: Bridging the Gap Between Simulation and Physical Testbeds

Reis Fontes, Ramon dos

Abstract

Realistic emulation of wireless communication is essential for the development and validation of protocols in lowpowernetworks. While tools like Wmediumd provide accurate medium emulation for IEEE 802.11, no equivalent exists for IEEE802.15.4, an important standard underlying protocols such as ZigBee, Thread, and 6LoWPAN. This paper presents an extensionof Wmediumd to support IEEE 802.15.4, enabling probabilistic modeling of wireless effects such as interference, attenuation, andpacket loss. By integrating with the existing mac802154 hwsim kernel module, our approach allows for accurate, reproducibleexperimentation in virtual environments. We demonstrate the emulator’s effectiveness through scenarios involving range-basedcommunication and unstable links, highlighting its potential for advancing research and testing in IoT and low-power wirelessnetworks.

Full text

Wmediumd for 802.15.4: Bridging the Gap Between Simulation and Physical Testbeds 1st Ramon Fontes Metropole Digital Institute Federal University of Rio Grande do Norte Natal, Brazil [email protected] 2nd Eduardo Cerqueira Institute of Technology Federal University of Par´ a Par´ a, Brazil [email protected] 3rd Christian Rothenberg Faculty of Electrical and Computer Engineering University of Campinas Campinas, Brazil cheste[email protected] Abstract—Realistic emulation of wireless communication is essential for the development and validation of protocols in lowpower networks. While tools like Wmediumd provide accurate medium emulation for IEEE 802.11, no equivalent exists for IEEE 802.15.4, an important standard underlying protocols such as ZigBee, Thread, and 6LoWPAN. This paper presents an extension of Wmediumd to support IEEE 802.15.4, enabling probabilistic modeling of wireless effects such as interference, attenuation, and packet loss. By integrating with the existing mac802154 hwsim kernel module, our approach allows for accurate, reproducible experimentation in virtual environments. We demonstrate the emulator’s effectiveness through scenarios involving range-based communication and unstable links, highlighting its potential for advancing research and testing in IoT and low-power wireless networks. Index Terms—IEEE 802.15.4, wmediumd, realistic emulation I. INTRODUCTION Wireless networking technologies are fundamental to modern digital infrastructure, particularly in IoT deployments that rely on low-power and resource-constrained devices. While protocols such as IEEE 802.11 (Wi-Fi) are well-supported by mature simulation and emulation tools, low-power standards like IEEE 802.15.4, which serve as the foundation for ZigBee, Thread, and 6LoWPAN, and others, often lack realistic, flexible test environments for system-level experimentation. One of the core challenges in IEEE 802.15.4 networks is the need to operate under strict energy and processing constraints [1]. Devices typically rely on batteries and have limited computational capabilities, which makes it essential to optimize communication strategies. In this context, network emulation becomes critical, as it allows testing under realistic conditions, enabling evaluation of channel access mechanisms, transmission behavior, and power usage. Another important factor is interference, as IEEE 802.15.4 operates in the crowded 2.4 GHz band, where it coexists with technologies such as Wi-Fi and household devices like microwave ovens [2]. Emulating interference and signal degradation in a controlled environment helps identify vulnerabilities and test mitigation strategies to improve reliability. To address these challenges, this paper introduces wmediumd 802154, an extension of the wmediumd [3] wireless medium emulator originally designed for Wi-Fi, now adapted to support IEEE 802.15.4. Integrated with the mac802154 hwsim Linux driver, wmediumd 802154 enables real-time emulation of IEEE 802.15.4 networks with configurable interference modeling, loss patterns, and topology control. To evaluate our proposal, we present three experimental scenarios: (i) per-link loss mprobability model; (ii) per-lik signal-to-noise ratio; and (iii) and an interference model that supports mobility. The main contributions of this work are as follows: we (i) extend the mac802154 hwsim kernel module to support user-space communication through the Netlink interface, enabling integration with wmediumd 802154; (ii) implement interference modeling, signal degradation, and probabilistic packet delivery based on propagation parameters; (iii) design a modular and extensible framework for IEEE 802.15.4 medium emulation that mirrors the successful approach used in Wmediumd for IEEE 802.11; and (iv) validate the proposed solution through emulation experiments scenarios described above. The remainder of this paper is structured as follows. Section 2 provides the background and foundational concepts; Section 3 reviews related work in the field; Section 4 presents the proposed system architecture, while Section 5 evaluates wmediumd 802154 in three diferente scenarios; Finally, Section 6 concludes the paper and outlines future directions. II. BACKGROUND The development and validation of protocols for low-power wireless networks depend heavily on reliable testing environments that can emulate realistic conditions without the need for physical hardware. In this context, mac802154 hwsim plays a pivotal role as it provides a kernel-level simulation of IEEE 802.15.4 radio interfaces. By creating virtual transceivers that integrate seamlessly with the Linux mac802154 stack, this module enables researchers and developers to prototype, debug, and evaluate protocol behavior in a fully controlled and reproducible setting. Its importance lies in the ability to simulate complex wireless topologies and interactions using only software, thus reducing the cost, complexity, and constraints associated with physical testbeds. As a foundation for more advanced emulation platforms, such as those incorporating probabilistic medium behavior, mac802154 hwsim is an essential building block for modern experimentation in IoT and wireless sensor networks. The architecture and operation of mac802154 hwsim revolve around its role as a kernel module that provides virtual IEEE 802.15.4 radios. When the module is loaded, it initializes a specified number of virtual radio interfaces, each simulating the behavior of a physical IEEE 802.15.4 transceiver. These interfaces are fully integrated with the Linux mac802154 stack, meaning they can be configured and managed using standard tools and layered with upper-layer protocols such as 6LoWPAN or RPL. Internally, each virtual radio is treated by the kernel in the same way as a physical device. The radios can be configured independently with parameters like PAN ID, channel, and device addresses. When a frame is transmitted by one of these virtual radios, the module checks for other radios that are configured on the same channel. If such radios exist, the frame is directly forwarded to them, creating a basic point-tomultipoint communication model. However, this environment is idealized: there is no signal attenuation, interference, or packet loss modeled in this default setup. All transmissions are assumed to be successful if the radios share the same channel and PAN configuration. To address this limitation and introduce realistic wireless behavior towards network emulation, mac802154 hwsim can be integrated with user-space applications. In this extended setup, when a radio transmits a frame, the module hands it off to an emulator via Netlink sockets. The emulator then applies probabilistic rules based on a model of the wireless medium, taking into account factors like signal strength, distance, and interference, before deciding whether the frame should be delivered, dropped, or corrupted. If the frame is approved, it is cloned and delivered back into the kernel via the virtual interface of the receiving radio. This feedback loop completes the emulated transmission process and provides acknowledgments to the sender, thus mimicking a real wireless communication environment in software. Through this architecture, mac802154 hwsim enables the development and testing of low-power wireless network protocols entirely within a virtualized environment, with the ability to incorporate complex and dynamic conditions that resemble real-world deployments. A. From Real Radios to Virtual Testing: The Role of Wmediumd The WLAN driver architecture in the Linux kernel follows a design pattern similar to other network device (netdev) drivers. Typically, wireless hardware connects to the system via interfaces such as PCI or USB, and the corresponding driver implementation depends on the type of interconnect used. From the perspective of higher network layers, a wireless netdev behaves similarly to a traditional Ethernet interface, but with added functionalities specific to wireless communication such as support for ad hoc modes. Originally, network interface cards implemented most lower-layer protocols, including Medium Access Control (MAC), directly in hardware or embedded firmware. This approach limited flexibility for developers, as the proprietary nature of firmware restricted access and customization. To address these limitations, newer generations of wireless devices transitioned toward a software-based MAC architecture. In this model, known as SoftMAC, MAC functionalities are implemented in software and loaded as kernel modules, enabling greater flexibility and control. The adoption of SoftMAC significantly expanded development opportunities for both the research and open-source communities by exposing the internal behavior and protocol logic of wireless networking stacks. This shift enabled deeper experimentation, rapid prototyping, and the customization of MAC-layer functionalities. Consequently, the testing and development of new features for IEEE 802.11 networks have gained growing importance. However, accurately replicating real-world wireless conditions, such as interference, signal fading, and mobility-induced packet loss remains a major challenge. These phenomena typically require elaborate and costly physical testbeds, limiting the accessibility and scalability of experimental validation. To address this, the company Cozybit developed wmediumd1, a userspace tool that emulates the wireless medium by introducing probabilistic transmission errors in virtualized environments (e.g., with Mininet-WiFi [4]). Wmediumd [3] interacts with the Linux kernel to simulate realistic wireless behavior, such as frame loss and interference, enabling more accurate testing of drivers and protocol stacks without the need for real radios. B. Gaps in Emulation for Low-Power Wireless Protocols While IEEE 802.11 dominates WLAN use cases, IEEE 802.15.4 is the foundation for many low-power wireless networks and IoT protocols, including ZigBee, Thread, and 6LoWPAN/RPL. This standard is designed for low energy consumption, low data rates (sufficient for sensors), highly dynamic mesh topologies, and others. Just like 802.11, 802.15.4 networks are affected by interference, signal loss over distance, multipath effects, crosstechnology interference, and mobility (e.g., in mobile sensor networks or drone-based monitoring). Therefore, realistic simulation/emulation tools are essential for developing and validating, routing protocols (e.g., RPL), energy-saving strategies, reliable communication for critical applications (e.g., disaster monitoring), and others. Despite these needs, there is currently no widely adopted open-source tool that offers 802.15.4 emulation capabilities comparable to what Wmediumd provides for 802.11 networks. This lack of a realistic, configurable, and reproducible test environment for 802.15.4 creates a major gap in the research and development process. Without such tools, researchers are often forced to rely on either simplified simulation environments, which may not reflect real-world dynamics, or costly and inflexible physical 1https://github.com/cozybit/wmediumd testbeds. As a result, evaluating protocol behavior under realistic wireless conditions remains a significant barrier, particularly for resource-constrained IoT devices where behavior is highly sensitive to environmental factors. The extension of Wmediumd to support IEEE 802.15.4, as proposed in this work, addresses this critical gap by enabling software-defined control of wireless medium characteristics, including interference, signal strength, and packet loss, tailored for the unique constraints of low-power wireless networks. III. RELATED WORK When comparing our implementation of wmediumd 802154 with other emulation platforms, few tools have contributed significantly to network experimentation. Notable examples include ns-3 [5], OMNeT++ [6], and Cooja, a simulator integrated with the Contiki OS [7]. Each of these solutions offers valuable features but also presents limitations when compared to the flexibility and realism provided by wmediumd 802154 combined with mac802154 hwsim. ns-3 is a powerful and widely used network simulator, supporting detailed modeling of IEEE 802.15.4 MAC and PHY layers. It enables comprehensive analysis of low-power networks through customizable simulation scenarios. However, as a discrete-event simulator, it lacks real-time interaction capabilities and does not natively support full system-level execution. Additionally, it relies on custom APIs rather than standard system calls, making it less suitable for integration with real-world applications, cryptographic libraries, or SDN experimentation. OMNeT++ is another modular and extensible simulator, well-suited for simulating large-scale and heterogeneous IoT networks. It supports a wide range of communication protocols, including IEEE 802.15.4, and offers visual tools for debugging and analysis. Nonetheless, it shares ns-3’s limitations regarding real-time execution and the absence of native SDN integration. Its simulation kernel is not designed for live interaction with Linux-based applications or user-space protocols. Cooja, although historically important, has become increasingly outdated. Developed as part of the Contiki OS ecosystem, it is tailored for simulating sensor network firmware and supports protocols such as RPL and 6LoWPAN. While Cooja is effective for firmware-level validation and visualizing node behavior, reliance on emulated hardware platforms (e.g., MSP430), lack of support for standard Linux networking tools, and incompatibility with modern security stacks. Moreover, it does not support SDN integration or realistic experimentation with modern cryptographic techniques, making it less suitable for current IoT research involving system-level protocols or post-quantum security. In contrast, mac802154 hwsim, integrated with our enhanced wmediumd 802154, offers a kernel-level emulation framework that enables real-time communication between virtual IEEE 802.15.4 interfaces. It supports actual Linux networking stacks, allowing experimentation with real applications, tools such as tcpdump and Wireshark, and libraries Fig. 1. Wmediumd 802.15.4 Architecture. including OpenSSL or post-quantum cryptography frameworks. Furthermore, it can be easily extended and integrated with SDN tools (e.g., Open vSwitch, network namespaces), enabling programmable control over low-power networks, an aspect lacking in traditional emulators. IV. WMEDIUMD 802.15.4 Figure 1 illustrates the architecture of Wmediumd 802.15.4, which allows realistic emulation of IEEE 802.15.4 wireless communication within the Linux operating system. At the core of this setup is the wmediumd 802.15.4 component, a user-space daemon responsible for simulating the behavior of the wireless medium, such as signal degradation, interference, and probabilistic frame loss. It interacts with the Linux kernel through the netlink interface, allowing it to control and monitor virtual radio interfaces. The radios themselves are simulated by the mac802154 hwsim kernel module, which creates multiple virtual IEEE 802.15.4 radios (Radio #1 to Radio #n). These radios are grouped by communication channels (e.g., channel x), meaning that only radios on the same channel can potentially communicate with each other. Frames transmitted by one radio are intercepted by wmediumd 802154, which determines based on its internal model whether the frame should be delivered, dropped, or corrupted before forwarding it to the destination radio. This architecture allows developers and researchers to emulate complex and dynamic wireless environments for IEEE 802.15.4 without the need for physical hardware, significantly improving the efficiency of testing and development for IoT and low-power wireless network protocols. Figure 2 illustrates the internal processing of frame transmission using mac802154 hwsim, integrating wmediumd 802154 logic for medium emulation. The dotted lines in the figure represent components or steps implemented or modified by us. •Frames In: The process begins when a frame is received by the virtual radio interface implemented by mac802154 hwsim; •Transmission Handler: The system invokes hwsim hw xmit() to handle the outgoing frame. At this point, the function checks whether the netlink communication (with Wmediumd) is active; Fig. 2. Frames Processing Pipeline. •If netlink is not running, the frame is passed directly to hwsim hw receive(), bypassing any emulation logic. Otherwise, the frame enters the Wmediumd emulation pipeline for further processing; •Frame Transmission Request: The frame is then passed to mac802154 hwsim tx frame nl(), which prepares it to be processed by Wmediumd; •Frame Processing: Wmediumd receives the frame via netlink and calls process recvd data() to simulate realistic medium behavior; •Frame Delivery Decision based on its internal medium model (signal strength, interference, distance, etc.), Wmediumd applies a probabilistic rule to determine whether the frame should be delivered via apply prob rate(); •If the frame is not to be delivered, the activity ends here. Otherwise, the process proceeds to send cloned frame msg(); •Transmission Acknowledgment: report the transmission result back to the sender, completing the emulated delivery process with send tx info frame nl(); •Frame Cloning and Delivery: Finally, the frame is cloned and passed back into the virtual interface of the receiving radio via send cloned frame msg(). V. EVALUATION To validate the feasibility and effectiveness of wmediumd 802154, we conducted a series of emulation experiments using virtual IEEE 802.15.4 radios instantiated via our modified mac802154 hwsim module. This version incorporates support for Signal-to-Noise Ratio (SNR), packet loss, and an interference-aware propagation model. The goal of these experiments was to assess the impact of link-level configurations on packet delivery and to verify the correct operation of the medium emulation logic under realistic wireless conditions. As illustrated in Figure 3 and for sake of simplicity, the evaluation environment comprises three virtual sensor nodes (sensors 0, 1, and 2) arranged in a tree network topology, with sensor 0 serving as the coordinator node. Pairwise communication edges were manually configured between radios using the well known by the Linux kernel community wpan-tools2, representing the connectivity matrix of the wireless medium. 2https://github.com/linux-wpan/wpan-tools/ Sensor1 Sensor0 (coordinator) Sensor2 Fig. 3. Network Topology. To facilitate reproducibility and enable further experimentation, all configuration files and scripts used in the evaluation will be made publicly available upon the release of the final version of this paper. A. Per-link loss probability model Wmediumd 802154 provides a straightforward mechanism for emulating imperfect wireless communication by assigning fixed packet loss probabilities to individual links. This enables emulation of the wireless medium with deterministic loss behavior, offering a more realistic alternative to an idealized, error-free environment. In this model, the user specifies a probability value for each link, representing the likelihood of packet loss, where values range from 0.0 (no loss) to 1.0 (100% loss). This configuration is particularly useful for creating reproducible and deterministic test scenarios involving lossy links or intentional connectivity gaps. Each loss probability is defined in a link configuration block as a tuple in the format (source, destination, error prob), where error prob denotes the fixed packet drop rate for that specific link. Although this error model is static and does not account for dynamic factors such as signal degradation over distance, mobility, or varying data rates, it serves as a valuable tool for baseline testing, topology enforcement, and controlled scenario reproduction. In our experiments, we successfully applied this configuration to emulate varying link qualities, demonstrating that wmediumd 802154 accurately enforces the specified packet delivery probabilities. For instance, when transmitting 10 ICMP packets, setting an error prob of 0.2 and 1.0 resulted in approximately 20% and 100% packet loss, respectively. B. Per-link signal-to-noise ratio (SNR) model The per-link signal-to-noise ratio (SNR) model provides fine-grained control over the quality of wireless connections between virtual radios, allowing the emulation of asymmetric and heterogeneous network topologies. Low SNR values can significantly degrade or even block communication between nodes, accurately reflecting real-world scenarios where poor signal quality limits connectivity. SNR values are also specified within a link configuration block. Each link is also defined as a tuple in the format (source, destination, snr), where source and destination correspond to the indices of virtual radios, and snr is a numerical value representing the signal-to-noise ratio. In our experiments, we successfully applied this model to create controlled scenarios with both stable and unstable links. For instance, we configured the SNR value between Sensor0 and Sensor1 to 35 dB and between Sensor1 and Sensor2 to 8 dB. As expected, communication between Sensor0 and Sensor1 remained stable, with near-zero packet loss, while communication with Sensor2 exhibited frequent delivery failures and significant RTT variability due to the lower SNR. Additionally, when the SNR was further reduced below 5 dB, packet delivery between Sensor1 and Sensor2 became virtually impossible, confirming that wmediumd 802154 reliably blocks transmissions in low-SNR environments. These results demonstrate the emulator’s ability to reflect the asymmetric and lossy nature of real-world wireless channels, making it a valuable tool for testing the robustness of routing protocols and adaptive communication strategies in low-power IoT networks. C. Interference We now evaluate how the wmediumd 802154 handles interference and connectivity constraints based on link configuration, signal range, inter-node distance. Although wmediumd 802154 supports a variety of propagation models widely recognized in the literature, such as Friis, Log-Distance, ITU, Log-Normal Shadowing, among others, we chose to adopt the Log-Distance propagation model for our evaluation. By simulating realistic wireless conditions, the emulator enables validation of packet delivery behavior in scenarios involving communication loss, unstable links, and distance-induced degradation. 1) Out-of-Range Communication - No Link Established: This experiment evaluates a basic connectivity scenario involving spatial separation between sensor nodes. In this setup, Sensor0 and Sensor2 are intentionally positioned beyond each other’s communication range, resulting in the absence of a direct link between them. Consequently, all packet transmission attempts between these nodes result in total loss, as the lack of overlap in their communication ranges prevents any successful delivery. These experiments were conducted successfully and closely mirror those using the per-link SNR model. However, unlike the manually defined SNR values in the previous scenario, here the signal-to-noise ratio is automatically computed based on the relative position and distance between nodes, using the Log-Distance propagation model, enabling dynamic and realistic calculation of signal attenuation. This approach allows the emulator to determine link feasibility without requiring manual SNR input, making it particularly useful for scenarios involving node mobility or realistic spatial layouts. The observed 100% packet loss between Sensor0 and Sensor2 confirms that wmediumd 802154 accurately enforces communication constraints based on propagation-based SNR estimation. 2) Unstable Connectivity: This experiment investigates the behavior of the emulator under conditions in which nodes are technically within communication range, but link quality is impaired due to distance-induced attenuation. Sensor0 maintains a stable connection with Sensor1, indicating adequate signal strength for consistent communication. In contrast, Sensor2 is deliberately placed near the edge of the radio’s effective range, resulting in an unreliable and unstable connection. While occasional packet reception may occur due to marginal signal presence or leakage, the increased distance and reduced SNR lead to intermittent or failed transmissions. This behavior underscores the emulator’s ability to capture and model the subtleties of real-world wireless degradation. The scenario is conceptually similar to the fixed probability loss model presented earlier; however, instead of defining delivery probability manually, here the signal-to-noise ratio (SNR) is calculated automatically based on the physical distance between nodes and the Log-Distance propagation model. This outcome highlights how wmediumd 802154 dynamically adjusts delivery probability based on environmental factors, providing a realistic emulation of wireless behavior. The observed packet loss and RTT variability further reinforce the importance of modeling distance, interference, and signal degradation in the evaluation of IEEE 802.15.4-based lowpower networks. VI. CONCLUSION This work presented wmediumd 802154, an extension of the Wmediumd framework to support realistic emulation of IEEE 802.15.4 wireless networks. By integrating the mac802154 hwsim kernel module with probabilistic wireless medium models, the proposed solution enables accurate emulation of key phenomena such as packet loss, interference, and signal degradation in a fully controlled virtual environment. The experimental scenarios demonstrated the emulator’s ability to accurately represent both stable communication links and the challenges of degraded or lost connectivity due to distance and interference. Future work will aim to enhance the interference models further by incorporating mobility, time-varying conditions, and environmental dynamics, increasing the realism and applicability of the emulator. Additionally, we envision extending the framework to support hybrid experimentation setups, allowing integration with physical IEEE 802.15.4 devices. This would enable mixed virtual/real testbeds, improving the fidelity of experiments while maintaining control and scalability. REFERENCES [1] A. Adeel et al., “A survey on the role of wireless sensor networks and iot in disaster management,” Geological disaster monitoring based on sensor networks, pp. 57–66, 2019. [2] R. Hassan, M. Rahman, and M. Shakir, “Performance analysis of ieee 802.15.4 for wireless sensor networks,” International Journal of Computer Applications, vol. 175, no. 6, pp. 30–35, 2017. [3] A. Mart´ ınez Ill´ an, “Medium and mobility behaviour insertion for 802.11 emulated networks,” Master’s thesis, Universitat Polit` ecnica de Catalunya, 2013. [4] R. R. Fontes, S. Afzal, S. H. Brito, M. A. Santos, and C. E. Rothenberg, “Mininet-wifi: Emulating software-defined wireless networks,” in 2015 11th International conference on network and service management (CNSM), pp. 384–389, IEEE, 2015. [5] ns 3, “ns-3: Discrete-event network simulator,” 2024. Accessed: 202506-05. [6] OMNeT++, “Omnet++: Discrete event simulator,” 2024. Accessed: 202506-05. [7] C. OS, “Contiki: The open source operating system for the internet of things,” 2024. Accessed: 2025-06-05.