⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 homeworka_chapter2.txt

📁 经典网络教程 自顶向下网络第三版课后习题的答案~~
💻 TXT
字号:
Chapter 2
 
Review Questions

1.
1)The Web: HTTP; 
2)file transfer: FTP; 
3)remote login: Telnet; 
4)Network News: NNTP; 
5)e-mail: SMTP.

2.Network architecture refers to the organization of the communication process into layers (e.g., the five-layer Internet architecture). Application architecture, on the other hand, is designed by an application developer and dictates the broad structure of the application (e.g., client-server or P2P).

3.With Instant Messaging, typically  the initiator contacts a centralized server to locate the address (IP address) of the receiver: client server model. After this, the instant messaging can be peer to peer – the messages between the two communicating parties are sent directly between them.

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

5.No. As stated in the text, all communication sessions have a client side and a server side. In a P2P file-sharing application, the peer that is receiving a file is typically the client and the peer that is sending the file is typically the server.

6.The IP address of the destination host and the port number of the destination socket.

9.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.

10.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.

11.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.

12.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.

15.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.

16.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's mail server then transfers the message to his host over POP3.

18.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).

19.Yes, an organization's mail server and Web server can have the same alias for a host name. The MX record is used to map the mail server's host name to its IP address.

20.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 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 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.

22.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.

23.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

2.Please visit http://www.ietf.org --> RFC Pages --> RFC number:959
1)Access control commands:
USER, PASS, ACCT, CWD, CDUP, SMNT, REIN, QUIT.

2)Transfer parameter commands:
PORT, PASV, TYPE STRU, MODE.

3)Service commands:
RETR, STOR, STOU, APPE, ALLO, REST, RNFR, RNTO, ABOR, DELE, RMD, MKD, PWD, LIST, NLST, SITE, SYST, STAT, HELP, NOOP.

3.Please visit http://www.iana.org --> Most Popular Links --> TCP and UDP Port Numbers

4.
Application layer protocols: DNS and HTTP
Transport layer protocols: UDP for DNS; TCP for HTTP

5.
Persistent connections are discussed in section 8 of RFC 2616. 
encryption services are discussed in section 15 of RFC 2616. 

6.
1) The total amount of time to get the IP address is:
	RTT1 + RTT2 + ... + RTTn
2) Once the IP address is known, RTT0 elapses to set up the TCP connection and another RTT0 elapses to request and receive the small object. 
3) The total response time is:
	RTT1 + RTT2 + ... + RTTn + 2RTT0

7. 
a)	RTT1 + RTT2 + ... + RTTn + 2RTT0 + 3 x 2RTT0
b)	RTT1 + RTT2 + ... + RTTn + 2RTT0 + 2RTT0
c)	RTT1 + RTT2 + ... + RTTn + 2RTT0 + RTT0     

8.
Method Definitions are discussed in section 8 of RFC 1945.
HTTP/1.0: GET, POST, HEAD.

Method Definitions are discussed in section 9 of RFC 2616.
HTTP/1.1: GET, POST, HEAD, OPTIONS, PUT, DELETE, TRACE, CONNECT.

Please see RFCs for explanations.

9.
a)
The time to transmit an object of size L over a link (rate R) is L/R. 
The average time is the average size of the object divided by R: 
	(900,000 bits)/(1,500,000 bits/sec) = .6 sec
The arrival rate of objects to the access link equals to the average request rate from the institution'browsers to the origin servers, so is 1.5 requests/sec.
Thus, the average access delay is:
	.6/(1 -.6x1.5) = 6 seconds
The total average response time is therefore:
	6 sec + 2 sec = 8 sec

b)The traffic intensity on the access link is reduced by 40% since the 40% of the requests are satisfied within the institutional network. 
Thus the average access delay is:
	.6/(1 –.6x1.5x.6) = 1.2 sec
Thus for the request is satisfied by the cache (which happens with probability .4), the total response time that is 1.2 seconds is approximately zero. For the request is missed by the cache (which happens 60% of the time),the total average response time is:
	1.2 sec + 2 sec = 3.2 sec 
So the total average response time is:
	.4x0 + .6x3.2 = 1.92 seconds. 
Thus with the cache the average response time is reduced from 8 sec to 1.92 sec.

11.
UIDL are discussed in section 7 of RFC 1939.
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.

12.
a)  C: dele 1
    C: retr 2
    S: (blah blah …
    S: ………blah
    S: .
    C: dele 2
    C: quit
    S: +OK POP3 server signing off

b)  C: retr 2
    S: blah blah …
    S: ………blah
    S: .
    C: quit
    S: +OK POP3 server signing off

c)  C: list
    S: 1 498
    S: 2 912
    S: .
    C: retr 1
    S: blah blah …
    S: ………blah
    S: .
    C: retr 2
    S: blah blah …
    S: ………blah
    S: .
    C: quit
    S: +OK POP3 server signing off

13.
a) For a given input of domain name (such as ccn.com), IP address or network administrator name, whois database can be used to locate the corresponding registrar, whois server, DNS server, and so on.

b) http://ewhois.cnnic.net.cn (China Internet Network Information Center)
   http://whois.com
   http://whois.sc
   http://www.domaintools.com
   http://arin.com
   http://dnsstuff.com

f) An attacker can use the whois database and nslookup tool to determine the IP address ranges, DNS server addresses, etc., for the target institution.
g) By analyzing the source address of attack packets, the victim can use whois to obtain information about domain from which the attack is coming and possibly inform the administrators of the origin domain. 

16.
a) In this case, each of the five Gnutella clients immediately learns that it has one less neighbor. 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 connection attempt.

b) In this case, Bob does not immediately know that X has departed. Bob will only learn about X’s departure when it attempts to send a message (query or ping) to X. When Bob attempts to send a message, Bob’s TCP will make several unsuccessful attempts to send the message to B. Bob’s TCP will 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 fourth connection.

17.
a) The advantage of sending the QueryHit message directly over a TCP connection from Bob to Alice is that the QueryHit message 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 opens 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 Query 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 receives a QueryHit message with the same MessageID, it indexes the table and determines the socket to which it should forward the message. 

c) When the Query message reaches Bob, it contains an ordered list of all the IP addresses of the peers the message passed through between Alice and Bob. When Bob sends back a QueryHit message, it would copy the ordered  list into the message. When a peer receives the QueryHit message, it can use the list to determine the next peer in the reverse path.

21.
a) If you run TCPClient first, then the client will attempt to make a TCP connection with a non-existent server process. A TCP connection will not be made.

b) UDPClient doesn't establish a TCP connection with the server. Thus, everything should work fine if you first run UDPClient, then run UDPServer, and then type some input into the keyboard.

c) If you use different port numbers, then the client will attempt to establish a TCP connection with the wrong process or a non-existent process. Errors will occur.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -