UDP Fragmentation problem

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
kemosparc
Member
Member
Posts: 207
Joined: Tue Oct 29, 2013 1:13 pm

UDP Fragmentation problem

Post 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.
Attachments
Wireshark on the client side
Wireshark on the client side
Wireshark on the OS side
Wireshark on the OS side
hidnplayr
Posts: 23
Joined: Sat Aug 09, 2008 5:07 pm

Re: UDP Fragmentation problem

Post 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.
User avatar
SpyderTL
Member
Member
Posts: 1074
Joined: Sun Sep 19, 2010 10:05 pm

Re: UDP Fragmentation problem

Post 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.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
hidnplayr
Posts: 23
Joined: Sat Aug 09, 2008 5:07 pm

Re: UDP Fragmentation problem

Post 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.
Post Reply