Getting crappy download speeds? Time to edit your MTU and
MRU
Thats great Sensei, but, uh what is MTU or MRU? Where and how do I do edit
them?
MTU:
Short for Maximum Transmission Unit, the largest physical packet size,
measured in bytes, that a network can transmit. Any messages larger than
the MTU are divided into smaller packets before being sent.
--the key is to is decide how big your bandwidth pipe is and select the
best MTU for your configuration.
For instance: I have a 33.6 modem (yeh I know its sad). I use a MTU and
MRU of 576. If you have a larger pipe you may want to try 1500.
MSS: (I think this is the same as MRU-maximum receiveable unit?)
Maximum Segment Size - The maximum size of the data that is contained
inside of each IP packet. Using a size too small will slow down data
transfers, while using a size too big will cause data "fragmenting". Also,
too big a size makes error recovery take quite a bit longer on noisy
telephone connections.
To edit your file:
su -
cd /etc/ppp
(use your favorite editor)
pico options
mtu 576
mru 512
Note:
Added by: James Cleverdon
This is what you should add to your options file. Save the file and you
are now finished.
For scads more options and tweaks (including some scary ones), take a
look at the sample options file that comes with the ppp docs:
/usr/doc/ppp-2.3.10/sample/options
(Where 2.3.10 is the current version. Your version number may vary.)
You can simply do:
cp /usr/doc/ppp-2.3.10/sample/options /etc/ppp/options
pico /etc/ppp/options
And hack to your heart's content.
While there are comments above each option, the pppd man page [man pppd]
also sheds a bit of light on some of the more arcane ones.
Note
Added By:
David K.
The MRU is the size of the largest packet you'll accept. Basically it
tells the PPP server to break packets up into smaller chunks until they're
no larger than the MRU. A larger MRU means you'll accept larger packets,
and with a larger packet there's a larger chance of a transmission error
which means it has to retransmit the WHOLE packet. MRU should never go
below 250, however, since then the packet overhead starts to catch up.
Basically, your best bet is to try random values between, say, 250 and
1500 until you find one which works well. (1500 is the default, and is
definitely too big for PPP.)
One thing you can do to gauge a good MRU is to connect with your MRU set
to 1500 and then use ping -s. Basically, do something like:
ping -s 456 -c 100 pick.server.com | tail -1
to see the packet loss when your packets are 456-big (this will take about
a minute and a half), and repeat that for a whole bunch of different
values until you find a reasonably-large one with a small amount of packet
loss.
Unfortunately, you can't change the MRU at runtime, since that's setup
when you first connect.
The MTU is exactly like the MRU except it affects outgoing connections
instead. So you can probably gauge a decent MRU by fiddling with the MTU,
uploading a file, and then comparing its thoroughput with a different MTU.
Of course, your uploads are only at 33.6Kbit instead of 56, so it'll only
be an approximate value.
You can change your MTU at runtime though; as root, do:
ifconfig ppp0 mtu (value)
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.
|