- You have just learned how to work with IPv4.
And in most cases, IPv4 is what you will be using.
But it's a fact that the world
is running out of IPv4 addresses.
And that is why there is a next version of IP,
and that's IPv6.
In case you are wondering what happened to IPv5,
well, it was proposed one day, but it never made it.
So we skipped IPv5.
Nobody ever heard about it anymore.
In IPv6, 128 bits is used
to write the addresses,
and the addresses are written in a hexadecimal way.
Hexadecimal is a numbering system from 0 up to 15.
And in order to use that numbering system,
we use the number zero up to nine,
and then a, b, c, d, e, and f as the additional numbers.
And that makes it what we see right here.
It's a valid IPv6 address.
As you can see, these are not so easy to work with.
In an IPv6 address, you can omit leading zeros,
as well as long string of zeros.
So fe80::1 is a valid address.
That just means that the address starts with fe80,
and then, there's a whole lot of zeros
and it ends with a one.
Fortunately, you can summarize the IPv6 addresses
to make it a little bit more manageable.
When you are referring to an address followed by the port,
then you need to put the address between square brackets,
as in this example
where you can see port 80 on fe80::1.
And it's quite obvious why you need the square brackets.
That is because the colon has a meaning
in a network socket.
In a network socket,
which consists of IP address followed by port,
the colon is normally used as a separator.
But in IPv6, the colon is also used as a separator.
Well, to avoid any confusion, we have the square brackets.
In IPv6, we have a default subnet mask.
The subnet mask distinguish between the part of the address
that is used as the network address
and the part that is used as the node address.
And by default, the subnet mask is /64.
So the first half is for the network,
the second half is for the node.
And the node bit of the address
may contain the device MAC address.
And that's because IPv6 has this nice solution
to automatically assign IP addresses.
Now, in IPv6, there's a couple of IP addresses
that are reserved.
Let's talk about those.
To start with, there is ::1,
which is the equivalent to IPv4 127001.
That's a localhost IP address.
There is ::, which is the unspecified address,
000 in IPv4.
And ::/0 refers to the default route.
And then there is a couple of addresses
that are reserved as well.
Anything starting with 2000 and a subnet mask /3
is what we call the global unicast address.
The global unicast address
is a worldwide unique address
that can be used on the Internet.
And the IPv6, folks, have done something smart.
And that is, they have reserved
a couple of IPv6 addresses only.
Anything starting with 2000/3.
And that means that a lot of IPv6 addresses
are not used at all at the moment.
They are for future use.
And we can do that because in IPv6,
given the 128 bits address space,
you can use an incredible lot of IPv6 addresses.
To be precise,
4 billion times 4 billion times 4 billion times 4 billion.
You try to pronounce the result of that.
I don't know how to pronounce it.
Back to the reserved IPv6 addresses, there is fd00.
These are unique local addresses or private addresses.
And these private addresses can be used for internal use.
So it's a little bit like 192 168 in IPv4.
Then we have fe80.
fe80 is for link-local addresses.
And link-local addresses
are addresses that are automatically assigned.
You don't have to assign them yourself.
These are addresses that are created automatically
based on the MAC address
that was found on your network interface.
And because these IPv6 addresses
are created automatically,
you get the default IPv6 functionality within your network,
and that's convenient.
And finally, there is ff00, which is a multicast address.
Now, how do we get an IPv6 address?
Well, you will notice that interfaces,
by default have an fe80 address.
You can also do a static addressing.
That is where you are going to assign them yourselves.
And you can use DHCPv6.
Now, in DHCPv6, the IPv6 client
sends out a multicast address to ff02::1:2
on port 547.
That is the all-DHCP multicast group.
And if the DHCP server is listening, it will answer.
The other option is stateless address auto configuration.
Now, how does that work?
Well, the IPv6 client
is sending a so-called router solicitation
to the multicast address ff02:2.
And that is the all-routers multicast group.
And if there's a router that is configured with IPv6,
then it will answer back with its IP address
that allows the host to learn the network prefix,
and it will automatically create its own IP address
by creating the node port
based on the MAC address of that network card.
Sounds a little bit complicated,
but in fact, it's really simple.
You have a node that needs an IPv6 address,
it is going to come up,
it sends a message over the network,
and its message is like,
"Hey, is there a router that can help me?"
And if there is a router that can help,
the router will answer.
And in the answer,
the requesting node will learn the network IP address
and it's assigning its own node ID to it,
and you have an automatically created IPv6 address.
The only requirement
is that you need a stateless address auto configuration
compatible router.
On Linux, you can create such a router
by installing radvd package on the Linux node.
But Linux is not used commonly as a router
so you probably have a Cisco router
or something else taking care of this.