HW - Module 1 & 2 Exercise Questions To Be Solved
HW - Module 1 & 2 Exercise Questions To Be Solved
HW - Module 1 & 2 Exercise Questions To Be Solved
Problem 1: Suppose users share a 3 Mbps link. Also suppose each user requires 150 kbps when
transmitting, but each user transmits only 10 percent of the time.
a. When circuit switching is used, how many users can be supported?
b. For the remainder of this problem, suppose packet switching is used. Find the
probability that a given user is transmitting.
c. Suppose there are 120 users. Find the probability that at any given time, exactly n users
are transmitting simultaneously. (Hint: Use the binomial distribution.)
d. Find the probability that there are 21 or more users transmitting simultaneously.
Problem 2: Consider a packet of length L which begins at end system A and travels over three
links to a destination end system. These three links are connected by two packet switches. Let
di , si , and Ri denote the length, propagation speed, and the transmission rate of link i, for i =
1, 2, 3. The packet switch delays each packet by d proc. Assuming no queuing delays, in terms
of di , si , Ri , (i = 1,2,3), and L, what is the total end-to-end delay for the packet? Suppose now
the packet is 1,500 bytes, the propagation speed on all three links is 2.5 · 10 8 m/s, the
transmission rates of all three links are 2 Mbps, the packet switch processing delay is 3 msec,
the length of the first link is 5,000 km, the length of the second link is 4,000 km, and the length
of the last link is 1,000 km. For these values, what is the end-to-end delay?
Problem 4: A packet switch receives a packet and determines the outbound link to which the
packet should be forwarded. When the packet arrives, one other packet is halfway done being
transmitted on this outbound link and four other packets are waiting to be transmitted. Packets
are transmitted in order of arrival. Suppose all packets are 1,500 bytes and the link rate is 2
Mbps. What is the queuing delay for the packet? More generally, what is the queuing delay
when all packets have length L, the transmission rate is R, x bits of the currently-being-
transmitted packet have been transmitted, and n packets are already in the queue?
Problem 5: (a) Suppose N packets arrive simultaneously to a link at which no packets are
currently being transmitted or queued. Each packet is of length L and the link has transmission
rate R. What is the average queuing delay for the N packets?
(b) Now suppose that N such packets arrive to the link every LN/R seconds. What is the average
queuing delay of a packet?
Problem 6: Suppose you would like to urgently deliver 40 terabytes data from Boston to Los
Angeles. You have available a 100 Mbps dedicated link for data transfer. Would you prefer to
transmit the data via this link or instead use FedEx overnight delivery? Explain.
Problem 7: Suppose two hosts, A and B, are separated by 20,000 kilometers and are
connected by a direct link of R = 2 Mbps. Suppose the propagation speed over the link is 2.5
*108 meters/sec.
a. Calculate the bandwidth-delay product, R *dprop.
b. Consider sending a file of 800,000 bits from Host A to Host B. Suppose the file is sent
continuously as one large message. What is the maximum number of bits that will be in the
link at any given time?
c. Provide an interpretation of the bandwidth-delay product.
d. What is the width (in meters) of a bit in the link? Is it longer than a foot-ball field?
e. Derive a general expression for the width of a bit in terms of the propagation speed s, the
transmission rate R, and the length of the link m.
Problem 8: Suppose there is a 10 Mbps microwave link between a geostationary satellite and
its base station on Earth. Every minute the satellite takes a digital photo and sends it to the base
station. Assume a propagation speed of 2.4*108 meters/sec.
a. What is the propagation delay of the link?
b. What is the bandwidth-delay product, R · dprop ?
c. Let x denote the size of the photo. What is the minimum value of x for the microwave link
to be continuously transmitting?
Problem 9: Consider sending a large file of F bits from Host A to Host B. There are three
links (and two switches) between A and B, and the links are uncongested (that is, no queuing
delays). Host A segments the file into segments of S bits each and adds 80 bits of header to
each segment, forming packets of L = 80 + S bits. Each link has a transmission rate of R bps.
Find the value of S that minimizes the delay of moving the file from Host A to Host B.
Disregard propagation delay
Module 2
Problem 1. True or false?
a. A user requests a Web page that consists of some text and three images. For this page,
the client will send one request message and receive four response messages.
b. Two distinct Web pages (for example, www.mit.edu/research.html and
www.mit.edu/students.html) can be sent over the same persistent connection.
c. With nonpersistent connections between browser and origin server, it is possible for a
single TCP segment to carry two distinct HTTP request messages.
d. The Date: header in the HTTP response message indicates when the object in the
response was last modified.
e. HTTP response messages never have an empty message body.
Problem 2. Consider an HTTP client that wants to retrieve a Web document at a given URL.
The IP address of the HTTP server is initially unknown. What transport and application-layer
protocols besides HTTP are needed in this scenario?
Problem 4. Consider the following string of ASCII characters that were captured by Wireshark
when the browser sent an HTTP GET message (i.e., this is the actual content of an HTTP GET
message). The characters are carriage return and line-feed characters (that is, the italized
character string in the text below represents the single carriage-return character that was
contained at that point in the HTTP header). Answer the following questions, indicating where
in the HTTP GET message below you find the answer.
Problem 6. Obtain the HTTP/1.1 specification (RFC 2616). Answer the following questions:
a. Explain the mechanism used for signalling between the client and server to indicate that
a persistent connection is being closed. Can the client, the server, or both signal the
close of a connection?
b. What encryption services are provided by HTTP?
c. Can a client open three or more simultaneous connections with a given server?
d. Either a server or a client may close a transport connection between them if either one
detects the connection has been idle for some time. Is it possible that one side starts
closing a connection while the other side is transmitting data via this connection?
Explain.
Problem 7. Suppose within your Web browser you click on a link to obtain a Web page. The
IP address for the associated URL is not cached in your local host, so a DNS lookup is necessary
to obtain the IP address. Suppose that n DNS servers are visited before your host receives the
IP address from DNS; the successive visits incur an RTT of RTT1, . . ., RTTn. Further suppose
that the Web page associated with the link contains exactly one object, consisting of a small
amount of HTML text. Let RTT0 denote the RTT between the local host and the server
containing the object. Assuming zero transmission time of the object, how much time elapses
from when the client clicks on the link until the client receives the object?
Problem 8. Referring to Problem P7, suppose the HTML file references eight very small
objects on the same server. Neglecting transmission times, how much time elapses with
a. Non-persistent HTTP with no parallel TCP connections?
b. Non-persistent HTTP with the browser configured for 5 parallel connections?
c. Persistent HTTP?
Problem 10. Consider a short, 10-meter link, over which a sender can transmit at a rate of 150
bits/sec in both directions. Suppose that packets containing data are 100,000 bits long, and
packets containing only control (e.g., ACK or handshaking) are 200 bits long. Assume that N
parallel connections each get 1/N of the link bandwidth. Now consider the HTTP protocol and
suppose that each downloaded object is 100 Kbits long, and that the initial downloaded object
contains 10 referenced objects from the same sender. Would parallel downloads via parallel
instances of non-persistent HTTP make sense in this case? Now consider persistent HTTP. Do
you expect significant gains over the non-persistent case? Justify and explain your answer.
Problem 11. Consider the scenario introduced in the previous problem. Now suppose that the
link is shared by Bob with four other users. Bob uses parallel instances of non-persistent HTTP,
and the other four users 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 of non-persistent HTTP, then would Bob’s
parallel connections still be beneficial? Why or why not?
Problem 12. Write a simple TCP program for a server that accepts lines of input from a client
and prints the lines onto the server’s standard output. (You can do this by modifying the
TCPServer.py program in the text.) Compile and execute your program. On any other machine
that contains a Web browser, set the proxy server in the browser to the host that is running your
server program; also configure the port number appropriately. Your browser should now send
its GET request messages to your server, and your server should display the messages on its
standard output. Use this platform to determine whether your browser generates conditional
GET messages for objects that are locally cached.
Problem 13. What is the difference between MAIL FROM: in SMTP and From: in the mail
message itself?
Problem 14. How does SMTP mark the end of a message body? How about HTTP? Can HTTP
use the same method as SMTP to mark the end of a message body? Explain.
Problem 15. Consider accessing your e-mail with POP3.
c. Suppose you have configured your POP mail client to operate in the download-and-keep
mode. Using your transcript in part (b), suppose you retrieve messages 1 and 2, exit POP, and
then five minutes later you again access POP to retrieve new e-mail. Suppose that in the five-
minute interval no new messages have been sent to you. Provide a transcript of this second
POP session.
Problem 16. Suppose you can access the caches in the local DNS servers of your department.
Can you propose a way to roughly determine the Web servers (outside your department) that
are most popular among the users in your department? Explain.
Problem 17. Suppose that your department has a local DNS server for all computers in the
department. You are an ordinary user (i.e., not a network/system administrator). Can you
determine if an external Web site was likely accessed from a computer in your department a
couple of seconds ago? Explain.
Problem 18. Consider distributing a file of F = 15 Gbits to N peers. The server has an upload
rate of us = 30 Mbps, and each peer has a download rate of di = 2 Mbps and an upload rate of
u. For N = 10, 100, and 1,000 and u = 300 Kbps, 700 Kbps, and 2 Mbps, prepare a chart giving
the minimum distribution time for each of the combinations of N and u for both client-server
distribution and P2P distribution.
Problem 19. Consider distributing a file of F bits to N peers using a client-server architecture.
Assume a fluid model where the server can simultaneously transmit to multiple peers,
transmitting to each peer at different rates, as long as the combined rate does not exceed u s .
a. Suppose that us /N ≤ dmin. Specify a distribution scheme that has a distribution time of NF/
us .
b. Suppose that us /N ≥ dmin. Specify a distribution scheme that has a distribution time of F/
dmin.
c. Conclude that the minimum distribution time is in general given by max{NF/ u s , F/ dmin}.
Problem 20. Consider distributing a file of F bits to N peers using a P2P architecture. Assume
a fluid model. For simplicity assume that dmin is very large, so that peer download bandwidth
is never a bottleneck.
a. Suppose that us ≤ (us + u1 + ... + uN)/N. Specify a distribution scheme that has a distribution
time of F/us .
b. Suppose that us ≥ (us + u1 + ... + uN)/N. Specify a distribution scheme that has a distribution
time of NF/(us + u1 + ... + uN).
c. Conclude that the minimum distribution time is in general given by max{F/us , NF/(us + u1
+ ... + uN)}.
Problem 21. Many BitTorrent clients use DHTs to create a distributed tracker. For these DHTs,
what is the “key” and what is the “value”?