retagged by
182 views
2 votes
2 votes

The routing table of a router is shown below:

$$\begin{array}{|c|c|c|}
\hline
\text{Destination} & \text{Subnet Mask} & \text{Interface}
\\\hline
142.72.43.0 & 255.255.255.128 & \text{Eth1}\\\hline
142.72.43.0 & 255.255.255.0 & \text{Eth2}\\\hline
190.32.21.1 & 255.255.255.254 & \text{Eth3}\\\hline
\text{Default} & & \text{Eth4}
\\\hline
\end{array}$$

On which interface will the router forward packets addressed to destinations $142.72.43.16$ and $192.32.21.3$ respectively?

  1. $\text{Eth2 and Eth3}$
  2. $\text{Eth1 and Eth3}$
  3. $\text{Eth1 and Eth4}$
  4. $\text{Eth2 and Eth4}$
retagged by

1 Answer

3 votes
3 votes
We can see that $142.72.43.16$ bitwise AND $255.255.255.128$ gives $142.72.43.0 (128$ has only the MSB as $1)$
    
$ 142.72.43.16$ bitwise AND $255.255.255.0$ also gives $142.72.43.0.$
    
When multiple destinations match, the subnet with more number of $1s$ is chosen. So, here the first one - $\text{Eth1}$ wins.
    
$192.32.21.3$ bitwise AND $255.255.255.254$ gives $192.32.21.2$ - not matching any destination. So, default $\text{Eth4}$ wins.

So, correct answer: C.
edited by
Answer:

Related questions