Views
IPv6: Obtaining IP Addresses
Orignally the only way to get connected to the test IPv6 network was to find someone who was willing to tunnel IPv6 packets over the existing IPv4 network. They would allocate you a part of their network range for your testing. This made it difficult to just get up and going since finding someone to get these tunnels from isn't exactly easy. To resolve this issue they invented a new addresses scheme called 6to4 which is described below.
6to4 Addresses
- The 6to4 address allocation scheme is definied in RFC3068
All 6to4 address are in the 2002::/16 network range. The next 32 bits contain the IP address of the IPv4 gateway, this is the gateway that packets this IPv6 address range should be tunneled to - ie your IPv4 IP address.
So a 6to4 address consists of:
- 16 bits 6to4 prefix: 2002:
- 32 bits IPv4 gateway address: Example: c0a8:0001:
- 80 bits for user networks and hosts.
And since host addresses are normally 64 bits, this is usually allocated as:
- 16 bits 6to4 prefix: 2002:
- 32 bits IPv4 gateway address: Example: c0a8:0001:
- 16 bits for user networks.
- 64 bits for user hosts
Example 6in4 usage
The host egwene6.twibble.org uses the 6to4 gateway charon.twibble.org, is in subnet 0 and is host 1. This gateway has the IP address of 203.217.29.134 and this address cb.d9.1d.86 in hex. This gives us:
- 16 bits 6to4 prefix: 2002:
- 32 bits IPv4 gateway address: cbd9:1d86:
- 16 bits user network: 0
- 64 bits user host: 1
Any traffic for
- 2002:cbd9:1d86::/48
will be routed to charon.twibble.org via a tunnel, and from there charon can route the packet as it likes (using the remaining 80 bits). The full IP address for egwene.twibble.org will be:
- 2002:cbd9:1d86:0000:0000:0000:0000:0001
which can be shortend by replacing all the longest set of 0's with :: to:
- 2002:cbd9:1d86::1
Tunneling
Any IPv6 hosts, that also an IPv4 address, can send traffic directly to sites in the 2002::/16 subnet by simply extracting the IPv4 gateway address from the packet and tunneling it. Not all hosts support 6to4 though (they may be IPv6 only for example, or may not configured to support 6to4) in which case the traffic will be routed to the nearest 6to4 gateway before being tunneled.
For sending traffic back to the IPv6 internet there are two options availble for the 6to4 router:
- If the destination address is in the 2002::/16 then we can tunnel the packets directly to the gateway for target host (since the gateway IPv4 address is encoded in the IPv6 address); or
- For all other packets we need to tunnel them to a gateway which is connected to the IPv6 internet and will accept tunneled packets from 6to4 hosts.
The RFC defines the gateway address to be 192.88.99.1. This is not a single machine, but rather a specific address that gateways are expected to advertise (via BPG) as part of their network. So in theory this should connect to the nearest (in BPG route terms) gateway. Currently for here in melbourne this routes to a site in switzerland, even though AARNET have a machine configured with the same IP address. The AARNET one is either not being advertised at all via BPG, is not reaching the ISP's I have access to or is only being advertised privately within AARNET.
This list: http://www.kfu.com/~nsayer/6to4/ is a list of other public gateway sites. Not all of them work and I'm not sure how up-to-date this list is.
AARNET are also running a 6to4 gateway on ipv6.broadway.aarnet.net.au - I've verified that this one currently works. (Found at http://www.aarnet.edu.au/engineering/resources/ipv6/)
Examples
The following is example traceroute to a host in the 2002:/16 network. This is tunneled directly to the target site:
[egwene][ 7:38PM]~#> traceroute6 6to4.ipv6.aarnet.net.au traceroute to 6to4.ipv6.aarnet.net.au (2002:c0e7:d405::1) from 2002:cbd9:1d86::1, 30 hops max, 16 byte packets 1 2002:c0e7:d405::1 (2002:c0e7:d405::1) 41.939 ms 42.228 ms 43.685 ms
The following is example traceroute to a host not in the 2002:/16 network. This needs to be tunneled to a gateway site.
[egwene][ 7:38PM]~#> traceroute6 trumpet-vbns.hay.vbns.net traceroute to trumpet-vbns.hay.vbns.net (3ffe:28ff:ffff:3::101) from 2002:cbd9:1d86::1, 30 hops max, 16 byte packets 1 swi6T1-F0-1.switch.ch (2001:620:0:20::6) 368.506 ms 368.679 ms 369.221 ms 2 sprint-gw2.us.ipv6.aorta.net (2001:730::1:65) 532.344 ms * 532.344 ms 3 vbns-ipls.abilene.ucaid.edu (2001:468:ff:dc1::2) 497.63 ms 495.779 ms 496.829 ms 4 cs-v6-atm0-2.hay.vbns.net (3ffe:28ff:ffff:1::) 577.896 ms 575.9 ms 573.975 ms 5 trumpet-vbns.hay.vbns.net (3ffe:28ff:ffff:3::101) 840.332 ms 816.861 ms 793.008 ms
Here's the previous trace again, this time using ipv6.broadway.aarnet.net.au instead of 192.88.99.1 for the 6to4 relay:
[egwene][ 7:50PM]~#> traceroute6 trumpet-vbns.hay.vbns.net traceroute to trumpet-vbns.hay.vbns.net (3ffe:28ff:ffff:3::101) from 2002:cbd9:1d86::1, 30 hops max, 16 byte packets 1 2002:c0e7:d405::1 (2002:c0e7:d405::1) 45.244 ms 43.255 ms 44.733 ms 2 6plains-janet.abilene.ucaid.edu (2001:468:ff:1dc2::1) 360.138 ms 357.592 ms 358.306 ms 3 ipls-6plains.abilene.ucaid.edu (2001:468:ff:61d::1) 386.066 ms 386.872 ms 383.49 ms 4 chinng-iplsng.abilene.ucaid.edu (2001:468:ff:f12::1) 382.296 ms 386.615 ms 384.969 ms 5 nycmng-chinng.abilene.ucaid.edu (2001:468:ff:f15::2) 383.284 ms 385.662 ms 384.228 ms 6 washng-nycmng.abilene.ucaid.edu (2001:468:ff:1518::2) 385.992 ms 386.667 ms 388.417 ms 7 vbns-ipls.abilene.ucaid.edu (2001:468:ff:dc1::2) 389.188 ms 390.183 ms 389.177 ms 8 cs-v6-atm0-2.hay.vbns.net (3ffe:28ff:ffff:1::) 467.52 ms 469.81 ms 471.334 ms 9 trumpet-vbns.hay.vbns.net (3ffe:28ff:ffff:3::101) 685.429 ms 684.485 ms 697.09 ms
Other options?
So you don't want 6to4 address, would prefer real ones? Take a look here:
Address prefixes
The current address prefixes that will be seen are:
- 2002::/16 These are the 6to4 addresses.
- 2001::/16 These are the production addressess, allocated by the registration authorities and allocated to ISPs to allocate to their customers.
- 3ffe::/16 These are the 6bone addresses. These were allocated early in the development of IPv6 for testing. There are plans afoot to remove these addresses from use sometime in the next 2-3 years.