[bf1942] RFE: TOS bits in IP packets

Scratch Monkey ScratchMonkey at SewingWitch.com
Thu Feb 20 05:07:46 EST 2003


--On Wednesday, February 19, 2003 6:02 PM +0100 Malte Schröder
<TuX.Norad at gmx.de> wrote:

> but if i have a slow uplink i could use those bits for traffic-control
> on the server-box itself ...

Exactly.

I'm using the WonderShaper script (http://lartc.org/) which splits the
outbound NIC queue into 3 priority bands: high, normal, and "traffic we
hate". The high-priority band can use all available bandwidth, while the
others get a percentage. I put my web, FTP, and mail services in the
"traffic we hate" band so that people visiting the website and downloading
files won't lag out the game servers. (This is a setting in the
WonderShaper script.)

Without marking the packets with TOS bits, they just go in the middle band.
By marking them, they get bumped into the important band, which lets them
use all the bandwidth instead of a percentage.

I could also move them into the high-priority band using an extra filter in
the shaper script, or by adding an iptables mangle entry, but that adds a
step in packet processing to the kernel that could more efficiently be done
at the time the packet is created in the application.

Note that I'm running all my services on one host, but one could also
imagine splitting services across several hosts in a data center and
applying this shaping at the gateway to one's upstream provider.

I also use the WonderShaper on my NAT boxes at home and at the office to
prevent bulk transfers (eg. FTP) from lagging my fellow gamers and
interactive users. The advanced routing facilities in Linux make it an
excellent choice for a border router for a LAN with a lot of mixed traffic.



More information about the Bf1942 mailing list