RFC1883, the document that describes IPv6, was written in 1995. It was the next big thing on the Internet. Google records how many IPv6 requests come in and last year the total reached the dizzying heights of 1%! After most of two decades, one in a hundred Google requests are not IPv4. You couldn’t really say IPv6 is taking off like a rocket. That’s all going to change in the next few years. Cisco reckon IPv6 takeup will hit 23.9% in 2017.
So when it comes to IPv6, Mythic Beasts are ahead of the curve. Mythic Beasts? As in unicorns and dragons? What?
Mythic Beasts and Linux commands
Mythic Beasts are a hosting company in Cambridge, UK. If you are one of the million owners of a Raspberry Pi, you have probably used Mythic Beasts’ services without realizing it – they host the RaspberryPi website.
Mythic Beasts got in early with IPv6. Much of their network is already IPv6. Any request coming from the Internet with an IPv4 address gets rewritten to IPv6 on the way in.
You can have a look at part of Mythic Beasts IPv6 setup yourself, using a few command line tools. Fans of the command line can do a little IPv6 investigation.
Ask the question host www.raspberrypi.org
Use the host command to find out if Mythic Beasts really have put their money where their mouth is and are advertising IPv6 addresses.
<code>[ec2-user@ip-10-34-200-38 ~]$ host www.raspberrypi.org</code>
<code>www.raspberrypi.org is an alias for lb.raspberrypi.org.</code>
<code>lb.raspberrypi.org has address 220.127.116.11</code>
<code>lb.raspberrypi.org has address 18.104.22.168</code>
<code>lb.raspberrypi.org has address 22.214.171.124</code>
<code>lb.raspberrypi.org has address 126.96.36.199</code>
<code>lb.raspberrypi.org has IPv6 address 2a00:1098:0:82:1000:13:0:5</code>
<code>lb.raspberrypi.org has IPv6 address 2a00:1098:0:82:1000:13:0:6</code>
<code>lb.raspberrypi.org has IPv6 address 2a00:1098:0:80:1000:13:0:5</code>
<code>lb.raspberrypi.org has IPv6 address 2a00:1098:0:80:1000:13:0:6</code>
Wow. To the casual user, that’s a whole load of garbage that takes some deciphering. Luckily, we can walk the sysadmin walk.
Decipher the answer part 1: Load balancers
You can get a hint of how the front door of the Raspberry Pi website works by reading these lines.
The first line says that the host name www is just an alias for the name lb (short for Load Balancer). When you point your web browser at the Raspberry Pi website, the first thing you hit is a load balancer. Load balancers are useful for running a highly available system that is high capacity, tolerant of failures, and able to withstand attack. Maybe you have load balanced your own EC2 machines.
The next four lines list IPv4 addresses, starting with 188.8.131.52. Each Mythic Beasts load balancer has two addresses – an IPv4 one that everyone can use and an IPv6 one from the shiny future. There are four IPv4 lines, so there are four load balancers.
It’s all straightforward so far, right? Try a little more advanced research. Have a look at who this IP address officially belongs to by asking the whois service. Run these commands and have a look at what gets displayed.
sudo yum install jwhois
Decipher the answer part 2: DNS round robin
These four load balancers all share the same name – these four lines all start with lb.raspberrypi.org
.This means Mythic Beasts use a load balancing technique called DNS round robin. DNS round robin works like this:
When a web browser sends a request to http://www.raspberrypi.org/, the OS has to do the tedious administration of sticking the request in an envelope and finding out what address to write on the front. The user’s OS sends a separate request to Mythic Beasts’ name servers to hand over the address. The name servers dish out these addresses one after the other, so every new request gets a different address.
Find out what the Mythic Beasts name servers are called – try another whois command.
Look for the lines that start with the words Name Server.
Some companies frown on the DNS round robin method, calling it “poor man’s load balancing”. Try running the command host www.google.com to see if they think it’s poor.
Decipher the answer part 3: IPv6 addresses
The last four lines are where the IPv6 action is. These give the IPv6 addresses, starting with 2a00:1098:0:82:1000:13:0:5. An IPv6 address does pretty much the same job as an IPv4 address, but it looks radically different. It’s written in hexadecimal instead of decimal, it’s got colons instead of dots, and it’s a lot longer.
If your ISP allows you to use IPv6 then you can connect all the way from your personal machine across the Internet to the Mythical Beasts load balancer using IPv6.
Within the Mythical Beasts network the internal connection from the load balancer to the main Raspberry Pi servers all use IPv6. Pete Stevens, director of Mythic Beasts, said, “The internal connection from the load balancer to the main raspberrypi servers are all now over IPv6; even if you connect over IPv4, we make an internal IPv6 call to get the page”.
Walk like a sysadmin
We have taken a stroll in the domain of the system administrator. We ran the host and whois commands to find out what’s happening behind the scenes at Mythic Beasts.
What we found was a real-world example of how the Mythic Beasts hosting company uses load balancing, DNS round robin, and IPv6 as the gateway to http://www.raspberrypi.org/.
The rest of us will be following their example in the next few years.