网络协议工程 第2章-协议设计(1-协议模型)课件

上传人:我*** 文档编号:139144011 上传时间:2020-07-20 格式:PPT 页数:34 大小:1.62MB
返回 下载 相关 举报
网络协议工程 第2章-协议设计(1-协议模型)课件_第1页
第1页 / 共34页
网络协议工程 第2章-协议设计(1-协议模型)课件_第2页
第2页 / 共34页
网络协议工程 第2章-协议设计(1-协议模型)课件_第3页
第3页 / 共34页
网络协议工程 第2章-协议设计(1-协议模型)课件_第4页
第4页 / 共34页
网络协议工程 第2章-协议设计(1-协议模型)课件_第5页
第5页 / 共34页
点击查看更多>>
资源描述

《网络协议工程 第2章-协议设计(1-协议模型)课件》由会员分享,可在线阅读,更多相关《网络协议工程 第2章-协议设计(1-协议模型)课件(34页珍藏版)》请在金锄头文库上搜索。

1、第 2 章 协议设计(1-协议模型),2,内容提要,协议设计概述,1,协议模型,2,3,协议设计概述,协议设计的含义? 协议设计是是一件很困难的事情 Example: Clayton Tunnel Protocol Example: 蓝军与白军作战问题,4,协议例子,England, 1841, William Cooke Telegraph(电报) instead of Optical telegraph for Railway Tunnel Protection, 节省成本(只需1/10)和提高速度。 Purpose: avoid that more than one train is i

2、n the tunnel at the same time Firstly used on several lines of the Great Western Railways in England.,5,电报(Telegraph),基本原理,1753,C.M给Scots杂志的信中描述了一个使用一些平行电线来通信的电子电报。 1830,英国Michael Faraday和美国Joseph Henry发现了电磁感应 1837,William Cooke利用电流来使处在接收端磁场中的罗盘指针发生偏转,从而得到信号。 1837年6月12日,第一个电报系统的专利,“五磁针信号系统”。 1842年,C

3、ooke“火车可以无所畏惧地行驶,而无论其时间是否正确,也不管其是否在正确的轨道上,因为在使用该系统后,其速率总可以及时地降下来,从而避免碰撞”,6,协议例子,England, 1841, William Cooke Telegraph(电报) instead of Optical telegraph for Railway Tunnel Protection, 节省成本(只需1/10)和提高速度。 Purpose: avoid that more than one train is in the tunnel at the same time Firstly used on several

4、lines of the Great Western Railways in England.,7,协议例子,semaphores with block-interval system(空闲/阻塞信号系统),turn to red automatically as a train passes,set to green by hand afterwards,signalmen on both ends linked by telegraphic line,malfunction of block-interval system signalled by a bell,red and white

5、 flags to replace malfunctioning semaphore,8,协议例子:报文(Messages),Message: TT: Train in Tunnel TF: Tunnel is Free TL: Has the Train left the Tunnel?,9,协议例子:差错控制,Error Free Functioning train enters tunnel, signalman A sends TT to B train leaves the tunnel, B sends TF to A A sets semaphore to green by ha

6、nd Under Error Situation train enters tunnel, A sends TT to B bell rings, A shows red flag to next train train leaves the tunnel, B sends TF to A A shows white flag to next train,10,协议例子:事故(Accident),One day in August 1861 at Clayton Tunnel. train-1 enters tunnel, block-interval system fails(fails t

7、o set the signal to red), so the bell warns signalman A, then A sends TT to B, then fetches the red flag to warn the next train. train-2 comes too fast, and could not stop in time, has already passed the green signal. Fortunately, its driver catches a glimpse of the red flag just in time as he enter

8、s the tunnel. train-3 sees the red flag and stops before the tunnel entrance.,11,协议例子:事故(Accident),A sends another TT to B (for train-2) B does not understand second TT(because the protocol did not account for this event so the meaning of two sbusequent TT had not been specified.) A sends TL (has th

9、e train left the tunnel?)to B B sees train-1 and sends TF,12,协议例子:事故(Accident),A thinks train-2 left the tunnel and shows white flag to train-3 train-2 had seen red flag before, is afraid and tries to return to position A After some deliberation.,13,协议例子:事故(Accident),Result train-3 and train-2 crash

