Adventures in IPv6

18 February 2017

Because I use a home ISP that supports IPv6 and has done for quite a few years, I have been using IPv6 for some time. But recently a problem meant that I was losing IPv6 connectivity. IPv4 was working fine so only a minor hiccup. But the process of investigating this I learnt quite a bit about IPv6 and I thought I would document this here. It might help someone else.


IPv6 addresses are 128 bits long and are written down in a standard notation, this looks like:

It is rare to have a completely populated address, so the notation allows for shortening the bits of the address that are zero. So the address ::1 is all zero except for the last bit. Also the CDIR format of showing the number of significant bits is often used. When used in some commands the interface to send on is specified with a %eth0 suffix

There are several types of IP address, and they can be recognised by the most significant part of the address. These are the ones I came across.

::1/128 this is the loopback address same as
fe80::/64 anything staring with fe80 is a link local address. A bit like 10.x.x.x or 192.168.x.x and can only be used on a single link
ff0X::   These are multicast addresses. the most useful ones are
ff02::1 All nodes in the link-local
ff02::2 All routers in the link-local


IPv6 has been designed for auto-configuration, so an endpoint should not have to have anything set in order to use a network. Everything is automatic.

The link local address is automatically calculated from the MAC address of the interface, it should be there for any interface that is connected regardless of the network supporting IPv6 or not. You can display the IP addresses with ifconfig (or ipconfig on windows) or ip -6 address show

Neighbor discovery protocol allows the discovery the link local addresses of locally connected interfaces. We do this with a ping or as it is more formally known via Internet Control Message Protocol version 6 (ICMPv6) to a multicast address.

$ ping6 -c2 ff02::1%eth0

$ ping6 -c2 ff02::1%eth0
PING ff02::1%eth0(ff02::1%eth0) 56 data bytes
64 bytes from fe80::3e98:c0ee:51ae:b461%eth0: icmp_seq=1 ttl=64 time=0.072 ms
64 bytes from fe80::1e74:dff:fe2c:b897%eth0: icmp_seq=1 ttl=64 time=2.53 ms (DUP!)
64 bytes from fe80::3e98:c0ee:51ae:b461%eth0: icmp_seq=2 ttl=64 time=0.059 ms

--- ff02::1%eth0 ping statistics ---
2 packets transmitted, 2 received, +1 duplicates, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.059/0.887/2.532/1.163 ms

This should give you a response form the link local of that interface, and anything else that has an IPv6 interface on that network segment. But

$ ping6 -c2 ff02::2%eth0
PING ff02::2%eth0(ff02::2%eth0) 56 data bytes
64 bytes from fe80::1e74:dff:fe2c:b897%eth0: icmp_seq=1 ttl=64 time=2.58 ms
64 bytes from fe80::1e74:dff:fe2c:b897%eth0: icmp_seq=2 ttl=64 time=0.946 ms

--- ff02::2%eth0 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.946/1.764/2.582/0.818 ms

will only give responses from routers on the segment. So now we have local addresses sorted, we need to get a routeable IPv6 address. There are a number of ways this can happen, most commonly this uses Stateless Address Autoconfiguration (SLAAC).

The steps in getting a Global scope IPv6 address then are first to find the router. This is either from the response to a Router Solicitation (RS) ICMPv6 message, or from just listening as a router will periodically send out a Router Advertisement (RA).

Wireshark Capture

Wireshark capture of IPv6 address auto-configuration

Lets step through the auto-configuration process. The first step is setting the Link Local address, this is configured from the MAC address, but there still could be conflicts. in packet 83 we send a neighbour solicitation out for the address we want to use. If nobody responds then we go ahead and use that address, packet 97.

The next important bit is the Router Solicitation, and Router Advertisement. Routers will send out a Router Advertisement periodically to the multicast address ff02::1 periodically, but can be prompted by Router Solicitation, packets 118 & 119. The Router Advertisement is displayed in the packet analysis window, and we can see the Prefix information as well as DNS servers from the router.

Next is packet 141 where we send out a Neighbor Solicitation for 2001:8b0:1679:ea38:cf58:def3:b993:1412 to check that nobody else is using this address. If nobody replies then we go and use this address.

Old Computer technology forgotten

3 December 2016

Have we already forgotten how to use some of the computer technology from just a few years ago. Perhaps they need better (and older) tech consultants on programs. I was watching the latest episode of Timeless S01E08 Space Race. The plot takes us to the Apollo 11 moon landing and that a modern day virus is inserted into a 60’s era mainframe computer to disrupt the communications stranding Neil Armstrong and Buzz Aldrin on the moon.

A virus attacks flaws in the operating system or other privileged programs on a system. I suppose that we now have more knowledge of these problems, but how these would relate to operating systems of the 1960s is just not credible. So let us take the leap of faith and believe that a modern virus could affect computers of this era, and just look at the mistakes in dealing with this technology for a moment.

We enter into what looks like a IBM system/360 computer room. Firstly they insert a papertape program into the machine. This presumably is some form of bootstrap program, though that is not clear from the dialogue.

Loading the papertape machine

They have obviously just got a random bit of papertape and used that. In reality there would be a substantial leader of blank tape at the beginning. This would normally have either a typed label, or more likely, a handwritten description of the contents. The reader would normally have a sprocket wheel to thread the tape onto and a clip over tab to hold and guide the tape through.
I can remember it being cool to punch holes in the leader tape that made up dot-matrix like characters. This was a matter of setting up the bit image of the characters and adding this to the start of the punch sequence. That makes it sound much easer than it was.

