Sei sulla pagina 1di 18

EE 471/ CS 471 /CS 573: Fall 2011-2012 Homework 5 Solution

Instructor: Zartash Afzal Uzmi


Due on Dec 13th , 2011

Solution by
Muhammad Fahad Manzoor and Zartash Afzal Uzmi

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

Review Question 3
Consider a TCP connection between Host A and Host B. Suppose that the TCP segments travelling from Host A to Host B have source port number x and destination number port number y. What are the source and destination for segments travelling from Host B to Host A? Answer Source port number y and destination port number x.

Review Question 5
Why is it that voice and video trac is often sent over TCP rather than UDP in todays Internet.(Hint: The answer we are looking for has nothing to with TCPs congestion-control mechanism.) Answer Since most rewalls are congured to block UDP trac, using TCP for video and voice trac lets the trac though the rewalls.

Review Question 7
Suppose a process in Host C has a UDP socket with port number 6789. Suppose both Host A and Host B each send a UDP segment to Host C with destination port number 6789. Will both of these segments be directed to the same socket at Host C? If so, how will process at Host C know that these two segments originated from two dierent hosts? Answer Yes, both segments will be directed to the same socket. For each received segment, at the socket interface, the operating system will provide the process with the IP addresses to determine the origins of the individual segments.

Review Question 8
Suppose that a Web server runs in Host C on port 80. Suppose this Web server uses persistent connections, and is currently receiving requests from two dierent Hosts, A and B. Are all of the requests being sent through the same socket at Host C? If they are being passed through dierent sockets, do both of the sockets have port 80? Discuss and explain. Answer For each persistent connection, the Web server creates a separate connection socket. Each connection socket is identied with a four-tuple: (source IP address, source port number, destination IP address, destination port number). When host C receives and IP datagram, it examines these four elds in the datagram/segment to determine to which socket it should pass the payload of the TCP segment. Thus, the requests from A and B pass through dierent sockets. The identier for both of these sockets has 80 for the destination port; however, the identiers for these sockets have dierent values for source IP addresses. Unlike UDP, when the transport layer passes a TCP segments payload to the application process, it does not specify the source IP address, as this is implicitly specied by the socket identier. Review Question 14 continued on next page. . . Page 2 of 18

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

Review Question 14
True or false? (a) Host A is sending Host B a large le over a TCP connection. Assume Host B has no data to send to Host A. Host B will not send acknowledgements to Host A because Host B cannot piggyback the acknowledgements on data. (b) The size of the TCP rwnd never changes throughout the duration of the connection. (c) Suppose Host A is sending Host B a large le over TCP connection. The number of unacknowledged bytes that A sends cannot exceed the size of receive buer. (d) Suppose Host A is sending a large le to Host B over TCP connection. If the sequence number for a segment of this connection is m, then the sequence number of subsequent segment will necessarily be m + 1. (e) The TCP segment has a eld in its header for rwnd. (f ) Suppose that the last SampleRTT in a TCP connection is equal to 1 sec. The current value of TimeoutInterval for the connection will necessarily be 1 sec. (g) Suppose Host A sends one segment with sequence number 38 and 4 bytes of data over TCP connection to Host B. In this same segment the acknowledgement number is necessarily 42. Answer (a) false (b) false (c) true (d) false (e) true (f ) false (g) false

Problem 13
Consider a reliable data transfer protocol that uses only negative acknowledgements. Suppose the sender sends data only infrequently. Would a NAK-only protocol be preferable to a protocol that uses ACKs? Why? Now suppose the sender has a lot of data to send and end-to-end connection experiences few losses. In this second case, would a NAK-only protocol be preferable to a protocol that uses ACKs? Why? Answer In a NAK only protocol, the loss of packet x is only detected by the receiver when packet x + 1 is received. That is, the receivers receives x 1 and then x + 1, only when x + 1 is received does the receiver realize that x was missed. If there is a long delay between the transmission of x and the transmission of x + 1, then it will be a long time until x can be recovered, under a NAK only protocol. Page 3 of 18

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

Figure 1: Figure 3.17 referred in Problem 14 of Chapter 3

