TL;DR
The paper identifies critical scalability limitations in NetEm, the de facto standard for network emulation in Linux, which hinders the development of large-scale virtual edge and IoT testbeds. To overcome this, the authors propose a novel approach leveraging eBPF and the Linux kernel's early departure time (EDT) model, demonstrating significantly improved performance and configuration efficiency.
What Problem Does This Paper Address?
As the Internet of Things (IoT) and edge computing grow, there's an increasing need for realistic, large-scale virtual testbeds. These testbeds allow researchers and developers to evaluate complex distributed systems without the prohibitive cost and complexity of physical infrastructure. A key component of these testbeds is network emulation, which simulates real-world network conditions like latency, packet loss, and bandwidth limitations. However, the current state-of-the-art network emulator in Linux, NetEm, struggles to scale to the hundreds or thousands of nodes required for these large-scale scenarios. This paper aims to quantify NetEm's scalability limitations and propose a more efficient alternative.
Methods
The authors' proposed solution centers around leveraging eBPF (extended Berkeley Packet Filters) and the Linux kernel's early departure time (EDT) model.
Here's a breakdown:
- eBPF Programs: These are small, safe programs that run directly in the Linux kernel. The authors use eBPF to intercept outgoing network packets at the kernel's egress hook.
- eBPF Maps: These are key-value stores accessible from eBPF programs. The authors use two eBPF maps:
- One to store network link parameters (like bandwidth and latency) keyed by destination IP addresses.
- Another to store the last departure timestamp for packets sent to specific IPs, crucial for inter-packet gap calculations.
- EDT Model: This model allows packets to be scheduled for transmission based on their departure timestamp. The eBPF program calculates a new departure timestamp for each packet, incorporating the desired emulation parameters (delay, rate limiting).
- Timing Wheel Scheduler: This kernel component then releases the packet to the network interface precisely when its calculated departure timestamp is met.
- Testbed Agent: A user-space application that dynamically updates the eBPF maps with emulation parameters, allowing for flexible configuration of network conditions.
This approach contrasts with NetEm, which relies on complex queuing disciplines (qdiscs) and filters for each emulated link, leading to significant overhead.
Datasets
Not discussed in the paper. The authors conducted experiments using a custom setup on a Google Cloud Platform machine and a bare-metal machine, simulating network scenarios based on their work on Celestial, a LEO edge testbed.
Key Insights and Ideas
- NetEm's Scalability Bottleneck: The paper clearly demonstrates that NetEm's performance degrades significantly as the number of configured links (and thus filters/qdiscs) increases. This is due to the sequential nature of filter checking and the overhead of managing complex queuing structures.
- Configuration Overhead is a Major Hurdle: Beyond runtime performance, the setup time for NetEm becomes prohibitively long for large-scale testbeds. Configuring thousands of links can take hours, making iterative development and testing impractical.
- eBPF Offers a Constant-Time Lookup: By using eBPF maps keyed by destination IP, the proposed solution achieves near constant-time lookups for emulation parameters. This is a fundamental advantage over NetEm's linear scan of filters.
- EDT and Timing Wheels are Powerful for Emulation: The combination of the EDT model and timing wheel scheduler provides a precise and efficient mechanism for controlling packet departure times, enabling accurate emulation of latency and rate limiting.
- Simplified Architecture: The eBPF-based approach significantly simplifies the configuration and management of network emulation compared to NetEm's intricate qdisc hierarchy.
Key Results
- Latency: NetEm's latency increases linearly with the number of filters, reaching up to 6ms with 65,000 filters. The eBPF approach maintains a near-constant, negligible overhead of around 0.1ms, even with the same number of entries.
- Configuration Time: Configuring a single link in NetEm can take up to 47.4ms at scale, leading to over three hours to configure 1024 links. The eBPF map filling for 65,000 entries takes approximately 170ms, with updates being very fast.
- Bandwidth: While NetEm shows an initial increase in throughput with a few thousand filters (up to 7.3 Gbit/s), it then drastically drops to 0.4 Gbit/s with 65,000 filters. The eBPF approach maintains a consistently high throughput, close to the theoretical maximum (around 4.53 Gbit/s in their nested virtualization setup).
- Accuracy: The eBPF prototype demonstrates comparable accuracy to NetEm in emulating latency and bandwidth limitations.
Limitations and Future Work
- Limitations:
- The current eBPF prototype omits more sophisticated emulation features like delay distribution and packet loss/corruption.
- The performance results for NetEm were observed in a nested virtualization environment (Firecracker microVMs), and the authors note that some anomalies might be specific to this setup.
- Future Work:
- The authors suggest that features like delay distribution and packet loss/corruption could be implemented by adapting methods from XNetEm.
- They are integrating their eBPF-based solution into a large-scale virtual testbed and hope it will benefit the research community.
- Further research is motivated for scenarios deviating from the nested virtualization use case, particularly on bare-metal machines.
Summary updated