# Quality of Service and Congestion Control in Software-Defined Networking Using Policy-Based Routing
## 6 Results and Discussion  
We evaluated the performance of the OSPF routing protocol on an SDN network, both with and without the policy-based routing (PBR) module, under high network congestion. The performance metrics assessed were packet loss percentage, end-to-end delay, jitter, flow completion time, and throughput. In the experiment, Host 1 transmits real-time media (RTP) packets (QoS flow) to Host 4, as depicted in Figure 3. Additionally, each host sends UDP packets at a rate of 100 packets per second to random destinations at two-second intervals to create background traffic. The buffer size on each switch is set to 100 packets per port. OSPF selected the blue link, as shown in Figure 3, to forward the RTP packets to Host 4. After heavily loading the network with traffic, we observed that 10.45% of the packets from QoS flow were lost due to congestion at one of the switches along the network path. This packet loss occurred because of buffer overflow at OvS-1 and OvS-3, which is the shortest path between Host 1 and Host 4, as calculated by the OSPF routing protocol. The packet loss percentage increased as more packets were transmitted, as illustrated in Figure 4. The increase in packet loss around 100 s indicates congestion at one of the intermediate switches, causing more packet drops. This observation is also verified by the throughput results in Figure 5, where we can see a significant drop in throughput at around 100 s.  
However, with the PBR module enabled, the packet loss rate of QoS flow dropped significantly to 2.3%, with only a few packets being lost. This improvement was due to the PBR module identifying an alternate open route for the flow, represented by the green links between Host 1 and Host 4. Although the alternate route calculated by the PBR module using Equation (8) has more hops than the OSPF route, it experiences less congestion, resulting in lower delay. These results indicate a substantial performance improvement when OSPF is augmented with the PBR module. Figure 5 shows that the PBR module maintains higher and more stable throughput compared to OSPF under high congestion, owing to the PBR's ability to find alternative paths with lower end-to-end delay. Jitter, an important network performance parameter for real-time communication, is significantly affected by congestion. As shown in Figure 6, the PBR module results in lower jitter compared to OSPF without the PBR module. The reason for this improvement is the reduction in packet loss, which stabilizes jitter, whereas OSPF without PBR suffers from higher variability due to packet drops. We also examined the effect of the PBR module on the flow completion time QoS flow. Figure 7 presents the flow completion times for OSPF with and without the PBR module for three different QoS flow sizes. The results show that adding the PBR module leads to shorter flow completion times. The improvement is less pronounced for smaller flows, as these flows do not cause significant congestion, resulting in only marginal gains from the PBR module. End-to-end delay also improved with the PBR module. Without the PBR module, the end-to-end delay for QoS flow was approximately 1120 ms, as shown in Figure 8. The high end-to-end delay is primarily caused by queuing delays at intermediate switches due to buffer overflows. After incorporating the PBR module, the average delay was reduced to just 210 ms. As shown in Figure 8, when the queuing delay reaches a threshold (set by the administrator), the PBR module is triggered, finding an alternate low-delay path and diverting traffic accordingly, which results in a substantial reduction in end-to-end delay. In Figure 8, the queuing delay threshold is reached when 50 K packets are transmitted, and after that, the end-to-end delay drops significantly due to the alternate low-delay path selected by the PBR module. The PBR module's ability to dynamically find an alternate route for the RTP flow reduces buffer contention at intermediate switches, leading to this improvement.