Congestion Management
As an increasing number of network services emerge and people demand higher network quality, bandwidth use also increases, which in turn causes congestion. This leads to delay and/or signal loss. Congestion management implements queuing and scheduling when sending packet flows to combat delay or signal loss. Congestion management is required when a network is congested intermittently and delay-sensitive services require higher QoS than delay-insensitive services. If congestion persists on the network after congestion management is configured, increase the bandwidth.
Based on queuing and scheduling policies, the switch supports Priority Queuing (PQ), Weighted Deficit Round Robin (WDRR), Weighted Round Robin (WRR), Weighted Fair Queuing (WFQ), PQ+WDRR, PQ+WRR, and PQ+WFQ for congestion management. Each scheduling algorithm schedules specific types of traffic, and affects bandwidth allocation, delay, and jitter.
The switch has eight queues on each interface in the outbound direction. The queues are identified by index numbers ranging from 0 to 7. The device sends classified packets to queues based on mappings between local priorities and queues. The packets are then scheduled using queue scheduling mechanisms:
PQ scheduling
Designed for core services, PQ scheduling is applied to queues in descending order of priority. Low-priority queues are processed only after all high-priority queues are empty. Core services are assigned a high priority and are processed first. Non-core services are processed only at times when core services do not require bandwidth. Core services are placed into high-priority queues, and non-core services (such as email services) are placed into low-priority queues. PQ scheduling is valid for short-delay services.
In Figure 5-2, data flow X is mapped to the queue with the highest priority on each node.
When packets from data flow X reach a node, the data flow packets are processed first. Packets are processed according to priority. Queues are processed in descending order of priority:- Queue 7 packets are processed first.
- Queue 6 packets are sent at the link rate when they need to be sent and queue 7 is empty.
- Queue 5 packets are sent at the link rate when queue 6 and queue 7 are empty, and so on.
However, the PQ scheduling mechanism may result in package starvation in low-priority queues. For example, if data flows mapped to queue 7 arrive at a 100% link rate in a given period, the scheduler does not process flows in queues 0 to 6.
To prevent package starvation, upstream devices need to accurately define service characteristics of data flows preventing service flows mapped to queue 7 from exceeding a certain percentage of link capacity. This prevents queue 7 from becoming full and allows the scheduler to process packets from low-priority queues.
WRR scheduling
WRR scheduling is an extension of Round Robin (RR) scheduling. Packets in each queue are scheduled in a polling manner based on the queue weight. RR scheduling equals WRR scheduling with the weight being 1.
Figure 5-3 shows WRR scheduling.
In WRR scheduling, the device schedules packets in queues in a polling manner round by round based on the queue weight. After one round of scheduling, the weights of all queues are decreased by 1. The queue whose weight is decreased to 0 cannot be scheduled. When the weights of all the queues are decreased to 0, the next round of scheduling starts. For example, the weights of eight queues on an interface are set to 4, 2, 5, 3, 6, 4, 2, and 1. Table 5-1 lists the WRR scheduling results.
Table 5-1 WRR scheduling resultsQueue Index
Queue 7
Queue 6
Queue 5
Queue 4
Queue 3
Queue 2
Queue 1
Queue 0
Queue Weight
4
2
5
3
6
4
2
1
Queue in the first round of scheduling
Queue 7
Queue 6
Queue 5
Queue 4
Queue 3
Queue 2
Queue 1
Queue 0
Queue in the second round of scheduling
Queue 7
Queue 6
Queue 5
Queue 4
Queue 3
Queue 2
Queue 1
- Queue in the third round of scheduling
Queue 7
- Queue 5
Queue 4
Queue 3
Queue 2
- - Queue in the fourth round of scheduling
Queue 7
- Queue 5
- Queue 3
Queue 2
- - Queue in the fifth round of scheduling
- - Queue 5
- Queue 3
- - - Queue in the sixth round of scheduling
- - - - Queue 3
- - - Queue in the seventh round of scheduling
Queue 7
Queue 6
Queue 5
Queue 4
Queue 3
Queue 2
Queue 1
Queue 0
Queue in the eighth round of scheduling
Queue 7
Queue 6
Queue 5
Queue 4
Queue 3
Queue 2
Queue 1
- Queue in the ninth round of scheduling
Queue 7
- Queue 5
Queue 4
Queue 3
Queue 2
- - Queue in the tenth round of scheduling
Queue 7
- Queue 5
- Queue 3
Queue 2
- - Queue in the eleventh round of scheduling
- - Queue 5
- Queue 3
- - - Queue in the twelfth round of scheduling
- - - - Queue 3
- - - The statistics show that the number of times packets are scheduled in each queue corresponds to the queue weight. A higher queue weight indicates a greater number of times packets in the queue are scheduled. The unit for WRR scheduling is packet; therefore, there is no fixed bandwidth for each queue. If packets are scheduled fairly, large-sized packets obtain more bandwidth than small-sized packets.
WRR scheduling offsets the disadvantage of PQ scheduling in which packets in queues with lower priories may be not processed for a long period of time if congestion occurs. In addition, WRR can dynamically change the time of scheduling packets in queues. For example, if a queue is empty, WRR scheduling ignores this queue and starts to schedule the next queue. This ensures bandwidth usage. WRR scheduling, however, cannot schedule short-delay services in time.
WDRR scheduling
WDRR is also based on RR. WDRR solves the WRR problem. In WRR scheduling, a large-sized packet obtains less bandwidth than a small-sized packet. WDRR schedules packets considering the packet length, ensuring that packets are scheduled equally.
Deficit indicates the bandwidth deficit of each queue. The initial value is 0. The system allocates bandwidth to each queue based on the weight and calculates the deficit. If the deficit of a queue is greater than 0, the queue participates in scheduling. The device sends a packet and calculates the deficit based on the length of the sent packet. If the deficit of a queue is smaller than 0, the queue does not participate in scheduling. The current deficit is used as the basis for the next round of scheduling.
In Figure 5-4, the weights of Q7, Q6, Q5, Q4, Q3, Q2, Q1, and Q0 are set to 40, 30, 20, 10, 40, 30, 20, and 10 respectively. During scheduling, Q7, Q6, Q5, Q4, Q3, Q2, Q1, and Q0 obtain 20%, 15%, 10%, 5%, 20%, 15%, 10%, and 5% of the bandwidth respectively. Q7 and Q6 are used as examples to describe WDRR scheduling. Assume that Q7 obtains 400 bytes/s bandwidth and Q6 obtains 300 bytes/s bandwidth.
First round of scheduling
Deficit[7][1] = 0+400 = 400
Deficit[6][1] = 0+300 = 300
After packet of 900 bytes in Q7 and packet of 400 bytes in Q6 are sent, the values are as follows:
Deficit[7][1] = 400-900 =-500
Deficit[6][1] = 300-400 =-100
Second round of scheduling
Deficit [7][2] = -500 + 400 = -100
Deficit [6][2] = -100 + 300 = 200
Packet in Q7 is not scheduled because the deficit of Q7 is negative. Packet of 300 bytes in Q6 are sent, the value is as follows:
Deficit [6][2] = 200-300 =-100
Third round of scheduling
Deficit[7][3] = -100+400 = 300
Deficit[6][3] = -100+300 = 200
Packet of 600 bytes in Q7 and packet of 500 bytes in Q6 are sent, the values are as follows:
Deficit[7][3] = 300-600 =-300
Deficit[6][3] = 200-500 =-300
Such a process is repeated and finally Q7 and Q6 respectively obtain 20% and 15% of the bandwidth. This illustrates that you can obtain the required bandwidth by setting the weights.
In WDRR scheduling, short-delay services still cannot be scheduled in time.
PQ+WRR scheduling
PQ+WRR scheduling integrates the advantages and offsets the disadvantages of both PQ scheduling and WRR scheduling. Packets from queues with lower priorities can obtain the bandwidth by WRR scheduling and short-delay services can be scheduled first by PQ scheduling.
On the device, you can set WRR parameters for queues. The eight queues on each interface are classified into two groups. One group includes queue 7, queue 6, and Queue 5, and is scheduled in PQ mode; the other group includes queue 4, queue 3, queue 2, queue 1, and queue 0, and is scheduled in WRR mode. Only LAN-side interfaces on the device support PQ+WRR scheduling. Figure 5-5 shows PQ+WRR scheduling.
During scheduling, the device first schedules traffic in queue 7, queue 6, and queue 5 in PQ mode. The device schedules traffic in other queues in WRR mode only after the traffic in queue 7, queue 6, and queue 5 are scheduled. Queue 4, queue 3, queue 2, queue 1, and queue 0 have their own weights. Important protocol packets or short-delay service packets must be placed in queues using PQ scheduling so that they can be scheduled first. Other packets are placed in queues using WRR scheduling.
PQ+WDRR scheduling
PQ+WDRR scheduling integrates the advantages and offsets the disadvantages of both PQ scheduling and WDRR scheduling. If only PQ scheduling is used, packets in queues with lower priorities cannot obtain bandwidth for a long period of time. If only WDRR scheduling is used, short-delay services such as voice services cannot be scheduled first. PQ+WDRR scheduling has advantages of both PQ and WDRR scheduling and offsets their disadvantages.
Eight queues on the device interface are classified into two groups. You can specify PQ scheduling for certain groups and WDRR scheduling for other groups.
In Figure 5-6, the device first schedules traffic in queues 7, 6, and 5 in PQ mode. After traffic scheduling in queues 7, 6, and 5 is complete, the device schedules traffic in queues 4, 3, 2, 1, and 0 in WDRR mode. Queues 4, 3, 2, 1, and 0 have their own weight.
Important protocol packets or short-delay service packets must be placed in queues using PQ scheduling so that they can be scheduled first. Other packets are placed in queues using WDRR scheduling.