计算机网络原理第二章答案

这是计算机网络原理系列答案第二章,是我个人总结的 有问题欢迎指出

ReviewQuestion:

R.1. What is the difference between network architecture and application architecture?

Answer:
网络体系结构是指将通信过程组织为多层(例如,五层互联网体系结构)。 另一方面,应用程序架构是由应用程序开发人员设计的,并规定了应用程序的广泛结构(例如,客户端-服务器或P2P)

R2 List five nonproprietary Internet applications and the application-layer protocols that they use.

答:
applications protocols
e-mail SMTP
WEB HTTP
streaming multimedia HTTP ,RTP
file transfer FTP
remote terminal access Telnet

R3 What information is used by a process running on one host to identify a process running on another host?

目标主机的IP地址和目标进程中的套接字端口号。

R5 For a communication session between a pair of processes, which process is the client and which is the server?

答:发起通信的过程是客户端;等待联系的进程是服务器。

R6 Suppose you wanted to do za transaction from a remote client to a server as fast as possible. Would you use UDPor TCP? Why?

您将使用UDP。使用UDP,事务可以在一个往返时间(RTT)内完成—客户端将事务请求发送到UDP套接字,服务器将应答发送回客户端UDP套接字。使用TCP时,至少需要两个RTTs—一个用于建立TCP连接,另一个用于客户机发送请求,服务器发回应答.

R7. Recall that TCPcan be enhanced with SSLto provide process-to-process security services, including encryption. Does SSLoperate at the transport layer or the application layer? If the application developer wants TCPto be enhanced with SSL, what does the developer have to do?

SSL在应用层操作。SSL套接字从应用层获取未加密的数据,对其进行加密,然后将其传递给TCP套接字。如果应用程序开发人员希望使用SSL增强TCP,则必须在应用程序中包含SSL代码。
R9 Referring to Figure 2.4, we see that none of the applications listed in Figure 2.4 requires both no data loss and timing. Can you conceive of an application that requires no data loss and that is also highly time-sensitive?
例如,使用谷歌文档的远程字处理就是这样一个例子。然而,由于谷歌文档是在Internet上运行的(使用TCP),所以没有提供时间保证。

R11 What is meant by a handshaking protocol?

如果两个通信实体在相互发送数据之前先交换控制数据包,则协议使用握手协议。 SMTP在应用程序层使用握手,而HTTP不使用。

R12 Telnet into a Web server and send a multiline request message. Include in the request message the If-modified-since: header line to force a response message with the 304 Not Modified status code.

答:Web缓存能够使用用户所希望的内容距离用户更近,或许就在用户主机所连接的局域网内。Web缓存能够减小用户请求所有对象的时延,即使是该对象没有被缓存,因为缓存能够减少链路上的流量。因此改善了所有应用的性能。因为一般情况下客户机与Web缓存器上,则该Web缓存器可以迅速将该对象交付给用户。

R.13. Consider an e-commerce site that wants to keep a purchase record for each of its customers. Describe how this can be done with cookies.

答:用户首次访问该站点时,该站点将返回一个cookie编号。 此Cookie编号存储在用户的主机上,并由浏览器管理。 在随后的每次访问(和购买)期间,浏览器都会将Cookie编号发送回站点。 因此,站点知道该用户(更确切地说是该浏览器)何时访问该站点。

Problems:

P1

FFTF

P2 Consider an HTTPclient that wants to retrieve a Web document at a given URL. The IPaddress of the HTTPserver is initially unknown. What transport and application-layer protocols besides HTTPare needed in this scenario?

应用层协议:DNS和HTTP
传输层协议:UDP用于DNS: TCP用于HTTP

P4 The text below shows the reply sent from the server in response to the HTTP GET message in the question above. Answer the following questions, indicating where in the message below you find the answer.