On the other hand, if data is being sent often, then recovery under a NAK-only scheme could happen quickly. Moreover, if errors are infrequent, then NAKs are only occasionally sent (when needed), and ACK are never sent a signicant reduction in feedback in the NAK-only case over the ACK-only case.

Problem 14
Consider the cross-country example shown in Figure 3.17. How big would the window size have to be for the channel utilization to be greater than 95 percent? Suppose that the size of packet is 1,500 bytes, including both header elds and data. Answer It takes 12 microseconds (or 0.012 milliseconds) to send a packet, as
15008 109

= 12 microseconds.

In order for the sender to be busy 95 percent of the time, we must have 0.012n 30.012 Therefore n is approximately 2736 packets utility = 0.95 =

Problem 19
Consider the GBN protocol with a sender window size of 3 and a sequence number range of 1,024. Suppose that at time t, the next in-order packet that receiver is expecting has a sequence number of k. Assume that the medium does not reorder messages. Answer the following questions: (a) What are the possible sets of sequence numbers inside the senders window at time t? Justify your answer. (b) What are all possible values of the ACK eld in all possible messages currently propagating back to the sender at time t? Justify your answer. Answer Page 4 of 18

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

(a) Here we have a window size of N=3. Suppose the receiver has received packet k-1, and has ACKed that and all other preceeding packets. If all of these ACKs have been received by sender, then senders window is [k, k+N-1]. Suppose next that none of the ACKs have been received at the sender. In this second case, the senders window contains k-1 and the N packets up to and including k-1. The senders window is thus [k-N,k-1]. By these arguments, the senders window is of size 3 and begins somewhere in the range [k-N,k]. (b) If the receiver is waiting for packet k, then it has received (and ACKed) packet k-1 and the N-1 packets before that. If none of those N ACKs have been yet received by the sender, then ACK messages with values of [k-N,k-1] may still be propagating back. Because the sender has sent packets [k-N, k-1], it must be the case that the sender has already received an ACK for k-N-1. Once the receiver has sent an ACK for k-N-1 it will never send an ACK that is less that k-N-1. Thus the range of in-ight ACK values can range from k-N-1 to k-1.

Problem 21
Consider the GBN and SR protocols. Suppose the sequence number space is of size k. What is the largest allowable sender window that will avoid the occurrence of problems such as that in Figure 3.27 for each of these protocols?

Figure 2: Figure 3.27 referred in Problem 21 of Chapter 3

Page 5 of 18

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

Answer In order to avoid the scenario of Figure 3.27, we want to avoid having the leading edge of the receivers window (i.e., the one with the highest sequence number) wrap around in the sequence number space and overlap with the trailing edge (the one with the lowest sequence number in the senders window). That is, the sequence number space must be large enough to t the entire receiver window and the entire sender window without this overlap condition. So we need to determine how large a range of sequence numbers can be covered at any given time by the receiver and sender windows. Suppose that the lowest-sequence number that the receiver is waiting for is packet m. In this case, its window is [m,m+w-1] and it has received (and ACKed) packet m-1 and the w-1 packets before that, where w is the size of the window. If none of those w ACKs have been yet received by the sender, then ACK messages with values of [m-w,m-1] may still be propagating back. If no ACKs with these ACK numbers have been received by the sender, then the senders window would be [m-w,m-1]. Thus, the lower edge of the senders window is m-w, and the leading edge of the receivers window is m+w-1. In order for the leading edge of the receivers window to not overlap with the trailing edge of the senders window, the sequence number space must thus be big enough to accommodate 2w sequence numbers. That is, the sequence number space must be at least twice as large as the window size, k 2w

Problem 22
Answer true or false to the following questions and briey justify your answer: (a) With the SR protocol, it is possible for the sender to receive an ACK for a packet that falls outside of its current window. (b) With GBN, it is possible to for the sender to receive an ACK for a packet that falls outside of its current window. (c) The alternating-bit protocol is same as the SR protocol with a sender and receiver window size of 1. (d) The alternating-bit protocol is the same as the GBN protocol with a sender and receiver window size of 1. Answer (a) True. Suppose the sender has a window size of 3 and sends packets 1, 2, 3 at t0 . At t1 (t1 > t0 ) the receiver ACKS 1, 2, 3. At t2 (t2 > t1 ) the sender times out and resends 1, 2, 3. At t3 the receiver receives the duplicates and re-acknowledges 1, 2, 3. At t4 the sender receives the ACKs that the receiver sent at t1 and advances its window to 4, 5, 6. At t5 the sender receives the ACKs 1, 2, 3 the receiver sent at t2 . These ACKs are outside its window. (b) True. By essentially the same scenario as in (a). (c) True. Problem 24 continued on next page. . . Page 6 of 18

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

