8

I configured the MTU size to 1000 with ip link set eth0 mtu 1000 on link eth0. I disabled Generic receiving offloading (gro) with ethtool -K gro off (since this can lead to "false" frame length in tcpdump (see here)) But if I capture now with tcpdump I still get packets which are larger than 1000, e.g. 1500 bytes.

What I am doing wrong ?

On the receiving side with MTU set to 1000:

eth0: mtu 1000

14:27:38.361168 IP XXXXXX > YYYYYY: ICMP echo > request, id 3273, seq 1, length 1480 14:27:38.361495 IP YYYYYY > XXXXXX: ICMP echo reply, id 3273, seq 1, length 976

der_wolle
  • 183
  • 1
  • 5

1 Answers1

7

MTU is the maximum packet size that can be sent through an interface. MTU doesn't limit the maximum packet size that can be received.

RFC 1191 says:

... When one IP host has a large amount of data to send to another host, the data is transmitted as a series of IP datagrams. It is usually preferable that these datagrams be of the largest size that does not require fragmentation anywhere along the path from the source to the destination. (For the case against fragmentation, see [5].) This datagram size is referred to as the Path MTU (PMTU), and it is equal to the minimum of the MTUs of each hop in the path. A shortcoming of the current Internet protocol suite is the lack of a standard mechanism for a host to discover the PMTU of an arbitrary path.

      Note: The Path MTU is what in [1] is called the "Effective MTU
      for sending" (EMTU_S).  A PMTU is associated with a path,
      which is a particular combination of IP source and destination
      address and perhaps a Type-of-service (TOS)...
Ra_
  • 677
  • 4
  • 9
  • I read that both sides should have the same MTU. But if the MTU is only the maximum sending size, the MTU's of both can be different ? Additional, can I configure the maximum receiving unit size in my Linux ? – der_wolle Jan 15 '16 at 08:29
  • Further I ask myself how could I then discover which size the other connection side can receive ? I mean MTU is for sending. Can I determine the Maximum receiving unit size of my counterpart? – der_wolle Jan 15 '16 at 09:02
  • As MTU affects only outgoing packets, in general it could be different at both sides. In my opinion, in this case each side will use is own MTU for sending packets, but I'm not 100% sure if both sides will use the smaller MTU instead. MRU is dinamically set after negotiation, I think it couldn´t be manually set. – Ra_ Jan 15 '16 at 13:30
  • @der_wolle There isn't any way for the receiver to communicate to the sender what the MRU is. If the MRU of an interface was less than the MTU of any other interface on the segment, you could be losing packets. It would be possible for a device to receive all packets regardless of size and respond with a "Too Big" response if it was larger than you wanted. But it would be mostly pointless to receive the packet and then reject it. For TCP you can control the sizes end-to-end through the MSS option, which by default is derived from the MTU of the endpoint. – kasperd Sep 21 '18 at 16:06