[Winpcap-users] Problems with send queues

Janne Heikkinen janne.m.heikkinen at helsinki.fi
Wed Apr 8 04:39:48 PDT 2009


I made small test programs that uses pcap_sendpacket() and it works
otherwise ok but troughput is quite low (something like 17 - 23 Mbytes/s
depending on NIC on gigabit Ethernet).

So I was trying to convert the program to use send queues hoping to
get better troughtput but I wasn't able to get it working. Code is like
this:

   squeue = pcap_sendqueue_alloc(packet_count * packet_size);

   struct pcap_pkthdr pktheader;

   for(int i=0; i < packet_count; i++)
   {
      memset(&pktheader, 0, sizeof(pktheader));
      pktheader.len = packet_size;

      if (pcap_sendqueue_queue(squeue, &pktheader, pktdata) == -1)
         show_error_message();
   }


   if ((res = pcap_sendqueue_transmit(outdesc, squeue, sync)) < squeue->len)
      show_error_messsage();

   pcap_sendqueue_destroy(squeue);

Where pktdata is same packet that I've sent earlier with
pcap_send_packet(). On Vista computer pcap_sendque_transmit()
doesn't send all the bytes and on XP computer pcap_sendqueue_queue()
returns errror but pcap_geterr() return empty string.

Oh, and the program runs pcap_loop() in another thread.

- Janne



More information about the Winpcap-users mailing list