edited by
92,895 views
57 57 votes

A router uses the following routing table:

\begin{array}{|l|l|l|} \hline \textbf {Destination} & \textbf { Mask} & \textbf{Interface}  \\\hline \text {144.16.0.0} &  \text{255.255.0.0} & \text{eth$0$} \\\hline\text {144.16.64.0} &  \text{255.255.224.0} & \text{eth$1$} \\\hline\text {144.16.68.0} &  \text{255.255.255.0} & \text{eth$2$}\\\hline \text {144.16.68.64} &  \text{255.255.255.224} & \text{eth$3$}\\\hline\end{array}

 Packet bearing a destination address $144.16.68.117$ arrives at the router. On which interface will it be forwarded?

  1. eth$0$
  2. eth$1$
  3. eth$2$
  4. eth$3$

11 Answers

Best answer
85 85 votes

Firstly start with Longest mask

 $\text{144. 16 . 68 .117   =  144.  16.  68. 01110101}$  AND

 $\text{255.255.255.224   =  255.255.255. 11100000}$

 $\qquad \qquad \qquad =\text{144.16.68.96}$ (Not matching with Destination)


 Now, take $\text{255. 255. 255. 0}$

$\text{144.16. 68.117}$ AND $\text{255.255.255.0 = 144.16.68.0}$ (matched)

So, interface chosen is eth2 OPTION (C).

edited by
43 43 votes

To get network id we perform $\text{Bitwise AND}$  operation of ip address with every
subnet mask...after if the obtain value matches with the network id ..then we send
the data through that..if more than one network id matches then we check for
the longest mask.

ip address $=144.16.68.117$ and with all mask one by one

first mask  $=255.255.0.0 \Rightarrow 11111111.11111111.00000000.00000000$


                   $144.16.68.117\Rightarrow 10010000.00010000.01000100.01110101$

bit wise and operation


we get ,           $144.16.0.0\Rightarrow  10010000.00010000.00000000.00000000$          

which is matching with network id $144.16.0.0$ given opposite to mask $255.255.0.0$

but we cannot stop here  may some more network id matches..so check for every mask

Similarly,                            

$255.255.224.0$

$144.16.68.117$


 $144.16.64.0$

which is matching with network id  $144.16.64.0$ given opposite to mask $255.255.224.0$

Now next ,

 $255.255.255.0$

 $144.16.68.117$


  $144.16.68.0$

Which is matching with network id  $144.16.68.0$ given opposite
to mask $255.255.255.0$

Now last,                         

  $255.255.255.224$

  $144.16.68.117$


   $144.16.68.96$

Which is  $\text{NOT}$ matching with network id  $144.16.68.64$ given opposite
to mask $255.255.255.224$

Now $3$ of the networks are matching...now we check for longest mask..

i.e        $255.255.0.0$

           $255.255.224.0$

           $255.255.255.0$       
So, last one is the largest therefore $\text{eth2}$ will be chosen to send packet.

edited by
6 6 votes

If two or more network have same address then the network whose subnet mask will contain more no of 1s will be chosen

If No Destination address matches then default will be chosen.

Here longest mask is Eth2 So given address belong to Eth2

Answer:
Position:
Show:

Related questions

92 92 votes
11 answers 11 answers
22.3k
22.3k views
Ishrat Jahan asked Nov 1, 2014
22,334 views
A subnetted Class $B$ network has the following broadcast address: $144.16.95.255$Its subnet maskis necessarily $255.255.224.0$is necessarily $255.255.240.0$is necessaril...
9 9 votes
2 answers 2 answers
7.0k
7.0k views
go_editor asked Jun 19, 2016
6,958 views
In a class B subnet, we know the IP address of one host and the mask as given below:IP address $: 125.134.112.66$Mask $: 255.255.224.0$What is the first address(Network a...
31 31 votes
2 answers 2 answers
10.5k
10.5k views
Ishrat Jahan asked Nov 1, 2014
10,542 views
The wait and signal operations of a monitor are implemented using semaphores as follows. In the following,$x$ is a condition variable,mutex is a semaphore initialized to ...
106 106 votes
9 answers 9 answers
42.0k
42.0k views
Rucha Shelke asked Sep 17, 2014
41,951 views
Consider the following log sequence of two transactions on a bank account, with initial balance $12000,$ that transfer $2000$ to a mortgage payment and then apply a $5\%$...