[Winpcap-users] Win7 pcap_sendqueue_transmit performance
Gianluca Varenni
Gianluca.Varenni at riverbed.com
Mon May 2 10:58:37 PDT 2011
Monroe,
Are you using the *same* hardware and the same network card? Also, is the same NIC used for something else (e.g. normal LAN connection) or it's a dedicated NIC?
The flags that you indicated are not used when sending packets out. The NIC will *not* calculate the IP/UDP checksums for you when transmitting with WinPcap. There is a specific negotiation process that happens between the NIC driver and the protocol driver in order to use checksum offloading. WinPcap does not support it.
There shouldn't be any difference if the hardware and test conditions are the same. Also, are the two machines using a fresh, clean installation of Win7 and Vista?
Have a nice day
GV
-----Original Message-----
From: winpcap-users-bounces at winpcap.org [mailto:winpcap-users-bounces at winpcap.org] On Behalf Of Monroe Comstock
Sent: Monday, April 25, 2011 9:53 AM
To: winpcap-users at winpcap.org
Subject: [Winpcap-users] Win7 pcap_sendqueue_transmit performance
Hello again,
I apologize for the flurry of questions. I'm head down developing my application at the moment and I have run into an odd behavior that I'd like to inquire about.
I've got an application that sends about 500 packets (about 300 bytes each) every 10ms using the pcap_sendqueue_transmit function. I'm also using QueryPerformanceCounter to record the time it takes to do the send. My
thread that sends the packets uses its own instance of a pcap_t. I've also
tried many combinations of PCAP_OPENFLAG_MAX_RESPONSIVENESS and PCAP_OPENFLAG_NOCAPTURE_LOCAL to see it they have any impact, yet they don't appear to.
What I've found is that on a Vista machine (Core2 Duo 3Ghz) I can send these packets consistently in 5ms or less. However on a Win7 (Core i7 2.8Ghz) the same call, using the exact same code, takes upwards of 60ms (consistently) to send the same amount of data. Moreover, if I disable the pcap send functionality on the Win7 box and just use a normal winsock send, winsock out performs pcap_sendqueue_transmit by a huge margin (about 15ms to send).
Be advised that I am NOT using time stamps and I send with "sync" set to 0.
Both machines have good NICs (GigE) with checksum offloading, although for some reason I still seem to need to calculate the IP and UDP checksums before I add the packets to the queue (Shouldn't the NIC card calculate these for me?) . But I digress...
So, my question is: Does Windows 7 have some negative effect on the performance of pcap_sendqueue_transmit that would cause it to have a 10 fold increase in the transmission time? Or have I forgotten something elementary?
Thanks again for all your help!
Monroe
_______________________________________________
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