計算機網絡自頂向下第六版課件講解學習_第1頁
計算機網絡自頂向下第六版課件講解學習_第2頁
計算機網絡自頂向下第六版課件講解學習_第3頁
計算機網絡自頂向下第六版課件講解學習_第4頁
計算機網絡自頂向下第六版課件講解學習_第5頁
已閱讀5頁,還剩104頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

計算機網絡自頂向下第六版課件ApplicationLayer2-2Chapter2:applicationlayerourgoals:

conceptual,implementationaspectsofnetworkapplicationprotocolstransport-layerservicemodelsclient-serverparadigmpeer-to-peerparadigmlearnaboutprotocolsbyexaminingpopularapplication-levelprotocolsHTTPFTPSMTP/POP3/IMAPDNScreatingnetworkapplicationssocketAPIApplicationLayer2-3Somenetworkappse-mailwebtextmessagingremoteloginP2Pfilesharingmulti-usernetworkgamesstreamingstoredvideo(YouTube,Hulu,Netflix)voiceoverIP(e.g.,Skype)real-timevideoconferencingsocialnetworkingsearch……ApplicationLayer2-4Creatinganetworkappwriteprogramsthat:runon(different)endsystemscommunicateovernetworke.g.,webserversoftwarecommunicateswithbrowsersoftwarenoneedtowritesoftwarefornetwork-coredevicesnetwork-coredevicesdonotrunuserapplicationsapplicationsonendsystemsallowsforrapidappdevelopment,propagationapplicationtransportnetworkdatalinkphysicalapplicationtransportnetworkdatalinkphysicalapplicationtransportnetworkdatalinkphysicalApplicationLayer2-5Applicationarchitecturespossiblestructureofapplications:client-serverpeer-to-peer(P2P)ApplicationLayer2-6Client-serverarchitectureserver:always-onhostpermanentIPaddressdatacentersforscalingclients:communicatewithservermaybeintermittentlyconnectedmayhavedynamicIPaddressesdonotcommunicatedirectlywitheachotherclient/serverApplicationLayer2-7P2Parchitecturenoalways-onserverarbitraryendsystemsdirectlycommunicatepeersrequestservicefromotherpeers,provideserviceinreturntootherpeersselfscalability–newpeersbringnewservicecapacity,aswellasnewservicedemandspeersareintermittentlyconnectedandchangeIPaddressescomplexmanagementpeer-peerApplicationLayer2-8Processescommunicatingprocess:programrunningwithinahostwithinsamehost,twoprocessescommunicateusinginter-processcommunication(definedbyOS)processesindifferenthostscommunicatebyexchangingmessagesclientprocess:

processthatinitiatescommunicationserverprocess:

processthatwaitstobecontactedaside:applicationswithP2Parchitectureshaveclientprocesses&serverprocessesclients,serversApplicationLayer2-9Socketsprocesssends/receivesmessagesto/fromitssocketsocketanalogoustodoorsendingprocessshovesmessageoutdoorsendingprocessreliesontransportinfrastructureonothersideofdoortodelivermessagetosocketatreceivingprocessInternetcontrolledbyOScontrolledbyappdevelopertransportapplicationphysicallinknetworkprocesstransportapplicationphysicallinknetworkprocesssocketApplicationLayer2-10Addressingprocessestoreceivemessages,processmusthaveidentifierhostdevicehasunique32-bitIPaddressQ:doesIPaddressofhostonwhichprocessrunssufficeforidentifyingtheprocess?identifier

includesbothIPaddressandportnumbersassociatedwithprocessonhost.exampleportnumbers:HTTPserver:80mailserver:25tosendHTTPmessagetowebserver:IPaddress:

2portnumber:

80moreshortly…A:no,manyprocessescanberunningonsamehostApplicationLayer2-11App-layerprotocoldefinestypesofmessagesexchanged,

e.g.,request,responsemessagesyntax:whatfieldsinmessages&howfieldsaredelineatedmessagesemantics

meaningofinformationinfieldsrulesforwhenandhowprocessessend&respondtomessagesopenprotocols:definedinRFCsallowsforinteroperabilitye.g.,HTTP,SMTPproprietaryprotocols:e.g.,SkypeApplicationLayer2-12Whattransportservicedoesanappneed?dataintegritysomeapps(e.g.,filetransfer,webtransactions)require100%reliabledatatransfer

