收藏 分销(赏)

数据通讯与计算机网络讲义 23章.ppt

上传人:pc****0 文档编号:13233538 上传时间:2026-02-07 格式:PPT 页数:51 大小:2.60MB 下载积分:10 金币
下载 相关 举报
数据通讯与计算机网络讲义 23章.ppt_第1页
第1页 / 共51页
数据通讯与计算机网络讲义 23章.ppt_第2页
第2页 / 共51页


点击查看更多>>
资源描述
第,23,章,-,*,Chapter 23,进程到进程的交付:,UDP,TCP,和,SCTP,(Process-To-Process Delivery),1,2,3.1,Process-To-Process Delivery,数据交付的不同类型,2,在运输层,以端口号,(Port numbers),标识进程。,Client/Server,进程的寻址,3,IP,地址,vs.,端口号,4,IANA,规定的端口号范围,Socket addresses,(套接字地址),因特网运输层协议的端口号字段为,16,比特。,(,32,比特)(,16,比特),5,Multiplexing and Demultiplexing,(运输层的复用与解复用),Connectionless&Connection-Oriented Service,面向连接(,TCP,,,SCTP,),无连接(,UDP,),运输层实体可同时管理(复用,/,解复用)多个套接字。,运输层,网络层,应用层,6,Reliable vs.Unreliable,E,rror control is needed at the transport layer,for some applications.,7,UDP,TCP,and SCTP in TCP/IP suite,8,UDP-connectionless,unreliable.,2,3.2,User Datagram Protocol(UDP),不建立连接;无序号,无确认,无重发。,UDP,数据报格式,9,Pseudoheader,for checksum,Checksum,10,例,23.2,Checksum calculation of UDP,11,Well-Known Ports for UDP,TCP also,12,Connectionless services,不建立连接,无序号,无关联,Flow and error control,无流控,(,无滑窗,),;仅差检,无重发,Encapsulation and,decapsulation,in IP packet,Queues in UDP,一个,“,port,”,对应一对,“,入出队列,”,。,UDP operation,13,TCP-connection-oriented,reliable.,2,3.3 TC,P,Stream delivery,建立连接;有序号,有窗口(流控);有确认,有重发(差控)。,14,Well-known ports in TCP,UDP also,UDP also,15,TCP,的发送,buffers,和接收,buffers,16,TCP,报文段(,segments,),17,TCP,的更多说明,Sequence number,报文段首部序号字段的值是该报文段中数据载荷部分的,第一个数据字节的序号,。,18,Acknowledgment number,报文段首部中,“,acknowledgment No.,”,字段的值为期望接收的,“,next byte No.,”,。,(,已正确收到的,“,last byte No.+1,”,),“,acknowledgment No.,”,具有累计作用。,Flow control,由收方决定发方发送量并通知发方,Error control,检错、确认、重发机制,Congestion control,由发方根据网络状况决定发送量,19,TCP segment format,20,Connection establishment (three-way handshaking),TCP Connection,SYN,Seq,=8000,SYN+ACK,Seq,=15000,ACK=8001,ACK,Seq,=8000,ACK=15001,21,A SYN segment cannot carry data,but it consumes,one,sequence number.,A SYN+ACK segment cannot carry data,but it consumes,one,sequence number.,An ACK segment,if carrying no data,consumes,no,sequence number.,Simultaneous Open,SYN,SYN,ACK,ACK,t,SYN flooding attack,22,Data transfer,L,ast byte No.+1,23,Connection termination(three-way handshaking),(,无,data),(,可有最后,data),(,可有最后,data),The FIN segment consumes,one,sequence number if it does not carry data.,The FIN+ACK segment consumes,one,sequence number if it does not carry data.,.,24,Connection termination(,Half-close,),若有,data,则,seq,=y,25,Flow control (,Sliding window,),TCP sliding windows are:,byte-oriented,Variable size,26,如果接收方主机,B,的,TCP,缓冲区为,5000 bytes,,且已收到,1000 bytes,的数据尚未交付,则发送方主机,A,的该,TCP,连接的,rwnd,数值将为多少,?,例,23.4,rwnd,=50001000=4000,,即主机,B,还能接收,4000 bytes,的数据,主机,B,将在它给主机,A,的下一个报文段首部的,rwnd,字段中告知该值。,解:,主机,A,的,TCP,连接的,rwnd,3000 bytes,,,cwnd,3500 bytes,,该发送方主机,A,的窗口为多大,?,例,23.5,发送方窗口,min,rwnd,cwnd,3000,3500=3000 bytes,,即 发送方窗口,=3000 bytes,。,解:,27,例,23.6,采用,TCP,协议的主机,A,当前的,cwnd,=20,。已发送完,seq.=202,的字节,又收到了对方的报文段,首部中的,“,ACK No.=200,r,wnd,=9,”,。画出主机,A,当前的发送窗口。,解:,28,TCP,发送方滑窗说明,窗口大小,min,rwnd,cwnd,发送方一般要等待发送缓冲区积累了足够的数据量后再构造报文段以发送(如,达到,MTU,或达到缓冲区一半)。,发送窗口可由接收方关闭,(,rwnd,=0),或重新打开。但发送窗口右界不可以被左移(,no shrinking,)。,发送方在收到,rwnd,=0,的报文段后,需定时发送含,1,字节数据的报文段,(,零窗口情况下的询问报文,),。,接收方发送,ACK,的机制(本,PPT,的,P.34,),29,数据报文段、,“SYN”,报文段、,“FIN”,报文段须确认;,纯“,ACK”,报文段不需确认。,重发的条件(事件):,重发定时器超时(重发首个或,N,个报文段);,或连续收到,3,个重复,ACK,(,duplicate ACK,)。,对纯,ACK,,不启动“重发,timer”,差错控制,校验和,(,发现出错,丢弃,),确认(,ACK,),重发,收到错序的报文段,存放到接收缓冲区;回送所期望字节号的,ACK,。,30,Normal operation,Se,q,=1400,Se,q,=1400,作业:,P.484,图,客户端的初始,seq,1000,,,ACK,3001,,双方均发送数据报文段,各报文段中数据长度均为,2000,字节。按该图时序填写出图中,6,个报文段中的参数,(,seq,ACK),。,31,Lost segment,Se,q,=x-1,Se,q,=x-1,Se,q,=x-1,32,Fast retransmission,(,three duplicate ACK,),33,TCP,协议中产生,ACK,的机制,RFC 1122,RFC 2581,接收方的事件,携带所期望序号的有序报文段到达,且该序号之前的所有报文段已作确认。,携带所期望序号的有序报文段到达,但之前尚有,1,个报文段未作确认。,携带大于所期望序号的错序报文段达到,(,检测到,“,间断,”,),。,部分填补或全部填补间断的报文段到达。,接收方的操作,延迟,ACK,:等待,500ms,。如果,500ms,时下一个报文段未到达,则发送,ACK,。,立即发送一个累积,ACK,确认两个有序的报文段。,立即发送重复的,ACK,指明期望接收的字节序号。,立即发送,ACK,指明剩余间断的下界字节序号。,34,S,tream,C,ontrol,T,ransmission,P,rotocol(SCTP)is a new reliable,message-oriented,transport layer protocol.,SCTP is mostly designed for Internet applications that have recently been introduced,(实时,流),.,SCTP Services and,Features,Packet Format,SCTP Association,Flow Control and Error Control,2,3.4 SCT,P,35,SCTP is a message-oriented,reliable protocol that combines the best features of UDP and TCP.,Some SCTP applications,SCTP Services and,Features,36,Multi-stream concept,An association in SCTP can involve multiple streams.,多流中某个流因丢失被阻塞时,其余的流仍可交付(在,L4,层)。,37,Multi-homing concept,SCTP association allows multiple IP addresses for each end.,示例:有,4,对,Socket,的一个关联(,1,个主路径,,3,个替换路径)。,38,In SCTP,a data chunk is numbered using a,TSN,.,(,T,ransmission,S,eq,.,N,o.),To distinguish between different streams,SCTP uses an,SI,(,S,tream,I,dentifier).,To label different data chunks in the same stream,SCTP uses,SSN,(,S,tream,S,eq.,N,o.),39,Comparison between a TCP segment and an SCTP packet,40,In SCTP,control information and data information are carried in separate chunks.,Data chunks are identified by three items:TSN,SI,and SSN.,TSN is a cumulative number relating with the association;SI defines the different streams in the,assocation,;SSN defines the chunk in a stream.,41,SCTP Packet Format,In an SCTP packet,control chunks are before data chunks.,42,Chunks,43,A connection in SCTP is called an association.,No other chunk is allowed in a packet carrying an INIT or INIT ACK chunk.,A COOKIE ECHO or a COOKIE ACK chunk can carry data chunks.,SCTP Association,四次握手,44,关联的终止,45,数据传输示例,46,The acknowledgment in SCTP defines the cumulative TSN,i.e.,the TSN of the last data chunk received in order.,In SCTP,only DATA chunks consume,TSNs,.,In SCTP,“acknowledgment,No.”are,used to acknowledge only data chunks;,control chunks are acknowledged by other control chunks if necessary.,47,流量控制(窗口),接收方,发送方,48,流控示例,49,接收方,差错控制,(失序、重复处理;重发机制),ACk:23;rwnd:1000;dup:22,31;out_order:35,811,SACK,50,发送方,定时器到时,,21,、,22,被移到重传队列。,51,
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服