# Quality of Service and Congestion Control in Software-Defined Networking Using Policy-Based Routing
## 4 Proposed Methodology
### Proposed Policy-Based Routing
#### 4.1.2 Minimum Delay Path Calculation  
Upon receiving a packet of a QoS flow, if the current queuing delay is greater than the threshold (\(th_{1}\)), the proposed model finds an alternate open path that leads to minimum delay. In a network, the overall delay experienced on a link between two nodes can be broken down into several components:  
1. Transmission Delay (\(T_{i}\)): This is the time required to push all the packet's bits onto the link. It depends on the packet size \(S\) and the link bandwidth \(\alpha_{i}\). \[T_{i}=\frac{S}{\alpha_{i}}\] (2) Here, \(S\) is the packet size in bits, and \(\alpha_{i}\) is the link bandwidth in bits per second. 2. Propagation Delay (\(P_{i}\)): This is the time it takes for the signal to travel from the sender to the receiver, depending on the distance \(d_{i}\) between the nodes and the propagation speed \(v\) of the signal in the medium (e.g., the speed of light in a fiber optic cable). \[P_{i}=\frac{d_{i}}{v}\] (3) \(d_{i}\) is typically measured in meters, and \(v\) in meters per second. 3. Queuing Delay (\(Q_{i}\)): This is the time a packet spends waiting in the queue before it can be transmitted. Queuing delay depends on the packet buffer occupancy \(\beta_{i}\) and the link bandwidth \(\alpha_{i}\). This delay is critical in congestion scenarios. 4. Processing Delay: This is the time taken by network devices (routers, switches) to process the packet header, perform routing decisions, etc. It is usually small and constant, so it can be neglected in this model. In many cases, especially in well-provisioned networks, transmission and propagation delays are relatively stable and do not vary significantly. However, queuing delay can vary considerably depending on network conditions, making it the most critical factor in determining the overall delay. Queuing delay \(Q_{i}\) can be approximated as the time it takes for the data already in the queue to be transmitted:  
\[Q_{i}=\frac{\beta_{i}}{\alpha_{i}} \tag{4}\]  
* \(\beta_{i}\) is the current buffer occupancy for link \(i\) (in bits or packets). * \(\alpha_{i}\) is the bandwidth of link \(i\) (in bits per second or packets per second). The intuition behind this formula is straightforward: the delay increases with the amount of data already in the queue (more data to be sent) and decreases with higher bandwidth (faster transmission). The total delay \(D_{i}\) on a link \(i\) is a sum of all the relevant delays:  
\[D_{i}=T_{i}+P_{i}+Q_{i} \tag{5}\]  
However, as noted earlier, if transmission and propagation delays are consistent across links, the queuing delay dominates in determining the best path. Therefore, we approximate the following:  
\[D_{i}\approx Q_{i}=\frac{\beta_{i}}{\alpha_{i}} \tag{6}\]  
* **Selecting the Next Hop** Given that \(N_{1}\) is connected to \(n\) other nodes (\(N_{2},N_{3},\dots,N_{n}\)), as shown in Figure 2, the objective is to find the next hop \(N_{\text{next}}\) that minimizes the delay \(D_{i}\). Mathematically, this is an optimization problem: \[N_{\text{next}}=\arg\min_{i\in\{1,2,\dots,n\}}\left(\frac{\beta_{i}}{\alpha_{ i}}\right)\] (7)  
This means that the next hop is chosen based on the link with the smallest \(\frac{\beta_{i}}{\alpha_{i}}\) ratio, indicating the least queuing delay and thus the least overall delay. The idea of using the smallest \(\frac{\beta_{i}}{\alpha_{i}}\) ratio comes from queuing theory, particularly in models like the M/M/1 queue [21], where the service rate (bandwidth) and queue length determine the wait time. By choosing the path with the least queuing delay, the system ensures that packets are transmitted through less congested routes, improving overall network performance. The model is most applicable in stable network environments where transmission and propagation delays remain relatively constant, making queuing delay the primary factor. It is particularly effective in moderate to heavy traffic scenarios, where minimizing the queuing delay becomes crucial, as differences in delay are negligible in light traffic.