Solutions to HW#2 Problem 6. a) Persistent connections are discussed in section 8 of RFC 2616 (the real goal of this question was to get you to retrieve and read an RFC). Sections 8.1.2 and 8.1.2.1 of the RFC indicate that either the client or the server can indicate to the other that it is going to close the persistent connection. It does so by including the including the connectiontoken "close" in the Connection-header field of the http request/reply. b) Please reference - RFC 2616 Section 3.5 Content Coding Note, HTTPS (implementation of HTTP over SSL) is a different protocol from HTTP. Problem 10. Data rage = 150 bits/sec, control Bits = 200 bits Data Packet = 100,000 bits, object length = 100,000 bits Number of object referenced = 10 1 RTT = 2 * 200/150 = 2.667 seconds Time to get raw page = time to get on object = 100,000/150 = 666.667 seconds In non persistent case, total 2RTT + file transmission time is required for getting one object (1 RTT for TCP connection, 1 RTT for request/reply and transmit time). Time for getting one HTML file and 10 objects without parallel connection is that 2 RTT + time to get raw page (HTML page) + 2 RTT + time to get first object + 2 RTT + time to get second object + … + 2 RTT + time to get tenth object. Total time (non persistent without parallel connection) = 11 * ( 2 RTT + time to get one object) = 11 * ( 2 * 2.667 + 666.557) = 7390.801 Time for getting one HTML file and 10 object with parallel connection is that 2 RTT + time to get raw page (HTML page ) + time to get 10 object with parallel connections. If a browser allows 10 parallel connections, the bandwidth of each object is 1/N of the link bandwidth. Therefore, the bandwidth of each object with parallel connection is 15 bit/sec (150 bit/sec / 10). total time is following. Total time (non persistent with 10 parallel connection) = 2 RTT + time to get raw page + 2RTT + time to get one object = 2 * 2.667 + 666.557 + 2 * 26.67 + 6665.57 = 5.334 + 666.557 + 53.34 + 6665.57 = 671.891 + 6718.91 = 7390.801 In persistent case, there will be 1 RTT to set up TCP connection and 1 RTT for request/reply for raw page. Then the raw page will be received. The TCP connection will be retained. Thus objects are obtained without another TCP connection. In non pipelined method, there will be on RTT per object. Total time (persistent with non-pipelined) = 1 RTT ( TCP connection) + 1 RTT (HTML) + time to get raw page (HTML) + 1 RTT (first object request) + time to get first object + …. + 1 RTT (tenth object request) + time to get tenth object = 12 * RTT + 11 * time to get one object = 12 * 2.667 + 11 * 666.557 = 32.004 + 7332.127 = 7364.251 In pipelined method, a browser sends requests as soon as it encounters a reference object. Therefore 1 RTT is enough for all the reference objects. Total time (persistent with pipelined) = 1 RTT ( TCP connection ) + 1 RTT (request HTML) + time to get raw page + 1 RTT (request 10 objects) + time to get first object + … + time to get tenth object = 3 * RTT + 11 * time to get one object = 3 * 2.667 + 11 * 666.557 = 8.001 + 7332.127 = 7340.128 the improvement obtained by using persistent pipelined over non persistent parallel case is not very high Problem 14. 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 ….. S: ….blah S: . C: retr 2 S: blah blah … S: ………..blah S: . C: quit S: +OK POP3 server signing off Problem 15. 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. 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. Problem 21. a) Recall that when a peer has a matching file, it sends a QueryHit message along the reverse path of the corresponding Query message. An alternative design would be for Bob to establish a direct TCP connection with Alice and send the QueryHit message over this connection. What are the advantages and disadvantages of such an alternative design? 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) In this Gnutella protocol, when the peer Alice generate a Query message, it inserts a unique ID in the message’s MessageID field. When the peer Bob has a match, it generates QueryHit message using the same MessageID as the Query message. Describe how peers can use the MessageID field and local routing tables to accomplish reverse-path routing. When a QueryHit 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) An alternative approach, which does not use message identifiers, is as follows. When a query message reaches a peer, before forwarding the message, the peer augments the query message with its IP address. Describe how peers can use thie mechanism to accomplish reverse-path routing. 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.