《计算机网络原理习题答案.doc》由会员分享,可在线阅读,更多相关《计算机网络原理习题答案.doc(13页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、精选优质文档-倾情为你奉上Review QuestionsSection 2.1 1) List five non-proprietary(非专有的) Internet applications and the application-layer protocols that they use. 列举五种非专用的英特网应用以及它们所使用的应用层协议。applicationsprotocolse-mail SMTPWEBHTTPstreaming multimediaHTTP,RTPfile transferFTPremote terminal accessTelnet2) For a comm
2、unication session(会议) between two hosts, which host is the client and which is the server? 对俩主机之间的通信会话,哪个主机是客户机,哪个主机是服务器?The process which initiates(发起) the communication is the client; the process that waits to be contacted is the server.3) What information is used by a process running on one host
3、to identify a process running on another host? 运行在一台主机上的进程使用什么信息标识运行在另一台主机上的进程?The IP address of the destination host and the port number of the destination socket.3) List the various network-application user agents that you use on a daily basis. 列举你每天都会使用的网络应用程序用户代理。Web browser E-mail application u
4、ser agentFile Transfer user agentP2p user agentaudio/video user agent5) Referring to Figure 2.1-2, we see that not none of applications listed in the table require both no data loss and timing. Can you conceive of an application that requires no data loss and that is also highly time sensitive? 参见图2
5、.1-2,我们可以看到表中所列举的应用没有一个既要求没有数据丢失又要求定时。你能设想出一个应用,既既要求没有数据丢失又要求定时吗?There are no good examples of an application that requires no data loss and timing.Sections 2.2-2.5 6) What is meant by a handshaking protocol? 握手协议的意义?A protocol uses handshaking if the two communicating entities first exchange contro
6、l packets before sending data to each other. SMTP uses handshaking at the application layer whereas HTTP does not.7) Why do HTTP, FTP, SMTP, POP3 and IMAP run on top of TCP rather than UDP? 为什么HTTP,FTP,SMTP,POP3 和 IMAP 都运行在TCP 协议而不是UDP协议上?The applications associated with those protocols require that
7、 all application data be received in the correct order and without gaps. TCP provides this service whereas UDP does not.8) Consider an e-commerce site that wants to keep a purchase record for each of its customers. Describe how this can be done with HTTP authentication. (认证)Describe how this can be
8、done with cookies. 考虑一个电子商务网站需要保留每一个客户的购买记录,描述如何使用HTTP认证;描述这是如何用cookies来实现的。When the user first visits the site, the site returns a cookie number. This cookie number is stored on the users host and is managed by the browser. During each subsequent visit (and purchase), the browser sends the cookie n
9、umber back to the site. Thus the site knows when this user (more precisely, this browser) is visiting the site.9) What is the difference between persistent HTTP with pipelining(持久HTTP 流水线) and persistent HTTP without pipelining(没有流水线的持久HTTP连接)? Which of the two is used by HTTP/1.1? In persistent HTT
10、P without pipelining, the browser first waits to receive a HTTP response from the server before issuing a new HTTP request. In persistent HTTP with pipelining, the browser issues requests as soon as it has a need to do so, without waiting for response messages from the server. persistent HTTP with p
11、ipelining is used by HTTP/1.1。10) Telnet into a Web server and send a muli-line 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. 用Telnet 向 web 服务器发送一条多行的请求报文。在该请求报文中包含If-modified-since: 首部行,迫使响应报文中出现
12、304 Not Modified 状态码。11) Why is it said that FTP sends control information out of band?(频带外的)为什么说FTP在“带外“发送控制信息?FTP uses two parallel(平行的) TCP connections, one connection for sending control information (such as a request to transfer a file) and another connection for actually transferring the file.
13、 Because the control information is not sent over the same connection that the file is sent over, FTP sends control information out of band.12) Suppose Alice with a Web-based e-mail account (such as Yahoo! mail or Hotmail) sends a message to Bob, who accesses his mail from his mail server using POP3
14、. Discuss how the message gets from Alices host to Bobs host. Be sure to list the series of application-layer protocols that are used to move the message between the two hosts. 假设Alice使用一个基于web的电子邮件账户向Bob 发送邮件,而Bob使用POP3 协议访问他的邮件服务器来获取邮件。讨论信息是如何从Alice 的主机到Bob的主机的。一定要列出在两台主机间移动信息所用的应用层协议。Message is s
15、ent 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.13) Suppose that you send an e-mail message whose only data is a Microsoft Excel attachment. What migh
16、t the header lines (including MIME lines) look like? 假定你发送一封电子邮件,唯一的数据就是一个表格附件。可能的首部行(包含MIME行)是什么样的?From: 123To: 456Subject: helloMIME-Version: 1.0Content-Transfer-Encoding: base64Content-Type: Application/MS-Excel14) Print out the header of a message that you have recently received. How many Reciev
17、ed: header lines are there? Analyze each of the header lines in the message. 打印出你最近收到的报文的首部,在Received中,首部行有多少行?分析该报文首部行的每一行。15) From a users perspective, what is the difference between the download-and-delete mode and the download-and-keep mode in POP3? 从用户的观点来看,POP3中“下载并删除”模式和“下载并保留”模式有什么区别?With do
18、wnload and delete, after a user retrieves(取回) its messages from a POP server, the messages are deleted. This poses a 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 ar
19、e not deleted after the user retrieves the messages. This can also be inconvenient, as each time the user retrieves the stored messages from a new machine, all of non-deleted messages will be transferred to the new machine (including very old messages).16) Redraw Figure 2.5-4 for when all queries fr
20、om the local nameserver are iterative. 重绘时,从本地域名服务器所有查询迭代图2.5-4。17) Each Internet host will have at least one local name server and one authoratative name server. What role does each of these servers have in DNS? 每一台英特网主机都至少有一个本地域名服务器和一个权威域名服务器。这两种服务器在域名解析中起什么作用?A host authoritative name server prov
21、ides the official translation of a hostname to an IP address (among other things). A host local name server is a proxy(代理服务器) to the DNS system: the host first queries its local name server for a mapping; the local name server then obtains the mapping on the behalf of(代表) the querying host.18) Is it
22、 possible that an organizations Web server and mail server have exactly the same alias(别名) for a hostname (e.g., )? What would be the type for the RR that contains the hostname of the mail server? 一个机构的web服务器和邮件服务器可以有有完全相同的主机别名吗?包含了邮件服务器的主机名的RR有什么样的类型?Yes 。An organization mail server and Web server
23、can have the same alias for a host name. The MX record is used to map the mail server host name to its IP address.19) Use nslookup to find a Web server that has multiple IP addresses. Does the Web server of your institution (school, company, etc.) have multiple IP addresses? 使用nslookup找到一个Web服务器有多个I
24、P地址。贵机构的Web服务器(如学校,公司,等)是否有多个IP地址?My insititution doesnt have multiple IP address.Sections 2.6-2.9 20) The UDP server described in Section 2.7 only needed one socket, whereas the TCP server described in Section 2.6 needed two sockets. Why? If the TCP server were to support n simultaneous(同时发生的) conn
25、ections, each from a different client host, how many sockets would the TCP server need? 2.7节描述的UDP服务器仅需要一个套接字,而2.6节描述的TCP服务器则需要两个套接字。为什么?如果TCP服务器要支持n个并行连接,且每个连接都来自不同的客户机主机,那么TCP服务器需要多少个套接字?With the UDP server, there is no welcoming socket, and all data from different clients enters the server throug
26、h this one socket. 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.21) For the client-server application over TCP described in Se
27、ction 2.6, why must the server program be executed before the client program? For the client-server application over UDP described in Section 2.7, why may the client program be executed before the server program? 在2.6节所描述的运行于TCP上的客户机-服务器应用程序,为什么服务器程序要先于客户机程序运行?在2.7节描述的运行于UDP上的客户机-服务器应用程序,为什么客户机程序要先于
28、服务器程序运行?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 fail to make a connection. For the UDP application, the client does not initiate connections (or attempt to communicate
29、 with the UDP server) immediately upon executionPROBLEMS1) True or false. a) Suppose a user requests a Web page that consists of some text and two images. For this page the client will send one request message and recieve three response messages? 假设一个用户请求一个网页,包含一些文本和两个图像。这个页面的客户端将发送一个请求消息和接收三个响应消息?
30、Fb) True or false. Two distinct Web pages (e.g., www.mit.edu/research.html and www.mit.edu/students.html) can be sent over the same persistent connection? 真或假。两种截然不同的网页(例如,www.mit.edu / research.html和www.mit.edu / students.html)可发送相同的持久连接?Tc) With non-persistent connections between browser and origi
31、n server, it is possible for a single TCP segment to carry two distinct HTTP request messages? 浏览器和源服务器之间的非持久连接,它有可能为一个单一的TCP段进行两个不同的HTTP请求消息?Fd) The Date: header in the HTTP response message indicates when the object in the response was last modified? 日期:在HTTP响应消息头指示的最后修订在响应对象时? F2) Read RFC 959 fo
32、r FTP. List all of the client commands that are supported by the RFC. FTP阅读RFC 959。列出所有的客户端支持的命令是由RFC。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
33、, DELE, RMD, MRD, PWD, LIST, NLST, SITE, SYST, STAT, HELP, NOOP.3) Read RFC 1700. What are the well-known port numbers for the simple file transfer protocol (sftp)? For the network news transfoer protocol (nntp)? 阅读RFC 1700中。什么是“简单文件传输协议”(SFTP)众所周知的端口号?对于“新闻联播transfoer协议”(NNTP)?4) Suppose within you
34、r web browser you click on a link to obtain a web page. Suppose that the IP address for the associated URL is not cached(缓存) in your local host, so that a DNS look up is necessary to obtain the IP address. Suppose that n DNS servers are visited before your host receives the IP address from DNS; the
35、successive visits incur(产生) a RTT of RTT1, ., RTTn. Further suppose that web page associated with the link contains exactly one object, a small amount of HTML text. Let RTT0 denote(表示) the RTT between the local host and the server containing the object. Assuming zero transmission time of the object,
36、 how much time elapses(流逝) from when the client clicks on the link until the client receives the object. 假定在你的浏览器中,你点击一个超链接来获得一个web页面。假定相关的URL的IP地址没有缓存在你的本地主机上,因此必须进行DNS查询以获得IP地址。假设你的主机从DNS获得IP地址之前,已经访问了n个DNS服务器,相继产生的RTT依次为RTT1,RTTn。进一步假设,与连接相关的web网页只含有一个对象,即少量的HTML文本。让RTT0表示本地主机和包含对象的服务器之间的RTT。假设对象
37、传输时间为0,从客户点击连接到接收到对象需要多长时间?The total amount of time to get the IP address is.Once the IP address is known, elapses to set up the TCP connection and another elapses to request and receive the small object. The total response time is4) Referring to question (4), suppose the page contains three very sm
38、all objects. Neglecting transmission times, how much time elapses with (a) nonpersistent HTTP with no parallel TCP connections, (b) nonpersistent HTTP with parallel connections, (c) persistent HTTP with pipelining. 提到的问题(4),假设该页面包含三个非常小的物体。忽略的传输时间,间隔时间多长(一)非持久的HTTP没有并行的TCP连接,(b)与并行连接的非持久的HTTP,(c)与持久
39、HTTP流水线。a) .b) .c) 6) Two HTTP request methods are GET and POST. Are there any other methods in HTTP/1.0? If so, what are they used for? How about HTTP/1.1 ? 两个HTTP请求方法是GET和POST。在HTTP/1.0是否有任何其他的方法?如果是这样,它们是什么使用?关于HTTP/1.1的怎么样?7) Write a simple TCP program for a server that accepts lines of input fr
40、om a client and prints the lines onto the servers standard output. (You can do this by modifying the TCPServer.java program in the text.) Compile and execute your program. On any other machine which contains a Web browser, set the proxy server in the browser to the machine in which your server progr
41、am is running; also configure the port number appropriately. Your browser should now send its GET request messages to your server, and your server should display the messages on its standard output. Use this platform to determine whether your browser generates conditional GET messages for objects th
42、at are locally cached. 写一个简单的TCP服务器接受从客户端的输入线和输出到服务器的标准输出线方案。(您可以通过修改文本TCPServer.java方案。)编译和执行程序。在任何其他机器,其中包含一个Web浏览器,在浏览器中设置代理服务器在您的服务器程序运行的机器,也适当配置的端口号。您的浏览器现在应该GET请求消息发送到您的服务器,您的服务器上显示的消息,它的标准输出。利用这一平台,以确定是否您的浏览器生成本地缓存的对象,有条件的GET消息。8) Read the POP3 RFC, RFC 1939. What is the purpose of the UIDL P
43、OP3 command? 阅读的POP3 RFC,RFC 1939中。UIDL POP3命令的目的是什么?UIDL abbreviates(是的缩写) “unique-ID listing”. 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
44、 a file that lists the messages retrieved in earlier sessions, the client can use the UIDL command to determine which messages on the server have already been seen.8) Install and compile the Java programs TCPClient and UDPClient on one host and TCPServer and UDPServer on another host. a) Suppose you
45、 run TCPClient before you run TCPServer. What happens? Why? b) Suppose you run UDPClient before you run UDPServer. What happens? Why? c) What happens if you use different port numbers for the client and server sides?9) Rewrite TCPServer.java so that it can accept multiple connections. (Hint: You wil
46、l need to use threads.) 重写TCPServer.java,以便它能够接受多个连接。(提示:您将需要使用线程)。DISCUSSION QUESTIONS1) What is a CGI script? Give examples of two popular Web sites that use CGI scripts. Explain how these sites use CGI. Which languages are CGI scripts typically written in? 什么是CGI脚本?给出了两个流行的网站,使用CGI脚本的例子。说明这些网站如何使
47、用CGI。哪些语言是CGI脚本通常写在? Abbreviation ofCommonGatewayInterface, a specification for transferring information between aand a CGI.w can you configure your browser for local caching? What kinds of options do you have? 2) Can you configure your browser to open multiple simultaneous(同时发生的)connections to a We
48、b site? What are the advantages and disadvantages of having a large number of simultaneous TCP connections? 您可以配置您的浏览器打开多个同时连接到一个网站吗?什么是有大量并发的TCP连接的优势和劣势?3) Discussion question: Consider SMTP, POP3 and IMAP. Are these stateless protocols? Why or why not? 讨论的问题:考虑SMTP,POP3和IMAP。这些无状态协议?为什么或为什么不呢?4) We have seen that Internet TCP sockets treat the data being sent as a byte stream but UDP sockets recognize message boundaries. What is one advant