Vive la résistance!

A short word on resistors. There are two common kinds available. The brown (carbon film) and the blue (metal film) ones.

The metal film resistors are generally preferred for the following reasons:

  • They have a smaller tolerance (1%) compared to the carbon film resistors (5-6%). That means that the actual resistance is very close to what it says on the box. In contrast the carbon film resistors vary a lot more. A 100 Ohm carbon film resistor can have an actual resistance of only 88 Ohm which is quite a difference.
  • They can handle more load than carbon film resistors while getting not as hot. (0.6W compared to 0.25W)
  • They produce less noise. This is not that important but still its a benefit

I mention this because initially I bought two boxes of the brown ones and I didn’t know about the difference. The advantages are not big enough to throw away all my carbon film resistors as they still work but I prefer metal film resistors from now on.

But what parts are needed to get started?

After writing an introduction and posting the first cube its probably time to talk a bit about the necessary hardware. After months of fiddling around I take certain things for granted that were really difficult to figure out in the beginning. Therefor I will also talk about the necessary tools and materials starting with the basics in this post.

The most important things are:

  • Getting Started in Electronics by Forrest M. Mims III: This is such a great beginners book for electronics that I wholeheartedly recommend it to everyone. The cover doesn’t look too fancy but the content is just great. Trust me. You want that book to learn about all the basic electronics stuff.
  • Microcontroller / Arduino UNO: Quote from the Arduino website: Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It’s intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.” 

    Its ideal for beginners as it abstracting away many difficulties when dealing with microcontrollers. The Arduino board itself is error forgiving (as in short circuits) and offers everything that is needed for a quick start but even for more serious projects. It can be easily connected via USB and has a very good documentation. The website offers many useful tutorials and the community around it is very encouraging.

  • Soldering Iron: Obvious but necessary nonetheless. I bought a pretty cheap one from Weller called WHS 40 which has 40 Watts of power and although is not expensive it works really well. The only accessory I needed was a finer tip which is also highly recommended. Irons that have less then 40 Watts take too long to heat up and can get quite annoying to use. My next station will have a little more but for now it works great.
  • Breadboard: This allows easy and fast circuit testing. The first thing I do when I try out a new LED, Transistor or any other part is to get out one of my Breadboards and play with it. Its also helpful for debugging in terms of rebuilding a circuit.

    I recommend having two. One big one with lots of space and than maybe a smaller one which is more handy and more practical to carry around

  • (Flexible) Jumper Wires: Places that sell Breadboards are very likely to sell jumper wires as well. I have them in different lengths and colors and as breadboards, they are highly recommended. There are stiff and flexible ones and I prefer the flexible ones because, as the name implies, they’re flexible!
  • Multimeter: This is the most important tool for debugging and testing circuits. It does not need to be an expensive one but it should be digital and offer a convenient interface. I bought an Voltcraft VC270 and I’m happy with it.
  • Resistors: This might be obvious again but still its good to have a broad range of resistors at hand. I bought two resistor boxes which contain resistors from 10 up to 27.000 Ohm. They are constantly needed especially when following the autodidactic approach of learning. Its great to always be able to reduce or increase the resistance when needed.
  • Transistors: I’d say that similar to resistors its essential to have a some transistors at hand. There are some standard transistors like the BC557, BC547, BC337, BC327. These are very common parts for all kinds of circuits. Basically they are very fast switches that allow to switch higher currents and voltages than your micro controller can supply. 
  • Wires: Simple copper wire or enameled wire for connecting parts on boards
  • Perfboards or Stripboards: When its time to make a circuit more permanent then on a breadboard with jumper wires these are useful for easily soldering everything together using the wires mentioned above.
  • LEDs: I almost forgot.
  • Other Parts: Like switches, potentiometers, light sensors etc etc. They’re not necessarily related to the construction of cubes but its fun to play around with those parts anyway.

Alright. I will write more about hardware as needed.

2x2x2

In the first post I said that building small LED cubes is reasonable easy. Without much prior experience we (my girlfriend and myself) built this small 2x2x2 cube. Its really tiny and the soldering is sloppy but it worked. Unfortunately I can’t find the board that belonged to the cube so I there is only a picture of the cube itself.

Although this doesn’t look spectacular it shows a common principle for LED cubes. The one thing to notice is the number of wires visible. In this picture there are 6 pins / connections visible. If each of the 8 LEDs would be connected individually there would be 16 connections necessary to power the cube. Instead the LEDs are connected vertically by their anode (+) and horizontally by their cathode (-), forming two layers with 4 LEDs each. Now to power up a single LED the corresponding layer and the corresponding column need to be connected. If both layers are connected and one column than both LEDs of that column would light up. The principle behind all this is called multiplexing. This means that only one layer of LEDs is active at a given moment. So for a given picture each layer is activated after another in such a fast way that thanks to persistence of vision, the human eye does see the complete picture, without noticing that is composed of multiple steps. Does that make any sense? I should probably add a video or animated gif.

For smaller cubes its also not important whether the LED layers are connected via the cathode or anode. For bigger cubes its important but I’ll get to that later. Multiplexing in general has two major benefits. First of all it allows to control many LEDs with fewer IO ports / pins and therefor saves wirings and possible errors and secondly it simplifies the power supply as only one layer is active at a time. This is especially important for bigger cubes. Think about 16x16x16 * 20mA compared to 16×16 * 20mA – quite a difference.

We connected this cube directly to the Arduino and wrote a really simple program that included a few animations. With only 8 LEDs there is not much to do but still its fun to exploit all possibilities. I found one code example for this code on one of my disks that can be found here: https://github.com/hukl/Cubino/tree/master/2x2x2/

Its as spectacular as the 2x2x2 cube itself.

IPv6 is there, everybody is waiting for you

Preface

For a couple of years now, people are scared of running out of oil because when it does it means big change for almost the entire population of earth. Similar to oil, another resource will experience a massive shortage soon. At least that is what we are told. Compared to oil however it is already hard to get new IPv4 addresses. The good news is that there is a replacement called IPv6 and there is so much of it that »there are approximately 6.67 * 10^27 IPv6 addresses per square meter on our planet«. This replacement now exists for over ten years but still the adoption among providers and users is almost insignificant. I assume this is because the internet still works as it has been for the last two decades without any noticeable consequences for most of the people. They are accustomed to the »little« drawbacks of being behind a NAT. They know that for some reason they don’t get the »real« internet at home through their dsl connection over their little plastic router. They accept it that file transfers over instant messaging do not always work, that their peer to peer transfers are slow or unusable and that they cannot connect to their working station at home when they are at the office or on a business trip. So did I but a couple of weeks ago I decided to stop ignoring these issues and to do something about it.

The theory is simple. Since there are so many IPv6 addresses available, every one can have one, or to be more accurate 4.86117667029912… x 10^28 which is obviously more than anyone could even think about. This make things like NAT obsolete. Everyone can have tons of real, globally accessible IP addresses which will eliminate all these issues mentioned above and many more. If you will most of the people will get »more« internet than they were ever able to get, even in the early years when there was plenty of IPv4 addresses available.

But there is really no need to use the future tense here because you can be part of the IPv6 internet right now and you really should. Since I already mentioned why it is a good idea, I want to talk about how you can do it.

Prerequisites

To use IPv6 you really don’t need that much and the most important thing you need is a computer running a moder operating system. Anything newer than Windows XP Service Pack 1, Mac OS 10.2, FreeBSD 4.0, Ubuntu 4.10 will work.

The second important thing you need is a IPv6 provider. Some of us are lucky to have an ISP which already enabled IPv6 for its customers but most people are still only given IPv4 addresses. If your provider is already IPv6 ready you really don’t have to do anything else. It seems as if many ISPs will enable IPv6 by the end of the year but its almost certain to say that there will be many left running IPv4 only. So if you have an ISP without IPv6 you don’t have to stop here. There are quite a few official transition techniques to give you IPv6 even if you are on an IPv4 only network. Most if not all techniques use so called »tunnels« to give you IPv6 encapsulated in IPv4 and its not as bad as it sounds. In fact this is the most common way for IPv6 distribution today.

How to get IPv6 on a IPv4 network

If you own a recent (as in one or two years old) Airport Extreme base station from apple and you have it directly connected to you dsl router or cable modem there is almost nothing you have to do because Apple took care of that for you. Their base stations use a IPv4 to IPv6 transition technique called »6to4«

The good thing about 6to4 is that there is very little to do to get it running. In fact all you basically have to do is to enable IPv6. You then have to configure an IPv6 6to4 gateway which has the address 192.88.99.1. This is an anycast address which means no matter where you are, when you connect to that IP, you get the 6to4 gateway which is closest to your current location. You can try that by tracerouting that IP from various locations:

traceroute 192.88.99.1

Once you’ve done that you get a IPv6 address based on your current IPv4 address and you are ready to go. Not only can you connect to IPv6 hosts but others also connected via IPv6 are able to connect to your machine, no matter if you use a dynamic IPv4 address (e.g. via adsl, cable or dial up) or a static on (e.g. university network, company network, server). This is the same thing the Apple Airport Extreme base stations uses.

There is another tunneling technique which allows you to have IPv6 no matter where you are and no matter if there is an Apple base station around you or not. For that you have to explicitly setup a tunnel which connects you to a so called »tunnel broker«. The most popular seems to be SixXS but there are others available. You can get a tunnel for free but the setup requires a lot of interaction with the broker compared to the easy 6to4 setup. However it usually takes only one or two days until you have a tunnel requested and setup. Now you can run a tool which sets up the tunnel, either manually or as a daemon and voila you just got IPv6!

When it comes to servers its also pretty simple. Either you ISP offers v6 which more an more do or you can get it easy via 6to4. As an example these are the lines you need to add to /etc/rc.conf on a FreeBSD machine to set up 6to4:

ipv6_enable="YES"
cloned_interfaces="stf0 lo1"
ipv6_ifconfig_stf0="2002:f222:cef7::/48 prefixlen 16"
ipv6_defaultrouter="2002:c058:6301::"
ipv6_ifconfig_bge0="2002:f222:cef7:c:: prefixlen 64"

Not that bad right? Next: get your web servers, ssh daemons, name servers IPv6 ready if they are not already. Lots of packages come with IPv6 support enabled by default now but if something isn’t working when you use the v6 address explicitly then check if your ports and packages need an update.

Now the whole point of all that is to significantly increase of IPv6 usage to accelerate deployment on the ISP side as they put more effort behind it the more it is used. Get your name servers to listen on your new v6 addresses, create AAAA records for your hosts so that people already using IPv6 can access more and more resources through it without having to fall back to good old IPv4.

Evangelize!

Once you have taken care of the IPv6 connectivity your own machines, go out and tell others about your experience. Write mails to your favorite websites (twitter.com, github.com, google.com), ask your provider about IPv6, or even better, demand it! Point them to this article: »Deploying IPv6 is vital to the continued development of the Internet«. Help them by sharing your migration experience and knowledge.

Why?

Most of the articles in the web only say »BECAUSE IPv4 ADDRESSES WILL BE DEPLEATED SOON!!!!« but they completely forget about all the benefits you can get with IPv6.

You can:

  • use remote desktop to connect to your sisters computer at your parents house whithout having to deal with NAT and port forwardings
  • use peer to peer networks far more efficiantly because there is now a better way for other peers to connect to you
  • connect to the file server at the office or at home from where ever you want
  • host web servers and other services from you’re home network and make them globally visible.
  • stream audio / video content from you’re own machine rather then relaying it to a globaly accessible server
  • connect anything you want to the internet
  • get rid of DHCP and all the hassle because IPv6 provides better and easier auto configuration features.
  • and many things

Also think about things you can do with every computer fully connected to the internet in terms of distributed systems. It could allow alternatives to the classic server – client relationship, enabling and simplifying distributed file systems, distributed knowledge bases like a distributed wikipedia, distributed chat and p2p systems etc etc. I know its an unpopular term in some circles but I think that cloud computing really starts to make sense that way.

Don’t just look on the IPv4 shortage as only reason to switch to IPv6, think about all the benefits and free your brain of the old IPv4 / NAT limitations!

Closing Thoughts

I strongly encourage all of you to get involved with IPv6. Either by using it as end user or as a system administrator by providing / exposing more services via v6. Read about it, play around with it enable it. Its quite different to IPv4 which we are all more or less used to. It took me a week or two to wrap my mind around it. It takes time to understand how to create v6 DNS records etc etc. But as far as I can tell its totally worth it as it is giving back qualities of the internet that were almost forgotten.

My personal mission of enabling IPv6 on all host which are under my control goes on. So far I’ve enabled it for an entire faculty of the UdK Berlin via 6to4, also enabled the autoconf feature for all student computers within the building. You get there, you get v6. I configured v6 on most of my servers and began to create AAAA DNS records for all the hosts (there are many of them so I’m far away from being done). I also enabled a couple of web hosts but this is work in progress. I will report once I’m done.

smyck.org on IPv6

I’m pleased to announce that all web hosts running on this machine and especially in this jail are now serving content via IPv6. Please try to browse this blog via http://[2002:50ed:991c:50ed:c411::]/ to explicitly request the v6 version. Report any issues you might have.