An avian carrier's blog – IPv6 Atom feed

Internet Protocol version 6
  1. Accessing serial ports the easy way (2011-12-01)

    Every once in a while, I see people having a hard time accessing a RS232 or USB serial port from Java. There exist several solutions to do this in Java:

    • The Java Communications 3.0 API looks awfully old and unmaintained. It is available for Solaris SPARC, Solaris x86, and Linux x86.

    • RXTX is a mix between Java code and C code accessed through the Java native interface. It is hosted on a CVS server and it looks like the 2.2 release will never go out since it got stuck on version 2.2pre2 released in 2009. The last stable version is 2.1.7 from 2006.

    • PureJavaComm is a drop-in replacement for those two libraries, written in Java and using JNA to interface with the system. It is simpler to setup than RXTX, is hosted on GitHub and is actively maintained.

    However, there exist at least one other solution which does not require the use of any external library. This is what I chose to interface a Scala program with a XBee Pro module through a serial interface to interact with my students devices. I also use it to interface the Factor programming language with the same XBee module.

    Every language has a well-defined and well-maintained sockets library, right? So why not simply use socat, a multipurpose relay which is able to bridge many protocols and interfaces such as, in our case, TCP and a serial port?

    I launch socat as

    % socat TCP-LISTEN:4161,fork,reuseaddr FILE:/dev/ttyUSB0,b57600,raw
    

    and what I immediately get is a TCP server listening onto port 4161 and ready to relay any incoming connection to the /dev/ttyUSB0 serial port with a 57600 baud rate. And not only do I have no more concern about accessing the serial port properly, but also I can access a port located on a remote computer as easily by launching socat there instead of locally.

    But what if I want to spy on the TCP/serial relay to see that I send the right codes to the XBee module? socat offers you a choice of command-line options to dump the data in various formats.

    What does the Scala interface look like? I have a XBee abstract class lacking an InputStream to receive the input from the XBee module and an OutputStream to send the output to it. This class is extended into a concrete class using simply:

    import java.net.Socket
    
    class TCPXBee(host: String, port: Int) extends XBee {
    
      private val socket: Socket = new Socket(host, port)
    
      override protected val inStream = socket.getInputStream
      override protected val outStream = socket.getOutputStream
    
      init()
    
    }
    

    socat makes my life easy. It is probably already packaged for your operating system, go and get it! Oh, and did I mention that it works with IPv6 too?

  2. IPv6: make it happen today (2011-01-13)

    On Wednesday, Google announced the world IPv6 day: on June 8, 2011, several major Internet companies including Google, Facebook, and Yahoo! will enable IPv6 on their main websites. The test will probably only last 24 hours, and the results will be carefully analyzed before turning IPv6 on forever on those sites.

    Google already provides IPv6 services. However, only selected candidate networks or motivated hackers have access to those services. The rest of the world only see the IPv4 version.

    The word about the June 8 experiment has been spread by lots of IPv6 enthusiasts and activists on social networks. However, looking at their Twitter profile, it is hard not to notice that most of their personal or professional web sites are definitely IPv4-only. While one can understand why the most visited web sites need to be careful in their systematic enabling of IPv6, smaller sites do not take huge risks in enabling IPv6 by default today.

    If you want IPv6 to become a reality tomorrow, start using it today by enabling IPv6 on your own web server, and publish its IPv6 address in your DNS alongside with the IPv4 one. Do it before Google does it. Beat Facebook to it. Sure, a minuscule portion of your visitors may experience occasional difficulties. So what? This is a good occasion for them to iron those problems out. Did you even check that your provider gives you IPv6 addresses already? If you did, this is a first step, do the second one and use those addresses. If you didn't, talk to your provider now, all it takes is a short email requesting a status update about IPv6.

    And if you want to test whether, as an information consumer, you are ready to browse IPv6-only sites as they appear, do not hesitate to use this excellent tool.

    Will 2011 be the year of IPv6?

  3. Using IPv6 by default with wget (2007-10-31)

    I was surprised to see that wget chose to use IPv4 over IPv6 when downloading a file. It looks like it is on purpose (I would call it a bad design choice). You can tell wget to prefer IPv6 over IPv4 by putting the following line

    prefer-family = IPv6

    in either /etc/wgetrc (system wide) or $HOME/.wgetrc (user settings).

  4. Will Gentoo be the last OS without IPv6 automatic tunnels? (2007-01-29)

    Tomorrow, Windows Vista will be available in stores. According to press reviews, this operating system will have IPv6 enabled by default with support for automatic Teredo tunnels when native IPv6 is not available.

    Teredo tunnels allows a computer plugged to a IPv4-only network to efficiently talk with computers using IPv6 addresses. IPv6 proponents such as myself are pleased with this move: while I don't like Microsoft at all, I am happy to see them embrace IPv6 and give this protocol the chance it deserves.

    However, I don't use Windows on my laptop (or anywhere else, if that matters), I use the Gentoo Linux free operating system. When my laptop is plugged into my home or work networks, it gets automatic IPv6 connectivity. However, when I am traveling, I usually use IPv4-only networks; an automatic tunnel would really be useful to reach my home computers, some of them being IPv6 only.

    Fortunately, there exists an excellent automatic tunneling software for Linux and FreeBSD called Miredo. This program is already included in Debian GNU Linux and FreeBSD.

    Arne Mejlholm packaged Miredo for Gentoo back in February 2005 after Daniel Webert suggested it. I submitted an updated version in June 2006. However, it has never been integrated into Gentoo's portage system and my question on the next step to do (if any) never got answered.

    As I am tired of chatting with myself on the Gentoo ticket tracking system, I will not submit a new version of the Miredo package that is likely to be ignored as well. I hope Gentoo developers will handle ticket 77603, even if only to tell what is wrong with it.

    Edit (2010-11-24): it took more than five years, but at last Miredo is now included in Gentoo.