Queue Scheduling Modes and Packet Loss Policies - QoS Implementation - QoS Issues (Issue 5) Highlighted

Latest reply: Apr 10, 2017 09:42:35 5175 1 0 0

This post highlights the Queue Scheduling Modes and Packet Loss Policies, as part of the section QoS Implementation - QoS Issues. Please see more details below.

Issues 2 and 3 describe how to classify and mark packets using priority mapping or MQC. After packets are classified, packets need to be controlled based on classification results. Congestion management and congestion avoidance are two traffic control methods. For example, when the uplink traffic on LSW1 exceeds the interface bandwidth, network congestion may occur in the outbound direction. In this case, you need to configure congestion avoidance and congestion management. The following describes congestion management and congestion avoidance.

Figure 1-1  Application of congestion management and congestion avoidance

20170410095602021001.png

 

1 Congestion Management

1.1 Functions of Congestion Management

When network devices' capabilities cannot meet bandwidth requirements of various applications, network congestion cannot be avoided. When network congestion occurs, congestion management uses queue technologies to manage and control traffic, preferentially ensuring the QoS quality such as the delay of specified services.

QoS queuing is similar to queuing during business transactions in a bank. When only one bank counter provides businesses, businesses of VIPs are processed preferentially. Common users can continue business transactions only after business transactions of the VIPs are complete.

1.2 Queue Scheduling Technologies and Applications

Congestion management is based on queue technologies. Each outbound interface on a switch has eight queues with indexes of 0, 1, 2, 3, 4, 5, 6, and 7. Each queue can buffer a certain number of packets. When network congestion occurs, the switch sends packets to queues based on the mapping between local priorities and queues. Congestion management technologies can send traffic in queues based on priorities using respective scheduling algorithms.

The following describes two commonly used scheduling modes.

1.2.1 PQ Scheduling

Priority Queuing (PQ) schedules packets in queues in descending order of priority. Packets in queues with a lower priority can be scheduled only after all packets in queues with a higher priority have been scheduled. A switch enabled with PQ scheduling schedules packets based on priorities 7, 6, 5, 4, 3, 2, 1, and 0 in descending order.

Assume that only one bank counter in a bank provides businesses. Users take numbers and wait in queues based on their credits. There are numbers A, B, and C in descending order of priority. That is, users of number A obtain services preferentially. When there is no user of number A, users of number B obtain services. When there is no user of number B, users of number C obtain services. In this mode, users of numbers B and C are unsatisfied when they do not obtain services for a long time.

20170410095603248002.png

 

The priorities of queues 1, 2, and 3 are in descending order of priority. When packets leave queues, the switch forwards the packets in descending order of priority. Packets in the higher-priority queue are forwarded preferentially. If packets in the higher-priority queue come in between packets in the lower-priority queue that is being scheduled, the packets in the high-priority queue are still scheduled preferentially. This implementation ensures that packets in the higher-priority queue are always forwarded preferentially. As long as there are packets in the high-priority queue, no other queue will be served.

1.2.2 WRR Scheduling

Weighted Round Robin (WRR) ensures that packets in all the queues are scheduled in turn. WRR schedules packets in queues based on the weight of each queue.

If three bank counters use WRR scheduling and the weights of the three bank counters are 50%, 25%, and 25% respectively, the other two bank counters can each provide business transactions of one user when the bank counter for VIPs processes business transactions of two users. Users of all bank counters are served, but the queuing time of VIPs is shorter.

Assume that three bank counters are considered as three queues. The scheduling is as follows.

20170410095604401003.png

 

A switch schedules packets in turn based on the weight of each queue. After one round of scheduling, counters decrease by 1. The queue of which the counter is decreased to 0 cannot be scheduled. When the counters of all the queues are decreased to 0, the next round of scheduling starts.

The counters are initialized first: Count[1] = 2, Count[2] = 1, and Count[3] = 1.

First round of WRR scheduling:

Packet 1 is taken from queue 1, with Count[1] as 1. Packet 5 is taken from queue 2, with Count[2] as 0. Packet 8 is taken from queue 3, with Count[3] as 0.

Second round of WRR scheduling:

Packet 2 is taken from queue 1, with Count[1] as 0. Queues 2 and 3 do not participate in this round of WRR scheduling because Count [2] and Count[3] are 0.

Count[1], Count[2], and Count[3] are all 0. The counters are initialized again. Then Count[1] is 2, Count[2] is 1, and Count[3] is 1.

Third round of WRR scheduling:

Packet 3 is taken from queue 3, with Count[1] as 1. Packet 6 is taken from queue 2, with Count[2] as 0. Packet 9 is taken from queue 3, with Count[3] as 0.

