in TF2 is the bane of my existence. Four people sharing an internet connection can be pretty annoying. My router has no traffic shaping or QoS options, so one person visiting a website can cause latency spikes, and it just goes downhill if they upload a photograph or visit youtube.
I would like a router with QoS (ideally the Tomato firmware) but I can’t justify the expense right now (maybe when I start work), especially as I currently have a modem-router so I might also need to buy a modem as well as the router. Failing that, using a machine as a gateway would give me this kind of control, but I don’t have one. Instead I hacked together a software solution which is as effective as it is ugly.
The general approach is my computer runs a script which checks for any game instances and if it finds any, it sends a message out on the network saying “everyone limit your rates please”. Therefore each computer needs to implement a listening server which somehow toggles the rate limiting when it’s told to. The server is very easy, you can hack this together in Python in about ten minutes. The rate limiting is more difficult.
There are two computers running Windows XP I need to worry about and one running Linux. The Linux one is easy, although I haven’t implemented it yet. I can use iptables to reroute packets through a local rate limiting proxy (Squid) and I can toggle the rule on and off as need be. Write daemon in Python, stick script in /etc/init.d/, enable it with rcconf or whatever. Simples. Linux is truly the operating system of the gods. [edit: actually I used a program called Wondershaper to limit the interface’s rate, not Squid/iptables.]
The Windows situation is much harder. Using a local Squid proxy for the browser works, and Squid can be reconfigured without restarting, but Flash ignores the proxy settings so any Youtube/BBC videos are going to get straight past it and my TF2 is going to say WELCOME TO TWO SECONDS AGO. Maybe there are ways to manipulate the Windows firewall to reroute the packets like in Linux but Windows just seems to fight against you every step of the way. Windows is not the operating system of the gods. Preschool age children maybe, gods no.
It’s not an ideal solution because NetLimiter is fairly ugly; the API looks flaky and amateurish, and it only works on version 2 while the most recent release is 3. And version 2 won’t work on Windows 7.
I also had to use a third party program (hstart.exe) to get the Python server to start quietly at login, otherwise Windows kept insisting on attaching a cmd.exe window to it, even if I used ‘start /B’. Writing it as a proper Windows service would have been better, but more complicated.
On the other hand, it’s better to have an ugly solution that works than a clean solution that doesn’t. Right?
ALSO WTF: MY ROUTER HAS NO BROADCAST ADDRESS. whaaaaaaaaaaaaat.