ipv6
That means there are
128 bit address. Broken up into eight 16 bit blocks. Each block expressed in hex.
A network prefix is handed down by the router immediately above the device. When you get all the way down the tree to an end device (like a laptop) the network prefix is usually 48 bits. That way the router can use 16 bits to subnet the hosts attached to it. However, the router gets a somewhat less restrictive network prefix from its upstream router. This progesses until finally the tier 1 routers. Of course, this is the ideal case, but who knows what really happens?
Since this is a top down appropriation of the first 64 bits of an end device’s IPv6 address this allows on the fly updates from the top to the bottom.
Ideally the passing along of network prefixes looks like this:
[Tier 1 Router]
|
1111::/16
|
v
[RIR Router]
|__________________________
| |
1111.2222::/32 1111.3333::/32
| |
v v
[ISP Router 1] [ISP Router 2]
|
1111.2222.3333::/48
|
v
[Home Router]
|
1111.2222.3333.4444/64
|
v
[end device]
The interface ID is the second half of an IPv6 address. It is created when a device connects to a network. There are several ways this can be done, including:
Every device can choose an IPv6 address that is static and can be used to communicate world wide. Uses the device’s MAC address. Need to convert the 48-bit MAC address into a 64-bit EUI.
Takes two steps:
FFFE
in the middle of the address.IPv6 Subnet Prefix | 2600:dddd:1111:0001 |
Device MAC Address | 82:ed:aa:4b:98:a7 |
Add FFEE |
82:ed:aa:FF:EE:4b:98:a7 |
Group into 16 bits | 82ed:aaFF:EE4b:98a7 |
Flip 7th bit | 80ed:aaFF:EE4b:98a7 |
So, the EUI-64 is 80ed:aaff:ee4b:98a7
, and the full 128 IPv6 address is 2600:dddd:1111:0001:80ed:aaff:ee4b:98a7
This is the address that an IPv6 devices uses to talk to the internet. It is assigned by the default gateway. First, the device will multicast a router solicitation message. Upon recieving the message, the router will tell the device the router’s Site Prefix and the device’s subnet. These together form the first 64 bits of the device’s global unicast address. The device will then append it’s interface ID (see below.) The final 128 bits is the device’s globally accessible IPv6 address.
In addition to the Global Unicast Address every IPv6 capable device gives itself a link local address on boot. This address has prefix FE80::/10
followed by 54 zero bits, or fe80:0000:0000:0000
. (Note: This is equivalent to fe80::/64
, but it is always written fe80::/10
with the remaining 54 bits implied.)
The Link Local Address of a device is the IP address it uses to talk to devices locally.
In some sense the Link Local Address is Equivalent to IPv4’s APIPA, except an APIPA address is only used as a last resort but every device will have a link local address in addition to it’s global unicast address.
0
s then they are joined using a double colon: ::
. For example, 0000:0000:0000
can be joined together as ::
.0
s, then only one will have the junction rule applied. This helps us avoid ambiguity that arises when expanding two or more ::
s.FE82:0000:0000:0000:0000:1A12:1234:1A12
FE82: 0: 0: 0: 0:1A12:1234:1A12 (Apply rule 1)
FE82 :: :1A12:1234:1A12 (Apply rule 2)
FE82::1A12:1234:1A12 (Final compressed address)
FE82:0000:0000:1234:0000:0000:0000:1A12
FE82: 0: 0:1234: 0: 0: 0:1A12 (Apply rule 1)
FE82: 0: 0:1234 :: 1A12 (Apply rule 2)
FE82:0:0:1234::1A12 (Final compressed address)
Unlike IPv4, IPv6 does not use broadcasting. Instead, it uses a Multicast
The ethernet frame of a multicast in IPv6 starts always has the form: 33:33:..:..:..:..
.
Address | Use |
---|---|
::1 |
loopback |
ff02::1 |
multicast read by all hosts |
ff02::2 |
multicast read only by routers |
ff0x::101 |
NTP |
2001:0000:/32 |
Teredo |
2002:/16 |
6to4 addresses |
This is a protocol that IPv6 devices use to find other devices in and information about its broadcast domain.
This is functionally equivalent to an IPv4 ARP request. When a new host joins a network it sends out a neighbor solicitation message in its broadcast domain.
When a device recieves a neighbor solicitation message it replies with a neighbor advertisement. This message just tells the new device what the responding device’s IPv6 address is.
A device (router or end device) can use a router solicitation message to ask for the network’s WAN IP address (network ID and subnet).
The router advertisement message is sent by a router to it’s downstream devices. It tells these devices things like it’s WAN IP address, default gateway, DNS server, etc. This happens periodically, or in responce to a router solicitation message.
The top down nature of IPv6 is fairly restrictive. Every bit of information comes from the router above. DHCPv6 allows for fine grained control, for instance, running your own DNS.
Stateful DHCPv6 is very much like its IPv4 predecessor.
The server uses UDP:547 and the the client uses UDP:546 to communicate.
There might be many DCHPv6 servers that are accessible by a client. Every DHCPv6 server is listening on FF02::1:2
.
Steps:
FF02::1:2
. There might be multiple DHCP servers listening to this address..Where stateful DHCPv6 exerts full control over IP addresses, default gateway, etc, stateless DHCPv6 recieves router advertisement messages from upstream and forwards modified messages to its downstream devices. Most of the information stays the same, however things like default gateway or DNS can be changed.
Used by routers
During the transition period from ipv4 to ipv6, there will be area in a route which ipv6 traffic needs to traverse an ipv4 only connection, or visa-versa. This can be done using tunneling. Several methods have been created to do this.
An ipv4 packet is encapsulated with an ipv6 header.
A deprecated standard, but it is essentially the reverse of 4to6
A working standard that allows ipv6 tunneling through ipv4 connections. Can traverse through NAT.
A Microsoft tunneling protocol that allows ipv6 to use ipv Can traverse through NAT.
An open source implementation of Teredo used on Linux.
This protocol appends an IPv4 address to an IPv6 prefix.
Embeds an ipv4 packet into an ipv6 packet. This is usually put where a NAT would be at the edge of a network.
The result of flipping the 7th bit has the following result on the last HEX element of the first 16 bit block. 0
↔ 2
1
↔ 3
4
↔ 6
5
↔ 7
8
↔ A
9
↔ B
C
↔ E
D
↔ F
So, flipping the 7th bit on 12:34:...
gives 10:34:...
. And flipping the 7th bit on AA:00:...
gives A8:00:...
.
Notes on Computers
AWS · Bash · C · C++ · Cyber Security · Git · LaTeX · Linux · Networking · Python · Raspberry Pi · Tools · Vim
Notes on Math & Physics
Information Theory · Linear Algebra · Solid State Physics
Copyright 2021 · Eric D. Weise