Environment
Novell SUSE Linux Enterprise Server 11
Situation
Resolution
The Maximum Transmission Unit (MTU) of the loopback network interface (lo) on Linux is, by default, 16436 bytes and therefore the TCP Maximum Segment Size (MSS) of TCP connections over the loopback interface is 16396 bytes.
A trace of GroupWise mail transfer over a TCP/IP link shows the following pattern:
1) the mail sender sends a mail message chunk of 8KB (8192 bytes).
2) the mail receiver sends a protocol message of 36 bytes.
3) the mail sender returns a protocol message of 36 bytes.
4) the mail sender sends a next mail message chunk of 8KB.
5) the mail receiver sends again a protocol message of 36 bytes.
6) the mail sender sends again a protocol message of 36 bytes.
etc.
By default, Delayed Acknowledgment and the Nagle algorithm congestion avoidance methods are enabled with TCP/IP connections and hence also with GroupWise TCP/IP connections. The Nagle algorithm causes the sending TCP stack to not transmit a segment until the segment to be transmitted is full, or until it has received an acknowledgment from the receiving TCP stack in return to the previously-sent segment. Delayed Acknowledgment will cause a receiving TCP stack to not send an acknowledgment until it has received 2 full segments from the sending TCP stack, or until it can piggybag the acknowledgment with data to be transmitted on behalf of the local user (application), or until it can combine the acknowledgment with a window update, or until a certain amount of time has expired. With the (MSS) of 16396 bytes, 8192 bytes will not fill a full segment. Because of Nagle, the TCP stack at the host of the sending GroupWise Agent will not send the segment with the 8KB mail message chunk until it has received an acknowledgment from the TCP stack at the host of the receiving GroupWise Agent. At the same time, the receiving GroupWise Agent has nothing to send after it received the protocol message from the sending GroupWise Agent, so the TCP stack on the host of the receiving GroupWise Agent will not need to send an ACK until the Delayed Acknowledgment time out has expired or until it can send the ACKnowledgment with a Window update, which takes about 0,03 seconds each time. This phenomenon is also known as a Nagle Algorithm/Delayed Acknowledgment deadlock.
To make TCP transmit the segments with the mail message chunks immediately, regardless to Nagle, lower the MTU of the loopback interface to 8244 byes so that an application message of 8KB will fill a complete TCP segment, which then becomes ready for immediate transmission. Change the MTU of lo temporarily with the following command:
sudo /sbin/ifconfig lo mtu 8244
or set it permanently in /etc/sysconfig/network/ifcfg-lo. The parameter needing to be appended to this file is:
MTU='8244'
Once modified run the following command to restart the network service and put the changed MTU into effect:
sudo /etc/init.d/network restart