Just like you have specific house or flat number in the society where you live. You have a particular mobile number so that people can contact you. Devices in the network must have a unique IP address. IP address stands for internet protocol address. these IP addresses help the others to identify you in the network.
What does IPv4 mean?
IPv4 means “internet protocol version 4”. This protocol is the backbone of most of today’s small and big networks.
IPv4 Address Structure
An IPv4 address consists of 32 bits. These 32 bits are distributed among four sections called “octets” each having 8 bits. Structure of a complete IP address is:
IP address = <network number> <host number>
An example of IP address is 192.168.1.2, this IP address contains a network number as well as a host number which i will explain below in “IP Address Classes” section. The binary form of above IP address is 11000000.10101000.00000001.00000010.
Regional Internet Registry (RIR)
There are so many commercial network service providers and they have billions of subscribers. If they pick an IP address randomly then there are high chances two or more network devices or service providers will pick same network number. So there is a need to have a central authority which assign IPs to networks. The regional internet registries (RIR) evolve with passage of time. Today there are five RIR are working
- African Network Information Center (AFRINIC) assigns IPs in Africa
- American Registry for Internet Numbers (ARIN) assigns IPs in USA, Canada and Antarctic
- Réseaux IP Européens Network Coordination Centre (RIPE NCC) works for Europe, Russia, Central and West Asia.
- Asia-Pacific Network Information Centre (APNIC) provides services for East Asia, South Asia and Oceania
- Latin America and Caribbean Network Information Centre (LACNIC) is proving services in all Latin America.
IPv4 Address Classes
If you observed above example of IP address, you will see it is divided into four parts. The first part from left decides how the remaining address should be distinguished into network number and host number. Based on this IP addresses are classified into five classes i.e class A, class B, Class C, Class D and Class E.
What is Class A IP Address?
Class A IP address ranges from 126.96.36.199 to 188.8.131.52. Whereas 127.0.0.0 to 127.255.255.255 are reserved for loopback IPs. See example in Fig-1 for network number and host number in a class A IP address.
Fig-1: Class A IP address example
In the above example first octet represents network number and the remaining three octets represent host number. With this example we can also find the number of network and hosts available in the class A.
But two IPs are always reserved in every class
- One for the network
- One for Broadcast
In this example:
Network IP: 184.108.40.206
Broadcast IP: 220.127.116.11 (This IP is used to send message to all hosts in the network)
Class A IP addresses are used by commercial companies which have millions of users. The following figure-2 shows my IP address allocated by my internet service provider at the time when i was writing this article.
Fig-2: My public IP
What is Class B IP Address?
Class B IP addresses ranges from 18.104.22.168 to 22.214.171.124. See fig-3 to know the reserved octets for network number and host number.
Fig-2: Class B IP address example
Now first two octets represent network number and remaining two octets represent host number. Also observe the first two bits in network part are reserved.
In this example
Network IP: 126.96.36.199
Broadcast IP: 188.8.131.52
What is Class C IP Address?
Class C ranges from 192.0.0.0 to 184.108.40.206. See figure-3 for network octets and host octets.
In this example
Network IP: 220.127.116.11
Broadcast IP: 18.104.22.168
What is Class D IP Address?
It ranges from 22.214.171.124 to 126.96.36.199. This is used for multicasting which means to send messages to many nodes simultaneously. But it is used within hosts having class D IPs.
What is Class E IP Address?
This class ranges from 240.0.0.0 to 255.255.255.254. This class is reserved for research and development purposes.
The following table summarize all above IPv4 classes which will help you to memorize them easy