otherapps(e.g.,audio)cantoleratesomelosstimingsomeapps(e.g.,Internettelephony,interactivegames)requirelowdelaytobe“effective”throughputsomeapps(e.g.,multimedia)requireminimumamountofthroughputtobe“effective”otherapps(“elasticapps”)makeuseofwhateverthroughputtheygetsecurityencryption,dataintegrity,…ApplicationLayer2-13Transportservicerequirements:commonappsapplicationfiletransfere-mailWebdocumentsreal-timeaudio/videostoredaudio/videointeractivegamestextmessagingdatalossnolossnolossnolossloss-tolerantloss-tolerantloss-tolerantnolossthroughputelasticelasticelasticaudio:5kbps-1Mbpsvideo:10kbps-5Mbpssameasabovefewkbpsupelastictimesensitivenononoyes,100’smsecyes,fewsecsyes,100’smsecyesandnoApplicationLayer2-14InternettransportprotocolsservicesTCPservice:reliabletransport

betweensendingandreceivingprocessflowcontrol:senderwon’toverwhelmreceivercongestioncontrol:throttlesenderwhennetworkoverloadeddoesnotprovide:timing,minimumthroughputguarantee,securityconnection-oriented:setuprequiredbetweenclientandserverprocessesUDPservice:unreliabledatatransferbetweensendingandreceivingprocessdoesnotprovide:reliability,flowcontrol,congestioncontrol,timing,throughputguarantee,security,orconnectionsetup,Q:whybother?WhyisthereaUDP?ApplicationLayer2-15Internetapps:application,transportprotocolsapplicatione-mailremoteterminalaccessWebfiletransferstreamingmultimediaInternettelephonyapplicationlayerprotocolSMTP[RFC2821]Telnet[RFC854]HTTP[RFC2616]FTP[RFC959]HTTP(e.g.,YouTube),

RTP[RFC1889]SIP,RTP,proprietary(e.g.,Skype)underlyingtransportprotocolTCPTCPTCPTCPTCPorUDPTCPorUDPSecuringTCPTCP&UDPnoencryptioncleartextpasswdssentintosockettraverseInternetincleartextSSL

providesencryptedTCPconnectiondataintegrityend-pointauthenticationSSLisatapplayerAppsuseSSLlibraries,which“talk”toTCPSSLsocketAPIcleartextpasswdssentintosockettraverseInternetencryptedSeeChapter7ApplicationLayer2-16ApplicationLayer2-17Chapter2:outline2.1principlesofnetworkapplicationsapparchitecturesapprequirements2.2WebandHTTP2.3FTP2.4electronicmailSMTP,POP3,IMAP2.5DNS2.6P2Papplications2.7socketprogrammingwithUDPandTCPApplicationLayer2-18WebandHTTPFirst,areview…webpageconsistsofobjectsobjectcanbeHTMLfile,JPEGimage,Javaapplet,audiofile,…webpageconsistsofbaseHTML-filewhichincludesseveralreferencedobjectseachobjectisaddressablebyaURL,e.g.,/someDept/pic.gifhostnamepath

