当前位置:网站首页>QoS Quality of Service Eight Congestion Avoidance
QoS Quality of Service Eight Congestion Avoidance
2022-08-10 19:19:00 【0 and 1 tour】
4、Qos拥塞避免
什么是拥塞避免?Congestion avoidance mainly in happens by discarding messages to relieve traffic congestion overload.By discarding the message alleviate the pressure of the downstream equipment flow.
两种丢弃策略:
- 尾丢弃
- WRED
4.1、 尾丢弃
尾丢弃(Tail Drop,尾丢弃)Refers to when the queue is filled with,All subsequent incoming message will be unable to team and cast it away,Beginning of the discarded way.Because it is at the rear of the queue of data packet will be discard,直到拥塞解除.So the wrong message in any way to distinguish,Is not differentiated service level.
The tail discarding the consequences:高延迟、高抖动、Loss of service guarantees、TCPGlobal synchronization andTCP"饿死"等.
The above consequences causes an overtime、数据重传、The business is not available in the process of data transmission phenomenon such as,Data timeout retransmission will further aggravate the network congestion occurs.
TCP的拥塞控制:
Abscissa to provide load,On behalf of the unit time输入Give the number of the network packet;
纵坐标是吞吐量,On behalf of the unit time from the network输出The number of groups.
tcp全局同步
This kind of phenomenon is because when the queue is filled with,All messages are discarded,这就导致TCPFlow message at the moment all discarded,传输中断,这时多个 TCP Connection at the same time into the congestion avoidance and慢启动状态,以降低并调整流量.Link asTCPMessage to reduce,Sufficient bandwidth to become,不再拥塞,In front of the interruptedTCPInitiate contact message flow in this moment,根据TCP快重传和快恢复Features and send the data.Flow of transmission and can cause congestion at the same time.This kind of phenomenon is repeated happen,使网络流量忽大忽小,Affect the link utilization.这种现象称为TCP全局同步.
TCP饥饿
The tail discarding the causeTCPAllocation of bandwidth traffic between uneven,Some high priority message traffic will occupy most of the bandwidth of the,而普通的TCPThe uneven distribution of flow bandwidth and“饿死”.
When the network has bothTCP又有UDP流量的时候,TCPTraffic because window mechanism(Stern discarded cause sliding window decrease)And release the bandwidth,UDPTraffic no window mechanism,于是UDPTraffic quickly occupiedTCPThe bandwidth of the release,最终造成UDPAll the bandwidth traffic andTCPFlow due to no bandwidth allocation“饿死”.
无差别丢弃
无差别的丢弃,Not to distinguish the different priority message.
4.2、 RED技术原理
RED(Random Early Detection,随机早期检测)较好的解决了TCPGlobal synchronization problem,Specific principle is in front of the queue was filled with began to discard a message,And with the increase of queue length(The congestion may occur)The greater the packet is discarded probability will become,When more than one of the biggest loss rate and packet discard to.
随机早期检测,Random refers to discard the way,Is a message for the unit,Not to flow.Early refers to occur before the congestion in,Message not discard it“选择”.By random early detection can avoidTCPFlow of packets at the same time be discarded,也就不会产生TCPGlobal synchronization problem.
RED的三个重要参数:
(1)、最小门限THmin:The lowest discarding the threshold.The average queue length exceeds the threshold,若平均队列长度小于最小门限THmin,则把新到达的分组放入队列进行排队;The average queue length exceeds the threshold,According to a certain probability will arrive new packet discard.
(2)、最大门限THmax(high-limit):若平均队列长度超过最大门限THmax,则把新到达的分组丢弃.
(3)、丢弃概率Pmax(low-limit):The biggest loss rate.即REDDiscarding the message under the condition of the maximum probability of discarded,Maximum value is usually not more than100%.
平均队列长度avg、丢弃概率 p 与 THmin 和 Thmax 的关系:
- 当 avg > Thmin 时,丢弃概率 p = 0.
- 当 avg < Thmax 时,丢弃概率 p = 1.
- 当 THmin < avg < THmax时, 0 < p < 1 .
Here is a packet loss ratep、最大门限THmaxAnd the minimum thresholdTHmin的关系:
Green message:当avg > ThminMarked as green,Do not discard
Yellow message:当THmin < avg < THmax时,报文被标记为黄色,To discard probability.并且,The longer the long queue,Discard the higher the probability of.
Red packet:当avg < Thmax时,报文被标记为红色,And discard.
The average queue length calculation:
平均队列长度avg=old_avg x (1-2-n) + current_queue_size x 2-n
其中,nFor the user configuration values,即weighting-constantWeighting constant.
Discard probability for the current team:
P = Pmax x (avg-MinTheshold)/(MaxTheshold- MinTheshold)
使用RED技术的结果:
REDDiscarding the reduced link violent oscillation,Improved the circuit bandwidth utilization and throughput.Reducing the delay and jitter.
RED技术的缺点:
- 公平性问题
For connection does not respond to congestion notice,REDAlgorithm can't effectively deal with,This connection will often use a large amount of network bandwidth,Led to a variety of connection unfairly bandwidth sharing. - 参数设置问题
REDAlgorithm is sensitive to parameter Settings,Two threshold and the maximum packet loss probability and subtle changes are often large effects on the network performance,If according to the specific business environment to choose the most suitable parameter isREDOne of the important problems. - Network performance issues
REDAlgorithm to control the average queue length is often as the number of connections increases with the increasing,Transmission delay jitter caused by,Network performance caused by unstable.
4.3、 WRED技术原理
WRED(Weighted RED,加权随机早期检测)对比REDSolve the problem of important and urgent message is discarded.Allow different priority message configurationRED参数,To ensure that different priority message for service.当发生拥塞时,实时性的业务带宽能够得到最大的保证.
WRED支持基于DSCP优先级的WRED和基于IP优先级的WRED,Allow for different priority message configurationRED参数,To ensure the important degree of different message get different service.
基于IPPriority packet discarding the threshold in the lowest not discarded curve at the same time:
IP PrecedenceThe higher the queue of the discarded the lower the rate of,This means that the packet the less,For important and urgent message priority.
基于DSCPPriority packet discarding the threshold in the lowest not discarded curve at the same time:
可以看出EFMessage has a minimum loss rate and discarding the range.
WFQ队列,CBQ队列内AF队列支持WRED、且WRED区分三种丢弃优先级(对应红、黄、绿三种报文颜色),允许用户对每种丢弃优先级设定高低门限百分比和丢弃概率,因此WRED可以对各种业务流以及同一业务流内部不同的丢弃级别报文进行不同概率的丢弃.
To receive a message,实际应用时,WREDLow threshold percentage advice from50%开始取值,According to the different colors of discarding priority adjustment step by step.Generally recommended green message set of discarding probability is small,高、Low threshold method is bigger;Yellow message times;Red packet discard probability maximum set,高、Low threshold minimum.
WREDQueue length of biggest Settings:
队列不能设置过短.如果某队列过短,缓存空间过小,容易造成丢包,流量即使速率不大也容纳不下.The shorter the queue,The smaller the tolerance of sudden quantity.队列越大,The greater the amount of sudden tolerate.
队列也不能设置过长.如果队列太长,时延过大.尤其对于TCP应用,通信两端会预测网络拥塞情况,在发送完一个报文后,启动超时定期器等待对方应答,如果在定时器超时前没有等到应答,发送方会重发报文.如果报文在网络中被缓存的时间过长,不丢弃与丢弃没有区别.
推荐高优先级队列(CS7、CS6、EF)的长度设置为10ms * 队列输出带宽;低优先级队列的长度设置为100ms * 队列输出带宽.
4.3.1、WRED配置
1、Configuration based on queueWRED
(1).Create a discarded template
命令:drop-profile drop-profile-name
(可选)指定当前WREDDiscarding the template based onDSCP优先级或IPPriority to discard.
命令:wred { dscp | ip-precedence }
配置基于DSCP优先级或IP优先级的WRED参数.
- 配置基于DSCP优先级的WRED参数.
dscp { dscp-value1 [ to dscp-value2 ] } &<1-10> low-limit low-limit-percentage high-limit high-limit-percentage discard-percentage discard-percentage - 配置基于IP优先级的WRED参数.
ip-precedence { ip-precedence-value1 [ to ip-precedence-value2 ] } &<1-10> low-limit low-limit-percentage high-limit high-limit-percentage discard-percentage discard-percentage
(2).Application of discarding the template
Queued template view.
命令:qos queue-profile queue-profile-name
In the queue in the template for the specified queue configurationWFQ调度模式.
命令:schedule wfq start-queue-index [ to end-queue-index ]
Discarding the template in the queue in the template for the specified queue binding.
命令:queue { start-queue-index [ to end-queue-index ] } &<1–10> drop-profile drop-profile-name
Enter the need to configure the congestion avoidance interface view or child interface view.
命令:interface interface-type interface-number[.subinterface-number ]
Under the interface or child interface application queue template.
命令:qos queue-profile queue-profile-name
案例配置:
创建队列模板queue-profile1,Configure the queue scheduling mode.
[RouterA] qos queue-profile queue-profile1
[RouterA-qos-queue-profile-queue-profile1] schedule pq 5 wfq 3 to 4
The application queue template
Discarding the template in the queue bindings in the template.
[RouterA-qos-queue-profile-queue-profile1] queue 4 drop-profile video
[RouterA-qos-queue-profile-queue-profile1] queue 3 drop-profile data
The queue template is applied to theRouterA的接口GE3/0/0上.
[RouterA] interface gigabitethernet 3/0/0
[RouterA-GigabitEthernet3/0/0] qos queue-profile queue-profile1
Check on the interface application queue template information.
[RouterA] display qos queue-profile queue-profile1
Check on the interface applicationWREDDiscarding the template information.
[RouterA] display drop-profile video
[RouterA] display drop-profile data
2、配置MQCTo achieve congestion avoidance
(1).Discarding the template configuration
[Huawei]drop-profile AFW //Define discarded template forAF11
[Huawei-drop-profile-AFW]wred dscp //基于dscp丢弃(默认基于IPP)
#定义dscp af21The data flow minimum threshold30%,The highest threshold95%,丢弃概率30%
[Huawei-drop-profile-AFW]dscp af21 low-limit 30 high-limit 95 discard-percentage 30
(2).配置流分类
(3).配置流行为 Popular for must have configuredqueue af或queue wfq.
[Huawei]traffic behavior AFW
[Huawei-behavior-AFW]drop-profile AFW //Popular for cut withWRED
(4).配置流策略
(5).应用流策略
4.2、 队列缓存对时延和抖动的影响
1、队列缓存对时延的影响:
When the device receives a message,将报文放入缓存,网络不拥塞时,报文能被及时转发,不会在缓存中产生堆积.这种情况下报文在缓存中的时间为μs级,延迟时间可以忽略不计.
当网络拥塞时,报文在缓存中产生堆积,被延迟处理,延迟时间会大幅增加.从报文进入缓存到报文被调度出去的时间间隔称为缓存时延(也称为队列时延).
缓存时延的大小主要取决于队列的缓存长度以及该队列获得的输出带宽,可以使用如下公式计算缓存时延的最大值:
缓存时延最大值 = 队列缓存长度÷队列输出带宽
队列缓存长度单位是Byte;队列输出带宽即队列整形速率,单位是bit/s,因此上述公式可表达为:
缓存时延最大值 = 队列缓存长度×8÷队列整形速率
从上述公式可以看出,缓存越大,缓存时延越大.
2、队列缓存对抖动的影响
抖动,也叫做延时的变化,是指同一业务流中不同分组所呈现的时延不同.数据包离开发送端时,是按照一定的间隔均匀发送,然而在通过网络时,这一均匀的间隔因数据包经历不同的延迟而遭到破坏,从而产生抖动.抖动会对语音、视频流等实时业务造成影响,分组到达时间的差异将在话音或视像中造成断续.为了解决抖动问题,通常语音/视频的接收终端会有去抖动缓存机制,但如果网络抖动过于严重,超出了接收终端的容忍度,依然会导致语音或视像的失真和断续.
网络抖动严重的原因主要是IP网络路由状态频繁变化,使得各数据包分别经由不同物理路由到达;或者网络节点流量拥塞,数据包在各节点缓存时间过长,使得数据包到达接收端的时间差较大.其中,后者是较为常见的原因.
根据抖动的定义可知:抖动=时延差.时延差越大,则抖动越大.那么,如果把时延都控制的很小,那时延差也就得到控制.即,通过控制时延,可间接控制抖动.例如,把时延控制在5µs之内,那么时延差也就控制在5µs,即抖动也控制在5µs之内.
缓存越大,缓存时延越大.那么,适当控制缓存长度,可控制时延,从而控制抖动.
3、队列缓存的设置
队列不能设置过短.如果某队列过短,缓存空间过小,流量即使速率不大也容纳不下,容易造成丢包,从而给使用TCP协议传输的业务带来抖动.
队列也不能设置过长.如果队列太长,时延过大.尤其对于TCP应用,通信两端会预测网络拥塞情况,在发送完一个报文后,启动超时定期器等待对方应答,如果在定时器超时前没有等到应答,发送方会重发报文.如果报文在网络中被缓存的时间过长,不丢弃与丢弃没有区别.
“队列缓存对时延的影响”中介绍过:
缓存时延最大值 = 队列缓存长度×8÷队列整形速率
此公式可推断出:
队列缓存长度(Byte) =队列整形速率(bit/s)×业务能容忍的最大时延(s)÷8
低优先级业务的时延通常要求≤100ms,高优先级业务的时延要求≤10ms.结合上述公式,推荐高优先级队列(CS7、CS6、EF)的长度设置为10ms×队列整形速率;低优先级队列的长度设置为100ms×队列整形速率.
5、基于DiffServ模型的QoS组成结构
边栏推荐
猜你喜欢
[教你做小游戏] 只用几行原生JS,写一个函数,播放音效、播放BGM、切换BGM
[Teach you how to do mini-games] How to lay out the hands of Dou Dizhu?See what the UP master of the 250,000 fan game area has to say
漫谈测试成长之探索——测试文档
AIRIOT答疑第8期|AIRIOT的金字塔服务体系是如何搞定客户的?
MySQL 查询出重复出现两次以上的数据 - having
优化是一种习惯●出发点是'站在靠近临界'的地方
魔方电池如何“躺赢”?解锁荣威iMAX8 EV“头等舱”安全密码
set和map使用讲解
选择是公有云还或是私有云,这很重要吗?
MySQL 原理与优化:Update 优化
随机推荐
stm32中的CAN通讯列表模式配置解析与源码
常见端口及服务
剑指 Offer II 042. 最近请求次数-队列法
服务器上行带宽和下行带宽指的是什么
Introduction to 3 d games beginners essential 】 【 modeling knowledge
Qt学习第三天
FPGA:从0开始(安装开发环境)加破解
[教你做小游戏] 只用几行原生JS,写一个函数,播放音效、播放BGM、切换BGM
【OpenCV】-物体的凸包
dumpsys meminfo 详解
入门:人脸专集2 | 人脸关键点检测汇总(文末有相关文章链接)
QoS服务质量七交换机拥塞管理
StoneDB Document Bug Hunting Season 1
消息队列初见:一起聊聊引入系统mq 之后的问题
如何通过JMobile软件实现虹科物联网HMI/网关的报警功能?
补坑求逆序对
基于GAMS的电力系统优化分析
开源一夏 | mysql5.7 安装部署 -二进制安装
陕西CAS:1244028-50-9_Biotin-PEG3-SCO-PPh3 固体
MySql main performance indicators description