Development issues regarding the cerowrt test router project
 help / color / mirror / Atom feed
* [Cerowrt-devel] policer question
@ 2015-05-26 10:49 Sebastian Moeller
  2015-05-27 17:12 ` Dave Taht
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Moeller @ 2015-05-26 10:49 UTC (permalink / raw)
  To: dave Täht, cerowrt-devel

Hi Dave,

I just stumbled over your last edit of "wondershaper needs to go the way of the dodo”; especially the following caught my attention (lines 303 - 311):

## The ingress policer doesn't work against ipv6, so if you have mixed traffic
## you are not matching all of it, and the policer fails entirely
## A correct, modern line for this would be:
## tc filter add dev ${DEV} parent ffff: protocol all match u32 0 0 \
## police rate ${DOWNLINK}kbit burst 100k drop flowid :1
## 
## Even if it did work, the police burst size is too small for higher speed 
## connections and what I suggest above for a burst size needs to be 
## a calculated figure.(that one works ok at 100mbit)

I think we should implement a policer setting in SQM (if only for testing) so I wonder how to set the burst size?
I think we basically can run the policer only X times per second, so we should allow something along the lines of:
bandwidth [bits/sec] / X [1/sec] = max bits in batch [bits]
Since in the end, we only can work in bursts/batches we need to figure out what worst-case batches to expect. 
Now it would be sweet if we could get a handle on X, but what about just using the following approximation:

How often does the policer run per second worst case?

100[kB]*1000*8 = 800000 [bit]
(100*1000^2 [bit/sec] / (100*1000*8) [bit]) = 125 1/sec or 8 milliseconds per invocation

So your example seems to show that if we can run 125 times per second we will be able to drain enough packets so we do not drop excessively many packets. This bursting issue will increase the latency under load for sure, but I guess not more than 8ms on average?. 
	Now, I guess one issue will be that this is not simply dependent on either data size or packet count, but probably we are both limited at how many packets per second we can process as well as how many bytes. So what about:

burst = (bandwidth [bits/sec] /  125 [1/sec]) / (1000*8) [kB]

This is probably too simplistic, but better than nothing.

I would appreciate any hints how to improve this; so thanks in advance. Now all I need to do is hook this up with sqm-scripts and then go test the hell out of it ;)

Best Regards
	Sebastian





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-05-30 18:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-26 10:49 [Cerowrt-devel] policer question Sebastian Moeller
2015-05-27 17:12 ` Dave Taht
2015-05-27 19:35   ` Dave Taht
2015-05-29 10:42   ` Sebastian Moeller
2015-05-30 18:17     ` Dave Taht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox