google / gopacket

Provides packet processing capabilities for Go
BSD 3-Clause "New" or "Revised" License
6.29k stars 1.12k forks source link

PF_RING Package Dropped #1072

Open frkn4129 opened 1 year ago

frkn4129 commented 1 year ago

am receiving 5 Gigabit network traffic and I would like to process this traffic without data loss. I have tried to process this data with pf_ring in the Go programming language. I have processed the network traffic with Go pf_ring on the nic card. While processing the data I also captured the traffic with tcpdump. Afterwhile I compared the differences between pf_ring and tcpdump. There were missing data at pf_ring pcap. So I have made some tests and I saw that while processing the network traffic with pf_ring, on average %70 data losses occuring. When I stopped the process at pf_ring data loss dropped to %0. Processing the network traffic even printing causes data loss. I think this problem occurs due to the pf_ring ring buffer size. How can I increase the ring buffer size? If the cause is different how can I prevent the data loss?

Case 1 0 drop image image

Case 2 A lot of drop packages image

singchia commented 1 year ago

When I stopped the process at pf_ring data loss dropped to %0.

you should pprof your code to see the performance issue especially at goParser.GetPacketInfo