Page 1 of 1

UDP Fragmentation problem

Posted: Mon Jul 20, 2015 9:20 am
by kemosparc
Hi,

I have a problem with UDP fragmentation.

My OS supports UDP and it can assemble fragmented packets.

My problem is with sending fragmented packets.

When a send a large packet of 4000 bytes from a client running on Linus, the packet is sent fragmented.My OS can reassemble the packet successfully.

The problem is that when I try to send the packet back and fragment it to be sent over the network in fragments the packet does not go through.

Basically packets appear correctly on the wireshark that is on the same machine that has my OS VM, but it seems that the packets do not travel over the network.

I have started 2 wiresharks on each side and here are screenshots from both.

Also when I decrease the packet size and send the packets without fragmentation the two way communication works fine.

I don't know also why on the wireshark running on the OS side it shows duplicate packets.

One question that I need clarification on is about the checksum. In case of fragmentation, does the checksum represent the whole stream or only the first packet?

Kindly let me know if you can advise for any prospect problems that might cause that.


Thanks
Karim.

Re: UDP Fragmentation problem

Posted: Mon Jul 20, 2015 10:41 am
by hidnplayr
To be clear, fragmentation happens on the IP level, not UDP level.
It seems the receiver is expecting more data.
Perhaps the 'Last Fragment' bit is not set in the last fragment?

Better post the wireshark dump if you need more help.

Re: UDP Fragmentation problem

Posted: Mon Jul 20, 2015 11:05 am
by SpyderTL
To answer your question, the UDP packet header checksum is not affected by fragmentation at all.

The IP header doesn't have a checksum field, only a fragment offset, and a last fragment flag.

The Ethernet header also does not have a checksum field, at least from the OS's point of view. (I believe you can request a checksum field, if you want, though.)

Someone correct me if I'm wrong.

Re: UDP Fragmentation problem

Posted: Mon Jul 20, 2015 12:56 pm
by hidnplayr
SpyderTL: The IP header does have a checksum field, but it is calculated only for the header bytes.
Ethernet does have a checksum, but it's calculated and checked by the network card.