Problem 24
Consider sending a enormous le of L bytes from Host A to Host B. Assume an MSS of 536 bytes. (a) What is the maximum value of L such that TCP sequence numbers are not exhausted? Recall that the TCP sequence number eld has 4 bytes. (b) For the L you obtain in (a), nd how long it takes to transmit the le. Assume that a total of 66 bytes transport, network, and data-link header are added to each segment before the resulting packet is sent out over a 155 Mbps link. Ignore ow control and congestion control so A can pump out the segments back to back and continuously. Answer There are 232 = 4, 294, 967, 296 possible sequence numbers. (a) The sequence number does not increment by one with each segment. Rather, it increments by the number of bytes of data sent. So the size of the MSS is irrelevant the maximum size le that can be sent from A to B is simply the number of bytes representable by 232 = 4.19 Gbytes. (b) The number of segments is
232 536

= 8, 012, 999. When 66 bytes of header get added to each

segment, we have a total of 8,012,999 66 = 528,857,934 bytes of header. The total number of bytes transmitted is 232 + 528, 857, 934 = 4.824 109 bytes. Thus it would take 249 seconds to transmit the le over a 155 Mbps link.

Problem 26
Host A and B are directly connected with a 100 Mbps link. There is one TCP connection between the two hosts, and Host A is sending to Host B an enormous le over this connection. Host A can send its application data into its TCP socket at a rate as high as 120 Mbps but Host B can read out of its TCP receive buer at a maximum rate of 60 Mbps. Describe the aect of TCP ow control. Answer Since the link capacity is only 100 Mbps, so host As sending rate can be at most 100Mbps. Still, host A sends data into the receive buer faster than Host B can remove data from the buer. The receive buer lls up at a rate of roughly 40Mbps. When the buer is full, Host B signals to Host A to stop sending data by setting RcvWindow = 0. Host A then stops sending until it receives a TCP segment with RcvWindow>0. Host A will thus repeatedly stop and start sending as a function of the RcvWindow values it receives from Host B. On average, the long-term rate at which Host A sends data to Host B as part of this connection is no more than 60Mbps.

Problem 34
Compare GBN, SR and TCP (no delayed ACK). Assume that the timeout values for all three protocols are suciently long such that 5 consecutive data segments and their corresponding ACKs can be received (if not lost in the channel) by the receiving host (Host B) and the sending host (Host A) respectively. Suppose Host A sends 5 data segments to Host B, and the 2nd segment (sent from A) is lost. In the end, all 5 segments have been correctly received by Host B. Problem 34 continued on next page. . . Page 7 of 18

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

(a) How many segments has Host A sent in total and how many ACKs has Host B sent in total? What are their sequence numbers? Answer this question for all three protocols. (b) If the timeout values for all three protocols are much longer than 5 RTT, then which protocol successfully delivers all ve data segments in shortest time interval? Answer (a) GoBackN: A sends 9 segments in total. They are initially sent segments 1, 2, 3, 4, 5 and later re-sent segments 2, 3, 4, and 5. B sends 8 ACKs. They are 4 ACKS with sequence number 1, and 4 ACKS with sequence numbers 2, 3, 4, and 5. Selective Repeat: A sends 6 segments in total. They are initially sent segments 1, 2, 3, 4, 5 and later re-sent segments 2. B sends 5 ACKs. They are 4 ACKS with sequence number 1, 3, 4, 5. And there is one ACK with sequence number 2. TCP: A sends 6 segments in total. They are initially sent segments 1, 2, 3, 4, 5 and later re-sent segments 2. B sends 5 ACKs. They are 4 ACKS with sequence number 2. There is one ACK with sequence numbers 6. Note that TCP always send an ACK with expected sequence number. (b) TCP. This is because TCP uses fast retransmit without waiting until time out.