nameApplicationLayer2-19HTTPoverviewHTTP:hypertexttransferprotocolWeb’sapplicationlayerprotocolclient/servermodelclient:browserthatrequests,receives,(usingHTTPprotocol)and“displays”Webobjectsserver:Webserversends(usingHTTPprotocol)objectsinresponsetorequestsPCrunningFirefoxbrowserserverrunningApacheWebserveriphonerunningSafaribrowserHTTPrequestHTTPresponseHTTPrequestHTTPresponseApplicationLayer2-20HTTPoverview(continued)usesTCP:clientinitiatesTCPconnection(createssocket)toserver,port80serveracceptsTCPconnectionfromclientHTTPmessages(application-layerprotocolmessages)exchangedbetweenbrowser(HTTPclient)andWebserver(HTTPserver)TCPconnectionclosedHTTPis“stateless”servermaintainsnoinformationaboutpastclientrequestsprotocolsthatmaintain“state”arecomplex!pasthistory(state)mustbemaintainedifserver/clientcrashes,theirviewsof“state”maybeinconsistent,mustbereconciledasideApplicationLayer2-21HTTPconnectionsnon-persistentHTTPatmostoneobjectsentoverTCPconnectionconnectionthencloseddownloadingmultipleobjectsrequiredmultipleconnectionspersistentHTTPmultipleobjectscanbesentoversingleTCPconnectionbetweenclient,serverApplicationLayer2-22Non-persistentHTTPsupposeuserentersURL:1a.HTTPclientinitiatesTCPconnectiontoHTTPserver(process)atwww.someSonport802.HTTPclientsendsHTTPrequestmessage(containingURL)intoTCPconnectionsocket.MessageindicatesthatclientwantsobjectsomeDepartment/home.index1b.HTTPserverathostwww.someSwaitingforTCPconnectionatport80.“accepts”connection,notifyingclient3.HTTPserverreceivesrequestmessage,formsresponsemessagecontainingrequestedobject,andsendsmessageintoitssockettime(containstext,referencesto10jpegimages)www.someS/someDepartment/home.indexApplicationLayer2-23Non-persistentHTTP(cont.)5.HTTPclientreceivesresponsemessagecontaininghtmlfile,displayshtml.Parsinghtmlfile,finds10referencedjpegobjects6.Steps1-5repeatedforeachof10jpegobjects4.HTTPserverclosesTCPconnection.timeApplicationLayer2-24Non-persistentHTTP:responsetimeRTT(definition):timeforasmallpackettotravelfromclienttoserverandbackHTTPresponsetime:oneRTTtoinitiateTCPconnectiononeRTTforHTTPrequestandfirstfewbytesofHTTPresponsetoreturnfiletransmissiontimenon-persistentHTTPresponsetime= 2RTT+filetransmissiontimetimetotransmitfileinitiateTCPconnectionRTTrequestfileRTTfilereceivedtimetimeApplicationLayer2-25PersistentHTTPnon-persistentHTTPissues:requires2RTTsperobjectOSoverheadforeachTCPconnectionbrowsersoftenopenparallelTCPconnectionstofetchreferencedobjectspersistentHTTP:serverleavesconnectionopenaftersendingresponsesubsequentHTTPmessagesbetweensameclient/serversentoveropenconnectionclientsendsrequestsassoonasitencountersareferencedobjectaslittleasoneRTTforallthereferencedobjectsApplicationLayer2-26HTTPrequestmessagetwotypesofHTTPmessages:request,responseHTTPrequestmessage:ASCII(human-readableformat)requestline(GET,POST,HEADcommands)headerlinescarriagereturn,linefeedatstartoflineindicatesendofheaderlinesGET/index.htmlHTTP/1.1\r\nHost:\r\nUser-Agent:Firefox/3.6.10\r\nAccept:text/html,application/xhtml+xml\r\nAccept-Language:en-us,en;q=0.5\r\nAccept-Encoding:gzip,deflate\r\nAccept-Charset:ISO-8859-1,utf-8;q=0.7\r\nKeep-Alive:115\r\nConnection:keep-alive\r\n\r\ncarriagereturncharacterline-feedcharacterApplicationLayer2-27HTTPrequestmessage:generalformatrequestlineheaderlinesbodymethodspspcrlfversionURLcrlfvalueheaderfieldnamecrlfvalueheaderfieldname~~~~crlfentitybody~~~~ApplicationLayer2-28UploadingforminputPOSTmethod:webpageoftenincludesforminputinputisuploadedtoserverinentitybodyURLmethod:usesGETmethodinputisuploadedinURLfieldofrequestline:/animalsearch?monkeys&bananaApplicationLayer2-29MethodtypesHTTP/1.0:GETPOSTHEADasksservertoleaverequestedobjectoutofresponseHTTP/1.1:GET,POST,HEADPUTuploadsfileinentitybodytopathspecifiedinURLfieldDELETEdeletesfilespecifiedintheURLfieldApplicationLayer2-30HTTPresponsemessagestatusline(protocolstatuscodestatusphrase)headerlinesdata,e.g.,requestedHTMLfileHTTP/1.1200OK\r\nDate:Sun,26Sep201020:09:20GMT\r\nServer:Apache/2.0.52(CentOS)\r\nLast-Modified:Tue,30Oct200717:00:02GMT\r\nETag:"17dc6-a5c-bf716880"\r\nAccept-Ranges:bytes\r\nContent-Length:2652\r\nKeep-Alive:timeout=10,max=100\r\nConnection:Keep-Alive\r\nContent-Type:text/html;charset=ISO-8859-1\r\n\r\ndatadatadatadatadata...ApplicationLayer2-31HTTPresponsestatuscodes200OKrequestsucceeded,requestedobjectlaterinthismsg301MovedPermanentlyrequestedobjectmoved,newlocationspecifiedlaterinthismsg(Location:)400BadRequestrequestmsgnotunderstoodbyserver404NotFoundrequesteddocumentnotfoundonthisserver505HTTPVersionNotSupportedstatuscodeappearsin1stlineinserver-to-clientresponsemessage.somesamplecodes:ApplicationLayer2-32TryingoutHTTP(clientside)foryourself1.TelnettoyourfavoriteWebserver:opensTCPconnectiontoport80(defaultHTTPserverport)at.anythingtypedinsenttoport80attelnet802.typeinaGETHTTPrequest:GET/~ross/HTTP/1.1Host:bytypingthisin(hitcarriagereturntwice),yousendthisminimal(butcomplete)GETrequesttoHTTPserver3.lookatresponsemessagesentbyHTTPserver!(oruseWiresharktolookatcapturedHTTPrequest/response)ApplicationLayer2-33User-serverstate:cookiesmanyWebsitesusecookiesfourcomponents:1)cookieheaderlineofHTTPresponsemessage2)cookieheaderlineinnextHTTPrequestmessage3)cookiefilekeptonuser’shost,managedbyuser’sbrowser4)back-enddatabaseatWebsiteexample:SusanalwaysaccessInternetfromPCvisitsspecifice-commercesiteforfirsttimewheninitialHTTPrequestsarrivesatsite,sitecreates:uniqueIDentryinbackenddatabaseforIDApplicationLayer2-34Cookies:keeping“state”(cont.)clientserverusualhttpresponsemsgusualhttpresponsemsgcookiefileoneweeklater:usualhttprequestmsgcookie:1678cookie-specificactionaccessebay8734usualhttprequestmsgAmazonservercreatesID1678forusercreateentryusualhttpresponseset-cookie:1678

