9

I'm exploring/benchmarking various IPC mechanisms for low latency communication between two processes in the same system. I'm using RHEL 6 system for benchmarking.

I'm currently looking into socket based communication through loopback. Since it is the loopback device, the packets do not even hit the NIC. Instead, the loopback linux driver loopbacks the packets to the destination.

However looking into the results of netstat -i, I see an MTU defined for the loopback. What's the role of this and the potential impact on bandwidth?

Name  Mtu   Network       Address            Ipkts Ierrs    Opkts Oerrs  Coll
lo0   16384 localhost   ::1                   1738     -     1738     -     -

1 Answer 1

11

loopback isn't a physical interface, but still the tcp/ip stack runs a lot of operations on it.

To increase performances on local transfers, kernel developers bumped its mtu from 16 Kb to 64 Kb.

See this commit in the Linux kernel and its rationale:

loopback current mtu of 16436 bytes allows no more than 3 MSS TCP segments per frame, or 48 Kbytes. Changing mtu to 64K allows TCP stack to build large frames and significantly reduces stack overhead.

Performance boost on bulk TCP transferts can be up to 30 %, partly because we now have one ACK message for two 64KB segments, and a lower probability of hitting /proc/sys/net/ipv4/tcp_reordering default limit.

--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
static void loopback_setup(struct net_device *dev)
{
-       dev->mtu                = (16 * 1024) + 20 + 20 + 12;
+       dev->mtu                = 64 * 1024;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.