tcpipchapter9userdatagramprotocoludp

上传人:M****1 文档编号:571317161 上传时间:2024-08-10 格式:PPT 页数:27 大小:373KB
返回 下载 相关 举报
tcpipchapter9userdatagramprotocoludp_第1页
第1页 / 共27页
tcpipchapter9userdatagramprotocoludp_第2页
第2页 / 共27页
tcpipchapter9userdatagramprotocoludp_第3页
第3页 / 共27页
tcpipchapter9userdatagramprotocoludp_第4页
第4页 / 共27页
tcpipchapter9userdatagramprotocoludp_第5页
第5页 / 共27页
点击查看更多>>
资源描述

《tcpipchapter9userdatagramprotocoludp》由会员分享,可在线阅读,更多相关《tcpipchapter9userdatagramprotocoludp(27页珍藏版)》请在金锄头文库上搜索。

1、Transport Layer ProtocollTransport Layer protocol: To serve as the intermediary between the application programs and the network operationslResponsibilities l lTo create a To create a process-to-process communicationprocess-to-process communicationl lTo provide a To provide a control mechanismcontro

2、l mechanism at the transport at the transport layerlayerl lflow control & error controlflow control & error controll lTo provide a To provide a connection mechanismconnection mechanism for the for the processesprocessesl lData streamData streaml l2 Protocols for transport layer2 Protocols for transp

3、ort layerl lTransmission Control ProtocolTransmission Control Protocol,TCPTCPl lUser Datagram ProtocolUser Datagram Protocol,UDPUDP功靠履溺思源甫理花歉芳洪守撕氢啼辟巳蛇炳阑裤偿俺屈投仲迄熊鼠谈丁tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20241 1TCP/IP Protocol SuiteTCP/IP Prot

4、ocol SuiteChapter 9 UDPlProcess-to-process communicationlUser datagramlChecksumlUDP operationlUse of UDPlUDP package蟹攒货蘑仲集菇茧辞急粗遵押屈兜靖西养郝蹋乎进盲淄绝报座狗骸息荚宴tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20242 2TCP/IP Protocol SuiteTCP/IP Protocol SuiteProce

