<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" 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 http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.5726" name=GENERATOR>
<STYLE>@font-face {
        font-family: Calibri;
}
@page Section1 {size: 612.0pt 792.0pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; }
P.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
LI.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
DIV.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: "Arial","sans-serif"; mso-style-type: personal-compose
}
.MsoChpDefault {
        mso-style-type: export-only
}
DIV.Section1 {
        page: Section1
}
</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 vLink=purple link=blue bgColor=#ffffff>
<DIV><FONT size=2>Noam,</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>are you sending just one queue of 20000bytes?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Have a nice day</FONT></DIV>
<DIV><FONT size=2>GV</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=Noam.Cohen@harmonicinc.com
href="mailto:Noam.Cohen@harmonicinc.com">Noam Cohen</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=winpcap-users@winpcap.org
href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Sunday, October 25, 2009 8:49
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Winpcap-users] correct usage of
pcap_sendqueue_transmit?</DIV>
<DIV><FONT size=2></FONT><FONT size=2></FONT><BR></DIV>
<DIV class=Section1>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'">Hello, <o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'">I am trying
to send packets using the pcap_sendqueue_transmit( adapter, queue, 1) //
<B>sync mode == true<o:p></o:p></B></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'">I see that
the larger the queue , the higher the actual transmission rate.
<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'">My guess is
that the usage is wrong. <o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'">Pseudo
code:<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'">Transmit(buff){<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'">
If(available_room < 2000){<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'">
pcap_sendqueue_transmit(adapter, queue,1);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt; TEXT-INDENT: 36pt"><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'">// force reallocation since the
queue is NOT emptied by the transmission ?!<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt; TEXT-INDENT: 36pt"><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'">pcap_sendqueue_destroy(queue);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt; TEXT-INDENT: 36pt"><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'">queue =
pcap_sendqueue_alloc(queue_size);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 36pt; TEXT-INDENT: 36pt"><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'">available_room =
queue_size;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-INDENT: 36pt"><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'">}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-INDENT: 36pt"><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="TEXT-INDENT: 36pt"><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'">pcap_sendqueue_queue(queue, header,
buff);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-INDENT: 36pt"><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'">available_room -= buff_size +
16;<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'">}<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'">OS: Win XP
SP3<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'">Winpcap
4.1.1 (latest from 2009-10-25)<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'">When I ran
with queue_size = 20000 I saw the rate is about 2% faster than required. I
tested by capturing the transmitted packet with wireshark (tried on the same
and different machine with same results), and comparing the captured file with
the original pcap file that was fed to the above code.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'">Is the
transmission done in kernel? I thought saw until today when I read the sources
(packet.dll) and now I am not sure.<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'">Any
ideas?<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'"><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 'Arial','sans-serif'">Thanks<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'">Noam
Cohen<o:p></o:p></SPAN></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></BLOCKQUOTE></BODY></HTML>