14
Name:____________________________________ CS244a Final March 22, 2006 Student ID #:_______________________________ Professor Nick McKeown Campus/SITN-Local/SITN-Remote?____________ _______________________________________________________________________ Page 1 of 14 Grade: MC:___ 7:___ 8:___ 9: ____ 10:____ 11: ____12: ____ 13: ____ 14: _____ Total: ____ CS244a: An Introduction to Computer Networks Final Exam: Wednesday March 22, 2006 You are allowed 2 hours 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 (double-sided) 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) Don’t 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. The Stanford Honor Code In accordance with both the letter and spirit of the Honor Code, I didn't cheat on this exam. Signature:________________________________________________________________

Grade: MC: 7: 8: 9: 10: 11: 12: 13: 14: Total: CS244a: …Networks Final Exam: Wednesday March 22, 2006 You are allowed 2 hours to complete this exam. (i) This exam is closed book

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Grade: MC: 7: 8: 9: 10: 11: 12: 13: 14: Total: CS244a: …Networks Final Exam: Wednesday March 22, 2006 You are allowed 2 hours to complete this exam. (i) This exam is closed book

Name:____________________________________ CS244a Final March 22, 2006

Student ID #:_______________________________ Professor Nick McKeown

Campus/SITN-Local/SITN-Remote?____________ _______________________________________________________________________

Page 1 of 14

Grade: MC:___ 7:___ 8:___ 9: ____ 10:____ 11: ____12: ____ 13: ____ 14: _____ Total: ____

CS244a: An Introduction to Computer Networks

Final Exam: Wednesday March 22, 2006

You are allowed 2 hours 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 (double-sided) 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) Don’t 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.

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 2: Grade: MC: 7: 8: 9: 10: 11: 12: 13: 14: Total: CS244a: …Networks Final Exam: Wednesday March 22, 2006 You are allowed 2 hours to complete this exam. (i) This exam is closed book

Name:____________________________________ CS244a Final March 22, 2006

Student ID #:_______________________________ Professor Nick McKeown

Campus/SITN-Local/SITN-Remote?____________ _______________________________________________________________________

Page 2 of 14

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 don’t know an answer, checking no assertion will neither earn you nor lose you any points.

1. Layering. "Layering" is commonly used in computer networks because:

(a.) It forces all network software to be written in ANSI ’C’. (b.) Encapsulation is the lowest overhead method to transmit data. (c.) It allows widespread code and implementation re-use. (d.) It keeps networks warm enabling them to run faster.

2. Elasticity Buffer. An elasticity buffer is used to store bits arriving at a network interface.

If the receiving station uses a 200-bit elasticity buffer and the clocks of the transmitter and receiver have a minimum frequency of 99.999MHz and a maximum frequency of 100.001MHz, which of the following statements are true:

(a.) All packets have to be less than or equal to 12,500 bytes long. (b.) All packets have to be less than or equal to 4500 bytes long. (c.) The two clocks have a tolerance of +/- 100ppm. (d.) The two clocks have a tolerance of +/- 10ppm. (e.) The transmitter’s clock is always faster than the receiver’s clock.

3. TCP. The TCP protocol uses a sliding window protocol. The window size varies because:

(a.) Routers along the route advertise a varying window size to prevent congestion. (b.) The destination advertises a reduced window size when its buffers are congested. (c.) The destination advertises a reduced window size when packets take a long time

to reach it. (d.) The source reduces its window size when it detects that congestion is occurring.

4. Fair Queueing. Which of the following are true:

(a.) A fair queueing scheduler used in a router transmits one packet at a time. (b.) A fair queueing scheduler used in a router transmits just one bit from each packet

at a time before moving onto the next packet. (c.) If traffic arriving at each router in a network is leaky-bucket constrained, and if

each router uses weighted fair queueing schedulers, then bounds can be placed on the end-to-end delay of each packet.

(d.) If a fair queueing scheduler calculates the finishing time of two packets, A and B, such that A is scheduled to depart before B, then at a later time as new packets arrive, the scheduler may change its mind and schedule B ahead of A.

(e.) Weighted fair queueing allows a router to provide each flow with a weighted share of the link capacity.