ebay8734amazon1678usualhttprequestmsgcookie:1678cookie-specificactionaccessebay8734amazon1678backenddatabaseApplicationLayer2-35Cookies(continued)whatcookiescanbeusedfor:authorizationshoppingcartsrecommendationsusersessionstate(Webe-mail)cookiesandprivacy:cookiespermitsitestolearnalotaboutyouyoumaysupplynameande-mailtositesasidehowtokeep“state”:protocolendpoints:maintainstateatsender/receiverovermultipletransactionscookies:httpmessagescarrystateApplicationLayer2-36Webcaches(proxyserver)usersetsbrowser:WebaccessesviacachebrowsersendsallHTTPrequeststocacheobjectincache:cachereturnsobjectelsecacherequestsobjectfromoriginserver,thenreturnsobjecttoclientgoal:satisfyclientrequestwithoutinvolvingoriginserverclientproxyserverclientHTTPrequestHTTPresponseHTTPrequestHTTPrequestoriginserveroriginserverHTTPresponseHTTPresponseApplicationLayer2-37MoreaboutWebcachingcacheactsasbothclientandserverserverfororiginalrequestingclientclienttooriginservertypicallycacheisinstalledbyISP(university,company,residentialISP)whyWebcaching?reduceresponsetimeforclientrequestreducetrafficonaninstitution’saccesslinkInternetdensewithcaches:enables“poor”contentproviderstoeffectivelydelivercontent(sotoodoesP2Pfilesharing)ApplicationLayer2-38Cachingexample:originserverspublicInternetinstitutionalnetwork1GbpsLAN1.54Mbpsaccesslinkassumptions:avgobjectsize:100Kbitsavgrequestratefrombrowserstooriginservers:15/secavgdataratetobrowsers:1.50MbpsRTTfrominstitutionalroutertoanyoriginserver:2secaccesslinkrate:1.54Mbpsconsequences:LANutilization:15%accesslinkutilization=99%totaldelay=Internetdelay+accessdelay+LANdelay=2sec+minutes+usecsproblem!ApplicationLayer2-39assumptions:avgobjectsize:100Kbitsavgrequestratefrombrowserstooriginservers:15/secavgdataratetobrowsers:1.50MbpsRTTfrominstitutionalroutertoanyoriginserver:2secaccesslinkrate:1.54Mbpsconsequences:LANutilization:15%accesslinkutilization=99%totaldelay=Internetdelay+accessdelay+LANdelay=2sec+minutes+usecsCachingexample:fatteraccesslink

