As increasing network services are emerging and people are demanding higher network quality, limited bandwidth cannot meet network requirements. As a result, the delay and signal loss occur because of congestion. When a network is congested intermittently and delay-sensitive services require higher QoS than delay-insensitive services, congestion management is required. If congestion persists on the network after congestion management is configured, the bandwidth needs to be increased. Congestion management implements queuing and scheduling when sending packet flows.
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 1, 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:
The PQ scheduling mechanism, however, may result in starvation of packets in queues with lower priorities. For example, if data flows mapped to queue 7 arrive at 100% link rate in a period, the scheduler does not process flows in queue 6 and queues 0 to 5.
To prevent starvation of packets in some queues, upstream devices need to accurately define service characteristics of data flows so that service flows mapped to queue 7 do not exceed a certain percentage of the link capacity. By doing this, queue 7 is not full and the scheduler can process packets in queues with lower priorities.
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 2 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 1 lists the WRR scheduling results.
Queue 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 priorities 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 a timely manner.
WDRR scheduling
WDRR is also based on RR. WDRR solves the WRR problem. In WRR scheduling, a large-sized packet obtains higher 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 3, 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 packets of 900 bytes in Q7 and packets 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
Packets in Q7 are not scheduled because the deficit of Q7 is negative. After packets 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
After packets of 600 bytes in Q7 and packets 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. You can obtain the required bandwidth by setting the weights.
In WDRR scheduling, short-delay services still cannot be scheduled in a timely manner.
WFQ scheduling
Weighted Fair Queuing (WFQ) uses priorities to schedule packets. More packets with higher priorities are scheduled than packets with lower priorities.
Session information
Flows are classified according to session information, including the protocol type, source and destination TCP or UDP port numbers, source and destination IP addresses, and precedence in the ToS field.
To minimize the delay, WFQ provides a large number of queues and evenly distributes flows into queues.
When a flow leaves a queue, WFQ allocates the bandwidth on the outbound interface based on the precedence of the flow. A low precedence value receives little bandwidth while a high precedence value receives more bandwidth.
Priority
Priority mapping marks local priorities for traffic.
Each interface is allocated four or eight queues. Packets enter queues based on the queue number.
By default, the queue weight is the same and interface bandwidth is evenly shared by queue traffic. Queue weight is customizable so that high-priority and low-priority packets are allocated bandwidth by weight percentage.
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 queues 7, 6, and 5, and is scheduled in PQ mode; the other group includes queues 4, 3, 2, 1, and 0, and is scheduled in WRR mode. Only LAN-side interfaces on the device support PQ+WRR scheduling. Figure 5 shows PQ+WRR scheduling.
During scheduling, the device first schedules traffic in queues 7, 6, and 5 in PQ mode. The device schedules traffic in other queues in WRR mode only after the traffic in queues 7, 6, and 5 is scheduled. Queues 4, 3, 2, 1, and 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 queues and WDRR scheduling for other queues.
In Figure 6, the device first schedules traffic in queues 7, 6, and 5 in PQ mode. After traffic in queues 7, 6, and 5 is scheduled, 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 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 WDRR scheduling.
PQ+WFQ scheduling
PQ+WFQ scheduling integrates the advantages and offsets the disadvantages of both PQ scheduling and WFQ scheduling.
If only PQ scheduling is used, packets in low-priority queues cannot obtain bandwidth for an extended period of time. If only WFQ scheduling is used, delay-sensitive services, such as voice services, cannot be scheduled in a timely manner.
Eight queues on the device interface are classified into two groups. You can specify PQ scheduling for certain groups and WFQ scheduling for other groups.
Configuring PQ+WFQ scheduling solves the above problems.
In Figure 7, there are eight queues on the device interface. They are classified into two groups, allowing for PQ scheduling for certain queues and WFQ scheduling for other queues.
The device first schedules traffic from queues 7, 6, and 5 in PQ mode. After traffic scheduling is complete, traffic from queues 4, 3, 2, 1, and 0 is scheduled in WFQ mode. Queues 4, 3, 2, 1, and 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 WFQ scheduling.