Fourth round of WRR scheduling:

Packet 4 is taken from queue 1, with Count[1] as 0. Queues 2 and 3 do not participate in this round of WRR scheduling because Count [2] and Count[3] are 0.

Count[1], Count[2], and Count[3] are all 0. The counters are initialized again. Then Count[1] is 2, Count[2] is 1, and Count[3] is 1.

The statistics show that the packet scheduling count in each queue is in direct ratio to the weight of this queue. A higher weight indicates more packet scheduling count. If the interface bandwidth is 100 Mbit/s, the queue with the lowest weight can obtain at least 25 Mbit/s bandwidth. WRR scheduling prevents packets in low-priority queues from being not served in PQ scheduling mode, but WRR scheduling cannot ensure that delay-sensitive services packets are preferentially transmitted.

An example is used to describe WRR scheduling. The traffic scheduling ratio of departments 1 and 2 is 2:3 when network congestion occurs.

20170410095605749004.png

 

Use the tester to simulate user traffic of department 1 and department 2. When the tester forwards traffic on the interface at line speed, traffic entering through GE0/0/1 and GE0/0/2 is forwarded by GE0/0/3. Traffic congestion may occur. Assume that traffic of department 1 belongs to VLAN 10 and has the 802.1p priority of 2, and traffic of department 2 belongs to VLAN 20 and has the 802.1p priority of 5.

Traffic of department 1:

20170410095606284005.jpg

 

Traffic of department 2:

20170410095607700006.jpg

Configure WRR scheduling on LSW1 and configure weights as 40 and 60 respectively. Different switch models support different configuration methods. The S5700LI and S5720EI are used as an example. For other model, see the product documentation.

The configuration of the S5700LI is as follows. The 802.1p priorities are mapped to queues 0 to 7 by default, so the weights of queue 2 and queue 5 are 40 and 60.

[LSW1] qos schedule-profile sp

[LSW1-qos-schedule-profile-sp] qos queue 2 wrr weight 40  [LSW1-qos-schedule-profile-sp] qos queue 5 wrr weight 60

[LSW1-qos-schedule-profile-sp] quit

[LSW1] interface GigabitEthernet 0/0/3

[LSW1-GigabitEthernet0/0/3] qos schedule-profile sp //Apply the scheduling profile to the interface in the outbound direction.

[LSW1-GigabitEthernet0/0/3] quit

[LSW1] interface GigabitEthernet 0/0/1

[LSW1-GigabitEthernet0/0/1] trust 802.1p  //The S5700LI does not trust any priority, and the priority to be trusted needs to be configured.

[LSW1-GigabitEthernet0/0/1] quit

[LSW1] interface GigabitEthernet 0/0/2

[LSW1-GigabitEthernet0/0/2] trust 802.1p

[LSW1-GigabitEthernet0/0/2] quit

The configuration of the S5720EI is as follows. The 802.1p priorities are mapped to queues 0 to 7 by default, so the weights of queue 2 and queue 5 are 40 and 60. An interface trusts 802.1p priorities by default, so the priority to be trusted does not need to be configured.

[LSW1] interface GigabitEthernet 0/0/3

[LSW1-GigabitEthernet0/0/3] qos wrr

[LSW1-GigabitEthernet0/0/3] qos queue 2 wrr weight 40

[LSW1-GigabitEthernet0/0/3] qos queue 5 wrr weight 60

After the configuration is complete, check traffic statistics on GE0/0/3. The rate ratio of queues 2 and 5 is 2:3.

<LSW1> display qos queue statistics interface GigabitEthernet 0/0/3

------------------------------------------------------------                   

  Queue ID          : 2                                                         

  CIR(kbps)         : 0                                                        

  PIR(kbps)         : 1,000,000                                                

  Passed Packets    : 409,269,881                                              

  Passed Rate(pps)  : 596,734                                                  

  Passed Bytes      : 26,193,272,384                                           

  Passed Rate(bps)  : 305,527,808                                              

  Dropped Packets   : 345,407,253                                              

  Dropped Rate(pps) : 895,096                                                  

  Dropped Bytes     : 22,106,064,192                                           

  Dropped Rate(bps) : 458,289,336                                              

------------------------------------------------------------                   

  Queue ID          : 5                                                        

  CIR(kbps)         : 0                                                        

  PIR(kbps)         : 1,000,000                                                

  Passed Packets    : 345,465,822                                              

  Passed Rate(pps)  : 895,133                                                  

  Passed Bytes      : 22,109,812,608                                           

  Passed Rate(bps)  : 458,308,224                                              

  Dropped Packets   : 409,211,630                                               

  Dropped Rate(pps) : 596,697                                                  

  Dropped Bytes     : 26,189,544,320                                           

  Dropped Rate(bps) : 305,508,952                                               