originservers1.54Mbpsaccesslink154Mbps154MbpsmsecsCost:increasedaccesslinkspeed(notcheap!)9.9%publicInternetinstitutionalnetwork1GbpsLANinstitutionalnetwork1GbpsLANApplicationLayer2-40Cachingexample:installlocalcache

originservers1.54Mbpsaccesslinklocalwebcacheassumptions:avgobjectsize:100Kbitsavgrequestratefrombrowserstooriginservers:15/secavgdataratetobrowsers:1.50MbpsRTTfrominstitutionalroutertoanyoriginserver:2secaccesslinkrate:1.54Mbpsconsequences:LANutilization:15%accesslinkutilization=100%totaldelay=Internetdelay+accessdelay+LANdelay=2sec+minutes+usecs??Howtocomputelinkutilization,delay?Cost:webcache(cheap!)publicInternetApplicationLayer2-41Cachingexample:installlocalcache

Calculatingaccesslinkutilization,delaywithcache:supposecachehitrateis0.440%requestssatisfiedatcache,60%requestssatisfiedatorigin

originservers1.54Mbpsaccesslinkaccesslinkutilization:60%ofrequestsuseaccesslinkdataratetobrowsersoveraccesslink=0.6*1.50Mbps=.9Mbpsutilization=0.9/1.54=.58totaldelay=0.6*(delayfromoriginservers)+0.4*(delaywhensatisfiedatcache)=0.6(2.01)+0.4(~msecs)=~1.2secslessthanwith154Mbpslink(andcheapertoo!)

publicInternetinstitutionalnetwork1GbpsLANlocalwebcacheApplicationLayer2-42ConditionalGETGoal:don’tsendobjectifcachehasup-to-datecachedversionnoobjecttransmissiondelaylowerlinkutilizationcache:specifydateofcachedcopyinHTTPrequestIf-modified-since:<date>server:responsecontainsnoobjectifcachedcopyisup-to-date:HTTP/1.0304NotModifiedHTTPrequestmsgIf-modified-since:<date>HTTPresponseHTTP/1.0304NotModifiedobjectnotmodifiedbefore<date>HTTPrequestmsgIf-modified-since:<date>HTTPresponseHTTP/1.0200OK<data>objectmodifiedafter<date>clientserverApplicationLayer2-43Chapter2:outline2.1principlesofnetworkapplicationsapparchitecturesapprequirements2.2WebandHTTP2.3FTP

2.4electronicmailSMTP,POP3,IMAP2.5DNS2.6P2Papplications2.7socketprogrammingwithUDPandTCPApplicationLayer2-44FTP:thefiletransferprotocolfiletransferFTPserverFTPuserinterfaceFTPclientlocalfilesystemremotefilesystemuserathosttransferfileto/fromremotehostclient/servermodelclient:sidethatinitiatestransfer(eitherto/fromremote)server:remotehostftp:RFC959ftpserver:port21ApplicationLayer2-45FTP:separatecontrol,dataconnectionsFTPclientcontactsFTPserveratport21,usingTCPclientauthorizedovercontrolconnectionclientbrowsesremotedirectory,sendscommandsovercontrolconnectionwhenserverreceivesfiletransfercommand,serveropens2nd

TCPdataconnection(forfile)toclientaftertransferringonefile,serverclosesdataconnectionFTPclientFTPserverTCPcontrolconnection,serverport21TCPdataconnection,serverport20serveropensanotherTCPdataconnectiontotransferanotherfilecontrolconnection:“outofband”FTPservermaintains“state”:currentdirectory,earlierauthenticationApplicationLayer2-46FTPcommands,responsessamplecommands:sentasASCIItextovercontrolchannelUSERusernamePASSpasswordLIST

