129k views
1 vote
Consider an HTTP server and client. Suppose that the RTT delay between the client and server is 10 msecs; the time a server needs to transmit an object into its outgoing link is 0.5 msecs; and any other HTTP message not containing an object has a negligible (zero) transmission time. Suppose the client again makes 100 requests, one after the other, waiting for a reply to a request before sending the next request. Assume the client is using HTTP 1.1 and the IF-MODIFIED-SINCE header line. Assume 30% of the objects requested have NOT changed since the client downloaded them (before these 100 downloads are performed). How much time elapses (in milliseconds) between the client transmitting the first request, and the completion of the last request?

1 Answer

2 votes

Final answer:

To calculate the total time elapsed, consider the time taken by the server to transmit the object and the time taken by the client to wait for a reply before sending the next request. Use the IF-MODIFIED-SINCE header line to avoid requesting unchanged objects. Add the time for transmitting changed objects and the time for unchanged objects to get the total time elapsed.

Step-by-step explanation:

To calculate the total time elapsed, we need to consider two factors: the time taken by the server to transmit the object and the time taken by the client to wait for a reply before sending the next request

For each request, the client sends the request to the server and waits for the server's response. Here's the breakdown:

  1. Time taken by the server to transmit the object: 0.5 msecs
  2. RTT delay between the client and server (round trip time): 10 msecs
  3. Time for the server to process the request and generate the response: negligible (zero) transmission time for any HTTP message not containing an object
  4. Client waiting for the server's response: RTT delay

Given that 30% of the objects requested have not changed, the client can use the IF-MODIFIED-SINCE header line to avoid requesting those objects and receive a 304 Not Modified response from the server.

Since the client waits for a reply before sending the next request, the total time elapsed can be calculated as follows:

  1. Total time for transmitting the objects that have changed: (100 - 30) * (0.5 msec + RTT delay)
  2. Time for the 30% of objects that have not changed: 30 * RTT delay

Adding these two times together gives the total time elapsed between the client transmitting the first request and the completion of the last request

User Mihriban Minaz
by
7.9k points