# New RED-Type TCP-AQM Algorithms Based on Beta Distribution Drop Functions
## 5 Dynamic Algorithms Based on BetaRED
### The Adaptative Beta RED Algorithm (ABetaRED)  
ABetaRED is inspired by the ARED algorithm (which in turn is based on RED), although there are some relevant changes due to the differences between the RED and BetaRED algorithms. For our ABetaRED algorithm, the tuning of the following two parameters is straightforward:  
\[q_{\text{min}}=0,\quad q_{\text{max}}=B. \tag{9}\]  
The choices for \(q_{\text{min}}\) and \(q_{\text{max}}\) are based primarily on the numerical simulations for BetaRED in Section 4.3. It is observed that with the choices (9) an acceptable performance is achieved for a very wide range of parameters in various scenarios, while no substantial improvement in performance was obtained with the selection of other values. The control parameters Alpha and Beta determine the size of the increase and decrease steps of the maximum probability, respectively, with the range of admissible values being \(0<\text{Alpha}\), Beta \(\leq 1\).  
Figure 4: Comparison of the BetaRED algorithm according to the number \(N\) of FTP active flows and different values of \(\theta\). Different thresholds \(q_{\text{min}}\) and \(q_{\text{max}}\) are also considered. Other tunable parameters: \(q_{\text{target}}=250\) packets, \(w=0.1\), \(p_{\text{max}}=1\). Scenario 1 on the dumbbell topology (described in Section 3.1) is used. As the standard deviation \(\sigma\) decreases and the level of congestion increases, the equilibrium point of the average queue length gets closer to the prefixed \(q_{\text{target}}\). Similarly, if the minimum and maximum thresholds \(q_{\text{min}}\) and \(q_{\text{max}}\) are closer to the target queue length \(q_{\text{target}}\), then the average queue length equilibrium point is closer to \(q_{\text{target}}\).  
On the other hand, the tunable parameters to be set by the user are the target delay \(T_{\text{target}}\), the scale factor \(\theta\) and the averaging weight \(w\). As in ARED, once the target delay is set, the target queue length can be estimated by  
\[q_{\text{target}}=C\cdot T_{\text{target}} \tag{10}\]  
where, as in Equation (9), \(C\) is the link capacity measured in packets per second, and \(T_{\text{target}}\) is measured in seconds. A pseudo-code for ABetaRED is outlined in Algorithm 2.  
```
1:set control parameters: \(T_{\text{target}},w,\theta\)
2:\(q_{\text{min}}=0\); \(q_{\text{max}}=B\); \(p_{\text{max}}=0.5\); \(q_{\text{target}}=C\cdot T_{\text{target}}\);
3:\(\mu=\dfrac{q_{\text{target}}-q_{\text{min}}}{q_{\text{max}}-q_{\text{min}}}\); \(\sigma=\theta\cdot\sqrt{\mu(1-\mu)}\);
4:for each arriving packetdo
5: calculate new \(q_{\text{avg}}=(1-w)\cdot q_{\text{avg}}+w\cdot q_{\text{cur}}\)
6:for every interval time \(T_{\text{update}}\)do
7:if\(q_{\text{avg}}<q_{\text{target}}\)then
8: decrease maximum probability:
9:elseif\(q_{\text{avg}}>q_{\text{target}}\)then
10: increase maximum probability:
11:\(p_{\text{max}}=\min\)[0.99, \(p_{\text{max}}+\text{Beta}\cdot p_{\text{max}}\cdot(1-p_{\text{max}}) \cdot\dfrac{q_{\text{avg}}-q_{\text{target}}}{q_{\text{max}}-q_{\text{min}}}\)]
13:endif
14:endfor
15: update \(p=p_{\text{max}}\cdot\tilde{I}_{z(q_{\text{avg}})}(\mu,\sigma)\)
16: with probability \(p\), drop arriving packet
17:endfor
```  
**Algorithm 2** Pseudo-code outline for the Adaptative Beta RED algorithm. By default, Alpha \(=\text{Beta}=1\) and \(T_{\text{update}}=0.5\,\text{s}\), were set in all simulations.