Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Packet rate limiting

From: Dan Kaminsky <dan(at)doxpara.com>
Date: Fri Jul 11 2003 - 19:43:01 EDT

Whatever you do, don't use the method used for scanrand -- calculate an intra-packet delay that would lead to x packets sent per second, and do a usleep between each send.

This scales VERY VERY badly, since sleep quanta can get pretty high.

Instead, do what scanrand2 is going to do: Determine the number of packets (bytes, really, with 64 as a minimum) you could send in a 50ms time period and still hit your bandwidth mark. Send that many, gettimeofday to determine how many ms till the next 50 ms timeslot is up, usleep that many ms.

This can be optimized slightly -- only do the gettimeofday routine every once in a while, for instance, or use a shorter timeslot than 50ms -- but do not sleep between each packet. That's bad, mmkay?

BTW, Aaron -- does Libnet 1.0's send fuctions return before the packet actually hits the wire?

--Dan
www.doxpara.com

P.S. Yes, Mike, I'm slowly but surely removing the 1.0 dependancy. Can you give me a Libnet 1.1 function that does L3 writes from an IP pointer?

Do you need help?X

Aaron Turner wrote:

>Unfortunately, there really isn't anyway to do that AFAIK. When libnet



To unsubscribe, e-mail: libnet-unsubscribe@securityfocus.com For additional commands, e-mail: libnet-help@securityfocus.com Received on Fri Jul 11 20:01:11 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:24 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library