当前位置:网站首页>QoS Quality of Service Seven Switch Congestion Management

QoS Quality of Service Seven Switch Congestion Management

2022-08-10 19:07:00 0 s and 1 s

4.2.3、Switch Congestion Management

4.2.3.1、WRRWeighted polling queue technology

WRR(Weight Round Robin,权重轮询)在队列之间进行轮流调度,根据每个队列的权重来调度各队列中的报文流.

主要解决RR不能设置权重的不足. 在轮询的时候,WRR 每个队列享受的调度机会和该队列的权重成比例.RR调度相当于权值为1的WRR调度.

WRR对于空的队列直接跳过,Shorter time to schedule the end of the week,Therefore, when the traffic of a queue is small,剩余带宽能够被其他队列按照比例占用.

1、RRRound-robin scheduling mechanism of polling queue
RR(Round Robin,循环调度),采用轮询的方式,对多个队列进行调度.RR 以环形的方式轮询多个队列. 如果轮询的队列不为空,则从该队列取走一个报文;如果该队列为空,则直接跳过该队列,调度器不等待.RR There is no priority between scheduling queues,can be scheduled with equal probability.

RR Advantages of scheduling:separate streams,Equal utilization of bandwidth between queues.
RR 调度的缺点是:All queues cannot reflect priority,For latency-sensitive mission-critical and non-critical operations cannot be discriminated against,Make key business can not be dealt with in a timely manner.

2、WRRWeight polling queue implementation method
为每个队列设置一个计数器 Count,根据权重进行初始化.

each roundWhen querying a queue,该队列输出一个报文且计数器减一.当计数器为 0 时停止调度该队列,但继续调度其他计数器不为 0 的队列.when all queues countdevice is 0 时,所有计数器重新根据权重初始化,开始新一round robin.在一个循环中,权重大的队列被多次调度.

队列索引Q7Q6Q5Q4Q3Q2Q1Q0
queue weight42536421
第1round robinQ7Q6Q5Q4Q3Q2Q1Q0
第2round robinQ7Q6Q5Q4Q3Q2Q1-
第3round robinQ7-Q5Q4Q3Q2--
第4round robinQ7-Q5-Q3Q2--
第5round robin--Q5-Q3---
第6round robin----Q3---
第7round robinQ7Q6Q5Q4Q3Q2Q1Q0
第8round robinQ7Q6Q5Q4Q3Q2Q1-
第9round robinQ7-Q5Q4Q3Q2--

在进行WRR调度时,The device performs round-robin scheduling according to the weight of each queue.A queue whose weight is reduced by one in one round of scheduling will not participate in the scheduling,When all access to a queue0时,开始下一轮的调度.例如,Users can use the interface as needed8个队列(q7、q6、q5、q4、q3、q2、ql)The specified weight is divided into4、2、5、3、6、4、2和1.

Schedule according to weight ratio
Suppose there are three queues of work and takeWRR调度方式,The weight ratios of the three queues are50%,25%,25%,Schedule according to weight ratio,权重50%Proportional queue sending2个报文时,In addition, the queue separates a message.

Weightings scheduling queues
3、WRR特点
(1).权重小的,延时很大,Long time no polling;
(2).以报文为单位,resulting in no fixed bandwidth per queue,Under the same scheduling opportunity, the bandwidth obtained by large size is greater than that of small size;
(3).每个队列都能得到带宽,不会饿死.

优点:

  • Ability to allocate bandwidth by weight,The remaining bandwidth of a queue can be occupied fairly by other queues,Low priority queues can also be scheduled,No hunger problem.
  • 实现简单、复杂度低.
  • 适合diffserv聚合后的端口.

缺点:

  • 与RRThe scheduling algorithm is consistent,When the message length is inconsistent,调度不准确.
  • When the scheduling rate is low, the packet delay control is not good,Delay jitter is unpredictable.
  • Timely scheduling cannot be guaranteed for low-latency services.

4、配置案例
在这里插入图片描述

全局模式:

