Posts

The rules of multicast

Image
The first rule of multicast is you don't talk about multicast Most networks don't do multicast routing, which means most network guys don't have much experience with it. Sure they know that it exists, and it's probably used on their layer 2, but they don't do multicast routing. These "rules" list some things that you should know when configuring or troubleshooting multicast. The second rules of multicast is you do not forward packets coming from a non-RPF interface If a multicast packet is received, and it's not the multicast RPF interface, it's dropped. The table can be viewed with "show ip mroute", and it will clearly show what interface is acceptable. Here's an example of group 239.0.0.1: R1#show ip mroute 239.0.0.1 [...] (*, 239.0.0.1), 00:00:08/stopped, RP 1.0.0.1, flags: S Incoming interface: Null, RPF nbr 0.0.0.0 Outgoing interface list: FastEthernet1/0, Forward/S...

It's duplex mismatch

Image
Print it out and put it next to your monitor. It will help you troubleshoot network problems.

Redirecting to the closest site using Javascript

I'm sure this problem has been solved this way many times before, but I haven't seen it while idly browsing around sites about scalability and load balancing. So here it is, a Javascript solution to the closest-site problem . For static content optimizing for latency is easy and cheap. Just put your files in a CDN such as Amazon CloudFront and you're done. Low (lower) latency all over the world. Done. For dynamic content it's a bit harder. You can set up several data centers (sites) and try to redirect the user to their closest site. But how do you find out what site is the closest one, and how do you redirect the user to the right one? There are several solutions to this, such as using anycast BGP or source-aware DNS. But they have big drawbacks. DNS based solutions depend on the users resolver to be close to the user and that the ip2location database is correct. BGP-based solutions depend on you having access to BGP (and the staf...

10 years of maintaining an open source program

Arping 0.1 was released 10 years ago last month or so. It's since been included as a package in Debian GNU/Linux, Ubuntu, OpenBSD, FreeBSD and NetBSD, Gentoo and some other smaller and bigger OSs and distributions. It's interesting that not one of these asked or even let me know, which is kind of fun. I only noticed because I ego-googled. A couple of German magazines did ask before putting it on their CDs. I told them that it's GPL so they can do what they want, but thanked them for letting me know. Linux Journal could have told me though. Arping was rewritten for libnet 1.1 as Arping 2.x. I fixed the IRIX port of libnet 1.1 just so that I could get Arping to work on it. I get bug reports or feature requests every now and then. Most build errors are due to someone not having libnet and/or libpcap installed. The new version (2.09) checks for these dependencies and present a friendly error message in case they're missi...

Clipboard sniffer

Yes clipboard, not keyboard. I've made a clipboard sniffer for X called ClipSniff. It periodically saves whatever is in the clipboard (both the "PRIMARY" and the "CLIPBOARD") into a sqlite database. git clone http://github.com/ThomasHabets/clipsniff.git It wasn't that hard when you knew where to look. You just: Connect to the X server. XOpenDisplay() Create a window (you don't need to display it). XCreateSimpleWindow() Ask the X server who owns the PRIMARY and CLIPBOARD atoms, and ask that window to send you the data. XInternAtom() , XConvertSelection() Wait for the reply event. Loop of NextEvent() Helpful links when coding Xlib Minimal XGetWindowProperty Example Xlib Programming Manual (O'Reilly & Associates, Inc.) X Selections, Cut Buffers, and Kill Rings (jwz) X Windows Copy-Paste mini HOWTO (Stelios Xathakis)

Shaping and policing on Cisco

Image
This post is about policing and shaping on Cisco routers and switches. This is a very big topic so don't expect this post to cover everything. What I'm attempting to to is cover some things that I found aren't explained very well by books or the Internets, while still being readable for someone who hasn't read all the other stuff. With QoS stuff there are always small differences in practice between the hardware implementations but I won't go into that here. Buckets In both policers and shapers traffic that "conforms" is traffic that will be allowed through. It will be allowed to go out to the interface (or in to it, if configured for incoming traffic) if there are as many tokens in the Bc bucket as there are bytes in the packet. If there are enough tokens then those tokens are removed from the bucket and the packet is allowed through immediately. If there aren't enough tokens in the bucket then the packet is n...

Lightwave. Like Google Wave only much less

I felt sorry for all those who don't yet have a Google Wave account, and I was impressed with their demo. And I also wanted an Erlang project. So I killed three birds with one stone. I made Lightwave. It's like Google Wave only: Dumber Buggier Uglier More incomplete Written in Erlang Future plans include API for hooking in bots Only save data for last X time or entries Automatic on-disk persistence Links Lightwave on Github Lightwave "technology preview" :-)