5、ss-to-Process Comm.InternetInternet进程进程进程进程ProcessProcess进程进程进程进程ProcessProcessDomain of IP protocolDomain of IP protocolDomain of transport protocolsDomain of transport protocolsIPIP地址地址地址地址协议端口(协议端口(协议端口(协议端口(portport)端点(端点(端点(端点(endpointendpoint)浅钝峻钝辟仰栽僳俏速滞问辩娶隘话茨呆优炎蝎妨诬惫栅嫉普豹零期刊弱tcpip-chapter 9 use

6、r datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20243 3TCP/IP Protocol SuiteTCP/IP Protocol SuitePort Numbers212120002000( 21 )( 21 )( 23 )( 23 )( 80 )( 80 )808034503450232364906490IP AddressIP Address撒原污介惨催尹口处懈侦彬莫凡踊灭宽晌鱼歹氦菲凭也币行诞禹应冗廉谊tcpip-chapter 9 user datagram protoc

7、ol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20244 4TCP/IP Protocol SuiteTCP/IP Protocol SuiteProcess-to-Process CommunicationlUDP负责将负责将IP数据报交付给适当的进程数据报交付给适当的进程l lProcessProcess(进程)(进程)(进程)(进程): a running application program: a running application programl lA computer can run A comp

8、uter can run several processesseveral processes at the same time at the same time l lC/S C/S application model application model l lClientClient: a process on the : a process on the local hostlocal host which needs which needs servicesservicesl lSeverSever: a process on the : a process on the remote

9、 hostremote host which which provides the servicesprovides the servicesl lFor For Process-to-Process Communication, must define Process-to-Process Communication, must define the:the:l lLocal host (IP), Local host (IP), local process (Port Number)local process (Port Number)l lRemote host (IP), Remote

10、 host (IP), remote process (Port Number)remote process (Port Number)惫沪锦颓主尊溶汲埂得慢硕灶阮呈芦镀炯彪耶星贫二犯腿廊靶激匹笛货叫tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20245 5TCP/IP Protocol SuiteTCP/IP Protocol SuitePort Numbers VS. C/SlPort number: to define the proce

11、ssesl lEphemeral port numberEphemeral port number(短暂端口号)(短暂端口号)(短暂端口号)(短暂端口号): can be : can be chosen chosen randomlyrandomly by the by the client processclient processl lWell-known port numberWell-known port number(熟知端口号)(熟知端口号)(熟知端口号)(熟知端口号): is : is universaluniversal port number for port number

12、for server processserver process传输协议传输协议传输协议传输协议DataData13135200052000DataData13135200052000传输协议传输协议传输协议传输协议13135200052000ClientClientServerServer多目标多目标多目标多目标并发通信并发通信并发通信并发通信馏偷孩端丁匹镣缠陕尺宝催忱妄衫阴偿匣狐揍蝴湖蘸醛状银羞门唯跌徊蓄tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248

13、/10/20246 6TCP/IP Protocol SuiteTCP/IP Protocol SuiteIP Address & Port Number13135200113193.14.26.75200113193.14.26.7193.14.26.7IP headerIP headerTransportTransportprotocolprotocolheaderheaderPortPortnumbernumber Server Processes Server Processes 21218080监弦岭筒湿橡磺饲搪颤学仍舰卤械皋眉暴蜒旬猾扑纬孝卑寓齿备哺非秸旧tcpip-chapter

14、 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20247 7TCP/IP Protocol SuiteTCP/IP Protocol SuiteIANA RangeslWell-known portslAssigned and controlled by IANAl lRegistered portsRegistered portsl lNot assigned or controlled by IANANot assigned or controlled by IANA

15、l lCan only be registered with IANA to prevent duplicationCan only be registered with IANA to prevent duplicationl lDynamic portsDynamic portsl lNeither controlled nor registeredNeither controlled nor registeredl lCan be used by any processCan be used by any process0 01023102310241024491514915149152

16、491526553565535Well-knownWell-knownRegisteredRegisteredDynamicDynamicPort number援健孔撇坯隋漠檄甘缔疾岂闺柏饺墟铜欺翼伤卿冒志枉楼铬楞翠莆呜讫耀tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20248 8TCP/IP Protocol SuiteTCP/IP Protocol SuiteWell-known Portslhttp:/www.iana.org/assig

17、nments/port-numbersl lThe well-known Ports on most systems The well-known Ports on most systems can only be used by can only be used by system (or root) system (or root) processesprocesses or by or by programs executed by programs executed by privileged usersprivileged usersl lTo the extent possible

18、, some port To the extent possible, some port assignments are both used with the TCP assignments are both used with the TCP and UDPand UDPl lExampleExample:port 53port 53(DNSDNS)殆茁前慌锈藏饲峪豹导个激邦裁播淤夷保矫郊雾冲梢悲穷盘艺映鳃鹃傣界tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/2

19、0248/10/20249 9TCP/IP Protocol SuiteTCP/IP Protocol SuiteSocket (套接字)(套接字)Addressesl(IP address, Port number) Socket AddresslProcess-to-process communication needs 2 Socket Addressesl l客户套接字地址客户套接字地址客户套接字地址客户套接字地址l l服务器套接字地址服务器套接字地址服务器套接字地址服务器套接字地址颠茁岁蔬韭困汐晚梯吧瞒城破疟薛璃渡夜欢啦糯扑呵禽娇篙赌径侵屑合薪tcpip-chapter 9 user

20、 datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20241010TCP/IP Protocol SuiteTCP/IP Protocol SuiteChapter 9 UDPlProcess-to-process communicationlUser datagramlChecksumlUDP operationlUse of UDPlUDP package岳悦禾南诡痈杰动畜蜒译娱驰隋阔咋亢坯枚矿秀缆锚愈擂媚式镰廉惠想超tcpip-chapter 9 user datagram prot

21、ocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20241111TCP/IP Protocol SuiteTCP/IP Protocol SuiteUser DatagramlUser Datagram Protocol,UDPl lRFC 768RFC 768,用户数据报协议,用户数据报协议,用户数据报协议,用户数据报协议IPLANsMANsWANsICMPIGMPARPRARPNetworkLayerNetworkAccess LayerTCPUDPTransportLayer刑涂倔揉勿那匈客絮隙纳谓灭滥滓否吕

22、员秀香跪恕蔽竣契值传耗倘蜒碌说tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20241212TCP/IP Protocol SuiteTCP/IP Protocol SuiteIP IP headerheaderIP IP datadataProtocol = 17Protocol = 17User Datagram FormatUDP HeaderUDP HeaderSource port numberSource port number16

23、bits16 bitsDestination port numberDestination port number16 bits16 bitsTotal lengthTotal length16 bits16 bits(0 06553565535)ChecksumChecksum16 bits16 bitsDataDataThe length of the data can The length of the data can be betweenbe between 0 and 65507 0 and 65507 bytesbytes65507 = 65535 IP headerUDP he

24、ader208IP IP headerheaderIP IP datadata蔬胀实湿揣败顽湖屡歇躯吐吃履液埂吠矫契搅蛤触篡甥恶波雷肉兆楷图桂tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20241313TCP/IP Protocol SuiteTCP/IP Protocol SuiteChapter 9 UDPlProcess-to-process communicationlUser datagramlChecksumlUDP operati

25、onlUse of UDPlUDP package宇舀撤手铭坍坑狐玩艰仍卡衅铝真储杉逻闺冶昨鱼羌析揖预戮昧陵横尉社tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20241414TCP/IP Protocol SuiteTCP/IP Protocol SuiteChecksumlUDP checksuml l与与与与IPIP校验和的校验和的校验和的校验和的计算方法计算方法计算方法计算方法相同相同相同相同l l校验内容不同校验内容不同校验内容不同校验

26、内容不同,包括三个部分:,包括三个部分:,包括三个部分:,包括三个部分:Pseudo header + UDP header +Pseudo header + UDP header + Data Datal lPseudo headerPseudo header(伪首部)(伪首部)(伪首部)(伪首部)l l根据根据根据根据IPIP首部的部分信息形成首部的部分信息形成首部的部分信息形成首部的部分信息形成l l不会与不会与不会与不会与UDPUDP报文一起发送到网络上报文一起发送到网络上报文一起发送到网络上报文一起发送到网络上l l进一步确保进一步确保进一步确保进一步确保UDPUDP报文送到报文送到

27、报文送到报文送到正确主机正确主机正确主机正确主机( (目的目的目的目的IPIP地址正确地址正确地址正确地址正确) )的的的的正确端口正确端口正确端口正确端口上上上上l lChecksum Checksum Optional Optionall l减少高可靠性网络上的传输开销减少高可靠性网络上的传输开销减少高可靠性网络上的传输开销减少高可靠性网络上的传输开销瑶凉旷林蓖渝裔和孕浮副融逸咙牡区晒斧赌乒牢兵缩压槛父捕绒筐黎绿差tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/

28、20248/10/20241515TCP/IP Protocol SuiteTCP/IP Protocol SuitePseudo Header FormatProtocolProtocolAll 0sAll 0sUDP total lengthUDP total lengthDestination IP addressDestination IP addressSource IP addressSource IP addressSource port numberSource port numberDest. port numberDest. port numberUDP total len

29、gthUDP total lengthChecksumChecksumDataDataP Ps se eu ud do oh he ea ad de er rH He ea ad de er r 愈迟庐加整清掂扎斜守奥仪芍炭猪销脸茬蟹喜冗极婶腻账旨刑幸翅瞩傈乾tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20241616TCP/IP Protocol SuiteTCP/IP Protocol SuiteChapter 9 UDPlProcess-

30、to-process communicationlUser datagramlChecksumlUDP operationlUse of UDPlUDP package雁抹操往盈毋殊靡芍密学趴犀固虐泪画殷相押曲稻齐随绘背瑶躁冻机竞厘tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20241717TCP/IP Protocol SuiteTCP/IP Protocol SuiteUDP OperationlA connectionless, unre

31、liableconnectionless, unreliable transport protocoll lTo create a process-to-process communicationTo create a process-to-process communicationl lConnectionless: Connectionless: 不同路径、不编号、面向报文不同路径、不编号、面向报文不同路径、不编号、面向报文不同路径、不编号、面向报文l l面向报文:不支持数据流,也不支持分段、重组面向报文:不支持数据流,也不支持分段、重组面向报文:不支持数据流,也不支持分段、重组面向报文:

32、不支持数据流,也不支持分段、重组l lNo flow controlNo flow controll lA litter error control: checksumA litter error control: checksuml l出错,出错,出错,出错,悄悄悄悄悄悄悄悄丢弃丢弃丢弃丢弃l l对对对对IPIP协议增强协议增强协议增强协议增强l l主机多目标通信的区分,允许多个通信并发进行而不主机多目标通信的区分,允许多个通信并发进行而不主机多目标通信的区分,允许多个通信并发进行而不主机多目标通信的区分,允许多个通信并发进行而不会发生混淆会发生混淆会发生混淆会发生混淆遁基劝墩客至辩捂猖垦蚁

33、迭恳尸乎屋巢政侵撮寂岳猛昧远焉铅哼目篇模煌tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20241818TCP/IP Protocol SuiteTCP/IP Protocol SuiteEncapsulation & Decapsulation炭柜详滴盂柑庆闽本弗部玻曰煤啊汉词莎观怒陈批鸯斥艳渤逊滥旱昭惑皿tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagra

34、m protocol-udp8/10/20248/10/20241919TCP/IP Protocol SuiteTCP/IP Protocol SuiteQueues in UDPl队列是与端口相关联在一起的队列是与端口相关联在一起的l进程进程入队列入队列/出队列出队列 or 进程进程入队列入队列均经独巳围帚犀帆冯谅吱硫备浴耍汛疫酋龙畔踪凌恒黔鳖叫连栈南戴吝玩tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20242020TCP/IP Proto

35、col SuiteTCP/IP Protocol SuiteMultiplexing & Demultiplexing硅熏呕识胡靠舍强书竹死乡徒窥屹步逾判彝辱丢刮钨深娱哼蓑濒专慷愉窟tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20242121TCP/IP Protocol SuiteTCP/IP Protocol SuiteChapter 9 UDPlProcess-to-process communicationlUser datagraml

36、ChecksumlUDP operationlUse of UDPlUDP package艇酪眼忘痛掺远巍列缝创医辅特眶跃湃仆刊赞拽论眨淫阑鸟弛扔斧肩援丘tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20242222TCP/IP Protocol SuiteTCP/IP Protocol SuiteUse of UDPl简单、简短的应用简单、简短的应用l简单的请求简单的请求-响应通信,如查询操作、网络管理响应通信,如查询操作、网络管理lIP ph

37、one,利用,利用UDP快捷的特点快捷的特点l适用于具有内部流控和差错控制的进程,如适用于具有内部流控和差错控制的进程,如TFTPl组播或广播应用组播或广播应用l某些路由协议,如某些路由协议,如RIPl l一般使用方式一般使用方式一般使用方式一般使用方式 客户客户客户客户/ /服务器模式服务器模式服务器模式服务器模式l l服务端:固定守候在特定服务端:固定守候在特定服务端:固定守候在特定服务端:固定守候在特定port xport x,提供服务,提供服务,提供服务,提供服务l l客户端:动态绑定任意客户端:动态绑定任意客户端:动态绑定任意客户端:动态绑定任意port nport n,向服务器,向

38、服务器,向服务器,向服务器port xport x发出发出发出发出请求,获得服务响应请求,获得服务响应请求,获得服务响应请求,获得服务响应缨历订卤兜特臣赚首波角龋瘦年趁邮套柔封薯缉梦端厢彻平始酵缕恍凄畴tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20242323TCP/IP Protocol SuiteTCP/IP Protocol SuiteChapter 9 UDPlProcess-to-process communicationlUser

39、 datagramlChecksumlUDP operationlUse of UDPlUDP package兼较始燃且啸头境龟丢骏根肖汉询勿泌汲寺画蚀赫现宵酮努姿鹿钠粟甭潦tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20242424TCP/IP Protocol SuiteTCP/IP Protocol SuiteUDP Package焦已司贮苑畏原掖绎祟凶先涵龟堪管邹钓腔祖假可农瓶浓叔赘卒檬褐嘲歧tcpip-chapter 9 user d

40、atagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20242525TCP/IP Protocol SuiteTCP/IP Protocol SuiteDiscussionl伪首部使得伪首部使得IP层和层和UDP层的界线模糊不清层的界线模糊不清l l考查考查考查考查UDPUDP协议软件在发送报文时如何计算校验和协议软件在发送报文时如何计算校验和协议软件在发送报文时如何计算校验和协议软件在发送报文时如何计算校验和UDPUDPIPI1NI1NI2NI3I2I317(dIPdIP,dPortdPort

41、,DataData)sPort封装封装UDP计算计算CS计算计算计算计算CSCS的困难的困难的困难的困难: 计算前需要知道计算前需要知道计算前需要知道计算前需要知道sIPsIP,但,但,但,但在在在在IPIP选路前,选路前,选路前,选路前,sIPsIP是未知的是未知的是未知的是未知的(sIPsIP与选择的与选择的与选择的与选择的NINI有关)有关)有关)有关)计算步骤:计算步骤:计算步骤:计算步骤:1 1. . 封装成封装成封装成封装成UDPUDP送给送给送给送给IPIP层层层层2 2. IP. IP层完成选路,得到层完成选路,得到层完成选路,得到层完成选路,得到sIPsIP,再送回,再送回,

42、再送回,再送回UDPUDP层层层层3 3. UDP. UDP层计算层计算层计算层计算CSCS,再送,再送,再送,再送IPIP层层层层UDPUDP接收也有类似问题接收也有类似问题接收也有类似问题接收也有类似问题应用的需要应用的需要赚沟柞勺痒拇妨盈契咕难叔棠拉吧水陛疗伊阶篓应完黔偏妆怨雇卵内判魄tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20242626TCP/IP Protocol SuiteTCP/IP Protocol SuiteSummar

43、yl进程到进程的通信进程到进程的通信l端点(端点(IP地址,端口)地址,端口)l lUDPl l通信特点:无连接、不可靠通信特点:无连接、不可靠通信特点:无连接、不可靠通信特点:无连接、不可靠l l作用作用作用作用l lUDP报文报文l l格式:伪首部、校验和的含义和作用格式:伪首部、校验和的含义和作用格式:伪首部、校验和的含义和作用格式:伪首部、校验和的含义和作用l l封装:直接封装在封装:直接封装在封装:直接封装在封装:直接封装在IPIP分组中分组中分组中分组中 古吩韵级七疑荣左谢泅列搁利樟焰产奈崖扦甫虚筛快洋咆懈赞皱肚爹汽款tcpip-chapter 9 user datagram protocol-udptcpip-chapter 9 user datagram protocol-udp8/10/20248/10/20242727TCP/IP Protocol SuiteTCP/IP Protocol Suite

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

最新文档


当前位置:首页 > 商业/管理/HR > 销售管理

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