[Winpcap-users] determinist / speed up the transmission withwinpcap ?

Hadriel Kaplan HKaplan at acmepacket.com
Tue Feb 14 17:55:59 GMT 2006


As Loris said the sendqueue function (with synchronization set) is highly
accurate.  Note though it uses a huge chunk of the CPU to do this, so
hopefully your app doesn't need to do much else when it's sending.  I have a
separate thread for sendqueue, which I usually set at a higher priority, but
if synch is set I make the sendqueue thread the same priority of the app, or
else the app never gets time.

Also, many NIC cards/drivers can't handle a very large sendqueue buffer
(where large is more than around 3MB).  So if you want to send more than
that you may have to break it up into smaller queues and send them one after
another.

-hadriel


> -----Original Message-----
> From: winpcap-users-bounces at winpcap.org [mailto:winpcap-users-
> bounces at winpcap.org] On Behalf Of Loris Degioanni
> Sent: Tuesday, February 14, 2006 12:01 PM
> To: soft at prodel-techno.fr; winpcap-users at winpcap.org
> Subject: Re: [Winpcap-users] determinist / speed up the transmission
> withwinpcap ?
> 
> WinPcap skips the protocol layer, but it still relies on the low part of
> the NDIS stack to transmit packets. In other words, it doesn't talk with
> the network card directly, but:
> 
> 1. performs a transition from user mode (packet.dll) to kernel mode
> (npf.sys). This is normally quite slow.
> 2. gives the packets to NDIS, which delivers it to the NIC driver for
> transmission. This is normally quite fast (microseconds), but the NIC
> driver may introduce arbitrary latencies that are not under the npf.sys
> control.
> 
> If you don't need to be interactive, you can buffer the packets during
> the transaction from user mode to kernel mode (pcap_sendqueue*
> functions). This improves things a lot.
> 
> Loris
> 
> 
> Soft Prodel wrote:
> > Hello All developers,
> >
> >
> >
> > - excuse first for my bad English...-
> >
> >
> >
> > I would like to know if with winpcap used with windows XP (pro) ,i can
> > be determinist for the timing.
> >
> >
> >
> > each milliseconde,(using the multimedia timer),i send a request to a
> > server with UDP/IP protocol. at this moment i use traditional
> > AsyncSocket windows API's.
> >
> > but all the layers, stacks of windows take time and is not determinist.
> > when i decide to send a frame, the most of the time, the frame is
> > emitted on the network 1, 5, 10, 50 ms after and sometimes, when i
> > stress the PC, 250 ms later !!!.
> >
> > i know that XP is not a Real-Time operating system, but i try to speed
> > up the transmission at least at 2 or 3 ms.
> >
> >
> >
> > is winpcap able to skip all the system latency ?
> >
> > i think yes because it bypass all the layers but what with the HAL
> > layer... ?
> >
> > or any person have information about to how to make ?
> >
> >
> >
> > The application is for fast communicate with I/O system. without real
> > time system like RTX or others.
> >
> >
> >
> > Thanks for attention.
> >
> >
> >
> > Best Regards.
> >
> >
> >
> > Laurent.
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Winpcap-users mailing list
> > Winpcap-users at winpcap.org
> > https://www.winpcap.org/mailman/listinfo/winpcap-users
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users



More information about the Winpcap-users mailing list