2. 第二章课后习题及答案 联系客服

发布时间 : 星期三 文章2. 第二章课后习题及答案更新完毕开始阅读8fcc0acdb9f67c1cfad6195f312b3169a451ea1d

第二章

1. (Q2)For a communication session between a pair of processes, which process is the client and which is the server?

Answer:The process which initiates the communication is the client; the process that waits to be contacted is the server. .

2. (Q3) What is the difference between network architecture and application architecture?

Answer: Network architecture refers to the organization of the communication processintolayers (e.g., the five-layer Internet architecture). Application architecture, on the other hand, is designed by an application developer and dictates the broadstructure of the application (e.g., client-server or P2P)

3. (Q4) What information is used by a process running on one host to identify a process running on another host?

Answer: The IP address of the destination host and the port number of the destinationsocket.

4. (Q6) Referring to Figure 2.4, we see that none of the application 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?

Answer: There are no good example of an application that requires no data loss and timing. If you know of one, send an e-mail to the authors

5. (Q9) Why do HTTP, FTP, SMTP, and POP3 run on top of TCP rather than on UDP?

Answer: The applications associated with those protocols require that all application databe received in the correct order and without gaps. TCP provides this servicewhereas UDP does not.

6. (Q11) What is meant by a handshaking protocol?

Answer: A protocol uses handshaking if the two communicating entities first exchangecontrol packets before sending data to each other. SMTP uses handshaking at theapplication layer whereas HTTP does not.

7. (Q13) 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.

Answer: Issued the following command (in Windows command prompt) followed by theHTTP GET message to the “utopia.poly.edu” web server: > telnet utopia.poly.edu 80

Since the index.html page in this web server was not modified since Fri, 18 May2007 09:23:34 GMT, the following output was displayed when the abovecommands were issued on Sat, 19 May 2007. Note that the first 4 lines are theGET message and header lines input by the user and the next 4 lines (startingfrom HTTP/1.1 304 Not Modified) is the response from the web server.

8. (Q14) 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.

Answer: When the user first visits the site, the site returns a cookie number. This cookie number is stored on the user’s 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. (Q15) Suppose Alice, with a Web-based e-mail account (such as Hotmail or gmail), sends a message to Bob, who accesses his mail from his mail server using POP3. Discuss how the message gets from Alice’s host to Bob’s host. Be sure to list the series of application-layer protocols that are used to move the message between the two hosts.

Answer: Message is sent from Alice’s host to her mail server over HTTP. Alice’s mail server then sends the message to Bob’s mail server over SMTP. Bob then transfers the message from his mail server to his host over POP3.

10. (Q10) Recall that TCP can be enhanced with SSL to provide process-to-process security services, including encryption. Does SSL operate at the transport layer or the application layer? If the application developer wants TCP to be enhanced with SSL, what does the developer have to do?

Answer: SSL operates at the application layer. The SSL socket takes unencrypted data fromthe application layer, encrypts it and then passes it to the TCP socket. If theapplication developer wants TCP to be enhanced with SSL, she has to include theSSL code in the application.

11. (Q16) Print out the header of an e-mail message you have recently received. How many Received: header lines are there? Analyze each of the header lines in the message.

Answer: from 65.54.246.203 (EHLO bay0-omc3-s3.bay0.hotmail.com)

Received: (65.54.246.203) by mta419.mail.mud.yahoo.com with SMTP; Sat, 19 May 2007

16:53:51 -0700

from hotmail.com ([65.55.135.106]) by bay0-omc3-s3.bay0.hotmail.com

Received: with Microsoft SMTPSVC(6.0.3790.2668); Sat, 19 May 2007 16:52:42 -0700

Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat,19 May

2007 16:52:41 -0700

Message-ID:

Received: from 65.55.135.123 by by130fd.bay130.hotmail.msn.com with HTTP; Sat, 19 May

2007 23:52:36 GMT

From: \To: prithula@yahoo.com Bcc:

Subject: Test mail

Date: Sat, 19 May 2007 23:52:36 +0000 Mime-Version:1.0

Content-Type: Text/html; format=flowed

Return-Path: prithuladhungel@hotmail.com

Figure: A sample mail message header

Received: This header field indicates the sequence in which the SMTP serverssend and receive the mail message including the respective timestamps.

In this example there are 4 “Received:” header lines. This means the mailmessage passed through 5 different SMTP servers before being delivered to thereceiver’s mail box. The last (forth) “Received:” header indicates the mailmessage flow from the SMTP server of the sender to the second SMTP server inthe chain of servers. The sender’s SMTP server is at address 65.55.135.123 andthe second SMTP server in the chain is by130fd.bay130.hotmail.msn.com.The third “Received:” header indicates the mail message flow from the secondSMTP server in the chain to the third server, and so on.

Finally, the first “Received:” header indicates the flow of the mail message fromthe forth SMTP server to the last SMTP server (i.e. the receiver’s mail server) inthe chain.

Message-id: The message has been given this

numberBAY130-F26D9E35BF59E0D18A819AFB9310@phx.gbl(bybay0-omc3-s3.bay0.hotmail.com. Message-id is a unique string assigned by the mail systemwhen the message is first created.

From: This indicates the email address of the sender of the mail. In the given example, the sender is prithuladhungel@hotmail.com

To: This field indicates the email address of the receiver of the mail. In theexample, the receiver is prithula@yahoo.com

Subject: This gives the subject of the mail (if any specified by the sender). In theexample, the subject specified by the sender is “Test mail”

Date: The date and time when the mail was sent by the sender. In the example,the sender sent the mail on 19th May 2007, at time 23:52:36 GMT.

Mime-version: MIME version used for the mail. In the example, it is 1.0.

Content-type: The type of content in the body of the mail message. In theexample, it is “text/html”.

Return-Path: This specifies the email address to which the mail will be sent if the receiver of this mail wants to reply to the sender. This is also used by the sender’s mail server for bouncing back undeliverable mail messages of mailer-daemon error messages. In the example, the return path is “prithuladhungel@hotmail.com”.

12. (Q18) Is it possible for an organization’s Web server and mail server to have exactly the same alias for a hostname (for example, foo.com)? What would be the type for the RR that contains the hostname of the mail server?

Answer: Yes an organization’s mail server and Web server can have the same alias for ahost name. The MX record is used to map the mail server’s host name to its IPaddress.

13. (Q19) Why is it said that FTP sends control information “out-of-band”?

Answer:FTP uses two parallel TCP connections, one connection for sending controlinformation (such as a request to transfer a file) and another connection foractually transferring the file. Because the control information is not sent over thesame connection that the file is sent over, FTP sends control information out ofband.

14. (P6) Consider an HTTP client that wants to retrieve a Web document at a given URL. The IP address of the HTTP server is initially unknown. What transport and application-layer protocols besides HTTP are needed in this scenario?

Answer:

Application layer protocols: DNS and HTTP

Transport layer protocols: UDP for DNS; TCP for HTTP

15. (P9) Consider Figure2.12, for which there is an institutional network connected to the