0% found this document useful (0 votes)
2 views

com208final22-solved

The document describes a network topology for Autonomous System AS0, detailing the allocation of IP prefixes for various end-systems and routers, as well as the behavior of packets during web page requests. It includes questions related to IP address allocation, packet transmission through routers, and the implications of Network Address Translation (NAT) on TCP connections. The document also outlines the necessary state information for NAT operation and the effects of network link cuts on routing tables.

Uploaded by

nalepfl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

com208final22-solved

The document describes a network topology for Autonomous System AS0, detailing the allocation of IP prefixes for various end-systems and routers, as well as the behavior of packets during web page requests. It includes questions related to IP address allocation, packet transmission through routers, and the implications of Network Address Translation (NAT) on TCP connections. The document also outlines the necessary state information for NAT operation and the effects of network link cuts on routing tables.

Uploaded by

nalepfl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Problem 2 (25 points)

Consider the Autonomous System AS0 shown in Figure 1, which includes:

• End-systems A1 , ... A1000 (there are 1000 of them).

• End-systems B1 , ... B600 (there are 600 of them).

• End-systems C1 , ... C100 (there are 100 of them).

• DNS server dns.epfl.ch.

• Web server www.epfl.ch.

• IP routers R1 , R2 , R3 , and R4 .

• Various link-layer switches (not explicitly shown).

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.

All end-systems in AS0 use dns.epfl.ch as their local DNS server.

The intra-domain routing protocol of AS0 uses the Dijkstra algorithm that we saw in class.

The time-to-live (TTL) of DNS records and ARP-table entries is 24 hours.

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.

Autonomous System AS0


R1
x

R2 y
v z
link-layer
u
1 switches
5
R3 h R4 e c1 c100 w
1
g k …
f j

C1 C100 www.ep .ch

link-layer link-layer
switches switches

a1 a1000 d b1 b2 b600
… …

A1 A1000 dns.ep .ch B1 B2 B600

fl fl

Figure 1: Network topology for Problem 2.

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.

• Each IP subnet must be allocated the smallest possible IP prefix.

• Assume one IP address per end-system and per-IP-router interface (but not for link-layer switches).

• Assume one broadcast IP address per IP subnet.

• 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).

Source Dest Source Dst Transp. Src Dst


# Application & Purpose
MAC MAC IP IP prot. Port Port
1 k broadcast - - - - - ARP request for g’s MAC
2 g k - - - - - ARP reply
3 k g b1 d UDP 2000 53 DNS request for w’s IP
4 f broadcast - - - - - ARP request for d’s MAC
5 d f - - - - - ARP reply
6 f d b1 d UDP 2000 53 DNS request for w’s IP
7 d f d b1 UDP 53 2000 DNS reply
8 g k d b1 UDP 53 2000 DNS reply
9 k g b1 w TCP 4000 80 TCP SYN
10 h v b1 w TCP 4000 80 TCP SYN
11 v h w b1 TCP 80 4000 TCP SYN ACK
12 g k w b1 TCP 80 4000 TCP SYN ACK
13 k g b1 w TCP 4000 80 HTTP GET index
14 h v b1 w TCP 4000 80 HTTP GET index
15 v h w b1 TCP 80 4000 HTTP OK
16 g k w b1 TCP 80 4000 HTTP OK

Table 1: Packets received, forwarded, or transmitted by router R3 in Question 2.

7
Question 3 (4 points):
(a) Show the entries of R3 ’s forwarding table that match packets addressed to AS0.

Destination IP prefix Output interface

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

Table 2: R3 ’s forwarding table for Question 3(a).

(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.

Destination IP prefix Output interface

5.0.8.0/25 g
5.0.8.128/30 g
5.0.8.132/30 g
5.0.8.140/30 g

Table 3: R3 ’s forwarding table for Question 3(b).

(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.

Destination IP prefix Output interface

5.0.8.128/30 –

Table 4: R3 ’s forwarding table for Question 3(b).

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).

Source Dest Source Dst Transp. Src Dst


# Application & Purpose
MAC MAC IP IP prot. Port Port
3 j 500
6 j 500
7 j 500
8 j 500
9 j 600
10 j 600
11 j 600
12 j 600
13 j 600
14 j 600
15 j 600
16 j 600

Table 5: Packets received, forwarded, or transmitted by router R3 in Question 4.

(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.

# Original IP Original Port Modified Port


1 b1 2000 500
2 b1 4000 600

Table 6: State of NAT gateway R4 in Question 5.

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

You might also like