Bits needed for defining Net IDs and Host IDs of Class A, Class B and Class C
In classful addressing, an IP address of class A, B, and C are divided into netid and hostid. The netid determines the network address while the hostid determines the host connected to that network.
|
Byte 1 |
Byte 2 |
Byte 3 |
Byte 4 |
Class A |
Netid |
Hostid |
||
Class B |
Netid |
Hostid |
||
Class C |
Netid |
Hostid |
||
Class D |
Multicast Address |
|||
Class E |
Reserved for future use |
Blocks and Hosts
Each class is divided into blocks. The number of blocks in a class can be calculated by the number of bits in the netid.
CLASS A
Class A has 1 byte (8 bits) netid and from the binary notation, we see that Class A address starts with 0 so there is a total of 7 bits that can be changed out of 8.
Therefore, total number of blocks in Class A = 27 = 128
There are 3 bytes (24 bits) for hostid in Class A so the total number of the host in each block = 224 = 16,777,216
So total number of addresses in Class A = No. of Blocks in Class A x No. of Hosts in each block of Class A
= 128 x 16,777,216
= 2,147,483,648
This is 50% of the total addresses in IPv4.
1st block of Class A has the netid 0
And the host id is between
0.0.0.0 ………….… 0.255.255.255
Similarly, 2nd block of Class A has the netid 1
And the host id is between
1.0.0.0
1.255.255.255
|
Netid 0 |
Netid 1 |
… |
Netid 127 |
Class A |
0.0.0.0 to 0.255.255.255 |
1.0.0.0 to 1.255.255.255 |
127.0.0.0 to 127.255.255.255 |
|
|
Block 1 |
Block 2 |
Block 128 |
CLASS B
Class B has 2 bytes (16 bits) netid and from the binary notation, we see that Class B address starts with 10, so there is a total of 14 bits that can be changed out of 16.
Therefore, total number of blocks in Class B = 214 = 16,384
There are 2 bytes (16 bits) for hostid in Class B so the total number of the host in each block = 216 = 65,536
So the total number of addresses in Class B = No. of Blocks in Class B x No. of Hosts in each block of Class B
= 16,384 x 65,536
= 1,073,741,824
This is 25% of the total addresses in IPv4.
1st block of Class B has the netid 128.0
And the host id is between
128.0.0.0
…
128.0.255.255
Similarly, 2nd block of Class B has the netid 128.1
And the host id is between
128.1.0.0
128.1.255.255
|
Netid 128.0 |
Netid 128.1 |
… |
Netid 191.255 |
Class B |
128.0.0.0 to 128.0.255.255 |
128.1.0.0 to 128.1.255.255 |
191.255.0.0 to 191.255.255.255 |
|
|
Block 1 |
Block 2 |
Block 16,384 |
CLASS C
Class C has 3 bytes (24 bits) netid and from the binary notation, we see that Class C address starts with 110, so there is a total of 21 bits that can be changed out of 24.
Therefore, total number of blocks in Class C = 221 = 2,097,152
There is 1 byte (8 bits) for hostid in Class C so the total number of the host in each block = 28 = 256
So total number of addresses in Class C = No. of Blocks in Class C x No. of Hosts in each block of Class C
= 2,097,152 x 256
= 536,870,912
This is 12.5% of the total addresses in IPv4.
1st block of Class C has the netid 192.0.0
And the host id is between
192.0.0.0
…
192.0.0.255
Similarly, 2nd block of Class B has the netid 192.0.1
And the host id is between
192.0.1.0
192.0.1.255
|
Netid 192.0.0 |
Netid 192.0.1 |
… |
Netid 223.255.255 |
Class C |
192.0.0.0 to 192.0.0.255 |
192.0.1.0 to 192.0.1.255 |
223.255.255.0 to 223.255.255.255 |
|
|
Block 1 |
Block 2 |
Block 2,097,152 |
(Source: https://dyclassroom.com/networking/netid-and-hostid)
0 Comments