A packet with the destination IP address 145.36.109.70 arrives at a router whose routing table is shown. Which interface will the packet be forwarded to?
| Subnet Address | Subnet Mask (in CIDR notation) | Interface |
|---|---|---|
| 145.36.0.0 | /16 | E1 |
| 145.36.128.0 | /17 | E2 |
| 145.36.64.0 | /18 | E3 |
| 145.36.255.0 | /24 | E4 |
| Default | -- | E5 |
Answer
(A)
Explanation
A router uses longest prefix match: among the entries that match the destination, the one with the longest mask wins. The first two octets (145.36) agree with every listed subnet, so only the third octet matters: \(109 = 01101101_2\).
- /16 (145.36.0.0): matches.
- /17 (145.36.128.0): needs the third octet to begin with bit 1 (128 to 255); 109 begins with 0, so no match.
- /18 (145.36.64.0): needs the third octet to begin with 01 (64 to 127); 109 does, so it matches.
- /24 (145.36.255.0): needs the third octet to be 255, so no match.
Of the matches (/16, /18 and the default route), /18 is the longest, so the packet is sent on E3.
Answer: A