Classes, Netid
and Hostid in
Classful
Addressing
Address space
The 32 bit IPv4 addressing system is divided into five
classes: Class A, B, C, D and E.
Class A occupies 50% of the address space, Class B – 25%,
Class C – 12.5%, Class D – 6.25% and Class E – 6.25%.
Binary and decimal notation
Finding class in binary
notation
Finding class in decimal
notation
Finding address
class
• Steps to find the class:
• Check the first bit, if it
is 0 then class A.
• If not check the second bit
if it is 0 then class B.
• If the first bit is 1 & the
second bit is 1 and the
third bit is 0 then the
class is C.
• If all the first 3 bits are
1 and the fourth bit is o
then class D.
Netid and Hostid
• In class A, 1 byte defines the Netid and 3 bytes
defines the Hostid.
• In class B, 2 byte defines the Netid and 2 bytes
defines the Hostid.
• In class C, 3 byte defines the Netid and 1 byte defines
the Hostid.
Class A
IP addresses belonging to Class A are assigned to the networks that
contain a large number of hosts.
The higher-order bit of the first octet in class A is always set to
0. The remaining 7 bits in the first octet are used to determine
network ID. The 24 bits of host ID are used to determine the host
in any network. The default subnet mask for Class A is 255.x.x.x.
Therefore, Class A has a total of:
• 2^24 – 2 = 16,777,214 host ID
IP addresses belonging to class A ranges from 0.0.0.0 –
127.255.255.255.
Millions of Class A addresses are wasted because most organizations
would never consist of 16 million hosts connected to it.
Class B
IP address belonging to class B is assigned to networks that range
from medium-sized to large-sized networks.
The higher-order bits of the first octet of IP addresses of class B
are always set to 10. The remaining 14 bits are used to determine
the network ID. The 16 bits of host ID are used to determine the
host in any network. The default subnet mask for class B is
255.255.x.x. Class B has a total of:
• 2^14 = 16384 network address
• 2^16 – 2 = 65534 host address
IP addresses belonging to class B ranges from 128.0.0.0 –
Class C
IP addresses belonging to class C are assigned to small-sized
networks.
The higher-order bits of the first octet of IP addresses of
class C is always set to 110. The remaining 21 bits are used
to determine the network ID. The 8 bits of host ID are used
to determine the host in any network. The default subnet mask
for class C is 255.255.255.x. Class C has a total of:
• 2^21 = 2097152 network address
• 2^8 – 2 = 254 host address
IP addresses belonging to class C range from 192.0.0.0 –
223.255.255.255.
Class D
IP address belonging to class D is reserved for
multi-casting. The higher-order bits of the first
octet of IP addresses belonging to class D is always
set to 1110. The remaining bits are for the address
that interested hosts recognize.
Class D does not possess any subnet mask. IP
addresses belonging to class D range from 224.0.0.0
– 239.255.255.255.
Class E
• This class doesn’t have any subnet mask.
• The higher-order bits of the first octet of
class E are always set to 1111.
• IP addresses of class E range from 240.0.0.0 –
255.255.255.254.
• IP addresses belonging to class E are reserved
for experimental and research purposes.
Example
Q. Identify the class, first, last and number of
addresses in a block of address where one of the address
is 205.16.37.39/28.
A. This address belongs to class C as the first byte 205
falls in the range 192-223.
The subnet mask 28 means that first 28 bits of the IP
address represents the network portion, and the
remaining 4 bits are available for host addresses. First
28 bits are set to 1, and remaining 4 bits are set to 0:
11111111.11111111. 11111111.11110000
To calculate first address, perform AND operation
between the given address(205.16.37.39) and subnet mask.
Address : 11001101.00010000.00100101.00100111
Mask : 11111111.11111111. 11111111.11110000
AND : 11001101.00010000.00100101.00100000
Thus, first address is 205.16.37.32
The last address in the block is obtained by changing all the 4 bits in
the host part to 1.
Ie. 11001101.00010000.00100101.00101111
Ie. 205.16.37.47
The last address of block is reserved as broadcast address, so actual
usable last address is 205.16.37.46
Total number of address is 2^4=16.
Out of the 16 addresses, first address is reserved for network and last
address is broadcast address, so total number of usable addresses is 14.
THANK YOU

