hw1 Sol
hw1 Sol
hw1 Sol
Homework 1
Assigned: Wednesday, 10 September 2014
Due: Monday, 22 September 2014
Name:
SID:
Discussion Section (Day/Time):
Instructions
- Submit this homework using Pandagrader/GradeScope(https://www.gradescope.com/
courses/214).
- To submit, print out this document, write your answers on it, then scan it and upload
to Pandagrader. Scanning services are available from the Berkeley Library System
(http://www.lib.berkeley.edu/using-the-libraries/print-scan). Be sure to
double-check your submission to ensure that Pandagrader has scanned in your solution correctly. You may want to consider using a pdf markup program to insert your
answers into this document in the provided spaces, especially in Problem 5 if your plot
is computer-generated.
- Use your @berkeley.edu email address to sign in to Pandagrader. If you dont have a
Pandagrader account, click Login and then Forgot Password on the Pandagrader
website and follow the instructions. If you have any problems with the submission
process, it is your responsibility to come to office hours prior to the homeworks due
date.
- If you need more space for work, or you write code to calculate a result, attach these
materials at the end of the homework when you submit.
- If you have questions, ask on Piazza (strongly preferred) or email Akshay (akshay [dot]
narayan [at] berkeley).
- Some potentially useful information:
1 Byte = 8 bits, 1 Mbps = 106 bits
, 1 Gbps = 109 bits
, 1 ms = 103 sec.
sec
sec
CS168
(b) (4 points) Which of the following reflects the Internets best effort design philosophy? (Select all that apply.)
Packets can be dropped
Switches have finite buffer capacity
Reuse of existing telephone lines
Organizing functionality in layers
The term best effort refers to the fact that the Internet provides no reliability
guarantees, so packets cna be dropped. Packets can be dropped because switches
have finite buffer capacity. However, no switch can have infinite buffer capacity, so
we also accepted answers that did not mark this option.
CS168
(c) (4 points) Which of the following design choices helped the Internet to scale? (Select all that apply.)
Reuse of existing telephone lines
Setting a minimum threshold of acceptable end-to-end packet delay
Settling on IP as the common protocol for interconnection
Statistical multiplexing at the granularity of individual packets
There was no minimum threshold set (even today), and telephone lines helped deployability (we also accepted answers that did not mark this since it can be argued
that deployability and scalability are separate ideas). IP as the common protocol
allowed for a decentralized Internet, which helped scaling, and had statistical multiplexing been implemented at a higher granularity, switches would have had to
maintain state, hurting scalability.
(d) (4 points) Reverse engineering links characteristics: Consider a link with bandwidth B and latency (i.e. one way propagation delay) L, with hosts 1 and 2 attached
to opposite ends of the link.
Starting at time t=0, Host 1 sends two data packets (back-to-back) to Host 2, which
ACKs them immediately (requiring no processing time). The ACKs arrive at times
T1 and T2. The data packets are of size P and the ACKs are of size A. (You may
assume A < P ).
Solve for the link bandwidth B in terms of the arrival times T1 and T2, and the
packet sizes P and A. The expression for B should not contain L on the right-handside.
P
B=
T2 T1
Since all else is identical for the two packets sent, the only difference is the transmission time of the second packet immediately after packet 1 was sent. So, a packet
of size P had a transmission time of T2 T1 , and we can calculate the bandwidth
B.
CS168
(e) (2 points) Suppose you would like to urgently deliver 300 TB of data from Boston
to Los Angeles. You have available a 1 Gbps dedicated link for data transfer. Which
of the following approaches would you prefer to transmit the data?
CS168
(a) (4 points) Consider Figure 1(a). What is the packet inter-arrival time at the destination? That is, how much time elapses from when the last bit of the first packet
arrives until the last bit of the second packet arrives?
L
RS
RS is the bottleneck link, so the transmission time on that link will determine the
inter-arrival time.
CS168
(b) (2 points) Again consider Figure 1(a). Now assume that the second link is the
bottleneck link (i.e., RC < RS ). Is it possible that the second packet queues at the
input queue of the second link? Explain.
Yes.
(c) (2 points) Once more consider Figure 1(a). Now, suppose that A sends the second
packet T seconds after sending the first packet. How large must T be to ensure no
queuing before the second link? Explain.
If you assumed that Rc was the bottleneck: RLC RLS
Look at the timing diagram above for the explanation.
If you assumed that Rs was the bottleneck: 0.
If you did not state your assumption, we defaulted to assuming Rc was the bottleneck.
(d) (4 points) Consider Figure 1(b). Suppose that there are M paths between A and
B. No two paths share any link. Path k (k = 1, . . . , M ) consists of N links with
k
.
transmission rates R1k , R2k , . . . , RN
(i) If A can only use one path to send data to B, what is the maximum throughput
that it can achieve?
maxM (min(Rnk )). Throughput is limited by the thinnest link, and we want to
use the path with the biggest limiting link.
(ii) If A can use all M paths to send data, what is the maximum throughput that
it
achieve?
Pcan
M
k
min(R
n ). Instead of maxing over the paths as in (i), we sum.
k=1
CS168
CS168
s
2.5 108 ms
= 1.6 105 bits
(b) (2 points) 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?
min(BDP, 800000) = BDP. 1.6 105 bits.
(c) (3 points) Visualize the link as a pipe filled with a sequence of bits. What is the
width (in meters) of a bit in the link, i.e., what fraction of the link corresponds to
one bit?
20000103 m
= 125 m.
1.6105 bits
(d) (3 points) 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.
s
=
R
CS168
5. (10 points) Fun! The ping program determines the round-trip-time (RTT) to any host
in the Internet. Using a computer on campus (either your device connected to AirBears
or an instructional machine) ping the following hosts five times each to calculate an
average RTT:
- stanford.edu (Palo Alto, CA)
- nus.edu.sg (Singapore)
For each of these cities find the physical distance from Berkeley (You can look these
up here: http://www.geobytes.com/citydistancetool.htm), and then compute the
estimated time T for a packet to reach that location.
(a) (7 points) Plot a graph where the x axis represents the distance to each city, and
the y axis represents the ratio between the RTT as measured by the ping program
and the shortest possible time 2T to reach that city and return. You may disregard
transmission delays as ping packets are quite small.
These are the results we got. Yours may be slightly different.
(b) (3 points) What is the ideal ratio? Did you achieve it? Does the ratio increase,
decrease, or stay the same as geographical distance increases? Why might this be
the case?
The ideal ratio would have been 1. You almost certainly did not achieve it. (Note
that even though Monash is almost touching the x-axis, it has a value of 2) As
you can see the ratio roughly gets smaller as distance increases - this is because
delays like queueing delays are more relevant when overall travel time is smaller.
Also, note that if the overall RTT is greater, you have more leeway in taking small
suboptimal detours to still gain a relatively small ratio.