Thursday, October 8, 2015

Homework

The homepage of EL PAIS required 327 different http requests (that's 327 different objects, some of them advertising, that are loaded from one or more web servers).

Please answer the following questions:

  1. If that webpage is downloaded using an HTTP 1.0 browser that cannot do parallel downloads, how many RTTs will it take?
  2. Same as 1 but now the browser allows up to 10 parallel downloads to take place.
  3. Now your browsers does use HTTP 1.1 and concurrent persistent connections are enabled on the server. How many RTTs will it take the full download of the page?
  4. Same as 3 but assuming objects are split into two different servers.
  5. Same as 4 if now client and server will use pipelining with 10 up to elements per request.
  6. Same as 5 if now each client can have two connections to each server.
Next lecture we will cover section 2.4 of the book.

Remember class of October 16th is cancelled as I will be out of town (please discuss among your classmates a suitable date for recovering that class. Maybe a Monday that you have an exam scheduled?).


Marking aftermath

None of you got questions 4, 5 or 6 right. That is most likely because the exercise was asking you more than what was explained in the classroom, so let us use some time to fix that:

When a webpage is downloaded from several severs, it means some of the objects of the page come from different servers. When no detail is provided we assume an even distribution of the files across the servers involved. 

But always keep in mind that it all started from a single file download (aka html file) costing 2 RTTs at the very beginning. Failing to remember that detail may get you in trouble.

That is why, question four, that tells us two servers are hosting the 327 files, is solved considering first that first [html] file is obtained from server#1 at a cost of 2RTT and it is then when we learn about the remaining 326 files still to be downloaded. We assume an even distribution, so server#1 contains 163 of them and so does server#2. Persistent connections are being used, no for server#1 there is no need of a new connection, but it is definitely needed for server#2, so it will be this server the one that will end the download later, so let us focus on it: After connection to server#2 is done (at a cost of 1 RTT) the 163 objects are downloaded one after the other through this same connection, totalling 163 RTTs. 

So when we add  2 RTT (first page) + 1 RTT (server#2 connection) + 163 RTT (extra objects) we obtain 166 RTT that is the expected answer. 

Similar reasoning is to be applied to questions 5 and 6.


1 comment:

  1. Answers:

    1) each object will take 2 RTT so total = 327 * 2 = 654 RTT

    2) first object 2 RTT, 326 still to go, so 33 rounds of up to ten objects each, or 33*2=66 plus the initial two makes a total = 66 + 2 =68 RTT

    3) first object 2 RTT, 326 still to go, each one will take an extra RTT so total = 2 + 326 =328 RTT

    4) let's assume the remaining 326 are split in two servers, so total = 2 + 1 + 326/2 = 166 RTT ( the extra RTT is the connection time to the second server )

    5) 2 RTT for initial page, one RTT for the connection to the second server and 17 rounds of pipeline with each server, giving a total = 2 +1 + 17 = 20 RTT

    6) So instead of 163 objects per connection it is 163/2, so total = 2 + 1 + 8 = 11 RTT

    ReplyDelete