------------------------------------------------------------                    

The example only provides the display of queues 2 and 5, and the display of other five queues is not provided here.

PQ scheduling and WRR scheduling have their respective advantages and disadvantages. WRR scheduling ensures that all services are processed but cannot schedule short-delay services in a timely manner. PQ scheduling can ensure that short-delay services are scheduled in a timely manner, but low-priority services may be not scheduled for a long time. In practice, PQ+WRR scheduling is often used to implement congestion management. Generally, PQ scheduling is configured for queues that short-delay services enter, and WRR scheduling is configured for other queues. Traffic in PQ queues is processed preferentially. When there is no traffic in PQ queues, traffic in WRR queues is scheduled based on weights.

To configure PQ+WRR scheduling on fixed switches, you only need to set the weight of PQ queues to 0. For example, PQ scheduling needs to be configured for queue 1 and WRR scheduling needs to be configured for queues 2 and 5. The S5720EI is used as an example.

[LSW1] interface GigabitEthernet 0/0/3

[LSW1-GigabitEthernet0/0/3] qos wrr

[LSW1-GigabitEthernet0/0/3] qos queue 1 wrr weight 0  //Configure PQ scheduling for queue 1.

[LSW1-GigabitEthernet0/0/3] qos queue 2 wrr weight 40

[LSW1-GigabitEthernet0/0/3] qos queue 5 wrr weight 60

To configure PQ+WRR scheduling on modular switches, you only need to configure PQ scheduling for some queues.

[LSW1] interface GigabitEthernet 1/0/3

[LSW1-GigabitEthernet1/0/3] qos pq 1    //Configure PQ scheduling for queue 1.

[LSW1-GigabitEthernet1/0/3] qos queue 2 wrr weight 40

[LSW1-GigabitEthernet1/0/3] qos queue 5 wrr weight 60

In addition to the preceding scheduling modes, switches also support other congestion management methods including DRR and WFQ.

1.2.3 DRR Scheduling

Deficit Round Robin (DRR) schedules packets considering the packet length, ensuring that packets are scheduled with the same chance. In contrast, WRR schedules packets based on the number of packets. 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 switch 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.

For example, three bank counters define that money is drawn based on the cash amount. The ratio of weights of one VIP counter and two common counters is 2:1:1. In each round, 5,000 CNY is allocated for the VIP counter, and 2,500 CNY is allocated for a common counter.

l   During the first round of business transactions, a VIP draws 10,000 CNY and two common users each draw 2000 CNY. After the first round, the remaining amount of the VIP counter is -5,000 CNY, and the amount of each common counter is 500 CNY.

l   During the second round of business transactions, the credit of the VIP counter is 0 after 5,000 CNY is allocated, and the credit of a common counter is 3,000 CNY after 2,500 CNY is allocated. That is, the VIP counter does not provide business transactions, and the common counter can continue to provide business transactions.

1.2.4 WFQ Scheduling

Fair Queuing (FQ) equally allocates network resources so that the delay and jitter of all flows are minimized.

Weighted Fair Queuing (WFQ) classifies flows based on the session information including the protocol type, source and destination TCP or UDP port numbers, source and destination IP addresses, and precedence field in the ToS field. Additionally, the system provides a large number of queues and equally places flows into queues to smooth out the delay. When flows leave queues, WFQ allocates the bandwidth on the outbound interface for each flow based on the precedence of each flow. Flows with the lowest priorities obtain the least bandwidth.

The following table describes different scheduling modes. For details, see the product documentation of S series switches.

Scheduling Mode

Principle

Advantage

Disadvantage

PQ

Sends packets based on queue priorities.

Guarantees the bandwidth of traffic in high-priority queues.

When traffic in high-priority queues is sent continuously, traffic in low-priority queues cannot be served.

WRR

Schedules packets in each queue based on queue weights.

Provides services in a fair manner.

Large-sized packets occupy more bandwidth.

DRR

Schedules packets in each queue based on queue weights.

Considers the packet size and provides fair scheduling rates.

Short-delay services cannot be scheduled in a timely manner.

WFQ

Allocates the bandwidth to each flow based on flow priorities.

Provides bandwidth based on flow priorities, and processes services with the same priority in a fair manner.

Short-delay services cannot be scheduled in a timely manner.

PQ+WRR

Integrates advantages of PQ scheduling and WRR scheduling.

PQ+DRR

Integrates advantages of PQ scheduling and DRR scheduling.

PQ+WFQ

Integrates advantages of PQ scheduling and WFQ scheduling.

 

