Detect MTU size when using Jumbo Frames
Recently I’ve setup an iSCSI target based on RHEL6 + tgt. After adding Logical Volumes to a target in the tgtd config file, the iSCSI target was discoverable and ready for use.
After testing this setup for a few days I wanted to tune the network traffic by enabeling Jumbo Frames. If you search on the interwebz you’ll most likely find information about adding “MTU=9000” ( for RHEL based clones) to the config file of the network interface.
The problem with Jumbo Frames is that when setting the mtu to high, you get fragmentation. Changing your mtu to 9000 will probably lead to fragmentation. If you don’t know this it can be quite hard to troubleshoot because you can still use ssh, ping the target etc.. but the iSCSI targets will keep failing.
You can easily check this with good old ping. Running this:
ping -M do -s 9000 <target_ip>
- -M : MTU discovery strategy. “do” means “prohibit fragmentation”
- -s : here you can specify the packet size
Gave me the following result :
From 10.0.0.13 icmp_seq=1 Frag needed and DF set (mtu = 9000)
Lower the packet size until you get a normal ping reply. This is the value you can use as your mtu size in your network card’s config file.
ping -M do -s 8900 <target_ip>