[Winpcap-users] Occasional packet loss?
simonskj05 at yahoo.com
Mon Jul 16 11:32:20 PDT 2012
Hello everyone. I am
hoping someone may be able to offer some ideas or suggestions. Basically, I am seeing some occasional packet
loss on the RX side of the NIC and wanted to address it. Typically, I see the NIC not being able to
detect one packet out of 8,000,000 on average. Maybe this is normal with PC HW/SW limitations????
The packets I send are the same packet over and over
(identical). Let me do my best
explaining what I am seeing and the things I have tried so far.
I implemented the packet counters in a few ways. I see the issue all 3 ways.
1. 1. Using the code from tutorial 6 with no filter
2. Using the code from tutorial 6 with a filter
3. 3. Using pcap_stats function.
I like methods 1 and 2 above because I see what the data
rate is. Also allows me to filter.
I am generating traffic in multiple ways. All three
experience the issue.
1. 1. Having the NIC generate traffic and using
SmartBits to receive it. Also I am using
the above RX methods to detect packets being sent out.
2. 2. Routing cable from one NIC to another in the
same PC. So, one NIC sends data out and the other captures (counts) it.
3. 3. Using Data Generator Equipment like SmartBits to
generate and the PC recieves
I have connected an Analyzer (SmartBits) to the NIC on
method 1 above and I can see the data generation from the PC is always
correct. The number of packets being
sent out (what I am telling it to send) makes it to the SmartBits. Except I see the occasional packet loss on the
NIC (outbound). So, I would think/expect the wpcap software should detect the
number of outgoing packets correctly all the time??
On method 2, if I run the analyzer (stats) on both NIC’s,
they will mismatch as well. For example,
the second NIC (receiver) counts the right number of packets being sent from
the first NIC. But the first NIC misses
one. And vice versa too.
In the method 1 above, I tried both the buffer send method
and using the nwrite method. Same
I have tried to slow down the traffic. Say 400Mb/s vs 960Mb/s on a 1G NIC. Slowing it down helps slightly, but does not
If I change the timeout in the open command from 250 to
2000, not much changes. If I change it
to 5000, it helps. Of course, it is
slower to report. This is true for
tutorial 6 code. I am not sure about
pcap_stats. I still need to try it.
I tried the snaplen in the open command from 100 to 65000. I still see the issue.
I tried setting the buffer (pcap_setbuff) from 1,000,000 to
4,000,000 to 6,000,000. Still see the
I have tried numerous NICs (5 different ones).
I have tried two different machines. One is a Intel I7 3820 (Quad Core) and the
other is slower Intel Core 2 6700 (2.67MHZ) 2 GB RAM (Dual Core). They both behave the same.
I used a 10Gig NIC and similar results. It is easier to see the loss because I can
send more packets quicker. Versus on a
1G, it may take 2-3 minutes before I see it.
I tried modifying the PC buffers using a tool called “TCPOptimizer”. Maybe it slightly helps.
I created numerous programs: One in C++, one in C#, one
using threads, etc. and the issue is still there.
I think that’s it so far with my ideas. J Anyone have any suggestions? I know it is only 1 packet every few minutes
but 1 packet loss is a big deal for testing too.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Winpcap-users