Cool Boiled WaterCool Boiled Water Logo
HomeBlog
ipv6 meme

IPv4 and IPv6

Network
5 days ago1170 words|Estimated reading time: 6 minutes

Why We Need a New IP Protocol

In today's highly connected digital world, IP addresses are like the "house numbers" of the internet. Every device connected to the internet needs a unique identifier. Since the early 1980s, IPv4 (Internet Protocol version 4) has been the foundation of internet communication.

However, with the explosive growth in the number of internet devices, the problem of IPv4 address exhaustion has become increasingly serious. This has led to the creation and development of IPv6 (Internet Protocol version 6).

This article will start with the basics and systematically introduce the technical features, differences, and transition mechanisms of IPv4 and IPv6. It aims to help university students with some computer background fully understand these two key network protocols.

IPv4: The Founder of the Internet

IPv4 Address Structure and Representation

IPv4 uses 32-bit binary addresses, usually shown in dotted decimal notation, for example: 192.168.1.1

Address Structure Analysis:

  • 32-bit addresses are divided into 4 groups of 8 bits (octets).
  • Each octet has a value range from 0 to 255 (00000000 to 11111111 in binary).
  • There are about 4.3 billion possible addresses in total (2^32 = 4,294,967,296).

IPv4 Address Classes and Subnetting

Initially, IPv4 addresses were divided into 5 classes:

ClassAddress RangeNetwork PartHost PartUse
A1.0.0.0 - 126.255.255.2558 bits24 bitsLarge Networks
B128.0.0.0 - 191.255.255.25516 bits16 bitsMedium Networks
C192.0.0.0 - 223.255.255.25524 bits8 bitsSmall Networks
D224.0.0.0 - 239.255.255.255--Multicast
E240.0.0.0 - 255.255.255.255--Experimental

Subnetting is a technique introduced to use the address space more efficiently. It uses a subnet mask (like 255.255.255.0) to divide an IP address into a network part and a host part.

Example: Calculating the number of usable hosts for the network 192.168.1.0/24

  • Network Address: 192.168.1.0
  • Broadcast Address: 192.168.1.255
  • Usable Host Addresses: 192.168.1.1 - 192.168.1.254 (254 addresses in total)

Limitations of IPv4

  1. Address Exhaustion: 4.3 billion addresses are not enough for all the devices in the world.
  2. Reliance on NAT: Network Address Translation helps with the address shortage but breaks the end-to-end principle.
  3. Complex Configuration: Often requires manual setup; low automation.
  4. Insufficient Security: IPSec support is optional and not widely used.
  5. Quality of Service: Limited support for real-time applications.

IPv6: The Next Generation Internet Protocol

IPv6 Address Structure and Representation

IPv6 uses 128-bit addresses, which creates a vastly larger address space (about 3.4×10^38 addresses).

Representation Method:

  • Shown in hexadecimal, with each 16-bit block as one group, making 8 groups in total.
  • Groups are separated by colons.
  • Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334

Simplification Rules:

  • Leading zeros in a group can be omitted: 2001:db8:85a3:0:0:8a2e:370:7334
  • Consecutive groups of all zeros can be replaced with "::" (only once per address): 2001:db8:85a3::8a2e:370:7334

IPv6 Address Types

IPv6 defines three basic address types:

Unicast Address: Identifies a single interface.

  • Global Unicast Address (like IPv4 public addresses).
  • Link-Local Address (starts with fe80::/10).
  • Unique Local Address (starts with fc00::/7).

Multicast Address: Identifies a group of interfaces.

  • Replaces IPv4 broadcasting and is more efficient.
  • Format: starts with ff00::/8.

Anycast Address: Identifies a group of interfaces, but data is sent to the nearest one.

  • Assigned from the unicast address space.
  • Used for load balancing and redundancy.

Technical Advantages of IPv6

  1. Huge Address Space: Enough to give an address to every grain of sand on Earth.
  2. Simplified Header Format: Fixed 40-byte header improves routing efficiency.
  3. Auto-configuration: Stateless Address Auto-configuration (SLAAC).
  4. Built-in Security: IPSec is mandatory.
  5. Better QoS Support: Flow Label field helps real-time applications.
  6. Mobility Support: Better experience with Mobile IP.

Key Technical Comparison: IPv4 vs. IPv6

Packet Header Structure Comparison

IPv4 Header (Usually 20 bytes, up to 60 bytes):

0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version|  IHL  |Type of Service|          Total Length         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Identification        |Flags|      Fragment Offset    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Time to Live |    Protocol   |         Header Checksum       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                       Source Address                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Destination Address                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Options (if IHL > 5)                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

IPv6 Header (Fixed 40 bytes):

0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Traffic Class |           Flow Label                  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Payload Length        |  Next Header  |   Hop Limit   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
+                         Source Address                        +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                                                               |
+                      Destination Address                      +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Summary of Key Differences

FeatureIPv4IPv6
Address Length32 bits128 bits
Number of Addresses~4.3 billion~3.4×10^38
Address NotationDotted DecimalColon-Separated Hex
Header LengthVariable (20-60 bytes)Fixed 40 bytes
Header ChecksumYesNo (relies on higher layers)
FragmentationBy routers and hostsBy source host only
ConfigurationManual / DHCPAuto-config (SLAAC) / DHCPv6
SecurityIPSec OptionalIPSec Mandatory
QoS SupportType of Service fieldFlow Label field
BroadcastSupportedReplaced by Multicast

Transition Technologies from IPv4 to IPv6

Dual Stack

The simplest transition method. Devices run both IPv4 and IPv6 protocol stacks at the same time.

Configuration Example (Cisco router):

interface GigabitEthernet0/0
 ip address 192.168.1.1 255.255.255.0
 ipv6 address 2001:db8:1::1/64
 ipv6 enable

Tunneling

Encapsulates IPv6 packets within IPv4 packets to connect IPv6 "islands" over an IPv4 network.

Common Tunnel Types:

  • Manually Configured Tunnels
  • 6to4 Tunnels (automatic)
  • Teredo Tunnels (through NAT devices)

6to4 Tunnel Example: Sending an IPv6 packet to 2001:db8:1::1 over an IPv4 network via 192.0.2.1:

IPv6 Header | IPv6 Payload
    ↓ Encapsulation
IPv4 Header(Protocol 41) | IPv6 Header | IPv6 Payload

Protocol Translation

NAT64/DNS64: Allows IPv6-only clients to access IPv4-only servers.

  • NAT64: Translates between IPv6 and IPv4 addresses.
  • DNS64: Synthesizes AAAA records (IPv6) from A records (IPv4).

Conclusion

The transition from IPv4 to IPv6 is a major milestone in the history of the internet. Although the transition is taking longer than expected, the adoption of IPv6 is now unstoppable.

Content

Why We Need a New IP Protocol IPv4: The Founder of the Internet IPv4 Address Structure and Representation IPv4 Address Classes and Subnetting Limitations of IPv4 IPv6: The Next Generation Internet Protocol IPv6 Address Structure and Representation IPv6 Address Types Technical Advantages of IPv6 Key Technical Comparison: IPv4 vs. IPv6 Packet Header Structure Comparison Summary of Key Differences Transition Technologies from IPv4 to IPv6 Dual Stack Tunneling Protocol Translation Conclusion
Switch To PCThank you for visiting, but please switch to a PC for the best experience.