IPv6 Address Format
By Stephen Bucaro
IPv4 (Internet Protocol version 4) is running out of addresses. IPv6 was designed
to solve this problem therefore it's important to understand the format of an IPv6 address.
What's the difference between an IPv4 address and an IPv6 address? An IPv6 address
is much larger. An IPv4 address consists of 32 bits, while and IPv6 address consists of 128 bits.
An IPv4 address has 4 groups of numbers, while an IPv6 address has 8 groups
of numbers. The groups in an IPv4 address are separated by periods, while the
groups in an IPv6 address are separated by colons. The numbers in an IPv4
address are decimal numbers ranging from 0 to 255, while the numbers in an
IPv6 address are hexadecimal numbers ranging from 0 to ffff.
The address shown above is a global unicast address. A global unicast address
is simply a public IP address. You can identify a global unicast address by converting
the first number in the address to binary. In this case 2000 in hex is 0010000000000000
in binary. The first 3 bits set to 001 identifies a global unicast address.
The first 48 bits are the global prefix. The global prefix identifies the highest
level in the routing hierarchy. The IANA allocates global prefixes to Internet registries,
which then assign them to organizations.
The next 16 bits are the subnet ID, which an organization can use for structuring
their network into subnets. 16 bits allows as many as 65,536 subnets, and each subnet
can have 18446744073709551616 computers.
Writing IPv6 Addresses
In order to make it easier to write long IPv6 addresses, there are several rules
allowing you to abbreviate them. Let's take the example shown below:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
Leading zeroes in a group may be omitted. Thus, the example address may be written as:
2001:db8:85a3:0:0:8a2e:370:7334
One or more consecutive groups of zero value may be replaced with a single empty group,
leaving two consecutive colons (::). Thus, the example address can be further simplified:
2001:db8:85a3::8a2e:370:7334
You may have a large sequence of zero's in an address, so you can replace it with a single
instance of consecutive colons. The example shown below:
1080:0:0:0:8:800:200C:417A
Can be written as:
1080::8:800:200C:417A
The loopback address:
0:0:0:0:0:0:0:1
Can be written as:
::1
As another example, the address shown below:
FF02:0:0:0:0:0:0:2
Can be written as:
FF02::2
You cannot use zero compression to include part of a block. For example,
you cannot express:
FF02:30:0:0:0:0:0:5
As:
FF02:3::5
|