Consider the entries shown below in the forwarding table of an IP router. Each…
2024
Consider the entries shown below in the forwarding table of an IP router. Each entry consists of an IP prefix and the corresponding next hop router for packets whose destination IP address matches the prefix. The notation “/N” in a prefix indicates a subnet mask with the most significant N bits set to 1.
Prefix Next hop router
10.1.1.0/24 R1
10.1.1.128/25 R2
10.1.1.64/26 R3
10.1.1.192/26 R4
This router forwards 20 packets each to 5 hosts. The IP addresses of the hosts are 10.1.1.16, 10.1.1.72, 10.1.1.132, 10.1.1.191, and 10.1.1.205 . The number of packets forwarded via the next hop router R2 is _______
Attempted by 98 students.
Show answer & explanation
Correct answer: 40
Key idea: use longest-prefix match (pick the most specific prefix that contains the destination address).
10.1.1.16 → R1 (falls in 10.1.1.0/24 only)
10.1.1.72 → R3 (matches 10.1.1.64/26)
10.1.1.132 → R2 (matches 10.1.1.128/25)
10.1.1.191 → R2 (matches 10.1.1.128/25)
10.1.1.205 → R4 (matches the more specific 10.1.1.192/26 rather than 10.1.1.128/25)
Calculation: R2 receives packets for two hosts (10.1.1.132 and 10.1.1.191). Each host receives 20 packets, so R2 forwards 2 × 20 = 40 packets.
A video solution is available for this question — log in and enroll to watch it.