Network Design and Operations

A router's routing table has four routes: 172.16.0.0/12 (next hop router B), 172.16.32.0/19 (router A), 172.16.48.0/20 (router C) and 0.0.0.0/0 (router D). To which router is a packet for 172.16.45.10 sent?

  1. ARouter A
  2. BRouter B
  3. CRouter C
Show answer and explanation

Answer: A. Router A

A router chooses, among the routes that match the destination, the one with the longest prefix (longest prefix match). The third octet, 45, is 00101101 in binary. A /19 compares the upper 3 bits of the third octet, and 45 AND 224 = 32, so the address matches 172.16.32.0/19 (172.16.32.0 to 172.16.63.255). A /20 compares the upper 4 bits, and 45 AND 240 = 32, which differs from 48, so it does not match 172.16.48.0/20 (172.16.48.0 to 172.16.63.255). The address also matches 172.16.0.0/12 and the default route, but the longest match, the /19, is chosen and the packet goes to router A.

  • A. Correct. It is the longest of the matching routes, the /19.
  • B. The /12 also matches, but the longer /19 matches too, so it is not chosen.
  • C. 172.16.45.10 is not in the range of 172.16.48.0/20 (172.16.48.0 to 172.16.63.255), so it does not match.
Practice this topic Back to topic

Related calculators

Books on Network Design and Operations Ad

As an Amazon Associate I earn from qualifying purchases.

More Network Design and Operations questions

  1. Branch router R2 is connected to head-office router R1 over a 10.255.0.0/30 link, with R1's end at 10.255.0.1 and R2's at 10.255.0.2. When a static route to the head-office network 192.168.1.0/24 is configured on R2, which address is appropriate as the next hop?
  2. A router has learned routes to the same destination, 192.168.50.0/24, from both OSPF and RIP. On this router, the administrative distance, which expresses the preference for each route source (lower is preferred), is 110 for OSPF and 120 for RIP. Which route goes into the routing table?
  3. A router's routing table holds three routes: a static route 10.0.0.0/8 (next hop router A, administrative distance 1), 10.1.0.0/16 learned by OSPF (router B, 110) and 10.1.1.0/24 learned by RIP (router C, 120). To which router is a packet for 10.1.1.5 sent?
  4. Which statement correctly describes a link-state routing protocol?
  5. In OSPF, router R1 has three paths to a network beyond R4. Path A uses a 10 Gbps link R1–R5 and a 1 Gbps link R5–R4; path B is a direct 100 Mbps link R1–R4; and path C uses 1 Gbps links R1–R2, R2–R3 and R3–R4. The cost of each link is "reference bandwidth 10 Gbps ÷ link bandwidth", and the cost beyond R4 is the same for all paths. Which path does R1 choose?

Comparisons in this topic