[Winpcap-users] correct usage of pcap_sendqueue_transmit?

Noam Cohen Noam.Cohen at harmonicinc.com
Sun Oct 25 08:49:00 PDT 2009


Hello,
I am trying to send packets using the pcap_sendqueue_transmit( adapter, queue, 1)  // sync mode == true

I see that the larger the queue , the higher the actual transmission rate.
My guess is that the usage is wrong.
Pseudo code:

Transmit(buff){
            If(available_room < 2000){
                        pcap_sendqueue_transmit(adapter, queue,1);
// force reallocation since the queue is NOT emptied by the transmission ?!
pcap_sendqueue_destroy(queue);
queue = pcap_sendqueue_alloc(queue_size);
available_room = queue_size;
}

pcap_sendqueue_queue(queue, header, buff);
available_room -= buff_size + 16;
}


OS: Win XP SP3
Winpcap 4.1.1 (latest from 2009-10-25)


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.

Is the transmission done in kernel? I thought saw until today when I read the sources (packet.dll) and now I am not sure.

Any ideas?

Thanks
Noam Cohen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20091025/17d36a5d/attachment.htm 


More information about the Winpcap-users mailing list