Abstract
Container overlay networks are essential for cloud-native flexibility but introduce substantial performance overhead due to the complexity of the Linux kernel networking stack. This paper presents ONCache, a high-performance overlay network solution that utilizes eBPF-based cross-layer caching to bypass redundant processing. By exploiting the "invariance property" of network flows, ONCache implements a fast path that achieves near-bare-metal performance while maintaining compatibility with standard overlay protocols like VXLAN. Experimental results demonstrate significant improvements in throughput and latency across various microbenchmarks and real-world applications.
Introduction
Standard container overlay networks, such as those utilizing VXLAN, are the industry standard because they decouple container IP addresses from the underlying physical network. This abstraction allows for seamless container migration and simplified deployment. However, this flexibility comes at a steep performance price. When a packet travels through a standard overlay, it must navigate a "gauntlet" of kernel modules, including virtual ethernet (veth) pairs, bridge/OVS switching, connection tracking (conntrack), and complex tunneling stacks. Previous research has found that this overhead can reduce TCP throughput by 11% and request-response transaction rates by 29% compared to bare-metal configurations.
System Design and Methods
ONCache is designed as a "plug-in" for existing container network interfaces (CNIs) like Antrea or Flannel. Its core innovation is a cross-layer cache implemented using eBPF (extended Berkeley Packet Filter) at the Traffic Control (TC) hook point.
The system relies on three primary caches:
- Egress Cache: Stores pre-calculated outer headers and routing results for outgoing packets.
- Ingress Cache: Stores intra-host routing results to quickly deliver incoming packets to the correct container.
- Filter Cache: Stores the "allow/deny" decisions from firewalls and security policies.
The workflow begins with an initialization phase where the first few packets of a new flow pass through the standard "slow path" (the original CNI). Once the flow is established, ONCache captures the results and populates its caches. Subsequent packets in that flow bypass the entire kernel networking stack via a "fast path." An eBPF program performs a cache lookup, applies the necessary headers, and redirects the packet directly to the network interface. If a cache miss occurs, the system transparently falls back to the standard overlay network.
Key Insights: The Invariance Property
The fundamental insight behind ONCache is the "invariance property": for a given network flow, the results of routing, filtering, and tunneling are almost always identical for every packet. Instead of re-calculating these results millions of times per second, ONCache caches the final result. Unlike traditional optimizations that focus on a single layer (e.g., OVS internal caches), ONCache is "cross-layer," treating the entire journey from the container's virtual interface to the physical wire as a single cacheable event. This minimalist implementation is achieved in just 524 lines of eBPF C code.
Evaluation and Results
The system was evaluated on a Kubernetes cluster (v1.23.6) using Cloudlab nodes equipped with AMD EPYC processors and 100 Gbps Mellanox NICs. Benchmarks included iperf3 for throughput and netperf for transaction rates, alongside real-world applications like Memcached, PostgreSQL, and Nginx.
Key results include:
- Throughput: TCP throughput improved by up to 12%, while UDP throughput saw a 20% increase compared to standard Antrea overlays.
- Latency and Transaction Rates: TCP transaction rates increased by 36%, and UDP rates by 34%.
- Application Performance: Memcached average latency dropped by 22.7%, and PostgreSQL transaction rates increased by 29.4%. Nginx (HTTP/1.1) request latency was reduced by 21.5%.
- Efficiency: Per-transaction CPU overhead was reduced by approximately 26%.
Limitations and Future Directions
Despite its performance gains, ONCache has limitations. It does not natively support packet-based filters that rely on non-invariant data, such as filters that change behavior based on specific sequence numbers or payload content. Furthermore, while ONCache bypasses much of the stack, the default version still incurs overhead from traversing network namespaces.
To address namespace traversal, the authors proposed an optional bpf_redirect_rpeer function, though this requires custom kernel modifications. Future work also includes exploring "rewriting-based tunneling protocols" to eliminate the byte overhead of standard VXLAN headers entirely. In conclusion, ONCache demonstrates that eBPF-based cross-layer caching can effectively bridge the performance gap between flexible overlay networks and bare-metal performance.
Summary updated