Question 1
Consider two hosts A and B that have data to be exchanged using TCP. In this problem, we will assume that the propagation delay between the two hosts is one time slot equal to the transmission of a packet (assumed of constant size), and the hosts never have urgent data to be transmitted. No data in a packet can be used prior to the complete reception of that packet. The maximum data eld in a packet is 200 bytes. Assume that Host A has a buer to receive data from the other host of size 800 bytes, and Host B has a buer to receive data from Host A of size 400 bytes. Further assume that the time to transfer the data to the higher layer once a packet is received is negligible. No errors ever occur in transmission. Hosts use maximum size packets whenever possible. Host A has 900 bytes to send to Host B, and Host B has 1300 bytes to send to Host A. Consider that Host A initiates the opening of a connection, which is accepted by Host B. Host A starts with sequence number equal to 428 and declares a TCP window size equal to 800, and Host B wants to start with sequence number 374 and declares a TCP window size equal to 400. Both window sizes remain unchanged for the entire duration of the session. If a station is blocked because of the window declaration, it does not send an empty data unit just to acknowledge received data. The table on the next page shows only the relevant parts of the TCP header. Fill in the elds showing the sequence of TCP data units exchanged in opening the connection, in the data transfer phase, and in closing the connection. Consider that a host closes its side of the connection as soon as it nishes the transmission of its data, and following the close, it continuously acknowledges data received from the other side. If a eld is not used, leave it blank. Page 8 of 18

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

Answer See interaction of hosts in the following table.

HOST A (900 bytes to send) SEQ# ACK# WINDOW SYN FIN ACK 428 800 1 0 0

HOST B (1300 bytes to send) ACK FIN SYN WINDOW ACK# SEQ#

400

429

374

429 629

375 375

800 800

0 0

0 0

1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 400 400 400 400 400 400 629 829 829 829 375 575 775 975

829 1029

575 775

800 800

0 0

0 0

1 1

1 1 1 1

1029 1175 1229 1375

1229 1375 1329 1575

800 800

0 0

0 0

1 1 1 1 0 1 0 0 400 400 1329 1575 1330 1675

1330 1675 1330 1676

800 800

0 0

0 0

1 1

timed wait before deletion connection deleted

Question 2 continued on next page. . .

Page 9 of 18

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

Question 2
Consider two stations A and B directly connected over an unreliable physical channel. Our goal is to provide a reliable channel at the data link layer between these two stations. Time is slotted with the slot size taken to be the unit of time. The 1-way propagation delay is d slots, where d is assumed to be an integer. All frames are of equal size, and the transmission time of a frame is exactly one slot. We are interested in the transmission of frames from A to B. We assume that the processing delay at station B is negligible, and that acknowledgments for frames transmitted by A are sent from B at the earliest possible time. Since the frames are of equal size, and d is an integer, we can consider the time axis to be slotted with the slot size equal to a frame transmission time, and the two stations A and B to be synchronized. (a) Assume an environment where no transmission errors can occur in either direction. Find the minimum values for the sending window size Ws , the receive window size Wr , and the sequence range (starting at 0) which achieve maximum eciency. For the rest of the question, consider an environment where noise occurs in bursts on an infrequent basis; however each noise occurrence causes a certain number of consecutive packets k 1 to be received in error. In this problem, we assume that errors occur in packet transmissions from A to B only, and thus acknowledgement packets from B are always received by A correctly. We consider the use of the Go-Back-N (GBN) mechanism and the selective repeat (SR) mechanism for error recovery, and we are interested in the eciency of these mechanisms in the environment described. We further assume that: i) the time-out at the sender is very large, and should not be counted on for recovery; i.e., the only way to detect frames received in error is by receiving a frame out-of-order. ii) the time that separates noise occurrences is large compared to the time it takes to recover from errors. (b) Consider the case where the GBN mechanism is used. Give as a function of k the minimum values of Ws and Wr that minimize the number of wasted slots (i.e., idle slots, erroneous transmissions, and retransmissions), as compared to the ideal case of part (a) where no errors occur. (c) Consider the case where only the SR mechanism is used. Give as a function of k the minimum values of Ws and Wr that minimize the number of wasted slots (i.e., idle slots, erroneous transmissions, and retransmissions). (d) Which of the two mechanisms gives the best performance (i.e., minimum number of wasted slots) as a function of k (assuming their respective optimal window sizes are used.) Answer (a) The send window should be large enough to keep the sender busy until the rst frame is acknowledged, i.e., Ws = 2d + 2. Receive window can be as small as possible because frames never arrive out of order, i.e., Wr = 1. The sequence range should be 0, 1, . . . , 2d + 1. (b) With GBN, there is no need to make receive window any larger than what it is in part (a), because out of order frames will not be entertained by the receiver anyways. Thus, Wr = 1 is the minimum receive window. The send window also does not need to be changed from part (a) except that after sending k erroneous frames, the sender must be able to send one correct frame. Page 10 of 18

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

This is because the recovery can only start when a duplicate ACK (or NACK) is received by the sender, which will be sent by the receiver only after receiving a correct but unexpected frame. Thus, Ws = max{2d + 2, k + 1}. (c) With SR, consider the rst erroneous frame from the sender. This streak of erroneous frames continues for k consecutive frames, as given in the problem statement. The sender nds out about the rst erroneous frame k + 2d + 2 slots later, when it receives an ACK from the receiver asking for a retransmit of the rst erroneous frame. Similarly, error in the k th frame is detected at k + k(2d + 2). The ACK that completes the error recovery arrives at the sender at k + (k + 1)(2d + 2). At this point, k frames were sent twice and k 1 frames were acknowledged. Hence, Ws = (2d + 2)(k + 1) + k k (k 1) = (2d + 2)(k + 1) k + 1 (1) (2)

The maximum number of out of order frames at the receiver is just before the k th erroneous frame is received for the second time (this time, correctly, as per problem statement). This maximum number of out of order frames dictates the receive window size. Note that frame k is sent for the second time at slot k + k(2d + 2) + 1. At this time, k frames were sent twice and k 1 were received in order and removed from the window. Thus, Wr = k(2d + 2) + k + 1 k (k 1) = k(2d + 2) k + 2 (3) (4)

(d) When optimal window sizes are used, the number of wasted slots in SR is k. Using GBN, the number of wasted slots is k + 2d + 2. Thus, SR is always better than GBN in terms of number of wasted slots.

Question 3: (Fragmentation and Reassembly)


Consider a series of networks (or subnets) connected by routers as shown in the gure. When an IP packet is forwarded onto a network whose MTU is smaller, the packet needs to be fragmented. Host A wants to send two IP packets to host B; the ID and LEN of the of the packets are: i) Packet 1: ID=412, LEN=400 ii) Packet 2: ID=413, LEN=700 Assume that IP headers are 20 bytes long (i.e., no options). (a) Fill in the tables depicting how packets ow on each network, using one row for each IP packet or a fragment. Fill in all elds including ID, OFFSET, M (where M is the more fragments? bit which is set to 0 if there are no more fragments to follow). (b) Why is there an MTU for a given network? One line! (c) What does the MTU of a network might depend on? One line! Page 11 of 18

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

Router A Subnet X MTU=300


Subnet X: A R1 ID M OFFSET

Router Subnet Y MTU=1000 R2 Subnet Z MTU=200 B

R1

Subnet Y: R1 R2 ID M OFFSET

Subnet Z: R2 B ID M OFFSET

Answer (a) Subnet ID 412 412 413 413 413 X: A R1 M OFFSET 1 0 0 35 1 0 1 35 0 70 Subnet ID 412 412 413 413 413 Y: R1 R2 M OFFSET 1 0 0 35 1 0 1 35 0 70 Subnet Z: R2 B ID M OFFSET 412 1 0 412 1 22 412 0 35 413 1 0 413 1 22 413 1 35 413 1 57 413 0 70

(b) To keep the packet error rates within/below a desirable level. (c) Bit error rate and target packet error rate.

Review Question 27
Why are dierent inter-AS and intra-AS protocols used in the Internet? Answer Intra-AS protocols have been designed by keeping in mind the performance parameters within the AS but the inter-AS protocol aim to advertise the subnets based on the policy of the AS.