[LSW1] qos schedule-profile sp        //Create a global scheduling templatesp
[LSW1-qos-schedule-profile-sp] qos queue 2 wrr weight 40    //队列2权重40.
[LSW1-qos-schedule-profile-sp] qos queue 5 wrr weight 60   //队列5权重60.
[LSW1-qos-schedule-profile-sp] quit

[LSW1] interface GigabitEthernet 0/0/3
[LSW1-GigabitEthernet0/0/3] qos schedule-profile sp  //Interface outbound applicationWRR调度配置
[LSW1-GigabitEthernet0/0/3] quit

[LSW1] interface GigabitEthernet 0/0/1
[LSW1-GigabitEthernet0/0/1] trust 8021p  //信任802.1p优先级
[LSW1-GigabitEthernet0/0/1] quit

[LSW1] interface GigabitEthernet 0/0/2
[LSW1-GigabitEthernet0/0/2] trust 8021p

查看接口GE0/0/3Queue-based traffic statistics on

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

接口模式:

[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

4.2.3.2、DRRDifferential polling queue technology

DRR(Deficit Round Robin,差分轮询)调度实现原理与 RR 调度基本相同. DRR 与 RR 的区别是:RR Scheduling is according to the message个数进行调度,而 DRR according to the message长度进行调度.

DRR为每个队列设置一个计数器Deficit,Deficit初始化为一次调度允许的最大字节数,(假设为Quantum,一般为接口MTU).each roundWhen querying a queue,如果报文长度小于Deficit,则该队列输出一个报文,且计数器Deficit减去报文长度.如果Packet length more thanDeficit,报文不被发送,Deficit值不变,继续调度下一个队列.每一次轮询之后,为每个队列加上Quantum,再开始新一round robin.DRR调度避免了采用SP调度时低优先级队列中的报文可能长时间得不到服务的缺点.但是,DRR调度不能设置权重,且也具有低延时需求业务(如语音)得不到及时调度的缺点.

DRR调度避免了采用SP调度时低优先级队列中的报文可能长时间得不到服务的缺点.但是,DRR调度不能设置权重,且也具有低延时需求业务(如语音)得不到及时调度的缺点.

4.2.3.3、MDRRModified Differential Poll Queue Technique

MDRR(Modified Deficit Round Robin,Corrected difference loop)是一种改良的DRR算法.MDRR和DRR实现类似,差别在于:MDRR调度允许Deficit出现负值,以保证长报文也能够得到调度.但下次轮循调度时该队列将不会被调度.当计数器为0或负数时停止调度该队列,但继续调度其他计数器为正数的队列.

MDRRModified Differential Round Robin Scheduling:

假设某端口MTU=150Bytes,有2个队列Q1和Q2采用MDRR调度,Q1队列中有多个200Bytes的长报文,Q2队列中有多个100Bytes的短报文,The scheduling process is as follows:
MDRRModified Differential Round Robin Scheduling

经过第1~6轮MDRR调度,Q1队列被调出了3个200Bytes的报文,Q2队列被调出了6个100Bytes的报文.从长期的统计看,Q1和Q2的实际输出带宽比是1:1,为公平的比例.

与DRR相比,MDRR中拥有一个可以被优先服务的优先队列(Priority Queue).这样可以保证特殊的队列的时延要求.也可以比较有效的分配带宽,是一种相对较好的调度算法.

4.2.3.4、WDRRWeighted Differential Poll Queue Technology

WDRR(Weighted Deficit Round Robin,加权差分轮询)调度主要解决DRR不能设置权重的不足.DRR调度相当于权值为1的WDRR调度.调度实现原理与WRR调度基本相同.

WDRR调度与WRRThe difference in scheduling is:WRRScheduling is according to the message个数进行调度,而WDRRaccording to the message长度进行调度.If the packet length exceeds the scheduling capability of the queue,WDRRScheduling allows negative weight,以保证长报文也能够得到调度.But the queue will not be scheduled the next time the poll is scheduled,until the weight is positive,the queue will participateWDRR调度.

WDRR调度避免了采用PQDisadvantages of queue starvation in case of scheduling congestion,也避免了各队列报文长度不等或变化较大时,WRR调度不能按配置比例分配带宽资源的缺点.但是,WDRRScheduling also has delay-sensitive services(如语音)得不到及时调度的缺点.when all involvedWDRRWhen the weights of the scheduled queues are the same,WDRR调度与DRRThe scheduling effect is the same.

WDRRWeighted Differential Round Robin Scheduling:
DWRR 为每个队列设置一个计数器 Deficit,Deficit 初始化为 WeightMTU.each round When querying a queue,该队列输出一个报文且计数器 Deficit 减去报文长度.当计数器 为 0 时停止调度该队列,但继续调度其他计数器不为 0 的队列.when all queues count device is 0 时,所有计数器的 Deficit 都加上 WeightMTU,开始新一round robin.

WDRRAlgorithm Two Variables:配额(quantum)和余额(credit counter),配额代表权重,以字节为单位,是可配置的参数,余额用来表示配额的积累和消耗情况,是状态参数,不可配置.

配额= Weight*MTU Weight范围为0~127,Weight为0表示严格优先级.
初始状态下:余额=配额;
When the queue sends a message every time:余额=配额-The number of bytes of the message.

假设某端口MTU=150Bytes,有2个队列Q1和Q2采用DRR调度,Q1队列中有多个200Bytes的长报文,Q2队列中有多个100Bytes的短报文,Q1和Q2配置权重比为weight1:weight2=2:1.Q1的余额=2x150=300Bytes ;Q2的余额=1x150=150Bytes.The scheduling process is as follows:
WDRRWeighted Differential Round Robin Scheduling

从上图可以看出:

  • 第一次调度
    Deficit[1] 余额=weight1* MTU=300,Deficit[2]余额 = weight2* MTU=150,从Q1队列取出200Bytes报文发送,从Q2队列取出100Bytes发送;发送后,Deficit[1]余额 = 100,Deficit[2]余额 =50.

  • 第二次调度
    从Q1队列取出200Bytes报文发送,从Q2队列取出100Bytes发送;发送后,Deficit[1]余额= -100,Deficit[2]余额=-50.

  • 第三次调度
    此时两个队列都为负,因此,Deficit[1]余额 = Deficit[1]+weight1* MTU=-100+2150=200,Deficit[2]余额 = Deficit[2]+weight2 MTU=-50+1*150=100.
    从Q1队列取出200Bytes报文发送,从Q2队列取出100Bytes发送;发送后,Deficit[1] = 0,Deficit[2] = 0.

经过第1~3轮WDRR调度,Q1队列被调出了3个200Bytes的报文,Q2队列被调出了3个100Bytes的报文.从长期的统计看,Q1和Q2的实际输出带宽比是2:1,与权重比相符.

WDRR调度避免了采用SP调度时低优先级队列中的报文可能长时间得不到服务的缺点,也避免了各队列报文长度不等或变化较大时,WRR调度不能按配置比例分配带宽资源的缺点.

但是,WDRR调度也具有低延时需求业务(如语音)得不到及时调度的缺点.

4.2.3.5、PQ+WRR/PQ+WDRR调度

PQ调度和WRR/WDRR调度各有优缺点.单纯采用PQ调度时,Packets in low-priority queues do not receive bandwidth for a long time,而单纯采用WRR/WDRRWhen scheduling, services with low latency requirements cannot be scheduled first,PQ+WRR/PQ+WDRRThe scheduling method combines the first two scheduling methods,Not only can play the advantages of two scheduling,And can overcome the shortcomings of the two scheduling.

用户可以借助PQ+WRR/PQ+WDRR调度方式,Put important protocol packets and delay-sensitive service packets into thePQin the scheduled queue,and assign the specified bandwidth to the queue;And put other packets according to their respective priorities into the adoptionWRR/WDRRIn each queue scheduled,Round-robin scheduling of each queue according to the weight.

Configuration of Switch Priority Mapping:
应用场景:Packets in different networks use different priority fields,For example, packets in a Layer 2 network use802.1p优先级,Packet usage in Layer 3 networksDSCP优先级.报文在进入设备时,The device maps the priority carried by the packet toInternal Service Levels and Colors,Then according to the service level and color, the packets are processed differently.QoS服务.When the packet is leaving the device,The device can re-mark the packet priority according to the internal service level and color,So that the subsequent network can serve according to the packet priority.
Switch Priority Mapping

1、配置端口优先级
[SW2] interfaceinterface-type interface-number
配置端口优先级.
[SW2-GigabitEthernet0/0/0] port priority priority-value //缺省情况下,The port priority is0.
当接口通过undo portswitchAfter switching to three-tier mode,Cannot configure port priority value,Port priority values are0.
2、配置DiffServ域
创建DiffServdomain and enterDiffServ域视图.
[SW2] diffserv domain { default | ds-domain-name }
在接口入方向,将VLAN报文的802.1p优先级映射为PHB行为,and color the message
[SW2-dsdomain-ds1] 8021p-inbound 8021p-value phb service-class [ green | yellow | red ]

在接口出方向,将PHB行为/颜色映射为VLAN报文的802.1p优先级
[SW2-dsdomain-ds1] 8021p-outbound service-class { green | yellow | red } map 8021p-value

在接口入方向,将IP报文的DSCP优先级映射为PHB行为,and color the message
[SW2-dsdomain-ds1] ip-dscp-inbound dscp-value phb service-class [ green | yellow | red ]
在接口出方向,将PHB行为/颜色映射为IP报文的DSCP优先级
[SW2-dsdomain-ds1] ip-dscp-outbound service-class { green | yellow | red } map dscp-value

在接口入方向,将MPLS报文的EXP优先级映射为PHB行为,and color the message
[SW2-dsdomain-ds1] mpls-exp-inbound exp-value phb service-class [ color ]
在接口出方向,将PHB行为/颜色映射为MPLS报文的EXP优先级
[SW2-dsdomain-ds1] mpls-exp-outbound service-class color map exp-value

3、应用DiffServ域
[SW2] interfaceinterface-type interface-number
在接口上绑定DiffServ域
[SW2-GigabitEthernet0/0/0] trust upstream { ds-domain-name | default | none } //noneNo priority mapping
Cancel the processing of outgoing packets on the interface.PHB映射
[SW2-GigabitEthernet0/0/1] undo qos phb marking enable

4、内部优先级和队列之间的映射
Configure the mapping between internal priorities and queues.
[SW2] qos local-precedence-queue-map local-precedence queue-index

5、Check Priority Mapping Configuration Results
查看DiffServ域的配置信息.
[SW2] display diffserv domain [ all | name ds-domain-name ]

PQ+WDRR调度:
1、进入接口视图.
[RA] interfaceinterface-type interface-number
2、Configure the scheduling mode of the port queue.

  • Configure the port queue scheduling mode asPQ、WRR或WDRR.
    [RA-GigabitEthernet0/0/0] qos { pq | wrr | drr }

  • Configure the port queue scheduling mode asPQ+WRR或PQ+WDRR.
    [RA-GigabitEthernet0/0/0] qos { pq { start-queue-index [ to end-queue-index ] } &<1-8> | { wrr | drr } { start-queue-index [ to end-queue-index ] } &<1-8> } *

  • PQ+WRRSpecify the port queue whenWRRscheduling weight.
    [RA-GigabitEthernet0/0/0] qos queue queue-index wrr weight weight

  • PQ+WDRRSpecify the port queue whenWDRRscheduling weight.
    [RA-GigabitEthernet0/0/0] qos queue queue-index drr weight weight

3、检查配置结果:
View all the data on the specified interfaceQoS配置信息.
[RA] display qos configuration interface [ interface-type interface-number ]
View queue-based traffic statistics on an interface.
[RA] display qos queue statistics interface interface-type interface-number [ queue queue-index ]

综合案例:
参考:S7700 V200R021C10 配置指南-QoS
https://support.huawei.com/enterprise/zh/doc/EDOC1100247678/7e29c35d

原网站

版权声明
本文为[0 s and 1 s]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/222/202208101837153029.html