北交計(jì)算機(jī)網(wǎng)絡(luò)課后習(xí)題答案期末考試復(fù)習(xí)第二章_第1頁
北交計(jì)算機(jī)網(wǎng)絡(luò)課后習(xí)題答案期末考試復(fù)習(xí)第二章_第2頁
北交計(jì)算機(jī)網(wǎng)絡(luò)課后習(xí)題答案期末考試復(fù)習(xí)第二章_第3頁
北交計(jì)算機(jī)網(wǎng)絡(luò)課后習(xí)題答案期末考試復(fù)習(xí)第二章_第4頁
北交計(jì)算機(jī)網(wǎng)絡(luò)課后習(xí)題答案期末考試復(fù)習(xí)第二章_第5頁
已閱讀5頁,還剩2頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、Chapter 2 Review questionsR1.The Web: HTTP; file transfer: FTP; remote login: Telnet; Network News: NNTP; e-mail: SMTP.R2. 發(fā)起通信的進(jìn)程是客戶端,等待接觸聯(lián)系的是服務(wù)器端。R3. 網(wǎng)絡(luò)體系結(jié)構(gòu)(network architecture)是指以分層組織的方式描述通信過程的組織體系,比如說本書介紹的自頂向下的五層結(jié)構(gòu)。而應(yīng)用體系結(jié)構(gòu)(application architecture)是由應(yīng)用程序的設(shè)計(jì)者設(shè)計(jì)并規(guī)定的。從應(yīng)用研發(fā)的角度來看,網(wǎng)絡(luò)體系結(jié)構(gòu)是固定的,而應(yīng)用體系結(jié)構(gòu)是

2、靈活多變的,前者為后者提供的特定的服務(wù)集合。R4. 答:目的主機(jī)的IP地址和目的套接字的端口號。R5.不同意. 每個(gè)通信會(huì)話都有一個(gè)客戶端和服務(wù)器端. 在一個(gè)P2P進(jìn)程中, 接收文件的一方是客戶端, 發(fā)送文件的一方是服務(wù)器端.R6. 答:目前為止還沒有這樣的應(yīng)用程序。R7.使用UDP, 因?yàn)樵谑褂肬DP的情況下, 事務(wù)能在一個(gè)RTT時(shí)間內(nèi)完成, 而TCP則需要2個(gè)RTT, 因?yàn)橛?次握手.R8.詳細(xì)內(nèi)容在課本P.1141. Reliable data transferTCP provides a reliable byte-stream between client and server bu

3、t UDP does not.2. A guarantee that a certain value for throughput will be maintainedNeither3. A guarantee that data will be delivered within a specified amount of timeNeither4. SecurityNeither為什么說TCP也不提供安全呢, 因?yàn)門CP的SSL是在應(yīng)用層的, 不是用在傳輸層的.R9.因?yàn)檫@些協(xié)議要保證數(shù)據(jù)在傳輸過程中不丟失,需要可靠的數(shù)據(jù)傳輸,TCP協(xié)議是可靠的,當(dāng)有包丟失時(shí)會(huì)重新傳送,所以要選擇TCP協(xié)議

4、,而UDP不滿足,所以不能選擇UDP協(xié)議。R10. 答:SSL運(yùn)轉(zhuǎn)在應(yīng)用層中,SSL套接字從應(yīng)用層獲取未加密的數(shù)據(jù),將這些數(shù)據(jù)加密,然后傳送給TCP的套接字。如果想要通過SSL加強(qiáng)TCP,需要將SSL的代碼添加到應(yīng)用程序中。R11.握手(handshaking)是一個(gè)建立連接的過程,握手協(xié)議的作用是使收發(fā)雙方交換一些信息,做好傳輸信息的準(zhǔn)備。R12.Web caching can bring the desired content “closer” to the user, perhaps to the same LAN to which the users host is connected

