network design and performance analysis
DESCRIPTION
Network Design and Performance Analysis. Wang Wenjie [email protected]. 综合服务 Integrated Services. Introduction ( 1 ). Internet 应用日益扩大,新的需求不断提出: 大容量 client/server 应用 实时和非实时多媒体应用 Web: 图像 这些应用对时延、吞吐量的变化以及分组的丢失都是敏感的 , 都需要大容量的通信量 基于 IP 的 Internet 原来设计目标已经无法满足这些应用: 对时延不敏感, - PowerPoint PPT PresentationTRANSCRIPT
Network Design and Analysis-----Wang Wenjie IS : 1
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Network Design and
Performance Analysis
Wang Wenjie
Network Design and Analysis-----Wang Wenjie IS : 2
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
综合服务
Integrated Services
Network Design and Analysis-----Wang Wenjie IS : 3
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Introduction ( 1 )
• Internet 应用日益扩大,新的需求不断提出:• 大容量 client/server 应用• 实时和非实时多媒体应用• Web: 图像
这些应用对时延、吞吐量的变化以及分组的丢失都是敏感的 , 都需要大容量的通信量
• 基于 IP 的 Internet 原来设计目标已经无法满足这些应用:– 对时延不敏感,– 容许吞吐量的变化和分组的丢失– 只提供尽力而为的服务
Network Design and Analysis-----Wang Wenjie IS : 4
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Introduction ( 2 )
• 基于 IP 的 Internet 的关键设计要求是 :
– 控制拥塞:拥塞使得网络无法以一种有效和及时的方式满足其通信量的需求。
– 提供低时延:当网络未出现拥塞时,时延是最小的。但是对有些应用,网络的利用率就必须相对高一些。这表示至少有某种程度的拥塞,因而有一些额外的时延。
– 提供高吞吐量:使网络专门化可以提高吞吐量。但要有效地使用网络就要使用统计复用,这在某种程度上与提供高吞吐量有矛盾
– 支持 QoS :对不同的通信流量提供不同级别的 QoS ,需要在分组或信元通过网络时进行智能处理
– 提供公平服务:给所有相互竞争的、具有同样 QoS 的通信流量提供大致等量的容量
Network Design and Analysis-----Wang Wenjie IS : 5
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Introduction ( 3 )
• 满足新的应用需求和 Internet 设计目标,仅增加网络的容量是不够的,还需要有灵敏而有效的管理通信量和控制拥塞的方法
• IETF 提出了两种不同的,功能相互补充的通信量管理框架:– 综合服务 Integrated Services: 对于加载在一个域上的一组业务提供一种综合的服务。 ( 1 )将被满足的需求限制在当前网络容量可以处理的范围内 ( 2 )在该域内预留资源以便为被满足的需求的特定部分提供一定的
QoS– 区分服务 Differentiated Services : 不试图从宏观上检控总的通信量,也不事先预留网络容量。是对通信量
分为组,所得到的服务取决于属于哪个组,不同的组可以有不同的处理方法。
Network Design and Analysis-----Wang Wenjie IS : 6
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Integrated Services Architecture
• 当前基于 IP 的 Internet 能够为应用提供尽力而为的服务• IPv4 的首部有指明服务类型的字段,但是路由器在进行路由选
择和处理分组时一般都忽略了。• 用来同时支持 TCP 、 UDP 通信量和实时通信量的唯一网络是
ATM
– 可能需要一些新的安装• 因此,需要在 TCP/IP 中能够支持具有不同 QoS 需要的各种通
信量– 在 routers 增加新的功能– 增加请求基于 QoS 服务的手段
Network Design and Analysis-----Wang Wenjie IS : 7
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
• 弹性 Traffic– 在网络上的时延和吞吐量的变化可以在很大范围内进行调整的通信
量– 基于 TCP/UDP 作为运输协议产生这样的通信量
• UDP :网络提供多大的速率应用就使用多大的速率,上限为应用产生数据的速率• TCP :网络提供多大的速率应用就使用多大的速率,上限为端到端接收方能接受
数据的最大速率,以及网络拥塞的影响。– TCP/UDP 上常用的应用都属于这样的通信量
• E-Mail – 对时延变化不敏感• FTP – 对吞吐量变化敏感• SNMP – 时延不是严重问题,除非是拥塞引起。这时希望 SNMP报文很快通过网
络• Web (HTTP), TELNET – 对时延敏感
– QoS perceived based on application• 对于非常小的元素,在总耗费中,跨越 Internet 的时延是最主要的成份• 对于较大的元素,总耗费时间由 TCP滑动窗性能决定,因此由 TCP连接的吞吐
量决定的。
Internet 上的通信量( 1 )
Network Design and Analysis-----Wang Wenjie IS : 8
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
• 非弹性 Traffic
– 不容易适应网络的时延和吞吐量的变化:如一些实时应用– 有如下一些要求:
• Throughput :最小吞吐量可能是需要的。• 时延:例如股票交易• Jitter :大的抖动,接收端就需要有大的缓存。• packet loss
– 在具有可变排队时延和拥塞丢失的环境中,上述需求是很难满足的。 提出两个新的需求:
1. 对要求较高的应用提供优先处理: 预先在某种服务请求中陈述,或在 IP 首部的某些字段说明2. 必须支持弹性 traffic : 非弹性 traffic 在面临拥塞时一般不退避也不减少需求,这样出现拥塞时,非弹性
traffic会继续供应负荷,而弹性 traffic 就有可能被挤出。
Internet 上的通信量( 2 )
Network Design and Analysis-----Wang Wenjie IS : 9
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
ISA 的处理方法( 1 )
• ISA 的目的是在基于 IP 的互联网上能够提供 QoS 的支持。• ISA 的主要设计问题是在发生拥塞时如何共享可用的资源• 目前基于 IP 的网络,路由器在控制拥塞和提供服务方面主要
两个机制:– 路由选择算法
• 选择具有最小时延的路由– 路由器发生溢出时分组丢弃
• 将发送丢弃分组的 TCP 实体退避并减少负荷。
Network Design and Analysis-----Wang Wenjie IS : 10
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
ISA 的处理方法( 2 )ISA 是一个总的体系结构,对尽力而为机制进行了增强。• 每一个分组和一个“流( flow )”相关联
– 由单个用户活动产生的 IP 分组构成的可区分的 stream ,它们要求相同的 QoS ( RFC 1633)
– 流和 TCP连接的不同:1. 流是单向的,并且可以有多于一个的接收者(多播)2. 基于源和目的 IP 地址、端口号和协议类型来区分一个 IP 分组是否属于
同一个流• 什么是 ISA?
– 对 Internet 上的服务进行区分– 主要考虑单独分组流– 每个流需要说明需要服务等级– 服务等级定量化为最小的服务速率,或者最大可容忍的端到端时延或丢失率– 基于当前可用的网络资源,网络可以接受或拒绝流的请求。
Network Design and Analysis-----Wang Wenjie IS : 11
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
ISA 的处理方法( 3 )
• ISA 使用以下功能来管理拥塞和提供 QoS 运输:– 容许控制:对 QoS 运输, ISA 要求对一个新的流要进行
预留。如果没有资源来保证所请求的 QoS ,则该流就不允许进入网络。
– 路由选择算法:可以基于许多不同的 QoS参数来决定路由
– 排队规则: 考虑不同的流不同的 QoS 需求的排队规则。如果有需要分组在同一个输出端口排队,该规则决定接下来将发送哪个分组。
– 分组丢弃策略: 在管理拥塞和满足 QoS 时,如何丢弃分组。
Network Design and Analysis-----Wang Wenjie IS : 12
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
ISA 在 Router 中的实现
RSVP
背景功能:用来产生转发功能所使用的一些数据结构
路由器基本转发功能
决定对流在所请求的QoS 上是否有足够的资源可用
为一个新的流在给定的 QoS上预留资源
•将入分组映射为类•确定下一跳•类的选择基于 IP 首部中的字段
•为每一个输出端口管理一个或多个队列•决定分组发送的顺序,以及丢弃哪些分组
能修改通信量控制数据库,并能监督准许控制模块以便设置准许控制策略
负责维护路由选择数据库,它对每一个目的地址和每一个流都给出应到达的下一跳
Network Design and Analysis-----Wang Wenjie IS : 13
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
ISA: 三类服务( 1 )
• 一个分组流的 ISA 服务是在两个级别上定义的:1. 通用服务类:提供一些通用的服务种类,其中每个服务都
提供了有服务保证的通用类型2. 类中特殊的流:在每一个类中,用通信量规约( TSpec )
对每个流的服务进行说明
TSpec 是服务合约的一部分
Network Design and Analysis-----Wang Wenjie IS : 14
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
ISA: 三类服务( 2 )• 目前已经了三个种类的服务 保证的服务
– 确定的容量 (data rate)– 对通过网络的时延指定一个上限– 没有排队丢失 (即没有 buffer溢出,但可以由于网络出现故障或改变了路由选择的路径而丢失 )
受控负荷– 相当于无负荷情况下尽力而为的服务行为– 没有指定上限,但大部分分组时延不会超过最小时延太多– 几乎没有排队丢失,大部分分组会成功交付
尽力而为(缺省)
Network Design and Analysis-----Wang Wenjie IS : 15
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
排队规则
• 排队规则是 ISA 实现中的一个重要构件。• 传统的路由器都是在每一个输出端口使用 FIFO 的排队规则• 针对 QoS 需求,单 FIFO队列有很多的不足:
– 对高优先级或时延比较敏感的分组没有特殊的对待– 短的分组会被队列中前面的长分组阻挡
• 短分组的平均时延增加• 长分组会得到比较好的服务
– 不同的连接对资源使用是不公平的• ISA允许每个端口有多个队列
– 每个队列对应一个流– 每个队列有单独的规则– 公平排队策略
Network Design and Analysis-----Wang Wenjie IS : 16
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Queuing Disciplines
缺点 ?
短分组得到惩罚:对于具有较长平均分组长度的流,要比具有较短平均分组长度的流得到更多的容量
•不同的流采用轮流方式被服务•每次循环从有分组的流中发送一个分组•可以在不同的流之间进行负荷的平衡
Network Design and Analysis-----Wang Wenjie IS : 17
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
处理机共享方法
• 处理机共享 (PS)– 是一种理想的方法,是不能实现的– 思想是:每次循环每个队列只发送一个位– 每个忙的流得到完全一样的容量
• 对于 N 个队列,每个队列会得到可用容量的 1/N
– 单独考虑每个队列,计算每次传输“虚拟的”开始和结束时间
EXAMPLE QUEUE QUEUE QUEUE Packet 1 Packet 2 Packet 1 Packet 2 Packet 1
Real arrival time, i 0 2 1 2 3Transmission time, Pi 3 1 1 4 2Virtual start time, Si 0 3 1 2 3Virtual finish time, Fi 3 4 2 6 5
Network Design and Analysis-----Wang Wenjie IS : 18
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
位轮流公平排队
• 位轮流公平排队 Bit-Round Fair Queuing (BRFQ)– 实际当中,我们希望发送的是分组,而不是位。– BRFQ 效仿 PS轮流方法发送分组和多个同步队列– 计算虚拟开始时间 Si 和虚拟结束时间 Fi
– 当一个分组传送完成后,发送所有队列中具有最小 Fi值的分组– 算法基于传输数据的量,而不是基于传输的分组数量。– 随着时间的增大,在 BRFQ下每个流经受的吞吐量和平均时延,将
收敛于 PS下的结果
Network Design and Analysis-----Wang Wenjie IS : 19
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
PS vs. BRFQ Example
缺点?
对流没有优先级
不能将不同数量的容量提供给不同的流
要支持 QoS ,就要有区别地分配容量
Network Design and Analysis-----Wang Wenjie IS : 20
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
排队规则比较( 1 )
负荷等于容量
Network Design and Analysis-----Wang Wenjie IS : 21
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
排队规则比较( 2 )
负荷超过容量
Network Design and Analysis-----Wang Wenjie IS : 22
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
广义处理机共享 (GPS)
• BRFQ 不能为不同流提供不同的容量• 增强的方法称为:加权公平排队 (WFQ)
• 根据 PS, 对每个流分配权重,以决定有在每个循环中有多少位可以发送– 如果权重为 5 ,则每个循环可以发送 5位
• 给出了针对不同服务请求做出响应的方法。• 同时提供了一个保证,流的时延不会超过某种上限
Network Design and Analysis-----Wang Wenjie IS : 23
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Queuing Discipline – Priority Queuing
Data Communications andNetworking, Forouzan, 2004
Network Design and Analysis-----Wang Wenjie IS : 24
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Queuing Discipline – Weighted Fair Queuing
Data Communications andNetworking, Forouzan, 2004
Network Design and Analysis-----Wang Wenjie IS : 25
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Weighted Fair Queue (WFQ)
保证的速率 =0 .5
保证的速率 =0 .05
Di Bi (Ki-1)Li K
i Lmax
Ri Ri m=1 Cm
流 i 的最大时延
Di = flow i 经受的最大时延Bi = flow i 的令牌桶大小 Ri = flow i 的令牌速率Ki = 通过网络的 flow i 的路径上
结点数Li = flow i 的最大分组长度Lmax = 通过 flow i 的路径上所有结点
的所有流的最大分组长度Cm = 结点 m 的输出链路数
Network Design and Analysis-----Wang Wenjie IS : 26
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
调度和队列管理 (see RFC 2309)
• 调度: 管理带宽的分配,确定下来发送哪个分组• 队列管理: 如果需要,预先丢弃分组,管理分组队列的长度• 网络出现拥塞,路由器的缓存充满了,分组开始丢弃:
– 分组重传:又增加了网络的负荷– 可能出现全局同步:多个 TCP连接都受到影响,进入慢启动,网络
通信量急剧下降• 可能的解决方案:
– 增大缓存,减少分组丢弃的概率– 预测拥塞的开始,通知相关连接降低速率: RED 方法,
Network Design and Analysis-----Wang Wenjie IS : 27
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
随机早期检测 (RED)
• RED 的设计目标:预防性地丢弃分组– 预见拥塞,并提早采取避免措施: RED 设计是为了避免
拥塞,而不是对拥塞作出反应– 改进弹性业务的性能,而不惩罚突发通信量的业务– 在拥塞出现时,避免 “全局同步” 现象出现:路由器决定
哪个连接需要退避,这是通过丢弃分组来通知的– 将平均队列长度 (buffer 的大小 ) 控制在确定范围内:
RED 应当能够控制平均长度,因而能够控制平均时延
Network Design and Analysis-----Wang Wenjie IS : 28
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Previous Work
• Drop Tail
• Random Drop
• Early Random Drop
• Source Quench messages
• DECbit scheme
Network Design and Analysis-----Wang Wenjie IS : 29
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Drop Tail Router
• FIFO queueing mechanism that drops packets when the queue overflows.
• 引起同步的 TCP 退避和重启• 通信量的波动
Network Design and Analysis-----Wang Wenjie IS : 30
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Random Drop Router
• When a packet arrives and the queue is full, randomly choose a packet from the queue to drop.
Network Design and Analysis-----Wang Wenjie IS : 31
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Early Random Drop Router
• If the queue length exceeds a drop level, then the router drops each arriving packet with a fixed drop probability.
• Reduces global synchronization
• Does not control misbehaving users (UDP)
?
Drop level
Network Design and Analysis-----Wang Wenjie IS : 32
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Source Quench messages
• Router sends source quench messages back to source before queue reaches capacity.
• Complex solution that gets router involved in end-to-end protocol.
Network Design and Analysis-----Wang Wenjie IS : 33
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
DECbit scheme
• Uses a congestion-indication bit in packet header to provide feedback about congestion.
• Average queue length is calculated for last (busy + idle) period plus current busy period.
• When average queue length exceeds one, set congestion-indicator bit in arriving packet’s header.
• If at least half of packets in source’s last window have the bit set, decrease the congestion window exponentially.
Network Design and Analysis-----Wang Wenjie IS : 34
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
RED Buffer Management
Avg: 平均队列长度
Pa :丢弃分组的概率
Pb :临时概率
Pmax : Pb 的最大值
Count :上一次丢弃分组后的分组数
F :小于 avg 临界区在
整个临界区所占的比例
•Drop some packets when queue start to grow.•Start dropping packets with low probabilitywhen the average queue length avg reaches•minth.•The larger the avg, the more likely a packet isdropped.•All packets are dropped when avg >= maxth.
Network Design and Analysis-----Wang Wenjie IS : 35
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Average Queue Length
Network Design and Analysis-----Wang Wenjie IS : 36
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Packet Dropping Probability
Network Design and Analysis-----Wang Wenjie IS : 37
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
RED Algorithm ( 1 )
calculate the average queue size, avg
if avg < THmin
queue the packet
else if THmin avg < THmax
calculate probability Pa
with probability Pa
discard the packet
else with probability 1 – Pa
queue the packet
else if avg THmax
discard the packet
Network Design and Analysis-----Wang Wenjie IS : 38
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
Network Design and Analysis-----Wang Wenjie IS : 39
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
RED Probability Function ( 1 )
Network Design and Analysis-----Wang Wenjie IS : 40
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
RED Probability Function ( 2 )
Fconst = THmax - THmin avg - THmin
Pa = 1/Pb - count
1
Pb = F x Pmax
Network Design and Analysis-----Wang Wenjie IS : 41
© G
rad
uat
e S
cho
ol ,
Ch
ines
e ac
adem
y o
f S
cien
ces.
RED Performance (vs. 丢弃尾策略 )
Pmax = 0.02