On Mon, 2010-08-16 at 17:19 +0200, ext Jan Engelhardt wrote: > On Monday 2010-08-16 16:01, Luciano Coelho wrote: > >> You can implement a daemon: which samples the statistics data of NIC > >> periodically, calculates the average bandwidth in a period, and change > >> the condition variables accordingly. > > > >We don't want to use polling from userspace. That's the reason why we > >decided to use iptables instead. The idea is that we will only notify > >the userspace when the throughput crosses the threshold line. And the > >rules I defined above are working rather well, except for this "detail" > >that the BELOW signal is not sent when there's no data flowing. > > Without data, the turing machine won't finish, so you can't say for > sure that you reached below. That is sort of a halting problem, which > is known to be unsolvable. Yes, that's the theoretical way to put it. :) In practice I see that without data the rules won't be traversed and therefore we can't make any rate calculations. But if I add an idletimer (which uses a timer to trigger execution, regardless of the availability of packets to process) with a timeout equal to the estimator's measurement averaging interval (ewmalog), I can be sure that the rate went to 0 bps if the timer expires. Ie. no packets at all during the measurement interval means 0 bps, right? -- Cheers, Luca. -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html