GATE | GATE-CS-2004 | Question 55

The routing table of a router is shown below:

 Destination     Sub net mask 	     Interface
 128.75.43.0 	 255.255.255.0 	        Eth0
 128.75.43.0 	 255.255.255.128 	Eth1
 192.12.17.5 	 255.255.255.255 	Eth3
 default 	  	                Eth2

On which interfaces will the router forward packets addressed to destinations 128.75.43.16 and 192.12.17.10 respectively?
(A) Eth1 and Eth2
(B) Eth0 and Eth2
(C) Eth0 and Eth3
(D) Eth1 and Eth3


Answer: (A)

Explanation: To find the interface, we need to do AND of incoming IP address and Subnet mask. Compare the result of AND with the destination. Note that if there is a match between multiple Destinations, then we need to select the destination with longest length subnet mask.

128.75.43.16, matches with 128.75.43.0 and 128.75.43.0, the packet is forwarded to Eth1 as length of subnet mask in Eth11 is more.



If a result is not matching with any of the given destinations then the packet is forwarded to the default interface (here Eth2). Therefore the packet’s addressed to 192.12.17.10 will be forwarded to Eth2.


Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :

1


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.