Net channels: Where is the end in end-to-end?

The key design feature of the Internet is the end-to-end principle. In short, the end-to-end principle says that as much work as possible should be done at the ends of the network. This results in a very simple network core. The simplicity of the core allows it to scale. See World of Ends for more implications of the end-to-end principle.

If you ask most network people exactly where the “end” is they will probably say it is the device at the edge of the network. Some may even go as far as to say it is the operating system on the edge device. At present this is indeed the case. For example, the processing necessary to make TCP a reliable protocol happens within the operating system.

At LCA 2006, Van Jacobson recently weighed in on the network protocol processing overhead that is becoming a big problem as link data rates increase. Current operating systems are having a hard time keeping up with 10 gigabit links, especially when using TCP. In his presentation, Van Jacobson says that the placement of the TCP stack in the operating system kernel is a historical accident. This design was chosen because it was necessary to ensure Multics did not page out the TCP stack. Further, TCP in the kernel violates the end-to-end principle because the kernel is not the end, the application is. Van Jacobson offers Net channels as a possible solution to this problem. Net channels provide a simple, cache friendly way to manage network packets within a system.

The presentation discusses several ways that Net channels can improve TCP performance. The first is to use Net channels between the NIC and the current in-kernel TCP stack. The more interesting use of Net channels is to push all TCP processing into userspace. Essentially, each application would have their own TCP stack. This removes the bottleneck that the single, system-wide TCP stack creates. Amazingly, Van Jacobson presents statistics which show that this modification results in TCP processing overhead dropping by 80%. Other benefits would include a simpler kernel and the ability to have a TCP stack tuned for each application. Applying TCP bug fixes and adding new features would also become easier with TCP moved outside of the kernel.

For more information on this really amazing idea see the following resources.

Bash fork() bomb

Today, I stumbled onto the following nasty bit of shell code in SECURITY Limit User Processes over on the Gentoo Wiki. No, I haven’t switched to Gentoo.

:(){ :|:& };:

Warning, this will cause your shell to create processes as fast as it can; most likely grinding your computer to a halt if you don’t have the appropriate limits set.

After spending some time trying to figure out what this command was doing assuming the colon was functioning as a no-op, I did a quick Google search and found this nice explanation of what it actually does. So, today I learned that Bash allows functions to be defined which override built-in commands.

Software as speech

Well, my sense of software is that it’s something that is both speech and a device, depending on how you define it. When you talk about software as speech, many good things tend to flow from that. When you use software as a device you can get into great benefits and also fairly scary issues.

– Don Marti

The above was taken from the November 2005 issue of Linux Journal in an article titled “Dialogue with Don“. This article is definitely worth reading if you have access to it or can wait for it to become freely available.

x86_64 FC4 and Open Office

While attempting to compile some software on my x86_64 FC4 system I ran into a strange problem. For some reason the compile was trying to link against an i386 library. My first thought was why are there i386 libraries on my x86_64 Linux installation? Well it turns out that OpenOffice is not 64-bit clean. So, in order to have OpenOffice in x86_64 FC4 all libraries on which OpenOffice depends must be present in i386 form. This leads to duplication since the rest of the system wants the x86_64 versions. Of course this wastes a bit of disk space but disks are cheap. What is more unfortunate is that loading the i386 version of OpenOffice requires a whole bunch of i386 libraries to be loaded into memory when x86_64 equivalents are already loaded.

Lately, I have been using Gnumeric and Abiword for my office application needs so I do not require OpenOffice. Thus, removing OpenOffice and all other i386 packages from my system was the simple solution to my library linking problems.

Gnumeric and Abiword are available in the extras repository, just run “yum install gnumeric abiword”.

FC4 and CD verification

For the last several versions the Fedora Core (and previously RedHat) distribution has had the ability to verify that the downloaded CD images were successfully transfered to the newly burned discs. For people who download the images and create CDs themselves this is a fabulous feature; I am sure it has saved people from broken installations. However, as I discovered it can also lead a bit of pain.

Last week I downloaded all of the FC4 disc images and preceded to burn them to CD. After rebooting to install using the new media I discovered that the CD verification was failing for three of the five discs. So, I burned them again. Same result. Having used the CD verification for many years I had no reason to doubt it. Eventually I gave up and asked Bob to burn me a copy. Strangely, these CDs failed the verification phase as well.

Realizing that something strange was going on I started googling for similar experiences. It turns out that the CD verification can fail on certain hardware. I had simply never ran into this problem before because this was my first Fedora install on my new computer.

The solution is to boot the installation kernel with an option which tells it not to use DMA for IDE devices. At the GRUB prompt type ‘linux ide=nodma”. After doing this all discs passed their tests. There is one catch though, the Fedora installer is quite smart. If you use a kernel option to do the installation the installer decides this option must be required for successful operation. After installation I had to remove “ide=nodma” from /etc/grub.conf.

If the above wasn’t enough of an adventure I also managed to cause myself some extra pain. When I asked for a copy of FC4 to be created for me I never specified which version. My new computer has a x86_64 processor. The FC4 installation discs I borrowed were for the i386 version. After a day or so of use I realized the mistake and reinstalled with the discs that first caused the problems.

LQL# HTB control

Now that LQL-Sharp has been released I thought I should put together a quick little demonstration of just how cool it is.

I have created a extremely simple GUI control that can modify the rate and ceiling parameters of a HTB class. This control should really subclass Gtk.Widget but it serves its purpose as is.

TC HTB Control

using System;
using Gtk;
using LQL;
class HTBControl { private LQL.ClassHTB klass; private LQL.Con con; private Gtk.SpinButton rateSpin; private Gtk.SpinButton ceilSpin;
public HTBControl(LQL.ClassHTB klass, LQL.Con con) { this.klass = klass; this.con = con;
Gtk.Window myWin = new Gtk.Window("TC GTK+"); myWin.DeleteEvent += new DeleteEventHandler(WindowDelete); Gtk.VBox vbox = new Gtk.VBox(false, 3);
Gtk.HBox hbox1 = new Gtk.HBox(false, 2); hbox1.Add(new Gtk.Label("Rate (bytes/sec): ")); this.rateSpin = new Gtk.SpinButton(0, 10000000, 1); hbox1.Add(this.rateSpin); vbox.Add(hbox1);
Gtk.HBox hbox2 = new Gtk.HBox(false, 2); hbox2.Add(new Gtk.Label("Ceiling (bytes/sec): ")); this.ceilSpin = new Gtk.SpinButton(0, 10000000, 1); hbox2.Add(this.ceilSpin); vbox.Add(hbox2);
Gtk.Button modifyButton = new Gtk.Button("Modify"); modifyButton.Clicked += new EventHandler(Modify); vbox.Add(modifyButton);
rateSpin.Value = this.klass.Rate; ceilSpin.Value = this.klass.Ceiling;
myWin.Add(vbox); myWin.ShowAll(); }
static void WindowDelete(object o, DeleteEventArgs args) { Gtk.Application.Quit(); args.RetVal = true; }
void Modify(object o, EventArgs args) { this.klass.Rate = (uint) this.rateSpin.Value; this.klass.Ceiling = (uint) this.ceilSpin.Value; this.klass.Modify(this.con); } }
using System;
using Gtk;
using LQL;
class MainClass { public static void Main(string[] args) { Application.Init(); LQL.Con con = new LQL.Con();
LQL.Interface nIf = con.FindInterfaceByName("eth0");
GLib.List classes = con.ListClasses(nIf);
foreach (LQL.Class klass in classes) { if (klass is LQL.ClassHTB) { new HTBControl((LQL.ClassHTB) klass, con); } }
Application.Run(); } }