# Ad-BBR: Enhancing Round-Trip Time Fairness and Transmission Stability in TCP-BBR
## 4 The Optimization Algorithm: Ad-BBR
### Adaptive Sending Rate Adjustment Mechanism
#### 4.1.2 Adaptive Transmit Rate Regulation Based on Real-Time Link State  
Assume that \(\beta\) is the adaptive adjustment factor applied when queues begin to form, while \(\gamma\) is the factor used under severe queueing conditions. The link bandwidth allocation for RTT streams should be fair under the influence of \(\beta\) and \(\gamma\). When the link bandwidth is ideally allocated fairly, the bandwidths detected and utilized by two BBR streams with different RTT values should be equal. Given that \(BDP=BtlBw^{*}RTprop\), the ratio of BDP for different RTT streams will correspond to the ratio of their RTTs. Let streams 1 and 2 exist, where the RTT obtained from real-time measurements is denoted as _rRTT_, and the possible queuing delay is \(\eta_{t}\). These two streams satisfy Equation (8):  
\[\frac{BDP_{1}}{BDP_{2}}=\frac{rRTT_{1}}{rRTT_{2}}=\frac{{\beta_{1}}^{*}nRTT_{1} ^{*}BtlBw_{1}(t)}{{\beta_{2}}^{*}nRTT_{2}^{*}BtlBw_{2}(t)} \tag{8}\]  
At this point, where \(BtlBw_{1}=BtlBw_{2}\) the following Equation (9) holds:  
\[\frac{{\beta_{1}}^{*}nRTT_{1}}{{\beta_{2}}^{*}nRTT_{2}}=\frac{rRTT_{1}}{rRTT_{2 }}=\frac{nRTT_{1}+\eta_{t}}{nRTT_{2}+\eta_{t}} \tag{9}\]  
This results in Equation (10), which describes the relationship between \(\beta\) and _nRTT_:  
\[\beta=g(nRTT)=\frac{nRTT+\eta_{t}}{nRTT}=1+\frac{\eta_{t}}{nRTT} \tag{10}\]Since the queuing delay equals the difference between the actual measured RTT and the minimum RTT, i.e., \(\eta_{t}\)= \(sRTT-nRTT\), the final expression for \(\beta\) is given by Equation (11):  
\[\beta=1+\frac{\eta_{t}}{nRTT}=\frac{nRTT+rRTT-nRTT}{nRTT}=\frac{rRTT}{nRTT} \tag{11}\]  
When \(rRTT>nRTT\) for a cumulative number of times \(\leq\) 10, when \(rRTT\geq nRTT\) for three consecutive times, or when the cumulative count exceeds 10 and the current \(rRTT>1.25 nRTT\), this indicates significant queuing on the link with a larger queuing delay. In such cases, a larger \(\gamma\) regulating factor is required to adjust the sending rate. Thus, the regulating factor \(\gamma\) is set as the reciprocal of the queuing delay \(\eta_{t}\), as shown in Equation (12):  
\[\gamma=\frac{1}{\eta_{t}}=\frac{1}{rRTT-nRTT} \tag{12}\]  
The link reduces the sending rate between different streams by a factor of \(\gamma\). Due to the varying \(rRTT\) across streams, the regulation factor \(\gamma\) for the long RTT stream is smaller than that for the short RTT stream. As a result, long RTT streams are more affected by the sending rate adjustment, enabling both long and short RTT streams to empty their queues more effectively. When the short RTT stream quickly empties its queue, link resources become idle, allowing the long RTT stream to gradually resume its sending rate after a period of reduced speed and queue clearing. This adjustment is based on the bottleneck bandwidth size, ensuring the continued transmission of long RTT flow data. The fairness between streams in the link is enhanced by two adaptive adjustment factors, \(\beta\) and \(\gamma\). The Adaptive Transmit Rate Regulation Based on Real-Time Link State is presented in Algorithm 2.  
```
1:\(rRTT\leftarrow\)measured_rtt
2:ifphase==\"ProbeW\"then
3:ifrRTT \(<\) 1.25\"\(nRTT\)then
4: PacingRate \(\leftarrow\) BitBw\"pacing_gain
5:elseif\((1.25\"nRTT)\leq rRTT<\)(1.5\"\(nRTT\))then
6:\(\beta\gets rRTT/nRTT\)
7: PacingRate \(\leftarrow\) BitBw\"Pacing_gain/\(\beta\)
8:else
9:\(\gamma\gets 1/(rRTT-nRTT+1e-6)\)
10: PacingRate \(\leftarrow\) BitBw\"pacing_gain\"\(\gamma\)
11:endif
12:endif
```  
**Algorithm 2**Ad-BBR, adaptive sending rate adjustment mechanism.