[Winpcap-users] Which is faster?

Gianluca Varenni gianluca.varenni at cacetech.com
Sat Sep 29 00:35:58 GMT 2007


pcap_loop won't give you any performance enhancement, expecially at such a low packet rate (50pps is really really low).
I think the bottleneck is the missing code that you commented as "// walk through the radiotap and TCP/IP structures".

Have you tried just leaving the "++framecounter;" statement?

Have a nice day

  ----- Original Message ----- 
  From: Paul Heil 
  To: winpcap-users at winpcap.org 
  Sent: Friday, September 28, 2007 4:30 PM
  Subject: [Winpcap-users] Which is faster?

  I'm having performance issues with pcap_next_ex() and I was wondering if it was any faster to use pcap_loop() with a dispatch function?
  The frames I want to capture are only 24 bytes, but I want to be able to count all of them if they arrive at 50 frames per second. Wireshark has no trouble seeing them all, but I only count around 90% 

  What I'm doing now looks like this:

     pcap_open( timeout = 100ms );
     pcap_setmintocopy( 128 bytes );
       // listen for 10 seconds after that, m_bListening is set to false by another thread
      while( m_bListening == TRUE && pcap_next_ex( pcapHandle, &pkt_header, &pkt_data ) >= 0 )
          // walk through the radiotap and TCP/IP structures getting the data and 
          // statistics I want from the captured frames.



  Winpcap-users mailing list
  Winpcap-users at winpcap.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20070929/ce18cef0/attachment.htm

More information about the Winpcap-users mailing list