Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

What is “network ID” and “host ID” in IP Addresses?

  • Last Updated : 24 Nov, 2021

IP addresses are divided into 5 classes namely, Class A, Class B, Class C, Class D, Class E. This concept came in around the 1980s. Where,

  • Class A is generally used for big networks such as the ISP networks.
  • Class B is used for medium to large networks like some big organizations.
  • Class C addresses are generally used for smaller networks.
  • Class D addresses are used for Multicasting.
  • Class E addresses are reserved addresses and they are used for experimental purposes.

Range of All Classes:

Class A: 1.0.0.0 to 127.255.255.255
Class B: 128.0.0.0 to 191.255.255.255
Class C: 192.0.0.0 to 223.255.255.255
Class D: 224.0.0.0 to 239.255.255.255
Class E: 240.0.0.0 to 255.255.255.255

Network ID:

A network ID or NetID is the fragment of IP address that classifies the network for a specified host i.e., it tells us which network the host belongs to, generally comprised of one to up to four octets in dotted-decimal representation. 

In dotted-decimal representation, an IP address is divided into four octets and based on which class the IP address belongs to its octets are further divided into network ID and HOST ID. 

For Class A first octet represents network ID as the prefix of the first octet is 0, it uses the remaining 7 bits for network ID, for Class B first and second octets represent network ID the prefix for class B is 10 so it uses the remaining 14 bits for network ID, for Class C first, second and third octet represents network ID the prefix of class C is 110 so it uses the remaining 21 bits for network ID, Class D, and Class E are reserved.

Host ID:

It is the fragment of an IP address that uniquely classifies a host on a specified TCP/IP network. A host ID can be found simply by ANDing the IP address in binary form with its respective default subnet mask (in binary form). The other fragment of an IP address is the network ID, which identifies the network to which the host belongs.

Host ID and Network ID

Host ID and Network ID

For Example, In the above Image,  the IP address of host C is 198.162.30.4 that means it belongs to class C, so its default subnet mask will be 255.255.255.0; Now applying AND on both, it will give the host ID 0.0.0.4 and network ID 198.162.30.0.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!