Review Question 30
How does BGP use the NEXT-HOP attribute? How does it use the AS-PATH attribute? Page 12 of 18

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

Answer Routers use the AS-PATH attribute to detect and prevent looping advertisements; they also use it in choosing among multiple paths to the same prex. The NEXT-HOP attribute indicates the IP address of the rst router along an advertised path (outside of the AS receiving the advertisement) to a given prex. When conguring its forwarding table, a router uses the NEXT-HOP attribute.

Problem 18
Suppose datagrams are limited to 1,500 bytes (including header) between source Host A and destination Host B. Assuming a 20-byte IP header, how many datagrams would be required to send and MP3 consisting of 5 million bytes? Explain how you computed your answer. Answer Assume the data is carried in TCP segments, with each TCP segment also having 20 bytes of header. Then each datagram can carry 1500-40=1460 bytes of the MP3 le. Number of datagrams required = 5 106 1460 = 3425

All but the last datagram will be 1,500 bytes; the last datagram will be 960+40 = 1000 bytes. Note that here there is not fragmentation the source host does not create datagrams larger than 1500 bytes, and these datagrams are smaller than the MTUs of the links.

Problem 20
Suppose you are interested in detecting the number of hosts behind a NAT. You observe that the IP layer stamps an identication number sequentially on each IP packet. The identication number of rst packet generated by a host is random number, and the identication numbers of the subsequent IP packets are sequentially assigned. Assume all packets generated by hosts behind NAT are sent to the outside world. (a) Based on this observation, and assuming you can sni all packets sent by the NAT to the outside, can you outline a simple technique that detects the number of unique hosts behind a NAT? Justify your answer. (b) If the identication numbers are not sequentially assigned but randomly assigned, would your technique work? Justify your answer. Answer (a) Since all IP packets are sent outside, so we can use a packet snier to record all IP packets generated by the hosts behind a NAT. As each host generates a sequence of IP packets with sequential numbers and a distinct (very likely, as they are randomly chosen from a large space) initial identication number (ID), we can group IP packets with consecutive IDs into a cluster. The number of clusters is the number of hosts behind the NAT. (b) However, if those identication numbers are not sequentially assigned but randomly assigned, the technique suggested in part (a) wont work, as there wont be clusters in snied data. Problem 21 continued on next page. . . Page 13 of 18

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

Problem 21
In this problem well explore the impact of NATs on P2P applications. Suppose a peer with username Arnold discovers through querying that a peer with username Bernard has a le it wants to download. Also suppose that Bernard and Arnold are both behind a NAT. Try to devise a technique that will allow Arnold to establish a TCP connection with Bernard without application specic NAT conguration. If you have diculty devising such a technique, discuss why. Answer It is not possible to devise such a technique. In order to establish a direct TCP connection between Arnold and Bernard, either Arnold or Bob must initiate a connection to the other. But the NATs covering Arnold and Bob drop SYN packets arriving from the WAN side. Thus neither Arnold nor Bob can initiate a TCP connection to the other if they are both behind NATs.

Problem 24
Consider the following network. With the indicated link costs, use Dijkstras shortest-path algorithm to compute the shortest path from x to all network nodes. Show how the algorithm works by computing a table similar to table 4.3.

Figure 3: Figure and table referred in Problem 24 of Chapter 4

Page 14 of 18

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

Answer Step 0 1 2 3 4 5 6 N x xv xvu xvuw xvuwy xvuwyt xvuwytz D(t),p(t) 7,v 7,v 7,v 7,v 7,v 7,v D(u),p(u) 6,v 6,v 6,v 6,v 6,v 6,v D(v),p(v) 3,x 3,x 3,x 3,x 3,x 3,x 3,x D(w),p(w) 6,x 6,x 6,x 6,x 6,x 6,x 6,x D(y),p(y) 6,x 6,x 6,x 6,x 6,x 6,x 6,x D(z),p(z) 8,x 8,x 8,x 8,x 8,x 8,x 8,x

Problem 26
Consider the network shown below, and assume that each node initially knows the cost to each of its neighbours. Consider the distance-vector algorithm and show the distance table entries at node z.

