<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<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"><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16588">
<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>
</HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody lang=EN-US leftMargin=0 link=blue topMargin=0 vLink=purple
CanvasTabStop="true" name="Compose message area">
<DIV><FONT face=Calibri>Carson,</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>if the dropped packet count is zero, then it means that
the packets do not reach the winpcap driver at all, so WinPcap is not dropping
the packets. Possible reasons are:</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>1. the packets are somewhat corrupted (wrong FCS) and
the NIC drops them</FONT></DIV>
<DIV><FONT face=Calibri>2. the packets have the wrong dest MAC address (and
since you are not using promiscuous mode, they are not received by
WinPcap)</FONT></DIV>
<DIV><FONT face=Calibri>3. either the NIC card or the NIC card driver cannot
keep up at those rates.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Have a nice day</FONT></DIV>
<DIV><FONT face=Calibri>GV</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=Carson.Morrow@Honeywell.com
href="mailto:Carson.Morrow@Honeywell.com">Morrow, Carson</A> </DIV>
<DIV><B>Sent:</B> Wednesday, August 18, 2010 10:50 AM</DIV>
<DIV><B>To:</B> <A title=winpcap-users@winpcap.org
href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A> </DIV>
<DIV><B>Subject:</B> [Winpcap-users] Problem with dropped
packets</DIV></DIV></DIV>
<DIV><BR></DIV>
<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>
<P>
<HR>
<P></P>_______________________________________________<BR>Winpcap-users mailing
list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BODY></HTML>