Wednesday, December 9, 2009

Sympatico.ca and MTUs on Linux

Ok, I learned something today. Bell Sympatico can not handle a MTU higher than 1460. I had the default 1492 in my router and I experienced a strange slowness on certain pages. Not all pages, I particularly noticed it with mail.yahoo.com and my Pidgen would take a long time to connect. It was really quite frustrating. Also, I couldn’t maintain a ssh connection, it would mysteriously disconnect- same with SVN.

After consulting with a networking expert (thanks Andrew) he recommended I check into MTU (Maximum Transmittion Unit). So, I used the ping -s option in GNU/Linux and discovered that 1460 was the largest MTU that didn’t result in truncation of the packet.

This isn’t documented by Bell (as far as I could find) anywhere.

For example:

$ ping -s 1492 www.google.com
PING www.l.google.com (72.14.205.99) 1492(1520) bytes of data.
1440 bytes from qb-in-f99.google.com (72.14.205.99): icmp_seq=1 ttl=244 (truncated)
1440 bytes from qb-in-f99.google.com (72.14.205.99): icmp_seq=2 ttl=244 (truncated)
1440 bytes from qb-in-f99.google.com (72.14.205.99): icmp_seq=3 ttl=244 (truncated)
1440 bytes from qb-in-f99.google.com (72.14.205.99): icmp_seq=4 ttl=244 (truncated)
1440 bytes from qb-in-f99.google.com (72.14.205.99): icmp_seq=5 ttl=244 (truncated)
1440 bytes from qb-in-f99.google.com (72.14.205.99): icmp_seq=6 ttl=244 (truncated)
1440 bytes from qb-in-f99.google.com (72.14.205.99): icmp_seq=7 ttl=244 (truncated)
^C
www.l.google.com ping statistics —
7 packets transmitted, 7 received, 0% packet loss, time 6008ms
rtt min/avg/max/mdev = 30.934/31.625/32.008/0.429 ms

while if I enter:

$ ping -s 1432 www.google.com
PING www.l.google.com (72.14.205.104) 1432(1460) bytes of data.
1440 bytes from qb-in-f104.google.com (72.14.205.104): icmp_seq=1 ttl=244 time=31.1 ms
1440 bytes from qb-in-f104.google.com (72.14.205.104): icmp_seq=2 ttl=244 time=31.6 ms
1440 bytes from qb-in-f104.google.com (72.14.205.104): icmp_seq=3 ttl=244 time=31.7 ms
1440 bytes from qb-in-f104.google.com (72.14.205.104): icmp_seq=4 ttl=244 time=31.4 ms
1440 bytes from qb-in-f104.google.com (72.14.205.104): icmp_seq=5 ttl=244 time=32.0 ms
1440 bytes from qb-in-f104.google.com (72.14.205.104): icmp_seq=6 ttl=244 time=31.2 ms
^C
www.l.google.com ping statistics —
6 packets transmitted, 6 received, 0% packet loss, time 5005ms
rtt min/avg/max/mdev = 31.168/31.560/32.096/0.371 ms

Note: ping has a header overhead, so although I entered 1432, the actual packet size is 1460 as noted (emphasized).

Strangely, Windows seems to automatically adjust this because the Windows computers on the network (with MTU 1500) seemed to work fine. It was just my Linux box that was slow. This led me down a rabbit hole of thinking the problem was hw or sw related. In the end, simply by changing my routers pppoe MTU to 1460 and magically everything worked great.

No comments:

Post a Comment