Ubuntu,  Unix

Enable Jumbo Frames in Ubuntu Server 10

Jumbo frames can completely suck. But they can also boost network throughput performance. The MTU in networking terminologies is the Maximum Transmission Unit in bytes that protocol data can send over the wire. MTU is configured per interface and needs (er, prefers) the network infrastructure to match about the same MTU sizes. By default, eth0 (en0 in Mac OS X) is set to 1500. But increasing that to 9000 means that you’re sending less error correction and addressing data and more payload (but as usual the payload can get messy if all parties aren’t knowledgeable that they’re taking it).

Before you get started, install ethtool:

apt-get install ethtool

Then run ethtool with the -i operator along with the interface on your box that you plan on shoving jumbo frames into:

ethtool -i eth0

Now Google or browse to the manufacturers site and see what the maximum MTU that the interface can take is. Provided it can take your large payload, to enable a larger MTU on the fly is pretty easy. I’m using 9000 for the purposes of this article, but if you get an error like SIOCSIFMTU or something then your driver doesn’t support that, so go with something smaller (if >1500 is supported at all on said driver). Simply use ifconfig, specify the interface and then mtu followed by the actual MTU size:

ifconfig eth0 mtu 9000

To make the change permanent, add the following line to /etc/network/interfaces

MTU 9000

Then restart networking:

/etc/init.d/networking restart

And to check that it’s working, use ip to get the route information to a potential target device (output will show the MTU that is being attempted):

ip route get 10.0.0.96

Note: Redhat, Fedora and CentOS will store their config information per adapter (the way it should be IMHO) in files in the /etc/sysconfig/network-script/ directory.