IPv4 address is binary string of 32 bits, it is used to identify each computer or device connected to internet or intranet uniquely. It is necessary to have IP address assigned to a device to participate in communication in a network of computers or devices.
There are different categories of IP address, some are special IP address and some are reserved IP address. Let’s see what are those
Total IPv4 address available are 2 ^ 32 = 4294967296 .
These 4 Billion IP addresses are not enough if each address is assigned to every device or computer on this planet. To overcome this limited set of IP’s we have, we use them sparingly and effectively by making use of LAN, NAT and subnetting .
IPv4 address which is 32 bit string, is represented in dot-decimal notation by breaking 32 bits into 8-bit segments called octets. Each octet is represented by a decimal equivalent number ranging from 0 to 255. IPv4 address contains 4 octets, each octet separated by dot or decimal point(.)
Example of IP address: 192.168.1.32
IPv4 Address Classes
IP Address classes or classful networks is a classification of IP address into 4 groups called classes which are A, B, C, D and E. With “Classful IP Addressing” Routers determines class of IP address for routing classful IP address which has it’s own limitations. Classful IP address were used till CIDR (classless Inter-Domain Routing) in 1993 was introduced.
IPv4 Address Classes
Class | Leading Bits | First Octet Range | # Network Bits | # Host Bits | Default Subnet Mask (Dotted Decimal) | Subnet Mask (Prefix Notation) | # of Netowrks | # Addresses Per Netowrk | Totals # address |
---|---|---|---|---|---|---|---|---|---|
A | 0 | 0-127* | 8 | 24 | 255.0.0.0 | /8 | 2^7 = 128 | 2 ^ 24 = 16, 777, 216 | |
B | 10 | 128-191 | 16 | 16 | 255.255.0.0 | /16 | 214 = 16, 384 | 216 = 65,536 | |
C | 110 | 192-223 | 24 | 8 | 255.255.255.0 | /24 | 221 =2097152 | 28 = 256 | |
D | 1110 | 224-239 | N/A | N/A | N/A | N/A | N/A | N/A | 268,435,456 |
E | 1111 | 240-255 | N/A | N/A | N/A | N/A | N/A | N/A | 268,435,456 |
Number of networks for class A is 2 ^ 7 = 128 since first bit must be 0 . For class B number of networks or blocks is 2 ^ 14 = 16,384 where left most two bits must be 10 for class B so it is 2 ^ 14 instead of 2 ^ 16. Class C is divided into 2 ^ 21 = 2,097,152 blocks where left most 3 bits are fixed 110.
Before classless addressing architecture was introduced each organization used to get block assigned form A, B or C based on its size
In classful network portion is determined by class of IP address. But, in classless addressing network portion is determined by subnet mask
In classful routing, class of destination is determined by performing right shift operation by 28 bits on a copy of destination address extracted from packet. Which results in 4-bit string. Class of destination address based on resulting 4-bits is determined as follows
Decimal Range | Class |
---|---|
0 to 7 | Class A |
8 to 11 | Class B |
12 to 13 | Class C |
14 | Class D |
15 | Class E |
Classful addressing was used in between 1981 and 1993 where “Classless Inter-Domain Routing” known as CIDR was introduced in 1993
Initially IP addresses were separated into groups called Classes. But, no longer classes are used because it’s wasteful of IP addresses. Originally it wasn’t envisioned about scarcity of IP addresses.
Default subnetmask is also called classful mask or natural mask in classful network architecture
Class D IP addresses are reserved for “Multicasting”
Class E IP addresses are reserved for experimental & research purposes
Address Type | IPv4 Address Range | Total Number of Addresses | Leading Bits | Class |
---|---|---|---|---|
Multicast Addresses | 244.0.0.0 – 239.255.255.255 | 2 ^ 28 = 268,435,456 | 1110 | D |
Experimental | 240.0.0.0 – 255.255.255.254 | 2 ^ 28 = 268,435,456 | 1111 | E |
Only class A, B and C addresses were used for hosts for very large, large and small networks respectively
Further Reading: RFC 790 , RFC 1700 , RFC 3330
Private IPv4 address
Private IP address are not routable on public internet, they are only routable with in the local network or private network. Since these IP addresses are local to private network, different private networks can make use of same IP addresses as result these private IP addresses are not uniquely identified globally.
Usually, computers and devices in factories or home are connected to private network behind router. These computers communicate with public internet using mechanism called “Network Address Translation” (NAT)
These addresses are also called RFC 1918 addresses since they were first defined in RFC 1918
Block Name | Default subnet mask | CIDR Notation | Address Range | # of Networks | # of Hosts per Network | Address Class |
---|---|---|---|---|---|---|
24-bit block | 255.0.0.0 | 10/8 | 10.0.0.0-10.255.255.255 | 126 | 16777214 | A |
20-bit block | 255.255.0.0 | 172.16/12 | 172.16.0.0 – 172.31.255.255 | 1048574 | B | |
16-bit block | 255.255.255.0 | 192.168/16 | 192.168.0.0 – 192.168.255.255 | 65534 | C |
Link-local IP Addresses
If given computer or device is not able to obtain a IP address, it will be assigned a special IP address called link-local IP using protocol Automatic Private IP Addressing (APIPA). Link-local IP address is not routable neither publicly nor in private network. These link-local addresses are also referred as APIPA addresses
Block Name | Default subnet mask | CIDR Notation | Address Range | # of Addresses | Address Class |
---|---|---|---|---|---|
Link-local addresses | 255.255.0.0 | 169.254.0.0/16 | 169.254.0.0–169.254.255.255 | 65536 | B |
Link-local IP address helps two or more hosts on single link/same network segment to communicate when no IP’s valid local or public IP’s are assigned to them.
APIPA was created by Microsoft for Windows to assign IP to interface if it not able to acquire IP. Later it became a standard
Loopback IP Addresses
Block Name | Default subnet mask | CIDR Notation | Address Range | # of Addresses | Address Class |
---|---|---|---|---|---|
Loopback addresses | 255.255.0.0 | 127.0.0.0/8 | 127.0.0.1 – 127.255.255.255 | 16 777 216 | B |
Leave a Reply