5、. Web caching can reduce the delay for all objects, even objects that are not cached, since caching reduces the traffic on links.R14. 當(dāng)游客第一次登錄網(wǎng)站時(shí),網(wǎng)站會(huì)返回給游客一個(gè)cookie碼,這個(gè)cookie碼被保存在用戶主機(jī)上并且受瀏覽器的管理。在接下來的子訪問(包括題目所說的購買動(dòng)作)中,瀏覽器發(fā)送cookie碼給商務(wù)網(wǎng)站,于是當(dāng)用戶(確切的說是這個(gè)瀏覽器)瀏覽這個(gè)網(wǎng)站的時(shí)候, 網(wǎng)站知道了這個(gè)用戶之前提交的購買請求。R15.Alice的郵件客戶端HTTPA

6、lice的郵件服務(wù)器 SMTPBob的郵件服務(wù)器 POP3Bob的郵件客戶端Message is sent from Alices host to her mail server over HTTP. Alices mail server then sends the message to Bobs mail server over SMTP. Bob then transfers the message from his mail server to his host over POP3.R16. Received:展示了SMTP服務(wù)器在哪些地址序列里接收和發(fā)送的郵件(即郵件通過了那些SMT

7、P服務(wù)器),包含當(dāng)時(shí)的時(shí)間戳。Message-ID:是一個(gè)郵件系統(tǒng)安排的獨(dú)立無二的序列,在郵件創(chuàng)建的時(shí)候被生成。From:郵件的發(fā)送者To:郵件的接收者Date:郵件發(fā)送的時(shí)間Content-type: 郵件主題內(nèi)容的類型(html之類的)。Return-Path:指定一個(gè)郵箱地址,如果接收方想要回復(fù),就會(huì)回復(fù)到這個(gè)郵箱。它也用于無法發(fā)送的郵件的回彈。R17.With download and delete, after a user retrieves its messages from a POP server, the messages are deleted. This poses a

8、 problem for the nomadic user, who may want to access the messages from many different machines (office PC, home PC, etc.). In the download and keep configuration, messages are not deleted after the user retrieves the messages. This can also be inconvenient, as each time the user retrieves the store

9、d messages from a new machine, all of non-deleted messages will be transferred to the new machine (including very old messages).R18. Web服務(wù)器與郵件服務(wù)器有相同的別名是可以的,通過添加RR中MX類記錄來實(shí)現(xiàn),例如(, )。R19. FTP客戶機(jī)和服務(wù)器之間會(huì)建立兩個(gè)并行的TCP連接,一個(gè)控制連接一個(gè)數(shù)據(jù)連接。因?yàn)榭刂七B接與數(shù)據(jù)連接相分離,所以控制信息稱為“帶外信令”。R20.Alice will get her f

10、irst chunk as a result of she being selected by one of her neighbors as a result of an “optimistic unchoke,” for sending out chunks to her.R21.It is not necessary that Bob will also provide chunks to Alice. Alice has to be in the top 4 neighbors of Bob for Bob to send out chunks to her; this might n

11、ot occur even if Alice is provides chunks to Bob throughout a 30-second interval.R22.The overlay network in a P2P file sharing system consists of the nodes participating in the file sharing system and the logical links between the nodes. There is a logical link (an “edge” in graph theory terms) from

12、 node A to node B if there is a semi-permanent TCP connection between A and B. An overlay network does not include routers. With Gnutella, when a node wants to join the Gnutella network, it first discovers (“out of band”) the IP address of one or more nodes already in the network. It then sends join

13、 messages to these nodes. When the node receives confirmations, it becomes a member of the of Gnutella network. Nodes maintain their logical links with periodic refresh messages.R23.It is a hybrid of client server and P2P architectures:a) There is a centralized component (the index) like in the case

14、 of a client server system.b) Other functions (except the indexing) do not use any kind of central server. This is similar to what exists in a P2P system.R24.Whenever a user, say Alice wants to locate another user in the instant messaging system, say Bob, her node would send out a query message aski

