Code never lies, comments sometimes do [Ron Jeffries]

Visitors Map

Follow on Twitter

@ZammaCode
Powered by Blogger.

Friday, February 28, 2014

IPv4 Network Classes


IPv4 addresses are divided into three groups:

Unicast Addresses

It includes Class A, B and C. Firs octet most significant bit identifies the class of IP address.
  • Class A IP addresses first octet start with 1-126.The first octet has a format 0xxxxxxx,where 0 identifies that it is Class A. 
  • Class B IP addresses first octet start with 128-191.The first octet has format 10xxxxxx, where 10 identifies that it is class B.
  • Class C IP addresses first octet start with 192-223.The first octet has format 110xxxxx, where 110 identifies that it is class C.

Multicast Addresses

It includes Class D.
  • Class D IP addresses first octet start with 224-239.

Experimental Addresses

It includes Class E. These addresses are only used for experimental purposes and its first Octet start with
240-255.

Table lists the different facts about Class A, B and C networks.

  • Network Number/ID is the lowest number in the network
  • Total networks are the available number of networks in one class, it can be calculated by 2^network_bits. It must be noted that network bits are always one, two and three bit less; it is because the Class A reserve 1-bit, Class B reserve 2-bits and Class C reserve 3-bits for the identification of class.
  • The mask communicates the network and host parts of the IP address to the computer, therefore; every Class has its associated default subnet mask.
  • Broadcast Address of a Class is the numerically highest number in network. Routers forward a copy of packet with broadcast address as destination to all hosts in Classful network.
  • In between Network ID and Network Broadcast Address is the range of Usable IP Addresses. It can be calculated by 2^h-2. Two addresses (namely; network ID and broadcast address) are subtracted from the total available addresses as there addresses can't be used for hosts/nodes.

To find then network ID, Network Broadcast and Usable Address for an IP Address follow the following steps: 

  1. Determine class of the IP address by examining first octet.
  2. Divide the IP address into network and host part.
  3. To find network ID, change host part octets to 0.
  4. To find broadcast address, change network ID's host octets to 255.
  5. To find first usable address, add 1 to the fourth octet of the network ID.
  6. To find last useable address, subtract 1 from the fourth octet of the network broadcast address.
Example (223.223.0.1)
  1. Class C
  2. Network Part (223.223.0), Host Part (1)
  3. Network ID = 223.223.0.0
  4. Broadcast Address = 223.223.0.255
  5. First Usable Address = 223.223.0.1
  6. Last Usable Address = 223.223.0.254

Reserved Network IDs

  • Class A network 0.0.0.0 was reserved for broadcasting requirements.
  • Class A network 127.0.0.1 is reserved for loopback addresses, which is used for software testing.

0 comments:

Post a Comment