2 Congestion Avoidance

2.1 Introduction to Congestion Avoidance

When traffic congestion occurs in the outbound direction of a switch, congestion management is used to provide differentiated services and ensure that high-priority traffic preferentially passes through the egress. When traffic is overloaded and many packets are lost, congestion avoidance can be used. When congestion occurs, congestion avoidance discards packets to eliminate the traffic overload. Packets are discarded to relieve the burden of the downstream device. Huawei S series switches support two packet loss policies: tail drop and WRED.

l   Traditionally, tail drop is used. When network congestion occurs, packets enter a queue. If the queue is full, the subsequent traffic will be directly dropped and cannot be cached. This policy cannot provide differentiated services. The tail drop policy is the default policy on a switch.

This policy leads to global TCP synchronization. In tail drop mechanisms, all newly arrived packets are dropped when congestion occurs, causing all TCP sessions to simultaneously enter the slow start state and the packet transmission to slow down. Then all TCP sessions restart their transmission at roughly the same time and then congestion occurs again, causing another burst of packet drops, and all TCP sessions enters the slow start state again. The behavior cycles constantly, severely reducing the network resource usage.

l   WRED is a congestion avoidance mechanism used to drop packets before the queue overflows. It prevents global TCP synchronization. WRED sets lower and upper thresholds for each queue and defines the following rules:

-     When the length of a queue is lower than the lower threshold, no packet is dropped.

-     When the length of a queue exceeds the upper threshold, all newly arrived packets are tail dropped.

-     When the length of a queue ranges from the lower threshold to the upper threshold, newly arrived packets are randomly dropped, but a maximum drop probability is set. The maximum drop probability refers to the drop probability when the queue length reaches the upper threshold.

WRED is configured in the outbound direction on an interface and applies to queues. Different drop parameters are set for packets of different colors. WRED allocates different drop parameters to packets with different colors based on queues. The upper and lower thresholds of important packets are higher than those of non-important packets, whereas the maximum drop probability is lower.

The following describes recommended WRED parameter settings for packets of different colors.

Queue (PHB)

Lower Drop Threshold (%)

Upper Drop Threshold (%)

Maximum Drop Probability

Green

80

100

10

Yellow

60

80

20

Red

40

60

30

 

2.2 Configuration of Congestion Avoidance

In the preceding networking, it is recommended that WRED be configured on GE0/0/3. The preceding recommended parameters can be configured. The 802.1p priorities of traffic of departments 1 and 2 are 2 and 5, respectively.

20170410095608568007.png

 

[LSW1] diffserv domain sp

[LSW1-dsdomain-sp] 802.1p-inbound 5 phb ef yellow   //Configure the switch to mark traffic of department 2 in yellow.

[LSW1-dsdomain-sp] 802.1p-inbound 2 phb af2 red    //Configure the switch to mark traffic of department 1 in red.

[LSW1-dsdomain-sp] quit

[LSW1] interface GigabitEthernet 0/0/1

[LSW1-GigabitEthernet0/0/1] trust upstream sp

[LSW1-GigabitEthernet0/0/1] quit

[LSW1] interface GigabitEthernet 0/0/2

[LSW1-GigabitEthernet0/0/2] trust upstream sp

[LSW1-GigabitEthernet0/0/2] quit

[LSW1] drop-profile sp

[LSW1-drop-sp] color yellow low-limit 60 high-limit 80 discard-percentage 20

[LSW1-drop-sp] color red low-limit 40 high-limit 60 discard-percentage 30

[LSW1-drop-sp] quit

[LSW1] interface GigabitEthernet 0/0/3

[LSW1-GigabitEthernet0/0/3] qos queue 2 wred sp

[LSW1-GigabitEthernet0/0/3] qos queue 5 wred sp

Based on the preceding configuration, when the length of packets of department 2 in queue 5 is 60% of the total queue length, the switch starts to discard packets in the queue. When the length of packets of department 2 is 80% of the total queue length, the switch discards all newly received packets, which is equivalent to the tail drop policy.

3 Summary

QoS basics and applications are over. These technologies can be used together to ensure the service quality. It is hoped that the issues can provide guidance to deploying QoS functions.


This article contains more resources

You need to log in to download or view. No account?Register

x
  • x
  • convention:

gululu
Admin Created Apr 10, 2017 09:42:35 Helpful(0) Helpful(0)

good,thanks!
  • x
  • convention:

Come on!

Comment

Reply
You need to log in to reply to the post Login | Register

Notice Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " Privacy."
If the attachment button is not available, update the Adobe Flash Player to the latest version!
Login and enjoy all the member benefits

Login and enjoy all the member benefits

Login