<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style id="owaParaStyle">P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</style>
</head>
<body bgcolor="#ffffff" fPStyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<p> </p>
<p>#1 64*82334=526967 and the WIN32_DEFAULT_BUFFER_SIZE - 256000 -- Did you increase your buffer size via pcap_setbuff to allow for this?</p>
<p> </p>
<p>#2 Can you run your packet generator on the same box as your capture instead of the FPGA?  Remove that from the equation and see if you get the same behavior.</p>
<div>
<p> </p>
<p>#3 How are you handling flow control since UDP has no flow control?</p>
<p> </p>
<div style="FONT-FAMILY: Tahoma; FONT-SIZE: 13px">
<p>Michael D. Black</p>
<p>Senior Scientist</p>
<p>NG Information Systems</p>
<p>Advanced Analytics Directorate</p>
<p> </p>
</div>
</div>
<div style="FONT-FAMILY: Times New Roman; COLOR: #000000; FONT-SIZE: 16px">
<hr tabindex="-1">
<div style="DIRECTION: ltr" id="divRpF826363"><font color="#000000" size="2" face="Tahoma"><b>From:</b> winpcap-users-bounces@winpcap.org [winpcap-users-bounces@winpcap.org] on behalf of Anton Tremsin [ast@ssl.berkeley.edu]<br>
<b>Sent:</b> Friday, February 04, 2011 11:39 PM<br>
<b>To:</b> winpcap-users@winpcap.org<br>
<b>Cc:</b> Gianluca Varenni<br>
<b>Subject:</b> EXT :Re: [Winpcap-users] Delay receiving packets - wrongfunctionality ofpcap_setmintocopy()<br>
</font><br>
</div>
<div></div>
<div>Gianluca,<br>
<br>
Thanks a lot for helping me. I am in a dire situation since my detector really needs that problem to be solved before our experiments in couple of months time (need to do a lot of debugging and code writing after Winpcap issue is solved).<br>
<br>
I am not loosing packets. Sorry if I made it confusing.<br>
<br>
The packets always arrive into my C code (although Wireshark may loose them, maybe that was a confusion with packets being lost). I only need my C code to work right.  The rest of packets come only after the timeout.
<br>
<br>
I varied timeout from 1 ms to 20 sec and the effect is the same. With timeout 0 - the packets do not arrive until I push more packets into Chelsio card and these, in turn, push the once which were already in some buffer.
<br>
<br>
I am using Chelsio card, but Winpcap I downloaded from the official website (version 4.1.2).
<br>
<br>
The problem seems to be as if the function setmintocopy() does not work right and the driver decides by itself how much to buffer before sending it to me. One strange thing - the number of packets being delivered to me changes from time to time, however very
 often number 31 (31 packets, 8234 bytes each) arrive in a single chunk. Sometimes it is 62 packets, sometimes other numbers, e.g. 57. etc.<br>
<br>
I will be very glad if someone ca advise something I can try to resolve that issue.<br>
<br>
Thanks again,<br>
<br>
Anton<br>
<blockquote type="cite"><style>@font-face {
        font-family: Wingdings;
}
@font-face {
        font-family: Wingdings;
}
@font-face {
        font-family: Calibri;
}
@font-face {
        font-family: Tahoma;
}
@font-face {
        font-family: Consolas;
}
@page WordSection1 {margin: 1.0in 1.0in 1.0in 1.0in; }
P.MsoNormal {
        MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman","serif"; COLOR: black; FONT-SIZE: 12pt
}
LI.MsoNormal {
        MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman","serif"; COLOR: black; FONT-SIZE: 12pt
}
DIV.MsoNormal {
        MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman","serif"; COLOR: black; FONT-SIZE: 12pt
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
PRE {
        MARGIN: 0in 0in 0pt; FONT-FAMILY: "Courier New"; COLOR: black; FONT-SIZE: 10pt
}
P.MsoAcetate {
        MARGIN: 0in 0in 0pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black; FONT-SIZE: 8pt
}
LI.MsoAcetate {
        MARGIN: 0in 0in 0pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black; FONT-SIZE: 8pt
}
DIV.MsoAcetate {
        MARGIN: 0in 0in 0pt; FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black; FONT-SIZE: 8pt
}
P.MsoListParagraph {
        MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Times New Roman","serif"; COLOR: black; FONT-SIZE: 12pt
}
LI.MsoListParagraph {
        MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Times New Roman","serif"; COLOR: black; FONT-SIZE: 12pt
}
DIV.MsoListParagraph {
        MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Times New Roman","serif"; COLOR: black; FONT-SIZE: 12pt
}
SPAN.HTMLPreformattedChar {
        FONT-FAMILY: Consolas; COLOR: black
}
SPAN.EmailStyle20 {
        FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d
}
SPAN.EmailStyle21 {
        FONT-FAMILY: "Calibri","sans-serif"; COLOR: #1f497d
}
SPAN.BalloonTextChar {
        FONT-FAMILY: "Tahoma","sans-serif"; COLOR: black
}
.MsoChpDefault {
        FONT-SIZE: 10pt
}
OL {
        MARGIN-BOTTOM: 0in
}
UL {
        MARGIN-BOTTOM: 0in
}
</style>
<div class="WordSection1">
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt">Anton,</span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></span> </p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt">You say that you are using a Chelsio board. Are you using the official version of WinPcap or Chelsio provided you with a custom one? What do you set
 as timeout and mintocopy?</span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></span> </p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt">Have a nice day</span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt">GV</span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></span> </p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></span> </p>
<div>
<div style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<p class="MsoNormal"><b><span style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: windowtext; FONT-SIZE: 10pt">From:</span></b><span style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: windowtext; FONT-SIZE: 10pt">
<a class="moz-txt-link-abbreviated" href="mailto:winpcap-users-bounces@winpcap.org" target="_blank">
winpcap-users-bounces@winpcap.org</a> [<a class="moz-txt-link-freetext" href="mailto:winpcap-users-bounces@winpcap.org" target="_blank">mailto:winpcap-users-bounces@winpcap.org</a>]
<b>On Behalf Of </b>Mark Pizzolato - WinPCap-Users<br>
<b>Sent:</b> Friday, January 28, 2011 11:57 AM<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:winpcap-users@winpcap.org" target="_blank">
winpcap-users@winpcap.org</a><br>
<b>Subject:</b> Re: [Winpcap-users] Delay receiving packets - wrong functionality ofpcap_setmintocopy()</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt">Ho Anton,</span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></span> </p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt">My first question to you would be:</span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></span> </p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt">WHY are you using WinPcap to receive UDP packets?</span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></span> </p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt">This sounds like a job for a winsock application….</span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></span> </p>
<p style="TEXT-INDENT: -0.25in" class="MsoListParagraph"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt"><span>-<span style="FONT: 7pt 'Times New Roman'">         
</span></span></span><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt">Mark Pizzolato</span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></span> </p>
<div style="BORDER-BOTTOM: medium none; BORDER-LEFT: 1.5pt solid; PADDING-BOTTOM: 0in; PADDING-LEFT: 4pt; PADDING-RIGHT: 0in; BORDER-TOP: medium none; BORDER-RIGHT: medium none; PADDING-TOP: 0in">
<div>
<div style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<p class="MsoNormal"><b><span style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: windowtext; FONT-SIZE: 10pt">From:</span></b><span style="FONT-FAMILY: 'Tahoma','sans-serif'; COLOR: windowtext; FONT-SIZE: 10pt">
<a class="moz-txt-link-abbreviated" href="mailto:winpcap-users-bounces@winpcap.org" target="_blank">
winpcap-users-bounces@winpcap.org</a> [<a class="moz-txt-link-freetext" href="mailto:winpcap-users-bounces@winpcap.org" target="_blank">mailto:winpcap-users-bounces@winpcap.org</a>]
<b>On Behalf Of </b>Anton Tremsin<br>
<b>Sent:</b> Friday, January 28, 2011 11:50 AM<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:winpcap-users@winpcap.org" target="_blank">
winpcap-users@winpcap.org</a><br>
<b>Subject:</b> [Winpcap-users] Delay receiving packets - wrong functionality ofpcap_setmintocopy()</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<p style="MARGIN-BOTTOM: 12pt" class="MsoNormal">I hope someone can help my problem receiving packets in Windows7<br>
<br>
I am sending data by UDP packets from an FPGA through 10GB card (Chelsio). Using VC++ 2010 to compile code to receive them.
<br>
<br>
All packets arrive, no losses seen, but the problem is with the proper <b>operation of pcap_setmintocopy() function.</b>
<br>
<br>
<b>I send 64 packets with 8234 bytes each. Receiving them through pcp_next_ex() and I only get 31 packets (sometimes 62, sometimes 47, 50 packets) before the timeout occurs. After timeout the rest of the packets arrives.
<br>
</b><br>
I set the minimum amount of data in the kernel buffer that causes a read from the application to return (unless the timeout expires) to be 1 byte or it to be all 8234x64 bytes, no difference. Looks like the setmintocpy function has no effect on my kernel buffer
 to be copied to my application. If I send another set of 64 packets - data arrives into pcp_next_ex(), still only in lamp of 31 (62, 47,50) packets
<br>
<br>
That is a big problem for my application.<br>
<br>
<b>Is there anything I am doing wrong or need to change something in the system/driver to make setmintocopy function to operate properly?<br>
</b><br>
Thanks a lot for your help, <br>
<br>
Anton Tremsin<br>
<br>
</p>
<pre>-- </pre>
<pre> </pre>
<pre>Anton S. Tremsin, Ph.D.</pre>
<pre>Space Sciences Laboratory</pre>
<pre>University of California at Berkeley</pre>
<pre>Berkeley, CA 94720</pre>
<pre>Tel: (510) 642 4554</pre>
</div>
</div>
<pre><fieldset class="mimeAttachmentHeader" target="_blank"></fieldset>
_______________________________________________
Winpcap-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Winpcap-users@winpcap.org" target="_blank">Winpcap-users@winpcap.org</a>
<a class="moz-txt-link-freetext" href="https://www.winpcap.org/mailman/listinfo/winpcap-users" target="_blank">https://www.winpcap.org/mailman/listinfo/winpcap-users</a>
  </pre>
</blockquote>
<br>
</div>
</div>
</div>
</body>
</html>