How to avoid fragmentation
Hi all!!
I'm developing a new target extension and I need to add some extra data and headers in TCP/UDP packets. But I'm having a problem: fragmentation. In the header developed by me I add a new checksum field to verify the integrity of that header. This works fine while there is no fragmentation. If the packet is fragmented I can't recalculate that checksum.
Does someone know how to correct or avoid this? Or have experience with fragmentation?
Thanks a lot!
Quoted 9 lines · Gervasio Bernal
I'm developing a new target extension and I need to add some extra data and headers in TCP/UDP packets. But I'm having a problem: fragmentation. In the header developed by me I add a new checksum field to verify the integrity of that header. This works fine while there is no fragmentation. If the packet is fragmented I can't recalculate that checksum.
Does someone know how to correct or avoid this? Or have experience with fragmentation?
Hm, still missing some information. You mean that you can't recalculate the checksum because the checksum part is missing, don't you? Use skb_header_pointer(...) to work with the headers, it's fragment-aware.
--
Pablo
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi,
Quoted 16 lines · Gervasio Bernal
I will show you an example:
+---------------+ | IP | | header | |---------------| | TCP | | header | |---------------| | My header | |---------------| | | | USER DATA | | | +---------------+
Quoted 6 lines
I calculte the USER DATA checksum and put it in a field of My header. If the packet is larger than MTU, it will be fragmented and the checksum calculated in My header will be incorrect when I recieve it in the other endpoint of the communication.
There is some form to avoid the fragmentation?
In this case, have a look at skb_checksum()
Signature · 1 line
Pablo