Sie sind auf Seite 1von 8

Name:____________________________________

CS244a Midterm
February 20, 2007

Student ID #:_______________________________
Professor Nick McKeown
Campus/SITN-Local/SITN-Remote?____________

_______________________________________________________________________
Grade: S MC:___ 11:____ 12:___ 13:___ 14:____ 15: _____ 16: _____ 17:____ Total:

CS244a: An Introduction to Computer


Networks
Midterm Exam: Tuesday February 20, 2007

xkcd.com

You are allowed 1 hour to complete this exam.


(i) This exam is closed book and closed notes. However, you may refer to a sheet of 8.5"x11" paper (singlesided) of your own design.
(ii) Write your solution directly onto this exam. Be sure to write your name and student ID clearly on the
front of the exam.
(iii) Dont panic! Be sure to start by reading the exam all the way through. Then answer the questions in
whatever order you choose.
(iv) Show your reasoning clearly. If your reasoning is correct, but your final answer is wrong, you will
receive most of the credit. If you just show the answer without reasoning, and your answer is wrong, you
may receive no points at all.
(v) You may assume that the speed of propagation along a cable or optical fiber is 2 x 108m/s.

The Stanford Honor Code


In accordance with both the letter and spirit of the Honor Code, I didn't cheat on this exam.
Signature:________________________________________________________________

Page 1 of 8

Name:____________________________________

CS244a Midterm
February 20, 2007

Student ID #:_______________________________
Professor Nick McKeown
Campus/SITN-Local/SITN-Remote?____________

_______________________________________________________________________

Short Multiple Choice Questions.


Instructions: in the following questions, check all listed assertions that appear to be
correct. There is at least one correct assertion per question, but there may be more.
Each correct assertion checked will earn you one point. For each incorrect assertion
you check, you will lose one point. If you dont know an answer, checking no assertion
will neither earn you nor lose you any points.
1. General. It takes a single bit ten times longer to propagate over a 10Mb/s link than over a
100Mb/s link.
(a.) True
(b.) False
(c.) There is insufficient information to answer the question
(d.) I should have dropped the class two weeks ago
2. General. You rip a 3 minute long stereo (its underlined to give you a hint!) music track
by sampling it at 8kHz with 16bits per sample and store it in a file in raw format. How
long would it take to send the file over a 1Mb/s link?
(a.) About 46 seconds.
(b.) 22.5 seconds.
(c.) 2 minutes and 17 seconds.
(d.) 3 minutes.
(e.) It depends on the volume setting.

3. General. What is the bandwidth delay product (in bits) of a network that
contains 5,000km of optical fiber operating at 2.5Gb/s, and three routers (each
with a fixed processing delay of 100s)?
(a.)
(b.)
(c.)
(d.)
(e.)

750,000 bits
62,500,000 bits
63,250,000 bits
625,000 bits
We need to know how wide the network is to determine how many bits will fit in the
pipe.

4. Address lookup. Which of the following are true statements about how routers lookup
IPv4 addresses in their forwarding tables
(a.) They can use regular hashing algorithms to perform lookups of address prefixes.
(b.) Binary search trees and tries are different names for the same algorithms and data
structures.
(c.) TCAMs (ternary CAMs) are commonly used because they are well suited to
longest-prefix match lookups.
(d.) TCAMs are commonly used for address lookups because they require less space,
less power and cost less per bit of storage than SRAM.

Page 2 of 8

Name:____________________________________

CS244a Midterm
February 20, 2007

Student ID #:_______________________________
Professor Nick McKeown
Campus/SITN-Local/SITN-Remote?____________

