Mohamed G Gouda CS 326E Spring 2013 Homework 1 ------------------------------------------------------------------------------- 1. Consider the transition of one packet P from one router R1 to another router R2 over a subnetwork S. i. Define the transmission delay of P during this hop. ii. Define the propagation delay of P during this hop. iii. Highlight the difference between the transmission delay and propagation delay of P during this hop. Sol: i. It is the time needed to push packet P over subnetwork S. ii. It is the time needed for 1 bit in P to travel from R1 to R2 over S. iii. The first delay depends on the number of bits in P whereas the second delay depends on the physical distance between R1 and R2. ------------------------------------------------------------------------------ 2. A packet travels from router R1 in ISP1 to an adjacent router R2 in ISP2. and then travels to an adjacent router R3 in ISP3. If the level of ISP1 is 1 (indicating that ISP1 is a Tier-1 ISP) and if the level of ISP2 is 2 (indicating that ISP2 is a Regional ISP), what are the possible levels of ISP3? Explain your answer. Sol: The level of ISP3 is either 2 or 3. ISP1 is a provider for the client ISP2. Also, ISP2 is either a peer or a provider for ISP3. Thus, the level of ISP3 is either the same as the level of ISP2 or one plus the level of ISP2. ------------------------------------------------------------------------------ 3. Assume that you are designing a new connection-oriented client-server application, named "X", with many server hosts around the globe. Any human user can use their client host to establish a TCP connection between the "X client" in the client host and the "X server" in any "X server" host. What information does the human user needs to supply to allow its "X client" for the TCP connection to be established? Sol: The human user needs to supply the name of the "X server" host. The "X client" already knows the TCP port of the "X server" and it can use DNS to get the IP address of the "X server" from the name of the "X server" host supplied by the user. ------------------------------------------------------------------------------ 4. One problem of the cookie mechanism in the HTTP protocol is that a user can randomly change the cookie that the user's browser has received from a server, say www.xy.com. This change allows the user to impersonate some other user of server www.xy.com. Describe a method for generating cookies such that if a user randomly changes his cookie, then his chances of successfully impersonating another user is small. Sol: Each cookie consists of 2 parts of K digits each.The server www.xy.com has a secret function F that maps each K-digit number to another K-digit number. Then, each cookie is generated in 2 steps as follows. a) Generate at random, a number N that consists of K digits. b) The cookie is a concatenation of the two K-digit numbers: N and F(N). ------------------------------------------------------------------------------ 5. Consider the case where a proxy server has stored in its memory a web page www.xy.com/hi that it has received at time T from an original server. Explain when the proxy server gets to remove this web page from its memory. Sol : The proxy server removes this web page from its memory in two occasions: a) The proxy server runs out of memory (to store web pages) and time T is the earliest time for a web page that is currently stored in in the proxy server. b) The proxy server sends a (GET www.xy.com/hi if-modified-since T) request to the original server and gets the modified web page at time T', which is later than T. ------------------------------------------------------------------------------