Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

CSE 123 Computer Networks

Homework 3 Solutions
(Total Points: 60)

Instructions:
Take a printout of this template, write answers in the spaces provided below each question, and submit
the scanned copies of your homework on Gradescope. You can even write your answers electronically.

Q1 Address Resolution Protocol (14 pt)

Q1.1 Consider the network topology shown in Figure 1 comprising router, switches, and hosts. The IP
addresses and MAC addresses assigned to various interfaces are shown in the figure. Assume that the
router’s ARP table is empty.

Figure 1: Sample Network Topology

Suppose that the following IP packet arrives at “interface 2” of router


Ethernet Source Ethernet Destination IP Source IP Destination

0a:e1:e2:f1:f2:f3 01:ab:12:34:56:78 192.168.2.3 192.168.1.2

(a) To successfully deliver the above IP packet, the router needs to send an ARP request. Which
host(s) receive the ARP request? (1 pt)
Sol: Host H1 and H2
(b) Mention the following header fields for the ARP request packet sent by the router. (1 pt)
Sol:
Ethernet Source Ethernet Destination IP Source IP Destination

02:ab:12:34:56:78 ff:ff:ff:ff:ff:ff 192.168.1.1 192.168.1.2

(c) Who replies to the ARP request? (1 pt)


Sol: Host H1

(d) After the above ARP request-reply exchange, mention the following header fields for the IP
packet that gets delivered to the destination host. (1 pt)
Sol:
Ethernet Source Ethernet Destination IP Source IP Destination

02:ab:12:34:56:78 01:a1:a2:a3:b1:b2 192.168.2.3 192.168.1.2

Q1.2 Consider the network topology shown in Figure 2 comprising routers, switches, and hosts. The
IP addresses and MAC addresses assigned to various interfaces are shown in the figure. The routing
and ARP table entries are also shown for selected routers and hosts. The figure shows five timestamps
in the journey of an IP packet from source host 192.168.1.2 to destination host 192.168.2.2.

Figure 2: Sample Network Topology


Mention the following header fields for the above IP packet at timestamps t1 to t5. (10 pt)
Sol: 2pt for correct packet fields values at each timestamp

Timestamp Ethernet Source Ethernet Destination IP Source IP Destination

t1 aa:bb:cc:dd:ee:ff a1:b2:c3:d4:e5:f6 192.168.1.2 192.168.2.2

t2 aa:bb:cc:dd:ee:ff a1:b2:c3:d4:e5:f6 192.168.1.2 192.168.2.2

t3 aa:11:bb:22:cc:33 dd:44:ee:55:ff:66 192.168.1.2 192.168.2.2

t4 1a:2b:3c:4d:5e:6f 01:02:03:04:05:06 192.168.1.2 192.168.2.2

t5 1a:2b:3c:4d:5e:6f 01:02:03:04:05:06 192.168.1.2 192.168.2.2

Q2 Network Address and Port Translation (4 pt)

Consider an edge router of a private network implementing Network Address and Port Translation
and having the following table entries in its NA(p)T table.

NA(p)T Translation Table

WAN side address LAN side address

202.38.16.7:6001 172.16.2.1:3650

202.38.16.7:6002 172.16.2.1:5114

202.38.16.7:6003 172.16.2.2:3535

202.38.16.7:6004 172.16.2.3:4125

(a) If the following IP packet from the public network—destined to a host in the internal private
network—arrives at the NAT, then mention the header fields for the packet once it passes
through the NAT and enters the private network. (2 pt)

IP Source IP Destination Source Port Destination Port

105.65.21.4 202.38.16.7 3111 6002

Sol:
IP Source IP Destination Source Port Destination Port

105.65.21.4 172.16.2.1 3111 5114


(b) If the following IP packet from the internal private network—destined to a host in the public
network—arrives at the NAT, then mention the header fields for the packet once it passes
through the NAT and enters the public network. (2 pt)

IP Source IP Destination Source Port Destination Port

172.16.2.2 138.76.21.3 3535 80

Sol:
IP Source IP Destination Source Port Destination Port

202.38.16.7 138.76.21.3 6003 80

Q3 Link State Routing (16 pt)

Consider the below network topology where circles represent routers and the routers are using
link-state routing algorithm to determine the least cost routes to all other routers. Determine the
routing table entries for routers B, C, D, and E after convergence.

Sol: 1 pt for each correct table entry

Routing table for B

Destination Next Hop Cost

A C 11

C C 2

D D 1

E C 4
Routing table for C

Destination Next Hop Cost

A E 9

B B 3

D B 4

E E 2

Routing table for E

Destination Next Hop Cost

A A 7

B A 15

C A 12

D D 6

Routing table for D

Destination Next Hop Cost

A E 11

B E 19

C E 16

E E 4
Q4 Distance Vector Routing (20 pt)
Consider the below network topology where circles represent routers and the routers are using a
distance-vector routing algorithm to determine the least cost routes to all other routers.

In the initial state of the distance vector routing algorithm, each node only knows the distance of the
routers that are directly connected to it. The below table shows distance vectors maintained at each
router at the start of the algorithm.

Information Distance to Node


at node
A B C D E

A 0 5 2 3 ∞

B 5 0 4 ∞ 3

C 2 4 0 ∞ 4

D 3 ∞ ∞ 0 ∞

E ∞ 3 4 ∞ 0

(a) Once all the routers have sent their respective distance vectors shown above to their
immediate neighbors, fill in the updated distance-vector values below for each router. (10 pt)
Sol: 2pt for each correct distance vector
Information Distance to Node
at node
A B C D E

A 0 5 2 3 6

B 5 0 4 8 3

C 2 4 0 5 4

D 3 8 5 0 ∞

E 6 3 4 ∞ 0
(b) Once all the routers have sent their respective distance vectors in (a) to their immediate
neighbors, fill in the updated distance-vector values below for each router. (10 pt)
Sol: 2pt for each correct distance vector

Information Distance to Node


at node
A B C D E

A 0 5 2 3 6

B 5 0 4 8 3

C 2 4 0 5 4

D 3 8 5 0 9

E 6 3 4 9 0

Q5 Border Gateway Protocol (6 pt)

Q5.1 Consider the below scenarios where a BGP router receives multiple route updates for the same
network. Referring to the BGP route selection rules, for each of the below scenarios, circle the route
update that will be preferred by the BGP router to reach the advertised network. (3 pt)
Sol: 1 pt for each correct answer
Scenario 1:

Scenario 2:

Scenario 3:
Q5.2 Consider the topology of autonomous systems shown in Figure 3. Each autonomous system is
using BGP to send route updates for the 18.56/16 network. (3 pt)

Figure 3: Sample topology of autonomous systems

If an IP packet originating from AS8 wants to reach a host in the 18.56/16 network, then what router
path (eg, R18–R16–R15–R14) will the packet follow?
Sol: R19–R13–R12–R11–R9–R4

You might also like