-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pyshark Live Capture Fall Behind Tshark on High Traffic Load #375
Comments
still no comments on this? |
You ever figure out what was going wrong with this? |
I still dont have a precise answer for this. I ended up with using tshark process instead. But I guess the problem is because of the buffering. Since pyshark reads the packets from the stdout of tshark process, in heavy load, the buffer replaces the old packets that are not read by pyshark with the new ones. But this is just a guess. Since the gap is huge, I preferred using tshark process with subprocess module as live capture, then reading the pcap with pyshark file capture. |
I know this issue is old, but I independently found out the same thing as @irfancnk today after searching for the cause of packet loss for ages, stdout is not optimal for this. |
Just use tshark, then read it with pyshark 👍🏻 |
Sure, would be cool to remove the overhead of saving and analyzing the pcap file for my usecase but at some point you'll need to pick this tradeoff anyways :) |
I tried starting two different tshark process with the following python script.
After executing the script I opened 10 different youtube videos from browser. After waiting around 30 seconds. I cut the program flow with CTRL+C. I saw that the last packet count captured by the pyshark is 6672 however, the number of packets in the tshark pcapng file is 63916. There is a huge gap between the two. I wonder the what is this originated from? Am I doing/understanding something wrong? Any idea is appreciated
The text was updated successfully, but these errors were encountered: