Docsity

Quiz III, Summaries of Computer Networks

Toggle sidebar
bg1
6.02 Fall 2009, Quiz 3 Page 1 of 13
Department of Electrical Engineering and Computer Science
MASSACHUSETTS INSTITUTE OF TECHNOLOGY
6.02 Fall 2009
Quiz III
There are 24 questions and 13 pages in this quiz booklet. Answer each question according to the
instructions given. You have 120 minutes to answer the questions.
If you find a question ambiguous, be sure to write down any assumptions you make. Please be
neat and legible. If we can’t understand your answer, we can’t give you credit!
Use the empty sides of this booklet if you need scratch space. You may also use them for answers,
although you shouldn’t need to. If you do use the blank sides for answers, make sure to clearly
say so!
Before you start, please write your name CLEARLY in the space below.
One two-sided “crib sheet” and calculator allowed. No other notes, books, computers, cell
phones, PDAs, information appliances, carrier pigeons carrying answer slips, etc.!
Do not write in the boxes below
1-5 (x/24) 6-11 (x/29) 12-17 (x/27) 18-24(x/20) Total (x/100)
Name: SOLUTIONS
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Quiz III and more Summaries Computer Networks in PDF only on Docsity!

Department of Electrical Engineering and Computer Science

MASSACHUSETTS INSTITUTE OF TECHNOLOGY

6.02 Fall 2009

Quiz III

There are 24 questions and 13 pages in this quiz booklet. Answer each question according to the instructions given. You have 120 minutes to answer the questions.

If you find a question ambiguous, be sure to write down any assumptions you make. Please be neat and legible. If we can’t understand your answer, we can’t give you credit!

Use the empty sides of this booklet if you need scratch space. You may also use them for answers, although you shouldn’t need to. If you do use the blank sides for answers, make sure to clearly say so!

Before you start, please write your name CLEARLY in the space below.

One two-sided “crib sheet” and calculator allowed. No other notes, books, computers, cell phones, PDAs, information appliances, carrier pigeons carrying answer slips, etc.!

Do not write in the boxes below

1-5 (x/24) 6-11 (x/29) 12-17 (x/27) 18-24(x/20) Total (x/100)

Name: SOLUTIONS

I MAC Protocols

Alyssa P. Hacker is setting up an 8-node broadcast network in her apartment building in which all nodes can hear each other. Nodes send packets of the same size. If packet collisions occur, both packets are corrupted and lost; no other packet losses occur. All nodes generate equal load on average.

  1. [4 points]: Alyssa observes a utilization of 0.5. Which of the following are consistent with the observed utilization? (Circle True or False for each choice.)

A. True / False Four nodes are backlogged on average, and the network is using Slotted Aloha with stabilization, and the fairness is close to 1. False. With four backlogged nodes and fairness close to 1, the probability of of transmission is 1/4. That would put the utilization at 4 · 1 / 4 · (1 − 1 /4)^3 < 0. 5. B. True / False Four nodes are backlogged on average, and the network is using TDMA, and the fairness is close to 1. True. TDMA gives each node an equal share of the network, but 4 nodes have nothing to send, giving a utilization of 0.5. 2 points each.

Now suppose Alyssa’s 8-node network runs the Carrier Sense Multiple Access (CSMA) MAC protocol. The maximum data rate of the network is 10 Megabits/s. Including retries, each node sends traffic according to some unknown random process at an average rate of 1 Megabit/s per node. Alyssa measures the network’s utilization and finds that it is 0.75. No packets get dropped in the network except due to collisions, and each node’s average queue size is 5 packets.

  1. [4 points]: What fraction of packets sent by the nodes (including retries) experience a collision? (Explain your answer in the space below.) Solution. The offered load presented to the network is 8 Megabits/s in aggregate. The throughput of the protocol is 0. 75 · 10 = 7. 5 Megabits/s. The packet collision rate is therefore equal to 1 − 7. 5 /8 = 1 /16 = 6. 25 %.

As mentioned earlier, the average number of packets in a node’s queue is 5. Each packet is 10000 bits long.

  1. [4 points]: What is the average queueing delay, in milliseconds, experienced by a packet before it is sent over the medium? (Explain your answer in the space below.) Solution. Apply Little’s law. The rate at which the network processes packets is 106 / 104 = 100 packets/s. The average queueing delay is therefore equal to 5 / 100 seconds, or 50 milliseconds.

II Reliable Data Transport

In the reliable transport protocols we studied, the receiver sends an acknowledgment (ACK) saying “I got k” whenever it receives a packet with sequence number k. Ben Bitdiddle invents a different method using cumulative ACKs: whenever the receiver gets a packet, whether in order or not, it sends an ACK saying “I got every packet up to and including ”, where is the highest, in-order packet received so far.

The definition of the window is the same as before: a window size of W means that the maximum number of unacknowledged packets is W. Every time the sender gets an ACK, it may transmit one or more packets, within the constraint of the window size. It also implements a timeout mechanism to retransmit packets that it believes are lost using the algorithm from class and Lab 10.

Network assumptions. The protocol runs over a best-effort network, but no packet or ACK is duplicated at the network or link layers.

  1. [5 + 2 = 7 points]: The sender sends a stream of new packets according to the sliding window protocol, and in response gets the following cumulative ACKs from the receiver:

1 2 3 4 4 4 4 4 4 4

A. Now, suppose that the sender times out and retransmits the first unacknowledged packet. When the receiver gets that retransmitted packet, what can you say about the ACK, a, that it sends? (Circle the BEST answer) (a) a = 5. (b) a ≥ 5. (c) 5 ≤ a ≤ 11. (d) a = 11. (e) a ≤ 11. Solution. (b), a ≥ 5. The reason is that packet 6 could also be lost. It might be tempt- ing to pick (c), but that would be incorrect because the receiver might have received packets 6 , 7 ,... , 11 , 12 ,.. ., and the receiver’s ACKs for 12 ,... lost, yielding the sequence of ACKs. Now, when the receiver gets 5, the cumulative ACK it sends would be larger than 11. For this reason, choices (d) and (e) are also wrong. B. Is it possible for the given sequence of cumulative ACKs to have arrived at the sender even when no packets were lost en route to the receiver when they were sent? (Explain your answer in the space below.) Solution. Yes, 5 may be reordered in the network and experiencing a long delay.

  1. [4 points]: A little bit into the data transfer, the sender observes the following sequence of cumulative ACKs sent from the receiver:

21 22 23 25 28

The window size is 8 packets. What packet(s) should the sender transmit upon receiving each of the above ACKs, if it wants to maximize the number of unacknowledged packets?

On getting ACK # → Send ?? On getting ACK # → Send ??

  1. [2 points]: Give one example of a situation where the cumulative ACK protocol gets higher throughput than the sliding window protocol described in class and Lab 10. Solution. When ACKs are lost, but data packets aren’t, the cumulative ACK protocol provides higher throughput than the one we studied in class because the sender may not need to retransmit the packet presumed missing.

Ben decides to use the sliding window transport protocol we studied in 6.02 and implemented in Lab 10 on the network below. The receiver sends end-to-end ACKs to the sender. The switch in the middle simply forwards packets in best-effort fashion.

Sender Switch Receiver

Queue (^106) bytes/s

106 bytes/s

108 bytes/s

108 bytes/s

One‐way propaga>on delay

= 10 milliseconds

Propaga>on delay

= 0 milliseconds

Max queue size = 30 packets

Packet size = 1000 bytes

ACK size = 40 bytes

Ini>al sender window size = 10 packets

  1. [5 points]: The sender’s window size is 10 packets. At what approximate rate (in packets per second) will the protocol deliver a multi-gigabyte file from the sender to the receiver? Assume that there is no other traffic in the network and packets can only be lost because the queues overflow. (Circle the BEST answer)

A. Between 900 and 1000. B. Between 450 and 500. C. Between 225 and 250.

  1. [2 points]: The sender uses an exponentially weighted moving average (EWMA) filter to estimate the smoothed round trip time, srtt, every time it gets an ACK with an RTT sample r.

srtt → α · r +(1 − α)· srtt

We would like every packet in a window to contribute a weight of at least 1% to the srtt calculation. As the window size increases, should α increase, decrease, or remain the same, to achieve this goal? (You should be able to answer this question without writing any equations.) (Explain your answer in the space below.)

