IP Address Explained: A Beginner-Friendly Guide to Internet Protocol

IP stands for Internet protocol. With the help of IP addresses, we uniquely identify a device in the computer network. All the devices in the network have one unique identifier, which is called an IP address. The IP address enables us to transfer files from one computer to another computer.

It is a logical address or dynamic address because it changes from network to network, e.g. if you connect to a Wi-Fi network, then you will get an IP address in the range of that Wi-Fi. your device Similarly, if you move to another place and you connect the same device to the other Wi-Fi then you will get another IP in that range, or if you disconnect your device and reconnect it to the same Wi-Fi after a few seconds, then there is a chance that you will get another IP in the same range. IP protocol works at the 3rd layer of the OSI model.

The IP address is 32-bits e.g. 00001010.10000000.00010000.11000000, but when we configure the IP address in our computer, then we use it in decimal notation as 10.128.16.192 because memorizing 32-bits is difficult. We divided IP addresses into four sections. Every section is of 8 bits. we call each section an octet or byte. Each octet ranges from zero to 255.

The IP address has two parts. The first part of the IP address represents the network portion, while the second part represents the host portion or the computer itself. For example 10.128.16.192/8, it means that we reserved the 1st 8 bits for the network portion while the remaining 24 bits are for the host portion. So 10 is the network part, while 128.16.192 is the host portion. No two devices will hold duplicate addresses, but they will be unique across the whole network.

Types of IP addresses

Some important parts on the basis of which we can categorize IP addresses

i) Assignment method (Static or dynamic)

ii) Classes (whether it is classful or classless)

iii) Public and Private

iv) Versions (whether it is IPv4 or IPv6)

1) Assignment Method

How do we assign an IP address to a device, whether it is?

(a) Static Assignment          or                   (b) Dynamic Assignment

(a) Static IP address assignment method

In static IP address assignment, we assign an IP address to a device manually. Normally this type of assignment usually used in a small network or if we are assigning ip address to the server, then we are also using a static method assignment. Static IP doesn’t change frequently, but we have to manually change it.

(b) Dynamic IP address assignment method

 It is an automatic IP address-assigning method. We assign the IP address to the endpoint devices with the help of the DHCP server. DHCP is a server that assigns IP addresses automatically to the nodes in a network. They normally use this type of assignment in medium to large networks. We also call this method zero-configuration because you don’t need to configure or remember anything related to the IP address. DHCP handles all the tasks

2)         Classes of IP addresses

i)          Classful                      ii)         classless

a)          Classful IP address

On the basis of the classful IP address, IP addresses are divided into five classes, Class A, Class B, Class C, Class D, & Class E.

How to identify a class

To identify a class, we should read the first byte of the IP address as:

I) Class A IP Address

There are 4 octets in the Class A network, in which we use 1st octet for the network and the remaining three octets are reserved for the host portion. Class A IP address starts from zero in the 1st octet of the decimal notation and ends at 126, while in a binary system, the 1st octet will start from zero. As there are 8 bits in the first octet of the class A IP address, the first bit i for class A while the remaining 7 bits are used for class A networks. So total number of class A networks will be found by the formula 2n. As there are 7 bits remaining in 1st octet n=7,

0nnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh

0 in 1st octet is reserved for a class A network, which indicates that it is a Class A network. The remaining 7 n-bits represent networks in class A. The remaining 24-h in the 2nd, 3rd, and 4th octets represent hosts in the class A network.

Formula to calculate Class IP Addresses

Put n=7 in a formula (2n) to find the total networks in class A, 27= 2*2*2*2*2*2*2 = 128 networks. Hosts In Class A network 224 -2,

Which is over 16 million hosts per class A network.

Why do we minus 2 in the host portion because the first ID is used for the network while the last host ID is used for the broadcast address as,

For example 1.0.0.0 network

So 1.0.0.0 255.0.0.0 is used for network ID,

1.0.0.1          255.0.0.0      1st host in a network

1.255.255.254                     Last host in a network

1.255.255.255                    broadcast ID

