第1页第2页Chapter2ReviewquestionsR1.TheWeb:HTTP;filetransfer:FTP;remotelogin:Telnet;NetworkNews:NNTP;e-mail:SMTP.R2.发起通信的进程是客户端,等待接触联系的是服务器端。R3.网络体系结构(networkarchitecture)是指以分层组织的方式描述通信过程的组织体系,比如说本书介绍的自顶向下的五层结构。而应用体系结构(applicationarchitecture)是由应用程序的设计者设计并规定的。从应用研发的角度来看,网络体系结构是固定的,而应用体系结构是灵活多变的,前者为后者提供的特定的服务集合。R4.答:目的主机的IP地址和目的套接字的端口号。R5.不同意.每个通信会话都有一个客户端和服务器端.在一个P2P进程中,接收文件的一方是客户端,发送文件的一方是服务器端.R6.答:目前为止还没有这样的应用程序。R7.使用UDP,因为在使用UDP的情况下,事务能在一个RTT时间内完成,而TCP则需要2个RTT,因为有3次握手.R8.详细内容在课本P.1141.ReliabledatatransferTCPprovidesareliablebyte-streambetweenclientandserverbutUDPdoesnot.2.AguaranteethatacertainvalueforthroughputwillbemaintainedNeither3.AguaranteethatdatawillbedeliveredwithinaspecifiedamountoftimeNeither4.SecurityNeither为什么说TCP也不提供安全呢,因为TCP的SSL是在应用层的,不是用在传输层的.R9.因为这些协议要保证数据在传输过程中不丢失,需要可靠的数据传输,TCP协议是可靠的,当有包丢失时会重新传送,所以要选择TCP协议,而UDP不满足,所以不能选择UDP协议。R10.答:SSL运转在应用层中,SSL套接字从应用层获取未加密的数据,将这些数据加密,然后传送给TCP的套接字。如果想要通过SSL加强TCP,需要将SSL的代码添加到应用程序中。R11.握手(handshaking)是一个建立连接的过程,握手协议的作用是使收发双方交换一些信息,做好传输信息的准备。第3页第4页R12.Webcachingcanbringthedesiredcontent“closer”totheuser,perhapstothesameLANtowhichtheuser’shostisconnected.Webcachingcanreducethedelayforallobjects,evenobjectsthatarenotcached,sincecachingreducesthetrafficonlinks.R14.当游客第一次登录网站时,网站会返回给游客一个cookie码,这个cookie码被保存在用户主机上并且受浏览器的管理。在接下来的子访问(包括题目所说的购买动作)中,浏览器发送cookie码给商务网站,于是当用户(确切的说是这个浏览器)浏览这个网站的时候,网站知道了这个用户之前提交的购买请求。R15.Alice的邮件客户端↓HTTPAlice的邮件服务器↓SMTPBob的邮件服务器↓POP3Bob的邮件客户端MessageissentfromAlice’shosttohermailserveroverHTTP.Alice’smailserverthensendsthemessagetoBob’smailserveroverSMTP.BobthentransfersthemessagefromhismailservertohishostoverPOP3.R16.Received:展示了SMTP服务器在哪些地址序列里接收和发送的邮件(即邮件通过了那些SMTP服务器),包含当时的时间戳。Message-ID:是一个邮件系统安排的独立无二的序列,在邮件创建的时候被生成。From:邮件的发送者To:邮件的接收者Date:邮件发送的时间Content-type:邮件主题内容的类型(html之类的)。Return-Path:指定一个邮箱地址,如果接收方想要回复,就会回复到这个邮箱。它也用于无法发送的邮件的回弹。R17.Withdownloadanddelete,afterauserretrievesitsmessagesfromaPOPserver,themessagesaredeleted.Thisposesaproblemforthenomadicuser,whomaywanttoaccessthemessagesfrommanydifferentmachines(officePC,homePC,etc.).Inthedownloadandkeepconfiguration,messagesarenotdeletedaftertheuserretrievesthemessages.Thiscanalsobeinconvenient,aseachtimetheuserretrievesthestoredmessagesfromanewmachine,allofnon-deletedmessageswillbetransferredtothenewmachine(includingveryoldmessages).R18.Web服务器与邮件服务器有相同的别名是可以的,通过添加RR中MX类记录来实现,例如(foo.com,mail.bar.foo.com)。R19.FTP客户机和服务器之间会建立两个并行的TCP连接,一个控制连接一个数据连接。因为控制连接与数据连接相分离,所以控制信息称为“带外信令”。R20.Alicewillgetherfirstchunkasaresultofshebeingselectedbyoneofherneighborsasaresultofan“optimisticunchoke,”forsendingoutchunkstoher.R21.ItisnotnecessarythatBobwillalsoprovidechunkstoAlice.Alicehastobeinthetop4neighborsofBobforBobtosendoutchunkstoher;thismightnotoccurevenifAliceisprovideschunkstoBobthroughouta30-secondinterval.R22.第5页第6页TheoverlaynetworkinaP2Pfilesharingsystemconsistsofthenodesparticipatinginthefilesharingsystemandthelogicallinksbetweenthenodes.Thereisalogicallink(an“edge”ingraphtheoryterms)fromnodeAtonodeBifthereisasemi-permanentTCPconnectionbetweenAandB.Anoverlaynetworkdoesnotincluderouters.WithGnutella,whenanodewantstojointheGnutellanetwork,itfirstdiscovers(“outofband”)theIPaddressofoneormorenodesalreadyinthenetwork.Itthensendsjoinmessagestothesenodes.Whenthenodereceivesconfirmations,itbecomesamemberoftheofGnutellanetwork.Nodesmaintaintheirlogicallinkswithperiodicrefreshmessages.R23.ItisahybridofclientserverandP2Parchitectures:a)Thereisacentralizedcomponent(theindex)likeinthecaseofaclientserversystem.b)Otherfunctions(excepttheindexing)donotuseanykindofcentralserver.ThisissimilartowhatexistsinaP2Psystem.R24.Wheneverauser,sayAlicewantstolocateanotheruserintheinstantmessagingsystem,sayBob,hernodewouldsendoutaquerymessageaskingforthe(unique)username(Bob)intotheoverlaynetwork,whichwouldbefloodedintothenetworkinthesamemanneraqueryrequestingthelocationofaresource(eg:afileinGnutellanetwork)isflooded.Iftheuserwiththeusername(Bob)isonline,asthequeryreachesthenodewheretheuserisonlinefrom,thenodesendsbackthequeryresponsetotheoriginalquerysource(Alice).Inthisway,AlicelocatestheIPaddressofthenodeBobiscurrentlyatintheinstantmessagingsystem.Theadvantageofsuchadesignisthatthereisnocentralizedcomponentinthesystemandhencenosinglepointoffailure.Thedisadvantagehowever,isthatthefloodingofeachsuchrequestintotheoverlaynetworkresultsinhugetrafficinthenetwork.OneoptionistohavelimitedscopequeryasinGnutella.However,withthisapproach,theusermightnotbelocatedevenifsheisonline.R25.a)Userlocationb)NATtraversalR26.a)FileDistributionb)InstantMessagingc)VideoStreamingd)DistributedComputingR27.FortheTCPapplication,assoonastheclientisexecuted,itattemptstoinitiateaTCPconnectionwiththeserver.IftheTCPserverisnotrunning,thentheclientwillfailtomakeaconnection.FortheUDPapplication,theclientdoesnotinitiateconnections(orattempttocommunicatewiththeUDPserver)immediatelyuponexecutionR28.WiththeUDPserver,thereisnowelcomingsocket,andalldatafromdifferentclientsenterstheserverthroughthisonesocket.WiththeTCPserver,thereisawelcomingsocket,andeachti