182 CHAPTER 2 • APPLICATION LAYER
HTTP/1.1 200 OKDate: Tue, 07 Mar 2008 12:39:45GMTServer: Apache/2.0.52 (Fedora) Last-Modified: Sat, 10 Dec2005 18:27:46 GMTETag: “526c3-f22-a88a4c80”AcceptRanges: bytesContent-Length: 3874 Keep-Alive: timeout=max=100Connection: Keep-AliveContent-Type: text/html; charset= ISO-8859-1<!doctype html public “//w3c//dtd html 4.0 transitional//en”> <meta name=”GENERATOR” content=”Mozilla/4.79 [en] (Windows NT 5.0; U) Netscape]”> CMPSCI 453 / 591 / NTU-ST550A Spring 2005 homepage <much more document text following here (not shown)>
(1) a) The status code 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.
(2) )There are 3874 bytes in the document being returned
(3) The first five bytes of the returned document are : <!doc. The server agreed to a persistent connection, as indicated by the Connection: Keep-Alive field.
(4) .The document index.html was last modified on Saturday 10 Dec 2005 18:27:46 GMT.

P5 Consider the following string of ASCII characters that were captured by Wireshark when the browser sent an HTTPGETmessage (i.e., this is the actual content of an HTTPGETmessage). The characters are carriage return and line-feed characters (that is, the italized character string in the text below represents the single carriage-return character that was contained at that point in the HTTPheader). Answer the following questions, indicating where in the HTTPGET message below you find the answer.

GET /cs453/index.html HTTP/1.1Host: gai a.cs.umass.eduUser-Agent: Mozilla/5.0 ( Windows;U; Windows NT 5.1; en-US; rv:1.7.2) Gec ko/20040804 Netscape/7.2 (ax) Accept:ex t/xml, application/xml, application/xhtml+xml, text /html;q=0.9, text/plain;q=0.8,image/png,/;q=0.5 Accept-Language: en-us,en;q=0.5AcceptEncoding: zip,deflateAccept-Charset: ISO -8859-1,utf-8;q=0.7,*;q=0.7Keep-Alive: 300 Connection:keep-alive
(1) The browser is requesting a persistent connection, as indicated by the Connection:keep-alive.
(2) The document request was http://gaia.cs.umass.edu/cs453/index.html. The Host :
field indicates the server’s name and /cs453/index.html indicates the file name.
(3) The browser is running HTTP version 1.1, as indicated just before the first pair.
(4) This is a trick question. This 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.

P7 Consider Figure 2.12, for which there is an institutional network connected to the Internet. Suppose that the average object size is 850,000 bits and that the average request rate from the institution’s browsers to the origin servers is 16 requests per second. Also suppose that the amount of time it takes from when the router on the Internet side of the access link forwards an HTTPrequest until it receives the response is three seconds on average (see Section 2.2.5). Model the total average response time as the sum of the average access delay (that is, the delay from Internet router to institution router) and the average Internet delay. For the average access delay, use Δ/(1 – Δ), where Δ is the average time required to send an object over the access link and is the arrival rate of objects to the access link.

a. Find the total average response time.
b. Now suppose a cache is installed in the institutional LAN. Suppose the miss rate is 0.4.Find the total response time.

(1) 总的时延=响应时间+传输时延
a) 通过一个传输速率为R的链路传输长度为L的对象需要的时间是L/R。
平均时间是对象的平均大小除以R:Δ=(900,000bits)/(1,500,000bits/sec)=0.6sec
链路的流量强度是:βΔ=(1.5requests/sec)(0.6sec/request)=0.9.
因此,平均访问时延是:Δ/(1-βΔ)=(0.6sec)/(1-0.9)=6seconds.
因此,总的平均响应时间是:6sec+2sec=8sec.
(b)因为有40%的请求有机构的网络满足,所以访问链路的流量强度减少了40%。
因此平均访问时延是:(0.6sec)/[1–(0.6)(0.9)]=1.2seconds
如果请求由缓存器满足的话,其响应时间近似为0。当
缓存器未命中时,平均响应时间是1.2sec+2sec=3.2sec
因此平均响应时间是:(0.4)(0sec)+(0.6)(3.2sec)=1.92seconds
因此平均响应时间由8sec减少到1.92sec。

P9

Referring to Problem P7, suppose the HTMLfile references three very small objects on the same server. Neglecting transmission times, how much time elapses with
a. Non-persistent HTTPwith no parallel TCPconnections?
b. Non-persistent HTTPwith the browser configured for 5 parallel connections?
c. Persistent HTTP?
a)

b)

c)

  • 13
    点赞
  • 45
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值