10、ed: 21 people died and 176 got injured The set of instructions given to the signalmen was incomplete, which leads to the accident,14,协议例子:Lessons,A historian of railway disasters(Nock, 1967 ): “One can almost hear the same comment being made time after time.I could not imagine that could ever happen

11、. Yet bitter experience showed that it could, and gradually the regulations and railway engineering practice were elaborated.” Protocol: Use Under normal circumstances and that allowed for a safe recovery from unexpected events.,15,协议例子:Lessons (Cont.),even the most simple protocols may contain erro

12、rs protocols must be fully verified before they are put in operation techniques to structure, design, analyse and verify protocols are necessary,16,一个简单的网络协议(蓝军与白军),谢希仁教授计算机网络上的一道作业题: 占据两个山顶的蓝军与驻扎在这两个山之间的山谷的白军作战。其力量对比是:一个山顶上的蓝军打不过白军,但两个山顶的蓝军协同作战则可战胜白军。一个山顶上的蓝军拟于次日正午向白军发起攻击。于是发送电文给另一山顶上的友军。但通信线路很不好,电

13、文出错或丢失的可能性较大。因此要求收到电文的友军必须送回一个确认电文。但此确认电文也可能出错或丢失。 试问能否设计出一种协议使得蓝军能够实现协同作战因而一定(即100 %)取得胜利?,17,如果情况如上所述,次日蓝军 1 和蓝军 2 的协同进攻必定获胜。,但情况并非如此简单。因为所发的报文可能会丢失。,丢失!,白军,蓝军 1,蓝军 2,因此蓝军 1 必须在收到蓝军 2 的确认后才能进攻,18,因此,收到报文后必须加以确认,但这个确认报文也可能丢失:,丢失!,白军,蓝军 1,蓝军 2,故蓝军 2 必须要收到蓝军 1 发出的对此“确认”的确认, 才能知道发送出的确认是否被蓝军 1 正确收到。,19

14、,因此蓝军 1 收到确认报文后应发送对此确认的确认。,蓝军 1 无法知道最后发送的这个确认是否被蓝军 2 收到, 仍需收到蓝军 2 发来的确认才行!,白军,蓝军 1,蓝军 2,20,白军,蓝军 1,蓝军 2,协议必须能够应付所有的(而不是部分的)不利情况 像这样简单的问题居然无法设计出一种协议来解决。,21,内容提要,协议设计概述,1,协议模型,2,22,协议模型,分层设计,n 层协议模型,(n+1) 实体,(n) 实体,(n+1) 实体,(n) 实体,(n) 协议,提供(n-1)服务,提供(n)服务,(n) 服务用户,(n) 服务提供者,通过(n-1)连接进行通信,(n + 1) 层,(n

15、- 1) 层,(n) 层,nSAP,(n-1)SAP,nSAP,(n-1)SAP,(n-1)SPs,(n-1)SPs,(n)SPs,(n)SPs,(n)PDUs,在OSI中,实体(entity)表示任何可以发送和接收信息的硬件或软件进程。在许多情况下,实体就是一个特定的模块。,两个(n)实体在(n)协议的控制下的通信,使(n)层能够向上一层(n+1)提供服务。这种服务就是(n)服务。,接受(n)服务的是上一层实体,即(n+1)实体。它们也称为(n)用户或更严格些是(n)服务用户。,23,协议模型,分层设计,n 层协议模型,(n+1) 实体,(n) 实体,(n+1) 实体,(n) 实体,(n)

16、协议,提供(n-1)服务,提供(n)服务,(n) 服务用户,(n) 服务提供者,通过(n-1)连接进行通信,(n + 1) 层,(n - 1) 层,(n) 层,nSAP,(n-1)SAP,nSAP,(n-1)SAP,(n-1)SPs,(n-1)SPs,(n)SPs,(n)SPs,(n)PDUs,一个(n)实体向上一层所提供的服务由以下三部分构成: (n)实体自己提供的某些功能。 从(n-1)层及其以下各层以及本地系统环境得到的服务。 通过与处在另一系统中的对等(n)实体的通信而得到的服务。,将(n)层对等实体之间,为实现该层协议所交换的信息单元称为协议数据单元PDU(Protocol Data Unit)。通常将第n层的协议数据单元记为(n)PDU。,24,PDUs,PDU通常由2部分构成:用户数据和协议控制信息PCI(Protocol Control Information)。 PC

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > PPT模板库 > PPT素材/模板

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号