Twenty-seven review questions and thirty-two problems, every numeric answer computed rather than copied — including one problem that cannot be solved as printed.
How to use this page
- Attempt first. A numeric answer reveals its working once you get it right, or when you explicitly ask. An open question hides behind “think first”. A solution read too early is a solution not learned.
- Numeric answers accept a 1 % tolerance by default, so rounding as you go is fine.
- Where a problem asks you to run something on your own machine, the solution says so plainly. It tells you what to look for rather than pretending to know your output.
Why this matters
Chapter 2’s ideas are easy to nod along with and hard to apply. The difference shows up here. P8 asks you to count round trips and P13 asks you to count HTTP/2 frames, and both are three-line calculations that are wrong if one detail is missed.
Two problems are worth doing even if you skip the rest. P9 contains a genuine flaw, and finding it teaches more than solving it would have. P22 puts real numbers on self-scalability and shows the binding constraint moving as the peers get faster.
Review questions
Review Questions R1–R27
The book's own review questions. Answer before revealing — a solution read too early is a solution not learned.
R1List five nonproprietary Internet applications and the application-layer protocols they use.
Name five, with their protocols.
Hint: Figure 2.5 lists most of them.
R2What is the difference between network architecture and application architecture?
State the difference, and say who decides each.
R3For a communication session between a pair of processes, which process is the client and which is the server?
Which is the client?
R4For a P2P file-sharing application, do you agree with the statement "There is no notion of client and server sides of a communication session"? Why or why not?
Agree or disagree, and justify.
R5What information is used by a process running on one host to identify a process running on another host?
Name both pieces, and say what each one narrows down.
R6Suppose you wanted to do a transaction from a remote client to a server as fast as possible. Would you use UDP or TCP? Why?
Which, and why?
R7Referring to Figure 2.4, none of the applications listed requires both no data loss and timing. Can you conceive of an application that requires no data loss and is also highly time-sensitive?
Give an example, and say why both requirements are genuine.
R8List the four broad classes of services a transport protocol can provide. For each, indicate whether UDP or TCP (or both) provides it.
All four, with which protocol provides each.
R9TLS can enhance TCP with process-to-process security. Does TLS operate at the transport layer or the application layer? What must a developer do to use it?
a.Which layer?
b.What must the developer do?
R10What is meant by a handshaking protocol?
Define it, and give one example from this chapter.
R11Why do HTTP, SMTP and IMAP run on top of TCP rather than UDP?
Give the reason.
R12Consider an e-commerce site that wants to keep a purchase record for each of its customers. Describe how this can be done with cookies.
Describe the mechanism, naming all four components.
R13Describe how Web caching can reduce the delay in receiving a requested object. Will it reduce the delay for all objects requested by a user, or only some? Why?
Explain both halves.
R14Telnet into a Web server and send a multiline request message including an If-modified-since: header line, to force a 304 Not Modified response.
Write the request you would send, and say what you expect back.
R15List several popular messaging apps. Do they use the same protocols as SMS?
Name some, and answer the question.
R16Alice, with a web-based e-mail account, sends a message to Bob, who reads his mail using IMAP. Describe how the message gets from Alice's host to Bob's host, listing the application-layer protocols used.
List the three hops and the protocol on each.
R17Print out the header of an e-mail message you have recently received. How many Received: header lines are there? Analyse each of them.
Do it with a real message, then read the solution for what to look for.
R18What is the head-of-line blocking issue in HTTP/1.1? How does HTTP/2 attempt to solve it?
Describe the problem and the solution.
R19Is it possible for an organisation's Web server and mail server to have exactly the same alias for a hostname, for example foo.com? What would be the type of the RR that contains the hostname of the mail server?
a.Is it possible?
b.Which record type holds the mail server's hostname?
R20Look at the header of a message sent from a .edu address. Can you determine the IP address of the host it was sent from? Do the same for a message from a Gmail account.
Try it, then read what to expect.
R21In BitTorrent, suppose Alice provides chunks to Bob throughout a 30-second interval. Will Bob necessarily return the favour in that same interval? Why or why not?
Necessarily?
R22A new peer Alice joins a torrent with no chunks. Without chunks she cannot become a top-four uploader for anyone. How will she get her first chunk?
Name the mechanism and explain why it exists.
R23What is an overlay network? Does it include routers? What are the edges in the overlay network?
Answer all three parts.
R24CDNs typically adopt one of two server placement philosophies. Name and briefly describe them.
Name both and give the trade-off.
R25Besides network considerations such as delay, loss and throughput, what other important factors go into designing a CDN server selection strategy?
Name several.
R26The UDP server needed only one socket; the TCP server needed two. Why? If the TCP server supported n simultaneous connections from n different client hosts, how many sockets would it need?
a.Explain the difference.
b.How many sockets for n simultaneous connections?
see solutionR27For the TCP application, why must the server program be executed before the client? For the UDP application, why may the client be executed first?
Explain both cases.
Problems
Problems P1–P32
Every numeric answer here was computed rather than copied. Where a problem cannot be solved as printed, the solution says so.
P1True or false?
a.A user requests a page of text and three images. The client sends one request message and receives four response messages.
b.Two distinct Web pages can be sent over the same persistent connection.
c.With non-persistent connections, a single TCP segment can carry two distinct HTTP request messages.
d.The Date: header in a response indicates when the object was last modified.
e.HTTP response messages never have an empty message body.
P2SMS, iMessage, WeChat and WhatsApp are all smartphone real-time messaging systems. Research the protocols they use, then explain how they differ.
Research question — write your findings, then compare with the outline.
P3An HTTP client wants to retrieve a document at a given URL. The IP address of the server is initially unknown. What transport and application-layer protocols besides HTTP are needed?
Name them, and say what each is for.
P4A captured HTTP GET message. Answer each question, and say where in the message you found the answer.
GET /cs453/index.html HTTP/1.1<cr><lf>Host: gaia.cs.umass.edu<cr><lf>User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)<cr><lf>Accept: ext/xml, application/xml, application/xhtml+xml, text/html;q=0.9, text/plain;q=0.8, image/png, */*;q=0.5<cr><lf>Accept-Language: en-us,en;q=0.5<cr><lf>Accept-Encoding: zip,deflate<cr><lf>Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7<cr><lf>Keep-Alive: 300<cr><lf>Connection: keep-alive<cr><lf><cr><lf>
a.What is the URL of the document requested?
b.What version of HTTP is the browser running?
c.Does the browser request a non-persistent or a persistent connection?
d.What is the IP address of the host on which the browser is running?
e.What type of browser initiates this message, and why is the browser type needed?
P5The server's reply to the previous request. Answer each question, indicating where in the message you find the answer.
HTTP/1.1 200 OK<cr><lf>Date: Tue, 07 Mar 2008 12:39:45 GMT<cr><lf>Server: Apache/2.0.52 (Fedora)<cr><lf>Last-Modified: Sat, 10 Dec 2005 18:27:46 GMT<cr><lf>ETag: "526c3-f22-a88a4c80"<cr><lf>Accept-Ranges: bytes<cr><lf>Content-Length: 3874<cr><lf>Keep-Alive: timeout=max=100<cr><lf>Connection: Keep-Alive<cr><lf>Content-Type: text/html; charset=ISO-8859-1<cr><lf><cr><lf><!doctype html public "-//w3c//dtd html 4.0 transitional//en"><lf><html><lf><head> …
a.Did the server find the document? What time was the reply provided?
b.When was the document last modified?
c.How many bytes are in the document being returned?
bytesd.What are the first 5 bytes of the document? Did the server agree to a persistent connection?
P6Obtain the HTTP/1.1 specification and answer the following.
a.How is the closing of a persistent connection signalled? Can the client, the server, or both signal it?
b.What encryption services are provided by HTTP?
c.Can a client open three or more simultaneous connections with a given server?
d.Is it possible for one side to start closing a connection while the other is transmitting data on it?
P7You click a link. The IP address is not cached locally, so n DNS servers are visited, incurring RTT₁ … RTTₙ. The page contains exactly one small object. RTT₀ is the round-trip time to the object's server. Assuming zero transmission time, how much time elapses from the click until the object is received?
Give the expression, and say what each term is for.
Hint: Count the DNS lookups, the TCP handshake, and the request and response.
P8Referring to P7, suppose the HTML file references eight very small objects on the same server. Neglecting transmission times, how much time elapses?
Write each answer as a multiple of RTT₀, added to the DNS sum from P7. Enter just the number of RTT₀ terms.
a.Non-persistent HTTP with no parallel TCP connections — how many RTT₀?
× RTT₀b.Non-persistent HTTP with the browser configured for 6 parallel connections — how many RTT₀?
× RTT₀c.Persistent HTTP — how many RTT₀?
× RTT₀P9Consider Figure 2.12. The average object size is 1,000,000 bits and the average request rate is 16 requests per second. The Internet delay is 3 seconds. Model the total average response time as the average access delay plus the average Internet delay, using Δ/(1 − Δβ) for the access delay.
Δ is the average time to send an object over the 15 Mbps access link; β is the arrival rate of objects to that link.
a.Find the total average response time.
Hint: Work out Δβ first, and look hard at the number you get.
b.Now install a cache in the institutional LAN with a miss rate of 0.4. Find the total response time.
sP10A 10-metre link carries 150 bits/s in both directions. Data packets are 100,000 bits; control packets are 200 bits. N parallel connections each get 1/N of the link rate. Each downloaded object is 100 kbits, and the initial object references 10 more from the same sender. Would parallel non-persistent downloads make sense? Would persistent HTTP give significant gains?
Answer both questions, with the numbers that decide them.
Hint: Compare the time to transmit one object with the time to exchange a few control packets.
P11Same scenario as P10. Now the link is shared by Bob and four other users. Bob uses parallel instances of non-persistent HTTP; the other four use non-persistent HTTP without parallel downloads.
a.Do Bob's parallel connections help him get Web pages more quickly? Why or why not?
b.If all five users open five parallel instances, would Bob's parallel connections still be beneficial?
P12Write a simple TCP server that accepts lines of input from a client and prints them to standard output. Point a browser's proxy setting at it, and use it to see whether your browser generates conditional GET messages for cached objects.
Write the program, then read the solution for what to look for.
P13A Web page consists of one video clip and five images, sent over HTTP/2. The video is 2000 frames and each image is three frames.
a.If all the video frames are sent first without interleaving, how many frame times until all five images are sent?
frame timesb.If frames are interleaved, how many frame times until all five images are sent?
frame timesP14The same page as P13, but now HTTP/2 prioritization is used. All images are given priority over the video clip, the first image over the second, the second over the third, and so on. How many frame times until the second image is sent?
How many frame times?
frame timesP15What is the difference between MAIL FROM: in SMTP and From: in the mail message itself?
State the difference clearly.
P16How does SMTP mark the end of a message body? How about HTTP? Can HTTP use the same method as SMTP?
Answer all three parts.
P17Read RFC 5321. What does MTA stand for? Given the spam message headers below, and assuming only the originator is malicious, identify the malicious host.
Received: from barmail.cs.umass.edu ([128.119.240.3]) by cs.umass.edu … Received: from asusus-4b96 (localhost [127.0.0.1]) by barmail.cs.umass.edu (Spam Firewall) … Received: from asusus-4b96 ([58.88.21.177]) by barmail.cs.umass.edu … Received: from [58.88.21.177] by inbnd55.exchangeddd.com …
a.What does MTA stand for?
b.Which host generated the spam?
P18Questions about whois databases and nslookup.
a.What is a whois database?
b.Parts (b) to (e) ask you to run whois and nslookup yourself.
c.How can an attacker use whois and nslookup for reconnaissance? And why should whois databases be public anyway?
P19Use dig to walk the DNS hierarchy, starting from a root server, and show the delegation chain for your department's web server and for several popular sites.
Run it, then read what you should see.
P20Suppose you can access the caches in your department's local DNS servers. Can you propose a way to roughly determine the Web servers most popular among users in your department?
Propose a method, and say what it can and cannot tell you.
P21Your department has a local DNS server. You are an ordinary user. Can you determine whether an external Web site was likely accessed from a computer in your department a couple of seconds ago?
Say how, and what the answer really tells you.
P22Distributing a file of F = 20 Gbits to N peers. The server uploads at uₛ = 30 Mbps; each peer downloads at dᵢ = 2 Mbps and uploads at u. Prepare a chart of the minimum distribution time for N = 10, 100, 1000 and u = 300 kbps, 700 kbps, 2 Mbps, for both architectures.
Use D_cs = max{NF/uₛ, F/d_min} and D_P2P = max{F/uₛ, F/d_min, NF/(uₛ + N·u)}. Answers in seconds.
a.Client-server, N = 10 (any u).
sb.Client-server, N = 1000 (any u).
sc.P2P, N = 1000, u = 300 kbps.
sd.P2P, N = 1000, u = 2 Mbps.
sP23Distributing F bits to N peers with a client-server architecture, assuming a fluid model where the server can transmit to several peers at once at different rates, as long as the combined rate does not exceed uₛ.
a.Suppose uₛ/N ≤ d_min. Specify a scheme with distribution time NF/uₛ.
b.Suppose uₛ/N ≥ d_min. Specify a scheme with distribution time F/d_min.
c.Conclude that the minimum distribution time is max{NF/uₛ, F/d_min}.
P24Distributing F bits to N peers with a P2P architecture, assuming a fluid model and d_min very large, so peer download is never a bottleneck.
a.Suppose uₛ ≤ (uₛ + u₁ + … + u_N)/N. Specify a scheme with distribution time F/uₛ.
b.Suppose uₛ ≥ (uₛ + u₁ + … + u_N)/N. Specify a scheme with distribution time NF/(uₛ + u₁ + … + u_N).
c.Conclude the general result.
P25An overlay network has N active peers, with each pair having an active TCP connection. The TCP connections pass through a total of M routers. How many nodes and edges are there in the overlay network?
a.How many nodes? (Answer for N = 10.)
nodesb.How many edges? (Answer for N = 10.)
edgesP26Bob joins a BitTorrent torrent but does not want to upload any data — so-called free-riding.
a.Bob claims he can still receive a complete copy. Is that possible? Why or why not?
b.Bob says he can make free-riding more efficient using several computers with distinct IP addresses. How?
P27A DASH system has N video versions and N audio versions, and the player may choose any video version with any audio version at any time.
a.If audio is mixed in with the video so the server sends one stream, how many files must the server store? (Answer for N = 10.)
filesb.If the server sends audio and video separately and the client synchronises them, how many files? (Answer for N = 10.)
filesP28Install the Python programs from §2.7 and run them in different orders.
a.What happens if you run TCPClient before TCPServer? Why?
b.What happens if you run UDPClient before UDPServer? Why?
c.What happens if you use different port numbers for the client and server sides?
P29Suppose that in UDPClient.py, after creating the socket, we add the line `clientSocket.bind(('', 5432))`. Does UDPServer.py need to change? What are the port numbers for the sockets in UDPClient and UDPServer, and what were they before?
a.Does UDPServer.py need to change?
b.After the change, what is the client socket's port number?
c.What is the server socket's port number, before and after the change?
P30Can you configure your browser to open multiple simultaneous connections to a Web site? What are the advantages and disadvantages of a large number of simultaneous TCP connections?
Answer both parts.
P31TCP sockets treat data as a byte stream; UDP sockets recognise message boundaries. Give one advantage and one disadvantage of a byte-oriented API compared with one that preserves application-defined message boundaries.
One advantage and one disadvantage of the byte-stream API.
P32What is the Apache Web server? How much does it cost? What functionality does it currently have?
Answer all three parts.
P9, with the numbers live
P9(a) is the problem worth dwelling on, so here it is with every input exposed.
What each symbol means
- Δ — time to send one object over the access link (s)
- β — arrival rate of objects to the access link (objects/s)
- Δβ — traffic intensity — dimensionless (—)
Read aloud: The access delay is the time to send one object, divided by how much of the link is still free — which is why it explodes as the link fills.
Traffic intensity Δβ on the access link1.07
only the misses cross the access link: 100 % of requests
arrival rate on the link = 1.00 x 16 = 16.00 requests/s
intensity = 16.00 x 1,000,000 bits / 15.0 Mbps
= 1.07
at 1.00 the delay grows without bound — §1.4.2Total average response time3.12 s
a hit is served from the cache over the LAN: 0.000 ns
a miss also crosses the access link and the Internet: 0.000 ns + 116 ms + 3.00 s = 3.12 s
average = 0.00 x 0.000 ns + 1.00 x 3.12 s
= 0.000 ns + 3.12 s
= 3.12 sChange any number above and the arithmetic re-runs, carrying the units through.
The defaults are P9 exactly as printed. Look at the traffic intensity before you look at the delay. Then set the hit rate to 0.6, which is P9(b)’s miss rate of 0.4 seen the other way round.
Read the traffic intensity before you read the delay
With the defaults — 16 requests per second, 1 Mbit objects, a 15 Mbps access link — the traffic intensity is
That is greater than 1. The institution is asking for 16 Mbps through a 15 Mbps link, so the queue grows without bound and the average access delay is infinite.
Feed it into the formula the problem tells you to use and you get
A negative delay. The arithmetic is right and the answer is meaningless — which is the model telling you it does not apply.
This is a flaw in the problem as printed, not a trick. It is recorded here rather than quietly corrected, because noticing that a result cannot be true is a more useful habit than getting it right by luck. Section 1.4.2 is where the formula’s domain was set out: it holds only while traffic intensity is below 1.
Now raise the hit rate hit rate Simple The share of requests a cache can answer from its own copies. Precise The fraction of requests that are satisfied by a cache. Hit rates typically range from 0.2 to 0.7 in practice. introduced in ch. 2 — open in glossary to 0.6 — which is P9(b)‘s miss rate of 0.4, seen from the other side. The intensity drops to 0.43, the access delay becomes 0.116 s, and the total response time becomes about 1.25 s. The cache did not make the link faster. It removed 60 % of the demand from it.
The three problems whose answers are worth memorising
P8 — the cost of a page, in round trips. With eight referenced objects: non-persistent serial is 18·RTT₀, six parallel connections is 6·RTT₀, and persistent with pipelining is 3·RTT₀. That last number does not change if there are eighty objects instead of eight.
P13 — the cost of head-of-line blocking, in HTTP/2 frames. One video of 2000 HTTP/2 frames and five images of three each: 2015 HTTP/2 frame times without interleaving, 18 with. The same 2015 HTTP/2 frames either way; only the order changed.
P22 — where the P2P (Peer-to-Peer) Peer-to-Peer An architecture where users’ own machines serve each other directly. introduced in ch. 2 bottleneck sits. At N = 1000 and u = 300 kbps the aggregate upload binds and the answer is 60,606 s. Raise u to 2 Mbps and the aggregate term falls to 9,852 s, below F/d_min. So the answer becomes 10,000 s and the binding constraint moves to one peer’s own download link. Beyond that point, more upload capacity buys nothing.
What these problems are really testing
- Count the base object. P1(a), P8 and P13 all hinge on remembering that the HTML (HyperText Markup Language) HyperText Markup Language The document format of the Web, created by Tim Berners-Lee at CERN between 1989 and 1991. introduced in ch. 1 file is an object too, and that the browser cannot ask for the others until it has read it.
- Distinguish the envelope from the letter. P15 and P17 both turn on
MAIL FROM:being an SMTP (Simple Mail Transfer Protocol) Simple Mail Transfer Protocol The application-layer protocol that transfers e-mail messages. introduced in ch. 1 command whileFrom:is a line inside the message — and P17 shows why forged mail is traceable anyway. - Ask what dominates. P10 and §2.2.2 are the same question with opposite answers: round trips matter when transmission is small, and not otherwise. Check the traffic intensity before trusting a queuing formula — P9 gives a negative delay if you do not.