com208final22-solved
com208final22-solved
• IP routers R1 , R2 , R3 , and R4 .
The orange boxes represent network interfaces. For example, IP router R2 has network interfaces y, z, v,
and u.
Each link between IP routers shown in the figure is annotated with its routing cost, and it has the same cost
in each direction.
The intra-domain routing protocol of AS0 uses the Dijkstra algorithm that we saw in class.
You can find a copy of this network topology at the end of the exam (next to last page). You can detach it so
that you can look at the topology while solving the problem, without having to turn the pages back and forth.
R2 y
v z
link-layer
u
1 switches
5
R3 h R4 e c1 c100 w
1
g k …
f j
link-layer link-layer
switches switches
a1 a1000 d b1 b2 b600
… …
fl fl
4
Question 1 (5 points):
Allocate an IP prefix to each IP subnet of AS0 following these rules:
• All IP prefixes must be allocated from 5.0.0.0/8.
• Assume one IP address per end-system and per-IP-router interface (but not for link-layer switches).
• You do not need to assume a network address per IP subnet (but it’s not a mistake if you do).
Explain in one or two sentences how you compute each IP prefix.
In decreasing order of size, we have 5 IP subnets: A (contains end-systems Ax ), B, C, R12 (subnet between
R1 and R2 ), R23 , R34 , and R24 . We will allocate IP prefixes in this order, but there are many possible solutions.
• IP subnet A needs 1001 addresses for end-systems, one for interface f, and one broadcast address. To
assign 1003 addresses we need 10 bits (210 = 1024) and thus the mask size is 32 − 10 = 22bits. We can
therefore assign the following address range:
0000 0101.0000 0000.0000 00xx.xxxx xxxx
which is equivalent to:
5.0.0.0/22
• IP subnet B needs 600 addresses for end-systems, one for interface j, and one broadcast address. To
assign 602 addresses we need 10 bits and thus the mask size is 32 − 10 = 22bits. Continuing from where
the previous range ends, we have:
0000 0101.0000 0000.0000 01xx.xxxx xxxx
which is equivalent to:
5.0.4.0/22
• IP subnet C needs 101 addresses for end-systems, one for interface z, and one broadcast address. To
assign 103 addresses we need 7 bits and thus the mask size is 32 − 7 = 25bits. Continuing from where
the previous range ends, we have:
0000 0101.0000 0000.0000 1000.0xxx xxxx
which is equivalent to:
5.0.8.0/25
• IP subnet R12 needs 2 addresses for interfaces x and y and one broadcast address. To assign 3 addresses
we need 2 bits and thus the mask size is 32 − 2 = 30bits. Continuing from where the previous range
ends, we have:
0000 0101.0000 0000.0000 1000.1000 00xx
which is equivalent to:
5.0.8.128/30
• IP subnet R23 needs 2 addresses for interfaces v and h and one broadcast address. To assign 3 addresses
we need 2 bits and thus the mask size is 32 − 2 = 30bits. Continuing from where the previous range
ends, we have:
0000 0101.0000 0000.0000 1000.1000 01xx
which is equivalent to:
5.0.8.132/30
5
• IP subnet R34 needs 2 addresses for interfaces g and k and one broadcast address. To assign 3 addresses
we need 2 bits and thus the mask size is 32 − 2 = 30bits. Continuing from where the previous range
ends, we have:
0000 0101.0000 0000.0000 1000.1000 10xx
which is equivalent to:
5.0.8.136/30
• IP subnet R24 needs 2 addresses for interfaces w and e and one broadcast address. To assign 3 addresses
we need 2 bits and thus the mask size is 32 − 2 = 30bits. Continuing from where the previous range
ends, we have:
0000 0101.0000 0000.0000 1000.1000 11xx
which is equivalent to:
5.0.8.140/30
6
Question 2 (8 points):
All link-layer switches have just been rebooted, and all end-system caches/ARP tables are initially empty.
All routers have populated their forwarding tables according to the intra-domain routing protocol.
The user of end-system A1 visits web page www.epfl.ch, which contains no embedded objects (e.g., no
images). Immediately after A1 ’s user views www.epfl.ch, the user of end-system B1 visits the same web
page.
State all the packets that are received, forwarded, or transmitted by router R3 as a result of B1 ’s actions
and until B1 ’s user can view the web page. For example, if router R3 receives and forwards an IP packet,
you should state that packet twice: once to state that R3 received it, and once to state that R3 forwarded it.
Answer by filling in Table 1. To denote the IP address or the MAC address of interface x, write “x”. If a
field is not applicable, write “–”. To repeat a field from the above cell, write “.”. To illustrate the format, we
have provided a hypothetical example entry (thee first entry in the table).
7
Question 3 (4 points):
(a) Show the entries of R3 ’s forwarding table that match packets addressed to AS0.
5.0.0.0/22 f
5.0.4.0/22 g
5.0.8.0/25 h
5.0.8.128/30 h
5.0.8.132/30 h
5.0.8.136/30 g
5.0.8.140/30 h
(b) Suppose the link between R2 and R3 is cut (and cannot be repaired). Show the entries of R3 ’s forwarding
table that match packets addressed to AS0 after the intra-domain routing protocol reconverges. Show only the
entries that change after the cut.
5.0.8.0/25 g
5.0.8.128/30 g
5.0.8.132/30 g
5.0.8.140/30 g
(c) Suppose that, after the link between R2 and R3 is cut, the link between R1 and R2 is also cut (and
cannot be repaired). Show the entries of R3 ’s forwarding table that match packets addressed to AS0 after the
intra-domain routing protocol reconverges. Show only the entries that change after the (second) cut.
5.0.8.128/30 –
8
Question 4 (4 points):
Ignore the events of Question 3 (pretend they didn’t happen).
Suppose the IP subnet behind interface j of IP router R4 is a private IP subnet (i.e., it uses private IP
addresses), and R4 acts as a Network Address Translation (NAT) gateway (for both TCP and UDP traffic).
(a) How does this change your answer to Question 2? Write down only the modified lines; use the ‘#’
column to refer to the designated row in Table 1. If a field between the original and modified line remains the
same, leave it empty. To illustrate the format, we have provided a hypothetical example entry (the first entry in
the table).
(b) What state (information for ongoing communications) does R4 need to keep to operate as a NAT gate-
way? Show its state at the end of the events of Question 2 (i.e., after B1 ’s user has received all the packets
needed to view the web page).
It needs to keep a mapping between a packet’s original (private) source IP address and original source port
number to the packet’s modified source port number.
9
Question 5 (4 points):
Considering the conditions of Question 4:
(a) Does the fact that R4 is a NAT gateway restrict the number of parallel (simultaneous) TCP connections
that B1 can establish with other end-systems located in the same IP subnet? Justify your answer.
(b) Does the fact that R4 is a NAT gateway restrict the number of parallel (simultaneous) TCP connections
that B1 can establish with other end-systems located in different IP subnets? Justify your answer.
10