_______________________________________________________________________
5. Packet switching (from textbook). Which of the following are true about the design of
packet switches (e.g. routers):
(a.) Packet switches always place arriving packets directly and immediately into a
queue at the output port.
(b.) Input queues are commonly used for high speed routers because they can
run slower than the equivalent output queue.
(c.) Routers always have a fast internal shared data bus that all the input and output
ports connect to, so as to transfer packets between them.
(d.) A router that does virtual cut-through (instead of store and forward), does not
need packet buffers.
6. TCP. Which of the following are true statements about TCP:
(a.) A sources retransmission timeout value (RTO) is always set equal to the mostrecently measured RTT.
(b.) Setting RTO too small may lead to unnecessary retransmissions.
(c.) A sources retransmission timeout value is usually set to a value that increases
with the variance in measured RTT values.
(d.) RTO is picked randomly when a TCP connection starts, and remains fixed for the
duration of the flow.
7. Packet switching. The original reasons for the Internet to use packet switching were:
(a.) Statistical multiplexing enables efficient sharing of expensive long-haul
links.
(b.) It is less work for a router to process a packet than to process the data in a circuit.
(c.) If the routers contain no per-flow state, then it is easy to re-route flows
around link and router failures.
(d.) Packet switching enables routers to be built faster than circuit switches.

8. Queues. You are at the post office where there is a single line of people waiting to be
served by four different tellers. You watch for a while and notice that, on average, a new
person joins the line every 30 seconds, and there are, on average, 10 people in the line.
Whats a good estimate of the average time someone spends waiting in line?
(a.) 1200 seconds
(b.) 300 seconds
(c.) 75 seconds
(d.) 3 seconds
(e.) There isnt enough information in the question to make a good estimate.
9. Queues. You are standing in line at a ski lift. A new chair arrives every 10 seconds and
can carry two people, except that every third chair is broken. If no more than 6 people
arrive in any one minute period, whats the longest time that someone needs to wait in
line?
(a.) 30 seconds
(b.) 40 seconds
(c.) 50 seconds
(d.) 60 seconds

Page 3 of 8

Name:____________________________________

CS244a Midterm
February 20, 2007

Student ID #:_______________________________
Professor Nick McKeown
Campus/SITN-Local/SITN-Remote?____________

_______________________________________________________________________
(e.) An average of 8 seconds.
10. Queues. For the same ski lift as in question (9), assume that smoeone arrives to the lift
when the line is empty. On average, how long do they have to wait for a chair? Assume
the arrival time is independent of the time chairs depart.
(a.) 30 seconds
(b.) 12.5 seconds
(c.) 5 seconds
(d.) 7.5 seconds
(e.) 2.5 seconds

Short Questions.
11. (9 points) Inter-AS routing (from textbook). Consider a router inside one AS that
receives a packet for a network inside another AS.
(a.) Briefly explain how the router decides which router to send it to in its own AS so
that it can reach the other AS.
(See page 368 of textbook).
The Inter-AS routing protocol (BGP4 today) is used to identify which ASs to pass
through in order to reach a destination. This information is propagated inside the AS
using the intra-AS protocol (e.g. OSPF); this way, a router can decide which router to
send packets to at the edge of the AS so that it can be forwarded along the correct AS
path. If there are multiple paths to the destination AS, the router must make a local
choice of where to send the packet next. (See part b).
(b.) Why do many network operators use hot-potato routing?
Hot-potato routing is used by routers inside an AS to decide which boundary router to
send to, when there are multiple paths to the destination. Hot-potato routing is commonly
used to forward the traffic outside the AS as quickly as possible the operators like to
offload the traffic to another AS whenever they can!
(c.) Explain how loops in paths can be detected in BGP.

BGP advertisements contain complete paths showing the ASs the path passes
through, and so a router can easily identify a loop because an AS will appear two
or more times.

Page 4 of 8

Name:____________________________________

CS244a Midterm
February 20, 2007

Student ID #:_______________________________
Professor Nick McKeown
Campus/SITN-Local/SITN-Remote?____________

_______________________________________________________________________