15、ng for the (unique) username (Bob) into the overlay network, which would be flooded into the network in the same manner a query requesting the location of a resource (eg: a file in Gnutella network) is flooded. If the user with the username (Bob) is online, as the query reaches the node where the us

16、er is online from, the node sends back the query response to the original query source (Alice). In this way, Alice locates the IP address of the node Bob is currently at in the instant messaging system. The advantage of such a design is that there is no centralized component in the system and hence

17、no single point of failure. The disadvantage however, is that the flooding of each such request into the overlay network results in huge traffic in the network. One option is to have limited scope query as in Gnutella. However, with this approach, the user might not be located even if she is online.

18、R25.a) User locationb) NAT traversalR26.a) File Distributionb) Instant Messagingc) Video Streamingd) Distributed ComputingR27.For the TCP application, as soon as the client is executed, it attempts to initiate a TCP connection with the server. If the TCP server is not running, then the client will f

19、ail to make a connection. For the UDP application, the client does not initiate connections (or attempt to communicate with the UDP server) immediately upon executionR28.With the UDP server, there is no welcoming socket, and all data from different clients enters the server through this one socket.

20、With the TCP server, there is a welcoming socket, and each time a client initiates a connection to the server, a new socket is created. Thus, to support n simultaneous connections, the server would need n+1 sockets.Problems:P2.a) The document request was /cs453/index.html. The

21、 Host : field indicates the servers name and /cs453/index.html indicates the file name.b) The browser is running HTTP version 1.1,as indicated just before hte first pair.c) The browser is requesting a persistent connection, as indicated by the Connection: keep-alive.d) This is a trick question. This

22、 information is not contained in an HTTP message anywhere. So there is no way to tell this from looking at the exchange of HTTP messages alone. One would need information from the IP datagrams (that carried the TCP segment that carried the HTTP GET request) to answer this question.P3.a) The status c

23、ode of 200 and the phrase OK indicate that the server was able to locate the document successfully. The reply was provided on Tuesday, 07 Mar 2006 12:39:45 Greenwich Mean Time.b) The document index.html was last modified on Saturday 10 Dec 2005 18:27:46 GMT.c) There are 3874 bytes in the document be

24、ing returned.d) The first five bytes of the returned document are : !doc. The server agreed to a persistent connection, as indicated by the Connection: Keep-Alive fieldP4.a) Persistent connections are discussed in section 8 of RFC 2616 (the real goal of this question was to get you to retrieve and r

25、ead an RFC). Sections 8.1.2 and of the RFC indicate that either the client or the server can indicate to the other that it is going to close the persistent connection. It does so by including the including the connection-token close in the Connection-header field of the http request/reply.b)

26、 HTTP does not provide any encryption services.P5.Access control commands:USER, PASS, ACT, CWD, CDUP, SMNT, REIN, QUIT.Transfer parameter commands:PORT, PASV, TYPE STRU, MODE.Service commands:RETR, STOR, STOU, APPE, ALLO, REST, RNFR, RNTO, ABOR, DELE,RMD, MRD, PWD, LIST, NLST, SITE, SYST, STAT, HELP

27、, NOOP.P6. 應(yīng)用層協(xié)議:DNS和HTTP協(xié)議傳輸層協(xié)議:UDP為DNS服務(wù),TCP為HTTP服務(wù)。P7.首先DNS迭代查詢到IP地址, 花費(fèi)時(shí)間是 i=1nRTTi.然后花費(fèi)一個(gè) RTT0 用于TCP建鏈(2次握手) , 然后再花費(fèi)一個(gè) RTT0 用于第三次握手(請求)和數(shù)據(jù)的傳輸.所以一共消耗時(shí)間為i=1nRTTi + 2RTT0P8.三者用于迭代尋找IP的時(shí)間是一樣的, 為 i=1nRTTia) 由于是非持久非并行連接, 所以每得到一個(gè)object都需要(建鏈+傳輸), 2個(gè)RTT0. 現(xiàn)在一共有1個(gè)HTML, 3個(gè)對象, 所以一共4個(gè), 花費(fèi)8個(gè)RTT0. 所以總花費(fèi)時(shí)間為:i