So we can’t assign 1.0.0.0 and 1.255.255.255 to hosts because the first ID (1.0.0.0) is the network ID through which we identify a network while the second ID (1.255.255.255) is a broadcast ID, through which a message is delivered to all hosts in a network.

Structure of Class A

Class A

The first Zero (0) for Class A, it that means first bit will always be 0 in Class A

N or 1 for network bits, means, a total of 128 networks in class A

The remaining 24 h or zeros represent class A host bits in a single network, i.e. over 16 million Host addresses in a single Class A network.

Exceptions in Class A IP address

127.0.0.0 To 127.255.255.255 is used for the loopback address. It is used for self-NIC checking. We use the ping command in a command prompt by pinging 127.0.0.0 any IP address for testing the Network interface card, whether it is working or not.

i) Class B IP Addresses

For the class B network, we have 4 octets in the IP address. 16 bits are reserved for the network part while 16 bits are reserved for the host part. The class B network range is 128.0.0.0 to 191.255.255.255.

Class B IP Structure

The class B network will always start in the first octet from 128 to 191 while in binary, the first two bits will always be 01.

The first two bits are reserved for the class B network. The remaining 14 bits in the network part are used to find the total number of networks.

214 = 16384 networks

216 = 65536 hosts per network

There is an exception in Class B address, which is represented in the range of 169.254.0.0/16. this is called Automatic private IP addressing or simply APIPA. When a PC wants an IP address and doesn’t find any DHCP server in the network, it gets its IP address from itself in the range of 169.254.0.0 to 169.254.255.255.

The PC gets its APIPA as in the below Windows 10 picture.

Class B APIPA
iii) Class C IP address

In the total of 4 octets, 1st three octets are reserved for network IDs while the last octet is reserved for host IDs. Class C address starts from 192.0.0.0 and ends at 223.255.255.255. In the total of 24 bits of the network, 1st 3 bits (110) represent Class C while the remaining 21 bits are used for finding network IDs. The last 8 bits of the 4th octet represent host IDs.

Class C IP Address

In total of 4 octets, 1st three octets are reserved for network IDs while the last octet is reserved for host IDs. Class C address starts from 192.0.0.0 and ends at 223.255.255.255. In the total of 24 bits of the network, 1st 3 bits (110) represent Class C while the remaining 21 bits are used for finding network IDs. The last 8 bits of the 4th octet represent host IDs.

The 1st three bits are reserved for representing class C, while the remaining 21 bits in the network portion represent the total networks in class C. Similarly, the last 8 bits of the 4th octet represent the total number of hosts in the class C network.

Total networks = 24-3 = 21 bits

Apply formula 2n = 221=  xxxxxx networks

Total number of bits for host portion = 8 bits

So 2n -2 put n= 8

28 -2 = 256 -2 = 254

So the total number of hosts in a single network in class C is 254.

iv) Class D IP Address

Class D IP addresses are used for the multi-cast purpose. It is one-to-many communication. Its range is 224.0.0.0 to 239.255.255.255. Multicasting is just like a group, e.g. Facebook group, or WhatsApp group where we communicate with those users who have joined the group. Other people outside of this group will not be able to see those messages. In multicasting IP addresses, the 1st four bits (1110) represent class D IP addresses. Multicasting doesn’t allow Unicast or broadcast.

While in decimal its range is represented as

224.0.0.0 To 239.255.255.255

Some popular class D multicast addresses are:

224.0.0.5 and 224.0.0.6   used by OSPF

224.0.0.9      used by RIP

224.0.0.10   used by EIGRP

v) Class E IP Addresses

It starts from 240.0.0.0 to 255.255.255.255 OR.

Class E is the last range of classful IP addresses reserved for experiment purposes. The 1st four bits 1111 out of 32 bits represent class D network.

b) Classesless IP Addresses

        There will be no classes in IP addresses. From the name of the classless, it is clearly mentioned that there will be no class use in an IP address. When we borrow some bits from the host portion and add them into network bits, then we are doing subnetting. Submitting is a way through which we divide a larger network into smaller networks. In classless IP addressing, there is no boundary of classes.       

