Month: March 2015

Concepts of IPv6

Introduction

IPv6 was there for around 20 years but still it is considered as a new thing, Regardless of how much organizations are forced to adopt to this still it’s just 10% in world. So in this post I thought of writing on the initial concepts of IPv6. Because as a newcomer to this topic, you will come-across so many technical terms even hard to remember, hex-numbers which are not human-friendly compared to IPv4 address and concepts around multicast which may hard to understand at once. Even for me it was not easy at the first time, so I thought of digging a bit in it and here’s my experience on it. Please note that through this I’m not going to cover every single point of IPv6 and assumed that you are already familiarized with IPv4 basics. So let’s start.

Why IPv6

You may already aware that IPv4 address-space has almost exceeded and there should be a new addressing schema. So IPv6 came with IP address with 128 bits long, so according to current situation this is far more enough since it consists 2^128 addresses!

IPv6 address can be divided into  chunks of 16-bits. so there are 8-parts in a single address. Each part represent by 4 hexadecimal numbers. And there are short-hand methods of writing a IPv6 address using :: (double-colon) and omitting leading zeros inside a chunk. So that’s it about a IPv6 address for more please refer [2].

Multicast in IPv6

Multicast is sending a message to a particular group of nodes which listens to an IPv6 address. This technique has replaced the Broadcast and ARP concepts which are using in IPv4. In one way we can see removing broadcast has reduced the unnecessary traffic-jam. But as a consequence of that, a bit complex mechanism has used to identify nodes and interfaces. So in IPv6 interfaces tend more to talk with each other compared to IPv4 and get the things done.

Working in IPv6

Now lets see how IPv6 works in a more practical aspect. For clear explanation, let’s take a case where a host connected to router via a network.

Initial_diagram
After Host-A boots up

When the host boots-up, it is automatically configured for several IPv6 address.

1. Link-local address

An address that will use within a link. Packets with link-local address as src. or dest. never get forwarded by routers. The creation of this link-local is happen with the help of EUI-64 (which uses MAC address of the interface or may be random 64 bits generated). For that FE80:: /64 bits become the prefix and link-local IPv6 address get created. After the process of Duplicate Address Detection (DAD) process, this link-local may become the global unique IPv6 address of that node (will discuss later about this).

2. Solicited Node Multicast Address – Group address

Each time a global or link-local address get assigned to a host, it’ll automatically get assigned to a group with Solicited Node Multicast Address. So this group address is created by taking the last 24 bits of the link-local or global IPv6 address and prefixing FF02::1:FF to it. So the important of this address is since this is generating using a host’s link-local or global address, other parties who are not aware about this node can send message through this. Will see this at Neighbor Discovery.

3. All node multicast address – Group address

Additionally each node with IPv6 capability also joins FF02::1. This is a bit similar to Broadcasting in IPv4, but seems it’s using occasionally otherwise there’s no-point of the fact reducing the traffic in IPv6.

Neighbor Discovery

Neighbor Discovery is finding neighbors in a network. So let’s take a look at a sample.

configured_diagram_2
Host-A with MAC addresses

There’s a host-A with Link-local (may be Global) IPv6 address configured and now Router-R1 wants to send a message to host-A. so, host-A IPv6 configurations are as follows:

Link-local :- fe80::200:aaff:feaa:aaaa
Solicited Node Multicast Address :- ff02::1:ffaa:aaaa

So if R1 sends a ping request to fe80::200:aaff:feaa:aaaa, since it’s not aware about that neighbor, it sends the Neighbor Solicitation Request to ff02::1:ffaa:aaaa which can be derived from the given IP address. Then the request should go to host-A. Then host A can directly directly address R1 since it knows information about R1 from Neighbor Solicitation Request and send the Neighbor Advertisement.

The interesting thing is what is happening behind the screen. If you think more deeper, you will realize that for any kind of message transferring need to know hardware address (MAC). So host-A listening to  Solicited Node Multicast Address has the meaning of host-A listening to a special MAC address 33:33:ff:aa:aa:aa , which is derived by prefixing 33:33 to the last 32-bits of the  Solicited Node Multicast Address. Since R1 can derive the Solicited Node Multicast Address, it definitely can guess that MAC address too. Since Neighbor Solicitation has R1’s MAC and Neighbor Advertisement has host-A’s MAC, now they can communicate with each other directly, and now they are Neighbors!

If R1 wants to find all its neighbors it can ping to All node multicast address FF02::1 . Very similar to earlier case, this All node multicast address uses 33:33:00:00:00:01 as the MAC address. but the specialty of this case is request contains R1’s IP address but, not containing MAC (echo request). So what receiving node should do? since they should respond, they use R1’s IP address and derive Solicited Node Multicast Address of R1, and send Neighbor Solicitation Request with node’s MAC address. Now once R1 gets Neighbor Solicitation Request from node, it sends Neighbor Advertisement to each node mentioning it’s MAC address. So now all nodes know R1 & R1 knows each node. So they are Happy!

Duplicate Address Detection

This starts with if a node gets a new IPv6 address. Assume a case where out previous router-R1 gets a new IPv6 address 3333::3. Now R1 needs to make-sure no-one else is not using it. So it follows a similar pattern to figure a neighbor. It sends a Neighbor Solicitation Request with IP address :: (since still not sure of new one) and real MAC address to imaginary Solicited Node Multicast Address ; ff02::1:ff00:3 (you know how to generate this since we did this several times). Now R1 waits. if it didn’t get Neighbor Advertisement the derived assumption of the imaginary Solicited Node Multicast Address is correct, no one using that IPv6 address. If it gets Neighbor Advertisement, it has no permission to assign that.

Stateless Address Autoconfiguration

Once a router is enabled for IPv6 unicast-routing, interface assigns a new address called All routers multicast address (FF02::2). Also routers sends a Routing Advertisement to All node multicast address (FF02::1), so any interesting node can use that information to configure a global IPv6 address. This Routing Advertisement launches at regular intervals containing information about the network address etc. But rather waiting for a Routing Advertisement, a node can send a Router Solicitation message and get Routing Advertisement and continue configuration. Configuration take place on EUI-64/random generated with the help of above described Duplicate Address Detection.

Conclusion

So, it’s a pretty much lengthy post, but tried my best to express things more summarized manner. Though you may learn IPv6 in lectures, you may not have the experience of working with IPv6. So in that case the video course [1] did help me a lot. So, I would recommend you to follow that and see. Have a great time with IPv6!

Resources

[1] IPv6 video course by Keith Barker – https://www.youtube.com/playlist?list=PLp6yrT-m9TAKEGqsJTZvXLBz7_CLdWiEH

[2] Tutorial on IPv6 – http://www.tutorialspoint.com/ipv6/index.htm

 

Advertisements