returnlistoffileincurrentdirectoryRETRfilename

retrieves(gets)fileSTORfilename

stores(puts)fileontoremotehostsamplereturncodesstatuscodeandphrase(asinHTTP)331UsernameOK,passwordrequired125dataconnectionalreadyopen;transferstarting425Can’topendataconnection452ErrorwritingfileApplicationLayer2-47Chapter2:outline2.1principlesofnetworkapplicationsapparchitecturesapprequirements2.2WebandHTTP2.3FTP2.4electronicmailSMTP,POP3,IMAP2.5DNS2.6P2Papplications2.7socketprogrammingwithUDPandTCPApplicationLayer2-48ElectronicmailThreemajorcomponents:

useragentsmailserverssimplemailtransferprotocol:SMTPUserAgenta.k.a.“mailreader”composing,editing,readingmailmessagese.g.,Outlook,Thunderbird,iPhonemailclientoutgoing,incomingmessagesstoredonserverusermailboxoutgoingmessagequeuemailservermailservermailserverSMTPSMTPSMTPuseragentuseragentuseragentuseragentuseragentuseragentApplicationLayer2-49Electronicmail:mailserversmailservers:mailboxcontainsincomingmessagesforusermessagequeueofoutgoing(tobesent)mailmessagesSMTPprotocolbetweenmailserverstosendemailmessagesclient:sendingmailserver“server”:receivingmailservermailservermailservermailserverSMTPSMTPSMTPuseragentuseragentuseragentuseragentuseragentuseragentApplicationLayer2-50ElectronicMail:SMTP[RFC2821]usesTCPtoreliablytransferemailmessagefromclienttoserver,port25directtransfer:sendingservertoreceivingserverthreephasesoftransferhandshaking(greeting)transferofmessagesclosurecommand/responseinteraction(likeHTTP,FTP)commands:ASCIItextresponse:statuscodeandphrasemessagesmustbein7-bitASCIApplicationLayer2-51useragentScenario:AlicesendsmessagetoBob1)AliceusesUAtocomposemessage“to”

bob@2)Alice’sUAsendsmessagetohermailserver;messageplacedinmessagequeue3)clientsideofSMTPopensTCPconnectionwithBob’smailserver4)SMTPclientsendsAlice’smessageovertheTCPconnection5)Bob’smailserverplacesthemessageinBob’smailbox6)Bobinvokeshisuseragenttoreadmessagemailservermailserver123456Alice’smailserverBob’smailserveruseragentApplicationLayer2-52SampleSMTPinteractionS:220C:HELOcrepes.frS:250Hellocrepes.fr,pleasedtomeetyouC:MAILFROM:<alice@crepes.fr>S:250alice@crepes.fr...SenderokC:RCPTTO:<bob@>S:250bob@...RecipientokC:DATAS:354Entermail,endwith"."onalinebyitselfC:Doyoulikeketchup?C:Howaboutpickles?C:.S:250MessageacceptedfordeliveryC:QUITS:221closingconnectionApplicationLayer2-53TrySMTPinteractionforyourself:telnetservername25see220replyfromserverenterHELO,MAILFROM,RCPTTO,DATA,QUITcommands

aboveletsyousendemailwithoutusingemailclient(reader)ApplicationLayer2-54SMTP:finalwordsSMTPusespersistentconnectionsSMTPrequiresmessage(header&body)tobein7-bitASCIISMTPserverusesCRLF.CRLFtodetermineendofmessagecomparisonwithHTTP:HTTP:pullSMTP:pushbothhaveASCIIcommand/responseinteraction,statuscodesHTTP:eachobjectencapsulatedinitsownresponsemsgSMTP:multipleobjectssentinmultipartmsgApplicationLayer2-55MailmessageformatSMTP:protocolforexchangingemailmsgsRFC822:standardfortextmessageformat:headerlines,e.g.,To:From:Subject:different

fromSMTPMAILFROM,RCPTTO:commands!Body:the“message”

