ABC of IPv6 Addressing
Overview
IPv6 is defined to eventually replace IPv4. As far as the
purpose is concerned both IPv4 and IPv6 are here to define logical address in
IP network. It is required to uniquely identify the host and deliver the right
content to the right recipient.
The most obvious and recognizable difference between IPv4 and IPv6 is the IPv6 address. An IPv4 address is 32 bits and expressed in dotted-decimal notation, whereas an IPv6 address is 128 bits in length and written in hexadecimal.
Just as an IPv4 address is divided into two parts, IPv6 address also has two parts. First 64-bits are known as the network/subnet and last 64-bits are for interface id or host. As you probably know this is required to locate a host in an IP network to correctly send the request/response.
IPv6 addresses are 128 bits in length and written as a string of hexadecimal digits. Every 4 bits can be represented by a single hexadecimal digit, for a total of 32 hexadecimal values. Configuring or working with IPv6 address is difficult as it a very long hexadecimal value.
This can be solved as there are various ways where this address can be trimmed down. We’ll see it soon but before that it is worth to know that the alphanumeric characters used in hexadecimal are not case sensitive; therefore, uppercase and lowercase characters are equivalent.
The longest representation of an IPv6 address includes a total of 32 hexadecimal values. Colons separate the groups of 4-bit hexadecimal digits. For example –
Address 1 - fe80:0000:0000:0000:a299:9bff:fe18:50d1
Address 2 - 2001:0db8:cafe:0001:0000:0000:0000:0100
Rule 1 – Omit leading 0s: Omit the leading 0 from the 16-bits section. This rule applies only to leading 0s and not to trailing 0s.
Address 1 Original format - fe80:0000:0000:0000:a299:9bff:fe18:50d1
Address 2 after Rule 1 – fe80:0:0:0:a299:9bff:fe18:50d1
Address 2 Original format - 2001:0db8:cafe:0001:0000:0000:0000:0100
Address 2 after Rule 1 – 2001:db8:1:0:0:0:100
Rule 2 – Omit all 0s : The second rule for shortening IPv6 addresses is that you can use a double colon (::) to represent any single, contiguous string of two or more hextets (16-bit segments) consisting of all 0s.
Address 1 Original Format - fe80:0000:0000:0000:a299:9bff:fe18:50d1
Address 1 after Rule 2 – fe80::a299:9bff:fe18:50d1
Address 2 - 2001:0db8:cafe:0001:0000:0000:0000:0100
Address 2 after Rule 2 – 2001:0db8:café:0001::0100
Rule 3 – Use rule 1 and rule 2 same time – yes, both the rules stated above can be used same time as follows:
Address 1 Original Format - fe80:0000:0000:0000:a299:9bff:fe18:50d1
Address 1 after Rule 2 – fe80::a299:9bff:fe1850d1
Address 2 - 2001:0db8:cafe:0001:0000:0000:0000:0100
Address 2 after Rule 2 – 2001:db8:café:1::100
Refer to Figure 1, it depicts the IPv6 network. There are
two IPv6 network – 2001:db8:a:a::/64 and 2001:db8:d::/64. There are two host
sharing the same network ID “2001:db8:a:a::/64” as part of the IPv6 address
assigned to them – PC 1 IPv6 Address: 2001:db8:a:a::10, and PC2 IPv6 Address:
2001:db8:a:a::20 pointing to default gateway in the same network subnet.
Fig 1.1- IPv6 addressing |
When a host wants to communicate to another host, it
compares it network id with destination host network id. If both are same,
communication between these two hosts will be based on the MAC address. If they
do not match it means the destination host is on the different network and the
packet is sent to the default gateway.
For example PC 1 wants to send the
traffic to the web-server and come to know that the network ID is different one
that is configured on its own interface. Therefore packets to different network
are forwarded to default gateway in this case g0/0 interface on router 1.
You can verify the IPv6 address on the PC using the ipconfig
command.