IP address is one of the most important topics in computer networking. This section will explain the basics of IP addressing, a brief history of how IP addresses evolved, how they are allocated to the Internet users, classes of IP addresses, the concept of the subnet mask, and so on.
Introduction to IP Address
Every device that is connected to the Internet is assigned a unique address. In order to send a packet from one host to another host, every host must be uniquely identified in a network. This unique identifier is called an IP address.
IP addressing is analogous to the postal address. Let us understand the IP address with an example. Suppose you want to send a letter to your friend. At first, you write a letter and put it in the envelope, then paste it so that no one will read the letter en route. Finally, you write your friend’s name and his/her home or office address on the envelope, so that letter will be delivered to your friend’s address and not to anybody.
Similarly, in the world of computer networking, when a host or a computer wants to send some information to the other host or a computer in a network. There must be an addressing scheme so that the information must be delivered to the destination host correctly. This addressing scheme is provided by a protocol called Internet Protocol (IP). IP provides a unique address to all the hosts connected to the network. This Unique address is called an IP Address.
Brief history of IP addresses
If we go back to the history of IP address, it came into existence in the early 1980s and widely used in ARPAnet. ARPAnet is an Advanced Research Project Agency network controlled by the United States Department of Defence and is the predecessor of the modern Internet. Earlier, ARPAnet had used NCP (Network Control Program) as the major middle layer protocol stack and used an 8-bit addressing scheme to address the host. It was easy to assign unique numbers 10,20 35, 50, etc to the host.
When ARPAnet started growing all across the United States, an 8-bit addressing scheme was not enough to address all the hosts. The famous scientists Robert Kahn and Vint Cerf designated the TCP/IP protocol in the late 1970s. The IP was the major internet layer protocol of TCP/IP suite used for addressing the host computer. After the introduction of IP version 4 in 1983, ARPAnet completely switched from NCP to TCP/IP Suite.
IP addresses had gone through many development phases to fulfill the growing needs of the Internet. Out of all, IP version 4 and IP version 6 are currently being used for addressing the host. We will discuss more IPv4 and IPv6 later in this article.
Who governs the IP Address
Internet Assigned Numbers Authority (IANA) is the International Organization within ICANN (Internet Corporation for Assigned Names and Numbers). IANA is responsible for managing and assigning IP addresses space worldwide. IANA further delegates 5 RIRs (Regional Internet Registries) to assign IP numbers to internet users. There are five Regional Internet Registries covering the whole world. They are:
- AFRINIC – African Network Information Centre
- APNIC -Asia-Pacific Network Information Centre
- ARIN – American Registry for Internet Numbers
- LACNIC – Latin America and Caribbean Network Information Centre
- RIP NCC – Réseaux IP Européens Network Coordination Centre
The RIRs are responsible for the allocation and management of IP addresses and AS (Autonomous System) numbers to their respective local internet registries and the internet service provider( ISP). The ISP further assigns the IP addresses to the end-users.
An Internet Protocol (IP) is a network layer protocol of the OSI model. Its main function is to provide logical addressing for every data packet received from the upper layer. This protocol further adds source IP address and destination IP address to the packet and sent over the network to reach its destination.
Definition of IP address
An IP address is defined as a unique identifier assigned to each node in a computer network. It is a numerical value denoted by decimal or hexadecimal numbers.
Two types of IP addresses are mostly used in IP networks. They are:
- Internet Protocol version 4 ( IPv4)
- Internet Protocol version 6 ( IPv6)
IPv4 is a 32-bit unique address assigned to every host in the IP network. It is written in decimal format. The 32-bit address length is divided into 4 equal parts called an octet. Each octet contains 8 bit and is separated by a dot.
For example, 192.168.5.10 is an IP v4 address.
Whereas, IP version 6 is a 128-bit address scheme. It is newer and more robust IP addresses because IP version 4 was being used on the Internet for more than four decades and its gradual exhaustion led to the introduction of IP version 6. IPv6 can have as much as trillions of trillions of IP addresses.
There is another article for IP v6 to explain in detail. This tutorial aims to explain IP version 4 in detail.
Features of IP address version 4
- IPv4 is a 32-bit length address.
- It is divided into 4 equal parts.
- Each part consists of 8 bits and is called Octet.
- Each octet is separated by dot notation.
- It is normally written in a human-readable numbering system ie decimal number.
- 232 = 4.7 billion of addresses are available for IPV4.
- IPv4 consists of two parts: The network part and the host part.
- The network part shows that the IP address belongs to which network. The host shows the number of different hosts in the same network.
The subnet mask is the 32-bit length of series of binary 0s (zeroes) and 1s (ones) that distinguishes the network part and the host part of an IP address. Series of 1s denote the network portion and 0s denote the host portion.
When we assign an IP address to any host in a network, a subnet mask is also given to it.
IP address is 192.168.5.10
The subnet mask is 255.255.255.0
If we convert subnet mask to binary bits, then it looks like this:
The series of 1s is called the network bits and the 0s are called host bit.
Network bit will remain unchanged for every IP assigned to any host in the same network and the network address is derived by ANDing the binary equivalent of IP address and the subnet mask.
These series of 0s can be varied from 0s to 1s for all the hosts within the same network.
Hence, in the above example,
The number of networks is given by = 2n, where n denotes the number of network bits.
and the number of hosts per network is given by=2h-2 where h is the number host bit.
When we calculate the number of hosts in a network, the first and the last IP is omitted or not assigned to any host in that network. These two IPs are called Network addresses and the Broadcast address.
The network address is calculated by logical ANDing the binary equivalent of IP address and its subnet mask. The calculation of the Network Address is explained in another document “How to Calculate Network Address and Broadcast Address”.
Whereas, the broadcast address is calculated by logical ORing the binary equivalent of IP address and its compliments of the subnet mask. The calculation of Broadcast Address in the document “How to Calculate Network Address and Broadcast Address”.
Classes of IP address
There are 5 different classes of IP addresses within the available IP range. The range of first octet i.e. from 0 to 255 is distributed to classify different classes. Each class has its fixed subnet mask or default subnet mask. The default subnet mask will decide how many hosts can be created in a network.
|Classes of IPv4 address||IP range||Network bits||Default subnet mask||Application|
|Class A||0.0.0.0 to 184.108.40.206||8||255.0.0.0||Used in larger networks where the number of required hosts per network is more. Example: ISP.|
|Class B||220.127.116.11 to 18.104.22.168||16||255.255.0.0||Used in medium-sized networks such as enterprise network, medium-sized organizations.|
|Class C||192.0.0.0 to 22.214.171.124||24||255.255.255.0||used by a small network where the number of required hosts per network is limited. Example: private networks like LAN, schools, home, etc.|
|Class D||126.96.36.199 to 188.8.131.52||—||—||Used for multicasting|
|Class E||240.0.0.0 to 255.255.255.255||—||—||Unused, kept reserve for scientific research.|
Note: Remember, the concept of a host is available only in Class A, B, and C.
IPv4 Address Utilization
Class A address
- The Class A address ranges from 0.0.0.0 to 127.255.255.255.
- Number of Networks = 27 -2 = 126 ( 1 – 126). But the network ID zero(0) is not used for any network and 127 is reserved for loopback address (for checking internal connectivity).
- Number of Hosts per Network = 224 – 2 = 1,67,77,214. The first IP and the last IP within the range are not allotted to any host.
- The first Host Id with all zeroes (00000000.00000000.00000000) specifies the network address, hence its is not assigned to any host.
- The last host Id with all ones (11111111.11111111.11111111) specifies the broadcast address, hence it is not assigned to any host.
- Class A addresses are used by larger networks such as ISP where they need the maximum number of hosts.
Class B address
- The Class B address ranges from 184.108.40.206 to 220.127.116.11.
- Number of Networks = 214 = 16384.
- Number of Hosts per Network = 216– 2 = 65,534. The first IP and the last IP within the range are not allotted to any host.
- The first Host Id with all zeroes (00000000.00000000) specifies the network address, hence its is not assigned to any host.
- The last host Id with all ones (11111111.11111111) specifies the broadcast address, hence it is not assigned to any host.
- Class B addresses are used in medium-size private networks like company networks, organizations, etc.
Class C address
- The Class B address ranges from 192.0.0.0 to 18.104.22.168.
- Number of Networks = 221 = 2097152
- Number of Hosts per Network = 28– 2 = 254. The first IP and the last IP within the range are not allotted to any host.
- The first Host Id with all zeroes (00000000) specifies the network address, hence its is not assigned to any host.
- The last host Id with all ones (11111111) specifies the broadcast address, hence it is not assigned to any host.
- The class C addresses are used in smaller private networks such as LAN where the number of hosts is limited.
Class D address
- The Class D address ranges from 22.214.171.124 to 126.96.36.199.
- Class D addresses are not assigned to any host.
- It is a special address used for multicasting.
- This address is assigned to a group of networks and is not assigned to represent a unique address.
Class E address
- The Class E address ranges from 240.0.0.0 to 255.255.255.255.
- Class E also does not have a subnet mask.
- Hence, It is also not assigned to any host.
- This IP range is reserved for scientific research and development purposes.