Linux networking slower than Windows
That title almost made you feel uncomfortable, didn’t it? But before you go away going all maniac on slashdot ranting about Microsoft please give me a chance to explain.
First, some history. My personal router c.q. firewall, panzertux, just went over it’s uptime counter. Yes, it runs Linux 2.4.x. The IPCop install was kinda ancient so I guessed this was a good moment to feed it it’s updates. I had to do a complete reinstall because of kernel incompatibility problems. But hey, it’s worth it. IPCop is a great firewall distro. After grabbing the latest ISO from sf.net and rebuilding my system the problems started.
Every time some app tried to make a connection through the router to the internet it paused for 10 seconds or so. After that the connection was established and everything was fine until another connection had to be made. Another 10 second pause. When browsing the web like me, you know, several browser screens filled with updating tabs, rss feeds, mail and server logs pouring in, a 10 second pause every time becomes quite an annoyance. What could this be? The first thing that came to my mind was DNS. I quicky checked all the DNS hops and my DNS proxy. All seemed to run fine. Querying the DNS servers using host(1) was as fast as it used to be. So it wasn’t DNS. And now the scary bit. I booted Windows XP to play my newly acquired game. I’m a bit of a cheater so I grabbed some cheats from the net. It was only during the game that I realised. Oh damn, did I just visit a site without that damn 10 second penalty? I turned to one of the running Linux boxes and tried to visit the same cheat site. The pause was still there. What is this? Why is that damn binary blob from Redmond faster on my 100% Linux powered network? This means war. This can’t be.
So there I was, broken beyond repair. The damn people at school were right. Windows is the better networking OS. After letting my forehead meet the door several times during high velocity impact I woke up. I had to get to the bottom of this. First, the thing that started it all. Panzertux. I had to rule that out. So I plugged my Linux laptop directly into my DSL modem. This is a great piece of equipment by the way, Linksys AG241V2, Linux powered, never let me down. Well, until now. I still had to wait 10 odd seconds before any connection was established. So it is my OS? Or is my modem just broken? Is Windows doing something wrong that actually is unintentionally something right on this network? I had made a new friend a while ago, so I went to NetBSD for help. It didn’t have problems what so ever. Could this be true? Maybe it’s my distro. All my workstation machines run Debian GNU/Linux sid. It’s known to break sometimes. Luckily I had an Ubuntu laptop ready for testing. It had the same problem. 10 seconds. I didn’t know what to do anymore. Did all my Linux boxes start to hate me? Would NetBSD be my only friend after this war? I noticed it was 4 AM. I had to get some sleep. Even the caffeine overdose wouldn’t help anymore.
The next morning, just when I thought it couldn’t get any worse. Guess what. It did! My network died! Somewhere during the night some part of my network decided it was time to quit. Panzertux was still up and running happily generating log files. All of my switches were alive and kicking. But I just couldn’t get on the interweb thingy. I told panzertux to reconnect to the interweb. Panzertux said he couldn’t. My modem died. So it was my modem all along? I patched it up, gave it new firmware and even got rid of the dust that it was collecting. I hooked up my Linux laptop directly again to test the modem. Damn, still the same problem. But why did it die? I was toying around a bit and to show off I switched to another tty, text mode only. When I logged into my modem using w3m some errors popped by about some RFC. They went away too fast for me to read them. While I was looking in the man page for a debug switch one flag stood out, “-4″. IPv4 only mode. I gave that mode a try, and wow, no time penalty! So maybe it’s IPv6 that keeps bugging me?
So I recompiled my kernel. Yeah, I do that some times when I’m feeling happy. No, really. I had built-in support for IPv6 but never connected to a single IPv6 router. Guess what, I’ve got one. IPCop talks both IPv4 and IPv6 now. So it routed all my IPv6 requests into an IPv4 network called the interweb. Well, at my ISP it is. This explains the pause. It’s needed by the OS to switch back to IPv4 after failing to connect using IPv6. But this still didn’t explain my entire network getting disconnected from the interweb. Maybe my modem doesn’t like IPv6? So, I wrote a quick bash script to utilise that other neat w3m flag. “-6″. IPv6 only. It started a thousand w3m browsers trying to connect to my modem using IPv6. Hey, a thousand w3m browsers still don’t use as much memory as one Firefox! Ok, the experiment succeeded. The modem died it’s painful death a second time. Poor thing. To save what’s left of that poor blue box I recompiled all my Debian kernels to block out IPv6. I blacklisted the ipv6 module on all the other boxes.
So, to summarise: When your DNS is acting normally, Windows is acting normally and even your mother in law is acting normally and your Linux box has problems connecting to servers, blame IPv6. Also blame that nasty stain on your wall, I know it’s there! You know, if my ISP would just give me a proper IPv6 enabled internet connection all of this wouldn’t have happened and my forehead wouldn’t hurt as much right now.
XS4ALL does have IPv6 suppport, but my modemrouter doesn’t support it.
I’m stuck with Orange. Aside from the lack of IPv6 they seem to do a good job.