University of California at Berkeley CS168, Homework 2

Transcription

University of California at Berkeley CS168, Homework 2
University of California at Berkeley
Department of Electrical Engineering and Computer Sciences
CS168, Homework 2
Due at Noon on Thursday, October 16, 2014
INSTRUCTIONS—READ THEM NOW!
-
-
-
-
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 boxes.
Use your @berkeley.edu email address to sign in to Pandagrader. If you don’t
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 homework’s 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.
In general, if something is unclear, write down your assumptions as part of
your answer. If your assumptions are reasonable, we will endeavor to grade the
question based on them.
If you have questions, ask on Piazza or come to office hours.
Please write your SID on each page!
Name – Please Print!
(Signature)
SID
Discussion Section (Day/Time)
Q1. Miscellaneous Short Questions [26 points] 1a) [2 points] Consider the following network containing two regional and two national ISPs, each of which is an autonomous system. AS B provides national service to regional AS A. AS C provides national service to regional AS D. B and C peer with each other in two places using BGP. Consider traffic going from A to D. B would prefer to hand that traffic over to C on the West Coast (so that C w
ould going
have from
to absorb the ost of prefer
carrying the tthat
raffic cross-­‐country), while other in two places
using
BGP.
Consider
traffic
A to D.
B cwould
to hand
traffic
over
would get thave
he traffic via its oast peering oint w
ith B (so that while
B would have to C on the WestC Coast
(soprefer that Cto would
to absorb
theEast costCof
carrying
the p
traffic
cross-country),
C would prefer to
get thethe traffic
via aits
Eastthe Coast
peeringW
point
B echanism (so that B m
would
carried
theB would hand carried traffic cross country). hat Bwith
GP m
ight Chave
use, so that traffic across the over country).
What
BGP
mechanism
might
C
use,
so
that
B
would
hand
over
A-to-D
traffic
at
A-­‐to-­‐D traffic at its East Coast peering point? its East Coast peering point? To answer this question, you will need to dig into the BGP specification.
(P42) In Figure 1, suppose that stub network V is a customer of ISP A. Suppose that B and C have a peering
relationship, and A is a customer of both B and C. Suppose that A would like to have the traffic destined to
W to come from B only, and the traffic destined to V from either B or C. How should A advertise its routes
to B and C? What AS routes does C receive?
1b) [2 points] Indicate whether the following statements are True or False by circling the appropriate answer: Figure 1: Problem 5 topology
(P51) In Section 4.5.1, weTrue studiedFalse Dijkstra’s
algorithm
unicast paths that
link-state
The routing
TTL field in IPv4 for
is ncomputing
ot used in the
practice are individually the least-cost paths from the source to all destinations. The union of these paths might be
True False pathIPv6 do not unicast
fragment thought of as forming a least-unicast-cost
treerouters (or a shortest
pathpackets tree, if all link costs are
identical). By constructing a counterexample, show that the least-cost path tree is not always the same as a
CIDR enables more efficient use of the IP address space minimum spanning tree. True False True False Poison-­‐Reverse eliminates the counting-­‐to-­‐infinity problem 2
1c) [2 points] Routing protocols such as RIP (distance-­‐vector) and OSPF (link-­‐state) are typically implemented at: (Circle one) a. The control processor of each router in a domain b. The control processor at only the border routers of a domain c. The line-­‐cards of each router in a domain d. None of the above 1d) [2 points] Which of the following are true? The aggregation of multiple IP addresses into a single prefix: (Circle all that are true) a. Reduces the number of routing entries but complicates the route lookup process b. Reduces the number of routing entries and simplifies the route lookup process c. Is rendered unnecessary by multi-­‐homing d. Leads to non-­‐optimal routing paths 1e) [6 points] Consider the following network, with nodes A through J. The numbers indicate the link weights or costs (so shortest paths are paths with the lowest cumulative cost). In the following questions, use the alphabetical ordering to break ties when there are several shortest paths (i.e., you pick the path with the next hop that is earliest in the alphabet). If the path loops, just list two repetitions of the loop and put “...” afterwards to indicate that it continues. A
6
2
B
3
2
4
2
D
4
C
E
3
H
2
3
2
1
F
3
I
G
1
5
J
1e1) Assuming the network operator uses link state routing, after everything has converged, what path would a packet from C to H take? 1e2) Using the same network as above, imagine that the cost of the link G-­‐I has changed to 15. G announces this change, and all nodes except F get this update (i.e., F still thinks G-­‐I is cost 1). C now sends a packet to H. What path would the packet take? 1f) [6 points] Consider the BGP topology below. Suppose that stub networks V and W are customers of ISP A. Suppose that B and C have a peering relationship, and A is a customer of both B and C. Suppose that A would like to mostly use the Gao-­‐Rexford rules, but would like to have the traffic destined to W come only from B. 1f1) What routes should A advertise to B? 1f2) What routes should A advertise to C? 1f3) What AS routes does C receive? 1g) [6 points] Consider sending an IPv4 packet over a link with an MTU of 500 bytes. The packet has an identification number of 291 and has a payload of 1,600 bytes (not including the 20 byte IP header). 1g1) What is the minimum number of fragments that will be generated? 1g2) Split the packet into the minimum number of fragments. Keep all fragments the same size except possibly the last one. For each fragment, what are the values of the IP header fields related to fragments (total_length, ID, fragment_offset, and the MF bit)? Q2. IP Addressing and Forwarding Aggregation [7 points] 2a) Convert the following address to dot-­‐quad: 11000000 00000111 00011101 00001011 2b) Convert the following address to binary: 19.17.34.41 2c) In the following address and netmask, what is the binary representation of the network address? Address: 11000000 00000111 00011101 00001011 Netmask: 255.248.0.0 2d) What is the equivalent of the above netmask in CIDR slash-­‐notation? 2e) Consider the following routing table: 171.1.216.0/24 Port 1 171.1.217.0/24 Port 1 171.1.218.0/24 Port 2 171.1.219.0/24 Port 4 171.1.220.0/24 Port 4 171.1.221.0/24 Port 4 171.1.222.0/24 Port 3 171.1.223.0/24 Port 4 Default Port 4 Express this using LPM, using three non-­‐default entries: Port 1 Port 2 Port 3 Default Port 4 Q3. Intra-­‐domain and Inter-­‐domain routing protocols [10 points] 3a) [4 points] Consider the network shown below. Suppose 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 BGP (eBGP + iBGP) is the inter-­‐AS routing protocol. Initially suppose there is no physical link between AS2 and AS4. 3a1) Router 3c learns about prefix x from which routing protocol? (Circle one) wo places using BGP. Consider
A to
OSPF traffic
going
RIP from
eBGP D. iB
BGP would prefer to hand th
e West Coast (so that C would have to absorb the cost of carrying the traffic cross-c
3a2) Router 3a learns about prefix x from which routing protocol? (Circle one) refer to get the
traffic via its East Coast peering point with B (so that B would ha
OSPF mechanism
RIP might
eBGP iBGP B would hand over Ass the country). What BGP
C
use, so that
oast peering point?
To answer this question, you will need to dig into the BGP spec
3a3) Router 1c learns about prefix x from which routing protocol? (Circle one) OSPF RIP eBGP iBGP 3a4) Router 1d learns about prefix x from which routing protocol? (Circle one) OSPF RIP eBGP iBGP 3b) [6 points] Referring to the previous problem, once router 1d learns about x it will put an entry in its forwarding table. (You can assume that any path that router 1d hears advertised is a policy-­‐compliant one and that AS1 is a customer of both AS2 and AS3. Assume MED is not used in any router advertisements, and that a “typical” selection policy is used.) 3b1) Will 1d use 1a as the next hop for x, or will it use 1b? (i.e., will it send the packet over interface I1 or over interface I2?) Explain why in one sentence. 3b2) 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 via AS3. Will 1d be set to send packets to 1a or 1b? Explain why in one sentence. 3b3) 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 1d be set to send packets to 1a or 1b? Explain why in one sentence. Q4. BGP [7 points] Consider a set of domains with the following customer-­‐provider-­‐peer relationships: H
I
peer
provider
E
A
F
B
peer
customer
G
C
D
4a) Assume that all these domains use “standard” Gao-­‐Rexford policies based on these relationships. 4a1) What route does A take to C? 4a2) What route does A take to D? 4a3) Now assume that E and F become peers, and F and G become peers. Do any of the two routes calculated above change, and if so how? 4b) For the next set of questions, we no longer use the preceding picture but just consider a set of domains M, N, O, X and Y and assume that domains do not necessarily follow the Gao-­‐
Rexford policies (i.e., you can ignore considerations about whether a domain is a peer/provider/customer of another domain). After running BGP, we see that: •
•
•
Domain M uses the path MXN to reach domain N Domain N uses the path NYO to reach domain O Domain X uses the path XNY to reach domain Y Can we conclude that: (Circle Yes or No for each of the below) 4b1) M reaches O through the path MXNYO? Yes No 4b2) M reaches X through the path MX? Yes No 4b3) N reaches Y through the path NY? Yes No 4b4) X reaches N through the path XN? Yes No Q5. ACKs [8 points] Consider a flaky link where the initial transmission of a data packet is dropped if its number is prime (in other words, the initial transmissions of D2, D3, D5, D7, D11, D13 are dropped, but subsequent transmissions are ok). Note that the ACKs are cumulative and numbered according to the next expected packet (hence, A4 indicates the receipt of D1, D2, and D3). Hosts 𝑥 and 𝑦 are using a transport protocol with sliding window flow control with a constant window size of 5 packets and selective repeat. Three duplicate ACKs trigger a retransmission (hint: consider… how many total ACKs makes for three duplicates?). Assume that the latency of the link is significantly longer than the transmission time of 5 packets and that the retransmit timeout is much longer than the RTT. Below, fill in the first 20 packets sent from host 𝑥 (you don’t need to indicate what ACKs are generated, though it may be helpful and we’ve entered the first few entries below). Mark which packets are retransmits due to timeouts and which are retransmits due to duplicate acknowledgements. 1.
D1
A2
2.
D2 (dropped)
-
3.
D3 (dropped)
-
4.
D4
A2
5.
D5 (dropped)
-
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
Q6 – Fun with traceroute! (12pt) The traceroute tool is a program that traces the path (a sequence of routers) a packet follows to a destination. We’ll be using it in the questions below. 6a) [2 points] In no more than two sentences, explain how traceroute works. 6b) [2 points] Use traceroute from a machine on the UCB network to record the path taken to 216.81.59.173. Attach a printout of the traceroute output. If traceroute is not installed, try /usr/sbin/traceroute. Make sure to set the max hops to at least 64 using the –m option. 6c) [2 points] What are the ISPs traversed, and in what order? Hint: Look at the router names and try to visit the corresponding website. The ISPs are often, but not always, identified by the router names. You’ll find it hard to continue once things get “interesting”. Just list as many as you can. 6d) [2 points] Now try running traceroute to stanford.edu. What are the ASes traversed, and in what order? List as many of the AS numbers along the path as you can. To find an AS number from an IP address, you may find the following command useful: whois –h radb.ra.net [IP address] If you have Mac OS, the –a option on traceroute will list some AS numbers for you, but may report some as 0, which they aren’t. Use the above command to fill those in. 6e) [2 points] In your trace you may encounter rows with three asterisks ***. What is going on? What might have caused it? (Hint: It is not due to a disturbance in the Force.) 6f) [2 points] Why might an ISP want to disable support for traceroute?