12. (3 points) Routing. Explain why a network operator might not use traffic load as a cost metric for
their routing protocol.
If routers pick lightly loaded paths, the paths will become more congested, and so routers will pick
new paths. This leads to oscillations, limit-cycles and eventually instability.
13. (3 points) RED. The RED mechanism for active queue management will drop packets before the
packet buffer is full. To do this, it keeps track of the average queue occupancy, and drops packets
if the average exceeds a threshold.
(a.) Explain why RED uses the average queue occupancy instead of the instantaneous queue
occupancy.
To make it tolerant of bursts from TCP. TCP tends to send in bursts (one window of traffic each
RTT). If the queue drops several packets from one burst, it is likely that the source will re-enter
slow-start, which is not desirable.
(b.) What would happen if it used the instantaneous value instead?
1. If the maximum threshold is set below the buffer size, then a portion of the buffer would never
be used.
2. The router would be intolerant to bursts of packets from TCP sources.
14. (8 points) Addresses. Consider a datagram network using 8-bit host addresses. Suppose a router
uses longest prefix matching and has the following forwarding table:
Prefix Match
00
01
10
11

Interface
0
1
2
3

For each of the four interfaces, write down the associated range of destination host addresses and
the number of addresses in the range.
Interface
0
1
2
3

Range of addresses
0x00 0x3F
0x40 0x7F
0x80 0xBF
0xC0 0xFF

Page 5 of 8

Number of addresses
64
64
64
64

Name:____________________________________

CS244a Midterm
February 20, 2007

Student ID #:_______________________________
Professor Nick McKeown
Campus/SITN-Local/SITN-Remote?____________

_______________________________________________________________________

Longer questions
15. (15 points) Routing. Use Dijkstras shortest path first algorithm to find the shortest path from
computer A to every other computer in the network below. At each stage of the algorithm, clearly
show the candidate set and the shortest path set. Assume all the links are bidirectional and
symmetric (i.e. the cost of using a link is the same in both directions).

Do it router based, then add in hosts. (Router, Dist, LastHop)


Shortest Path Set
Candidate Set
(R1, 0, NULL)
(R2, 1, R1)
(R1, 0, NULL), (R2, 1, R1)
(R3, 3, R2), (R6, 7, R2)
(R1, 0, NULL), (R2, 1, R1), (R3, 3, R2)
(R6, 7, R2), (R4, 7, R3), (R5, 5, R3), (R7, 8, R3)
(R1, 0, NULL), (R2, 1, R1), (R3, 3, R2), (R5, 5,
(R6, 7, R2), (R4, 7, R3), (R7, 8, R3)
R3)
(R1, 0, NULL), (R2, 1, R1), (R3, 3, R2), (R5, 5,
(R6, 7, R2), (R7, 8, R3)
R3), (R4, 7, R3)
(R1, 0, NULL), (R2, 1, R1), (R3, 3, R2), (R5, 5,
(R7, 8, R3)
R3), (R4, 7, R3), (R6, 7, R2)
(R1, 0, NULL), (R2, 1, R1), (R3, 3, R2), (R5, 5,
R3), (R4, 7, R3), (R6, 7, R2), (R7, 8, R3)
Now find the host distances and paths
B
R1 -> R2
1
C
R1 -> R2 -> R3 -> R4
7
D
R1 -> R2 -> R3 -> R4
7
E
R1 -> R2 -> R3 -> R4
7
F
R1 -> R2 -> R3 -> R5
5
G
R1 -> R2 -> R6
7

Page 6 of 8

Name:____________________________________

CS244a Midterm
February 20, 2007

Student ID #:_______________________________
Professor Nick McKeown
Campus/SITN-Local/SITN-Remote?____________

_______________________________________________________________________
H

R1 -> R2 -> R3 -> R7

16. (12 points) General. MyTube makes available high-definition 2-hour movies on-line
using MPEG4 compression, which compresses the movie to a rate of 9Mb/s. Users
download them over the network onto a computer in their home, and then watch them
when they are fully downloaded.
(a.) Imagine that the users computer is in the back of their car and is automatically
replenished with new movies (using Wireless Ethernet running at 54Mb/s) each
time they go fill their car with gas. If the user fills their car with gas once per
week, and wants to download 3 movies, how long do they need to spend at the
gas station?

