## 3 Research Design and Methodology
### Using DualPi2 as an AQM in FreeBSD-L4S
For the actual implementation of DualQ L4S, we need to understand the underlying mathematical formulations for **each pair of L4S and classic queues**, as shown inFigure 1. The implementation requires two phases: (i) phase one produces an internal base probability \(p^{\prime}\), and (ii) in phase 2, we generate \(p_{c}\) using Equation (2), where  
\[p_{c}=(p^{\prime})^{2}. \tag{2}\]  
Substituting the value of \(p_{c}\) in the equation provided in Equation (1) to Equation (2) gives  
\[p^{\prime}=p_{cl}/k. \tag{3}\]  
Now, we can express the Coupled L4S ECN-marking probability as  
\[p_{cl}=k\times p^{\prime}. \tag{4}\]  
Recognizing that the L queue has its own ECN-dropping probability due to its \"Native AQM\", we denote it as \(p^{\prime}_{l}\), calculated based on the current L4S queuing delay. Given that \(p_{l}\) is the ECN-dropping probability applied to the L4S queue, and \(p_{cl}\) is the probability under coupled congestion conditions, the L4S queue should apply \(p^{\prime}_{l}\) whenever the L4S queue grows due to its conditional precedence over the classic queue. However, it should not drop below \(p_{cl}\). We can define this relation as follows:  
\[p_{l}=max(p^{\prime}_{l},p_{cl}), \tag{5}\]  
This has been proven to function really well in actual network traffic. The transformations applied to \(p^{\prime}\) in Equations (2) and (3) serve to apply the correlation described in Equation (1), previously introduced. The coupling factor, denoted as 'k' in Equation (1), intricately determines the relationship between congestion probabilities for low latency, low loss, and scalable throughput (L4S) and classic traffic within network environments. Through its modulation of drop probabilities, k indirectly influences the adjustments in transmission rates made by the AQM in response to congestion. Consequently, variations in k directly impact the equilibrium ratio between L4S and classic flow rates: higher values of k promote more pronounced marking of L4S traffic, potentially leading to substantial rate adjustments compared to classic traffic, while lower values indicate a lesser degree of coupling and closer resemblance in marking probabilities between L4S and classic traffic. This parameter offers network administrators and policymakers a critical tool for fine-tuning traffic proportions, optimizing network performance, and enhancing overall efficiency by accommodating the diverse requirements of different traffic types. In queue prioritization, although the scheduler gives higher precedence to the L queue, the classic queue still exerts a significant influence. This phenomenon arises because the 'Base AQM' aggressively applies congestion signals to L traffic as the C queue expands. Consequently, as L4S flows adjust their rates in response, they underutilize the allocated L4S scheduling resources. This behavior creates opportunities for C traffic to be scheduled within the gaps. While prioritizing the L queue results in a low queuing delay for L traffic, courtesy of the coupling mechanism controlling L traffic, it necessitates conditional prioritization to prevent the C queue from being starved in the short term, giving the means for the C traffic to assert itself. The introduction of a conditional priority mechanism allows for a balanced approach, granting small weight or limited waiting time for C traffic, thereby improving response times for short classic messages like DNS requests and enhancing the startup performance of classic flows by providing immediate capacity when needed. We employ the 'flow queueing scheduler' from FQ-CoDel and FQ-PIE to segregate network traffic evenly across our three DualPi2 L4S AQMs by utilizing hash functions computed based on certain network parameters, such as port numbers and the source and destination IP addresses. This allows us to isolate low-traffic and high-traffic connections. In upcoming versions, we hope to add the option to change the number of flows or queuesdynamically. Flow-queuing significantly impacts performance, especially when scaling our network traffic.