ASCIIcharactersonlyheaderbodyblanklineApplicationLayer2-56MailaccessprotocolsSMTP:delivery/storagetoreceiver’sservermailaccessprotocol:retrievalfromserverPOP:PostOfficeProtocol[RFC1939]:authorization,downloadIMAP:InternetMailAccessProtocol[RFC1730]:morefeatures,includingmanipulationofstoredmsgsonserverHTTP:gmail,Hotmail,Yahoo!Mail,etc.sender’smailserverSMTPSMTPmailaccessprotocolreceiver’smailserver(e.g.,POP,IMAP)useragentuseragentApplicationLayer2-57POP3protocolauthorizationphaseclientcommands:user:declareusernamepass:passwordserverresponses+OK-ERRtransactionphase,

client:list:listmessagenumbersretr:retrievemessagebynumberdele:deletequit

C:listS:1498S:2912S:.C:retr1S:<message1contents>S:.C:dele1C:retr2S:<message1contents>S:.C:dele2C:quitS:+OKPOP3serversigningoffS:+OKPOP3serverreadyC:userbobS:+OKC:passhungryS:+OKusersuccessfullyloggedonApplicationLayer2-58POP3(more)andIMAPmoreaboutPOP3previousexampleusesPOP3“downloadanddelete”modeBobcannotre-reade-mailifhechangesclientPOP3“download-and-keep”:copiesofmessagesondifferentclientsPOP3isstatelessacrosssessionsIMAPkeepsallmessagesinoneplace:atserverallowsusertoorganizemessagesinfolderskeepsuserstateacrosssessions:namesoffoldersandmappingsbetweenmessageIDsandfoldernameApplicationLayer2-59Chapter2:outline2.1principlesofnetworkapplicationsapparchitecturesapprequirements2.2WebandHTTP2.3FTP2.4electronicmailSMTP,POP3,IMAP2.5DNS2.6P2Papplications2.7socketprogrammingwithUDPandTCPApplicationLayer2-60DNS:domainnamesystempeople:manyidentifiers:SSN,name,passport#Internethosts,routers:IPaddress(32bit)-usedforaddressingdatagrams“name”,e.g.,-usedbyhumansQ:howtomapbetweenIPaddressandname,andviceversa?DomainNameSystem:distributeddatabaseimplementedinhierarchyofmanynameserversapplication-layerprotocol:hosts,nameserverscommunicatetoresolve

names(address/nametranslation)note:coreInternetfunction,implementedasapplication-layerprotocolcomplexityatnetwork’s“edge”ApplicationLayer2-61DNS:services,structurewhynotcentralizeDNS?singlepointoffailuretrafficvolumedistantcentralizeddatabasemaintenanceDNSserviceshostnametoIPaddresstranslationhostaliasingcanonical,aliasnamesmailserveraliasingloaddistributionreplicatedWebservers:manyIPaddressescorrespondtoonenameA:doesn’tscale!ApplicationLayer2-62RootDNSServerscomDNSserversorgDNSserverseduDNSserversDNSserversDNSserversDNSserversDNSserversDNSserversDNS:adistributed,hierarchicaldatabaseclientwantsIPfor;1stapprox:clientqueriesrootservertofindcomDNSDNSservertogetDNSserverclientqueriesDNSservertogetIPaddressfor……ApplicationLayer2-63DNS:rootnameserverscontactedbylocalnameserverthatcannotresolvenamerootnameserver:contactsauthoritativenameserverifnamemappingnotknowngetsmappingreturnsmappingtolocalnameserver13rootname“servers”worldwidea.Verisign,LosAngelesCA(5othersites)b.USC-ISIMarinadelRey,CAl.ICANNLosAngeles,CA(41othersites)e.NASAMtView,CAf.InternetSoftwareC.PaloAlto,CA(and48othersites)i.Netnod,Stockholm(37othersites)k.RIPELondon(17othersites)m.WIDETokyo(5othersites)c.Cogent,Herndon,VA(5othersites)d.UMarylandCollegePark,MDh.ARLAberdeen,MDj.Verisign,DullesVA(69othersites)g.USDoDColumbus,OH(5othersites)ApplicationLayer2-64TLD,authoritativeserverstop-leveldomain(TLD)servers:respons

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論