diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-10-20 13:01:40 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-10-20 14:05:53 +0000 |
commit | 37c98dad5ce8f5e5144bc5412f7776d6a886fbbe (patch) | |
tree | 5887d269476213bc05875f8382a0f0dff175904b | |
parent | 5c651abae844b1dbddde33ca38164bde5d28ff46 (diff) | |
download | alpine_aports-37c98dad5ce8f5e5144bc5412f7776d6a886fbbe.tar.bz2 alpine_aports-37c98dad5ce8f5e5144bc5412f7776d6a886fbbe.tar.xz alpine_aports-37c98dad5ce8f5e5144bc5412f7776d6a886fbbe.zip |
main/iproute2-qos: misc bugfixes
fixed couple bugs and changed some logic how packets are being inspected
and classified.
(cherry picked from commit 0732f85009f5ce5a820b0c2ace2dc46e059b53ff)
-rw-r--r-- | main/iproute2-qos/APKBUILD | 10 | ||||
-rw-r--r-- | main/iproute2-qos/qos.eth0.sample | 97 | ||||
-rw-r--r-- | main/iproute2-qos/qos.ifb0.sample | 92 | ||||
-rw-r--r-- | main/iproute2-qos/qos.initd | 62 |
4 files changed, 158 insertions, 103 deletions
diff --git a/main/iproute2-qos/APKBUILD b/main/iproute2-qos/APKBUILD index 7190d5c761..bb0b27a6f3 100644 --- a/main/iproute2-qos/APKBUILD +++ b/main/iproute2-qos/APKBUILD | |||
@@ -1,8 +1,8 @@ | |||
1 | # Contributor: Ilya Strelkin <iilluzion@gmail.com> | 1 | # Contributor: Ilya Strelkin <iilluzion@gmail.com> |
2 | # Maintainer: Ilya Strelkin <iilluzion@gmail.com> | 2 | # Maintainer: Ilya Strelkin <iilluzion@gmail.com> |
3 | pkgname=iproute2-qos | 3 | pkgname=iproute2-qos |
4 | pkgver=0.2 | 4 | pkgver=0.3 |
5 | pkgrel=1 | 5 | pkgrel=0 |
6 | pkgdesc="Scripts to set up quality of service with iproute2" | 6 | pkgdesc="Scripts to set up quality of service with iproute2" |
7 | url="http://git.alpinelinux.org/cgit/aports" | 7 | url="http://git.alpinelinux.org/cgit/aports" |
8 | license="GPL" | 8 | license="GPL" |
@@ -19,7 +19,7 @@ build() { | |||
19 | "$pkgdir"/etc/conf.d/qos.ifb0.sample | 19 | "$pkgdir"/etc/conf.d/qos.ifb0.sample |
20 | } | 20 | } |
21 | 21 | ||
22 | md5sums="78c8edd233e081a167788b6198560b13 qos.initd | 22 | md5sums="dda96b445c6e4fe377e918f860825fb1 qos.initd |
23 | aeb793e4e1e7219bf245c06e29212048 qos.eth0.sample | 23 | 79cecb47b3d1f623d2f6790044b3afee qos.eth0.sample |
24 | d9bbf66187a62485450397c4e93d1293 qos.ifb0.sample | 24 | 9f8d3514081624ea2ad2606c1564c759 qos.ifb0.sample |
25 | 785aff5d4284c47038a009797c576e34 setup-qos" | 25 | 785aff5d4284c47038a009797c576e34 setup-qos" |
diff --git a/main/iproute2-qos/qos.eth0.sample b/main/iproute2-qos/qos.eth0.sample index a8d1d38567..1578dfa572 100644 --- a/main/iproute2-qos/qos.eth0.sample +++ b/main/iproute2-qos/qos.eth0.sample | |||
@@ -5,8 +5,8 @@ DEV=eth0 | |||
5 | IFB_DEV=ifb0 # Leave blank if $DEV is ifbX | 5 | IFB_DEV=ifb0 # Leave blank if $DEV is ifbX |
6 | 6 | ||
7 | # Internet EGRESS/INGRES rates in kbit or mbit. Measure this on a free line to gain precise value | 7 | # Internet EGRESS/INGRES rates in kbit or mbit. Measure this on a free line to gain precise value |
8 | EGRESS_RATE=1000kbit # 128kbit, 256kbit, 512kbit | 8 | EGRESS_RATE=512kbit # 128kbit, 256kbit, 512kbit |
9 | INGRESS_RATE=1000kbit # 256kbit, 512kbit, 1024kbit | 9 | INGRESS_RATE=2048kbit # 256kbit, 512kbit, 1024kbit |
10 | 10 | ||
11 | # In order to control a queue at the router/bridge side we will downgrade a real link speed on purpose | 11 | # In order to control a queue at the router/bridge side we will downgrade a real link speed on purpose |
12 | RATE_SUB_PERCENT=5 # 20, 10 | 12 | RATE_SUB_PERCENT=5 # 20, 10 |
@@ -23,7 +23,7 @@ DEV_RATE=50mbit | |||
23 | # prio: if rate is variable and you want to be sure that interactive traffic has ultimate priority | 23 | # prio: if rate is variable and you want to be sure that interactive traffic has ultimate priority |
24 | # none: if link is not congested | 24 | # none: if link is not congested |
25 | # | 25 | # |
26 | EGRESS_ALG=hfsc | 26 | EGRESS_ALG=htb |
27 | 27 | ||
28 | # EGRESS leaf Queuing Disciplines | 28 | # EGRESS leaf Queuing Disciplines |
29 | # | 29 | # |
@@ -31,9 +31,9 @@ EGRESS_ALG=hfsc | |||
31 | # sfq: TCP sessions or best-effort class traffic | 31 | # sfq: TCP sessions or best-effort class traffic |
32 | # red: hightly congested links or high-speed Internet [> 10Mbit/sec]) | 32 | # red: hightly congested links or high-speed Internet [> 10Mbit/sec]) |
33 | # | 33 | # |
34 | INTERACTIVE_LEAF_QDISC=pfifo | 34 | INTERACTIVE_LEAF_QDISC=pfifo |
35 | PRIVILEGED_LEAF_QDISC=pfifo | 35 | PRIVILEGED_LEAF_QDISC=pfifo |
36 | BESTEFFORT_LEAF_QDISC=red | 36 | BESTEFFORT_LEAF_QDISC=red |
37 | LAN_LEAF_QDISC=sfq | 37 | LAN_LEAF_QDISC=sfq |
38 | 38 | ||
39 | # INGRESS treatment | 39 | # INGRESS treatment |
@@ -50,21 +50,19 @@ INGRESS_ALG=ifb | |||
50 | # Maximum 100 filter items are allowed for each class. | 50 | # Maximum 100 filter items are allowed for each class. |
51 | # By default ALL unclassified traffic is being assined to Best-Effort class. | 51 | # By default ALL unclassified traffic is being assined to Best-Effort class. |
52 | 52 | ||
53 | # UDP | 53 | ################################### |
54 | INTERACTIVE_FILTER_1="protocol ip prio 100 u32 match ip protocol 0x11 0xff" | 54 | ### INTERACTIVE FILTERING RULES ### |
55 | 55 | ################################### | |
56 | # ICMP | ||
57 | INTERACTIVE_FILTER_2="protocol ip prio 100 u32 match ip protocol 0x1 0xff" | ||
58 | 56 | ||
59 | # ACK with payload < 64 bytes (32-bit version) | 57 | # ACK with payload < 64 bytes (32-bit version) |
60 | INTERACTIVE_FILTER_3="protocol ip prio 100 u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16 0x0000 0xffc0 at 2 match u8 0x10 0xff at 33" | 58 | INTERACTIVE_FILTER_10="protocol ip prio 10 u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16 0x0000 0xffc0 at 2 match u8 0x10 0xff at 33" |
61 | 59 | ||
62 | # ACK with payload < 64 bytes | 60 | # ACK with payload < 64 bytes |
63 | INTERACTIVE_FILTER_4="protocol ip prio 100 u32 match ip protocol 6 0xff match u8 0x10 0xff at nexthdr+13 match u16 0x0000 0xffc0 at 2" | 61 | INTERACTIVE_FILTER_11="protocol ip prio 11 u32 match ip protocol 6 0xff match u8 0x10 0xff at nexthdr+13 match u16 0x0000 0xffc0 at 2" |
64 | 62 | ||
65 | # PHB TOS HEX | 63 | # PHB TOS HEX NOTES |
66 | # -------------------------- | 64 | # ---------------------------------------------- |
67 | # 0x10 | 65 | # 0x10 SSH, IAX2 |
68 | # 0x18 | 66 | # 0x18 |
69 | # CS1 PRIORITY 0x20 | 67 | # CS1 PRIORITY 0x20 |
70 | # AF11 0x28 | 68 | # AF11 0x28 |
@@ -77,54 +75,77 @@ INTERACTIVE_FILTER_4="protocol ip prio 100 u32 match ip protocol 6 0xff match u8 | |||
77 | # AF23 0x58 | 75 | # AF23 0x58 |
78 | # | 76 | # |
79 | # CS5 CRITICAL 0xA0 | 77 | # CS5 CRITICAL 0xA0 |
80 | # EF 0xB8 | 78 | # EF 0xB8 IAX2, SIP Voice |
81 | # | 79 | # |
82 | # CS6 INTERNETWORKCONTROL 0xC0 | 80 | # CS6 INTERNETWORKCNTRL 0xC0 BGP (by default) |
83 | # CS7 NETWORKCONTROL 0xE0 | 81 | # CS7 NETWORKCONTROL 0xE0 |
84 | 82 | ||
85 | INTERACTIVE_FILTER_5="protocol ip prio 100 u32 match ip tos 0x10 0xff" | 83 | INTERACTIVE_FILTER_30="protocol ip prio 30 u32 match ip tos 0xb8 0xff" |
86 | INTERACTIVE_FILTER_6="protocol ip prio 100 u32 match ip tos 0x18 0xff" | 84 | INTERACTIVE_FILTER_31="protocol ip prio 31 u32 match ip tos 0x10 0xff" |
87 | INTERACTIVE_FILTER_7="protocol ip prio 100 u32 match ip tos 0xa0 0xff" | 85 | INTERACTIVE_FILTER_32="protocol ip prio 32 u32 match ip tos 0x18 0xff" |
88 | INTERACTIVE_FILTER_8="protocol ip prio 100 u32 match ip tos 0xb8 0xff" | 86 | INTERACTIVE_FILTER_33="protocol ip prio 33 u32 match ip tos 0xa0 0xff" |
87 | |||
88 | # UDP | ||
89 | INTERACTIVE_FILTER_90="protocol ip prio 90 u32 match ip protocol 0x11 0xff" | ||
90 | |||
91 | # ICMP | ||
92 | INTERACTIVE_FILTER_91="protocol ip prio 91 u32 match ip protocol 0x1 0xff" | ||
93 | |||
94 | ################################## | ||
95 | ### PRIVILEGED FILTERING RULES ### | ||
96 | ################################## | ||
89 | 97 | ||
90 | # SSH | 98 | # SSH |
91 | PRIVILEGED_FILTER_1="protocol ip prio 100 u32 match ip dport 22 0xffff" | 99 | PRIVILEGED_FILTER_20="protocol ip prio 20 u32 match ip dport 22 0xffff" |
92 | PRIVILEGED_FILTER_2="protocol ip prio 100 u32 match ip sport 22 0xffff" | 100 | PRIVILEGED_FILTER_21="protocol ip prio 21 u32 match ip sport 22 0xffff" |
93 | 101 | ||
94 | # Remote Desktop | 102 | # Remote Desktop |
95 | PRIVILEGED_FILTER_3="protocol ip prio 100 u32 match ip dport 3389 0xffff" | 103 | PRIVILEGED_FILTER_22="protocol ip prio 22 u32 match ip dport 3389 0xffff" |
96 | PRIVILEGED_FILTER_4="protocol ip prio 100 u32 match ip sport 3389 0xffff" | 104 | PRIVILEGED_FILTER_23="protocol ip prio 23 u32 match ip sport 3389 0xffff" |
97 | 105 | ||
98 | # ESP | 106 | # ESP |
99 | PRIVILEGED_FILTER_5="protocol ip prio 100 u32 match ip protocol 0x32 0xff" | 107 | PRIVILEGED_FILTER_50="protocol ip prio 50 u32 match ip protocol 0x32 0xff" |
100 | 108 | ||
101 | # AH | 109 | # AH |
102 | PRIVILEGED_FILTER_6="protocol ip prio 100 u32 match ip protocol 0x33 0xff" | 110 | PRIVILEGED_FILTER_51="protocol ip prio 51 u32 match ip protocol 0x33 0xff" |
111 | |||
112 | # IPSEC-NAT | ||
113 | PRIVILEGED_FILTER_52="protocol ip prio 52 u32 match ip protocol 0x11 0xff match ip dport 4500 0xffff" | ||
114 | PRIVILEGED_FILTER_53="protocol ip prio 53 u32 match ip protocol 0x11 0xff match ip sport 4500 0xffff" | ||
103 | 115 | ||
104 | # PHB TOS HEX | 116 | # PHB TOS HEX NOTES |
105 | # -------------------------- | 117 | # -------------------------------------- |
106 | # CS3 FLASH 0x60 | 118 | # CS3 FLASH 0x60 SIP signaling |
107 | # AF31 0x68 | 119 | # AF31 0x68 |
108 | # AF32 0x70 | 120 | # AF32 0x70 |
109 | # AF33 0x78 | 121 | # AF33 0x78 |
110 | # | 122 | # |
111 | # CS4 FLASHOVERRIDE 0x80 | 123 | # CS4 FLASHOVERRIDE 0x80 |
112 | # AF41 0x88 | 124 | # AF41 0x88 SIP Video |
113 | # AF42 0x90 | 125 | # AF42 0x90 |
114 | # AF43 0x98 | 126 | # AF43 0x98 |
115 | 127 | ||
116 | PRIVILEGED_FILTER_7="protocol ip prio 100 u32 match ip tos 0x88 0xff" | 128 | PRIVILEGED_FILTER_80="protocol ip prio 80 u32 match ip tos 0x60 0xff" |
129 | PRIVILEGED_FILTER_81="protocol ip prio 81 u32 match ip tos 0x88 0xff" | ||
117 | 130 | ||
118 | # IPSEC-NAT | 131 | ################################### |
119 | PRIVILEGED_FILTER_8="protocol ip prio 90 u32 match ip protocol 0x11 0xff match ip dport 4500 0xffff" | 132 | ### BEST-EFFORT FILTERING RULES ### |
120 | PRIVILEGED_FILTER_9="protocol ip prio 90 u32 match ip protocol 0x11 0xff match ip sport 4500 0xffff" | 133 | ################################### |
121 | 134 | ||
135 | BESTEFFORT_FILTER_85="protocol ip prio 85 u32 match ip tos 0x4 0xff" | ||
136 | BESTEFFORT_FILTER_86="protocol ip prio 86 u32 match ip tos 0x6 0xff" | ||
137 | BESTEFFORT_FILTER_87="protocol ip prio 87 u32 match ip tos 0x90 0xff" | ||
138 | BESTEFFORT_FILTER_88="protocol ip prio 88 u32 match ip tos 0x98 0xff" | ||
122 | 139 | ||
123 | # Example: Any traffic from/to 192.168.1.0/24 network will be classified as best-effort | 140 | # Example: Any traffic from/to 192.168.1.0/24 network will be classified as best-effort |
124 | # | 141 | # |
125 | ### BESTEFFORT_FILTER_1="protocol ip prio 3 u32 match ip src 192.168.1.0/24" | 142 | ### BESTEFFORT_FILTER_5="protocol ip prio 10 u32 match ip src 192.168.1.0/24" |
126 | ### BESTEFFORT_FILTER_2="protocol ip prio 4 u32 match ip dst 192.168.1.0/24" | 143 | ### BESTEFFORT_FILTER_6="protocol ip prio 11 u32 match ip dst 192.168.1.0/24" |
144 | |||
145 | ########################### | ||
146 | ### LAN FILTERING RULES ### | ||
147 | ########################### | ||
127 | 148 | ||
128 | # Example: Traffic Originated from router | 149 | # Example: Traffic Originated from router |
129 | # | 150 | # |
130 | ###LAN_FILTER_1="protocol ip prio 10 u32 match ip src 192.168.1.10" \ No newline at end of file | 151 | ###LAN_FILTER_10="protocol ip prio 10 u32 match ip src 192.168.1.10" |
diff --git a/main/iproute2-qos/qos.ifb0.sample b/main/iproute2-qos/qos.ifb0.sample index 2f382b27f5..f71ef68ac5 100644 --- a/main/iproute2-qos/qos.ifb0.sample +++ b/main/iproute2-qos/qos.ifb0.sample | |||
@@ -5,8 +5,8 @@ DEV=ifb0 | |||
5 | IFB_DEV= # Leave it blank if $DEV is ifbX | 5 | IFB_DEV= # Leave it blank if $DEV is ifbX |
6 | 6 | ||
7 | # Internet EGRESS/INGRES rates in kbit or mbit. Measure this on a free line to gain precise value | 7 | # Internet EGRESS/INGRES rates in kbit or mbit. Measure this on a free line to gain precise value |
8 | EGRESS_RATE=1000kbit # 128kbit, 256kbit, 512kbit | 8 | EGRESS_RATE=2048bit # 256kbit, 512kbit, 1024kbit |
9 | INGRESS_RATE=1000kbit # 256kbit, 512kbit, 1024kbit | 9 | INGRESS_RATE=512kbit # 128kbit, 256kbit, 512kbit |
10 | 10 | ||
11 | # In order to control a queue at the router/bridge side we will downgrade a real link speed on purpose | 11 | # In order to control a queue at the router/bridge side we will downgrade a real link speed on purpose |
12 | RATE_SUB_PERCENT=5 # 20, 10 | 12 | RATE_SUB_PERCENT=5 # 20, 10 |
@@ -50,21 +50,19 @@ INGRESS_ALG=none | |||
50 | # Maximum 100 filter items are allowed for each class. | 50 | # Maximum 100 filter items are allowed for each class. |
51 | # By default ALL unclassified traffic is being assined to Best-Effort class. | 51 | # By default ALL unclassified traffic is being assined to Best-Effort class. |
52 | 52 | ||
53 | # UDP | 53 | ################################### |
54 | INTERACTIVE_FILTER_1="protocol ip prio 100 u32 match ip protocol 0x11 0xff" | 54 | ### INTERACTIVE FILTERING RULES ### |
55 | 55 | ################################### | |
56 | # ICMP | ||
57 | INTERACTIVE_FILTER_2="protocol ip prio 100 u32 match ip protocol 0x1 0xff" | ||
58 | 56 | ||
59 | # ACK with payload < 64 bytes (32-bit version) | 57 | # ACK with payload < 64 bytes (32-bit version) |
60 | INTERACTIVE_FILTER_3="protocol ip prio 100 u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16 0x0000 0xffc0 at 2 match u8 0x10 0xff at 33" | 58 | INTERACTIVE_FILTER_10="protocol ip prio 10 u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16 0x0000 0xffc0 at 2 match u8 0x10 0xff at 33" |
61 | 59 | ||
62 | # ACK with payload < 64 bytes | 60 | # ACK with payload < 64 bytes |
63 | INTERACTIVE_FILTER_4="protocol ip prio 100 u32 match ip protocol 6 0xff match u8 0x10 0xff at nexthdr+13 match u16 0x0000 0xffc0 at 2" | 61 | INTERACTIVE_FILTER_11="protocol ip prio 11 u32 match ip protocol 6 0xff match u8 0x10 0xff at nexthdr+13 match u16 0x0000 0xffc0 at 2" |
64 | 62 | ||
65 | # PHB TOS HEX | 63 | # PHB TOS HEX NOTES |
66 | # -------------------------- | 64 | # ---------------------------------------------- |
67 | # 0x10 | 65 | # 0x10 SSH, IAX2 |
68 | # 0x18 | 66 | # 0x18 |
69 | # CS1 PRIORITY 0x20 | 67 | # CS1 PRIORITY 0x20 |
70 | # AF11 0x28 | 68 | # AF11 0x28 |
@@ -77,55 +75,77 @@ INTERACTIVE_FILTER_4="protocol ip prio 100 u32 match ip protocol 6 0xff match u8 | |||
77 | # AF23 0x58 | 75 | # AF23 0x58 |
78 | # | 76 | # |
79 | # CS5 CRITICAL 0xA0 | 77 | # CS5 CRITICAL 0xA0 |
80 | # EF 0xB8 | 78 | # EF 0xB8 IAX2, SIP Voice |
81 | # | 79 | # |
82 | # CS6 INTERNETWORKCONTROL 0xC0 | 80 | # CS6 INTERNETWORKCNTRL 0xC0 BGP (by default) |
83 | # CS7 NETWORKCONTROL 0xE0 | 81 | # CS7 NETWORKCONTROL 0xE0 |
84 | 82 | ||
85 | INTERACTIVE_FILTER_5="protocol ip prio 100 u32 match ip tos 0x10 0xff" | 83 | INTERACTIVE_FILTER_30="protocol ip prio 30 u32 match ip tos 0xb8 0xff" |
86 | INTERACTIVE_FILTER_6="protocol ip prio 100 u32 match ip tos 0x18 0xff" | 84 | INTERACTIVE_FILTER_31="protocol ip prio 31 u32 match ip tos 0x10 0xff" |
87 | INTERACTIVE_FILTER_7="protocol ip prio 100 u32 match ip tos 0xa0 0xff" | 85 | INTERACTIVE_FILTER_32="protocol ip prio 32 u32 match ip tos 0x18 0xff" |
88 | INTERACTIVE_FILTER_8="protocol ip prio 100 u32 match ip tos 0xb8 0xff" | 86 | INTERACTIVE_FILTER_33="protocol ip prio 33 u32 match ip tos 0xa0 0xff" |
87 | |||
88 | # UDP | ||
89 | INTERACTIVE_FILTER_90="protocol ip prio 90 u32 match ip protocol 0x11 0xff" | ||
90 | |||
91 | # ICMP | ||
92 | INTERACTIVE_FILTER_91="protocol ip prio 91 u32 match ip protocol 0x1 0xff" | ||
89 | 93 | ||
94 | ################################## | ||
95 | ### PRIVILEGED FILTERING RULES ### | ||
96 | ################################## | ||
90 | 97 | ||
91 | # SSH | 98 | # SSH |
92 | PRIVILEGED_FILTER_1="protocol ip prio 100 u32 match ip dport 22 0xffff" | 99 | PRIVILEGED_FILTER_20="protocol ip prio 20 u32 match ip dport 22 0xffff" |
93 | PRIVILEGED_FILTER_2="protocol ip prio 100 u32 match ip sport 22 0xffff" | 100 | PRIVILEGED_FILTER_21="protocol ip prio 21 u32 match ip sport 22 0xffff" |
94 | 101 | ||
95 | # Remote Desktop | 102 | # Remote Desktop |
96 | PRIVILEGED_FILTER_3="protocol ip prio 100 u32 match ip dport 3389 0xffff" | 103 | PRIVILEGED_FILTER_22="protocol ip prio 22 u32 match ip dport 3389 0xffff" |
97 | PRIVILEGED_FILTER_4="protocol ip prio 100 u32 match ip sport 3389 0xffff" | 104 | PRIVILEGED_FILTER_23="protocol ip prio 23 u32 match ip sport 3389 0xffff" |
98 | 105 | ||
99 | # ESP | 106 | # ESP |
100 | PRIVILEGED_FILTER_5="protocol ip prio 100 u32 match ip protocol 0x32 0xff" | 107 | PRIVILEGED_FILTER_50="protocol ip prio 50 u32 match ip protocol 0x32 0xff" |
101 | 108 | ||
102 | # AH | 109 | # AH |
103 | PRIVILEGED_FILTER_6="protocol ip prio 100 u32 match ip protocol 0x33 0xff" | 110 | PRIVILEGED_FILTER_51="protocol ip prio 51 u32 match ip protocol 0x33 0xff" |
111 | |||
112 | # IPSEC-NAT | ||
113 | PRIVILEGED_FILTER_52="protocol ip prio 52 u32 match ip protocol 0x11 0xff match ip dport 4500 0xffff" | ||
114 | PRIVILEGED_FILTER_53="protocol ip prio 53 u32 match ip protocol 0x11 0xff match ip sport 4500 0xffff" | ||
104 | 115 | ||
105 | # PHB TOS HEX | 116 | # PHB TOS HEX NOTES |
106 | # -------------------------- | 117 | # -------------------------------------- |
107 | # CS3 FLASH 0x60 | 118 | # CS3 FLASH 0x60 SIP signaling |
108 | # AF31 0x68 | 119 | # AF31 0x68 |
109 | # AF32 0x70 | 120 | # AF32 0x70 |
110 | # AF33 0x78 | 121 | # AF33 0x78 |
111 | # | 122 | # |
112 | # CS4 FLASHOVERRIDE 0x80 | 123 | # CS4 FLASHOVERRIDE 0x80 |
113 | # AF41 0x88 | 124 | # AF41 0x88 SIP Video |
114 | # AF42 0x90 | 125 | # AF42 0x90 |
115 | # AF43 0x98 | 126 | # AF43 0x98 |
116 | 127 | ||
117 | PRIVILEGED_FILTER_7="protocol ip prio 100 u32 match ip tos 0x88 0xff" | 128 | PRIVILEGED_FILTER_80="protocol ip prio 80 u32 match ip tos 0x60 0xff" |
129 | PRIVILEGED_FILTER_81="protocol ip prio 81 u32 match ip tos 0x88 0xff" | ||
118 | 130 | ||
119 | # IPSEC-NAT | 131 | ################################### |
120 | PRIVILEGED_FILTER_8="protocol ip prio 90 u32 match ip protocol 0x11 0xff match ip dport 4500 0xffff" | 132 | ### BEST-EFFORT FILTERING RULES ### |
121 | PRIVILEGED_FILTER_9="protocol ip prio 90 u32 match ip protocol 0x11 0xff match ip sport 4500 0xffff" | 133 | ################################### |
122 | 134 | ||
135 | BESTEFFORT_FILTER_85="protocol ip prio 85 u32 match ip tos 0x4 0xff" | ||
136 | BESTEFFORT_FILTER_86="protocol ip prio 86 u32 match ip tos 0x6 0xff" | ||
137 | BESTEFFORT_FILTER_87="protocol ip prio 87 u32 match ip tos 0x90 0xff" | ||
138 | BESTEFFORT_FILTER_88="protocol ip prio 88 u32 match ip tos 0x98 0xff" | ||
123 | 139 | ||
124 | # Example: Any traffic from/to 192.168.1.0/24 network will be classified as best-effort | 140 | # Example: Any traffic from/to 192.168.1.0/24 network will be classified as best-effort |
125 | # | 141 | # |
126 | ### BESTEFFORT_FILTER_1="protocol ip prio 3 u32 match ip src 192.168.1.0/24" | 142 | ### BESTEFFORT_FILTER_5="protocol ip prio 10 u32 match ip src 192.168.1.0/24" |
127 | ### BESTEFFORT_FILTER_2="protocol ip prio 4 u32 match ip dst 192.168.1.0/24" | 143 | ### BESTEFFORT_FILTER_6="protocol ip prio 11 u32 match ip dst 192.168.1.0/24" |
144 | |||
145 | ########################### | ||
146 | ### LAN FILTERING RULES ### | ||
147 | ########################### | ||
128 | 148 | ||
129 | # Example: Traffic Originated from router | 149 | # Example: Traffic Originated from router |
130 | # | 150 | # |
131 | ###LAN_FILTER_1="protocol ip prio 10 u32 match ip src 192.168.1.10" \ No newline at end of file | 151 | ###LAN_FILTER_10="protocol ip prio 10 u32 match ip src 192.168.1.10" |
diff --git a/main/iproute2-qos/qos.initd b/main/iproute2-qos/qos.initd index b2d33f0437..9986a8cce4 100644 --- a/main/iproute2-qos/qos.initd +++ b/main/iproute2-qos/qos.initd | |||
@@ -84,8 +84,14 @@ configure() | |||
84 | # Calculaton of WAN classes rates | 84 | # Calculaton of WAN classes rates |
85 | WAN_SUB_RATE=$((WAN_RATE - (RATE_SUB_PERCENT * WAN_RATE / 100))) | 85 | WAN_SUB_RATE=$((WAN_RATE - (RATE_SUB_PERCENT * WAN_RATE / 100))) |
86 | INTERACTIVE_RATE=$((WAN_SUB_RATE / 5)) | 86 | INTERACTIVE_RATE=$((WAN_SUB_RATE / 5)) |
87 | if [ $INTERACTIVE_RATE -lt 75000 ]; then | ||
88 | INTERACTIVE_RATE=75000 | ||
89 | PRIVILEGED_RATE=$(((WAN_SUB_RATE - 75000) / 2)) | ||
90 | BESTEFFORT_RATE=$(((WAN_SUB_RATE - 75000) / 2)) | ||
91 | else | ||
87 | PRIVILEGED_RATE=$((WAN_SUB_RATE / 2)) | 92 | PRIVILEGED_RATE=$((WAN_SUB_RATE / 2)) |
88 | BESTEFFORT_RATE=$((WAN_SUB_RATE / 3)) | 93 | BESTEFFORT_RATE=$((WAN_SUB_RATE / 3)) |
94 | fi | ||
89 | 95 | ||
90 | DEV_RATE=${DEV_RATE:-$EGRESS_RATE} | 96 | DEV_RATE=${DEV_RATE:-$EGRESS_RATE} |
91 | DEV_RATE=`bits $DEV_RATE` | 97 | DEV_RATE=`bits $DEV_RATE` |
@@ -99,12 +105,10 @@ configure() | |||
99 | INTERACTIVE_PRIO_BURST=$((INTERACTIVE_RATE / 100 / 8)) | 105 | INTERACTIVE_PRIO_BURST=$((INTERACTIVE_RATE / 100 / 8)) |
100 | 106 | ||
101 | INTERACTIVE_HFSC_DMAX=50000 | 107 | INTERACTIVE_HFSC_DMAX=50000 |
102 | INTERACTIVE_HFSC_UMAX=$((INTERACTIVE_RATE * INTERACTIVE_HFSC_DMAX / 1000 / 1000)) | 108 | INTERACTIVE_HFSC_UMAX=1500 |
103 | [ $INTERACTIVE_HFSC_UMAX -gt 1500 ] && INTERACTIVE_HFSC_UMAX=1500 | ||
104 | 109 | ||
105 | PRIVILEGED_HFSC_DMAX=100000 | 110 | PRIVILEGED_HFSC_DMAX=100000 |
106 | PRIVILEGED_HFSC_UMAX=$((PRIVILEGED_RATE * PRIVILEGED_HFSC_DMAX / 1000 / 1000)) | 111 | PRIVILEGED_HFSC_UMAX=1500 |
107 | [ $PRIVILEGED_HFSC_UMAX -gt 1500 ] && PRIVILEGED_HFSC_UMAX=1500 | ||
108 | 112 | ||
109 | # Random Early Detect (RED) parameters calculation: | 113 | # Random Early Detect (RED) parameters calculation: |
110 | # min = maximum delay * rate (dalay ~ 200ms = 0.2sec) [b] | 114 | # min = maximum delay * rate (dalay ~ 200ms = 0.2sec) [b] |
@@ -123,9 +127,18 @@ configure() | |||
123 | RED_LIMIT=$((8 * RED_MAX)) | 127 | RED_LIMIT=$((8 * RED_MAX)) |
124 | 128 | ||
125 | # Setting leaf Queuing Disciplines parameters | 129 | # Setting leaf Queuing Disciplines parameters |
126 | INTERACTIVE_LEAF_QDISC=`expand_leaf_qdisc $INTERACTIVE_LEAF_QDISC` | 130 | INTERACTIVE_LEAF_QDISC=pfifo |
127 | PRIVILEGED_LEAF_QDISC=`expand_leaf_qdisc $PRIVILEGED_LEAF_QDISC` | 131 | INTERACTIVE_LEAF_QDISC=`expand_leaf_qdisc $INTERACTIVE_LEAF_QDISC` |
132 | PRIVILEGED_LEAF_QDISC=pfifo | ||
133 | PRIVILEGED_LEAF_QDISC=`expand_leaf_qdisc $PRIVILEGED_LEAF_QDISC` | ||
134 | |||
135 | # Force using SFQ in case rate is less than 2mbit | ||
136 | if [ $BESTEFFORT_RATE -lt 2097152 ]; then | ||
137 | BESTEFFORT_LEAF_QDISC=sfq | ||
138 | fi | ||
128 | BESTEFFORT_LEAF_QDISC=`expand_leaf_qdisc $BESTEFFORT_LEAF_QDISC` | 139 | BESTEFFORT_LEAF_QDISC=`expand_leaf_qdisc $BESTEFFORT_LEAF_QDISC` |
140 | |||
141 | LAN_LEAF_QDISC=sfq | ||
129 | LAN_LEAF_QDISC=`expand_leaf_qdisc $LAN_LEAF_QDISC` | 142 | LAN_LEAF_QDISC=`expand_leaf_qdisc $LAN_LEAF_QDISC` |
130 | fi | 143 | fi |
131 | } | 144 | } |
@@ -182,23 +195,26 @@ set_filters() | |||
182 | BESTEFFORT_FILTER_FLOWID=60 | 195 | BESTEFFORT_FILTER_FLOWID=60 |
183 | LAN_FILTER_FLOWID=70 | 196 | LAN_FILTER_FLOWID=70 |
184 | 197 | ||
185 | for CLASS_TYPE in $CLASS_TYPES; do | 198 | { |
186 | if [ "$QDISC_CMD" = "prio" -a "$CLASS_TYPE" = "INTERACTIVE" ]; then | 199 | for CLASS_TYPE in $CLASS_TYPES; do |
187 | PARENT_CLASSID=1 | 200 | if [ "$QDISC_CMD" = "prio" -a "$CLASS_TYPE" = "INTERACTIVE" ]; then |
188 | INTERACTIVE_FILTER_FLOWID=1 | 201 | PARENT_CLASSID=1 |
189 | else | 202 | INTERACTIVE_FILTER_FLOWID=1 |
190 | PARENT_CLASSID=$1 | 203 | else |
191 | PARENT_CLASSID=${PARENT_CLASSID:-1} | 204 | PARENT_CLASSID=$1 |
192 | INTERACTIVE_FILTER_FLOWID=40 | 205 | PARENT_CLASSID=${PARENT_CLASSID:-1} |
193 | fi | 206 | INTERACTIVE_FILTER_FLOWID=40 |
194 | 207 | fi | |
195 | for FILTER_NUM in `seq 1 100`; do | 208 | |
196 | eval FILTER="\$$CLASS_TYPE"_FILTER_$FILTER_NUM | 209 | for FILTER_NUM in `seq 1 100`; do |
197 | [ -z "$FILTER" ] && break | 210 | eval FILTER="\$$CLASS_TYPE"_FILTER_$FILTER_NUM |
198 | eval FILTER_FLOWID="\$$CLASS_TYPE"_FILTER_FLOWID | 211 | if [ ! -z "$FILTER" ]; then |
199 | $ECHO tc filter add dev $DEV parent $PARENT_CLASSID:0 $FILTER flowid $PARENT_CLASSID:$FILTER_FLOWID | 212 | eval FILTER_FLOWID="\$$CLASS_TYPE"_FILTER_FLOWID |
213 | $ECHO tc filter add dev $DEV parent $PARENT_CLASSID:0 $FILTER flowid $PARENT_CLASSID:$FILTER_FLOWID | ||
214 | fi | ||
215 | done | ||
200 | done | 216 | done |
201 | done | 217 | } | sort -g |
202 | 218 | ||
203 | $ECHO | 219 | $ECHO |
204 | } | 220 | } |
@@ -402,8 +418,6 @@ start() | |||
402 | fi | 418 | fi |
403 | done | 419 | done |
404 | 420 | ||
405 | describe > /tmp/$$ | ||
406 | |||
407 | if [ $DEBUG -eq 0 ]; then | 421 | if [ $DEBUG -eq 0 ]; then |
408 | eend $? | 422 | eend $? |
409 | fi | 423 | fi |