Page 3: Grade: MC: 7: 8: 9: 10: 11: 12: 13: 14: Total: CS244a: …Networks Final Exam: Wednesday March 22, 2006 You are allowed 2 hours to complete this exam. (i) This exam is closed book

Name:____________________________________ CS244a Final March 22, 2006

Student ID #:_______________________________ Professor Nick McKeown

Campus/SITN-Local/SITN-Remote?____________ _______________________________________________________________________

Page 3 of 14

5. TCP. TCP guarantees a reliable, in-order stream of data. Which of the following are

true? (a.) TCP guarantees that if a byte did not reach the receiver, the sender will find out

and be able to retransmit the data. (b.) TCP guarantees that any error that corrupts the TCP header is detected by the

receiver (c.) TCP guarantees that any error that corrupts the TCP payload is detected by the

receiver (d.) When a sender receives an acknowledgement with ACK sequence number A, it

should assume that all the data up to and including byte A-1 has been correctly received by the destination

(e.) When a sender receives an acknowledgement with ACK sequence number A, it should assume that all the data with a sequence number greater than A has not been received by the destination

6. Link layer. Which of the following are true?

(a.) An Ethernet switch can interconnect a 10Mb/s Ethernet network and a 1Gb/s Ethernet.

(b.) An Ethernet hub can interconnect a 10Mb/s Ethernet network and a 1Gb/s Ethernet.

(c.) An Ethernet network cannot detect collisions until it has computed a checksum over the frame.

(d.) 4B/5B is considered more efficient than Manchester encoding because more user data is transmitted in same amount of time.

(e.) The 802.11b wireless protocol incorporates a link-layer ACK not present in regular Ethernet.

Page 4: Grade: MC: 7: 8: 9: 10: 11: 12: 13: 14: Total: CS244a: …Networks Final Exam: Wednesday March 22, 2006 You are allowed 2 hours to complete this exam. (i) This exam is closed book

Name:____________________________________ CS244a Final March 22, 2006

Student ID #:_______________________________ Professor Nick McKeown

Campus/SITN-Local/SITN-Remote?____________ _______________________________________________________________________

Page 4 of 14

Short questions 7. (3 points) IP. Explain why IPv4 fragments are reassembled at the end-point, rather than at an

intermediate router along the path. 8. (3 points) Physical Layer. You are asked to implement an 8-level coding scheme for a high speed

electrical link, in which 3 bits are sent every 2ns. You measure the signal to noise ratio of the link, and find it to be 30dB. With a spectrum analyzer you determine that the bandwidth of the cable is 100MHz. Assuming that the noise is Gaussian, is it possible to design the link so that it has an arbitrarily low bit-error rate? Explain your answer.

9. (5 points) TCP sequence numbers.

(a.) Why does TCP use a 32-bit sequence number, instead of, say, 16 bits?

(b.) Compute the maximum data rate at which a sender needs to worry about TCP sequence number wrap-around, assuming a maximum segment lifetime of two minutes.

10. (6 points) Security. “Great floods have flown from simple sources.”

Alice, upon moving to Costa Rica, starts a small website using a local ISP for hosting. The ISP guarantees her a 5Mb/s connection. After a couple of days, evil Trudy (the bot queen), launches a SYN flood against Alice's simple setup.

(a.) Explain how and why Alice’s machine is unable to continue providing service. Be as specific as you can, and use your knowledge of how TCP is implemented.

Page 5: Grade: MC: 7: 8: 9: 10: 11: 12: 13: 14: Total: CS244a: …Networks Final Exam: Wednesday March 22, 2006 You are allowed 2 hours to complete this exam. (i) This exam is closed book

Name:____________________________________ CS244a Final March 22, 2006

Student ID #:_______________________________ Professor Nick McKeown

Campus/SITN-Local/SITN-Remote?____________ _______________________________________________________________________

Page 5 of 14

(b.) In response, Alice turns on SYN cookies at her server. Explain how SYN cookies solve the problem of SYN flood attacks.

(c.) Explain how Trudy could increase her attack and still deny access to legitimate clients.

