Author Archives: Dan Siemon

Measuring one way packet loss

I’ve recently observed packet loss on my home Internet connection and suspected that this was occurring on the downstream path. Unfortunately, ping, the tool normally used to measure packet loss doesn’t tell you anything about where the packet was lost – just that either the request to the destination or the reply from the destination was lost.

After a quick bit of Googling I couldn’t find a tool which measured one way packet loss so I fell back to combining a couple of tools. Hopefully the technique outlined here will be useful to others.

Note that the steps below require that you have control of both of the hosts you wish to measure packet loss between. It’s very easy and cheap to get a virtual machine on Amazon EC2 or other services so this shouldn’t be a huge barrier.

To measure packet loss on the path from host A to host B run the following commands.

Host B

tcpdump -nni ppp0 udp port 8787 > tmp.file

Host A

hping3 -i u100000 --destport 8787 -2 HOSTB

Let some time elapse and then press CTRL-C to stop hping3.

Host B

Press CTRL-C to stop tcpdump

cat tmp.file | egrep 8787 | wc -l

Now compare the number of UDP packets transmitted by hping3 to the number of packets captured by tcpdump (output of wc -l). If there is any difference there is packet loss from A to B.

Masada

On my last trip to Israel I finally made it to Masada. We hiked the ~1000ft up the mountain and while we were on the top fighter jets patrolling the border flew below us. Recommended if you get the chance.

Version control in government

I’ve often wondered if version control would be a useful addition to democracy. Imagine being able to get a diff which showed which parliamentarian proposed a particular amendment to a bill or see the entire change history once a bill became law (the later is like a software release).

In the open source software world many people are driven to do excellent work at least in part because there is a public record for the world to see. Perhaps this same transparency and historical record would drive deeper thought and less willingness to propose bills and amendments on behalf of other people and organizations.

With a slightly different angle, Clay Shirky discusses the idea of version control as a tool for government in his recent TED talk. He even provides a basic background on version control which might be useful if if this whole post makes no sense to you.