# On the Fairness of Internet Congestion Control over WiFi with Deep Reinforcement Learning
## 4 System Model of Proposed TCP-Switching Mechanism  
This section details the design of our TCP-switching mechanism, which utilizes DRL to optimize CCAs. The model integrates four key components, Unfairness Monitoring, Collective Statistics, DRL-based Selection, and TCP Switching, each contributing to a dynamic and responsive network management system. Before presenting the details of our system model, we outline a set of metrics in Tables 2 and 3 for monitoring unfairness and Collective Statistics in CCAs, respectively. Analyzing these metrics allows us to assess CCA fairness and identify the need for adjustments or switching. \begin{table}
\begin{tabular}{l l c c} \hline \hline
**Algorithms** & **Window \(\star\)(\(W^{\star}\))** & **Unfairness** & **Starvation** \\ \hline CUBIC [49] & \(\sqrt[4]{\frac{T^{3}C}{(p^{*})^{3}p}}\) & \(\sqrt[4]{\frac{T^{3}}{T^{2}}}\) & \(\sqrt[4]{\frac{T^{3}}{T^{2}}}\) & \(\sqrt[4]{\frac{T^{3}}{T^{3}}}\) \\ \hline BBR [50] & \(\frac{\pi^{*}}{T^{-2}\mathcal{I}_{n}}\) & \(\frac{\tau_{1}}{T_{2}}\left(\frac{\tau_{2}-T_{n}}{1-2\mathcal{I}_{n}}\right) \frac{\tau_{2}-2\tau_{n}(1-p_{2})}{\tau-2\tau_{n}(1-p_{1})}\) & \(\frac{1-p_{2}}{1-np_{2}}\), \(\frac{3\eta}{5n-2}\) \\ \hline PCC [14, 15] & \(1-b\frac{d\tau_{n}}{dT}-cl_{i}\) & \(\frac{1-b\frac{d\tau_{n}}{dT}-cl_{i}}{1-b\frac{d\tau_{n}}{dT}-cl_{i}}\), \(\frac{1-p_{2}}{1-2p_{2}}\), \(\frac{1-p_{2}}{1-np_{2}}\), \(\frac{1-n(b\frac{d\tau_{n}}{dT})-cl_{i}}{1-(b\frac{d\tau_{n}}{dT})-cl_{i}}\) \\ \hline Copa [16] & \(\frac{\tau^{*}}{b(\tau^{*}-T_{n})}\) & \(\frac{\tau_{1}}{T_{2}}\left(\frac{\tau_{2}-T_{n}}{1-\mathcal{I}_{n}}\right) \frac{1-p_{2}}{1-p_{1}}\) & \(\frac{1-p_{2}}{1-np_{2}}\), \(\frac{n\tau_{2}}{T_{n}}\left(\frac{\tau_{2}-T_{n}}{\eta_{2}-T_{n}}\right)\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Summary of congestion control for CUBIC, BBR, PCC Vivace, and Copa. \begin{table}
\begin{tabular}{l l} \hline \hline
**Metric** & **Interpretation** \\ \hline \(Th_{ratio}\) & Throughput of flow A/Throughput of flow B \\ \(\tau\) & Travel time from source to destination and back to source \\ Delay & One way delay—from source to the destination \\ \(P_{rate}\) & Number of loss packets/Total number of sent packets \\ Jitter & Variability in packet arrival times \\ \hline Goodput & (Total transferred data—overhead data)/time taken \\ \(Sq_{Size}\) & Total amount of buffered data waiting to be transmitted \\ \(byte_{rate}\) & Bytes the sender processes in the last selection period \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Metrics to monitor the unfairness of CCAs. Selecting effective CCAs requires addressing flow unfairness, which is pivotal for optimizing QoS and QoE. We assert that CCAs failing to distribute bandwidth fairly among all flows will not adequately enhance QoS and QoE. Our approach involves evaluating and addressing the fairness of CCAs through various metrics and employing DRL to switch CCAs based on these evaluations dynamically. To detect unfairness in CCAs, we use a fixed-point approach that compares throughput across different flows. If one flow consistently receives a higher throughput than others, it indicates that the CCA may be unfair. This approach involves defining a fairness function that evaluates the throughput ratio between flows and iteratively adjusting it until it reaches a fixed point, reflecting an equitable bandwidth distribution. For example, one possible function could be the ratio of the throughput of the flow to the average throughput of all flows:  
\[f(Th_{1})=\frac{Th_{1}}{a.Th_{avg}}\]  
where \(Th_{1}\) is the throughput of flow 1, a is the number of flows, and \(Th_{avg}\) is the average throughput of all flows. The fixed-point approach then iteratively adjusts the throughput of each flow until the function \(f(Th_{1})\) reaches a fixed point. A fixed point is a value of the function that does not change when the throughput of the flows is adjusted.