3movies ! 120 min movie ! 60s / min! 9Mb / s


= 3600 sec = 1hour.
54Mb / s
(b.) How fast would the network need to be if they wanted to download three movies
in 10 minutes?
6 times faster; i.e. 324Mb/s.
(c.) How long does it take to download a movie over a 1Mb/s DSL line?

1movies ! 120 min movie ! 60 s / min! 9 Mb / s


= 1080 min = 18hours.
1Mb / s
(d.) Imagine now that MyTube downloads the videos in a trickle to the users
computer in the background over their 1Mb/s DSL connection. The user wants to
watch three movies per week, and MyTube delivers the files at an average rate of
100kb/s (so as to leave plenty of capacity for other applications to share the link).
Can all three movies be downloaded each week?
18hours for one movie at 1Mb/s means 180hours per movie at 100kb/s which is
already more than a week. So no, cant do it.
17. (25 points) TCP. In this question well consider the dynamics of the TCP congestion
control algorithm (slow-start plus AIMD). Consider a video-call that takes place
between Stanford University and Sydney Australia well assume the round-trip time
(RTT) of packets in the network is 250ms. Well assume the video is high-quality and
runs at a peak rate of 10Mb/s with fixed size packets of 125bytes. Well also assume that

Page 7 of 8

Name:____________________________________

CS244a Midterm
February 20, 2007

Student ID #:_______________________________
Professor Nick McKeown
Campus/SITN-Local/SITN-Remote?____________

_______________________________________________________________________
the bottleneck link on the network also runs at 10Mb/s in other words, the video-call is
able to fill the pipe.
(a.) If we assume that the RTT includes the delay through the links and through the
buffer at the bottleneck link, what is the maximum congestion window-size
(cwnd) that TCPs AIMD will use once it reaches equilibrium? Express your
answer in bytes.
(Note: I hadnt meant to say that the RTT was fixed in the network only on the links.
i.e. I wanted to include the fact that the RTT will vary [by 50%] as the buffer fills and
empties. My mistake so I have graded it as if the RTT is fixed, but given the benefit
of the doubt to anyone who assumed it varied as the buffer occupancy varied).
The window size will reach a maximum when the pipe is full:
250ms at 10Mb/s = 2.5Mbits = 312, 500 bytes.
(b.) As a fraction of your answer in (a), what will be the value of cwnd immediately
after it learns that a packet has been dropped.
1/2
(c.) How long will it be until cwnd reaches value it was just before the loss? Express
your answer in seconds.
Each RTT, the window will grow by 125bytes, so it will take W_max/(2 * 125bytes)
RTTs = 312.5 seconds.
(d.) Explain why this could be a problem.
After a packet loss, it takes a very long time to re-reach the maximum window-size. In
the meantime, the rate is well below the maximum rate for the link (assuming many
flows are competing).
(e.) If several losses occur, cwnd is reduced to zero, and the slow-start algorithm is
used until cwnd reaches half of the value it was before the last packet was
dropped. How long does slow-start run for?
Assuming slow-start starts out with one packet (in fact, it starts with two) then we
need to figure out how long to reach 312,500/2 bytes if the window size increases by
125bytes each time an ACK is received. Essentially, the window size doubles each

( 312,500 %
# " 250ms ! 2.5 sec onds
' 2 " 125 $

RTT, so the time taken is: log 2 &

(f.) How much slower can we expect an identical flow to run in a network with an
RTT of 500ms. Assume that both networks experience the same fraction of
dropped packets.
Because we know that the rate is proportional to

1
RTT ! p

then we know that the

rate will be halved and the flow will take approximately twice as long to complete.

Page 8 of 8

Das könnte Ihnen auch gefallen