Let’s dig a little into origin of IPV6 before we start to configure
IPv6 is the latest version of the Internet Protocol, the previous version, IPv4, uses a 32-bit addressing scheme to support just about 4.3 billion devices, which by today’s standard would have been exhausted as predicted but thanks to a protocol called NAT, more on that later.
The growth of the internet, personal computers, smartphones and now Internet of Things devices proves that the world needed more addresses. Fortunately, the Internet Engineering Task Force (IETF) recognized this 20 years ago.
In 1998 it created IPv6, which instead uses 128-bit addressing to support approximately 340 trillion trillion (or 2 to the 128th power, if you like). Instead of the IPv4 address method of four sets of one- to three-digit numbers, IPv6 uses eight groups of four hexadecimal digits, separated by colons. This is enough to identify devices across the internet, so they can be located. Every device that uses the internet is identified through its own IP address in order for internet communication to work.
What are the benefits of IPv6?
In its work, the IETF included enhancements to IPv6 compared with IPv4. The IPv6 protocol can handle packets more efficiently, improve performance and increase security. It enables internet service providers to reduce the size of their routing tables by making them more hierarchical.
IPV6 Addressing
The length of an IPv6 address is 128 bits, compared with 32 bits in IPv4. The address is split into 2 64 bit segments the top 64 bits is the network part and the lower 64 bits, the node part. The address space therefore has 2128 or approximately 3.4×1038 addresses
(340,282,366,920,938,463,463,374,607,431,768,211,456, which is approximately 340 undecillions, or 340 billion billion billion billion, addresses) An example is given below:
IPv6 Address Representation
IPv6 addresses consist of 8 groups of 16-bit hexadecimal values separated by colons (:). IPv6 addresses have the following format:
aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa . Each (aaaa) is a 16-bit hexadecimal value, and each ais a 4-bit hexadecimal value.
Following is a sample IPv6 address: 3FFE:0000:0000:0001:0200:F8FF:FE75:50DF
You can omit the leading zeros of each 16-bit group, as follows: 3FFE:0:0:1:200:F8FF:FE75:50DF
You can also compress 16-bit groups of zeros to double colons (::) as shown, but only done once per address: 3FFE::1:200:F8FF:FE75:50DF
What is IPv6 Network Prefix ???
The leftmost fields of the IPv6 address contain the prefix, which is used for routing IPv6 packets. IPv6 prefixes have the following format: prefix/length in bits. Prefix length in bits is stated in classless inter-domain routing (CIDR) notation which is a slash at the end of the address that is followed by the prefix length in bits. The prefixes in IPv6 can be considered similar to the subnet mask used in IPv4 addresses. Example of prefix is 2001:1111:2222:3333::/64 . This is the same as writing 192.168.1.1 /24 in IPV4. The number behind the / are the number of bits that we use for the prefix. In the example, it means that 2001:1111:2222:3333 is the prefix (64 bits).
How to find IPv6 Prefix
When calculating subnets for IPv4 we can use the subnet mask to determine the network address and for IPv6 we can do something similar. For any given IPv6 address, we can calculate what the prefix is, as an example, an IPv6 address that could be assigned to a host is:
2001:1234:5678:1234:5678:ABCD:EF12:1234/64
What part from this IPv6 address is the prefix and what part identifies the host? Divide the 8 groups of 16 bits into 2, the first 4 groups becomes the prefix and the last 4 becomes the host as shown;
Since we use a /64 it means that the first 64 bits are the prefix. Each hexadecimal character represents 4 binary bits, so, that means that this part 2001:1234:5678:1234 is the prefix. This part has 16 hexadecimal characters. 16 x 4 means 64 bits. So that’s the prefix. The rest of the IPv6 address 5678:ABCD:EF12:1234 identifies the host:
Now, since we figured out that “2001:1234:5678:1234” is the prefix part, writing it down like this is incorrect. So, to write down the prefix correctly, we need to add zeros at the end of this prefix so that, it is a 128 bit address again and add the prefix length:
2001:1234:5678:1234:0000:0000:0000:0000/64 is a valid prefix.
We can however shorten it. This string of zeros can be removed and replace by a double colons (::) to make it 2001:1234:5678:1234::/64. That’s the shortest way to write down the prefix.
Another example
2001::1234:ABCD:5678:1010:CAFE/64
Before we can know what the prefix is, we need to first write out the complete address as this one has been shortened as shown by the (:: ).
So, to write it out, just add zeros until we have a full 128 bit address again. Remember, its 8 blocks of 16bits, which will now be as follows; prefix =2001:0000:0000:1234 host= ABCD:5678:1010:CAFE/64
Now, we need to complete the prefix by adding zeros at the end of the 4th group to make it a 128 bit address again and add the prefix length, so it looks like this 2001:0000:0000:1234:0000:0000:0000:0000/64 and the prefix length of 64 bits.
This can be re-written as 2001:0000:0000:1234::/64
It can further be re-written as 2001:0:0:1234::/64 (4 zeroes in a row can be replaced by a single zero, so “2001:0:0:1234::/64” is the shortest we can make this prefix).
The main features of the IPv6 are listed below.
- IPv6 provides better end-to-end connectivity than IPv4.
- Comparatively faster routing.
- IPv6 offers ease of administration than IPv4.
- More security for applications and networks.
- It provides better Multicast and Anycast abilities.
- Better mobility features than IPv4.