Figure 4: Figure referred in Problem 26 of Chapter 4 Answer Cost to u From v x z v 6 x 2 y z 0 From v x z Cost to u 1 7 v 0 3 5 x 3 0 2 y 3 5 z 6 2 0

Cost to u From v x z 1 4 6 v 0 3 5 x 3 0 2 y 3 3 5 z 5 2 0 From v x z

Cost to u 1 4 6 v 0 3 5 x 3 0 2 y 3 3 5 z 5 2 0

Problem 31
Argue that for the distance-vector algorithm in Fig. 4.30, each value in the distance vector D(x) is nonincreasing and will eventually stabilize in a nite number of steps.

Page 15 of 18

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

Figure 5: Figure 4.31 referred in Problem 31 of Chapter 4 Answer At each step, each updating of a nodes distance vectors is based on the Bellman-Ford equation, i.e., only decreasing those values in its distance vector. There is no increasing in values. If no updating, then no message will be sent out. Thus, D(x) is non-increasing. Since those costs are nite, then eventually distance vectors will be stabilized in nite steps.

Problem 34
Will a BGP router always choose the loop-free route with shortest AS-path length? Justify your answer. Answer The chosen path is not necessarily the shortest AS-path. Recall that there are many issues to be considered in the route selection process. It is very likely that a longer loop-free path is preferred over a shorter loop-free path due to economic reason. For example, an AS might prefer to send Page 16 of 18

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

trac to one neighbour instead of another neighbour with shorter AS distance.

Problem 35
Consider the network shown below. Suppose that AS3 and AS2 are running OSPF for their intra-AS routing protocol. Suppose AS1 and AS4 are running RIP for their intra-AS routing protocol. Suppose eBGP and iBGP are used for the inter-AS routing protocol. Initially suppose there is no physical link between AS2 and AS4. (a) Router 3c learns about prex x from which routing protocol: OSPF, RIP, eBGP, or iBGP? (b) Router 3a learns about prex x from which routing protocol? (c) Router 1c learns about prex x from which routing protocol? (d) Router 1d learns about prex x from which routing protocol?

Figure 6: Figure referred in Problem 35 & 36 of Chapter 4 Answer (a) eBGP (b) iBGP (c) eBGP (d) iBGP

Problem 36
Referring to the previous problem, once router 1d learns about x it will put an entry (x, I) in its forwarding table. (a) Will I be equal to I1 or I2 for this entry? Explain why in one sentence. (b) Now suppose that there is a physical link between AS2 and AS4, shown by the dotted line. Suppose router 1d learns that x is accessible via AS2 as well as vis AS3. Will I be set toI1 or I2 ? Explain why in one sentence. Problem 36 continued on next page. . . Page 17 of 18

Handout # 28

EE 471/ CS 471 /CS 573: Fall 2011-2012

Due on Dec 13th , 2011

(c) Now suppose there is another AS, called AS5, which lies on the path between AS2 and AS4 (not shown in diagram). Suppose router 1d learns that x is accessible via AS2 AS5 AS4 as well as via AS3 AS4. Will I be set toI1 or I2 ? Explain why in one sentence. Answer (a) I1 , because this interface begins the least cost path from 1d towards the gateway router 1c. (b) I2 . Both routes have equal AS-PATH length but I2 begins the path that has the closest NEXT-HOP router. (c) I1 . I1 begins the path that has the shortest AS-PATH.

Figure 7: Figure 4.31 referred in Problem 37 of Chapter 4

Problem 37
Consider the following network. ISP B provides national backbone service to regional ISP A. ISP C provides national backbone service to ISP D. Each ISP consists of one AS. B and C peer with each other in two places using BGP. Consider trac going from A to D. B would prefer to hand that trac over to C on the West Coast (so that C would have to absorb the cost of carrying the trac cross-country), while C would prefer to get the trac via its East Coast peering point with B (so that B would have carried trac across the country). What BGP mechanism might C use, so that B would hand over A-to-D trac at its East Coast peering point? To answer this question you will need to dig into the BGP specication. Answer One way for C to force B to hand over all of Bs trac to D on the east coast is for C to only advertise its route to D via its east coast peering point with C.

Page 18 of 18

Potrebbero piacerti anche