Jan Engelhardt | a47bb4a | 2008-08-15 22:13:57 +0200 | [diff] [blame] | 1 | The rate estimator can match on estimated rates as collected by the RATEEST |
| 2 | target. It supports matching on absolute bps/pps values, comparing two rate |
| 3 | estimators and matching on the difference between two rate estimators. |
| 4 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 5 | \fB\-\-rateest1\fP \fIname\fP |
Jan Engelhardt | a47bb4a | 2008-08-15 22:13:57 +0200 | [diff] [blame] | 6 | Name of the first rate estimator. |
| 7 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 8 | \fB\-\-rateest2\fP \fIname\fP |
Jan Engelhardt | a47bb4a | 2008-08-15 22:13:57 +0200 | [diff] [blame] | 9 | Name of the second rate estimator (if difference is to be calculated). |
| 10 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 11 | \fB\-\-rateest\-delta\fP |
Jan Engelhardt | a47bb4a | 2008-08-15 22:13:57 +0200 | [diff] [blame] | 12 | Compare difference(s) to given rate(s) |
| 13 | .TP |
Jan Engelhardt | 2d039bc | 2011-02-21 02:59:50 +0100 | [diff] [blame] | 14 | \fB\-\-rateest\-bps1\fP [\fIvalue\fP] |
Jan Engelhardt | a47bb4a | 2008-08-15 22:13:57 +0200 | [diff] [blame] | 15 | .TP |
Jan Engelhardt | 2d039bc | 2011-02-21 02:59:50 +0100 | [diff] [blame] | 16 | \fB\-\-rateest\-bps2\fP [\fIvalue\fP] |
Jan Engelhardt | a47bb4a | 2008-08-15 22:13:57 +0200 | [diff] [blame] | 17 | Compare bytes per second. |
| 18 | .TP |
Jan Engelhardt | 2d039bc | 2011-02-21 02:59:50 +0100 | [diff] [blame] | 19 | \fB\-\-rateest\-pps1\fP [\fIvalue\fP] |
Jan Engelhardt | a47bb4a | 2008-08-15 22:13:57 +0200 | [diff] [blame] | 20 | .TP |
Jan Engelhardt | 2d039bc | 2011-02-21 02:59:50 +0100 | [diff] [blame] | 21 | \fB\-\-rateest\-pps2\fP [\fIvalue\fP] |
Jan Engelhardt | a47bb4a | 2008-08-15 22:13:57 +0200 | [diff] [blame] | 22 | Compare packets per second. |
| 23 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 24 | [\fB!\fP] \fB\-\-rateest\-lt\fP |
Jan Engelhardt | a47bb4a | 2008-08-15 22:13:57 +0200 | [diff] [blame] | 25 | Match if rate is less than given rate/estimator. |
| 26 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 27 | [\fB!\fP] \fB\-\-rateest\-gt\fP |
Jan Engelhardt | a47bb4a | 2008-08-15 22:13:57 +0200 | [diff] [blame] | 28 | Match if rate is greater than given rate/estimator. |
| 29 | .TP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 30 | [\fB!\fP] \fB\-\-rateest\-eq\fP |
Jan Engelhardt | a47bb4a | 2008-08-15 22:13:57 +0200 | [diff] [blame] | 31 | Match if rate is equal to given rate/estimator. |
| 32 | .PP |
| 33 | Example: This is what can be used to route outgoing data connections from an |
| 34 | FTP server over two lines based on the available bandwidth at the time the data |
| 35 | connection was started: |
| 36 | .PP |
| 37 | # Estimate outgoing rates |
| 38 | .PP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 39 | iptables \-t mangle \-A POSTROUTING \-o eth0 \-j RATEEST \-\-rateest\-name eth0 |
| 40 | \-\-rateest\-interval 250ms \-\-rateest\-ewma 0.5s |
Jan Engelhardt | a47bb4a | 2008-08-15 22:13:57 +0200 | [diff] [blame] | 41 | .PP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 42 | iptables \-t mangle \-A POSTROUTING \-o ppp0 \-j RATEEST \-\-rateest\-name ppp0 |
| 43 | \-\-rateest\-interval 250ms \-\-rateest\-ewma 0.5s |
Jan Engelhardt | a47bb4a | 2008-08-15 22:13:57 +0200 | [diff] [blame] | 44 | .PP |
| 45 | # Mark based on available bandwidth |
| 46 | .PP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 47 | iptables \-t mangle \-A balance \-m conntrack \-\-ctstate NEW \-m helper \-\-helper ftp |
| 48 | \-m rateest \-\-rateest\-delta \-\-rateest1 eth0 \-\-rateest\-bps1 2.5mbit \-\-rateest\-gt |
| 49 | \-\-rateest2 ppp0 \-\-rateest\-bps2 2mbit \-j CONNMARK \-\-set\-mark 1 |
Jan Engelhardt | a47bb4a | 2008-08-15 22:13:57 +0200 | [diff] [blame] | 50 | .PP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 51 | iptables \-t mangle \-A balance \-m conntrack \-\-ctstate NEW \-m helper \-\-helper ftp |
| 52 | \-m rateest \-\-rateest\-delta \-\-rateest1 ppp0 \-\-rateest\-bps1 2mbit \-\-rateest\-gt |
| 53 | \-\-rateest2 eth0 \-\-rateest\-bps2 2.5mbit \-j CONNMARK \-\-set\-mark 2 |
Jan Engelhardt | a47bb4a | 2008-08-15 22:13:57 +0200 | [diff] [blame] | 54 | .PP |
Jan Engelhardt | fea74bf | 2009-01-12 04:53:18 +0100 | [diff] [blame] | 55 | iptables \-t mangle \-A balance \-j CONNMARK \-\-restore\-mark |