Search This Blog

2013-07-10

Testing MTU

MTU (Maximum Transmission Unit) is the maximum effective size of a PDU (Protocol Data Unit) that can be transmitted onwards by a layer.

These configuration maximums may need to differ to accommodate different traffic types. They may need to be increased or decreased depending on whether you have configured VPN and require additional header area to transmit data as your WAN link may be configured for 1500 MTU and your VPN may require an extra 8 bytes of data to package your VPN frames. If this is the case you may need to decrease your MTU to 1492.

An easy way to test to test and validate your MTU sizes is by using a simple ping with the DF (do not fragment bit).

Windows:
The following will send a frame with a size of 1500 bytes (using -l) and will tell windows not to fragment the packet (-f do not fragment)
C:\Users\user>ping $hostname -l 1500 -f

Pinging $hostname [$ip_address] with 1500 bytes of data:
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.

Ping statistics for $ip_address:
    Packets: Sent = 3, Received = 0, Lost = 3 (100% loss),
Control-C
^C

Linux:
This will do the same as the windows command (-M do will tell Linux to not fragment) it only does one attempt to prevent spam (-c 1) and will send with a size of 1500 bytes (-s 1500)
# ping -s 1500 -M do $hostname -c 1
PING $hostname ($ip_address) 1500(1528) bytes of data.
From TPC-F3-05.phaedrus.sandvine.com ($ip_address) icmp_seq=1 Frag needed and DF set (mtu = 1500

--- $hostname ping statistics ---
0 packets transmitted, 0 received, +1 errors

FreeBSD:
FreeBSD ping with no fragment (-D) and a size of 1500 bytes (-s 1500)
sudo ping -D -s 1500 $hostname
PING $hosntmae ($ip_address): 1500 data bytes
ping: sendto: Message too long
ping: sendto: Message too long
ping: sendto: Message too long


Here's some commonly known and referenced MTU sizes
1500 The biggest-sized IP packet that can normally traverse the Internet without getting fragmented. Typical MTU for non-PPPoE, non-VPN connections. 
1492 The maximum MTU recommended for Internet PPPoE implementations. 
1472 The maximum ping data payload before fragmentation errors are received on non-PPPoE, non-VPN connections. 
1460 TCP Data size (MSS) when MTU is 1500 and not using PPPoE. 
 
1464 The maximum ping data payload before fragmentation errors are received when using a PPPoE-connected machine. 
1452 TCP Data size (MSS) when MTU is 1492 and using PPPoE. 
576 Typically recommended as the MTU for dial-up type applications, leaving 536 bytes of TCP data. 
48 The sum of IP, TCP and PPPoE headers. 
40 The sum of IP and TCP headers. 
28 The sum of IP and ICMP headers. 

http://en.wikipedia.org/wiki/Maximum_transmission_unit
http://www.dslreports.com/faq/695

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.