The Gateway to Computer Science Excellence

+15 votes

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}$$

- i-a, ii-c, iii-e, iv-d
- i-a, ii-d, iii-b, iv-e
- i-b, ii-c, iii-d, iv-e
- i-b, ii-c, iii-e, iv-d

+8 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**

**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**

**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)**

**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**

**∴ Option (a) is the correct answer**

+19 votes

+5 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.

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.

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,737 questions

57,370 answers

198,506 comments

105,272 users