Page 6: Grade: MC: 7: 8: 9: 10: 11: 12: 13: 14: Total: CS244a: …Networks Final Exam: Wednesday March 22, 2006 You are allowed 2 hours to complete this exam. (i) This exam is closed book

Name:____________________________________ CS244a Final March 22, 2006

Student ID #:_______________________________ Professor Nick McKeown

Campus/SITN-Local/SITN-Remote?____________ _______________________________________________________________________

Page 6 of 14

Longer questions 11. (20 points) Ethernet switched networks. Consider the Ethernet network below consisting of

switches that run the Spanning Tree Protocol.

S4S4

S1S1

S2S2

S6S6

S5S5

S7S7 S9S9

S8S8

S3S3

A B

(a.) Sketch the logical spanning tree that the Spanning Tree Protocol will create.

(b.) What use is S9?

Page 7: Grade: MC: 7: 8: 9: 10: 11: 12: 13: 14: Total: CS244a: …Networks Final Exam: Wednesday March 22, 2006 You are allowed 2 hours to complete this exam. (i) This exam is closed book

Name:____________________________________ CS244a Final March 22, 2006

Student ID #:_______________________________ Professor Nick McKeown

Campus/SITN-Local/SITN-Remote?____________ _______________________________________________________________________

Page 7 of 14

(c.) Write down three differences between the Spanning Tree Protocol and Dijkstra’s algorithm, used to calculate routes in OSPF.

(d.) What path will packets take from Host A to Host B? How does this compare to the shortest distance from A to B?

(e.) After A and B have exchanged messages and the Ethernet switches have learned addresses, what will the forwarding table contain for each switch? Write your answer next to each switch in the figure above.

12. (20 points) Routing. Use the Bellman Ford algorithm to find the lowest cost path to computer A from every other computer in the network below. Show how the algorithm evolves at each step, showing the current lowest cost to reach A, and the next hop router to get there from each computer. Assume all the links are bidirectional and symmetric (i.e. the cost of using a link is the same in both directions).

Page 8: Grade: MC: 7: 8: 9: 10: 11: 12: 13: 14: Total: CS244a: …Networks Final Exam: Wednesday March 22, 2006 You are allowed 2 hours to complete this exam. (i) This exam is closed book

Name:____________________________________ CS244a Final March 22, 2006

Student ID #:_______________________________ Professor Nick McKeown

Campus/SITN-Local/SITN-Remote?____________ _______________________________________________________________________

Page 8 of 14

R1R1

R2R2

R5R5

R6R6

R3R3 R4

R4

R7R7

31

4

1

5

65

2

9

A

C

D

B

GH

F

E

Page 9: Grade: MC: 7: 8: 9: 10: 11: 12: 13: 14: Total: CS244a: …Networks Final Exam: Wednesday March 22, 2006 You are allowed 2 hours to complete this exam. (i) This exam is closed book

Name:____________________________________ CS244a Final March 22, 2006

Student ID #:_______________________________ Professor Nick McKeown

Campus/SITN-Local/SITN-Remote?____________ _______________________________________________________________________

Page 9 of 14

13. (20 points) TCP throughput. In this question we will explore the throughput of a TCP flow during the initial “slow-start” phase. In our model, we will assume that during “slow-start”, a TCP source sets the window size, W, equal to one initially, and then increases W by one for each packet for which it receives an acknowledgement. We will assume that the RTT is constant.

(a.) On the axes below, sketch the evolution of W as a function of time until

the first packet is dropped.

RTT 2RTT 3RTT 4RTT

W

1

2

4

8

16

32

64

(b.) Assume that the first packet is dropped when W = Wmax. Show that the throughput, T, of the flow (up until the first drop) is approximately:

( )RTTW

WT

max2

max

log1

12

+−

= .

Page 10: Grade: MC: 7: 8: 9: 10: 11: 12: 13: 14: Total: CS244a: …Networks Final Exam: Wednesday March 22, 2006 You are allowed 2 hours to complete this exam. (i) This exam is closed book

Name:____________________________________ CS244a Final March 22, 2006

Student ID #:_______________________________ Professor Nick McKeown

Campus/SITN-Local/SITN-Remote?____________ _______________________________________________________________________

Page 10 of 14

(c.) Find an expression for T as a function of RTT and p (the probability that a

packet is dropped).

(d.) Suppose now the TCP source sets the window size to W1 initially and as before it increases W by one for every ACK it receives. The TCP receiver sends an ACK for every b-th packet. Show that the number of slow-start rounds needed to transfer L packets in unconstrained slow-start (i.e. no packet drops or a limit on the source’s window size) is:

( ) −−= 11

log1W

Li

αα ,

where b

11+=α .

[Hint: sender’s cwnd in round (i + 1) evolves as cwndi+1 = cwndi (1 + 1/ b). ] (e.) Continuing with the assumptions in part (d), let ( )LWss denote the TCP

window size after sending L packets in unconstrained slow-start. Find an expression for ( )LWss in terms of α,1W , and L.

Page 11: Grade: MC: 7: 8: 9: 10: 11: 12: 13: 14: Total: CS244a: …Networks Final Exam: Wednesday March 22, 2006 You are allowed 2 hours to complete this exam. (i) This exam is closed book

Name:____________________________________ CS244a Final March 22, 2006

Student ID #:_______________________________ Professor Nick McKeown

Campus/SITN-Local/SITN-Remote?____________ _______________________________________________________________________

Page 11 of 14

(f.) Suppose now, b=2, W1 = 1 Kbytes, C =1.5 Mbps, RTT = 70 ms and most flows have transfer sizes less than 10 Kbytes. Using this information and your answer from part (e), conclude that most Internet flows spend their lifetimes in slow-start phase.

Page 12: Grade: MC: 7: 8: 9: 10: 11: 12: 13: 14: Total: CS244a: …Networks Final Exam: Wednesday March 22, 2006 You are allowed 2 hours to complete this exam. (i) This exam is closed book

Name:____________________________________ CS244a Final March 22, 2006

Student ID #:_______________________________ Professor Nick McKeown

Campus/SITN-Local/SITN-Remote?____________ _______________________________________________________________________

Page 12 of 14

14. (20 points) Leaky-buckets. In the figure below, source S sends packets through a router with a buffer of size B to destination D. The link from S to the router runs at rate R1, and the link from the router to the destination runs at rate R2. R2 > R1.

S DR1 R2

B

(a.) Write down the leaky bucket parameters that are an upper bound on the

burstiness and rate of arrivals to D, regardless of the process of packets that S sends into the network.

(b.) Sketch on the axes below a tight upper bound on the cumulative arrivals to D. Your answer should clearly show R1, R2 and B. You only need to show the constraints starting from t=0.

Page 13: Grade: MC: 7: 8: 9: 10: 11: 12: 13: 14: Total: CS244a: …Networks Final Exam: Wednesday March 22, 2006 You are allowed 2 hours to complete this exam. (i) This exam is closed book

Name:____________________________________ CS244a Final March 22, 2006

Student ID #:_______________________________ Professor Nick McKeown

Campus/SITN-Local/SITN-Remote?____________ _______________________________________________________________________

Page 13 of 14

A source sends packets, all of length P, belonging to a single flow through k store-and-forward routers (each with B packet buffers), as shown in the figure below. All the links are l meters long and operate at data-rate R. The source uses a leaky-bucket regulator to limit the burstiness of the flow to σ packets, and the long-term average rate to ρ bits per second.

S ρR b/s

B > σ

ρR b/s

B > σ

ρR b/s

B > σ

D

Router1 Router2 Routerk

R

Page 14: Grade: MC: 7: 8: 9: 10: 11: 12: 13: 14: Total: CS244a: …Networks Final Exam: Wednesday March 22, 2006 You are allowed 2 hours to complete this exam. (i) This exam is closed book

Name:____________________________________ CS244a Final March 22, 2006

Student ID #:_______________________________ Professor Nick McKeown

Campus/SITN-Local/SITN-Remote?____________ _______________________________________________________________________

Page 14 of 14

(c.) Assuming that the scheduler in each router is work-conserving, what is the shortest time for a packet from S to reach D? Explain your answer.

(d.) What is the worst-case end-to-end delay for this flow, assuming it shares the links with many other leaky-bucket constrained flows?