Classes, NetId and HostId in Classful Addressing

  • 1.
    Classes, Netid and Hostidin Classful Addressing
  • 2.
    Address space The 32bit IPv4 addressing system is divided into five classes: Class A, B, C, D and E. Class A occupies 50% of the address space, Class B – 25%, Class C – 12.5%, Class D – 6.25% and Class E – 6.25%.
  • 3.
    Binary and decimalnotation Finding class in binary notation Finding class in decimal notation
  • 4.
    Finding address class • Stepsto find the class: • Check the first bit, if it is 0 then class A. • If not check the second bit if it is 0 then class B. • If the first bit is 1 & the second bit is 1 and the third bit is 0 then the class is C. • If all the first 3 bits are 1 and the fourth bit is o then class D.
  • 5.
    Netid and Hostid •In class A, 1 byte defines the Netid and 3 bytes defines the Hostid. • In class B, 2 byte defines the Netid and 2 bytes defines the Hostid. • In class C, 3 byte defines the Netid and 1 byte defines the Hostid.
  • 6.
    Class A IP addressesbelonging to Class A are assigned to the networks that contain a large number of hosts. The higher-order bit of the first octet in class A is always set to 0. The remaining 7 bits in the first octet are used to determine network ID. The 24 bits of host ID are used to determine the host in any network. The default subnet mask for Class A is 255.x.x.x. Therefore, Class A has a total of: • 2^24 – 2 = 16,777,214 host ID IP addresses belonging to class A ranges from 0.0.0.0 – 127.255.255.255. Millions of Class A addresses are wasted because most organizations would never consist of 16 million hosts connected to it.
  • 7.
    Class B IP addressbelonging to class B is assigned to networks that range from medium-sized to large-sized networks. The higher-order bits of the first octet of IP addresses of class B are always set to 10. The remaining 14 bits are used to determine the network ID. The 16 bits of host ID are used to determine the host in any network. The default subnet mask for class B is 255.255.x.x. Class B has a total of: • 2^14 = 16384 network address • 2^16 – 2 = 65534 host address IP addresses belonging to class B ranges from 128.0.0.0 –
  • 8.
    Class C IP addressesbelonging to class C are assigned to small-sized networks. The higher-order bits of the first octet of IP addresses of class C is always set to 110. The remaining 21 bits are used to determine the network ID. The 8 bits of host ID are used to determine the host in any network. The default subnet mask for class C is 255.255.255.x. Class C has a total of: • 2^21 = 2097152 network address • 2^8 – 2 = 254 host address IP addresses belonging to class C range from 192.0.0.0 – 223.255.255.255.
  • 9.
    Class D IP addressbelonging to class D is reserved for multi-casting. The higher-order bits of the first octet of IP addresses belonging to class D is always set to 1110. The remaining bits are for the address that interested hosts recognize. Class D does not possess any subnet mask. IP addresses belonging to class D range from 224.0.0.0 – 239.255.255.255.
  • 10.
    Class E • Thisclass doesn’t have any subnet mask. • The higher-order bits of the first octet of class E are always set to 1111. • IP addresses of class E range from 240.0.0.0 – 255.255.255.254. • IP addresses belonging to class E are reserved for experimental and research purposes.
  • 11.
    Example Q. Identify theclass, first, last and number of addresses in a block of address where one of the address is 205.16.37.39/28. A. This address belongs to class C as the first byte 205 falls in the range 192-223. The subnet mask 28 means that first 28 bits of the IP address represents the network portion, and the remaining 4 bits are available for host addresses. First 28 bits are set to 1, and remaining 4 bits are set to 0: 11111111.11111111. 11111111.11110000 To calculate first address, perform AND operation between the given address(205.16.37.39) and subnet mask.
  • 12.
    Address : 11001101.00010000.00100101.00100111 Mask: 11111111.11111111. 11111111.11110000 AND : 11001101.00010000.00100101.00100000 Thus, first address is 205.16.37.32 The last address in the block is obtained by changing all the 4 bits in the host part to 1. Ie. 11001101.00010000.00100101.00101111 Ie. 205.16.37.47 The last address of block is reserved as broadcast address, so actual usable last address is 205.16.37.46 Total number of address is 2^4=16. Out of the 16 addresses, first address is reserved for network and last address is broadcast address, so total number of usable addresses is 14.
  • 13.