外文翻译 - UDP_第1页
外文翻译 - UDP_第2页
外文翻译 - UDP_第3页
外文翻译 - UDP_第4页
外文翻译 - UDP_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

0外文原文UDPisoneofthetwomainprotocolstoresideontopofIP.Itoffersservicetotheusersnetworkapplications.NetworkapplicationsthatuseUDPare:NetworkFileSystem(NFS)andSimpleetworkManagementProtocol(SNMP).TheserviceislittlemorethananinterfacetoIP.UDPisaconnectionlessdatagramdeliveryservicethatdoesnotguaranteedelivery.UDPdoesnotmaintainanend-to-endconnectionwiththeremoteUDPmodule;itmerelypushesthedatagramoutonthenetandacceptsincomingdatagramsoffthenet.UDPaddstwovaluestowhatisprovidedbyIP.Oneisthemultiplexingofinformationbetweenapplicationsbasedonportnumber.Theotherisachecksumtochecktheintegrityofthedata.Ports:Howdoesaclientononecomputerreachtheserveronanother?ThepathofcommunicationbetweenanapplicationandUDPisthroughUDPports.Theseportsarenumbered,beginningwithzero.Anapplicationthatisofferingservice(theserver)waitsformessagestocomeinonaspecificportdedicatedtothatservice.Theserverwaitspatientlyforanyclienttorequestservice.Forinstance,theSNMPserver,calledanSNMPagent,alwayswaitsonport161.TherecanbeonlyoneSNMPagentpercomputerbecausethereisonlyoneUDPportnumber161.Thisportnumberiswellknown;itisafixednumber,aninternetassignednumber.IfanSNMPclientwantsservice,itsendsitsrequesttoportnumber161ofUDPonthedestinationcomputer.WhenanapplicationsendsdataoutthroughUDPitarrivesatthefarendasasingleunit.Forexample,ifanapplicationdoes5writestotheUDPport,theapplicationatthefarendwilldo5readsfromtheUDPport.Also,thesizeofeachwritematchesthesizeofeachread.UDPpreservesthemessageboundarydefinedbytheapplication.Itneverjoinstwo1applicationmessagestogether,ordividesasingleapplicationmessageintoparts.Checksum:AnincomingIPpacketwithanIPheadertypefieldindicatingUDPispasseduptotheUDPmodulebyIP.WhentheUDPmodulereceivestheUDPdatagramfromIPitexaminestheUDPchecksum.Ifthechecksumiszero,itmeansthatchecksumwasnotcalculatedbythesenderandcanbeignored.ThusthesendingcomputersUDPmodulemayormaynotgeneratechecksums.IfEthernetistheonlynetworkbetweenthe2UDPmodulescommunicating,thenyoumaynotneedhecksumming.However,itisrecommendedthatchecksumgenerationalwaysbeenabledbecauseatsomepointinthefuturearoutetablechangemaysendthedataacrosslessreliablemedia.Ifthechecksumisvalid(orzero),thedestinationportnumberisexaminedandifanapplicationisboundtothatport,anapplicationmessageisqueuedfortheapplicationtoread.OtherwisetheUDPdatagramisdiscarded.IftheincomingUDPdatagramsarrivefasterthantheapplicationcanreadthemandifthequeuefillstoamaximumvalue,UDPdatagramsarediscardedbyUDP.UDPwillcontinuetodiscardUDPdatagramsuntilthereisspaceinthequeue.TransmissionControlProtocolTCPprovidesadifferentservicethanUDP.TCPoffersaconnection-orientedbytestream,insteadofaconnectionlessdatagramdeliveryservice.TCPguaranteesdelivery,whereasUDPdoesnot.TCPisusedbynetworkapplicationsthatrequireguaranteeddeliveryandcannotbebotheredwithdoingtime-outsandretransmissions.ThetwomosttypicalnetworkapplicationthatuseTCPareFileTransferProtocol(FTP)andtheTELNET.OtherpopularTCPnetwork.ApplicationsincludeX-WindowSystem,rcp(remotecopy),andtheirseriescommands.TCPsgreatercapabilityisnotwithoutcost:itrequiresmoreCPUandnetworkbandwidth.TheinternalsoftheTCPmodulearemuchmorecomplicatedthanthoseinaUDPmodule.SimilartoUDP,networkapplicationsconnecttoTCPports.Well-definedportnumbersarededicatedtospecificapplications.Forinstance,theTELNETserverusesportnumber23.TheTELNETclientcanfindtheserversimplybyconnectingtoport23ofTCPonthe2specifiedcomputer:WhentheapplicationfirststartsusingTCP,theTCPmoduleontheclientscomputerandtheTCPmoduleontheserverscomputerstartcommunicatingwitheachother.Thesetwoend-pointTCPmodulescontainstateinformationthatdefinesavirtualcircuit.ThisvirtualcircuitconsumesresourcesinbothTCPend-points.Thevirtualcircuitisfullduplex;datacangoinbothdirectionssimultaneously.TheapplicationwritesdatatotheTCPport,thedatatraversesthenetworkandisreadbytheapplicationatthefar.UDP:UserDatagramProtocolUDPisasimple,datagram-oriented,transportlayerprotocol:eachoutputoperationbyaprocessproducesexactlyoneUDPdatagram,whichcausesoneIPdatagramtobesent.Thisisdifferentfromastream-orientedprotocolsuchasTCPwheretheamountofdatawrittenbyanapplicationmayhavelittlerelationshiptowhatactuallygetssentinasingleIPdatagram.BroadcastingandMulticastingBroadcastingandmulticastingonlyapplytoUDP,whereitmakessenseforanapplicationtosendasinglemessagetomultiplerecipients.TCPisaconnection-orientedprotocolthatimpliesaconnectionbetweentwohosts(specifiedbyIPaddresses)andoneprocessoneachhost(specifiedbyportnumbers).ConsiderasetofhostsonasharednetworksuchasanEthernet.EachEthernetframecontainsthesourceanddestinationEthernetaddresses(48-bitvalues).NormallyeachEthernetframeisdestinedforasinglehost.Thedestinationaddressspecifiesasingleinterface-calledaunicast.Inthiswaycommunicationbetweenanytwohostsdoesntbotheranyoftheremaininghostsonthecable(exceptforpossiblecontentionforthesharedmedia).Therearetimes,however,whenahostwantstosendaframetoeveryotherhostonthecable-calledabroadcast.WesawthiswithARPandRARP.Multicastingfitsbetweenunicastingandbroadcasting:theframeshouldbedeliveredtoasetofhoststhatbelongtoamulticastgroup.3Tounderstandbroadcastingandmulticastingweneedtounderstandthatfilteringtakesplaceoneachhost,eachtimeaframepassesbyonthecable.Todaymostinterfacescanalsobeconfiguredtoreceiveframeswhosedestinationaddressisamulticastaddress,orsomesubsetofmulticastaddresses.OnanEthernet,amulticastaddresshasthelow-orderbitofthehigh-orderbyteturnedon.Inhexadecimalthisbitlookslike01:00:00:00:00:00.(WecanconsidertheEthernetbroadcastaddress,ff:ff:ff:ff:ff:ffasaspecialcaseoftheEthernetmulticastaddress.)Iftheinterfacecardreceivestheframe,itispassedtothedevicedriver.(OnereasontheinterfacecardmightdiscardtheframeisiftheEthernetchecksumisincorrect.)Additionalfilteringisperformedbythedevicedriver.First,theframetypemustspecifyaprotocolthatissupported(IP,ARP,etc.).Second,additionalmulticastfilteringmaybeperformed,tocheckwhetherthehostbelongstotheaddressedmulticastgroup.Thedevicedriverthenpassestheframetothenextlayer,suchasIP,iftheframetypespecifiesanIPdatagram.IPperformsmorefiltering,basedonthesourceanddestinationIPaddresses,andpassesthedatagramuptothenextlayer(suchasTCPorUDP)ifalliswell.EachtimeUDPreceivesadatagramfromIP,itperformsfilteringbasedonthedestinationportnumber,andsometimesthesourceportnumbertoo.Ifnoprocessiscurrentlyusingthedestinationportnumber,thedatagramisdiscardedandanICMPportunreachablemessageisnormallygenerated.BroadcastingLimitedBroadcastThelimitedbroadcastaddressis55.ThiscanbeusedasthedestinationaddressofanIPdatagramduringthehostconfigurationprocess,whenthehostmightnotknowitssubnetmaskorevenitsIPaddress.Adatagramdestinedforthelimitedbroadcastaddressisneverforwardedbyarouterunderanycircumstance.Itonlyappearsonthelocalcable.Anunansweredquestionis:ifahostismultihomedandaprocesssendsadatagramtothelimitedbroadcastaddress,shouldthedatagrambesentouteachconnectedinterface4thatsupportsbroadcasting?Ifnot,anapplicationthatwantstobroadcastoutallinterfacesmustdeterminealltheinterfacesonthehostthatsupportbroadcasting,andsendacopyouteachinterface.MostBSDsystemstreat55asanaliasforthebroadcastaddressofthefirstinterfacethatwasconfigured,anddontprovideanywaytosendadatagramoutallattached,broadcast-capableinterfaces.Indeed,twoapplicationsthatsendUDPdatagramsouteveryinterfacearerouted(Section10.3)andrwhod(theserverfortheBSDrwhoclient).Bothoftheseapplicationsgothroughasimilarstart-upproceduretodeterminealltheinterfacesonthehost,andwhichonesarecapableofbroadcasting.Thenet-directedbroadcastaddresscorrespondingtothatinterfaceisthenusedasthedestinationaddressfordatagramssentouttheinterface.TheHostRequirementsRFCtakesnostandontheissueofwhetheramultihomedhostshouldsendalimitedbroadcastoutallitsinterfaces.Net-directedBroadcastThenet-directedbroadcastaddresshasahostIDofallonebits.AclassAnet-directedbroadcastaddressisnetid.255.255.255,wherenetidistheclassAnetworkID.Aroutermustforwardanet-directedbroadcast,butitmustalsohaveanoptiontodisablethisforwarding.Subnet-directedBroadcastThesubnet-directedbroadcastaddresshasahostIDofallonebitsbutaspecificsubnetID.ClassificationofanIPaddressasasubnet-directedbroadcastaddressrequiresknowledgeofthesubnetmask.All-subnets-directedBroadcastAnall-subnets-directedbroadcastaddressalsorequiresknowledgeofthedestinationnetworkssubnetmask,todifferentiatethisbroadcastaddressfromanet-directedbroadcastaddress.BoththesubnetIDandthehostIDareallonebits.Forexample,ifthedestinationssubnetmaskis,thentheIPaddress55isanall-subnets-directedbroadcast.Butifthenetworkisnotsubnetted,thenthisisanet-directedbroadcast.Multicasting5IPmulticastingprovidestwoservicesforanapplication.Deliverytomultipledestinations.Therearemanyapplicationsthatdeliverinformationtomultiplerecipients:interactiveconferencinganddisseminationofmailornewstomultiplerecipients,forexample.WithoutmulticastingthesetypesofservicestendtouseTCPtoday(deliveringaseparatecopytoeachdestination).Evenwithmulticasting,someoftheseapplicationsmightcontinuetouseTCPforitsliability.Solicitationofserversbyclients.Adisklessworkstation,forexample,needstolocateabootstrapserver.Todaythisisprovidedusingabroadcast(aswellseewithBOOTPinChapter16),butamulticastsolutionwouldimposelessoverheadonthehoststhatdontprovidetheservice.Broadcastingissendingapackettoallhostsonanetwork(usuallyalocallyattachednetwork)andmulticastingissendingapackettoasetofhostsonanetwork.Basictothesetwoconceptsisanunderstandingofthedifferenttypesoffilteringthatoccurwhenareceivedframepassesupaprotocolstack.Eachlayercandiscardareceivedpacketfordifferentreasons.6中文翻译用户数据报协议(UDP)UDP是位于IP上层的两个主要协议之一.它服务于用户的网络应用程序.诸如网络文件系统(NFS)和简单网络管理协议(SNMP)都是使用UDP的网络应用程序.这些服务只不过是与IP的一个接口.UDP是一种无连接的数据报传输服务,不保证传输的可靠性.UDP不与远端的UDP模块保持端对端的连接;它仅仅是把数据报发向网络,并从网络接收传来的数据报.数据报在传给IP之前被UDP加上了两个值.一个是基于端口的应用程序间的多路信息,另一个是校验和以保证数据的完整性.端口一台计算机上的客户端是怎样到达另一台计算机上的服务端的应用程序和UDP之间通过UDP端口实现通信.这些端口是从零开始的数字.一个提供服务的应用程序(服务端)在一个该服务专有的端口等待信息的传来.服务端耐心地等待任何客户端的服务请求.例如,SNMP服务,通常被称作SNMP代理,经常在161端口等待.每台计算机只可能有一个SNMP代理,因为每台计算机只有一个161UDP端口.这个端口号是众所周知的,它是一个固定的端口,是internet分配的端口号.如果一个SNMP客户端需要服务,它就像目的计算机的161UDP端口发送请求.当一个应用程序通过UDP向外发送数据,则数据是做为一个单独的单元到达远端主机的.例如,如果一个应用程序对UDP端口执行了5次写操作,那么远端的应用程序将从UDP端口执行5次读操作.同样,每次写操作和每次读操作的数据量是一样的.UDP保护由应用程序确定的消息包的大小.它从来不会把两个应用程序消息组合到一起,也不会把一个应用程序消息分割成几部分.校验和如果一个接收到的IP包的IP头部类型区是UDP,它会被IP传递到上层的UDP模块.当UDP模块收到从IP传上来的UDP数据报,它对UDP校验和进行检查.如果校验和为零,则说明发送者没有计算校验和,可以忽略掉.发送者计算机的UDP模块可以产生校验和,也可以不产生.如果以太网是这两个UDP模块之间唯一的网络通信介质,则可以不需要校验和.否则,我们建议你始终开启产生校验和的功能,因为将来路由表的变化可能会使发送的数据通过不可靠的网络介质.如果校验和正确(或者为零),接下来检查目的端口号,并且查看是否有应用程序已绑定在该端口.若是,则应用程序信息排入队列等待该应用程序读取.若不是,该数据报将被丢弃.如果数据报到来的速度快于应用程序读取的速度而且队列已满,UDP也会丢弃这个数据报.UDP会继续丢弃收到的数据报,直至队列中有空间为止.传输控制协议(TCP)TCP提供的服务与UDP不同.TCP提供的是面向连接的数据流,而不是传输无连接的数据报.TCP能保证传输的可靠性,而UDP不能.对于那些需要保证传输的可靠性,并且不能被超时重传所打扰的网络应用程序来说,使用TCP是一个很好的选择.两个使用TCP的最普遍的网络应用程序是文件传输协议(FTP)和TELNET.其它流行的TCP网络应用程序包括:X-窗口系统,rcp(远程拷贝),以及r-系列命令.TCP更好的性能是以更多的消耗换来的,它需要更多的CPU资源和更多的网络带宽.TCP模块的内部也比UDP模块要复杂得多.与UDP相似,网络应用程序通过TCP端口连接.特定的应7用程序有自己特定的端口.例如:TELNET服务使用端口23.TELNET客户端通过向特定计算机的TCP端口23进行连接,就能找到服务端一旦应用程序开始使用TCP,客户机和服务器上的TCP模块就同时开始互相通信.这种端到端的TCP模块包含用来定UDP:用户数据报协议UDP是一个简单的面向数据报的运输层协议:进程的每个输出操作都正好产生一个UDP数据报,并组装成一份待发送的IP数据报。这与面向流字符的协议不同,如TCP,应用程序产生的全体数据与真正发送的单个IP数据报可能没有什么联系。广播和多播广播和多播仅应用于UDP,它们对需将报文同时传往多个接收者的应用来说十分重要。TCP是一个面向连接的协议,它意味着分别运行于两主机(由IP地址确定)内的两进程(由端口号确定)间存在一条连接。考虑包含多个主机的共享信道网络如以太网。每个以太网帧包含源主机和目的主机的以太网地址(48bit)。通常每个以太网帧仅发往单个目的主机,目的地址指明单个接收接口,因而称为单播(unicast)。在这种方式下,任意两个主机的通信不会干扰网内其他主机(可能引起争夺共享信道的情况除外)。然而,有时一个主机要向网上的其他主机发送帧,这就是广播。通过ARP和RARP可以看到这一过程。多播(multicast)处于单播和广播之间:帧仅传送给属于多播组的多个主机。为了弄清广播和多播,需要了解主机对由信道传送过来帧的过滤过程。目前,大多数的网卡经过配置都能接收目的地址为多播地址或某些子网多播地址的帧。对于以太网,当地址中最高字节的最低位设置为1时表示该地址是一个多播地址,用十六进制可表示为01:00:00:00:00:00。(以太网广播地址ff:ff:ff:ff:ff:ff可看作是以太网多播地址的特例。)如果网卡收到一个帧,这个帧将被传送给设备驱动程序。(如果帧检验和错,网卡将丢弃该帧。)设备驱动程序将进行另外的帧过滤。首先,帧类型中必须指定要使用的协议(IP,ARP等等)。其次,进行多播过滤来检测该主机是否属于多播地址说明的多播组。备驱动程序随后将数据帧传送给下一层,比如,当帧类型指定为IP数据报时,就传往IP层。IP根据IP地址中的源地址和目的地址进行更多的过虑检测,如果正常,将数据报传送给下一层(如TCP或UDP)。每次UDP收到由IP传送来的数据报,就根据目的端口号,有时还有源端口号进行数据报过滤。如果当前没有进程使用该目的端口号,就丢弃该数据报并产生一个ICMP不可达报文。广播受限的广播受限的广播地址是255.255.255

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论