The Gateway to Computer Science Excellence
+13 votes
3.4k views

Consider the following routing table at an IP router:
$$\begin{array}{|l|l|l|} \hline \textbf {Network No} & \textbf {Net Mask} & \textbf{Next Hop}  \\\hline \text {128.96.170.0} &  \text{255.255.254.0} & \text{Interface $0$} \\\hline\text {128.96.168.0} &  \text{255.255.254.0} & \text{Interface $1$} \\\hline\text {128.96.166.0} &  \text{255.255.254.0} & \text{R$2$}\\\hline \text {128.96.164.0} &  \text{255.255.252.0} & \text{R$3$}\\\hline \text {0.0.0.0} &  \text{Default} & \text{R$4$}\\\hline \end{array}$$
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.
$$\begin{array}{l|ll} \hline \textbf {Group I} & \textbf {Group II}  \\\hline
\text {i) 128.96.171.92} &  \text{a) Interface 0} \\ \hline
\text {ii) 128.96.167.151} &  \text{b) Interface 1} \\\hline
\text {iii) 128.96.163.151} & \text{c) R$2$}\\ \hline
\text {iv) 128.96.164.121} & \text{d) R$3$}\\ \hline
\text {} & \text{e) R$4$}\\\hline \end{array}$$

  1. i-a, ii-c, iii-e, iv-d
  2. i-a, ii-d, iii-b, iv-e
  3. i-b, ii-c, iii-d, iv-e
  4. i-b, ii-c, iii-e, iv-d
in Computer Networks by Veteran (105k points)
edited by | 3.4k views
0
iii matches with none. so it goes to default router.

4 Answers

+3 votes
Best answer

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:$$ \begin{array} {rrrr}255&255&11111110&0 \\ 128&96&10101011&92 \\ \hline \textbf{128}&\textbf{96}&\textbf{10101010}&\textbf{0}\end{array}$$

∴ 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, $$ \begin{array} {rrrr}255&255&11111110&0 \\ 128&96&10100111&151 \\ \hline \textbf{128}&\textbf{96}&\textbf{10100110}&\textbf{0}\end{array}$$

∴ 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, $$ \begin{array} {rrrr}255&255&11111110&0 \\ 128&96&10100011&151 \\ \hline \textbf{128}&\textbf{96}&\textbf{10100010}&\textbf{0}\end{array}$$

∴ 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, $$ \begin{array} {rrrr}255&255&11111100&0 \\ 128&96&10100011&151 \\ \hline \textbf{128}&\textbf{96}&\textbf{10100000}&\textbf{0}\end{array}$$

∴ 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, $$ \begin{array} {rrrr}255&255&11111110&0 \\ 128&96&10100100&121 \\ \hline \textbf{128}&\textbf{96}&\textbf{10100100}&\textbf{0}\end{array}$$

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

∴ Option (a) is the correct answer

by (259 points)
selected by
+18 votes
Option $A$ is correct . Do the $AND$ operation of group $1$ with net mask you will get the answer.
by Active (5k points)
edited by
0
Can u explain this what to check with result of  AND operation to get next hop ???
+1

The next hop is decided according to the longest prefix matching obtained by AND operation, hope this helps smiley

+4 votes
i) 128.96.171.92  --- > First addr 128.96.170.0         a) Interface 0

ii) 128.96.167.151 ---> First  addr 128.96.166.0        c) R2

iii) 128.96.163.151--> first addr matches none e) R4

iv) 128.96.164.121---> first addr  128.96.164.0       d) R3

               

Consider the following routing table at an IP router:

 

Network No                      Net Mask            Next Hop

128.96.170.0/23 255.255.254.0     Interface 0

128.96.168.0/23 255.255.254.0     Interface 1

128.96.166.0/23 255.255.254.0     R2

128.96.164.0/22 255.255.252.0     R3

0.0.0.0   Default R4

 

128.96.171.92

To get First Net addr make the last 32-N bits of the addr to zero.[N is prefix]

First prefix to check is 23 --> 32-23=9

Make the last 9 bits of the addr to zero. The last 9 bits of address are in the last two octets.

171.92 -  - - - - -> 170.0   hence first netaddress is 128.96.170.0 matches first entry.
by Active (3k points)
+4 votes

So now we can eliminate the options easily.

i -> a

ii -> c

Option - A

by Junior (589 points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,647 questions
56,473 answers
195,393 comments
100,370 users