example of fanfold papertape with printed label and punched characters

I mostly worked on Digital Equipment and Data General machines that used fanfold papertape, but there was also the teletype machines, that used loose tape. You would typically use a pair of plastic bins to hold the in and out portions of the tape. But this was quite untidy and the tape could easily be torn if it tangled up in the bins.

Next there is a sequence of loading a reel of ½” magnetic tape. In the background there are racks of tapes with the plastic surrounds (frequently called a “tape seal belt” because its purpose was to prevent humidity and dust on the media). There was a later innovation of these that usually matched with a automatic loading system. The tape, with the ring was loaded onto the drive, and the drive mechanism would open the seal, vacuum the tape through the machine onto the fixed takeup reel. The point is that you did not remove the seal belt before loading the tape. In the episode they remove the ring before taking the tape over to the machine. The tape drives do not appear to have the auto-loading mechanism, so they did this bit right.

Tape reels have an opaque side and a transparent side. The opaque side is the back of the reel and you would always load the tape with the transparent side outwards. As well there is a plastic ring that can be inserted into the back of the reel. This was a write protect ring. The drive would only be able to write to the tape if this ring was inserted. The ring was detected with a probe on the tape drive. so this ring must be on the back side of the reel when loaded into the drive. Also the tape on the reel was always loaded clockwise, inserting a reel back-to-front would not work at all.

Tape loaded back to front

With the write protect ring visable

They then press the top left button to supposedly load the tape. I suspect that this is the rewind button so it makes the drive spin as though it is doing something. I am surprised that they did not end up with lots of tape everywhere as the drive would try to unwind the rather than rewind. Perhaps they only had empty reels of tape, so they had to put them on backwards so you couldn’t see that there was no tape on them?

IP Bill Final Death Throws we hope.

14 March 2016

The IP Bill aka #SnoopersCharter is back from the committee stage with most of the sensible recommendations ignored, and some things even worse that it was before. Again I have Written to my MP lets hope it is again dead as the alternative is too horrible to imagine.

Dear Alock Shama

I have written to you several times about the Investigatory Powers Bill. [1,2] I have tried to explain the very real problems with this bill, but underneath all these problems, the massive impact that it would have on the high tech industry in the UK, under all of these problems is a fundamental issue of privacy.

I want you to think seriously about a state where citizens have no privacy. The privacy we have now in our own homes, our person and thoughts. As the internet becomes part of these spaces so these new powers to intercept, collect, filter, and examine come under the purview of the state.

The Home Secretary claims that we do not live in an interception state, because she only considers a communication intercepted when a person looks at it. This is not the view of the general public.

I watched much of the evidence presented to the Parliamentary Committee and read their report. The report highlighted many of this issues with the Bill and I was hopeful that we would get a sensible bill out of that process. But what we have after only a few weeks contains hardly any of the recommendations, but several changes to make the powers of the bill even worse.

When 200 Senior Lawyers tell you the bill is flawed, and probably illegal [3] I really think you should listen.

The only sensible course of action at this point is for you to vote against the Bill.

I urge you to declare that you will not support this bill.

Yours Sincerely

Stuart Ward


Reply from Alok Sharma on #IPbill #Snooperscharter

26 November 2015

Here is the reply from my MP to my previous post. My response follows



An expression of Elegance; Base 3 math

27 May 2015

I have been playing around with the Balanced Ternary number system. I gave a talk at DC4420 on Monday night on this, and I am posting the presentation slides up here for anyone interested.

Presentation (pdf)

The further reading links on the last slide are:

Wikipedia Page

Paper by Brian Hayes

Hackaday Project

Paper on a Balanced Ternary adder circuit design (pdf)

Fridge lighting hack

14 April 2015
With the new LED lighting

After: The fridge with the new LED lighting strip installed.

It took way longer that it should, but I have managed to complete my LED fridge lighting project. This was to replace the single bulb at the top of the fridge with a strip of LED lights around the top and sides of the fridge. I found an old power supply I think it was a laptop brick, that would do 12 volts reasonably. Replaced the IEC connector with a screw connector, and presented the 12v output on PCB mount screw connectors.

Before the change

Before: The fridge with the original incandescent light at the top.

Next was a replacement cover, this I designed in OpenSCAD to cover over the power supply and replace the moulded lamp cover that was there before. Then an 10 hour 3D print run to create the cover. Although there were a few minor mistakes the cover worked pretty well first time so I didn’t have to do a reprint.

The LED lighting is a big improvement, the whole fridge is illuminated and because the light is coming from different angles no shadows, and even illumination. The only down side is that the power supply can take a second to come up after opening the door. The fridge does have a temperature management system and a LCD display, so presumably there is some low voltage floating around there, that I could have used. But that would have meant much more disassembly and potential breakage of the fridge.

Add Tracking

26 May 2013

There has been a lot of interest in the way in which advertisers gather the targeting information they use to target ads. The EFF has a detailed investigation into how facebook does this. This shows how your offline activities are used to refine the online advertisements that are shown by facebook. While this just covers facebook, many other sites use these companies and others to do similar things.

Personally I always use add blockers, back from the day when advertisers use animations and flashing to draw you eye, making it hard to read the content of the site. While this doesn’t prevent tracking it just cleans up my screen and makes the content readable.

I also came across this info-graphic that explains much of the on net tracking technology in a fairly understandable manner.

Internet Day Infographic