计算机网络原理习题答案.doc_第1页
计算机网络原理习题答案.doc_第2页
计算机网络原理习题答案.doc_第3页
计算机网络原理习题答案.doc_第4页
计算机网络原理习题答案.doc_第5页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Review Questions Section 2.1 1) List five non-proprietary(非专有的)(非专有的) Internet applications and the application-layer protocols that they use. 列举五种非专用的英特网应用以及它们所使用的应用层协议。列举五种非专用的英特网应用以及它们所使用的应用层协议。 applicationsprotocols e-mail SMTP WEBHTTP streaming multimediaHTTP ,RTP file transfer FTP remote terminal access Telnet 2) For a communication 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 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 user agent File Transfer user agent P2p user agent audio/video user agent 5) 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.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 control 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 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 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 number 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 HTTP 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 pipelining 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: 首部行,迫使响应报文中出现首部行,迫使响应报文中出现 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. 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. 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 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. 13) Suppose that you send an e-mail message whose only data is a Microsoft Excel attachment. What might the header lines (including MIME lines) look like? 假定你发送一封电子邮件,唯一的数据就是一个表格附件。可能的首部行(包含假定你发送一封电子邮件,唯一的数据就是一个表格附件。可能的首部行(包含 MIME 行)是什么行)是什么 样的?样的? From: 123 To: 456 Subject: hello MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Type: Application/MS-Excel 14) Print out the header of a message that you have recently received. How many Recieved: 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 download 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 are 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 from 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 provides 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 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 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 服务器有多个服务器有多个 IP 地址。贵机构的地址。贵机构的 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(同时发生的)(同时发生的) connections, 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 through 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 Section 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 上的客户机上的客户机-服务器应用程序,为什么客户机程序要先于服务器服务器应用程序,为什么客户机程序要先于服务器 程序运行?程序运行? 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 with the UDP server) immediately upon execution PROBLEMS 1) 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? 假设一个用户请求一个网页,包含一些文本和两个假设一个用户请求一个网页,包含一些文本和两个 图像。这个页面的客户端将发送一个请求消息和接收三个响应消息?图像。这个页面的客户端将发送一个请求消息和接收三个响应消息? F b) True or false. Two distinct Web pages (e.g., /research.html and /students.html) can be sent over the same persistent connection? 真或假。两种截然不同的网页(例真或假。两种截然不同的网页(例 如,如, / research.html 和和 / students.html)可)可 发送相同的持久连接?发送相同的持久连接? T c) With non-persistent connections between browser and origin server, it is possible for a single TCP segment to carry two distinct HTTP request messages? 浏览器和源服务器之间的非持久连接,它有可能为一个单一的浏览器和源服务器之间的非持久连接,它有可能为一个单一的 TCP 段进行两个不同的段进行两个不同的 HTTP 请求消息?请求消息? F d) The Date: header in the HTTP response message indicates when the object in the response was last modified? 日期:日期: 在在 HTTP 响应消息头指示的响应消息头指示的 最后修订在响应对象时?最后修订在响应对象时? F 2) Read RFC 959 for 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, 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 your 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 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, 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。假设对象传输时间为。假设对象传输时间为 0,从客户点击连接到接收到对象需要多长时间?,从客户点击连接到接收到对象需要多长时间? The total amount of time to get the IP address is . n RTTRTTRTT 21 Once the IP address is known, elapses to set up the TCP connection and O RTT another elapses to request and receive the small object. The total response time O RTT is no RTTRTTRTTRTT 21 2 4) Referring to question (4), suppose the page contains three very small 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)与持久)与持久 HTTP 流水线。流水线。 a) oon RTTRTTRTTRTT232 1 . no RTTRTTRTT 1 8 b) oon RTTRTTRTTRTT22 1 . no RTTRTTRTT 1 4 c) oon RTTRTTRTTRTT2 1 no RTTRTTRTT 1 3 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 from 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 program 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 that are locally cached. 写一个简单的写一个简单的 TCP 服务器接受从客户端的输入线和输出到服务器的标准输出线方案。(您可以通过服务器接受从客户端的输入线和输出到服务器的标准输出线方案。(您可以通过 修改文本修改文本 TCPServer.java 方案。)编译和执行程序。在任何其他机器,其中包含一个方案。)编译和执行程序。在任何其他机器,其中包含一个 Web 浏浏 览器,在浏览器中设置代理服务器在您的服务器程序运行的机器,也适当配置的端口号。您的浏览器览器,在浏览器中设置代理服务器在您的服务器程序运行的机器,也适当配置的端口号。您的浏览器 现在应该现在应该 GET 请求消息发送到您的服务器,您的服务器上显示的消息,它的标准输出。利用这一平请求消息发送到您的服务器,您的服务器上显示的消息,它的标准输出。利用这一平 台,以确定是否您的浏览器生成本地缓存的对象,有条件的台,以确定是否您的浏览器生成本地缓存的对象,有条件的 GET 消息。消息。 8) Read the POP3 RFC, RFC 1939. What is the purpose of the UIDL POP3 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 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 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 will need to use threads.) 重写重写 TCPServer.java,以便它能够接受多个连接。(提示:您将需要使用线程)。,以便它能够接受多个连接。(提示:您将需要使用线程)。 DISCUSSION QUESTIONS 1) What is a CGI script? Give examples of two popular

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论