28、=1nRTTi + 8RTT0.b) 現(xiàn)在是并行連接, 首先花費(fèi) 2RTT0 得到HTML, 然后再次建鏈, 花費(fèi)RTT0 , 接下來由于是并行, 所以一次傳輸三個(gè)對象, 花費(fèi)RTT0.所以總花費(fèi)為:i=1nRTTi + 4RTT0.c) 首先花費(fèi) 2RTT0 得到HTML, 由于持久連接, 所以不用再次建鏈, 而且是流水線, 所以一個(gè) RTT0 就能得到全部對象(如果不是流水線就是3個(gè)RTT0). 總花費(fèi)為:i=1nRTTi + 3RTT0P9. a) =900,000bits / 15Mbps = 0.06sec = 10requests/sectraffic intensity = *

29、= 0.6average access delay = 0.06/(1-0.6)=0.15secaverage response time = 0.15 + 2 = 2.15secb) 由于web緩存的命中率為60%,流量強(qiáng)度下降了60%所以average access delay = 0.06/(1 - 60% * 0.6) = 0.09sec在這60%里, 請求時(shí)延幾乎為0, 時(shí)延全部在未命中緩存時(shí)的外請求,所以Total response time = 0.6*0 + 0.4*(2.09) = 0.836secP11.Parallel download would only share

30、the 100K bandwidth among the 10 connections (each getting just 10K bits/sec) thus, there is no significant advantage here. With persistent HTTP we avoid the SYN and SYNACK exchange but that only requires 2 seconds (1 second to send the 100 bit SYN message over the 100 bps link, and 1 second to recei

31、ve the ACK). Given that each object takes 101 seconds to send and receive the ACK, the use of pipelining gives only a 2 percent gain.P12. MAIL FROM: in SMTP:是來自于SMTP客戶端的一條信息,它確認(rèn)發(fā)送這條消息的發(fā)送者的身份,并通知到服務(wù)器端。From: in the mail message itself:它并不是SMTP消息,它只是郵件信息中的一行信息而已。P14.UIDL abbreviates “unique-ID listing”

32、. When a POP3 client issues the UIDL command, the server responds with the unique message ID for all of the messages present in the users mailbox. This command is useful for “download and keep”. By keeping a file that lists the messages retrieved in earlier sessions, the client can use the UIDL comm

33、and to determine which messages on the server have already been seen.P16. minimum distribution time for client-server distribution:DCS=maxNFus,Fdminminimum distribution time for P2P distribution:DP2P=maxFus,Fdmin,NFus+i=1Nui其中:F = 5Gbits = 5120Mbitsus = 20Mbpsdmin = di = 1MbpsC-S: Nu101001000100Kbps

34、512025600250Kbps512025600500Kbps512025600P2P: Nu101001000100Kbps512017201.0498743516.60027250Kbps512011527.8803919383.61432500Kbps51207438.8195210073.16323P17.a) Define u = u1 + u2 + . + uN. By assumptionus = (us + u)/N Equation 1Divide the file into N parts, with the ith part having size (ui/u)F. T

35、he server transmits the ith part to peer i at rate ri = (ui/u)us. Note that r1 + r2 + . + rN = us, so that the aggregate server rate does not exceed the link rate of the server. Also have each peer i forward the bits it receives to each of the N-1 peers at rate ri. The aggregate forwarding rate by p

