Score:0

IP fragments are not reassembled due to packet loss in Linux

tl flag

I have been working with a device that sends heavy TCP/IP traffic.

I'm trying to capture those packets in my Linux machine (Ubuntu 22.04.2 LTS) with Python programming language.

But, most of the time the sent packets are not received correctly from the OS.

I can see some of those packets are correctly re-assembled by the OS but not most of them.

I can clearly see the from Wireshark.

Below are the unexpected behaviors:

https://i.stack.imgur.com/CIjhJ.png

https://i.stack.imgur.com/YP949.png

I am mostly seeing fragmented IP protocol packets and after those, I am seeing time-to-live exceeded (fragment reassembly time exceeded).

Below is the expected behavior:

https://i.stack.imgur.com/Tbwb0.png

Is there a way to correct this behavior (relax the conditions that result unable to reassemble the packets) to capture all the packets?

I am never seeing this issue in Windows 10.

On the same client machine, when log out of Ubuntu and log in to Win10, I can't see dropped packets and all the transmitted chunks reassmbled and sent to corresponding port. Seems like, there are some system parameters on Linux that affects packet dropping.

I attached a Wireshark capture file below:

https://drive.google.com/file/d/1GFtlHnKF619HE02JfuSUQpIGqSxRt6Yf/view?usp=sharing

Here is the output of sudo sysctl -a | grep ipfrag

net.ipv4.ipfrag_high_thresh = 4194304
net.ipv4.ipfrag_low_thresh = 3145728
net.ipv4.ipfrag_max_dist = 64
net.ipv4.ipfrag_secret_interval = 0
net.ipv4.ipfrag_time = 30

I tried doing the following too (10 times of above settings):

sudo sysctl -w net.ipv4.ipfrag_time=300
sudo sysctl -w net.ipv4.ipfrag_high_thresh=41943040
sudo sysctl -w net.ipv4.ipfrag_low_thresh=31457280
sudo sysctl -w net.ipv4.ipfrag_max_dist=640

Still no luck.

Thanks.

A.B avatar
cl flag
A.B
Cross-posted: https://unix.stackexchange.com/questions/740362/ip-fragments-are-not-reassembled-due-to-packet-loss-in-linux and there https://networkengineering.stackexchange.com/questions/82711/udp-fragmented-packets-not-reassembled . You should not cross-post, as explained there: https://meta.stackexchange.com/questions/64068/is-cross-posting-a-question-on-multiple-stack-exchange-sites-permitted-if-the-qu/64069#64069
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.