Many Computer Network beginners are confused about IP address and the difference between IPv4 and IPv6. In this article, we will try to explain everything about IP addresses in detail with simple examples and will also see the differences between IPv4 and IPv6.
So let's start with an example: Consider a student Ben, who got admitted to ABC university where he got assigned a registration number, which is necessary to uniquely identify him among the other students. Universities around the world follow the same process. Just like that every machine whether it's a computer or a mobile device when connected to the internet are assigned an IP address (Internet Protocol Address). Similar to ben's registration number, the IP address is also in numeric form.
Now what will happen if Ben decides to move to a new university XYZ for higher studies, now will his registration number remain the same? Obviously not. So, in the same way, IP address changes when we move from place to place, or from network to network.
The IP address can be used to determine the location of the computer or mobile device, generally, most networks combine IP with a TCP(which is Transmission Control Protocol).
The IP address also plays an important role in setting up a virtual connection between a destination and a source machine.
Here is how an IP address looks like 192.168.1.1
The IP address consists of different versions, let's discuss IPv4 that is IP version 4 and IP version 6.
IPv4 address
We generally represent IPv4 in DOT notation. E.g. it varies from 0.0.0.0 to 255.255.255
There is another way in which we can represent IPv4 and that is in the form of 4-tuple of octets, which is an 8-bit segment, since 28=256.
The IPv4 consists of 12 header fields. The components of the header section of the request, as well as response messages in the hypertext transfer protocol (HTTP) which defines the operating parameters of an HTTP transaction, are HTTP header fields. Here the length of the header field is 20 bytes. IPv4 address also consists of the checksum field which is useful in detecting errors during the transmission of the message.
here we have to configure a newly installed system before it can communicate with other systems. IPv4 also supports the variable length subnet mask (vlsm) which allows network engineers to divide an IP address space into a hierarchy of subnets of different sizes, enabling the possibility of creating subnets that have very different host counts without wasting large numbers of addresses
Following is the same IP address in both forms of notations.
Dot notation: 172.217.6.36
4-tuple octet: 10101100 11011001 00000110 00100100
The IPv4 addresses consist of two parts, first part the network prefix (it determines the network to which the address belongs), the second part, the host identifier, which helps to identify the host within that network.
Features of IPv4 addresses:
-
Connectionless Protocol
-
It allows for the creation of a simple virtual communication layer over varied devices
-
Less memory is required, and ease of remembering addresses
-
Already supported protocol by millions of devices
-
Offers video libraries and conferences
IPv4 address classification:
IPv4 addresses consist of 5 classes from class A to class E. These classes differ from each other in the first 4 bits of IP addresses.
-
Class A - IP addresses which belong to this class have their first bit as "0". In dot-notation form, it ranges from "0.0.0.0 to 127.255.255.255". The first 8 bits of the address represent the network prefix and the rest of them represent the host identifier. For instance, consider 127.42.13.69. It has a network prefix "127" and a host identifier "42.13.69".
-
Class B - IP addresses that belong to this class have their first bits as "10". In dot-notation form, it ranges from "128.0.0.0" to "191.255.255.255". The network prefix is represented by the first 16 bits and the remainder represents the host identifier. For instance, in 129.42.13.69, the network prefix is 129.42 and the host identifier is 13.69.
-
Class C - IP addresses that belong to this class have their first bits as "110". In dot-notation form, it ranges from "192.0.0.0" to "223.255.255.255". The first 24 bits of the address represent the network prefix and the rest represent the host identifier. For instance, in 196.13.42.69, the network prefix is 196.13.42 and the host identifier is 69.
-
Class D - IP addresses which belong to this class have their first bits as "1110". In dot-notation form, it ranges from "224.0.0.0" to "239.255.255.255". These addresses are used for multi-casting protocols (ie. when in one action, a single packet can be sent to multiple hosts)
-
Class E - IP addresses which belong to this class have their first bits as "1111". In dot-notation form, it ranges from "240.0.0.0" to "255.255.255.255". These IP addresses are reserved for future and experimental use.
Routing information protocol (RIP)
It is a dynamic routing protocol (automatically select the best route to put into the routing table) which uses hop count as a routing metric to find the best path between the source & the destination network. In IPv4 RIP is a routing protocol supported by the routed daemon.
IPv6 Address
We represent IPv6 addresses in colon-notation as xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx, here xxxx is hexadecimal value and we can also represent IPv6 in the form of 8-tuples of 16-bit segments.
The IPv6 consists of 8 header fields. In an HTTP transaction, the components of the header section of the request, as well as response messages in the hypertext transfer protocol (HTTP) which defines the operating parameters, are HTTP header fields. Here the length of header field is 40 bytes. IPv6 address does not consist of the checksum field. And as we have seen above in IPv4 the five classes from class A to E, IPv6 allows storage for an unlimited number of IP addresses. In IPv6, the configuration part is optional, which depends upon the functions required, unlike IPv4 where we have to configure a newly installed system before it can communicate with other systems.
Following is the same IP address in both forms of notations.
Colon-notation: 2001:0db8:0012:0001:3c5e:7354:0000:5db1
8-tuple of 16-bit segments:
0010000000000001 0000110110111000 0000000000010010 0000000000000010 0011110001011110 0111001101010100 0000000000000000 0101110110110001
Talking about IPv4, it has only 232 = 4,294,967,296 possible addresses!. The world population is around 7.6 billion. So, staying onto IPv4 was not a good idea.
Switching onto IPv6 gives us 2128 = 340,282,366,920,463,374,607,431,768,211,456.
IPv6 Addressing Methods
In IPv6 representation, we have three addressing methods which are unicast, multicast & anycast. Unlike IPv4, IPv6 does not use broadcast addresses
Unicast Address: Unicast Address determines a single network interface. A packet sent to a unicast address is delivered to the interface which is identified by that address.
Multicast Address: Multicast Address is used by multiple hosts which are known as Groups, which acquires a multicast destination address. It is not necessary for these hosts to be geographically together. If any packet is sent to this multicast address, then it will be distributed among all the interfaces corresponding to that multicast address. Also, multicast addressing provides additional optimization for the delivery of services. Device mobility, security, and configuration aspects are aspects that have been considered in the design of the protocol.
Anycast Address: Here, The Anycast Address is assigned to a group of interfaces. Any packet sent to anycast address will be delivered to only a single member interface (it is generally the nearest host possible).
Features of IPv6 addresses
-
Hierarchical addressing and routing infrastructure
-
Stateful and Stateless configuration
-
Support for quality of service (QoS)
-
An ideal protocol for neighboring node interaction
The routing information protocol discussed above does not support IPv6 instead it uses static routes.
Difference between IPv4 and IPv6
Following are some of the differences between IPv4 and IPv6:
|
IPv4
|
IPv6
|
size
|
32-bit
|
128-bit
|
notation
|
Dot-notation
|
Colon-notation
|
Header fields
|
12
|
8
|
Length of header fields
|
20
|
40
|
Has Checksum
|
Yes
|
No
|
Number of classes
|
5 (from A to E)
|
Unlimited
|
Supports VLSM
|
Yes
|
No
|
Fragmentation
|
Done by sending & forwarding routes
|
Done by sender
|
Supports RIP
|
YES
|
NO
|
Supports SNMP
|
YES
|
NO
|
Packet size
|
576 bytes
|
1208 bytes
|
Mapping
|
Uses ARP(address resolution protocol)
|
Uses NDP(neighbor discovery protocol )
|
IPSec
|
Optional
|
Mandatory
|
Has Optional fields
|
Yes
|
No
|
Local subnet group management
|
Internet group management protocol
|
Multicast listener discovery
|
Due to all these differences, the IPv4 & IPv6 cannot communicate with each other but they can exist together on the same network, that network is known as a dual-stack network. With this comparison, we can have a better understanding of IP addresses and their versions IPv4 & IPv6. As the users are increasing on a very huge level, switching from IPv4 to IPv6 supports the growing number of devices.
But eventually, we all have to switch to the IPv6 cause it offers more transparency, improved mobility & mandated security, and as you can see in the above-mentioned table that IPv6 provided unlimited IP address classes that are necessary as network users are rapidly increasing day by day.
You may also like: