<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=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1989244635;
        mso-list-type:hybrid;
        mso-list-template-ids:-1411073492 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></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 bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>This is wrong. If your application is not fast enough at processing packets, it does not drop them (in order to drop packets, you need to see the packets and make the choice to drop them). The drop gets pushed all the way down to the driver (and you will see ps_drop &gt; 0).<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>If you detect missing packets (by looking at sequence numbers in the packets) but ps_drop is zero, then the reasons can be<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Packets are dropped directly by the NIC card or NIC driver for lack of resources (where resources can be a variety of things, including memory descriptors and bandwidth on the PCI/PCIe/USB bus)<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Packets are dropped by the NIC card because they have the wrong FCS (e.g. interference on the Ethernet cable?)<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Packets are dropped by the NIC because the NIC sucks and cannot keep up<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I would definitely try with a good NIC (e.g. some intel PCIe one) and see if anything changes.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Have a nice day<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>GV<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> winpcap-users-bounces@winpcap.org [mailto:winpcap-users-bounces@winpcap.org] <b>On Behalf Of </b>Helmut Vaupotitsch<br><b>Sent:</b> Tuesday, November 30, 2010 11:12 PM<br><b>To:</b> winpcap-users@winpcap.org<br><b>Subject:</b> Re: [Winpcap-users] About the packet drops and use of pcap_stats_ex()<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><tt><span style='font-size:10.0pt'>if ps_drop=0, then the *driver* hasn´t lost packets (see Re: [Winpcap-users] Question about the struct type pcap_t. from 28.10!)</span></tt><span style='font-size:10.0pt;font-family:"Courier New"'><br><tt>Most likely your app looses packets...&nbsp;&nbsp; </tt><br><tt>...try to implement a ringbuffer in the following way: one thread just fills the pre-allocated FIFO, another thread processes the buffer</tt><br><br><tt>Regards</tt><br><tt>Helmut</tt><br></span><br>yulou liu schrieb: <o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:13.5pt'><br><br><span style='font-size:13.5pt'><br></span><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:blue'>I have made these experiments :</span></span><span class=apple-style-span><span style='font-size:13.5pt'>&nbsp;</span></span><span style='font-size:13.5pt'><br><br></span><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:blue'>PC captures data packets &nbsp;from a FPGA board.&nbsp;</span></span><span style='font-size:13.5pt'><br></span><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:blue'>&nbsp;</span></span><span class=apple-style-span><span style='font-size:13.5pt'>&nbsp;</span></span><span style='font-size:13.5pt'><br></span><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:blue'>1,&nbsp; I made a Loop back test that can verify there is no packet drops &nbsp;between &nbsp;FPGA TO FPGA.</span></span><span class=apple-style-span><span style='font-size:13.5pt'>&nbsp;</span></span><span style='font-size:13.5pt'><br></span><span class=apple-style-span><span style='font-size:10.0pt;font-family:SimSun'>&nbsp;</span></span><span class=apple-style-span><span style='font-size:13.5pt'>&nbsp;</span></span><span style='font-size:13.5pt'><br></span><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:blue'>2Each data packets from FPGA board has a sequence number. Then PC can figure&nbsp; that there&nbsp; are&nbsp; packets drops. (the packets number that pc gets does not match the sequence of the packets).</span></span><span class=apple-style-span><span style='font-size:13.5pt'>&nbsp;</span></span><span style='font-size:13.5pt'><br></span><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:blue'>&nbsp;</span></span><span class=apple-style-span><span style='font-size:13.5pt'>&nbsp;</span></span><span style='font-size:13.5pt'><br></span><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:blue'>3,&nbsp; call the pcap_stats_ex() , the result&nbsp; is : ps_drop=0 .&nbsp; That means&nbsp; there is no packets drops between the kernel buffer to&nbsp; user buffer.&nbsp;</span></span><span style='font-size:13.5pt'><br></span><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:blue'>&nbsp;</span></span><span class=apple-style-span><span style='font-size:13.5pt'>&nbsp;</span></span><span style='font-size:13.5pt'><br></span><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:blue'>&nbsp;</span></span><span class=apple-style-span><span style='font-size:13.5pt'>&nbsp;</span></span><span style='font-size:13.5pt'><br></span><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:blue'>According&nbsp; to above ,&nbsp;&nbsp; Packet drops&nbsp; could occur in&nbsp; the&nbsp; system netcard to winPcap kernel driver.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Is this conclusion right ?</span></span><span class=apple-style-span><span style='font-size:13.5pt'>&nbsp;</span></span><span style='font-size:13.5pt'><br></span><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:blue'>Is it is right ,&nbsp; what is the suggestion ?&nbsp;&nbsp;&nbsp; Can it be improved to use a more professional net card&nbsp; ?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class=apple-style-span><span style='font-size:13.5pt'><o:p></o:p></span></span></p><pre><o:p>&nbsp;</o:p></pre><pre>  <o:p></o:p></pre><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Liuyulou<o:p></o:p></p></div></div><pre><o:p>&nbsp;</o:p></pre><pre style='text-align:center'><hr size=4 width="90%" align=center></pre><pre><o:p>&nbsp;</o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>Winpcap-users mailing list<o:p></o:p></pre><pre><a href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</a><o:p></o:p></pre><pre><a href="https://www.winpcap.org/mailman/listinfo/winpcap-users">https://www.winpcap.org/mailman/listinfo/winpcap-users</a><o:p></o:p></pre><pre>  <o:p></o:p></pre><p class=MsoNormal><br><br><o:p></o:p></p><pre>-- <o:p></o:p></pre><pre>----------------------------------------------------------------<o:p></o:p></pre><pre>Ing. Helmut Vaupotitsch        Phone:  +43 (0)3133 3780 16<o:p></o:p></pre><pre>ITEC Tontechnik und            Fax:    +43 (0)3133 3780 9<o:p></o:p></pre><pre>Industrieelektronik GmbH       E-mail: <a href="mailto:hv@itec-audio.com">hv@itec-audio.com</a><o:p></o:p></pre><pre>A-8200 Lassnitzthal 300        URL:    <a href="http://www.itec-audio.com">http://www.itec-audio.com</a><o:p></o:p></pre><pre>----------------------------------------------------------------<o:p></o:p></pre></div></body></html>