Open icestrawberryxjw opened 6 years ago
i met the same problem as you...
yes, i got the same problem. i have resolve the problem by DPDK.
it lost packets when the speed of traffic was 200Mbps.
Just offering possibilities... Is it possible that your problem is not in gopacket
? Network interfaces have a fixed ring packet buffer that will overflow at a certain rate. TCP fixes this problem by simply re-transmitting lost packets, but a sniffer has no reason to do so. If this is your problem, you should rate-limit your traffic, or otherwise work around the packet drops at high speeds.
It's also possible that your CPU / scheduler simply cannot keep up... at any rate, packet sniffing on a host should be considered best-effort... sad, but true.
This one of many reasons that people can sell dedicated sniffer appliances for in-line capture off a network switch... and even those run into similar limitations, but the threshold for pain is higher in that case.
I'm writing a traffic sniffer and realtime-analyzer. Today I did a test on the performance of the part of writing packets. Results show that it lost packets when the speed of traffic was 200Mbps. I wonder that whether there exists problems in my codes.
Here are my codes: