Showing posts with label Hardware. Show all posts
Showing posts with label Hardware. Show all posts

Thursday, July 01, 2010

Cellphone radiation

The recent iPhone 4 antenna problems have made a lot of news. As an Android user, I have no experience or vested interest in the matter, but I did read one excellent article about cell phone antennas in general and what causes the problems in the case of the iPhone 4:

"Just about every cell phone in current production has the antenna located at the bottom.  This insures that the radiating portion of the antenna is furthest from the head.  Apple was not the first to locate the antenna on the bottom, and certainly won't be the last.  The problem is that humans have their hands below their ears, so the most natural position for the hand is covering the antenna.  This can't be a good design decision, can it?  How can we be stuck with this conundrum?  It's the FCC's fault."

The article got me curious about how much radiation does my Android emit. To determine, I had to dig out the "FCC ID" for my Android -- this requires taking out the back panel and the battery, the FCC ID is printed underneath: NM8PB99100.

I went to the FCC website, and typed the ID into the form. Incidentally, why on earth does the FCC website require the user to split the ID in this way? Wouldn't it be easier to just have one text input box and have the code do the splitting for you? Bizarre.

The resulting page is a jumble of information, poorly organized and hard to dig through. When I click on "Details", I'm greeted with the following lovely warning:


To get the actual radiation report, I need to figure out which of the following documents actually contains this information:
The attachments are all listed as PDF files, but when I click on them, they download as HTML, so I can't open any of them.

Are you kidding me? I'm not exactly inclined to trust the FCC much based on what I've seen so far.

After some digging, it looks like the numbers I'm after are in "EN-2009-90001_OET65_Test report(Page.1-100)", on pages 4/5:


These are pretty standard numbers as far as smartphones go -- I think the FCC requires no more than 1.5W/kg SAR, and the Android is under that. The iPhone is in the same range. Interestingly, the radiation is lower next to the head but higher when the phone is body-worn.

The PDF itself is actually pretty interesting to read, in particular the part about how they do the testing. As the original AntennaSys article above points out, the FCC requires testing with the phone next to the head but does not specify how the phone is held next to the head. All kinds of interesting.

Wednesday, June 30, 2010

DIY Oscilloscope

For one of my projects I need to measure the frequency of an oscillator. I don't have an oscilloscope, and buying one is prohibitively expensive. I looked for alternatives, and I was intrigued to find a surprisingly full-featured and very inexpensive DIY oscilloscope kit made by JYETech; I got mine at NKC Electronics. The oscilloscope is built around an ATMega64 CPU running at 16Mhz. The oscilloscope can sample AC or DC signals up to 5M times/second, and has a variety of other nice features which cover a broad range of hobbyist uses.

This blog posts details my experience assembling and testing this oscilloscope kit, at revision 062.

This is an average complexity project, you'll need to be pretty comfortable with soldering in pretty tight spaces (around 1mm between leads). You'll need a good soldering iron, or even better a temperature controlled soldering station -- I use the XYTronic 379, which is excellent and sells for around $50 (click on any image below to see a larger version):


You'll also need the following tools:
  • Rosin core solder
  • Helping hands -- very helpful for holding the board while you solder some small components
  • Flush cutter -- essential for trimming leads underneath the LCD to make it fit
  • Long nose pliers
  • Multimeter -- essential for testing intermediate voltages during assembly

The oscilloscope kit is tiny -- a little bigger than your palm:

In it you'll find the following (in clockwise order):
  • Instruction sheet -- this is one piece of paper with URLs to more information online
  • LCD screen
  • Bottom- and Top- cover panels
  • Mainboard
  • Components
The mainboard comes with all surface mount components pre-soldered, which is really nice: some of these components are extremely tiny (a couple of millimeters), so soldering them would have been a nightmare.

Important note: the mainboard the revision number printed in the upper-left corner -- if you are following these instructions to assemble your own oscilloscope, make sure that you have the same exact version otherwise the steps may not match and you can damage the board!

The components can be grouped into categories as follows. First, we have the actual electronic components

  • L7805CV voltage regulator (3-pins, with a screw attachment at the top)
  • Heat-sink for L7805CV
  • 1x 470uF capacitor
  • 5x 100uF capacitors
  • 1x 0.1uF capacitor (orange)
  • 1x 100mH inductor (2 pins, round, no other markings on it)
  • 1x 1N4001 diode (smallest component, white stripe at one side)
Then we have the switches and external connectors:

  • 9x push-button switches with 9x white caps
  • 3x slider switches (3 positions)
  • 1x RCA input jack
  • 1x power jack
  • 1x RS-232 male connector
  • 3x male connectors
The screws and pins that will hold everything together:

And, last but not least, the wires and connectors for the rudimentary probe you'll be using with your oscilloscope:

As I mentioned above, the documentation that comes with the oscilloscope is sparse, so you'll also want to open the following URLs in your browser, or print them out and have them nearby:
  • Detailed parts list: this lists all the parts above along with the names referenced on the schematic.
  • Assembly notes: this shows the final placement of the electronic components on the mainboard, referencing the parts by the names in the detailed parts list above.
  • Voltage reference chart: this shows the expected voltages you should see on the board after you assemble it; very useful for testing your work before you finalize it, as well as visuall verifying the placement of parts.
There is also a helpful discussion board where you can search for answers or ask questions.

First, some definitions:
  • The back of the board is the side that has all the chips and surface-mount components
  • The front of the board is the side that will hold the switches and LCD later on
Start by installing components on the back of the board. The first component is the power adaptor. The leads are large, so you'll want to use a higher temperature on the iron and a fair bit of solder on the other side:

Take the voltage regulator and bend its legs using the long nose pliers at the joint:

Align the voltage regulator with the heat-sink, place the legs through the 3 holes at the top of the board, run the screw through the hole in the heat-sink (it is threaded, so you'll probably want to use a screw-driver), and put a washer on the other side. Solder it, then use the flush cutter to cut it as close as possible to the mainboard.

Take the diode and bend its legs using the long nose pliers as shown:

Place the diode on the mainboard in the D3 slot, with the white stripe towards the right (this is essential: the diode only works in one direction). Solder it:

Insert the 470uF capacitor as shown. This is the largest capacitor by size, so you can't miss it. The capacitor is electrolytic, so it's essential to get + and - correct: the capacitor has a grey stripe on it that indicates the - (negative) lead; the other lead is the positive lead. Insert the positive lead in the hole on the mainboard that has a square shape, and the negative lead in the hole that has a round shape. In this case, the grey stripe will be pointing down, towards the power plug:

Insert the other 5x 100uF capacitors as shown on the schematic. They are all the same size, so order doesn't matter, but placement, just like above, does matter. The capacitors are denoted on the schematic as C10, C14, C15, C16, and C32, along with the position of the + lead.

Important note: the C14 position is wrong on the schematic, you will want to put it in reverse, that is to say with the + lead towards the right, and the grey stripe (- lead) towards the left:

Bend the leads on the ceramic capacitor (orange) as shown:

Then place it on the right side of the board:

Install the probe connector opposite the power connector. Just like the power connector, it has large leads, so it will need more solder than usual:

Optional: install the RS-232 connector in the middle of the board. This connector can be used to hook-up the oscilloscope to a PC and take screenshots of its LCD. If you'll never need this feature, you can skip installing this, it will also make your life easier later when you install the LCD:

Short the leads across D4 (green wire, circled in the diagram below).

Important note: this step is missing from the official documentation:

It's now time to power-up the oscilloscope and do a preliminary test. You'll need a 9V DC power supply, where the jack is center-positive and outer-negative. Plug it in, and, using your multi-meter, measure the DC voltage at the "+5V" hole indicated with a red arrow in the image above. The multi-meter should read 5V DC. If it doesn't, something is wrong, the most likely causes are:
  • You got the polarity wrong on one of the capacitors.
  • You got the polarity wrong on the diode.
  • One of your solder joints is loose.
Go back and carefully check your assembly, cross-reference with the schematic, and keep testing the voltage at the "+5V" hole above until it's right.

Once you get the voltage right, install another lead across the "JP1" connector, as shown below:

Check the "+5V" voltage hole again -- it should still read 5V DC. If it doesn't go back and check the capacitors and solder joints.

Now turn the board on its front and install the 9 push-button switches: their leads are springy, so they should snap into place, after which you can solder them. The orientation of the switches across their 4 holes doesn't matter:

Install the 3 slide-switches. Their leads are asymmetric, so they only fit in one direction:

You are now done with the mainboard for the time being. Pick up the LCD assembly and look on its back: you'll see a row of holes with labels:

Place the long strip of leads into these labeled holes, by inserting the shorter end into the holes (the longer end will go into the mainboard.) Solder them onto the LCD assembly, taking great care to keep the leads perpendicular to the LCD board, otherwise the LCD assembly won't fit right on the mainboard.

Important note: be sure to insert the strip of leads into the labeled holes, and not the other ones!

Important note: this is the hardest, most delicate part of the whole assembly. These holes are about 1mm apart, and the LCD board's holes are not pre-soldered. You need a steady hand and patience. The helping hands tool should come in handy here. A technique I found works reasonably well is to get one of the leads soldered correctly, holding the rest at the right position and angle; once you get that done, soldering the rest should be easier:

Solder the two other 2x lead strips at opposite ends of the row of holes opposite the one you just soldered. These leads are not electrical contacts, they just hold the LCD in place on the other side. Pay close attention to solder these in perpendicularly as well:

Using the flush cutter tool, cut one of the leads as shown in the image. This is because the hole into which it goes on the mainboard is obstructed by the heat-sink as shown:

Now solder the LCD assembly on the front side of the board. The LCD assembly can only go in one direction, don't force it.

Important note: you will need to use the flush cutter to cut all leads of components sticking out through the board behind the LCD very flush to the board, otherwise you risk shorting the LCD!

Screw together the two halves of the metal posts that will hold the panels above and below the mainboard. The shorter metal post goes on the front of the mainboard, the longer metal post on the back:


The final assembly should look like this:

Now comes the moment of truth: plug it in, and, if all is well, it will go through the boot sequence like this:



Place the white-caps on the push-buttons, and, using the 4 remaining screws, assemble the top and bottom panels like this. If you find that the push-buttons are sticky after installing the panels, either trim the white-caps with a knife, or loosen the screws a little:

You're almost done! The last step is to assemble the probe:

Strip the ends of the red and black wires -- these will connect to the alligator clips. Be careful to slide the shrink-wrap tube and alligator clip cover on each wire before finalizing the assembly:

Do the same with the larger black coaxial wire, and connect it to the RCA plug. Just like above be careful to slide the shrink wrap tube and RCA cover over the wire before finalizing the assembly. Connect the red wire to the inner coaxial lead (leading to the center jack), and the black wire to the outer coaxial lead (leading to the outer shield):

After everything is assembled, slide the shrink-wrap tubes over the connections and use a hair-dryer on high to shrink them into place.

Let's test that the oscilloscope can actual measure frequencies! Turn it on, and plug the probe into the RCA jack. Set the oscilloscope as follows:
  • Using the SEC/DIV button, set it to "1ms"
  • Using the LEVEL button, set it to "i"
  • Using the V.POS button, and the +/- buttons, slide the Y level down towards the bottom of the screen
Now connect just the red alligator clip to the upper-left corner hole on the mainboard marked "500Hz/5V pp" (this hole is also marked on the top panel with the same indicator):

The oscilloscope should show you a 500Hz square wave:

You might consider getting a better probe, I like this one.

Enjoy!

Sunday, May 09, 2010

Diodes and demodulation

As we described before, a diode lets current flow in only one direction. This is essential for demodulation: the process of extracting information from a signal. To understand demodulation we need to first understand the first and simplest kind of radio transmission -- amplitude modulation.

The goal of radio is, ultimately, to transmit sound over very long distances. A band is playing in New York and I would like to hear it in San Francisco. One way to do this is to build a sound amplifier so loud that the sound waves themselves travel directly from the origin to my ear. This is obviously impractical: it would be intolerably loud at the origin and barely audible at the destination; furthermore, you could not have multiple radio stations broadcasting at the same time, they would all clobber each other in a cacophony of noise.

Another way to do this is:
  • Convert the sound wave (anywhere from 1 Hz - 10 kHz) to another equivalent wave (measured in hundreds of kHz or even MHz).
  • The equivalent wave, or modulated wave, contains the original sound wave information but in a different representation.
    • The carrier wave is not audible to the human ear since it is in a totally different frequency spectrum.
    • Sound waves travel by making the air vibrate. The amount of energy required to make air vibrate over long distances is enormous (think loud rock concert).
    • Higher frequency waves are electromagnetic waves. They can travel much longer distances using much less energy.
  • Once the modulated wave arrives at my radio's antenna, the radio translates this modulated wave back into a sound wave that I can hear. This is called demodulation, and it is made possible by diodes.
 Let's first see what a modulated wave looks like (courtesy of yourdictionary.com):


The carrier wave is basically the radio station frequency. When you tune into KFRC, you tell the radio to look for sound information embedded in carrier frequency 1550 kHz.

The modulating wave is the sound. This is what is embedded into the carrier frequency and, ultimately, the "information" we want to hear.

The modulated wave is the combined wave that travels from the radio tower to my radio. Visually, it roughly looks like a combination between the carrier wave and the modulating wave, which should hopefully agree with your intuition and some of the descriptions above.

Now, we wish to turn this modulated wave into sound. To understand how that works we need to first understand how a loudspeaker works, as shown on this diagram (courtesy of soundonmind.com):


  • The magnet provides a fixed, constant magnetic field.
  • The signal input provides the sound wave we wish to ultimately hear.
  • When the signal input goes into the voice coil, the voice coil becomes an electromagnet.
  • The voice coil's magnetic field "pushes against" the magnet's field, based on the strength of the signal input.
  • The voice coil is attached to the diaphragm, which is basically a piece of cardboard.
  • When the voice coil moves, the diaphragm moves, and pushes air to varying extents, generating a sound wave we can hear.
    • If you've ever touched a loudspeaker that was playing music, you can actually feel the movement of the diaphragm with your fingers.
Let's step back and look at the complete picture:
  • We have a modulated wave that contains the sound information embedded in a carrier wave. This modulated wave has very high frequency, measured in hundreds or thousands of kHz, so it is not audible by the human ear.
  • We have a loudspeaker that can convert a wave into sound by vibrating a piece of cardboard.
What would happen if we feed the modulated wave directly into the loudspeaker? Think about it for a minute before reading on.

The answer is: absolutely nothing:
  • The modulated wave has very high frequency, which means that the "peaks" and "throughs" come in rapid succession one after the other.
  • When a "peak" arrives at the voice coil, it starts to move the voice coil out; this takes a bit of time, as the voice coil has to physically move in order to push the diaphragm and make a sound wave.
  • However, a "through" quickly follows the "peak" and starts to pull the voice coil back in the opposite direction.
  • The "peaks" and the "throughs" effectively cancel each other out as far as the diaphragm is concerned and no sound comes out the speaker.
What would happen if we feed the modulated wave through a diode first, and then feed the output from the diode to the speaker? A diode lets current flow in only one direction, so the modulated wave would basically be cut in "half":


Now, if we feed the demodulated wave into the speaker:
  • The first peak will start to push the voice coil out.
  • There is no through following this peak, simply an empty space, or "absence of signal".
    • How is absence of signal different from a through?
    • A through is a negative signal -- it starts to pull the voice coil in the opposite direction.
    • Absence of signal is no signal -- the voice coil is left where it is will at most react based on its own inertia or the elasticity of the diagram.
  • The next peak will start to push the voice coil further out.
  • As you can see, the voice coil (and the attached diagram) react only to the peaks, in other words they both move according to a wave that follows the top of the peaks.
The wave that follows the top of the peaks is our original sound wave! Look back at the first diagram to see it, or just trace the peaks above with your finger.

The coil and diaphragm end up vibrating the air in accordance to the original sound wave, therefore producing sound we can hear. The diode demodulates the modulated wave back into sound we can hear.

Tuesday, April 20, 2010

My first month with a Mac

About a month ago I upgraded my company laptop from a Thinkpad to a MacBook Pro. Although I've used Apple computers in the past, it's never been my "main" computer or even close to it. I've always used Thinkpads as my work laptop and felt they were and still are exceptional laptops. I'm pretty proficient with the Mac now; I still miss the Thinkpad every so often, but overall I'm happy. Here are some of my impressions thus far from the transition.

My most important requirement for a computer is that it lets me be "productive". I define productivity as "doing my job as fast as I know how using the given tool". If the machine gets in the way (by being unreliable, slow, lacking software, etc.) then that's a deal breaker and I'm not interested. I don't have particular allegiances to certain companies or hardware manufacturers, so long as I can be productive. In that respect, the Mac got off to a surprisingly good start, and I can now safely say that I'm about 95% as productive on it as I used to be on my Thinkpad. I honestly did not expect this, so it was a rather pleasant surprise.

In terms of software, the applications I run most on my Mac are:
  • Chrome = duh
  • iTerm = SSH client
  • TextMate = general purpose programming text editor
  • OpenOffice = word processing, spreadsheet, presentations
  • Eclipse/Android = work
  • iTunes = streaming radio
  • Picasa = photos
  • VLC/QuickTime/Flip4Mac = media
  • Skype = video conferencing
  • Solitaire etc. = blow off steam
All these programs work almost flawlessly. I don't detect almost any difference from the Thinkpad, they run fast, they're reliable, they're as bug-free as they are on the PC.

The only application that took some work was iTerm -- I run Emacs in screen, and getting the keybindings to work was a bit painful. In particular, by force of habit I'd often hit Command+W to copy in Emacs, which would close the current tab. Fortunately, it's easy to re-bind the keys for any menu to some other key combination, so that's what I did. This is actually a remarkable feature of OSX, and one that I'm not sure exists on Windows -- you can specify any app and any menu entry in that app (by name), and then give it another key combination. Cool!

The main drag was getting used to the new key combinations. Command+{C, X, Z, TAB} all work the same and fairly intuitive for someone used to PCs. But that's where the similarities end:
  • I used Home/PgUp/PgDn/End/Del a lot on the PC, and the Mac is inadequate here. Having to hit Fn+{Left, Right, Up, Down} just isn't the same. Not to mention that different apps interpret the key combinations differently, sometimes it recognizes Fn+, other times Command+.
  • I still find it confusing to have to deal with Control, Alt, and Command. I know how they work, but I still have to think about it. Why do we need 3 keys to do what a PC does with just Control and Alt?
  • Switching between applications is done via Command+TAB, switching between multiple windows of the same application is done via Command+~ Is this really necessary? Command+TAB should be enough IMO, why the extra aggravation?
Another minor drag is connecting an external monitor. I sometimes use an external digital monitor (DVI), other times an external analog monitor (VGA). Apple decided that they couldn't use a single connector for this, you need two dongles: one for DVI (DVI-D to be precise), and another for VGA. This is crazy. The mini-port can clearly put out both digital and analog signal, and DVI connectors are perfectly capable of relaying said signals. I suspect the reason Apple insisted on a DVI-D dongle is to speed the demise of VGA monitors. This is part of the general company culture (we know what's best for you, trust us), which I personally find patronizing.

Now that we got the bad out of the way, there's plenty of stuff to like:
  • The touchpad is fabulous. Scrolling with 2 fingers, clearing the desktop with 4 fingers -- it's just beautiful. Furthermore, I simply could not use the touchpad on my Thinkpad, I always used the little red knob instead; the PC touchpad is so sensitive it's useless. The Mac touchpad simply works, and works well. If you've never tried to use one, I do recommend you try it.
  • The laptop feels extremely sturdy and well built. I used to think that Thinkpads were the best built laptops out there, but the unibody design wins hands down. It's not even a comparison.
  • The keyboard feels good, the screen looks beautiful. I'd say on par with the Thinkpad.
  • The battery life is amazing. I get 4+ hours easily, which was never possible with any Thinkpad I've ever used. The magnetic power connector is really neat and has saved wire accidents a few times already.
  • The wireless configuration just works. As soon as the laptop comes out of standby, it's connected to the wireless, which is fantastic (the Thinkpad used to take a good 15-20 seconds, which gets old fast). The laptop also knows to stay connected to the current SSID, unlike the Thinkpad which would switch between SSIDs seemingly randomly if more than one "preferred" network was in range (I guess they thought this was a feature?)
  • Last but not least, going in and out of standby is remarkably fast and reliable -- it's almost instant ON/instant OFF. The Thinkpad would sometimes take 1 minute (yes, 60 seconds) to do this, and lock-up in the process. I've experienced this with every Thinkpad I've used.
All in all, I think the Mac has come a long way in the area I care the most about -- productivity. I would go so far as to say that if I had some Windows-only apps I needed to run, I'd run them in VMWare (which is very fast and nice to use on the Mac).


The Mac is a remarkable beautiful piece of engineering. The rumours are true, there's no laptop quite like it. It's also expensive, almost double the price of an equivalent Thinkpad. This is the reason I'd have trouble justifying the price if it came out of my own pocket. But I do love using it, and I can understand why some people never settle for less.

Thursday, September 03, 2009

Repeater on the cheap

The wireless signal in our house has difficulty reaching a few spots. On top of that, the PowerBook's metal shell interferes with the (already weak) signal, and makes it impossible to connect.

One solution is to use a repeater to boost the signal. LinkSys already makes a Range Expander, which seems to do the right thing, but at $80, it costs more than the router itself!

DD-WRT, which I already use for QoS, can also turn a $50 router into a repeater (and more!)

The generic name for this is Linking Routers. At a high-level, there are 4 ways to link two (or more) routers together:
  • Client -- Router 1 is on the WAN, Router 2 extends the range of Router 1. The catch is that all clients can only connect to Router 2 via a wired connection. Additionally, Router 1 and Router 2 sit on different networks, so it is not possible to do things like "broadcast" between them.
  • Client Bridged -- same as Client, but the two routers sit on the same network.
  • Repeater -- same as Client, but the clients can connect to Router 2 via wired and wireless. The two routers sit on different networks.
  • Repeater Bridged -- same as Repeater, but the two routers sit on the same network.
The easiest and most convenient configuration is the Repeater. Basically, Router 2 acts as just another computer that connects to Router 1, but creates a separate network (with a separate SSID) in its area of influence.

One drawback (to all these configurations) is that the wireless bandwidth is cut in half, roughly, because of collissions within the wireless broadcast between the two routers. This is apparently unavoidable. In our case, the 802.11g protocol is already fast enough for what we use it, that this does not create noticeable slowdowns (and SpeedTest confirms it).

The Client functionality has existed for a while (it even exists in my ancient v23 on my original router), but the Repeater functionality is new, only in v24, and (confusingly) only works right in some versions but not others. Read the documentation very carefully!

While I was researching repeaters, I also briefly looked into whether an 802.11n router might help -- they are supposed to be "faster" and have increased range. Unfortunately, the Linksys own N-products get mixed to bad reviews -- the range is not much increased, neither is the speed, and the installation process leaves much to be desired. Add to that the fact that, to use it, I'd have to get compatible 802.11n PCMCIA cards, and I'm not all that interested or excited about this.

DD-WRT continues to be an exceptional product, especially when combined with a solid piece of hardware like the WRT54GL.

Monday, January 28, 2008

IPv6: here already?

With the phenomenal recent growth of the internet, the 32-bit IP address space (IPv4) is starting to run out. There are efforts to address this, like subdividing or repossessing large blocks already in use, or the ubiquitous use of NATs, but they're only slowing the inevitable. The IPv6 standard has been around since circa 1996, and it has recently started to get more visible traction: all major operating systems (Windows XP/Vista, Linux, and OSX) support IPv6 natively, there exist IPv6 networks that you can access via dedicated tunnels ("tunnel brokers"), and there are rumors that some companies use IPv6 internally. Some ISPs (like Sonic.net) even provide such dedicated IPv6 tunnels for free, in an effort to encourage experimentation. Although no major ISP has yet migrated to IPv6, I believe it's only a matter of time.

Discussing the in-depth technical aspects of IPv6 is much beyond the scope of this blog post, though I do encourage the adventurous reader to take a look at some of the resources linked above. Instead, this is more of a high-level overview for how to get IPv6 up and running on your home LAN. I recommend using the excellent DD-WRT firmware's IPv6 support, upon which this post is roughly based.

IPv4 addresses are 32 bit in size, which gives us a total of 4 billion different addresses. The effective number of machines that can be accessed in practice is smaller (since many addresses were given out in "blocks" to institutions that don't use the entire block), but it still gives an idea about the upper-bound. In contrast, IPv6 addresses are 128 bit in size. This is an enormously large number, and it's hard to provide a good metaphor for how large it really is. IPv6 would allocate a trillion IPv6 addresses for each square centimeter of our planet, or over 1 trillion trillion addresses for each of the 6.5 billion people currently on the planet. Hopefully, this should be enough for the foreseeable future.

The internet at large is still IPv4, but you can configure your internal LAN (behind your NAT'ed router) to run over IPv6. All the machines on the LAN would talk amongst themselves using IPv6. However, the router is still connected to an IPv4 network (your ISP). Therefore, the LAN traffic must have a way to travel across IPv4 to its destination, regardless if the destination is an IPv4 or an IPv6 network. This is done in one of two major ways:

1. Use 6to4

This is a protocol which assigns each IPv4 address a special IPv6 equivalent (which, by convention, always starts with the prefix "2002:"). Your router would package all IPv6 packets, regardless of destination, into IPv4 equivalents, and send them to a relay gateway. This relay gateway is a machine that sits at the edge between an IPv4 and an IPv6 network, and looks at the destination address of incoming traffic:
  • If the address is an IPv6 address on the relay's IPv6 network, it routes it using IPv6 routing.
  • If the address is an IPv6 address on another IPv6 network, it packages it into an IPv4 packet, sends it over IPv4 to the relay gateway of the destination IPv6 network, which unpacks it, and routes it.
  • If the address is a 6to4 IPv6 address (corresponding to an IPv4 address), it unpacks it, sends the traffic over the IPv4 network, collects the response, and sends it back to your router.
Confused? Here's a diagram:

One risk with the 6to4 protocol is that the nearest relay gateway may be far away, which negatively impacts performance. If you're careful, you can select a 6to4 relay that's reasonably close to you, and you should be fine.

2. Use a tunnel broker

A tunnel broker is a dedicated link from your router's gateway to an IPv6 gateway. This makes life a lot simpler for your router: all it has to do is take IPv6 packets from the LAN, package them as IPv4, and push them into the tunnel. Provided that the tunnel isn't too slow (that is, too far away), the tunnel 's end-point will do all the hard work of routing IPv6 and IPv4 packets correctly. Here is a diagram that describes the process visually (note that the Tunnel Server can either directly route over IPv6, or ask the Tunnel Broker to route over IPv4; your LAN uses only a single IPv6 tunnel to connect to the Tunnel Server).

Some tunnels require that your router have a static address, while others can handle dynamic addresses (via the AICCU utility). The two big IPv6 tunnel providers in the US are SixXS and Hurricane Electric.

If you succeed in setting up IPv6 on your LAN, you can connect to this site, and watch the turtle dance!

"All this work to see a silly turtle dance on the screen?" I hear you ask?

Although the IPv6 internet is significantly smaller than the IPv4 at this point, this might be a good exercise for you to learn how IPv6 works. All indications are that we will migrate to IPv6 before too long, so consider this a way to get your feet wet. There is no downside to running your LAN over IPv6, your operating system, as well as most modern browsers (Firefox, IE, etc.) and network applications (Thunderbird, etc.) natively support IPv6. The performance penalty for running using tunnels should not be prohibitive, and most DNS servers know to serve both IPv4 and IPv6 addresses for multi-homed servers, to make the accessible from both networks. IPv6 is, in some ways, much simpler and more elegant than IPv4, so for those curious to learn more, this is a great opportunity to look under the covers.