# ELEC 3120: Computer Communication Networks Homework 2

\$30.00

## Description

P1. (12 pts.) Consider distributing a file of F = 3 Gbits to N peers. The server has an upload rate of us = 60 Mbps, and
each peer has a download rate of di = 3 Mbps and an upload rate of u. For N = 10, 100, and 1,000 and u = 300
Kbps, 1 Mbps, and 3 Mbps, prepare a table giving the minimum distribution time for each of the combinations of
N and u for:
a. Client-server distribution (6 pts.).
b. P2P distribution (6 pts.).
P2. (8 pts.) Assume that the RTT between a client and the local DNS server is RTTl = t, while the RTT between the
local DNS server and other DNS servers is RTTr = 2t. Assume that no DNS server performs caching.
a. What is the total response time (in t) for the scenario illustrated as following? (2 pts.)
ELEC 3120: Computer Communication Networks
Homework 2
Page 2
b. What is the total response time (in t) for the scenario illustrated as following? (2 pts.)
c. Assume now that the DNS record for the requested name is cached at the local DNS server. What is the total
response time (in t) for the two scenarios? (4 pts.)
P3. (12 pts.) Assume you request a webpage consisting of one document and five images. The document size is 1 KB, all
images have the same size of 50 KB, the download rate is 1 Mbps, and the RTT is 100 ms. How long does it take to
obtain the whole webpage under the following conditions? (Assume no DNS name query is needed and the impact of
the request line and the headers in the HTTP messages is negligible).
a. Nonpersistent HTTP with serial connections. (2 pts.)
b. Nonpersistent HTTP with two parallel connections. (2 pts.)
c. Nonpersistent HTTP with six parallel connections. (2 pts.)
d. Persistent HTTP with one connection (without pipeline). (2 pts.)
e. Generalize the results obtained for sub-problems a and d to a document size of Ld bytes, N images with size
of Li bytes (for 0 ≤ 𝑖𝑖 < 𝑁𝑁), a rate of R byte/s and an RTT of RTTavg. (4 pts.)
P4. (12 pts.) UDP and TCP use 1s complement for their checksums. Suppose you have the following three 8-bit bytes:
00101101, 01110000, 11000011.
a. What is the 1s complement of the sum of these 8-bit bytes? (Note that although UDP and TCP use 16-bit
words in computing the checksum, for this problem you are being asked to consider 8-bit sums.) (2 pts.)
b. Why is it that UDP takes the 1s complement of the sum; that is, why not just use the sum? With the 1s
complement scheme, how does the receiver detect errors? (2 pts.)
c. Is it possible that a 1-bit error will go undetected? (2 pts.)
d. How about a 2-bit error? (2 pts.)
e. Suppose that the UDP receiver computes the Internet checksum for the received UDP segment and finds that
it matches the value carried in the checksum field. Can the receiver be absolutely certain that no bit errors
have occurred? Explain. (4 pts.)
ELEC 3120: Computer Communication Networks
Homework 2
Page 3
P5. (16 pts.) Host A and B are communicating over a TCP connection, and Host B has already received from A all
bytes up through byte 127. Suppose Host A then sends two segments to Host B back-to-back. The first and
second segments contain 50 and 29 bytes of data, respectively. In the first segment, the sequence number is 128,
the source port number is 133, and the destination port number is 100. Host B sends an acknowledgment
whenever it receives a segment from Host A.
a. In the second segment sent from Host A to B, what are the sequence number, source port number, and
destination port number? (4 pts.)
b. If the first segment arrives before the second segment, in the acknowledgment of the first arriving segment,
what is the acknowledgment number, the source port number, and the destination port number? (4 pts.)
c. If the second segment arrives before the first segment, in the acknowledgment of the first arriving segment,
what is the acknowledgment number? (4 pts.)
d. Suppose the two segments sent by A arrive in order at B. The first acknowledgment is lost and the second
acknowledgment arrives after the first timeout interval. Draw a timing diagram, showing these segments and
all other segments and acknowledgments sent. (Assume there is no additional packet loss.) For each segment
in your figure, provide the sequence number and the number of bytes of data; for each acknowledgment that
you add, provide the acknowledgment number. (4 pts.)