[Winpcap-users] winpcap sends packets double (or libpcap receives 'm double)

Tiemen Schut tschut at gmail.com
Thu Aug 31 08:04:02 GMT 2006

Hi there mailinglist,

I'm currently working on some highspeed data acquisition stuff, and for an
experimental setup I am using a windows XP pc (with winpcap) as sender of
packets, and a slackware linux pc (with libpcap) as receiver.

The sender is creating packets of 1512 bytes long, in which the last 4 bytes
represent a counter. I put a 1000 of these packets in a pcap_queue thingie,
and send them out. After that I destroy the queue, and if a certain amount
of time has passed (I want to create an average of 43,75 MB/s) I refill the
queue and resend it (continuously incrementing the numbers of course).

So far so well, ksysguard tells me I receive about 43,75 MB/s of data, so
I'm happy. Now, on the receiving side, I sniff all the traffic using
libpcap's pcap_loop, and in my callback function I check the counters in the
packets. So, every next counter should be the last counter + 1.

At first I lost a huge amount of packets (> 25 %), but running the server
app with nice -n-20 (yes, the receiving pc is quite slow) this decreased
dramatically. I lose like 0.00x % of packets, so I'm quite happy about that.

Now, the problem. At first I didn't even think this could happen, but it
does. I receive packets twice! :o Not all packets, just like a few in say
100.000 or so. The question is, has anyone ever seen this before? Is it
likely a winpcap problem (sender, so the packets really are send twice) or a
libpcap problem (callback function called twice for same packet?) or even a
kernel issue?

I truly don't have a clue, would appreciate any comments :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20060831/dc492858/attachment.htm

More information about the Winpcap-users mailing list