# A Modified TCP BBR to Enable High Fairness in High-Speed Wireless Networks
## 3 Proposed Work
### The Optimization Algorithm: BBR-PG  
In the pacing-controlled phase, the actual pacing gain is as follows:  
\[pg=\frac{1.25T_{p_{i}}}{T_{i}}=\frac{1.25T_{p_{i}}}{T_{D_{i}}+T_{p_{i}}} \tag{12}\]  
The impact of the relationship between queuing delay and RTprop on the bandwidth can be seen from Equation (12). The BBR bandwidth detection process generally does not reach 1.25 times _pg_ unless the whole link is not queued at all. If the queuing time increases significantly, the _pg_ will increase significantly with the increase in \(T_{p}\). This is the root cause of the RTT unfairness of BBR. If \(\gamma\) is the _pg_ regulatory factor, the bandwidths of the two flows with different RTTs are the same in the ideal fair case, and the ratio of BDP is the ratio of RTT,  
\[\frac{\gamma_{1}\times T_{p1}\times BtlBw_{1}(t)}{\gamma_{2}\times T_{p2} \times BtlBw_{2}(t)}=\frac{T_{1}}{T_{2}}=\frac{T_{p1}+\text{T}_{D}}{T_{p2}+ \text{T}_{D}} \tag{13}\]  
If _BtlBw\({}_{1}\)_ = BtlBw\({}_{2}\), then:  
\[\frac{\gamma_{1}\times T_{p_{1}}}{\gamma_{2}\times T_{p_{2}}}=\frac{T_{p_{1}}+ \text{T}_{D}}{T_{p2}+\text{T}_{D}} \tag{14}\]  
The general term of \(\gamma\) is  
\[\gamma=g(T_{p})= \frac{T_{p}+T_{D}}{T_{p}}=1+\frac{T_{D}}{T_{p}} \tag{15}\]The regulatory factor \(\gamma\) is a subtractive function greater than 1, with \(T_{p}\) as the independent variable. The queuing delay \(T_{D}\) is equal to the difference between the actual RTT and RTprop, so \(\gamma\) can be obtained as follows:  
\[\gamma=\frac{T_{p}+sRTT-T_{p}}{T_{p}}=\frac{sRTT}{T_{p}} \tag{16}\]  
where \(sRTT\) represents the actual measured RTT, and its value is the average result of the moving index of RTT. After the adjusting of the \(\gamma\), have the RTT fair bandwidth iterative equation:  
\[BtlBw(t)=\frac{\gamma T_{p}}{T_{p}+T_{D}}\times BtlBw(t-8T_{p})=BtlBw(t-8T_{p}) \tag{17}\]  
It can be seen from Equation (17) that the measurement bandwidth \(BtlBw\) does not increase and reaches equilibrium. In the \(\gamma\) expression g(\(T_{p}\)), the larger the \(T_{p}\), the smaller the \(pg\). Under this guarantee, different RTT flows can equal probe-up bandwidth. In addition, the window of max-filtered bandwidth needs to be adjusted to match the fixed interval of a steady cycle, so it is adjusted to  
\[WIN=\frac{T_{interval}}{T}+4 \tag{18}\]  
where \(WIN\) is the window of max-filtered bandwidth. \(T_{interval}\) is set to 180 ms in this paper, roughly equivalent to the 6 rounds of 30 ms flows. According to Equation (18), it can be guaranteed that at least the max-filtered bandwidth window can cover the interval between two probe-up cycles and thus can be detected in the max bandwidth window when probe-up. BBR-PG was implemented by modifying the _get_pacing_gains_ () and _bbr_update_bw_ () functions in the BBR source code. The pseudocode of the ProbeBW phase in BBR-PG is shown in Algorithm 1. ```
1:\(rtt\_us/^{\prime}RTT^{\prime}\)/, min_rtt_us/^Minimum RTT */, pg
2:\(pacing\_gain\)
3:Initialization:\(T_{interval}\) = 180 ms, \(rtt\_cnt=0\)
4:bbr_update_min_rtt()/*Track min RTT seen in the min_rtt filter window*/
5:ifbbr>mode == ProbeBW then
6:get_pacing_gains_ ()
7:ifbbr>cycle_idx == 0 then
8:\(\gamma=\frac{rtt\_us}{min\_rtt\_us}\)
9:\(pacing\_gain=pacing\_gain\times\gamma\)/*Update pacing_gain*/
10:return\(pg\)
11:\(bbr\_update\_bw\) ()/*Update BtlBw */
12:\(rtt\_cntt\_+\);
13:ifBtlBw >= bbr_max_bw then
14:\(WIN=\frac{T_{interval}}{T}+4\);
15:\(minmax\_running\_max\) (\(WIN\), \(rtt\_cnt\)) /*Incorporate new sample into BtlBw filter. */
16:endif
```  
**Algorithm 1**ProbeBW phase in BBR-PG  
Next, the inter-protocol fairness optimization when BBR and CUBIC coexist is discussed. In addition to the above \(pg\) interference, the cycle of the ProbeRTT phase also affects inter-protocol fairness. BBR enters the ProbeRTT phase at a fixed interval of 10s to remeasure RTprop. Due to the existence of CUBIC, the measurement of RTprop will be inaccurate. When the BBR flows enter the ProbeRTT phase, the active detection of bandwidth by the CUBIC flows will fill the queue.