版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、1,Bilingual CourseNetwork Communications网络通信(For Master Students in the Department of Electronic Engineering)Chapter 17 Transport Protocols,Instructor: Dr. Tianshuang Qiu School of the Electronic and Information Engineering Fall of 2009,2,OSI与TCP/IP协议的关系,3,Introduction,The transport protocol provide
2、s an end-to-end data transfer service that shields upper layer protocols from the details of the intervening(中介)network or networks. A transport protocol can be either connection oriented, such as TCP (Transmission control protocol), or connectionless, such as UDP (User datagram protocol). If the un
3、derlying(下层)network or internetwork service is unreliable, such as with the use of IP, then a connection-oriented transport protocol becomes quite complex. The basic cause of this complexity is the need to deal with the relatively large and variable delays experienced between end systems. These larg
4、e, variable delays complicate(使复杂)the flow control and error control techniques. TCP uses a credit-based(基于信用量)flow and error control technique that is somewhat different from the sliding-window flow control found in X.25 and HDLC. In essence, TCP separates acknowledgements from the management of th
5、e size of the sliding window. Although the TCP credit-based mechanism was designed for end-to-end flow control, it is also used to assist in internetwork congestion control. When a TCP entity detects the presence of congestion in the internet, it reduces the flow of data onto the internet until it d
6、etects an easing(缓解)in congestion.,4,传输层协议与其它协议的关系,In a protocol architecture, the transport protocol sits above a network or internetwork layer,which provides network related services, and just below application and other upper-level protocols. The transport protocol provides services to transport
7、service (TS) users, such as FTP (File Transfer Protocol ), SMTP (Simple Mail Transfer Protocol ), and TELNET. The local transport entity communicates with some remote transport entity, using the services of some lower layer, such as the internet protocol. The general service provided by a transport
8、protocol is the end-to-end transport of data in a way that shields the TS user from the details of the underlying communications systems. We find that most of the complexity relates to connection-oriented services. As might be expected, the less the network service provides, the more the transport p
9、rotocols: transmission control protocol (TCP) and UDP.,5,传输层协议与其它协议的关系,6,17-1 面向连接的传输协议机制,两种基本类型的服务 面向连接的 对应于虚电路方式。 面向连接的服务提供了TS用户之间(端到端)的一条逻辑连接的建立、维护以及终止操作。 是最常见的有效协议服务类型,有广泛的应用。 面向连接暗示了这种服务是可靠的。 面向非连接的 对应于数据报方式。,7,1. 可靠的顺序网络服务,假设 网络服务可以接受任意长度的报文; 以100%的可靠性按顺序交付到目的地。 这样的网络包括 具有X.25接口的高可靠分组交换网络; 使用L
10、APF(Link Access Procedure for Frame Mode Bearer Services)控制协议的帧中继网络; 使用面向连接的LLC服务的IEEE 802.3局域网。 对于可靠的顺序网络服务,需要讨论 寻址(Addressing) 复用(Multiplexing) 流控制(Flow control) 连接的建立/终止(Connection establishment/termination),8,寻址,概念 某个给定的传输实体的用户希望与另一个传输实体的用户建立一条连接,或者进行无连接的数据传送。 需要为目标用户指定 用户的标识(User identification
11、); 传输实体的标识(Transport entity identification); 主机地址(Host address); 网络编号(Network number) 返回,9,进一步说明,传输层协议必须能够从TS用户地址中推算出上面所列的所有信息。 典型情况下,用户地址定义为(主机,端口)。 通常,一个主机只有一个传输实体,这样就不需要传输实体的标识。 地址中应当包含传输协议类型标记(如TCP或UDP)。 在单一网络的情况下,“主机”标识的是连接到网络上的一个设备。 在互联网情况下,“主机”是一个全局互联网地址。 在TCP中,端口和主机的结合称为套接字(socket). 传输层不涉及路由
12、选择,仅仅将地址的“主机”部分向下交付给网络服务。 “端口”包含在传输层首部中,由目的站的目的传输协议来使用。,10,套接字的概念,“套接字”或者“插座”(Socket)也是一种软件形式的抽象,用于表达两台机器间一个连接的“终端”。针对一个特定的连接,每台机器上都有一个“套接字”,可以想象它们之间有一条虚拟的“线缆”。线缆的每一端都插入一个“套接字”或者“插座”里。当然,机器之间的物理性硬件以及电缆连接都是完全未知的。 套接字是通信的基石,是支持TCP/IP协议的网络通信的基本操作单元。可以将套接字看作不同主机间的进程进行双向通信的端点,它构成了单个主机内及整个网络间的编程界面。套接字存在于通
13、信域中,通信域是为了处理一般的线程通过套接字通信而引进的一种抽象概念。套接字通常和同一个域中的套接字交换数据(数据交换也可能穿越域的界限,但这时一定要执行某种解释程序)。各种进程使用这个相同的域互相之间用Internet协议簇来进行通信。,11,复用,两种复用 传输协议复用 多个用户使用相同的传输协议; 通过端口号或服务访问点相互区分。 传输实体复用 上行复用(upward multiplexing),将单个低层的多个连接复用。(Multiplexing of multiple connections on a single lower-level connection) 下行复用(downw
14、ard multiplexing),将单个连接划分成多个低层连接 返回,12,流控制,传输层流量控制比较复杂,其原因 与实际传输时间相比,传输实体之间的传输时延比较长; 传输层是一个在网络和互联网之上操作的,因此传输时延可能是高度可变的,从而使得为丢失数据而重传时所使用的超时机制难以做到高效率。 四种流控方法(对于接收方) 什么也不做; 拒绝接受来自网络服务的后续报文段; 使用固定的滑动窗协议; 使用信用量机制(credit scheme) 返回,13,什么也不做,问题 溢出的报文将被丢弃; 发送端由于没有收到确认,会重新发送这些报文; 这样,发送方将不得不增加输出流量; 返回,14,反压(b
15、ackpressure)机制,反压机制,即第二种选择 依赖于网络服务; 当缓存溢出时,拒绝接收来自网络的更多的服务,会触发网络内部的流控过程,从而抑制发送端的网络服务; 拒绝更多的报文段。 返回,15,第三种选择(滑动窗),在数据单元上使用序号; 使用固定大小的窗口; 通过确认使窗口向前滑动 返回,16,第四种选择(信用量机制),信用量机制 向接收方提供了更高级程度的数据流控制; 可以产生较平稳的数据流。 返回,17,信用量分配机制举例,18,信用量分配机制说明,Assume that 200 octets of data are sent in each segment. Initially
16、, through the connection establishment process, the sending and receiving sequence numbers are synchronized establishment process, the sending and receiving sequence numbers are synchronized and A is granted an initial credit allocation of 1400 octets, beginning with octet number 1001. After sending
17、 600 octets in three segments, A has shrunk its window to a size of 800 octets (numbers 1601 through 2400). Following receipt of these segments, B acknowledges receipt of all octets through 1601 and issues a credit of 1000 octets. This means that A can send octets 1601 through 2600 (5 segments). How
18、ever, by the time that Bs message has arrived at A, A has already sent two segments, containing octets 1601 through 2000 (which was permissible under the initial allocation). Thus, As remaining credit at this point is only 400 octets (2 segments). As the exchange proceeds, A advances the trailing ed
19、ge of its window each time that it transmits and advances the leading edge only when it is granted credit.,19,Sending and Receiving Perspectives,20,17-2 TCP,概念 TCP is designed to provide reliable communication between pairs of processes (TCP users) across a variety of reliable and unreliable network
20、s and internets. TCP provides two useful facilities for labeling data: push(急迫)and urgent(紧急): Data stream push: ordinarily, TCP decides when sufficient data have accumulated to form a segment for transmission. The TCP user can require TCP to transmit all outstanding data up to and including that la
21、beled with a push flag. On the receiving end, TCP will deliver these data to the user in the same manner. A user might request this if it has come to a logical break in the data. Urgent data signaling: This provides a mean of informing the destination TCP user that signification or “urgent” data is
22、in the upcoming data stream. It is up to the destination user to determine appropriate action.,21,TCP服务的原语与参数(Read by yourself),TCP服务请求原语(表17.2) 是TCP用户向TCP发出的,例: Active Open-Request connection at a particular security and precedence(优先)to a specified destination Send-Transfer data across named conne
23、ction TCP服务响应原语(表17.3) 是TCP向本地TCP用户发出的,例: Deliver-Reports arrival of data Open success-Reports completion of pending(挂起的)open request TCP服务参数(表17.4) Source Port-Local TCP user; Data-Block of data sent by TCP user or delivered to a TCP user.,22,TCP首部格式( Read by yourself ),23,TCP首部说明( Read by yourself
24、 ),Source port (16 bits): 源TCP用户; Destination port (16 bits): 目的TCP用户; Sequence number(32 bits): 报文段中第一个八位组的序号; Acknowledgement number(32 bits):捎带确认,包含了TCP实体希望接收的下一个数据八位组的序号; Data offset(4 bits): 首部中32位字的数量; Reserved(6 bits): 为将来使用保留; Flag(6 bits): URG-紧急指针;ACK-确认;PSH-急迫;RST-复位; SYN-序号同步;FIN-发送者没有其他
25、数据了; Window(16 bits): 控制流的信用分配; Checksum(16 bits): 校验 Urgent pointer(16 bits): 指向紧急数据的最后一个八位组; Options(Options): 指出能够接受的最大报文长度。,24,TCP机制,连接建立(三次握手) 发送方实体发送一个SYN,使SN=X (Sequence number) ,X为初始序号; 接收将SYN和ACK置位,以SN=Y,AN=X+1( Acknowledgement number )来响应; 初始方用AN=Y来响应 数据传送 按八位组编号,以232为模; 流控制采用信用量分配机制; 数据有缓
26、存,PUSH强迫传输方把积累的数据都发出去; 可以用紧急指针指出数据的末端; 若有不属于本次传输的报文段出现,则将报文中的RST置位。 连接终止 每个TCP用户发CLOSE原语,在最后一个报文段将FIN置位; 若发出ABORT原语,则发生粗暴终止。,25,TCP实现中的策略选择(P.663, Read by yourself ),发送策略(Send policy) 交付策略(Deliver policy) 接受策略(Accept policy) 按顺序(In-order) 按窗口(In-window) 重传策略(Retransmit policy) 仅重传第一个(First-only) 批量重
27、传(Batch) 单个重传(Individual) 确认策略(Acknowledge policy),26,17-3 TCP拥塞控制,目的 基于信用量控制机制的目的是使目的站能够限制来自源站的报文流,以避免目的站的缓存溢出; 重传计时器管理(超时后重传,动态调整) 简单平均 对观察到的一些报文段的往返时间简单地取平均 其中:RTT(i)=第i个报文段的往返时间;ARTT(K)=前K个报文的平均往返时间,27,指数平均,给越近的采样值以更大的权。 其中 SRTT(K+1)=平滑往返时间估值,SRTT(0)=0; Alpha值越小,给予近期观察值的权越大,28,指数平均的使用,29,RTT方差估计
28、( Read by yourself ),RTT方差估计 TCP标准中规定的方法,可以使TCP实体能够适应往返时间的变化,但是不能很好地处理较高方差的情况。 高方差的三个来源 若TCP连接的数据率较低,则传输时间传播时间,由于IP数据报大小变化所引起的时延方差会很可观; 互联网通信量负荷及状况可能会随来自其他源站的通信量的变化而变化,从而造成RTT的突然变化。 对等TCP实体可能会因其自身的处理延时而并不对每个报文段都立即发出确认,或者因为它利用了累积确认的特权。 平均估计 MDEV(X)=E|X-E(X)| 其中:EX是X的期望值。,30,Jacobson算法( Read by yourse
29、lf ),其中:g=1/8=0.125; H=1/4=0.25; f=2 or 4,31,Jacobson算法计算RTO,32,17-4 UDP,概念 In addition to TCP, there is one other transport-level protocol that is in common use as part of the TCP/IP protocol suite: the user datagram protocol (UDP). UDP provides a connectionless service for application level procedures. Thus, UDP is basically an unreliable service; delivery and duplicate protection are not guaranteed. Howev
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年山东省济南市天桥区中考物理三模试卷(含答案)
- 部编版初中七年级道德与法治《青春飞扬》教案
- 八年级物理上册《5.2 学习使用天平和量筒》导学案
- 初中八年级道德与法治(下册)核心知识清单:依宪治国
- 初中八年级道德与法治《交友的智慧-同学·朋友》教案
- 初中八年级道德与法治㈥.2议题式导学案:维权履责·终身学习-权利的行动者与责任的担当者
- 八年级英语上册Unit8第2课时SectionA(2d3c)高效课堂教案
- 初三英语中考冲刺:语法选择解题技巧与核心考点融合导学案
- 2026年医疗卫生单位考试题库(含答案)
- 基坑上下通道安全技术交底
- 埃博拉病毒病诊疗方案(2026年版)解读课件
- 浙江省宁波市海曙区2025年七年级下学期期末数学试题及答案
- 导医知识培训课件
- DB32-T 5081-2025 建筑防水工程技术规程
- 2025届贵州省遵义市新蒲新区中考生物仿真试卷含解析
- 期末考试复习演讲稿
- 公共关系与人际交往能力知到智慧树章节测试答案2024年秋同济大学
- 安全保证体系及管理措施
- 《对虾的内部结构》课件
- 儿科学课件急性上呼吸道感染
- 2023-2024学年江苏省苏州市高二下学期6月期末物理试题(解析版)
评论
0/150
提交评论