




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、1chapter 6 network layern6.1网络层向传输层提供的服务n6.2虚电路与数据报n6.3路由算法n6.4拥塞控制n6.5网络互连26.1网络层向传输层提供的服务n网络层设计目标:n服务应与通信子网的技术无关n对于传输层而言,通信子网的数量、类型和拓扑结构是隐蔽的n网络地址应该采用统一的编号模式n争论:n网络层提供面向连接的服务还是非连接的服务传输层网络层主机通信子网用户网络运营商复杂功能复杂功能36.2虚电路与数据报nosi的网络层提供两种服务n面向连接虚电路(virtual circuit):n首先要发出连接请求,与目的端建立连接n数据通信n拆除连接n非连接数据报(da
2、tagram)n每个分组头都必须包含目的地址n每个分组在途径节点上被单独处理n同一数据流的分组可以走不同的路径4虚电路的特点n一条物理链路可以对应多条逻辑信道n一条虚电路由各物理链路上的逻辑信道级联而成,占用了节点上的一条逻辑信道实际上就是占用了该节点上缓存器内的一个存储空间n分组靠逻辑信道号(lcn)选择路由,因lcn只有局部意义,所以减少了分组头标的开销和处理的复杂度n能有效的防止拥塞5virtual circuits: signaling protocolsnused to setup, maintain teardown vcnused in atm, frame-relay, x.2
3、5nnot used in todays internetapplicationtransportnetworkdata linkphysicalapplicationtransportnetworkdata linkphysical1. initiate call2. incoming call3. accept call4. call connected5. data flow begins6. receive datanetworkdata linkphysical6数据报的特点n每个分组的寻路是独立的,可以合理利用网络资源n如果途中一个节点或一条链路发生故障,能给分组重选路由n分组头需
4、要包含地址字段,也会增加开销(overhead)n各分组途经的路径可能不同,因此有可能出现先发后到现象n分组必须有生存时间限制,当生存期满时,分组则被抛弃,免得在网络内死转7datagram networks: the internet modelnno call setup at network layernrouters: no state about end-to-end connectionsnno network-level concept of “connection”npackets typically routed using destination host idnpacke
5、ts between same source-dest pair may take different pathsapplicationtransportnetworkdata linkphysicalapplicationtransportnetworkdata linkphysical1. send data2. receive data86.3路由算法n网络层的主要功能是根据分组目的地址选择路径,对数据报,每个分组都要在途径的节点上被单独寻路;而虚电路,则在建立连接时要进行寻路。n路由算法有两类:非自适应和自适应非自适应自适应静态路由动态路由路由表固定路由表定时刷新路由协议简便、可靠、易
6、行,适用于负荷稳定、拓扑结构变化不大的网络算法复杂,会增加网络负担,但能够改善网络的性能,并有利于流量控制9what does a routing table look like106.3.1dijkstra最短通路搜索算法n最短通路算法的基本准则:n在全双工链路连接的网络上,每条链路的每个方向上都有一个与之相关的权值。两个节点之间一条路由的代价是它所经过的链路权值之和,所以,这两个节点间的最佳路由为其所有可能路由中具有最小代价的那条路由。nrouting metrics (weight,cost)nnumber of hopsndelaynbandwidthnloadabcefghd2216
7、4273223利用dijkstra算法求a到d的最短通路abcefghd22164273223ab(2,a)e(,-)g(6,a)c(,-)f(,-)h(,-)d(,-)ab(2,a)e(4,b)g(6,a)c(9,b)f(,-)h(,-)d(,-)ab(2,a)e(4,b)g(5,e)c(9,b)f(6,e)h(,-)d(,-)ab(2,a)e(4,b)g(5,e)c(9,b)f(6,e)h(9,g)d(,-)ab(2,a)e(4,b)g(5,e)c(9,b)f(6,e)h(8,f)d(,-)ab(2,a)e(4,b)g(5,e)c(9,b)f(6,e)h(8,f)d(10,h)ab(2,a
8、)e(4,b)g(5,e)c(9,b)f(6,e)h(8,f)d(10,h)ab(2,a)e(4,b)g(5,e)c(9,b)f(6,e)h(8,f)d(10,h)最短通路为:a-b-e-f-h-d,权值为10126.3.2距离矢量( distance vector )路由算法n距离矢量路由选择(distance vector routing)算法是现代计算机网络两个最常使用的动态路由选择算法之一。narpanet;decnet、novell的ipx以及internet的一种内部网关协议(igp,interior gateway protocol)rip(route information p
9、rotocol)都使用了距离矢量路由选择算法;cisco则开发了一种改进的协议,叫作igrp(interior gateway routing protocol)。n每个节点都定期地将它们的路由表传送给所有相邻节点,这里的路由表所包含的内容有:n每条路径的目的地址矢量n本节点到该目的地址的代价距离n每个节点根据收到的相邻节点的路由信息更新自己的路由表13 距离矢量路由算法举例81012614问题n寻路环(routing loops)n慢收敛(slow convergence)n无穷计算(count to infinity):n它对好消息的反应迅速,但对坏消息却反应迟钝。15水平分割算法n水平分
10、割(split horizon)算法是解决无穷计算问题的一种方法。n其工作过程与距离矢量法一样。n不同之处在于:如果节点c通过节点b向a发送分组,则节点b不会再试图通过c向a发送分组。换句话说,节点c向b发送的路由信息中不会包含通往a的路由信息。166.3.3链路状态( link state )路由算法n链路状态路由算法于1979年出现在arpanet上,作为一种用来取代dvr的动态路由选择算法,得到了广泛的应用。n算法:n主动测试邻接节点的状态n定期地将相邻节点的状态信息传送给所有节点n每个节点都有完整的网络拓扑信息,然后计算到每个节点的最佳路径n该方法也叫最短路径优先(shortest p
11、ath first),简称spf算法17distance vector vs. link statendvn节点向相邻节点告诉它所知道的所有节点的路由信息n节点根据相邻节点的路由信息更新自己的路由表n分布式计算n可扩展性差nlsn节点向所有节点告诉其相邻节点的状态信息n每个节点都有一个全局的拓扑结构n根据此拓扑结构计算路由表n可扩展性好,可靠18分级路由选择(hierarchical routing)n将网络分成一些区域,每个区域内的路由器只负责本区域内的分组转发,而不管其它区域的情况,目的地址不在本区域内的分组都发给指定的区域路由器去处理。n当网络规模很大时,往往需要分成多级。n路由信息的交
12、换只在本区域内进行,路由器内部需存储的路由信息大大减少。节省了路由器的存储空间和网络带宽。n缺点是选择的路由可能不是最佳的。19分级路由示例206.4拥塞控制n什么是网络的拥塞n当大量分组进入通信子网,超出了网络的处理能力时,就会引起网络局部或整体性能下降,这种现象称为拥塞。n路由器的队列溢出,分组丢失n拥塞会导致什么后果n拥塞使许多分组重传n导致更多的业务量,直至崩溃n拥塞的原因n路由器的处理速度、存储空间、带宽不匹配n网络负载的不平衡21拥塞控制与流量控制n拥塞控制n网络负载的不均衡,例如,某个路由器的多个输入端口向同一个输出端口传输分组n是全局问题,涉及的节点包括主机、路由器n流量控制n
13、接收端或所在网络的接收速度小于发送端的发送速度n只涉及收发两端,是局部问题n由于解决方法相似,两者经常混淆226.4.1拥塞控制的一般原理n从控制理论观点出发,可分为两类:n开环控制,基于良好的设计n业务量整形漏桶算法、令牌桶法n闭环控制,基于反馈概念n监测系统何时、何处发生拥塞n将拥塞信息传到能控制它的地方n调整系统操作n指示网络拥塞的参数n分组丢失率n平均队列长度n分组重传率n平均分组延时236.4.2拥塞控制的策略n闭环控制n检测到拥塞时,就发一个分组给源端或向所有主机广播n在每个分组头中保留一个位或域,当拥塞超过一定值时,路由器就在该位或域上填上拥塞信息通知网络节点n由主机或路由器发送
14、询问分组打听拥塞情况241.虚电路中的拥塞控制采用接纳控制(admission control)的三种策略:一旦出现拥塞的信号,就不再创建任何虚电路,直至拥塞解除。允许建立新的虚电路,但要仔细选择路由,以便所有新的虚电路绕过拥塞的区域。在虚电路建立时,子网与主机对所需服务质量进行协商。若不能满足主机最低要求,则拒绝建立连接;否则就保留连接所需的多种资源,避免拥塞发生。252.数据报中的拥塞控制n抑制分组(choke packet):每个路由器监视本节点的资源利用情况,若某个方向的资源利用率超过一定的门限,则该路由器向有关源节点发送抑制分组,源节点相应减少发往该方向的数据量,直至该方向的拥塞解除
15、。ntcp的窗口机制对拥塞的有着慢启动和拥塞回避策略,但有时会引起同步效应,可采用随机早期检测(red,random early detection)的方法进行拥塞控制,该方法采用提早丢包来减轻网络负载。minthmaxth分组丢失概率1.0maxp平均队列长度26服务质量(qos)n各种不同业务对qos的需求应用可靠性延时延时抖动带宽e-mailhighlowlowlowfile transferhighlowlowmediumweb accesshighmediumlowmediumremote loginhighmediummediumlowaudio on demandlowlowhi
16、ghmediumvideo on demandlowlowhighhightelephonelowhighhighlowvideoconferencinglowhighhighhigh27服务质量(qos)控制方法n资源预留n接纳控制n队列调度n缓存(消除延时抖动)n业务量整形(也是拥塞控制的两种常用方法)n漏桶算法n令牌桶法28漏桶算法以恒定的速率向网络发送29举例n计算机以25mb/s(200mbps)速率产生数据,向网络发送1mb的数据(即以25mb/s速率发送了40ms),而网络的最佳传输速率不超过2mb/s,为了降低传送速率,令漏桶的=2mb/s,因此1mb的数据将传输500ms。3
17、0令牌桶法令牌桶以每隔t秒产生令牌,分组得到令牌后就可发送31举例n设突发长度为s秒,令牌桶容量c bytes,令牌产生速率为 bytes/s,计算机最大数据速率m bytes/s。n设前例中,c=250kb,m=25mb/s, =2mb/snc+ s=ms s=c/(m- )=11msn剩余的以2mb/s发送364ms32c=250kbc=500kbc=750kbc=500kb令牌桶加10mb/s漏桶33服务质量(qos)控制技术n综合服务(intserv, integrated services)n基于流的qos控制技术,不适合大规模使用 n区分服务(diffserv, different
18、iated services)n基于类的qos控制,但不是严格意义的qosn多协议标记交换(mpls, multi-protocol label switching)34mpls operation1a. routing protocols (e.g. ospf-te, is-is-te) exchange reachability to destination networks1b. label distribution protocol (ldp) establishes label mappings to destination network2. ingress ler receive
19、s packet and “label”s packetsipip103. lsr forwards packets using label swappingip20ip404. ler at egress removes label and delivers packetip356.5 网络互连n互连设备:nrepeater/hubnbridge/switchnrouter/l3 switch ngateway36one lan is not enoughndue to distance cannot go beyond 100m or 185m or 500m or 2.5kmndue t
20、o capacity 10 mbps or 100 mbps is shared between all stations on a segmentnas a result:norganization ends up with several lansnthe multiple lans need to be interconnected37lan 的扩展n随着lan用户的增长,有必要将它划分成一些较小的碰撞域n降低拥塞n提高性能n提高可靠性n网络连接设备有nrepeater or hub:在物理层透明地复制比特流,以补偿信号的衰减nbridge or switch:在相同或不同的lan间存储
21、转发帧,必要时要进行链路层的协议转换nrouter:在不同的网络间存储转发发组,必要时进行网络层转换ngateway:指对高层协议进行转换的协议转换器38repeatersnjoins two segments of cablenonly one path of segments and repeaters between any two stations - cannot have loopsnattempt to forward all frames - error frames will be forwardednno logical isolation of segmentsncoll
22、ision domains are not isolated - if two stations on different segments send at the same time, packets will collidenbroadcast domains are not isolatednhas no effect on mac or network addresses39segmented baseband with repeaters40repeaters can do media conversionclientclientclientclientprinterrepeater
23、thickthinnetservernodenodenode10 baset hubethernet star41hubsnhub is a multiport repeaternshared medium hubncentral hubnhub retransmits incoming signal to all outgoing linesnonly one station can transmit at a timenwith a 10mbps lan, total capacity is 10mbps42stackable(可堆叠) hubsna stackable hub consi
24、sts of modules stacked on top of another and connected by short cables.nstackable hubs have flexible port densities due to the scalable nature of stacking modules.nstackable hubs can be 12 or 24 ports each, and typically stack up to 128 total ports or more. management consolestackable hub43bridgesna
25、 bridge is a device which has two or more ports which can be connected to a variety of media types, and provides a mechanism for the filtering and forwarding of data frames among the ports while building one large logical network.noperates at the data link layernselectively forwards framesnerror fra
26、mes will not be forwardedncollision domains are isolatednbroadcast domains are not isolatednhas no effect on mac or network addresses44bridge operationa bridge is a simple device which simply recognizes the mac addresses on two lans and retransmits packets from one lan destined for devices on the ot
27、her. the lans usually need to have the same mac format.45less collisions with a bridge46connection of two lans using a bridgenieee 802.1dnmac level lstation address is at this levelnbridge does not need llc layerlit is relaying mac frames nevery data frame sent on a lan has two addresses associated
28、with it: source address, which identifies which computer sent the frame; and destination address, which computer the frame is addressed to. nthe source address can be compared to the return address on a letter, and the destination address can be compared to the destination address of a letter.47swit
29、ches & switched hubsn交换机(switch)源自于多端口网桥(bridge),工作在第二层,采用存储-转发方式在各端口之间进行数据帧的交换n交换机检测每个到达数据的帧头n根据数据帧的目的mac地址查找输出端口n如果地址查找表中没有该表项,交换机就向所有端口(除接收端口)转发n地址查找表是通过帧的源mac地址与到达端口的对应关系建立的48capacity with switched hub10 mbps10 mbps10 mbps10 mbpsdcbatotal capacity n 10 mbps4950routersnoperate at the network
30、layernselectively forwards packetsnerror frames will not be forwardedncollision domains are isolatednbroadcast domains are isolatednprotocols can be filterednhas an effect on mac addresses but no effect on network addresses51per packet processing in an ip router1. accept packet arriving on an incomi
31、ng link.2. lookup packet destination address in the forwarding table, to identify outgoing port(s).3. manipulate packet header: e.g., decrement ttl, update header checksum.4. send packet to the outgoing port(s).5. buffer packet in the queue.6. transmit packet onto outgoing link.52another view of an
32、ip routercontrol planedatapathper-packet processingswitchingforwardingrouting tablerouting protocols53first generation routersshared backplaneline interfacecpumemoryroutetablecpubuffermemorylineinterfacemaclineinterfacemaclineinterfacemacfixed length “dma” blocksor cells. reassembled on egress linec
33、ardfixed length cells or variable length packetstypically 0.5gb/s aggregate capacity54second generation routersroutetablecpulinecardbuffermemorylinecardmacbuffermemorylinecardmacbuffermemoryfwdingcachefwdingcachefwdingcachemacslow pathdrop policyoutputlinkschedulingbuffermemorytypically 5gb/s aggreg
34、ate capacity55third generation routerslinecardmaclocalbuffermemorycpucardlinecardmaclocalbuffermemoryswitched backplaneline interfacecpumemoryfwdingtableroutingtablefwdingtabletypically 50gb/s aggregate capacity56fourth generation routers/switchesswitch corelinecardsoptical links100sof feet57basic a
35、rchitectural componentsdatapath: per-packet processing2. interconnect3. egressforwardingtableforwardingdecision1. ingressforwardingtableforwardingdecisionforwardingtableforwardingdecision58forwarding engineheaderpayloadpacketrouterdestination addressoutgoing portdest-networkportforwarding tablerouti
36、ng lookup data structure/8/16/1931759qos support architectural componentsoutputschedulingcontrol planedatapath”per-packet processingswitchingforwardingtableadmissioncontrolrouting tablerouting protocolspolicing& accesscontrolpacketclassificationingressegressinterconnec
37、t0qos support architectural componentsdatapath: per-packet processing2. interconnect3. egressforwardingtableclassifiertablepolicing &accesscontrolforwardingdecision1. ingressforwardingtableclassifiertablepolicing &accesscontrolforwardingdecisionforwardingtableclassifiertablepolicing &
38、amp;accesscontrolforwardingdecisionlimitation: memory b/w limitation: interconnect b/w power & arbitration limitation: memory b/w 61problems facing router buildersnfast forwarding (route lookup)nflow identificationnfast forwarding pathnqos supportncore routers, enterprise routers, access routers
39、nsimpler is winnernreliability (stability) of high-speed routersndual powernduplicate data pathsnease of configurationnmisconfiguration is another major problemnaccountability62l3 & l4 switchesn几种说法n三层交换机:nip switch、tag switch(mpls)、fast ip“先路由,后交换(route first, then switch)”n集二层交换和三层路由于一体,“switc
40、h where you can, route where you must”n硬件实现路由功能,线速转发n四层交换机:基于tcp/udp端口号进行业务分类(用于支持qos)63gatewayn网关也称协议转换器,它是用于连接不同网络的高层网络互连设备n应用层网关:在应用层连接两个网络,如ip电话网关n传输层网关:在传输层连接两个网络n安全网关,用于安全考虑的协议过滤,包过滤,内容过滤等,也称为防火墙,用于连接内外网络,保护内部网络的安全64防火墙技术n什么是防火墙 防火墙是建立在两个网络的边界上的实现安全策略和网络通信监控的系统或系统组,强制执行对内部网和外部网的访问控制。通过建立一整套规则和
41、策略来监测、限制、更改跨越防火墙的数据流,达到保护内部网络的目的。internetintranetfirewallfirewall65n防火墙的功能n访问控制n授权认证n内容安全:病毒扫描、url扫描、http过滤n加密n路由器安全管理n地址翻译n均衡负载n日志记帐、审计报警66防火墙的技术分类n数据包过滤型防火墙 n应用级网关型防火墙 n代理服务型防火墙 n复合型防火墙 67数据包过滤型防火墙n数据包过滤(packet filtering)技术是在网络层对数据包进行选择,选择的依据是系统内设置的过滤逻辑,被称为访问控制表(access control table)。通过检查数据流中每个数据包
42、的源地址、目的地址、所用的端口号、协议状态等因素,或它们的组合来确定是否允许该数据包通过。工作在网络层和传输层 。 68包过滤防火墙包过滤:根据规则有选择地让数据包在网络内外进行交换可以在一台机器上提供对整个网络的保护不识别数据包中的用户信息和文件信息数据包头部信息ip源地址和目标地址协议(tcp、udp或icmp包)tcp/udp源和目标接口icmp信息类型数据包要到达的端口和要出去的端口69包过滤防火墙几种包过滤系统用过滤路由器进行包过滤用双宿主主机进行包过滤用堡垒主机进行包过滤70nip过滤路由器n双宿主主机防火墙internet内部网外部网防火墙internetr内部网外部网路由器71包过滤的优点:一个包过滤路由器即可保护整个网络不需要用户软件支撑,不需要对用户作特别培训包过滤产品比较容易获得包过滤的缺点:包过滤规则配置比较困难对包过滤规则配置的测试比较麻烦包过滤功能有种种局限性72应用级网关型防火墙n应用级网关(application level gateways)是在网络应用层上建立协议过滤和转发功能。它针对
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025飞行培训及雇佣意向合同书样本
- 2025精算师考点关于投资连结保险合同形成资产的解析与探究
- 2025房屋租赁合同协议范本2
- 苏州某污水管道工程顶管施工组织设计
- 二手房买卖合同书公证操作流程简述
- 二零二五版劳动合同书管理制7
- 二零二五版租房子合同书模板
- 二零二五版分红协议书合同书屋
- 教师岗位员工劳动合同书二零二五年
- 大学生职业规划大赛《市场营销专业》生涯发展展示
- 2025-2030年中国小麦加工产业运行动态及发展可行性分析报告
- 乾坤未定皆有可能-2025届高三百日誓师班会课件
- 台达DELTA变频器VFD-EL系列使用说明书和手册(完整中文版)VFD007EL23A
- 2025年山西汾西矿业集团公司招聘笔试参考题库含答案解析
- 2024年度英语课件容貌焦虑
- 神经外科质量与安全管理工作计划
- 城市违建拆除施工方案
- 复色激光光谱分析研究
- 农药代销协议书模板
- 《电力中长期交易合同示范文本(2022年修订版)》
- 小学班会 世界知识产权日知识产权宣传周主题班会 课件
评论
0/150
提交评论