Abstract—Traditional TCP still lacks the ability to differentiate between losses primarily caused by congestion from those caused by physical layer errors. This may severely impair performance, especially in data-intensive science applications over high-capacity and long-distance dynamically reconfigurable transparent optical networks. This work proposes and experimentally implements a variant of TCP Cubic designed for reconfigurable networks to turn transport layer tolerant to non-congestion losses and variable RTT exploiting available bandwidth more efficiently. This is done by designing a congestion window (cwnd) reduction mechanism that conditions loss reactions on evidence of congestion, given by RTT measurements. In addition, Flex-Cubic aims to supports dynamic parameter tuning and higherprecision timing, resulting in greater stability and improved bandwidth utilization. Thus, eBPF has been used as a platform for TCP congestion control algorithm (CCA) implementation, enabling new algorithms to be loaded into the kernel via JIT at runtime, without recompilation. Through struct ops and maps, eBPF allows per-flow instrumentation and dynamically CCA adaptation.
Index Terms — Congestion Control Algorithms, eBPF
| Seal | Description |
|---|---|
| SeloD — Available | Source code, scripts, and documentation are publicly available at this repository |
| SeloF — Functional | The eBPF algorithm compiles, loads into the kernel, and runs controlled network experiments |
| SeloS — Sustainable | Modular structure with documented parameterization and runtime dynamic configuration |
| SeloR — Reproducible | All paper results can be reproduced using the provided scripts (see Scripts/README.md) |
Flex-Cubic/
├── bpf_cubic/ # eBPF implementation of Flex-Cubic
│ ├── bpf_cubic.c # Flex-Cubic source code
│ ├── bpf_tracing_net.h # Auxiliary network header
│ ├── Makefile # Build rules
│ └── README.md # Code architecture and API documentation
├── Install/
│ ├── setup_ebpf_env.sh # Automated environment setup script
│ └── README.md # Step-by-step installation and dependency guide
├── Scripts/
│ ├── exe.sh # Main experiment runner (all β configurations)
│ ├── exe_alg.sh # Per-configuration loop (delay × loss × queue)
│ ├── exe_plot.sh # Graph generation for all configurations
│ ├── topo_beta.py # Mininet topology and iperf3 orchestration
│ ├── plot_iperf_multi_queue.py # Throughput/RTT/cwnd plotting script
│ └── README.md # Experiment execution and reproduction guide
├── Images/ # Result figures referenced in the paper
├── requirements.txt # Python dependencies (pip install -r requirements.txt)
├── LICENSE # GPL-2.0 license
└── README.md # This file
Note:
bpf_cubic.oandvmlinux.hwere compiled on a Linux 6.5 kernel. If your kernel version differs, regenerate them by following Install/README.md.
| Component | Version |
|---|---|
| OS | Ubuntu 22.04 LTS |
| Linux kernel | ≥ 6.5 (with eBPF struct_ops + TCP CCA BPF support) |
| clang / llvm | 14 |
| bpftool | ≥ 7.3 |
| Mininet | 2.3.1b4 |
| Open vSwitch | ≥ 2.13 |
| iperf3 | ≥ 3.9 |
| Python | 3.10+ |
| numpy | ≥ 1.21 |
| matplotlib | ≥ 3.5 |
Minimum kernel requirement: Linux ≥ 6.1 with CONFIG_BPF_JIT=y, CONFIG_NET_SCH_FQ=y, and TCP congestion control via BPF (tcp_congestion_ops struct_ops) enabled.
⚠️ Root privileges are required. All scripts andbpftoolcommands must be run withsudoor asroot.Running these experiments will:
- Register a custom TCP congestion control algorithm into the running kernel
- Temporarily change the system-wide default TCP algorithm via
sysctl- Create Mininet virtual network namespaces and virtual interfaces
Recommendation: use an isolated VM or a dedicated test machine. Restore the system defaults after experiments:
sudo sysctl -w net.ipv4.tcp_congestion_control=cubic sudo bpftool struct_ops unregister name cubic
To reproduce the experiments presented and analyzed here, consult the instructions in the directories Install and Scripts. For the source code of the TCP Flex-cubic algorithm, consult the file Flex-Cubic source code.
For a simple functionality test, it is necessary to first follow the step-by-step instructions described in the Install directory and then execute item 4. The execution will only start the mininet with the network topology, performing connection tests between hosts for approximately 200 seconds, and will export the iperf3 results to JSON files. This is a simple test of the TCP bpf_cubic functionality, not exporting enough data to generate comparison graphs like those illustrated in the complete work.
A structural limitation remains in most CCAs in the differentiation between losses caused by congestion events, illustrated in Fig 1 (a), and those caused by corrupted bits at physical layer by noise and interference, which is depicted in Fig 2 (b). In long-distance optical fibers, free-space optical (FSO) links subject to atmospheric turbulence, and satellite communications links under noise and interference, a non-negligible fraction of packet losses stems from residual bit errors rate (BER), and not from buffer overload.
Fig 1 - Discarding of packets due to: (a) buffer overload, (b) packet corruption, and (c) packet timeout.
As a result, losses caused by corrupted packets are interpreted as congestion signals, causing cwnd reductions, unwarranted rate oscillations, and systematic under-utilization of available bandwidth. In this work, we focus on networks composed of high Bandwidth-Delay Product (BDP) links, where this effect is particularly severe, as window recovery after a reduction may require tens or hundreds of RTTs, significantly degrading average throughput, while also highlighting the behavior of loss-based algorithms.
In addition, there are strong dependence of congestion control on RTT. Route reconfigurations in adaptable networks may impose different propagation delays to in-flight packets of a given flow, as illustrated in Fig 1 (c) triggering a loss event. Classic performance models show that TCP throughput is proportional to cwnd/RTT and inversely proportional to
For simplicity, a Dumbbell topology was adopted, with four hosts (H1-H2 and H3-H4 pairs), access and core switches Fig. 2. This configuration supports to evaluate the behavior of the TCP Cubic and Flex-Cubic algorithms when competing for bandwidth resources under network links with different one-way delay (OWD) values (10, 25, and 50 ms), packet loss rates ranging from 0% to 2% (introduced via \textit{tc}—traffic control) to emulate losses caused by corrupted packets at physical layer, and throttling of intermediate node buffer queues to values ranging from 100% to 25% of the bandwidth delay product (BDP) in order to intensify the response to packet overload. Here, the values of delays, and consequently values of minimum RTT (20, 50, and 100 ms). Each experiment involves two concurrent long-lived TCP flows sharing the bottleneck link, allowing controlled observation of bandwidth competition under identical configurations, and no background traffic was added to focus on TCP behavior under bit-error-induced losses. The experiment focused on the direct comparison between the standard TCP Cubic from the Linux kernel and the Flex-Cubic algorithm proposed in this work.
Fig 2 - Topology adopted and results of competition between two (partially overlapping) flows using standard TCP Cubic vs. Flex-Cubic with losses and queue bottlenecks.
The behavior of TCP regarding the congestion window dynamics is strongly influenced by the parameters
The parameter \textit{C} controls the constant of the cubic function is responsible for the growth of the cwnd over time. Higher values of \textit{C} produce a faster and more aggressive increase of the congestion window, allowing the flow to return more quickly to its previous maximum value. In contrast, reducing \textit{C} smooths the cubic growth curve, delaying the recovery of the cwnd.
The joint tuning of these parameters enables TCP Cubic to be adjusted toward more or less aggressive behavior, according to the constraints and operating conditions imposed by the network.
Fig. 3 - Throughput comparison between Cubic and Flex-Cubic (β = 0.3,C = 41)
Fig. 4 - Throughput comparison between Cubic and Flex-Cubic (β = 0.7,C = 41)
Fig. 5 - Throughput comparison between Cubic and Flex-Cubic (β = 0.9,C = 41)
The results indicate that Flex-Cubic mitigates key limitations of traditional TCP Cubic by incorporating RTT-based decision mechanisms, enabling improved performance in high-BDP and loss-prone environments, while introducing a controllable trade-off between aggressiveness, stability, and retransmission overhead.
Overall, the results indicate that Flex-Cubic mitigates key limitations of TCP Cubic by incorporating RTT-based decision mechanisms. This design enables improved performance in high-BDP and loss-prone environments, while providing a tunable balance between aggressiveness and stability, at the cost of controlled increases in retransmissions.
A limitation of this study is the adopted loss model, where packet losses are injected randomly using the Linux tc/netem module. While this enables controlled and reproducible experiments, it does not capture the bursty and correlated loss patterns typical of optical, FSO, or satellite networks, which may affect congestion control behavior under consecutive loss events. However, random losses allow isolating the algorithm’s ability to distinguish between congestion-induced and non-congestion-induced losses, which is the main focus of this work. Thus, the results should be interpreted as a baseline, and future work will consider more realistic bursty loss models.
This work presented TCP Flex-Cubic, a CCA derived from TCP Cubic and enhanced with eBPF features support toward runtime adaptability. TCP Flex-Cubic may dynamically follow communication link conditions and, when compared to traditional TCP Cubic, offers the additional capability to differentiate between packet losses caused by queue overload at intermediate nodes and losses induced by physical layer impairments effects. This work extends our previous studies on the dynamic adaptability of TCP CCAs to physical-layer constraints and the requirements of loss-sensitive applications, such as Data-Intesive Science (DiS), leveraging additional metrics toward cross-layer approaches.
The integration of the maps eBPF tool with the TCP congestion control algorithm (CCAs) was discussed in details, offering an alternative to the static algorithms traditionally implemented in the Linux kernel. This integration allows for dynamic interaction between runtime metrics and CCA control variables, representing a substantial evolution of TCP by enabling adaptation to networks with non-static characteristics, including satellite, FSO, and optical networks with disjoint paths and heterogeneous properties.
Future works will progress toward larger scale tests for Flex-Cubic with multihop flows competing with background traffic and under physical layer reconfiguration toward TE studies, which will include Cubic parameter optimization according to current perceived network states.




