Professional Documents
Culture Documents
CS132 EECS148 ProblemSet2 Solution
CS132 EECS148 ProblemSet2 Solution
-----------------------------------------------------------------------------Problem 1 (1 points) - What is the difference between pull and push network protocols?
Explain the difference by using two example protocols.
Pull : HTTP, POP, IMAP : client requests (pulls) data from server
Push : SMTP , server sends (pushes) its data to client whenever new data is available
Problem 2 - (Chapter 1 problem 31 , 5 points) In modern packet-switched networks, including
the Internet, the source host segments long, application layer messages (for example an image
or a music file) into smaller packets and sends the packets into the network. The receiver then
resembles the packets back into the original message. We refer to this process as message
segmentation. Consider a message that is 8*10^6 bits long that is to be sent from a source to a
destination which are separated by two routers in between. Suppose each of the three link in
this path is 2 Mbps. Ignore propagation, queueing and processing delays.
a. Consider sending the message without message segmentation. How long does it take to
move the message from the source host to the first router ? Keeping in mind that each router
uses a store-and-forward packet switching, what is the total time to move the message from
source to destination?
b. Now suppose the packet is segmented into 800 packets with each packet being 10000 bits
long. How long does it take to move the first packet to the first router ? When the first packet is
being sent from the first router to the second one, the second packet is on its way to the first
router. At what time will the second packet be fully received by the second router ?
c. What is the total to move the message to destination host ? Compare this result with your
answer in part a.
d. In addition to reducing delay, what are the reasons to use message segmentation?
e. Discuss the drawbacks of message segmentation.
a) Time to send message from source host to first packet switch = 8*10^6 / 2*10^6 = 4 sec. With
store-and-forward switching, the total time to move message from source host to destination
host = 4 sec 3 hops = 12 sec
b) Time to send 1st packet from source host to first packet switch = 1*10^4/2*10^6 = 5 m sec.
Time at which second packet is received at the first switch = time at which 1 st packet is
received at the second switch = 2 5m sec = 10 m sec
c) Time at which 1st packet is received at the destination host = 5 m sec 3 hops = 15 m sec
. After this, every 5msec one packet will be received; thus time at which last (800 th) packet
is received = 15 m sec + 799 * 5m sec = 4.01 sec . It can be seen that delay in using message
segmentation is significantly less (almost 1/3rd).
d)
i. Without message segmentation, if bit errors are not tolerated, if there is a single bit
error, the whole message has to be retransmitted (rather than a single packet).
ii. Without message segmentation, huge packets (containing HD videos, for example)
are sent into the network. Routers have to accommodate these huge packets. Smaller
packets have to queue behind enormous packets and suffer unfair delays.
e)
i. Packets have to be put in sequence at the destination.
ii. Message segmentation results in many smaller packets. Since header size is usually
the same for all packets regardless of their size, with message segmentation the total
amount of header bytes is more.
Problem 3 - (Chapter 2 problem 1, 5 points) 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 Data: header in HTTP response message indicates when the object in the response was
last modified.
e. HTTP response messages never have an empty message body.
a) False
b) True
c) False
d) False
e) False
Problem 4 - (Chapter 2 problem 7, 4 points) Suppose within your web browser you click on a
link to obtain a Web page. The IP address of the associated URL is not cached in your local
host, so a DNS lookup is necessary to obtain the IP address. Suppose 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 webpage 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?
The total amount of time to get the IP address is
RTT1 + RTT2 + + RTTn .
Once the IP address is known, RTTO elapses to set up the TCP connection and another RTTO
elapses to request and receive the small object. The total response time is
Iterative and Recursive. In iterative approach, client only talks to local DNS, local talks to Root
DNS, Root talks to TLD, TLD talks to authoritative and ... . In recursive approach, client talks to
local DNS, then talks to Root, then talks to TLD, then to authoritative and ....
d. What is the necessity of having Root Domain Name Servers ?
Adding a new TLD requires updating only 13 entities in the network.
Problem 11 (Modified version of Chapter 2 problem 22, 6 points ) - 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. We have N peers in total.
a. Assume U = 700Kbps. Do the math and compare the total amount of time needed to
distribute the file for N = 10 and N = 100. How does increasing N affect this comparison ?
Direct communication : max {10 (or 100) * 15000 / 30 , 15000 / 2}
P2P communication : max {15000 / 30 , 15000 / 2 , 10 (or 100) * 15000 / (30 + 10(or 100)*0.7)}
If number of peers is increased enough, P2P becomes greater finally.
b. Assume N = 50. Compare this time for U = 300 Kbps and U = 700 Kbps. How does
increasing peers upload rate (U) affects this comparison?
Direct communication : max {50 * 15000 / 30 , 15000 / 2}
P2P communication : max {15000 / 30 , 15000 / 2 , 50 * 15000 / (30 + 50*0.3(or 0.7))}
If upload rate of peers is increased enough, P2P becomes greater finally.
Problem 12 (2 points) - Consider a P2P overlay network.
a. One example of this network is Circular Architecture. Depict this architecture and briefly
explain how a file is distributed among peers in this approach.
Page 153 in book
b. Add shortcuts to your answer for part a. How is total upload time affected by adding
shortcuts? What is the drawback of adding more edges to the overlay network ?
Total time is decreased because of shortcuts but managing the network becomes more difficult
due to peer churn.
Problem 13 - (Chapter 2 problem 29, 5 points) Because an integer in [0, 2^n - 1] can be
expressed as an n-bit binary number in a DHT, each key can be expressed as k = (k0,k1,..kn-1)
, and each peer identifier can be expressed as p = (p0, p1, ..., pn-1). Lets now define the XOR
distance between a key k and a peer p as
d(k, p) = |k0 - p0|*2^0 + ... + |kn-1 - pn-1|*2^(n-1)
Describe how this metric can be used to assign (key, value) pairs to peers.
For each key, we first calculate the distances (using d(k,p)) between itself and all peers, and
then store the key in the peer that is closest to the key (that is, with smallest distance value).
Extra Credit
You can submit the answers to Problem 19, or Wireshark Lab problems of chapter 2 for
10 points extra credit.