in Computer Networks edited by
11,923 views
54 votes
54 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$.

Given the information above, how many distinct subnets are guaranteed to already exist in the network?

  1. $1$
  2. $2$
  3. $3$
  4. $6$
in Computer Networks edited by
11.9k views

4 Comments

since we are calculating subnet-ids for each subnet by performing AND operation and finding no. of possible subnets as for each subnet a subnet id will exist.. dats fine...and giving answer which is asked in ques. but  why can't  we do like the normal method of calculating no. of subnets :

subnet mask : 255.255.255.224

no of subnets = (2^3) - 2 

–1
–1
it said already exists, not the maximum subnets!
0
0
edited by

Similar Question (For Better visualization )

https://gateoverflow.in/371924/gate-cse-2022-question-12

1
1

8 Answers

73 votes
73 votes
Best answer
$255.255.255.224  =  11111111.11111111.11111111.11100000$

$192.168.1.97$
$192.168.1.80$
$192.168.1.135$
$192.168.1.110$
$192.168.1.67$
$192.168.1.155$

We need to do bitwise AND with subnet mask.
the last $5$ bits are going to be 0 when ANDED.

No need to waste time in finding binary.
Only focus on $1$st $3$ bits of binary.  

(From left side, $1$st bit is $128$,next one is $64$,next one is $32$..it goes like that you know.)

$\bf{97}$:    $0 + 64 + 32 +$ something  so $1$st $3$ bits will contain $011$
$\bf{80}$:    $0 + 64 + 0+$ something  so $010$
$\bf{135}$:  $128+0+0+$ something so $100$
$\bf{110}$:  $0+64+32+$ something so $011$
$\bf{67}$:    $0+64+0+$ something so $010$
$\bf{155}$:  $128+0+0+$ something so $100$

So we got $011, 010, 100$
$3$ subnets.... subnet id are...

$192.168.1.96$
$192.168.1.64$
$192.168.1.128$

Correct Answer: $C$
edited by
by

4 Comments

@Shaik Masthan

can you please check this understanding..sorry if something silly

1) If a host in network has to send packet to host on another network then first it should sent it to default router of network..so are R1 and R2 are considered as default routers of networks in which Host X and Y are present respt.

2) From IP of X and Y and host we found that X and Y are in diff networks so 2 distinct subnets ..noow they are connected by two routers R1 and R2 ..now for Interface 2 of R1 and Inteface 1 of R2 IP's should be in such a way that both R1 and R2 seems to be in same network so that to forward packet from R1 to R2..R1 will get MAC of R2 using ARP..hence that will create one new subnet there may not be any hosts in that 3rd subnet other than R1 and R2

1
1

i didn't get you @jatin khachane 1

0
0

@Shaik Masthan in the above diagram where I said parallel connection,can we say that both R1 and R2 situated into the same network ?

because a network can't have two interfaces.

And can't we connect a single network with two different routers?

0
0
11 votes
11 votes
Given all address are of class c Default mask for class c=24bit Given net mask =255.255.255.224 11111111.11111111.11111111.11100000 Subnet id=3bit Simply BITWISE AND the bits of the first octet for each of the IP addresses we got 011, 010, 100 3 subnets. subnet id are 192.168.1.96 192.168.1.64 192.168.1.128
6 votes
6 votes
Simply BITWISE AND the bits of the first octet for each of the following IP addresses . You will get only
xx.xx.xx.96 ,xx.xx.xx.64 and xx.xx.xx.128  
Option C) 3 is the answer
edited by

2 Comments

Not XOR,  bitwise AND.
1
1
Oh sorry.. !! :P
0
0
4 votes
4 votes
Caption

 

Answer:

Related questions