In the 80s, with the creation of the Internet service, no one imagined the huge demand it would have today. Therefore, it was developed using IPv4 (Internet Protocol version 4).
An IPv4 address is represented by decimal numbers and has a length of 32 bits. This allows for a total of 4,294,967,296 possible combinations. Addresses are written in a format of 4 bytes separated by periods (n.n.n.n), where each "n" is a decimal digit (between 0 and 255).
In IPv4, there are classes of addresses (from A to E), but only the first three classes (A, B, C) are used. Each address has a mask that indicates the bits that form the network and the bits that define the host. Additionally, there is a distinction between public IPs and private IPs; the former are visible on the Internet, while the latter are used internally in organizations and homes, without direct visibility from the internet.
What is IPv6
With the rise of technologies and the increasing demand, a depletion of public IPv4 addresses was detected. To solve this problem and improve what existed, the IETF began developing a new addressing scheme. In the early 90s, IPv6 (Internet Protocol Version 6) was created.
An IPv6 address is represented by 8 groups of 4 hexadecimal digits separated by colons (:). This protocol allows for a total of 2^128 possible combinations, ensuring that all devices can connect to the internet without distinction between private and public IPs, as all IPs are global. With IPv6, the use of NAT to access the internet is no longer necessary.
Differences between IPv4 and IPv6
The main differences between both protocols are as follows:
- Number of bits: IPv4 uses 32 bits, while IPv6 uses 128 bits.
- Format: IPv4 uses periods (.) to separate bytes, while IPv6 uses colons (:).
- Traffic optimization: IPv4 includes Broadcast, while IPv6 uses Multicast, optimizing data transport.
- Automatic configuration: In IPv6, nodes can configure their IP addresses automatically without the intervention of an administrator.
- NAT: In IPv4 it is necessary, but in IPv6 it is not, as each device has a global address.
- Security: IPv6 incorporates security mechanisms such as SSL and IPSec.
- Headers: The IPv6 header is longer and suitable for 64-bit processors.
Special Addresses in IPv4 and IPv6
In IPv6:
- 0000::/8: Addresses reserved by the IETF.
- 2000::/3: Global addresses.
- FE80::/10: Link-local addresses, not routable on the internet.
- FF00::/8: Multicast addresses.
- ::/128: Unspecified address (similar to 0.0.0.0/32 in IPv4).
- ::1/128: Loopback address (similar to 127.0.0.1 in IPv4).
In IPv4:
- 127.0.0.0/8: Loopback addresses for checking TCP/IP configuration.
- 169.254.0.0/16: APIPA addresses for automatic assignment in the absence of a DHCP server.
- 192.0.2.0/24: Addresses for educational use and examples.
- 240.0.0.0/4: Experimental addresses.
Differences in IPv4 and IPv6 Headers
- Header size: IPv4 has 20 bytes, while IPv6 has 40 bytes.
- Specific fields: IPv6 includes fields like "flow label" and "traffic class".
- Addresses: Addresses in IPv6 take up more space due to their greater length.
Why is it necessary to switch to IPv6
Migrating from IPv4 to IPv6 is a long and complex process, but necessary. IPv6 offers a much greater number of IP addresses, allowing for more devices to connect to the network and alleviate congestion in current structures. It also improves security and facilitates the automatic configuration of devices.
IPv6 is designed to be easy and transparent for users, allowing for greater flexibility and security in network connections. The adoption of IPv6 will ensure the availability of enough IP addresses for the future growth of connected devices.
In summary, although the transition to IPv6 requires effort and time, its advantages in terms of capacity, security, and ease of use justify this necessary change.