<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=WordSection1>
<p class=MsoNormal>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.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>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.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>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.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>I can provide code if it helps.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Thanks,<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Carson<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>