Skip to content
Related Articles
Open in App
Not now

Related Articles

GATE | Gate IT 2008 | Question 81

Improve Article
Save Article
  • Last Updated : 26 Oct, 2021
Improve Article
Save Article

Host X has IP address and is connected through two routers R1 and R2 to anĀ­other host Y with IP address Router R1 has IP addresses and R2 has IP addresses and The netmask used in the network is

Given the information above, how many distinct subnets are guaranteed to already exist in the network?
(A) 1
(B) 2
(C) 3
(D) 6

Answer: (C)

Explanation: Given IP addresses are of Class C
default Mask for class C = 24
Here given mask is 27 bits ( 11111111 11111111 11111111 11100000)
subnet ID: 3 bits
existing subnets: 011, 010 and 100

Alternative approach –
Each link which connects a router-router, or a router-host(s) has a different subnet. In this case, there are 3 subnets,

  1. One connecting Host X to Router R_1
  2. One connecting Router R_1 to Router R_2
  3. One connecting Router R_2 to Host Y

We can also find the number of subnets by counting the number of network prefixes as each network ID corresponds to a subnet. Subnet Mask – or /27.
In the following table, Network ID only displays bits 24 to 26 since bits 0 to 23 are the same for all subnets. Subnet ID is obtained after AND’ing the IP address with the subnet Mask.
 \begin{tabular}{||c||c||c||} \hline IP & Subnet ID & Network ID(Bits 24-26)\\ \hline \hline & & 011\\  \hline & & 011\\  \hline & & 100\\  \hline & &100\\  \hline & & 010\\  \hline & & 010\\  \hline \end{tabular}
Therefore option (C) is correct.

This explanation is provided by Chirag Manwani.

Quiz of this Question

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!