The Wayback Machine - https://web.archive.org/web/20230310183935/https://www.geeksforgeeks.org/gate-gate-cs-2015-set-2-question-51/
Skip to content
Related Articles
Open in App
Not now

Related Articles

GATE | GATE-CS-2015 (Set 2) | Question 65

Improve Article
Save Article
  • Last Updated : 28 Jun, 2021
Improve Article
Save Article

Consider the following routing table at an IP router \"Q51\" For each IP address in Group-I identify the correct choice of the next hop from Group-II using the entries from the routing table above.

   List-I               List-II
A. 128.96.171.92     1. Interface 0
B. 128.96.167.151    2. Interface 1
C. 128.96.163.121    3. R2
D. 128.96.165.121    4. R3
                     5. R4
Codes:
     A B C D
(a)  1 3 5 4
(b)  1 4 2 5
(c)  2 3 4 5
(d)  2 3 5 4

(A)

a

(B)

b

(C)

c

(D)

d


Answer: (A)

Explanation:

Taking the 1st IP Address: 128.96.171.92

Bitwise AND between 128.96.171.92 and 255.255.254.0 we get the subnet ID as follows:25525511111110012896101010119212896101010100

∴ Subnet ID = 128.96.170.0
∴ 128.96.171.92 will forward to interface 0

Taking the 2nd IP Address: 128.96.167.151

Bitwise AND between 128.96.167.151 and 255.255.254.0 we get, 255255111111100128961010011115112896101001100

∴ Subnet ID = 128.96.166.0
∴ 128.96.167.151 will forward to interface R2

Taking the 3rd IP Address: 128.96.163.151

Bitwise AND between 128.96.167.151 and 255.255.254.0 we get, 255255111111100128961010001115112896101000100

∴ Subnet ID = 128.96.162.0 (Doesn’t match with any given interface)

Now, Bitwise AND between 128.96.167.151 and 255.255.252.0 we get, 255255111111000128961010001115112896101000000

∴ Subnet ID = 128.96.160.0 (Doesn’t match with any given interface)
∴ 128.96.163.151 will forward to default interface R4

Taking the last IP Address: 128.96.164.121

Bitwise AND between 128.96.164.121 and 255.255.254.0 we get, 255255111111100128961010010012112896101001000

∴ Subnet ID = 128.96.164.0
∴ 128.96.167.151 will forward to interface R3

∴ Option (A) is the correct answer.


Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!