Which of the following can be the subnet mask?

The directed broadcast address of a subnet is given as 204.99.88.31
which of the following can be the subnet mask??
a) 255.255.255.224
b)255.255.255.240
c)255.255.255.248
d) b&c

7Comments
abhinandan @abhinandan 9 Aug 2017 02:05 am

@pritam sir help me in this

Pritam Prasun @pritam 9 Aug 2017 12:45 pm

Answer would be d) b & c

I want you to give it a try with the following hint:

  1. For broadcast, host ids will be all 1
  2. Assuming that the host bit N would be the host bit try to find the possible IPs

I suggest you to solve it by your own.

rishabh shukla @rishabhhh 10 Aug 2017 05:00 pm

sir can u pls elaborate ans seems diffrent

 

shivani @shivani1234 11 Aug 2017 12:55 pm

since, all 1s in the host id part represents direct broadcast.

so, for getting subnet mask we make 0 as1 and 1 as 0 in host part and all 1s in network part so we get 255.255.255.224 as subnet mask .

You can verify it , by ANDing  255.255.255.224 with 204.99.88.31 then we will get 204.99.88.0 which is subnet id and belongs to class C.

abhinandan @abhinandan 11 Aug 2017 02:35 pm

Directed Broadcast address is 204.99.88.31

if we write in binary it would be 11001100.01100011.01011000.00011111

The only hint we have about broadcast address is it has all ones in the host part. 

Now host part can be last bit or last 2 bits or last 3 bits or last 4 bits or last 5 bits

Case1: Assume that last 4 bits as host part

Now make network part as all ones and host part as zeroes to get subnet mask 

 11111111.11111111.11111111.11110000

255.255.255.240

Case 2: Assume that last 3 bits as host part 

Now make network part as all ones and host part as zeroes to get subnet mask 

11111111.11111111.11111111.11111000

255.255.255.248

Case 3: If you do like above then subnet mask will be

255.255.255. 252

Case 4: if you do like above then subnet mask is

255.255.255.254

case 5: if you take last 5 one's as host part and then ANDing it with 255.255.255.224 then we will get subnet id as 204.99.88.0 but note that 204.99.88.0 is the network id of class C. so this is invalid

hence Option D is the answer

shivani @shivani1234 11 Aug 2017 02:46 pm

first subnet id is always network id , so how can you say that it can't be the subnet mask.

abhinandan @abhinandan 11 Aug 2017 03:21 pm

@pritam sir plz verify now