Solution. α should decrease. If α is small, the EWMA has more history, and as α becomes larger, the contribution reduces. One can write out a mathematical expression, but it isn’t necessary to answer the question.

III Routing and the Network Layer

  1. [4 points]: We studied a few principles for designing networks in 6.02.

A. State one significant difference between a circuit-switched and a packet-switched network. (Explain your answer in the space below.) In a packet-switched network, packets carry information in the header that tells the switches about the destination. Circuit-switched networks don’t carry any destination information in the data frames. The abstraction provided by a circuit-switched network is that of a dedicated link of a fixed rate; a packet-switched network provides no such guarantee to the communicating end points. B. Why does topological addressing enable large networks to be built? (Explain your answer in the space below.) It reduces the size of the routing tables and the amount of information that must be exchanged in the routing protocol.

  1. [8 points]: Eager B. Eaver implements distance vector routing in his network in which the links all have arbitrary positive costs. In addition, there are at least two paths between any two nodes in the network. One node, u, has an erroneous implementation of the integration step: it takes the advertised costs from each neighbor and picks the route corresponding to the minimum advertised cost to each destination as its route to that destination, without adding the link cost to the neighbor. It breaks any ties arbitrarily. All the other nodes are implemented correctly. Let’s use the term “correct route” to mean the route that corresponds to the minimum-cost path. Which of the following statements are true of Eager’s network?

A. True / False Only u may have incorrect routes to any other node. B. True / False Only u and u’s neighbors may have incorrect routes to any other node. C. True / False In some topologies, all nodes may have correct routes. D. True / False Even if no HELLO or advertisements packets are lost and no link or node failures occur, a routing loop may occur.

Solution. A and B are false, C is true, and D is false. A is false because u could propagate an incorrect cost to its neighbors causing the neighbor to have an incorrect route. In fact, u’s neighbors could do the same. C is correct; a simple example is where the network is a tree, where there is exactly one path between any two nodes. D is false; no routing loops can occur under the stated condition. We can reason by contradiction. Consider the shortest path from any node s to any other node t running the flawed routing protocol. If the path does not traverse u, no node on that path can have a loop because distance vector routing without any packet loss or failures is loop-free. Now consider the nodes for which the computed paths go through u; all these nodes are correctly implemented except for u, which means the paths between u and each of them is loop-free. Moreover, the path to u is itself loop-free because u picks one of its neighbors with smaller cost, and there is no possibility of a loop.

Alyssa now inspects node C, and finds that it looks like the picture below. She is sure that the bold (not dashed) links belong to the shortest path tree from node C, but is not sure of the dashed links.

C

B D

F

E

A

  1. [3 points]: List all the dotted links that are guaranteed to be on the routing tree at node C. (Explain your answer in the space below.) Solution. AD is guaranteed to be on the routing tree because AD is on the shortest path tree from node A. No other dotted link is guaranteed to be on a shortest path from C.
  2. [5 points]: List all the dotted links that are guaranteed not to be (i.e., surely not) on the routing tree at node C. (Explain your answer in the space below.) Solution. BD, BA, AF, DE.

IV Information and Huffman Coding

  1. [2 points]: I randomly select a letter from the 26-letter alphabet and tell you that my letter is not X, Y, or Z. How much information have I told you about my letter? Give a number or an expression. Solution. Before, N = 26, after, N = 23. Information received = log 2 (26/23) bits.
  2. [2 points]: You are trying to guess a card picked at random from a standard 52-card deck. Sam tells you the card is a spade; Nora tells you it’s not an ace; Rita tells you it’s a seven. What is the total amount of information about the card given by Sam, Nora, and Rita? Give a number or an expression. Solution. Observe that you now know the card exactly (it’s a 7 of spades). So you’ve gone down from 52 choices to 1, and have received log 2 (52/1) bits of information.

Consider the five 6-leaf binary trees shown below, each of which diagrams a particular Huffman code for message sequences composed from six symbols A, B, C, D, E, F. Each symbol has an associated proba- bility p(A), p(B), p(C), p(D), p(E), p(F ).

  1. [3 points]: Which tree or trees are consistent with a Huffman code where p(A) > 0. 5? Solution. Trees 1, 4, 5.
  2. [3 points]: Which tree or trees are consistent with a Huffman code where all six of the probabil- ities are equal?

Solution. Tree 2.