Introduction to IP Addressing

In the internetwork, internet protocol(IP) address is used to identify a node. Internet Protocol has two versions IPv4 and the other one is IPv6. Logical address is the another name of IP addressing.

IP Address Quality

Identification / location
The length is same
Network will divided based on the size

IP Address – 32-bit Address

Divided into 4 Octets


4 Octets

Each Octets ranges from 00000000 …………………………… 11111111 i.e from (0 to 255)

Each Octets is of

IP Address Contains into 2 Parts

Location (NID – Network ID)
Identification (HID – Host ID)

Network Classifications are:

Class-A —————— 0-127

Class-B —————— 128-191

Class-C —————— 192-223

Class-D —————— 224-239

Class-E —————— 240-255

Class A

Network ID = 8 Bits

Host ID = 24 Bits

Network ID

In Class A, there are 8 bits and so 28-1 networks are possible = 128 Networks. These (0 to 255) values in first octet are shared among other classes also. Values for class-A will be ranging in (0 to 127).

I Octet

Most Significant Bit (MSB)

Least Significant Bit (LSB)

128 (MSB) is reserved for Class A as ‘0’ always.
0.0.0.0 – This is reserved for representing any network.
127.0.0.0 – This is Loop back address.

Finally, Class-A can have 1-126 networks.

For Example : 20.20.10.0 is a Class-A Network

Host ID (HID)

If the hosts IDs are ‘0’ then it will definitely represents the network and not the host. If the hosts IDs are ‘255’ then it will represent the broadcast address for this particular network.

For Example:

20.0.0.0 —————————— Network Address (All HID ‘0’)
10.0.0.1 —————————— First Host IP Address (All HID ‘0’ except the least)
10.255.255.254 ——————— Last Host IP Address (All HID ‘1’ except the least)
10.255.255.255 ——————— Broadcast IP Address (All HID ‘1’)

Class-B

Network ID = 16 Bits

Host ID = 16 Bits

Range   128.0.0.0 to 191.255.255.255

Network ID

I Octet

Two bits will be reserved for class-B
The other two bits are from 000000 to 111111.

Network ID has 2 octets out of which two 2 bits are reserved.

216-2 = 214 = 16384 networks for Class-B.

For Example: 172.16.0.0 is a Class-B Network.

Host ID (HID)

If the hosts IDs are ‘0’ then it will represent the network and not the host. If the hosts IDs are ‘255’ then it will represent the broadcast address for this particular network.

For Example

160.22.0.0 ————————— Network Address
160.22.0.1 ————————— First Host IP Address
160.22.255.254 ——————— Last Host IP Address
160.22.255.255 ——————— Broadcast IP Address

Class-C

Network ID = 24 bits

Host ID = 8 bits

Range  192.0.0.0 to 223.255.255.255

Network ID

I Octet

The last three bits will be reserved for Class-C
The others are from 00000 to 11111

Network ID has 3 octets out of which two 3 bits are reserved.

It becomes 224-3 = 221 = 2097152 networks for Class-C.

For Example: 201.15.2.0 is a Class-C network.

Host ID (HID)

If the hosts IDs are ‘0’ then it will represent the network and not the host. If the hosts IDs are ‘225’ then it will represent the broadcast address for this particular network.

For Example:

195.53.45.0 —————— Network Address
195.53.45.1 —————— First Host IP Address
195.53.45.254 ————— Last Host IP Address
195.53.45.255 ————— Broadcast IP Address

Class-D

Class D have 224-239 networks. The purpose of this class is for Multicasting.

Class-E

Class E have 240-255 networks. Class E networks are used for Research purposes.

Note: At the end of this, we can reserved addresses from the above for the private networks. Following are ranges of the IP addresses:

10.0.0.0 to 10.255.255.255   —————— Class-A

172.16.0.0 to 172.31.0.0     —————— Class-B

192.168.0.0 to 192.168.255.0 ————-- Class-C

Internet Protocols V.6 Introduction:

IPv6 has 128 bits. IPv6 is a power of 16 octet.

1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16
0000:0000:0000:0000:0000:0000:0000:0000:0000:0000:0000:0000:0000:0000:0000:0000

16 : 16 : 16 : 16 : 16 : 16 : 16 : 16 : 16 : 16 : 16 : 16 : 16 : 16 : 16 : 16

Thus, it will become 128 bits.

[root@linuxpathfinder ~]#vi /etc/sysconfig/network

networking IPV6=yes

save and quit.

[root@linuxpathfinder ~]#vi /etc/sysconfig/network-scipts/ifcfg-eth1

ipv6init = yes

IPv6Addr = 2010:db8:100f10:0::1/64

[root@linuxpathfinder ~]#ip --6 addr show
Avatar photo

Asif Khan

Responsible and proactive professional with more than 13 years of experience in IT systems, open source software applications, DevOps, Linux systems, and cloud operations. My main goals are to automate things, keep them safe, and make sure they are strong. I am very good at planning and building the infrastructure for services that people really want. I was drawn to the fast-paced world of cloud computing because it has resources that can be scaled up or down as needed. One of my best skills is being able to use a lot of different DevOps tools to set up, release management, and microservices ecosystems, as well as for provisioning, orchestration, and configuration management.