Test 3 Review B: Questions

R3b.1.

When a user requests a URL like http://ozark.hendrix.edu/filename.txt, what does the browser do to retrieve the file via HTTP?

R3b.2.

What does SPDY change from HTTP that leads to better performance?

R3b.3.

Give one reason why the SPDY protocol tends to perform substantially better than HTTP in situations where a fair number of packets (say 2%) are dropped?

R3b.4.

Suppose each track on a one-platter, two-head disk has 100 sectors, numbered from 0. Which takes longer: The time to read sector 1 and then sector 199, or the time to read 199 and then 201? Why?

R3b.5.

Suppose the disk previously served a request at track 50 before going to track 52 to serve another request. It has six outstanding requests that have arrived in this order:

47, 1, 58, 82, 35, 100

What order will these be served with each of the following algorithms?

a.FIFO
b.SSTF
c.SCAN
R3b.6.

Suppose we have a disk of 10 sectors, numbered 2 through 9, with the following three files occupying sectors as listed.

a.txt:8, 4, 9
b.txt:6, 3, 7
b.txt:5

What would the FAT contents be (using 0 to indicate end of file, 1 to indicate unused)?

R3b.7.

Suppose we had an i-node based filesystem using 512-byte sectors, where each i-node contains the identifiers of 11 sectors followed by the identifier of a single-indirect sector followed by the identifier of a double-indirect sector. Each sector identifier fits into four bytes. What is the maximum number of bytes a file may contain?

Test 3 Review B: Solutions

R3b.1.

The browser opens a TCP connection to port 80 on the server ozark.hendrix.edu, sending it a message like the following.

GET /filename.txt HTTP/1.1
Host: ozark.hendrix.edu
   a blank line terminates its request

It then awaits a response from the server, which will include a header describing the requested file, followed by a blank line, followed by the file contents.

R3b.2.

It combines three changes over HTTP.

  • Requests and response headers are sent using text compression, so that fewer bits are sent each way.

  • Multiple requests can be sent simultaneously over the same TCP connection for the server to process. The server can multitask in retrieving information for these requests: As it finds data for a request, it can send fragments of its response labeled with what request it is responding too.

  • The browser can suggest to the server which requests are most important to handle first.

R3b.3.
  • A typical Web page requires about 80 different resources, which with HTTP would typically be done with 80 different TCP connections. Whenever a packet is lost during any of these TCP connections' open-connection phase, TCP will wait several seconds before timing out and attempting again. By contrast, SPDY uses just one TCP connection, so losing a packet during the open-connection phase is much less likely.

  • Because SPDY's single TCP connection is long-lived, it will have time to adapt to the proper window size. Consequently, when a packet is lost, it will typically be identified through fast retransmit. By contrast, a lost packet with a short-lived HTTP request is likely to happen when the window size is still quite small, and the lost packet is more likely to lead to resetting the window size to 1 and undergoing slow start again.

R3b.4.

It is faster to move from 1 to 199: These are on the same cylinder (the same track, except on opposite sides of the platter), so the only time delay is the time for the platter to rotate nearly one full rotation. By contrast, in moving from 199 to 201, the disk must first move the head one track over and then wait for the platter to rotate back around.

R3b.5.
a.FIFO: 47, 1, 58, 82, 35, 100
b.SSTF: 47, 58, 35, 1, 82, 100
c.SCAN: 58, 82, 100, 47, 35, 1
R3b.6.
indexdata
FAT[2]1
FAT[3]7
FAT[4]9
FAT[5]0
FAT[6]3
FAT[7]0
FAT[8]4
FAT[9]0
R3b.7.

Each indirect sector contains 512/4 = 128 sector identifiers. So the i-node may contain 11 sector identifiers, the single-indirect sector 128 identifiers, and the double-indirect sector 128² = 218 = 256K identifiers, for a total of 11 + 128 + 262,144 = 262,283 sectors. Each sector has 512 bytes, for a total of 262,283 × 512 = 134,288,896 bytes. [No, you wouldn't be expected to figure this out without a calculator.]