I'm using winpcap to interface with some test equipment that communicates over an 100 Mb Ethernet connection (directly connected, no switch or hub). The test equipment centers around an FPGA, and I control the code on the FPGA. Most of the time, the test equipment is sending status information (two 60 B packets/s), but occasionally it will transfer the data it has collected, in response to a specific packet from the computer. It's up to 64 MB of data, transferred in up to 2097152 packets (for the full 64 MB). I want to transfer the data as quickly as possible, but I'm having trouble with packets getting dropped.
I'm using pcap_next_ex in a separate thread from the UI thread. I've adjusted the kernel buffer using pcap_setbuff, although I understand now that increasing that buffer only delays the onset of the dropped packets. I only capture the minimum portion of the packet required (60 B). I've tried adjusting the read timeout, turning off promiscuous mode, and adjusting the kernel copy size, without the improvement I'm looking for. The thread calling pcap_next_ex does very little else when receiving the test data, and right now I just have it checking the packet sequence number (so I can tell if it's dropping packets) and incrementing a counter (the UI is updated with the counter value by the separate UI thread). I tried using pcap_stats_ex to get data on the actual number of packets dropped, but it shows "0" for the different packet drop counts. Right now, I'm seeing a few dropped packets even when sending at ~60,000 packets/s. This is with promiscuous mode on, a 500 ms read timeout, a 4 MB kernel buffer, and the min copy size adjusted anywhere from the default (16 kB, I believe) to 1 MB. I test using the release version of the software, compiled with optimizations for speed. I'm running winpcap 4.1.2 on XP on a reasonably recent laptop (Core 2 Duo, 2 GB RAM). From reading through the archives here, I'm certain winpcap can provide better performance than this. I can provide code if it helps. Thanks, Carson
_______________________________________________ Winpcap-users mailing list [email protected] https://www.winpcap.org/mailman/listinfo/winpcap-users
