\documentclass{beamer}

\usepackage{beamerthemesplit}

\title{Linux on commodity network hardware}
\subtitle{LUGOD talk}
\author{Josh Parsons}
\date{August 15, 2005}

\parskip10pt

\begin{document}

\frame{\titlepage}

\section[Outline]{}
\frame{\tableofcontents}

\section{``More open'' firmware on commodity network devices}

\frame
{
  \frametitle{What are the devices I'm talking about}

  If you have small office / home (``SoHo'') network, chances are you
  are using a router made by Linksys, ASUS, D-Link, or Motorola.

  If you do, then probably your router is already running linux.

  (And a lot of other GNU software)

  You can use the \emph{firmware upgrade} feature of your router to
  install a \emph{more open} version of the firmware onto it

  This has many advantages.
}

\frame
{
  \frametitle{Advantages of a more open firmware}

  What do I mean by ``more open''?

  \begin{itemize}
    \item Get more control over the device's existing functionality. e.g.:

      \begin{itemize}
	\item Set up more sophisticated firewall rules with
	iptables.
	\item Override firmware limitations on wireless
	power/channel.
	\item Remote administration with ssh.
      \end{itemize}

      \item Install new software / new functionality. e.g:

	\begin{itemize}
	  \item Run a web server / wiki / blog / proxy.
	  \item Run an irc server or proxy.
	  \item P2P file share.
	  \item Email / printer / webcam / telephony / network sound /
	  etc.
	\end{itemize}
  \end{itemize}
}

\subsection{How does it work?}

\frame
{
  \frametitle{How does it work: Hardware}

  What's inside a typical SoHo router / network device?

  \begin{itemize}
    \item A \emph{specialised ``embedded systems'' processor} --- MIPS or ARM
    architecture --- about 100-300MHz clock rate.

    \item Some \emph{RAM} (between 8 and 32MB)

    \item Flash \emph{ROM} containing the firmware (2--8MB)

    \item An \emph{ethernet interface}

    \item Sometimes also \emph{802.11a/b/g wireless} or \emph{USB}.

    \item Sometimes other specialised network hardware such as an
    ethernet switch.

  \end{itemize}

  These devices are all pretty similar internally, even though they
  are marketed for different purposes.

%  Compare a late-1990s desktop system!
}

\frame
{
  \frametitle{How does it work: what happens at boot?}

  These devices treat their ROMs like a disk.  The ROM is
  \emph{partitioned} into several areas:

  \begin{itemize}
    \item The \emph{boot loader} (like LILO, GRUB, SYSLINUX)
    \item A re-writable \emph{configuration area}.
    \item The \emph{linux kernel}.
    \item A \emph{root filesystem}.
  \end{itemize}

  When you switch the device on, the boot loader loads the kernel into
  RAM, and it begins running using the root filesystem.

  Reflashing the firmware replaces only the kernel and root, leaving
  the boot loader and configuration intact, so that a failed reflash
  does not \emph{brick} the device.
}

\subsection{What's available?}

\frame
{
  \frametitle{What devices are available?}

  This is very much a partial list!

  \begin{itemize}
    \item Linksys' popular WRT54-series routers.
    \item Linksys' NSLU2 ``network storage unit''.
    \item Asus' WL500 series wireless routers.
    \item Other routers by D-Link, Motorola, Belkin, ...
  \end{itemize}

  These are all the sorts of things you might buy in Radio Shack.

  The manufacturers sometimes change the hardware
  completely with a minor version number change.  Check that there is
  a supported ``more open'' firmware for a device before you buy it!
}

\frame
{
  \frametitle{What firmware is available?}

  Usually you will have two options for user-supported firmware.
  There'll be a \emph{conservative} firmware that preserves the
  functionality of the manufacturer's firmware, and a \emph{clean}
  firmware that just converts the device into a generic linux server.

  \begin{itemize}
    \item For the WRT54*: HyperWRT / OpenWRT
    \item For the NSLU2: Unslung+Optware / OpenSlug
    \item For the WL500*: Oleg's+Optware / OpenWRT
  \end{itemize}

  In either case, there'll be a range of add-on \emph{packages}
  available to add more functionality over-and-above what's supplied
  by the firmware.
}

\section{A case-study: the Linksys NSLU2}

\subsection{About the NSLU2}

\frame
{
  \frametitle{The Linksys NSLU2}

  Features:

  \begin{itemize}
    \item Intel XScale processor (bigendian ARM) running at 133MHz. Can be
    ``de-underclocked'' to 266MHz.
    \item 8MB flash, 32MB RAM.
    \item One 100TX ethernet port.
    \item Two USB 2.0 ports.
    \item Intended as a dedicated samba server.
  \end{itemize}

  The NSLU2 is fondly known to its users as the ``slug''.

  I maintain the Optware/Unslung package repository and build system.

}

\subsection{Unslinging the NSLU2}

\frame
{
  \frametitle{Unslinging the NSLU2}

  The NSLU2 was very popular with embedded linux hackers when it first
  appeared because it was one of the first such device  to feature
  USB 2.0.  So it's practical to attach a USB hard drive.

  This is important because there's not a lot of room on the flash to
  install software.  And the hard drive can be used for swapping.

  The \emph{Unslung} firmware has a feature that allows it to copy
  parts of the firmware that would underwise be in RAM to the NSLU2's
  harddrive.  This saves RAM, and allows packages to be installed on
  the harddrive.  The process is called \emph{unslinging}.

}

\frame
{
  \frametitle{The moment of truth}

  I will now attempt to reflash and unsling the slug I have with me.
  There are several methods for doing this:

  \begin{enumerate}
    \item Using the web interface. Requires firmware to be
    functional. Does not work on every version of unslung.
    \item Using the boot loader's upgrade mode.  Works even if the
    firmware is broken.  Requires a special (but opensource) utility.
    \item Using the boot loader and tftp.  Works even if the firmware
    is broken.  Requires only standard tools, but it is slightly
    tricky to use them.
    \item Using a soldering iron.
  \end{enumerate}

  I am going to use method \#2.

}

\subsection{What can we do with the slug once it's unslung?}

\frame
{
  \frametitle{What can we do now?}

  I unslung the slug to a 1GB flash drive.  If we had internet access,
  we could now begin installing packages from the Optware/Unslung
  package repository onto the slug.

  Packages available include:
  
  \begin{itemize}
    \item Apache, and a choice of other php-enabled web servers.
    \item Mediawiki for use with the above.
    \item Typical linux server stuff: ssh, ldap, cvs, ipsec, nfs.
    \item Things you might not think of: asterisk, esd, x11, qemu.
  \end{itemize}

}

\frame
{
  \frametitle{Developing packages for unslung}

  Though it is possible to install a compiler and other development
  tools on the slug itself (and some packages can only be built that
  way) it is much easier in the long run to cross-compile on a PC or
  other, faster, system.

  It is important to keep known-to-work recipes for building packages
  in a systematic way.  These recipes are known as ``meta-data''.
  They are like RPM's .spec files.

  The package system used with unslung is called ``optware''.  Optware
  consists of a build system (a set of compilers, tools, and makefiles
  that will cross compile packages for unslung) and a set of meta-data
  for each package.
}

\frame
{
  \frametitle{Openslug}

  Unslung preserves the stock firmware's web interfaces and samba
  server.  These are tied to the stock firmware's kernel, gcc, and
  glibc configuration, which is a bit out of date, and includes some
  non-standard patches to the linux USB subsystem.

  If we gave up on those, and just installed a clean gnu/linux system
  on the slug, we could upgrade the kernel to 2.6, and enable many
  more kernel features.

  This is the purpose of the Openslug firmware.

  Openslug is based on the OpenEmbedded build system, and has its own
  package repository.
}

\frame
{
  \frametitle{What's interesting about Unslung development?}

  Being involved with Optware/Unslung has been a great learning
  experience for me.

  \begin{itemize}
    \item The big-endian ARM architecture is quite exotic, so I'm
    often found portability problems with famous pieces of software
    and been able to contribute fixes.  This was true of php and gcc.
    \item I've learned how to write more portable
    code myself.
    \item Doing firmware development, I've learned a lot about the
    linux kernel and GNU C library.
    \item Optware/Unslung is by far the largest open-source project
    I've been closely involved in.  We have about 60 active
    developers located all over the world, communicating by irc.
  \end{itemize}
}

\section{Closing thoughts}

\subsection{We will see more of these devices.}
\frame
{
  \frametitle{We will see more of these devices.}

  The manufacturers like Linux for both technical and social reasons.

  The technical reasons are its stability and good support for IP
  networking and for MTD.  The social reason is that it is free as in
  beer to anyone who can compile it.

  They take the same attitute to hardware: the NSLU2 is very similar to
  intel's development boards.  Linksys clearly wanted a generic system
  on which they could run (mostly) pre-written software.

  We will see more and more of these devices.  This is a good thing,
  as it will mean that Linux will become more mainstream.

  But it is important to get the manufacturers to respect the GPL. 

}

\subsection{The Unslung/Optware Community.}
\frame
{
  \frametitle{The Unslung/Optware Community.}

  Unslung and Optware are a good example of user-supported /
  user-developed software done right.

  What makes it work so well?

  \begin{itemize}
  \item Revision-control systems.  We use monotone and cvs.
  \item Wikis.  We have a community rule that encourages users to add
  to and improve the wiki.
  \item Freenode irc.  The core developers are available to help on
  \#nslu2-linux.  Community rules about bothering them.
  \item Easy to become a developer.  Publically post a working package
  recipe and you get cvs write access.  We have had no ``rogue
  developers'' yet, and if we did, any damage would be reverted.  A
  wiki-like model of development.
  \end{itemize}

}

\end{document}

