UDP packet greater than 1500 bytes dropped?

I fail to see the problem. You are setting the "don't fragment" bit, and you send a package smaller than the sending host's MTU, but larger than the receiving host's MTU. Of course nobody will fragment here (doing so would violate the DF bit).

Instead, the sending host should get an ICMP message back.

I fail to see the problem. You are setting the "don't fragment" bit, and you send a package smaller than the sending host's MTU, but larger than the receiving host's MTU. Of course nobody will fragment here (doing so would violate the DF bit).

Instead, the sending host should get an ICMP message back. Edit: IP specifies that an ICMP error message type 3 (destination unreachable) code 4 (Fragmentation Required but DF Bit Is Set) is sent to the originating host at the point where the fragmentation would have occurred. The TCP layer handles this on its own for PMTU discovery.

On connection-less sockets, Linux reports the error in the socket's error queue if the IP_RECVERR option is activated; see ip(7).

ICMP type 3 code 4 means "Fragmentation required, and DF flag set". How you listen for that message on linux I'm not sure. I believe that the ICMP payload contains enough information to match it to a particular socket, in which case you might get it as OOB data, if you've enabled that.

Or a future sendto() call may fail with ECONNRESET. – Ben Voigt Jan 2 at 19:19 @Konerak: see my edit. – Martin v.

Löwis Jan 2 at 19:19 Thanks for the reply. So I should set the IP_RECVERR flag and then search the error queue, right? I have simply tried to verify if sendto gives me an error, in which case I control if the error is "Message too long" and so reduce the datagram size.

From what you say the thing doesn't work this way, right? – Alex Vitale Jan 3 at 11:14 @Alex: No, this doesn't work. When the UDP package is sent, the kernel doesn't know that the receiver won't be able to receive it.

Since you normally don't get a response in UDP in case of successful transmission, the send call returns immediately (or after only local error checking, such as missing network connectivity). I haven't tried IP_RECVERR, but yes, I think this is how it should work. – Martin v.

Löwis Jan 3 at 17:22 1 No ICMP error message will be recieved if these two hosts are on the same subnet, because the IP layer on the recieving host with the smaller MTU never even saw the packet - it was discarded at a lower layer for being too large. It is simply incorrect to have two hosts with different MTUs configured on the same subnet. – caf Jan 4 at 2:33.

That "DF bit" you're setting, stands for "Don't Fragment". The IP layer should not be expected to fragment packets when you've told it not to.

Yes it is the Don't Fragment flag. – Alex Vitale Jan 3 at 11:13.

It is not correct to run hosts with different interface MTUs on the same subnet1. This is a host/network misconfiguration, and IP path MTU discovery is not expected to work correctly in this situation. If you wish to test your application's path MTU discovery, you will need to set up multiple subnets connected by a router2, with different MTUs.In this situation, the router is the device that will pick up the MTU mismatch, and send back an ICMP "Fragmentation Needed" error.

1. Well, technically, same broadcast domain.2. The devices sold as "home routers" are really router/switches - they route between the WAN and the LAN, but switch between the ethernet ports on the LAN.

This isn't sufficient to separate networks with different MTUs.

Thanks for the reply. So the "Fragmentation Needed" thing is relative to the IP layer. I should use a router or a layer 3 switch for the thing to work.

I didn't know that home routers are dsl routers + layer 2 switches, I thought they would be able to work as layer 3 switches for the lan. – Alex Vitale Jan 4 at 13:29 @Alex Vitale: Yes, that's right. You can configure a machine with two NICs as a router for testing purposes.

– caf Jan 4 at 13:46.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions