I'm wrting a UDP client and UDP server.
I have some large UDP payload, which is between 2000-3000. I tried some simple tests. I let the UDP client send 2000 bytes in a datagram, and used tcpdump
to capture packets. I notice there is only 1 outgoing packet and it is not parsed to UDP packet, but a IP packet of 1514 bytes, this means there are about 500 bytes lost.
Is it possible to put all the payload in the same UDP packet(it will take some effort to split the payload into 2 parts and then assemble them on the receving application layer), and let IP stack the fragment each UDP packets into several IP fragments. And on the server side, the IP stack assemble the IP fragments and handle them to the UDP server.
If it is possible, how to enable IP fragmentation?