[Winpcap-users] open question: exact timing with pcap_sendqueue_transmit

Noam Cohen Noam.Cohen at harmonicinc.com
Thu Nov 12 00:56:01 PST 2009

Assume the file to be transmitted cannot fit into memory (i.e >> 400MB).
The symptom I saw was that the transmission was too FAST not too slow. This is caused by the libpcap function skip one inter packet interval every time a new queue is used.

Anyone has an idea how to maintain accurate transmission rate for long files? It seems the pcap_sendqueue_transmit() is a dead end for now.


Message: 3
Date: Tue, 10 Nov 2009 09:45:58 +0530
From: Adagio Grazioso <adagiograzioso at gmail.com>
Subject: Re: [Winpcap-users] Winpcap-users Digest, Vol 56, Issue 11
To: winpcap-users at winpcap.org
	<239eee8d0911092015o49a8a0cdl675ad3bc647ded25 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1


I may go about doing it like this -

Create 2 threads - one to alloc and fill up sendqueues (as many as
required to accomodate the 400MB file); the second to transmit the
sendqueues prepared by the first thread, one immediately after the
other. When transmit of a sendqueue is finished, the second thread
signals the first that has finished with a particular sendqueue and
the first thread may destroy it.

This of course assumes that time required to fill up a sendqueue is
less than the time required to transmit it so that the second thread
never has to wait - which may or may not always be the case.

This is the scheme I had in mind when I suggested the
feature/workaround of having a special last pkt of length 0 to
maintain timing across sendqueues.

Please note that I'm a developer "using" WinPcap, not a contributing
WinPcap developer. GV or someone else may have a better solution to
your problem.

Good Luck!


On Tue, Nov 10, 2009 at 1:30 AM,  <winpcap-users-request at winpcap.org> wrote:
> Date: Sun, 8 Nov 2009 12:42:01 -0800
> From: Noam Cohen <Noam.Cohen at harmonicinc.com>
> Subject: [Winpcap-users] open question: exact timing with
> ? ? ? ?pcap_sendqueue_transmit
> To: "winpcap-users at winpcap.org" <winpcap-users at winpcap.org>
> Message-ID:
> ? ? ? ?<6709A690910C7A47B77DD95744B919A50BE7BA1E93 at EXCH-CMS.hlit.local>
> Content-Type: text/plain; charset="us-ascii"
> Hi
> Somehow my question was left unanswered. Can anyone from the developers relate to it ?(and to the PS below)
> Thanks
> Noam Cohen
> -----Original Message-----
> From: Noam Cohen
> Sent: Sunday, November 01, 2009 9:24 AM
> To: 'winpcap-users at winpcap.org'
> Subject: RE: Winpcap-users Digest, Vol 55, Issue 22
> Adding a (special) packet to the first call of pcap_sendqueue_transmit() in order to 'link' the time with the second call is problematic
> since not always the caller can know the required transmission time of the second call during the first call.
> Why not adding a flag that will say "use same time base since first call": pcap_sendqueue_transmit(... , bool usePreviousTimeBase = false),
> ?or even better: add a new function pcap_set_sendqueue_time_base(timeval* origin). If this function is called, all transmissions will use this time base.
> PS: how do people transmit long files? Use your own busy loop?
> Noam

More information about the Winpcap-users mailing list