In today’s technological age, we have witnessed a huge leap in the use of Internet and networked devices. Every home has a laptop, smartphone, digital watch, IoT devices, home automation components and other devices connected to the home network or the Internet. Devices communicate with each other over a variety of network protocols, of which TCP and IP are the most commonly used. Each device connected to the network must have an IP address that identifies the device on the network.
This article explains the Internet protocol and the difference between IPv6 and IPv4.
What is IP (Internet Protocol)?
As humans, we use our names to identify and communicate with each other. Similarly, in the computing world, devices use IP addresses to identify and interact with each other. The common language that all computing devices use to communicate with each other is called a protocol. Similar to human language, the protocol has a set of rules for formatting and processing data.
The Internet Protocol (IP) is a set of rules that specify the addressing and routing of data between computers. It is used primarily with network transport protocols, such as TCP and UDP.
This unique addressing model is what allows the Internet to exist today. IANA manages the range of IP addresses of networks/stations connected to the Internet. However, if we run an isolated local network infrastructure, we can assign IP addresses according to our preferences. Now, let’s dive into the essence of these two architectures and their comparative analysis.
IPv4
The first major release of the Internet Protocol (IP) was version 4 (IPv4). It uses a 32-bit network addressing architecture, which is further split into four 8-bit numbers called octets. For example, the IP address of google.com
is 141.251.36.46. This format is called dotted-quad representation. These IP addresses can be configured manually or obtained automatically through a DHCP server.
To check the live status of a remote device, we can use the following ping
command to perform an ICMP probe on that IP.
The IP address is divided into two parts, the network address and the host address, which are used to create subnets. The subnet number helps determine the network and host portions of the IP. In addition, the available IP space is divided into five different categories, as shown in the table below.
address class | IP range | subnet mask | number of networks | number of hosts per network |
---|---|---|---|---|
Class A | 1.0.0.0 to 126.0.0.0 | 255.0.0.0 | 126 | 16,777,214 |
Level B | 128.0.0.0 to 191.255.0.0 | 255.255.0.0 | 16,282 | 65,534 |
Class C | 192.0.0.0 to 223.255.255.0 | 255.255.255.0 | 2,097,150 | 254 |
Level D | 224.0.0.0 to 239.255.255.255 | Multicast | ||
Class E | 240.0.0.0 to 255.255.255.255 | Research/Reserve/Experimental |
The calculation of subnets involves some mathematical gauges behind the scenes. To ease our calculations, we can use similar tools ipcalc
or subnetcalc
for IPv4 subnets. The following snippet shows how to use these tools.
|
|
|
|
Typically, IP addresses are assigned to end hosts and router gateway interfaces as shown in the figure below.
Here, the traffic from Machine A (10.235.64.58) reaches the router gateway interface (10.235.64.57) on the left side of the Internet cloud. It is routed over the Internet to the Google Server gateway and finally to the destination server.
To identify the network interface IP, you can use commands such as ifconfig
, hostname
or the command ip
.
|
|
|
|
A network IP address that has a special purpose, such as 0.0.0.0
or 127.0.0.1
. The former is the default route or four-zero route, and the latter is called a loopback address.
In the following snippet, we will see the kernel IP routing table and the default route for this network. The flag ‘U’ indicates that the network route is UP, while G indicates that the network route is a network gateway.
Typically, an IPv4 datagram consists of a 20-byte header field, an options field, and a variable-length data field. An example packet format is shown below.
Below, Wireshark captures help decipher packet header information from live traffic.
IPv6
Internet Protocol version 6 is an updated version of the Internet Protocol (IP). Version 6 of the Internet Protocol is intended to replace the older version (IPv4), which carries 75% of total Internet traffic as of 2018 (source: Google IPv6 Stats).
IPv6 addresses are 128 bits (16 bytes) and use 32 hexadecimal digits, while these are further divided into eight groups of four digits each for ease of management. A brief description is shown below.
There are very few basic steps involved in the IPv6 naming convention.
Rule 1: All letters are case-insensitive. For example, ‘ab41’ equals ‘AB41’ Rule 2: Consecutive fields with ‘0’ can be visualized as “::”, but can only appear once in the addressing rules Rule 3: Indicating leading zeros in a field is optional. For example, ‘001a’ is equivalent to ‘1a’
Take the IPv6 address as an example, 45ab:0000:a179:0000:0000:c1c0:abcd:0876
- Application Rule 1 => 45ab:0000:a179:0000:0000:c1c0:abcd:0876
- Application Rule 2 => 45ab:0:a179:0:0:c1c0:abcd:876
- Application Rule 3 => 45ab:0:a179 ::c1c0:abcd:876
There are three types of IPv6 addresses: unicast, multicast, and anycast. A unicast address is a single network interface and the packets transmitted to that particular interface. In addition, unicast addresses have local (link-local) and global scope levels. Multicast addresses are the group interfaces to which packets are delivered. An anycast address is the group interface and the packet delivered to the nearest interface.
A few well known addresses are listed below.
]::1/128 | loopback address |
---|---|
ff00::/8 | multicast address |
fe80::/10 | link-local address |
2001::/16 | regular IPv6 unicast address |
2002::/16 | 6to4 unicast address |
|
|
Similarly, IPv6 packets have both a header and a payload. The header size is fixed at 40 bytes, and the source and destination addresses occupy 32 bytes. An example packet format is shown below.
IPv6, for all its benefits, cannot replace IPv4, and the two protocol versions must coexist for a period of time to migrate seamlessly. Therefore, service providers are providing dual-stack support systems that have network interfaces that can understand both IPv4 and IPv6 packets.
There are few intelligent transition mechanisms, i.e., IPv6 tunnels, IPv4 mapped IPv6 addresses, etc. The former encapsulates IPv6 packets in IPv4, while the latter maps IPv6 to IPv4 addresses in a dual-stack implementation.
IPv4 vs IPv6 - Quick Comparison Analysis
Features | INTERNET Protocol - Version 4 [IPV4] | Internet Protocol - Version 6 [IPV6] |
---|---|---|
deployment and allocation | 1981 | 1999 |
length | 32-bit | 128-bit |
address space | 4.29 x 10^9 | 3.4 x 10^38 |
format | dotted decimal / [10.235.64.56] | hexadecimal / [2400::4] |
number of octets | 4 | 16 |
header size | varies from 20 - 60 bytes | 40 bytes |
class | five classes: Class A, Class B, Class C, Class D, Class E | without any |
security features/authentication and encryption | unavailable | available |
Check amounts | available | unavailable |
IPSec | external and optional | built-in features |
hop count | indicated by the TTL field | indicated by the Hoplimit field |
fragmentation | performed by the sending and forwarding routers | by the sender only |
Option fields | provided in IPv4 header | no optional fields, but can use IPv6 extension header |
Multicast | IGMP manages multicast group members | MLD replaces IGMP |
Broadcast message | available | not available. Use multicast |
IP to MAC Mapping | Address Resolution Protocol | Neighbor Discovery Protocol |
Conclusion
We have explored the basics of the Internet protocol and its versions. In the process, this paper has clarified the addressing modes, packet formats, and functions of IPv4 and IPv6 through a comparative analysis. Although IPv4 carries most of the Internet traffic today, IPv6 is the future of the networked world.