Fri 18 Nov

Pirate Party wins 8% of vote in Berlin elections

I remember when the first Pirate Party was created in 2006 (back in the days when I still read 2600 and went to high school). I'm thrilled to see that in the ensuing years the party has taken hold in multiple countries and has expanded its agenda to become more than a single-issue party. To paraphrase a point made by Evgeny Morozov at a talk I was at yesterday, the best outcome for a movement started on the Internet is the formation of a party that can engage with the political system in a meaningful way to create change.


Thu 18 Aug

The Case of the Mystery IGMP Query Request

I've spent two days trying to track down the source of mystery IGMP query requests on a network emulation testbed I'm building. All the machines are (essentially) stock installations of Ubuntu 11.04, with no services running besides sshd.

One of my machines acts as a poor man's Ethernet tap. Its two NICs, which are connected to the two machines that run the system I'm testing, are bridged together, allowing me to run tcpdump on the bridge interface (br0) to capture packet traces from the experiments I run*.

I noticed some strange IGMP queries originating from this monitor machine, and after several hours of hunting for the source I found that it was actually coming from this bridge device! It turns out that the bridge module in Linux supports IGMP snooping. I'm sure this is a useful feature for certain scenarios, but when you're trying to make sure no non-intentional traffic is moving across your NICs it is not at all useful.

Anyway, once you've figured this out the solution is simple: just disable IGMP snooping. You can (thankfully) do this via a sysctl variable:

cd /sys/devices/virtual/net/br0/bridge
echo 0 | sudo tee multicast_snooping

Once you do this, the pesky IGMP queries will go away. You can make this permanent (in Ubuntu, anyway) by adding these lines to a script under /etc/network/if-up.d/.

This page was helpful in solving this problem, as it provides documentation about the sysfs features of the bridge module.

*Yes, I know this is not a real Ethernet tap, but with the equipment, budget, and schedule I have (as well as my desire to run at 1Gbps, rather than 100Mbps) this is the best I can do.


Sat 23 Apr

File reading performance in Python

There are a few ways to read a file in Python, some of which are outlined in this page about their relative performance. I am working on a project right now that involves reading large amounts of data from text files, so I repeated the analysis on Python 2.6.6, the version currently shipping with Ubuntu 10.10. I ran three implementations (below) against a file with 1 million lines.

My test script is available here, and the functions I tested are below. Here were my results:

ScriptTime (sec)Lines read per sec
fileread1:0.16955,899,280 lines/sec
fileread2:1.6387610,236 lines/sec
fileread3:0.12787,823,156 lines/sec
def fileread1():
    file = open("test.txt")
    while 1:
        line = file.readlines()
        if not line:
            break
        pass
    file.close()

def fileread2():
    for l in fileinput.input("test.txt"):
        pass

def fileread3():
    file = open("test.txt")
    for l in file:
        pass

Wed 9 Feb

The right way to ask a developer to help you with your startup

I just got a message from a friend I hadn't heard from in a while. We were catching up when he mentioned a startup idea he had been thinking about. My first thought: "Oh no! Please don't pull the '... and I just need a coder to do it!' bit on me!".

Anyone who did an undergraduate degree in CS knows how it is to be bombarded by emails to the department listserv from business school students looking for just that - and you also know how dismal their success rate is in getting someone to help them.

But my friend, thankfully, didn't do this. Instead, he described his idea to me, talked about why he thought it was a good one, and then asked for my feedback. By doing this, he showed that he respected my opinion with regard to the business idea as a whole, had done some serious thinking about the problem space, and didn't have delusions of grandeur about the potential of his business.

At the end, he casually mentioned that he'd like my involvement in his project, and I didn't dismiss the idea out of hand like I usually would. On the contrary, if I didn't already have too much on my plate I probably would have offered to help him prototype the site. And while he didn't get someone to help him with his startup, he did (hopefully) get some helpful criticism that will improve his chances moving forward.

I think this is the right approach for trying to attract a technical co-founder. You're looking for a partner, not an employee. Treat them like one.


Sun 12 Dec

On making a minified Click Modular Router driver for OpenWRT

My group is using the Click Modular Router for a project we're doing. We've written several custom elements for our configuration, and we're attempting to run it on space-constrained devices, Ubiquiti NanoStation M5's that have only 4MB of ROM. Thus, we need to build a minified version of Click that includes only the elements we actually use. You can do this by specifying a series of elements to to the click-mkminidriver in the form "-E -E ... ". To extract the elements we're actually using in our Click configuration files, we can use this bash script from our configurations directory:

cat *.click | tr ' ' '\n' | tr '(' '\n' | egrep "^[A-Z]" | grep "[a-z]$" | sort | uniq | sed "s/^/ -E /g "

Note that this assumes that all your Click elements begin with an upper-case letter. Fortunately, it's simple to remove false positives.

← Previous Next → Page 2 of 10