edited by
30,672 views
99 99 votes

Host $X$ has $IP$ address $192.168.1.97$ and is connected through two routers $R1$ and $R2$ to an­other host $Y$ with $IP$ address $192.168.1.80$. Router $R1$ has $IP$ addresses $192.168.1.135$ and $192.168.1.110$. $R2$ has $IP$ addresses $192.168.1.67$ and $192.168.1.155$. The netmask used in the network is $255.255.255.224$.

Which $IP$ address should $X$ configure its gateway as?

  1. $192.168.1.67$
  2. $192.168.1.110$
  3. $192.168.1.135$
  4. $192.168.1.155$

7 Answers

Best answer
108 108 votes

$X$ must be able to reach the gateway using the net mask.
Subnet number of host $X = 192.168.1.97 \;\&\; 255.255.255.224 = 192.168.1.96$

Now, the gateway must also have the same subnet number. Lets take $\text{IP}\;192.168.1.110$ of $R1. \; 192.168.1.110 \;\&\; 255.255.255.224 = 192.168.1.96$ and hence this can be used by $X$. 

$($To quickly identify the matching mask divide the last part of mask $(224\;\text{here})$ into powers of $2$. So, $224 = 128 + 64+ 32$. Now, our host $X$ has $97$ as the last part of $\text{IP} = 64 + 32 + 1$. So, the last part of subnet number becomes $64 +32 = 96$. Now, we need to consider only those $\text{IPs}$ whose last part will contain $64$ as well as $32)$

http://courses.washington.edu/css432/joemcc/slides/03_cidr.ppt
Correct Answer: $B$

edited by
16 16 votes
The concept for this question and all other questions like this is as follows.

The router takes 1 IP address for every interface that it is connected to and the IP address is taken from the same subnet in which the whole network on that interface is.

So here every router is connected to 2 interfaces. Like R1 on the one side is connected to X and on the other side connected to R2. So similarly R2 is connected to R1 and Y.

So both the routers will be having 2 IP addresses. Both IPs in the interface should be in the same network.
So one side of the wire is X and on the second side is R2, So The default gateway for X will be the Ip address that belongs to the same subnet out of 2 IP which R1 has.
So you can get the Ip address router is using on the X side, remaining will be used to communicate by R2. Similarly, R2 has 2 IPs, check which is in the same subnet with the remaining IP of R1.
10 10 votes
Network mask:255.255.255.224
Subnet bit =3 bit
For: 192.168.1.97
Network address = 192.168.1.01100000 =>192.168.1.96
For:192.168.1.110
Network address=192.168.1.01101110
=>192.168.1.96
0 0 votes

Method 1 - Without checking options,

A host's default gateway must be the router interface that is in the SAME subnet as the host.

Mask - 255.255.255.224  =>  256 - 224 = 32

X = 192.168.1.97          So subnets are, 

Network             Host Range           Broadcast
     0                         1–30                     31
    32                       33–62                    63
    64                       65–94                    95
    96                       97–126                 127
   128                    129–158                 159
     ...                         ...                          ...

Since, 97 lies in 96–127,

X = 192.168.1.96/27 

 

Now, let's see router interfaces, 

R1 : 192.168.1.135     ............falls in 128–159   (different subnet)
        192.168.1.110     ............falls in 96–127     (same subnet)

R2 :  192.168.1.67      ............falls in 64–95       (different subnet)
         192.168.1.155    ............falls in 128–159   (different subnet)

Only, one interface is same as of X's interface
Ans 192.168.1.110

 

Method 2 - With checking options, 

Host =>  .97
Mask => 255.255.255.224   => /27    =>   96–127

Now, check options

    Ip                      Subnet

    67                      64–95           .....different subnet
    110                    96–127         ......same subnet
    135                    128–159       .....different subnet
    155                    128–159       .....different subnet

Hence, Ans (B)


Method 3 - Even faster method 

X =             .97  =  64 + 32 + 1
Subnet  =  .224 =  128 + 64 + 32 
-----------------------------------------------
              =   64 + 32   i.e 011 (starting 3 bits)

Check options, 

A - 67    =    010    (not matches)
B - 110  =    011     (matches)
C - 135  =   100     (not matches)
D - 155  =   100     (not matches)

Hence, Ans (B)

Answer:
Position:
Show:

Related questions

75 75 votes
10 answers 10 answers
22.2k
22.2k views
Ishrat Jahan asked Oct 29, 2014
22,214 views
Host $X$ has IP address $192.168.1.97$ and is connected through two routers $R1$ and $R2$ to an­other host $Y$ with IP address $192.168.1.80$. Router $R1$ has IP addresse...
22 22 votes
4 answers 4 answers
14.4k
14.4k views
Ishrat Jahan asked Oct 29, 2014
14,432 views
The total number of keys required for a set of $n$ individuals to be able to communicate with each other using secret key and public key cryptosystems, respectively are:$...
73 73 votes
7 answers 7 answers
24.2k
24.2k views
Ishrat Jahan asked Oct 29, 2014
24,186 views
The three way handshake for $\text{TCP}$ connection establishment is shown below. Which of the following statements are TRUE?$S1:$ Loss of $\text{SYN} + \text{ACK}$ from...
61 61 votes
4 answers 4 answers
24.9k
24.9k views
Ishrat Jahan asked Oct 29, 2014
24,881 views
Which of the following statements are TRUE?S1: TCP handles both congestion and flow controlS2: UDP handles congestion but not flow controlS3: Fast retransmit deals wit...