Isnt the correct answer be 2^{21}-2, because first and last network IDs are not used as Network ID of any network

The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+18 votes

In the IPv4 addressing format, the number of networks allowed under Class $C$ addresses is:

- $2^{14}$
- $2^{7}$
- $2^{21}$
- $2^{24}$

+30 votes

Best answer

Answer is (c)

$$\scriptsize{\begin{array}{|l|l|r|r|r|r|r|r|} \hline {\textbf{Class}} & \textbf{Leading} & \textbf{Size of network} & \textbf{Size of rest}& \textbf{Number of}& \textbf{Addresses} & \textbf{Total} & {\textbf{Start} }& \textbf{End} \\ & \textbf{Bits} & \textbf{number bit} & \textbf{bit field} & \textbf{networks} & \textbf{per} & \textbf{Addresses} & \textbf{address} & \textbf{address} \\ & & \textbf{field} & \textbf{} && \textbf{network} & \textbf{in class} & \\\hline

\text{Class A} & \text{0} & \text{8}& \text{24} & \text{128 }& \text{16,777,216} & \text{2,147,483,648} & \text{0.0.0.0}& \text{127.255.255.255} \\

&&&&(2^7)& \text{($2^{24}$)} & \text{($2^{31}$)}\\\hline

\text{Class B} & \text{10} & \text{16}& \text{16} & \text{16,384}& \text{65,536} & \text{1,073,741,824} & \text{128.0.0.0}& \text{191.255.255.255} \\

&&&&(2^{14})& (2^{16}) & \text{($2^{30}$)}\\\hline

\text{Class C} & \text{110} & \text{24}& \text{8} & \text{2,097,152}& \text{256} & \text{536,870,912} & \text{192.0.0.0}& \text{223.255.255.255} \\

&&&& \text{$(2^{21}$)} &(2^8)& \text{($2^{29}$)} \\\hline

\text{Class D} & \text{1110} & \text{Not defined}& \text{Not defined} & \text{Not defined}& \text{Not defined} & \text{268,435,456} & \text{224.0.0.0}& \text{239.255.255.255} \\

&&&& && \text{($2^{28}$)} \\\hline

\text{Class E} & \text{1111} & \text{Not defined}& \text{Not defined} & \text{Not defined}& \text{Not defined} & \text{268,435,456} & \text{240.0.0.0}& \text{255.255.255.255} \\ &&&& && \text{($2^{28}$)} \\\hline\end{array}}$$

We have $32\text{ bits}$ in the $\text{IPV4}$ network

Class A $=\text{ 8 network bits + 24 Host bits}$

Class B $=\text{ 16 network bits + 16 Host bits}$

Class C $=\text{ 24 network bits + 8 host bits}$

Class D (multicast)

Now for Class C we have $3\text{ bits}$ reserved for the network id.

Hence remaining bits are $21.$ Therefore total number of networks possible are $2^{21}$.

Similarly in Class B we have $2\text{ bits}$ reserved.

Hence, total number of networks in Class B are $2^{14}$.

And we have $1\text{ bit}$ reserved in Class A, therefore there are $2^7$ networks.

A better reasoning for the bit reservation is given at: https://en.wikipedia.org/wiki/Classful_network

- All categories
- General Aptitude 1.8k
- Engineering Mathematics 7.3k
- Digital Logic 2.9k
- Programming & DS 4.9k
- Algorithms 4.3k
- Theory of Computation 6k
- Compiler Design 2.1k
- Databases 4.1k
- CO & Architecture 3.4k
- Computer Networks 4.1k
- Non GATE 1.4k
- Others 1.4k
- Admissions 596
- Exam Queries 577
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

49,534 questions

54,122 answers

187,321 comments

71,040 users