If an IP address belongs to a classful IP address then we clearly understand which is the network ID and which is the host ID. But if we use classless IP addresses in which IP doesn’t belong to any class.

E.g. A class A IP may have 1st two octets of the network portion or it can have 1st three octets of the network portion. Classless IP addresses are defined by subnetting.

. 

3) Public and Private IP addresses

a) Public IP addresses

Public IP addresses are routable on the public internet. It is assigned to the router which is connected to the internet.  At the start of classful IP addressing, IANA reserved Class A, Class B, and Class C for public use, i.e.

Class A begins from 1 to 126

While Class B begins from 128 to 191

Similarly, Class C begins from 192 to 223

IANA (internet assigned number authority) doesn’t distribute public IP addresses directly to the user, but it first distributes it to the regional registry and then from the regional registry, it is distributed to ISPs. ISPs then assign it to actual users (companies, organizations). Public IP addresses are paid. A user will have to pay for a public IP address monthly or yearly.

b)  Private IP addresses

IANA has reserved some IP addresses for organizations and users that don’t want to connect to the internet but want to run a network within its organization by the use of TCP/IP protocol. It is not necessary for them to buy the IP address for their use. They can use public IP addresses in their LAN for their daily routine tasks, but for the best management purposes, IANA has defined some range of IP addresses in each class. So the users can use any IP address from those ranges without any permission from IANA and without any fee. It is not routable on the public internet. We can’t use private IP addresses in public networks; Instead, we will translate these private IP addresses into public IP addresses by the use of NAT. Prive IP addresses are configured inside the LAN.

Ranges of Private IP addresses

Class A

10.0.0.0 to 10.255.255.255

Class B

172.16.0.0 to 172.31.255.255

Class C

192.168.0.0 to 192.168.255.255

Difference between Public and Private IP addresses
Public IPPrivate IP
It is a paid IPIt is not routable
It is used to connect routers over the internetIt is a paid IP
It is used in a private networkIt can be reused in other LAN
It is paid IPIt is free of cost
Public vs Private IP Addresses

4) IP Versions

IP has two major versions.

a)IPv4                     b)      IPv6

IPv4 stands for IP version four while IPv6 stands for IP version six. IPv4 has been used for a few decades but Ipv6 is an emerging address that is being used due to a shortage of Ipv4. IPv4 is limited up to 4 billion, but the number of IPv6 is in trillions, which is enough for future use. IPv4 has 32 bits while Ipv6 is 128 bits long. There is a huge amount of difference between them. IPv4 is written in decimal format while Ipv6 is written in hexadecimal format. IPv4 is easy to remember due to its short length, while Ipv6 is difficult to remember due to its long address format. There are various techniques, on the basis of which we shorten Ipv6 addresses.

Examples of Ipv4 and Ipv6
  1. IPv4:-               192.168.1.1
  2. IPv6:-               2001:15CA:0000:0000:00BA:0C11:C000:0001

As I mentioned earlier, IPv6 is difficult to remember, but it has some techniques to remember it. So I will use a technique through which I will ease it for me to remember it.

2001:15CA:0000:0000:00BA:0C11:C000:0001

Write only one zero in the 3rd and 4th octets from the left.

2001:15CA:0:0:00BA:0C11:C000:0001

Eliminate the leading zero in the 5th, 6th, and 8th octets from the left. Simply eliminate those zeros which are at the left side of the digits in any octet as in the 5th, 6th, and 8th octets.

2001:15CA:0:0: BA: C11:C000:1

               It is not completely shortened, so the next is to eliminate zeros in the 3rd and 4th octets from the left and write double-colon “:” instead of zeros as below

2001:15CA:: BAC11:C000:1

So we have shortened it, and now it is easy to remember.

Note: don’t eliminate zeros that are coming at the right side of the digits, as in the case of the 7th (C000) octet.

Difference Between IPv4 and IPv6
S.NoIPv4IPv6
1IP version 4IP version 6
2It has 4 octetsIt has 8 octets
332-bits long128-bits long
4Written in decimal formatWritten In hexadecimal format
IPv4 vs IPv6

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *