If you want to send them precisely evenly spaced, then you have to do what your 
pseudo code suggests and suffer the consequences.  You may find that achieving 
fine grained delay and high packets rates could be hard.

 

Meanwhile, if you realize that there will be buffering in various places no 
matter what you do, you might get the same results with much lower overhead by 
sending a series of short bursts of n packets and delay between the bursts:

While (true) {

Pcap_sendqueue_transmit (npackets);

Delay (…);

}

 

When n is 2 or greater the kernel transitions will be reduced accordingly. The 
right choice for n will likely depend on link speed, packet size, and receive 
buffer capacity of the where you are sending to.

 

From: [email protected] 
[mailto:[email protected]] On Behalf Of ?????? ???????
Sent: Friday, April 08, 2011 5:47 AM
To: [email protected]
Subject: [Winpcap-users] Efficient sending huge number of UDP packets at afixed 
specified rate

 

Good day, colleagues!

Do you know efficient way of sending UDP packets at a fixed rate efficiently?

As far as I know, there are 2 functions for packets sending - pcap_sendpacket 
and pcap_sendqueue_transmit. Regarding the first, it's easy to realize this 
pseudocode:

while (true) {
pcap_send_packet(...);
delay (...);
}

But, as said in WinPcap tutorial, pcap_send_packet is inefficient if you need 
high performance (and I need it).

pcap_sendqueue_transmit is optimized efficient way to send packets, but as I 
can see, there is no way to specify sending rate in pcap_sendqueue_transmit, i. 
e. pcap_sendqueue_transmit will send packets as fast as possible which is not 
suitable in my situation.

Can you give any recommendations?

-- 
Best regards, Metcherin Sergey.

_______________________________________________
Winpcap-users mailing list
[email protected]
https://www.winpcap.org/mailman/listinfo/winpcap-users

Reply via email to