GATE CSE
First time here? Checkout the FAQ!
x
+14 votes
1.4k 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 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
asked in Computer Networks by Veteran (21.3k points) 469 751 812
retagged by | 1.4k views
Option C, Just perform bit wise AND of given IP addresses and subnet mask, we get 3 distinct subnet id
1) 011
2) 010
3) 100
routers also counted in subnets?
what the significance can someone explain?
Find first addresses i.e netaddress of all given IP's using subnetmask.You will find there are only three subnets.
Router's Interfaces have the same netId as the network they are part of. Here, three distinct netIDs are present, implying three sub-nets.
Actually, if there are 2 routers connected via a single interface, then that interface needs to be given a subnet ! And this the subnet id for the common interface between routers is - 192.168.1.128.

Apart from this there are 2 more subnets in the network in which both the hosts are present distinctly - 192.168.1.96 for 'X' and 192.168.1.64 for 'Y'.

Also the interfaces of the routers connected to these hosts have IP addresses taken from the above 2 subnets respectively only !

X(192.168.1.97)---(192.168.1.110)---R1---(192.168.1.135)---(192.168.1.155)---R2---(192.168.1.67)---(192.168.1.80)Y
i think (3) should be 000.

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 

2 Answers

0 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
answered by Active (2.1k points) 10 45
edited by
Not XOR,  bitwise AND.
Oh sorry.. !! :P
0 votes

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 1st 3 bits of binary.  

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

97:    0 + 64 + 32 + something  so 1st 3 bits will contain 011
80:    0 + 64 + 0+something  so 010
135:  128+0+0+something sp 100
110:  0+64+32+something so 011
67:    0+64+0+something so 010
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

answered by Boss (7k points) 4 13 42
Answer:

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
Top Users Oct 2017
  1. Arjun

    23488 Points

  2. Bikram

    17108 Points

  3. Habibkhan

    8682 Points

  4. srestha

    6314 Points

  5. Debashish Deka

    5458 Points

  6. jothee

    5068 Points

  7. Sachin Mittal 1

    4882 Points

  8. joshi_nitish

    4444 Points

  9. sushmita

    3996 Points

  10. Rishi yadav

    3868 Points


Recent Badges

Photogenic MiNiPanda
Reader Ali Jazib Mahmood
Good Question Ishrat Jahan
Nice Comment Arjun
Notable Question Kaifi7
Popular Question LORD ofKINGS
Great Question Rucha Shelke
Popular Question rahul sharma 5
Popular Question jothee
Popular Question Pankaj Joshi
27,351 questions
35,209 answers
84,265 comments
33,328 users