版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1TCP/IPandInternet1InternetArchitecture2TheInternetProtocol3TransportLayerProtocols4InternetRouting2TCP/IPandInternet1InternetArchitecture2TheInternetProtocol3TransportLayerProtocols4InternetRouting3WhyInternetworking?Tobuilda“networkofnetworks”orInternetoperatingovermultiple,coexisting,differentnetworktechnologiesprovidingubiquitousconnectivitythroughIPpackettransferachievinghugeeconomiesofscaleGGGGGGHNet5Net5HNet5Net2HNet5Net3HNet5Net1Net5Net44WhyInternetworking?ToprovideuniversalcommunicationservicesindependentofunderlyingnetworktechnologiesprovidingcommoninterfacetouserapplicationsGGGGGGHNet5Net5HNet5Net2HNet5Net3HNet5Net1Net5Net4ReliableStreamServiceUserDatagramService5WhyInternetworking?TosupportdistributedapplicationsAnyapplicationdesignedtooperatebasedonInternetcommunicationservicesimmediatelyoperatesacrosstheentireInternet
RapiddeploymentofnewapplicationsEmail,Web,Peer-to-peer,game,etc.ApplicationsindependentofnetworktechnologyNewnetworkscanbeintroducedbelowOldnetworktechnologiescanberetired6Internethistory最初的ARPANET網(wǎng)絡(luò)196x,美國軍方為互聯(lián)所屬各軍方網(wǎng)絡(luò),由國防部下屬ARPA(AdvancedResearchProjectAgent)出資贊助大學(xué)開展網(wǎng)絡(luò)互聯(lián)技術(shù)的研究。實(shí)驗(yàn)性網(wǎng)絡(luò)ARPANET。1983年初,美軍將其所有軍事基地的各子網(wǎng)都聯(lián)到了ARPANET上,并全部采用TCP/IP協(xié)議。標(biāo)志著Internet正式誕生。80年代中期的NSFNET20世紀(jì)80年代,美國國家科學(xué)基金會(huì)(簡稱NSF)組建了一個(gè)從開始就使用TCP/IP協(xié)議的網(wǎng)絡(luò)NSFNET。NSFNET取代ARPANET,于1988年正式成為Internet的主干網(wǎng)。NSFNET采取的是一種層次結(jié)構(gòu),分為主干網(wǎng)、地區(qū)網(wǎng)與校園網(wǎng)。7Internethistory90年代,商業(yè)機(jī)構(gòu)介入InternetInternet問世后,每年加入Internet的計(jì)算機(jī)成指數(shù)式增長。MERIT、MCI與IBM三家商業(yè)公司組建了一個(gè)非盈利性的公司ANS,在1990年接管NSFNET構(gòu)成了ANSNET。Internet的商業(yè)化,開拓了其在通信、資料檢索、客戶服務(wù)等方面的巨大潛力,導(dǎo)致了Internet新的飛躍,走向全球。下一代互聯(lián)網(wǎng)Internet21996年美國率先發(fā)起下一代高速互聯(lián)網(wǎng)及其關(guān)鍵技術(shù)的研究。有185所大學(xué)和研究機(jī)構(gòu)加盟了Internet2計(jì)劃,建設(shè)了一個(gè)獨(dú)立的高速網(wǎng)絡(luò)試驗(yàn)床Abilene,并于1999年1月提供服務(wù)。自1998年以來,其他國家和地區(qū)相繼開展下一代高速互聯(lián)網(wǎng)及其關(guān)鍵技術(shù)的研究。2004年3月,我國第二代CERNET2(中國教育和科研計(jì)算機(jī)網(wǎng))實(shí)現(xiàn)了與國際下一代高速互聯(lián)網(wǎng)Internet2的互聯(lián)。InternetArchitectureTheInternetisacollectionofmanynetworksconnectedtogetherbyabunchofbackbones.ThegluethatholdsthewholeInternettogetheristhenetworklayerprotocol,IP(InternetProtocol).
9InternetProtocolApproachIPpacketstransferinformationacrossInternet
HostAIP→router→router…→router→HostBIPInternetlayerineachrouterdeterminesnexthop(router)NetworkinterfacestransferIPpacketsacrossnetworksRouterInternetLayerNetworkInterfaceTransportLayerInternetLayerNetworkInterfaceTransportLayerInternetLayerNetworkInterfaceHostAHostBNet5Net1Net5Net2Net5Net3RouterInternetLayerNetworkInterfaceRouterInternetLayerNetworkInterfaceNet5Net410InternetProtocolstructureARPRARPHardwareInterfaceICMPIGMPIPTCPUDPUserProcessUserProcessUserProcessUserProcessapplicationtransportnetworklinkBest-effortconnectionlesspackettransferReliablestreamserviceUnreliableUserdatagramservice11EncapsulationTCPHeadercontainssource&destinationportnumbersIPHeadercontainssourceanddestinationIPaddresses;transportprotocoltypeEthernetHeadercontainssource&destinationMACaddresses;networkprotocoltypeHTTPRequestTCPheaderHTTPRequestIPheaderTCPheaderHTTPRequestEthernetheaderIPheaderTCPheaderHTTPRequestFCS12TCP/IPandInternet1TheTCP/IPArchitecture2TheInternetProtocol2.1IPAddressing2.2IPpacketstructureandtransmission3TransportLayerProtocols4InternetRouting13TCP/IPandInternet2TheInternetProtocol2.1IPAddressing2.2IPpacketstructureandtransmission14InternetProtocol(IP)Providesbesteffort,connectionlesspacketdeliverymotivatedbyneedtokeeprouterssimpleandbyadaptingtofailureofnetworkelementspacketsmaybelost,outoforder,orevenduplicatedhigherlayerprotocolsmustdealwiththese,ifnecessaryRFCs791,950,919,922,and2474.IPispartofInternetSTDnumber5,whichalsoincludes:InternetControlMessageProtocol(ICMP),RFC792InternetGroupManagementProtocol(IGMP),RFC111215TCP/IPandInternet2TheInternetProtocol2.1IPAddressing2.2IPpacketstructureandtransmission16InternetNames&AddressesInternetNamesEachhosthasauniquenameIndependentofphysicallocationFacilitatememorizationbyhumansDomainNameOrganizationundersingleadministrativeunitHostNameNamegiventohostcomputerUserNameNameassignedtouserInternetAddressesEachhosthasgloballyuniquelogical32bitIPaddressSeparateaddressforeachphysicalconnectiontoanetworkIPaddresshastwoparts:
netidandhostidnetiduniquenetidfacilitatesroutingDottedDecimalNotation: 4 (intj=jthoctet)
DNSresolvesdomainnametoIPaddress17PhysicalAddressesLANs(andothernetworks)assignphysicaladdressestothephysicalattachmenttothenetworkThenetworkusesitsownaddresstotransferpacketsorframestotheappropriatedestinationIPaddressneedstoberesolvedtophysicaladdressateachIPnetworkinterfaceExample:Ethernetuses48-bitaddressesEachEthernetnetworkinterfacecard(NIC)hasgloballyuniqueMediumAccessControl(MAC)orphysicaladdressFirst24bitsidentifyNICmanufacturer;second24bitsareserialnumber00:90:27:96:68:0712hexnumbers18IPAddressingRFC1166EachhostonInternethasunique32bitIPaddressEachaddresshastwoparts:netidandhostidnetidunique&administeredbyInternetCorporationforAssignedNamesandNumbers(ICANN)AmericanRegistryforInternetNumbers(ARIN)ReseauxIPEuropeens(RIPE)AsiaPacificNetworkInformationCentre(APNIC)IPaddressisassignedtonetworkinterfacesratherthanhosts=>separateaddressisrequiredforeachphysicalconnectionofahosttoanetwork;“multi-homed”hosts
Dotted-DecimalNotation:IPaddressof10000000100001110100010000000101isindotted-decimalnotation19ClassesofIPAddresses010netidnetidhostidhostid7bits24bits14bits16bitsClassAClassB126networkswithupto16millionhosts16,382networkswithupto64,000hoststo55to5511netidhostid22bits8bitsClassC02millionnetworkswithupto254hoststo5520MulticastaddressUpto250millionmulticast
groupsatthesametime11multicastaddress28bits10ClassDto55ClassesofIPAddresses11Reservedforexperiments28bits11ClassE~~Reserved21PrivateIPAddressesSpecificrangesofIPaddressessetasideforuseinprivatenetworks(RFC1918)Userestrictedtoprivateinternets;routersinpublicInternetdiscardpacketswiththeseaddressesRange1:to55Range2:to55Range3:to55NetworkAddressTranslation(NAT)usedtoconvertbetweenprivate&globalIPaddresses22ExampleofIPAddressingRNetworkNetworkHHHHHR=routerH=hostInterfaceAddressisInterfaceAddressis50160AddresswithhostID=all0sreferstothenetworkAddresswithhostID=all1sreferstoabroadcastpacket23IPSubnetWhysubnet?MaximHostnumberinA/B/Cdifferentfromeachother;A/B/CclassesNotflexibleSimplifiesmanagementofmultiplicityofLANsSubnetaddressingintroducesanotherhierarchicallevel(e.g.,)HowtosubnetIntradomainonlyTransparenttoremotenetworksChangepartofhostbitstosubnetbits,Introducenetworkmasktoknowhowsubnetwasdoneinside.Tonormalizeusage,treattraditionalA/B/Caddressesasspecialsubnettednetworks(onlyhaveonesubnet)24SubnetAddressingMaskingusedtofindsubnetnumber25Network
MaskIPaddress mask
11001010011101110001011000000101&11111111111111111111111100000000
11001010011101110001011000000000(202)(119)(22)(0)Theresultof(ipandmask)meansnetworkID,soif(address1andmask)equals(address2andmask)meanstheyareinthesamenetworkAllbitsinmaskequals1meansIPaddress’scorrespondingbitsarenetworkpart,0smeanshostpartDefaultMaskforA/B/CaddressA=>B=>C=>26SpecialIPAddressesHostid“all0s”isreservedtorefertoanetworkNumber
(mask),(mask)Hostid“all1s”isreservedtobroadcasttoallhostsonaspecificnetwork
55(mask),55(mask)27SpecialIPAddresses(cont)
isreservedandmeans“unknownaddress“.Normallyusetobootdisklessworkstation55isreservedtobroadcasttoeveryhostonthelocalnetwork127.x.x.xmeans“thisnode”(localloopback).Messagessenttothisaddresswillneverleavethelocalhost.It’spurposeistestingnetworksoftware28IPaddresses:howtogetone?Hosts(hostportion):UsersareassignedIPaddressesbyInternetserviceproviders(ISPs)byhard-codedinsystemDHCP:
DynamicHostConfigurationProtocol:dynamicallygetaddress:“plug-and-play”hostbroadcasts“DHCPdiscover”msgDHCPserverrespondswith“DHCPoffer”msghostrequestsIPaddress:“DHCPrequest”msgDHCPserversendsaddress:“DHCPack”msg29AddressResolutionProtocolH1H2H3H4H1H2H3H4ARPrequest(whatistheMACaddressof2?)ARPresponse(myMACaddressis08:00:5a:3b:94)0123
AlthoughIPaddressidentifiesahost,thepacketisphysicallydeliveredbyanunderlyingnetwork(e.g.,Ethernet)whichusesitsownphysicaladdress(MACaddressinEthernet).HowtomapanIPaddresstoaphysicaladdress?
H1,H2,H3,H4areinthesamenetwork(howtojudge?)H1wantstolearnphysicaladdressofH3->broadcastsanARPrequestEveryhostreceivestherequest,butonlyH3replywithitsphysicaladdress30ExampleofARP31TCP/IPandInternet2TheInternetProtocol2.1IPAddressing2.2IPpacketstructureandtransmission32IPPacketHeaderVersionIHLTypeofServiceTotalLengthIdentificationFlagsFragmentOffsetTimetoLiveProtocolHeaderChecksumSourceIPAddressDestinationIPAddressOptionsPadding04816192431IPheaderTCPheaderHTTPRequest33IPPacketHeaderVersion
IHL
TypeofServiceTotalLengthIdentificationFlagsFragmentOffsetTimetoLiveProtocolHeaderChecksumSourceIPAddressDestinationIPAddressOptionsPadding04816192431Version:currentIPversionis4.Internetheaderlength(IHL):lengthoftheheaderin32-bitwords.Typeofservice(ToS):traditionallypriorityofpacketateachrouter.RecentDifferentiatedServicesredefinesToSfieldtosupportotherservicesthatarebetterthanbesteffort.34IPPacketHeaderVersionIHLTypeofServiceTotalLengthIdentificationFlagsFragmentOffsetTimetoLiveProtocolHeaderChecksumSourceIPAddressDestinationIPAddressOptionsPadding04816192431Totallength:numberofbytesoftheIPpacketincludingheaderanddata,maximumlengthis65535bytes.Identification,Flags,andFragmentOffset:usedforfragmentationandreassembly(Moreonthisshortly).35IPPacketHeaderVersionIHLTypeofServiceTotalLengthIdentificationFlagsFragmentOffsetTimetoLiveProtocolHeaderChecksumSourceIPAddressDestinationIPAddressOptionsPadding04816192431Timetolive(TTL):numberofhopspacketisallowedtotraverseinthenetwork.Eachrouteralongthepathtothedestinationdecrementsthisvaluebyone.Ifthevaluereacheszerobeforethepacketreachesthedestination,therouterdiscardsthepacketandsendsanerrormessagebacktothesource.36IPPacketHeaderVersionIHLTypeofServiceTotalLengthIdentificationFlagsFragmentOffsetTimetoLiveProtocolHeaderChecksumSourceIPAddressDestinationIPAddressOptionsPadding04816192431Protocol:specifiesupper-layerprotocolthatistoreceiveIPdataatthedestination.ExamplesincludeTCP(protocol=6),UDP(protocol=17),andICMP(protocol=1).Headerchecksum:verifiestheintegrityoftheIPheader.(16-bit)SourceIPaddressanddestinationIPaddress:containtheaddressesofthesourceanddestinationhosts.37IPPacketHeaderVersionIHLTypeofServiceTotalLengthIdentificationFlagsFragmentOffsetTimetoLiveProtocolHeaderChecksumSourceIPAddressDestinationIPAddressOptionsPadding04816192431Options:Variablelengthfield,allowspackettorequestspecialfeaturessuchassecuritylevel,routetobetakenbythepacket,andtimestampateachrouter.Detaileddescriptionsoftheseoptionscanbefoundin[RFC791].Padding:Thisfieldisusedtomaketheheaderamultipleof32-bitwords.38ExampleofIPHeader39IPHeaderProcessingatRoutersComputeheaderchecksumforcorrectnessandcheckthatfieldsinheader(e.g.,versionandtotallength)containvalidvaluesConsultroutingtabletodeterminenexthopChangefieldsthatrequireupdating(TTL,headerchecksum)TheIPpacketisthenforwardedalongthenexthop40IPIPRouterSourceDestinationNetworkNetworkFragmentatsourceFragmentatrouterReassembleatdestinationFragmentationandReassemblyMTU:maximumtransmissionunit41FragmentationandReassembly
Identificationidentifiesaparticularpacket,allocatedbysourcehost
Flags=(unused,don’tfragment/DF,morefragment/MF)
Fragmentoffsetidentifiesthelocationofafragmentwithinapacketin64-bitwords42Example:FragmentingaPacketApacketistobeforwardedtoanetworkwithMTUof576bytes.ThepackethasanIPheaderof20bytesandadatapartof1484bytes.andofeachfragment.Maximumdatalengthperfragment=576-20=556bytes.Wesetmaximumdatalengthto552bytestogetmultipleof8.
TotalLengthIdMFFragmentOffsetOriginalpacket1504x00Fragment1572x10Fragment2572x169=552/8Fragment3400x0138=552*2/8Fragmentationinvolvesasubtleperformancepenalty.43Thefragmentsaretobereassembledatdestinationhost.(noreassemblingatrouters)RelievingloadofroutersFragmentsmaygoaheadalongdifferentpathsTimerissetatdestinationhostTimerisstartedoncethefirstfragmentarrivedAllfragmentsofonepacketwillbediscardedifanyoneofthepacketisnotreceivedbeforetimeout.Anderrorinformationwillbereportedtosource.
Fragmentationinvolvesasubtleperformancepenalty.Reassembling44ICMP
(InternetControlMessageProtocol)RFC792;EncapsulatedinIPpacket(protocoltype=1)HandleserrorandcontrolmessagesIfroutercannotdeliverorforwardapacket,itsendsanICMP“hostunreachable”messagetothesourceIfrouterreceivespacketthatshouldhavebeensenttoanotherrouter,itsendsanICMP“redirect”messagetothesender;SendermodifiesitsroutingtableICMP“routerdiscovery”messagesallowhosttolearnaboutroutersinitsnetworkandtoinitializeandupdateitsroutingtablesICMP“echorequestandreply”facilitatediagnosticandusedin“ping”ICMPICMP封裝在IP包內(nèi)(因?yàn)镮CMP包需要跨越多個(gè)路由器)差錯(cuò)報(bào)告功能:向源端報(bào)告(不可達(dá)、分組超時(shí)、分組頭參數(shù)錯(cuò)誤),不用于差錯(cuò)恢復(fù),僅僅是通告,未規(guī)定后續(xù)處理控制功能:擁塞控制——源抑制報(bào)文:請(qǐng)求源端降低發(fā)送速率,未定義恢復(fù)速率報(bào)文,源端稍后自動(dòng)逐步恢復(fù)速率路由重定向:同一網(wǎng)絡(luò)內(nèi)多個(gè)路由器,某路由器重定向同網(wǎng)內(nèi)某主機(jī)路由路由器通告(向主機(jī))、路由器懇求等查詢功能:Echo:ping,tracerouteTimestamp(節(jié)點(diǎn)同步)地址掩碼請(qǐng)求與應(yīng)答2022/11/2NCRL45ICMP2022/11/2NCRL4647TypeCodeChecksumUnusedIPheaderand64bitsoforiginaldatagram081631ICMPBasicErrorMessageFormatTypeandCodeIPheader&64bitsoforiginaldatagramTomatchICMPmessagewithoriginaldatainIPpacket48TypeCodeChecksumIdentifierSequencenumberData081631EchoRequest&EchoReplyMessageFormatEchorequest:type=8;Echoreply:type=0DestinationreplieswithechoreplybycopyingdatainrequestontoreplymessageSequencenumbertomatchreplytorequestIDtodistinguishbetweendifferentsessionsusingechoservicesUsedinPING49Example–Echorequest50Example–EchoReply51TCP/IPandInternet1TheTCP/IPArchitecture2TheInternetProtocol3TransportLayerProtocols:UDPTCP4InternetRouting52OutlineUDPProtocolTCPReliableStreamServiceTCPProtocolTCPConnectionManagementTCPFlowControlTCPCongestionControl53UDPBesteffortdatagramserviceMultiplexingenablessharingofIPdatagramserviceSimpletransmitter&receiverConnectionless:nohandshaking&noconnectionstateLowheaderoverheadNoflowcontrol,noerrorcontrol,nocongestioncontrolUDPdatagramscanbelostorout-of-orderApplicationsmultimedia(e.g.,RTP)networkservices(e.g.,DNS,RIP,SNMP)54UDPDatagramSourceanddestinationportnumbersClientportsareephemeralServerportsarewell-knownMaxnumberis65,535UDPlengthTotalnumberofbytesindatagram(includingheader)8bytes≤length≤65,535UDPChecksumOptionallydetectserrorsinUDPdatagramsourceport#destport#32bitsApplicationdata(message)UDPsegmentformatlengthchecksumLength,inbytesofUDPsegment,includingheader55UDPChecksumCalculationUDPchecksumdetectsforend-to-enderrorsCoverspseudoheaderfollowedbyUDPdatagramIPaddressesincludedtodetectagainstmis-deliveryIP&UDPchecksumssettozeroduringcalculationPadwith1byteofzerosifUDPlengthisodd 00000000Protocol=17UDPLengthSourceIPAddressDestinationIPAddress081631UDPpseudo-header56UDPChecksumCalculation57UDPReceiverChecksumUDPreceiverrecalculatesthechecksumandsilentlydiscardsthedatagramiferrorsdetected“silently”meansnoerrormessageisgeneratedTheuseofUDPchecksumsisoptionalButhostsarerequiredtohavechecksumsenabled58Example59OutlineUDPProtocolTCPReliableStreamServiceTCPProtocolTCPConnectionManagementTCPCongestionControl60TCPReliablebyte-streamserviceMorecomplextransmitter&receiverConnection-oriented:full-duplexunicastconnectionbetweenclient&serverprocessesConnectionsetup,connectionstate,connectionreleaseHigherheaderoverheadErrorcontrol,flowcontrol,andcongestioncontrolHigherdelaythanUDPMostapplicationsuseTCPHTTP,SMTP,FTP,TELNET,POP3,…61ReliableByte-StreamServiceStreamDataTransfertransfersacontiguousstreamofbytesacrossthenetwork,withnoindicationofboundariesgroupsbytesintosegmentstransmitssegmentsasconvenient(Pushfunctiondefined)ReliabilityerrorcontrolmechanismtodealwithIPtransferimpairmentsWrite45bytesWrite15bytesWrite20bytesbufferbufferApplicationTransportRead40bytesRead40bytessegmentsACKS,sequence#ErrorDetection&Retransmission62FlowControlBufferlimitations&speedmismatchcanresultinlossofdatathatarrivesatdestinationReceivercontrolsrateatwhichsendertransmitstopreventbufferoverflowbuffersegmentsbufferusedApplicationTransportadvertisedwindowsize<Bbufferavailable=B63CongestionControlAvailablebandwidthtodestinationvarieswithactivityofotherusersTransmitterdynamicallyadjuststransmissionrateaccordingtonetworkcongestionasindicatedbyRTT(roundtriptime)&ACKsElasticutilizationofnetworkbandwidthbuffersegmentsbufferApplicationTransportACKSRTTEstimation64TCPMultiplexingATCPconnectionisspecifiedbya4-tuple(sourceIPaddress,sourceport,destinationIPaddress,destinationport)TCPallowsmultiplexingofmultipleconnectionsbetweenendsystemstosupportmultipleapplicationssimultaneouslyArrivingsegmentdirectedaccordingtoconnection4-tuple...TCP
IP12m...TCP
IP12nABC...TCP
IP12k(A,5234,B,80)(A,6234,B,80)(C,5234,B,80)65OutlineUDPProtocolTCPReliableStreamServiceTCPProtocolTCPConnectionManagementTCPCongestionControl66TCPProtocol
EachTCPsegmenthasheaderof20ormorebytes+0ormorebytesofdataSourceportDestinationportSequencenumberAcknowledgmentnumberChecksumUrgentpointerOptionsPadding0410162431URGACKPSHRSTSYNFINHeaderlengthReservedWindowsizeDataTCPSegmentFormat67TCPHeaderPortNumbersAsocketidentifiesaconnectionendpointIPaddress+portAconnectionspecifiedbyasocketpairWell-knownportsFTP 21Telnet 23DNS 53HTTP 80Headerlength4bitsLengthofheaderinmultiplesof32-bitwordsMinimumheaderlengthis20bytesMaximumheaderlengthis60bytes68TCPHeaderAcknowledgementNumberSNofnextbyteexpectedbyreceiverAcknowledgesthatallpriorbytesinstreamhavebeenreceivedcorrectlyValidifACKflagissetSequenceNumberBytecountFirstbyteinsegment32bitslong0SN232-1Initialsequencenumberselectedduringconnectionsetup69TCPHeaderReserved6bitsControl6bitsURG:urgentpointerflagUrgentmessageend=SN+urgentpointerACK:ACKpacketflagPSH:overrideTCPbufferingRST:resetconnectionUponreceiptofRST,connectionisterminatedandapplicationlayernotifiedSYN:establishconnectionFIN:closeconnection70TCPHeaderWindowSize16bitstoadvertisewindowsizeUsedforflowcontrolCurrentsenderwillacceptbyteswithSNfromACKtoACK+windowMaximumwindowsizeis65535bytesTCPChecksumInternetchecksummethodTCPpseudoheader+TCPsegment71TCPChecksumCalculationTCPerrordetectionusessameprocedureasUDPTCPpseudo-header00000000Protocol=6TCPsegmentlengthSourceIPaddressDestinationIPaddress08163172OutlineUDPProtocolTCPReliableStreamServiceTCPProtocolTCPConnectionManagementTCPCongestionControl73InitialSequenceNumberSelectinitialsequencenumbers(ISN)toprotectagainstsegmentsfrompriorconnections(thatmaycirculateinthenetworkandarriveatamuchlatertime)SelectISNtoavoidoverlapwithsequencenumbersofpriorconnectionsUselocalclocktoselectISNsequencenumberTimeforclocktogothroughafullcycleshouldbegreaterthanthemaximumlifetimeofasegment(MSL);TypicallyMSL=120secondsHighbandwidthconnectionsposeaproblem2n>2*maxpacketlife*Rbytes/second74TCPConnectionEstablishment“Three-wayHandshake”ISN’sprotectagainstsegmentsfrompriorconnectionsHostAHostBSYN,Seq_no=xSYN,Seq_no=y,ACK,Ack_no=x+1Seq_no=x+1,ACK,Ack_no=y+175IfhostalwaysusesthesameISNHostAHostBSYN,Seq_no=n,ACK,Ack_no=n+1Seq_no=n+1,ACK,Ack_no=n+1DelayedsegmentwithSeq_no=n+2willbeacceptedISNshouldbedifferenteachtimetoavoiddelay,lost,duplicate76MaximumSegmentSizeMaximumSegmentSizelargestblockofdatathatTCPsendstootherendEachendcanannounceitsMSSduringconnectionestablishmentTCPMSSDefaultis536bytesEthernetimpliesMSSof1460bytesIEEE802.3implies145277NearEnd:ConnectionRequest78FarEnd:AckandRequest79NearEnd:Ack80Client-ServerApplicationacceptreturnsread(blocks)readreturnswriteread(blocks)HostA(client)HostB(server)SYN,Seq_no=xSYN,Seq_no=y,ACK,Ack_no=x+1Seq_no=x+1,ACK,Ack_no=y+1socketbindlistenaccept
(blocks)socketconnect(blocks)connectreturnswriteread(blocks)readreturnsRequestmessageReplymessaget1t2t3t4t5t681TCPWindowFlowControl1024bytestotransmit1024bytestotransmit1024bytestotransmit128bytestotransmit1024bytestotransmitcanonlysend512bytesHostAHostBSeq_no=2000,Ack_no=1,Win=1024,Data=2000-3023Seq_no=1,Ack_no=4048,Win=512,Data=1-128Seq_no=3024,Ack_no=1,Win=1024,Data=3024-4047Seq_no=4048,Ack_no=129,Win=1024,Data=4048-4559t1t2t3t4Seq_no=1,Ack_no=2000,Win=2048,NoDatat082“GracefulClose”FIN,seq=5086Ack=5087Data,seq.=303,Ack=5087Deliver150bytesFIN,seq.=453,Ack=5087Ack=454HostAHostBAck=453TCPConnectionClosingTerminatingABTerminatingBA835.3TCPcongestioncontrolTCPusesaslidingwindowprotocolforendtoendflowcontrol.Theadvertisedwindowensuresthatthereceiver’sbufferwillneveroverflow,doesnotpreventthebuffersintheintermediateroutersformoverflowing.IPlayerdoesnotamechanismtoco
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度生態(tài)公園車位租賃與休閑娛樂服務(wù)協(xié)議4篇
- 2025年度藝術(shù)品代理合同終止及展覽策劃協(xié)議4篇
- 二零二五版跨行業(yè)企業(yè)戰(zhàn)略合作保密及數(shù)據(jù)共享協(xié)議3篇
- 離婚2025年度子女監(jiān)護(hù)權(quán)變更合同3篇
- 2025年農(nóng)業(yè)大棚租賃與農(nóng)產(chǎn)品質(zhì)量安全檢測服務(wù)協(xié)議4篇
- 2025年度園林景觀蟲害防治與植物保護(hù)合同4篇
- 家庭中醫(yī)急救技能普及工作匯報(bào)
- 現(xiàn)代家庭教育的新篇章-從理論到操作的全面解讀與實(shí)踐探索
- 探索創(chuàng)新型康復(fù)治療在醫(yī)療教育中的價(jià)值
- 科技小能手的培養(yǎng)計(jì)劃觀察與思考的融合
- 三級(jí)人工智能訓(xùn)練師(高級(jí))職業(yè)技能等級(jí)認(rèn)定考試題及答案
- 華為全屋智能試題
- 第三單元名著導(dǎo)讀《經(jīng)典常談》知識(shí)清單 統(tǒng)編版語文八年級(jí)下冊(cè)
- 第十七章-阿法芙·I·梅勒斯的轉(zhuǎn)變理論
- 焊接機(jī)器人在汽車制造中應(yīng)用案例分析報(bào)告
- 合成生物學(xué)在生物技術(shù)中的應(yīng)用
- 中醫(yī)門診病歷
- 廣西華銀鋁業(yè)財(cái)務(wù)分析報(bào)告
- 無違法犯罪記錄證明申請(qǐng)表(個(gè)人)
- 大學(xué)生勞動(dòng)教育PPT完整全套教學(xué)課件
- 繼電保護(hù)原理應(yīng)用及配置課件
評(píng)論
0/150
提交評(píng)論