36、eer i is (N-1)ri. We have(N-1)ri = (N-1)(usui)/u = (us + u)/N Equation 2Let ri = ui/(N-1) and rN+1 = (us u/(N-1)/NIn this distribution scheme, the file is broken into N+1 parts. The server sends bits from the ith part to the ith peer (i = 1, ., N) at rate ri. Each peer i forwards the bits arriving a

37、t rate ri to each of the other N-1 peers. Additionally, the server sends bits from the (N+1) st part at rate rN+1 to each of the N peers. The peers do not forward the bits from the (N+1)st part.The aggregate send rate of the server isr1+ . + rN + N rN+1 = u/(N-1) + us u/(N-1) = usThus, the servers s

38、end rate does not exceed its link rate. The aggregate send rate of peer i is (N-1)ri = uiThus, each peers send rate does not exceed its link rate.In this distribution scheme, peer i receives bits at an aggregate rate ofThus each peer receives the file in NF/(us+u).(For simplicity, we neglected to sp

39、ecify the size of the file part for i = 1, ., N+1. We now provide that here. Let = (us+u)/N be the distribution time. For i = 1, , N, the ith file part is Fi = ri bits. The (N+1)st file part is FN+1 = rN+1 bits. It is straightforward to show that F1+ . + FN+1 = F.)c) We know from section 2.6 that Co

40、mbining this with (a) and (b) gives the desired result.P18.a) Consider a distribution scheme in which the server sends the file to each client, in parallel, at a rate of a rate of us/N. Note that this rate is less than each of the clients download rate, since by assumption us/N dmin. Thus each clien

41、t can also receive at rate us/N. Since each client receives at rate us/N, the time for each client to receive the entire file is F/( us/N) = NF/ us. Since all the clients receive the file in NF/ us, the overall distribution time is also NF/ us.b) Consider a distribution scheme in which the server se

42、nds the file to each client, in parallel, at a rate of dmin. Note that the aggregate rate, N dmin, is less than the servers link rate us, since by assumption us/N dmin. Since each client receives at rate dmin, the time for each client to receive the entire file is F/ dmin. Since all the clients rece

43、ive the file in this time, the overall distribution time is also F/ dmin.c) From Section 2.6 we know thatDCS max NF/us, F/dmin (Equation 1)Suppose that us/N dmin. Then from Equation 1 we have DCS NF/us . But from (a) we have DCS NF/us . Combining these two gives:DCS = NF/us when us/N dmin. (Equation

44、 2)We can similarly show that:DCS =F/dmin when us/N dmin (Equation 3).Combining Equation 2 and Equation 3 gives the desired result.P19.There are N nodes in the overlay network. There are N(N-1)/2 edges.P20.a) In this case, each of the five Gnutella clients immediately learns that it has one less nei

45、ghbor. Consider one of these five clients, called, Bob. Suppose Bob has only three neighbors after X drops out. Then Bob needs to establish a TCP connection with another peer. Bob should have a fresh list of active peers; he sequentially contacts peers on this list until one accepts his TCP connecti

46、on attempt.b) In this case, Bob does not immediately know that X has departed. Bob will only learn about Xs departure when it attempts to send a message (query or ping) to X. When Bob attempts to send a message, Bobs TCP will make several unsuccessful attempts to send the message to B. Bobs TCP will

47、 then inform the Gnutella client that X is down. Bob will then try to establish a TCP connection with a new peer (see part (a) to rebuild a fifth connection.P21.Alice sends her query to at most N neighbors. Each of these neighbors forwards the query to at most M = N-1 neighbors. Each of those neighb

48、ors forwards the query to at most M neighbors. Thus the maximum number of query messages isN + NM + NM2 + + NM(K-1)= N(1 + M + M2 + + M(K-1) )= N(1-MK)/(1-M)= N(N-1)K- 1/(N-2)P22.a) The advantage of sending the QueryHit message directly over a TCP connection from Bob to Alice is that the QueryHit me

49、ssage is routed by the underlying Internet without passing through intermediate peers; thus, the delay in sending the message from Bob to Alice should be substantially less. The disadvantage is that each peer that has a match would ask Alice to open a TCP connection; Alice may therefore have to open

50、s tens or hundreds of TCP connections for a given query. Furthermore, there will be additional complications if Alice is behind a NAT (see Chapter 4).b) When a QueryHit message enters a peer, the peer records in a table the MessageID along with an identifier of the TCP socket from which the message arrived. When the same peer r

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(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ǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論