vasek00 DD-WRT Guru
Joined: 06 Nov 2010 Posts: 3312
|
Posted: Sun Feb 08, 2015 14:05 Post subject: Qos settings r26081 Asus RT-N13U B1 |
|
Qos settings r26081 Asus RT-N13U B1.
On the client the torrent (port 55557), and also work of the client viewing of pages of the Internet is started. Qos doesn't work, doesn't limit a stream from a program torrent to put according to settings of speed. UL=9900
On settings we receive.
Code: | 1:100 rate 5940Kbit ceil 9900Kbit burst 9023b от 5.9 Mbit prio 0 handle 0x64 fw Maximum
1:10 rate 2475Kbit ceil 9900Kbit burst 4692b от 2.5 Mbit prio 1 handle 0x0A fw Premium
1:20 rate 990000bit ceil 9900Kbit burst 2836b от 0.9 Mbit prio 2 handle 0x14 fw Express
1:30 rate 495000bit ceil 9900Kbit burst 2217b от 0.5 Mbit prio 5 handle 0x1E fw Standard
1:40 rate 99000bit ceil 9900Kbit burst 1722b от 0.09 Mbit prio 7 handle 0x28 fw Bulk
|
Code: | root@My-Fan:~# svqos status ppp0
Interface: ppp0
qdisc htb 1: root refcnt 2 r2q 10 default 30 direct_packets_stat 0
Sent 48294356 bytes 214933 pkt (dropped 106, overlimits 2779 requeues 82)
backlog 0b 0p requeues 82
qdisc sfq 100: parent 1:100 limit 127p quantum 1478b perturb 10sec
Sent 2185644 bytes 41211 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
qdisc sfq 10: parent 1:10 limit 127p quantum 1478b perturb 10sec
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
...
class htb 1:6 parent 1:1 rate 99000bit ceil 9900Kbit burst 1722b cburst 13972b
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 0 borrowed: 0 giants: 0
tokens: 2175500 ctokens: 176437
Interface:
Interface:
root@My-Fan:~#
root@My-Fan:~# tc -d -s filter sh dev ppp0
root@My-Fan:~#
root@My-Fan:~# iptables -t mangle -nvL
Chain PREROUTING (policy ACCEPT 2077 packets, 267K bytes)
pkts bytes target prot opt in out source destination
1924 238K FILTER_IN 0 -- * * 0.0.0.0/0 0.0.0.0/0
0 0 MARK 0 -- !ppp0 * 0.0.0.0/0 xx.xx.xx.xx MARK or 0x80000000
2077 267K CONNMARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK save
Chain INPUT (policy ACCEPT 1596 packets, 266K bytes)
pkts bytes target prot opt in out source destination
6 918 IMQ 0 -- ppp0 * 0.0.0.0/0 0.0.0.0/0 IMQ: todev 0
Chain FORWARD (policy ACCEPT 138 packets, 18366 bytes)
pkts bytes target prot opt in out source destination
22 1284 TCPMSS tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x06/0x02 TCPMSS clamp to PMTU
64 10845 IMQ 0 -- ppp0 * 0.0.0.0/0 0.0.0.0/0 IMQ: todev 0
Chain OUTPUT (policy ACCEPT 689 packets, 90866 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 1878 packets, 792K bytes)
pkts bytes target prot opt in out source destination
808 94125 FILTER_OUT 0 -- * * 0.0.0.0/0 0.0.0.0/0
2 80 DSCP 0 -- * * 0.0.0.0/0 0.0.0.0/0 DSCP match !0x00 DSCP set 0x00
Chain FILTER_IN (1 references)
pkts bytes target prot opt in out source destination
1924 238K CONNMARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK restore
1792 221K SVQOS_SVCS 0 -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x7ffc00
1922 238K CONNMARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK save
1922 238K RETURN 0 -- * * 0.0.0.0/0 0.0.0.0/0
Chain FILTER_OUT (1 references)
pkts bytes target prot opt in out source destination
808 94125 CONNMARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK restore
645 73276 SVQOS_SVCS 0 -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x7ffc00
196 10165 CLASSIFY tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x10/0x10 length 0:64 CLASSIFY set 1:100
56 3324 CLASSIFY tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x02/0x02 length 0:64 CLASSIFY set 1:100
806 94019 CONNMARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK save
806 94019 RETURN 0 -- * * 0.0.0.0/0 0.0.0.0/0
Chain SVQOS_SVCS (2 references)
pkts bytes target prot opt in out source destination
2 165 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 MARK xset 0x2800/0x7ffc00
6 918 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:443 MARK xset 0x2800/0x7ffc00
6 366 MARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 LAYER7 l7proto dns MARK xset 0x19000/0x7ffc00
0 0 MARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 LAYER7 l7proto html MARK xset 0x2800/0x7ffc00
35 13790 MARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 LAYER7 l7proto http MARK xset 0x2800/0x7ffc00
0 0 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 ipp2p v0.8.2 --bit MARK xset 0xa000/0x7ffc00
23 2185 MARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 length 0:550 LAYER7 l7proto bt MARK xset 0xa000/0x7ffc00
0 0 MARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 LAYER7 l7proto bt2 MARK xset 0xa000/0x7ffc00
0 0 MARK udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:55557 MARK xset 0xa000/0x7ffc00
23 2185 MARK udp -- * * 0.0.0.0/0 0.0.0.0/0 udp spt:55557 MARK xset 0xa000/0x7ffc00
0 0 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:55557 MARK xset 0xa000/0x7ffc00
0 0 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:55557 MARK xset 0xa000/0x7ffc00
2433 294K RETURN 0 -- * * 0.0.0.0/0 0.0.0.0/0
root@My-Fan:~#
|
Restrictions for a torrent of the program aren't present, continues to work at a maximum. Add filter :
Code: | root@My-Fan:~# /usr/sbin/tc filter add dev ppp0 protocol ip pref 1 handle 0x64 fw classid 1:100
root@My-Fan:~# /usr/sbin/tc filter add dev ppp0 protocol ip pref 3 handle 0x0A fw classid 1:10
root@My-Fan:~# /usr/sbin/tc filter add dev ppp0 protocol ip pref 5 handle 0x14 fw classid 1:20
root@My-Fan:~# /usr/sbin/tc filter add dev ppp0 protocol ip pref 8 handle 0x1E fw classid 1:30
root@My-Fan:~# /usr/sbin/tc filter add dev ppp0 protocol ip pref 9 handle 0x28 fw classid 1:40
root@My-Fan:~# svqos status ppp0
...
class htb 1:6 parent 1:1 rate 99000bit ceil 9900Kbit burst 1722b cburst 13972b
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 0 borrowed: 0 giants: 0
tokens: 2175500 ctokens: 176437
filter parent 1: protocol ip pref 1 fw
filter parent 1: protocol ip pref 1 fw handle 0x64 classid 1:100
filter parent 1: protocol ip pref 3 fw
filter parent 1: protocol ip pref 3 fw handle 0xa classid 1:10
filter parent 1: protocol ip pref 5 fw
filter parent 1: protocol ip pref 5 fw handle 0x14 classid 1:20
filter parent 1: protocol ip pref 8 fw
filter parent 1: protocol ip pref 8 fw handle 0x1e classid 1:30
filter parent 1: protocol ip pref 9 fw
filter parent 1: protocol ip pref 9 fw handle 0x28 classid 1:40
Interface:
Interface:
root@My-Fan:~#
root@My-Fan:~# iptables -t mangle -nvL
Chain PREROUTING (policy ACCEPT 35158 packets, 4537K bytes)
pkts bytes target prot opt in out source destination
35005 4508K FILTER_IN 0 -- * * 0.0.0.0/0 0.0.0.0/0
0 0 MARK 0 -- !ppp0 * 0.0.0.0/0 xx.xx.xx.xx MARK or 0x80000000
35158 4537K CONNMARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK save
Chain INPUT (policy ACCEPT 18849 packets, 3864K bytes)
pkts bytes target prot opt in out source destination
8 1533 IMQ 0 -- ppp0 * 0.0.0.0/0 0.0.0.0/0 IMQ: todev 0
Chain FORWARD (policy ACCEPT 281 packets, 44094 bytes)
pkts bytes target prot opt in out source destination
24 1396 TCPMSS tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x06/0x02 TCPMSS clamp to PMTU
142 29192 IMQ 0 -- ppp0 * 0.0.0.0/0 0.0.0.0/0 IMQ: todev 0
Chain OUTPUT (policy ACCEPT 12657 packets, 4649K bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 14225 packets, 5453K bytes)
pkts bytes target prot opt in out source destination
13155 4755K FILTER_OUT 0 -- * * 0.0.0.0/0 0.0.0.0/0
5 341 DSCP 0 -- * * 0.0.0.0/0 0.0.0.0/0 DSCP match !0x00 DSCP set 0x00
Chain FILTER_IN (1 references)
pkts bytes target prot opt in out source destination
35005 4508K CONNMARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK restore
31290 4287K SVQOS_SVCS 0 -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x7ffc00
35003 4508K CONNMARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK save
35003 4508K RETURN 0 -- * * 0.0.0.0/0 0.0.0.0/0
Chain FILTER_OUT (1 references)
pkts bytes target prot opt in out source destination
13155 4755K CONNMARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK restore
7631 994K SVQOS_SVCS 0 -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x7ffc00
4157 226K CLASSIFY tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x10/0x10 length 0:64 CLASSIFY set 1:100
1099 65896 CLASSIFY tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x02/0x02 length 0:64 CLASSIFY set 1:100
13153 4755K CONNMARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK save
13153 4755K RETURN 0 -- * * 0.0.0.0/0 0.0.0.0/0
Chain SVQOS_SVCS (2 references)
pkts bytes target prot opt in out source destination
3 225 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 MARK xset 0x2800/0x7ffc00
6 918 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:443 MARK xset 0x2800/0x7ffc00
11 674 MARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 LAYER7 l7proto dns MARK xset 0x19000/0x7ffc00
0 0 MARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 LAYER7 l7proto html MARK xset 0x2800/0x7ffc00
1078 499K MARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 LAYER7 l7proto http MARK xset 0x2800/0x7ffc00
0 0 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 ipp2p v0.8.2 --bit MARK xset 0xa000/0x7ffc00
61 5795 MARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 length 0:550 LAYER7 l7proto bt MARK xset 0xa000/0x7ffc00
0 0 MARK 0 -- * * 0.0.0.0/0 0.0.0.0/0 LAYER7 l7proto bt2 MARK xset 0xa000/0x7ffc00
0 0 MARK udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:55557 MARK xset 0xa000/0x7ffc00
61 5795 MARK udp -- * * 0.0.0.0/0 0.0.0.0/0 udp spt:55557 MARK xset 0xa000/0x7ffc00
0 0 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:55557 MARK xset 0xa000/0x7ffc00
0 0 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:55557 MARK xset 0xa000/0x7ffc00
38917 5281K RETURN 0 -- * * 0.0.0.0/0 0.0.0.0/0
root@My-Fan:~# |
Restrictions on a torrent - No, also for viewing of pages of full speed - No. |
|
liverpoolatnight DD-WRT User
Joined: 29 May 2008 Posts: 243 Location: United Kingdom
|
Posted: Mon Feb 09, 2015 23:32 Post subject: |
|
You could try this script as it seem to work much better then QoS built into DD-WRT, Tryed and tested on my D-Link DIR-615 D2 on build r26138 http://www.dd-wrt.com/phpBB2/viewtopic.php?p=241408 & use http://www.endmemo.com/sconvert/kbpsmbps.php to convert Mbps to Kbps
For example, I have done a quick script for you to pass my time in work
Downlink 8Mbps (8192kbps)
Uplink 1Mb (1024kbps)
ppp0 - WAN/Intenet port?
This scipt will tell all traffic on ports 1024 to 65535 are class as Bulk, HTTP 80 Highest and HTTPS 443 High
Administration > Commands > Copy and Paste this into Firewall
Code: | #WRT54 Script Generator v1.02
#(C) 2006-2007 Robert "Robson" Mytkowski
#--------------------------------------------
TCA="tc class add dev ppp0"
TFA="tc filter add dev ppp0"
TQA="tc qdisc add dev ppp0"
SFQ="sfq perturb 10"
tc qdisc del dev ppp0 root
tc qdisc add dev ppp0 root handle 1: htb
tc class add dev ppp0 parent 1: classid 1:1 htb rate 8192kbit
$TCA parent 1:1 classid 1:10 htb rate 4096kbit ceil 8192kbit prio 0
$TCA parent 1:1 classid 1:11 htb rate 3072kbit ceil 8192kbit prio 1
$TCA parent 1:1 classid 1:12 htb rate 1024kbit ceil 8192kbit prio 4
$TQA parent 1:10 handle 10: $SFQ
$TQA parent 1:11 handle 11: $SFQ
$TQA parent 1:12 handle 12: $SFQ
$TFA parent 1:0 prio 0 protocol ip handle 10 fw flowid 1:10
$TFA parent 1:0 prio 1 protocol ip handle 11 fw flowid 1:11
$TFA parent 1:0 prio 4 protocol ip handle 12 fw flowid 1:12
iptables -t mangle -A POSTROUTING -p tcp --sport 80 -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -p tcp --sport 443 -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -p tcp --sport 1024:65535 -j MARK --set-mark 12
TCAU="tc class add dev imq0"
TFAU="tc filter add dev imq0"
TQAU="tc qdisc add dev imq0"
modprobe imq
modprobe ipt_IMQ
ip link set imq0 up
tc qdisc del dev imq0 root
tc qdisc add dev imq0 root handle 1: htb
tc class add dev imq0 parent 1: classid 1:1 htb rate 1024kbit
$TCAU parent 1:1 classid 1:10 htb rate 384kbit ceil 1024kbit prio 0
$TCAU parent 1:1 classid 1:11 htb rate 384kbit ceil 1024kbit prio 1
$TCAU parent 1:1 classid 1:12 htb rate 256kbit ceil 1024kbit prio 4
$TQAU parent 1:10 handle 10: $SFQ
$TQAU parent 1:11 handle 11: $SFQ
$TQAU parent 1:12 handle 12: $SFQ
$TFAU parent 1:0 prio 0 protocol ip handle 10 fw flowid 1:10
$TFAU parent 1:0 prio 1 protocol ip handle 11 fw flowid 1:11
$TFAU parent 1:0 prio 4 protocol ip handle 12 fw flowid 1:12
iptables -t mangle -A PREROUTING -p tcp --dport 80 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -p tcp --dport 443 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -p tcp --dport 1024:65535 -j MARK --set-mark 12
iptables -t mangle -A PREROUTING -j IMQ --todev 0 |
Or you can use the L7 protocol but will take more CPU on the router
Code: | #--------------------------------------------
#WRT54 Script Generator v1.02
#(C) 2006-2007 Robert "Robson" Mytkowski
#--------------------------------------------
modprobe ipt_layer7
TCA="tc class add dev ppp0"
TFA="tc filter add dev ppp0"
TQA="tc qdisc add dev ppp0"
SFQ="sfq perturb 10"
tc qdisc del dev ppp0 root
tc qdisc add dev ppp0 root handle 1: htb
tc class add dev ppp0 parent 1: classid 1:1 htb rate 8192kbit
$TCA parent 1:1 classid 1:10 htb rate 4096kbit ceil 8192kbit prio 0
$TCA parent 1:1 classid 1:11 htb rate 3072kbit ceil 8192kbit prio 1
$TCA parent 1:1 classid 1:12 htb rate 1024kbit ceil 8192kbit prio 4
$TQA parent 1:10 handle 10: $SFQ
$TQA parent 1:11 handle 11: $SFQ
$TQA parent 1:12 handle 12: $SFQ
$TFA parent 1:0 prio 0 protocol ip handle 10 fw flowid 1:10
$TFA parent 1:0 prio 1 protocol ip handle 11 fw flowid 1:11
$TFA parent 1:0 prio 4 protocol ip handle 12 fw flowid 1:12
iptables -t mangle -A POSTROUTING -m layer7 --l7proto http -j MARK --set-mark 10
iptables -t mangle -A POSTROUTING -m layer7 --l7proto ssl -j MARK --set-mark 11
iptables -t mangle -A POSTROUTING -m layer7 --l7proto bittorrent -j MARK --set-mark 12
TCAU="tc class add dev imq0"
TFAU="tc filter add dev imq0"
TQAU="tc qdisc add dev imq0"
modprobe imq
modprobe ipt_IMQ
ip link set imq0 up
tc qdisc del dev imq0 root
tc qdisc add dev imq0 root handle 1: htb
tc class add dev imq0 parent 1: classid 1:1 htb rate 1024kbit
$TCAU parent 1:1 classid 1:10 htb rate 384kbit ceil 1024kbit prio 0
$TCAU parent 1:1 classid 1:11 htb rate 384kbit ceil 1024kbit prio 1
$TCAU parent 1:1 classid 1:12 htb rate 256kbit ceil 1024kbit prio 4
$TQAU parent 1:10 handle 10: $SFQ
$TQAU parent 1:11 handle 11: $SFQ
$TQAU parent 1:12 handle 12: $SFQ
$TFAU parent 1:0 prio 0 protocol ip handle 10 fw flowid 1:10
$TFAU parent 1:0 prio 1 protocol ip handle 11 fw flowid 1:11
$TFAU parent 1:0 prio 4 protocol ip handle 12 fw flowid 1:12
iptables -t mangle -A PREROUTING -m layer7 --l7proto http -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -m layer7 --l7proto ssl -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -m layer7 --l7proto bittorrent -j MARK --set-mark 12
iptables -t mangle -A PREROUTING -j IMQ --todev 0
|
_________________ TP-Link TL-WDR3600 v1 [EU]: r36330 (07/16/18 )
D-Link DIR-615 D2 [EU]: r36330 (07/16/18 )
Mikrotik RB750r2 (OpenWrt 17.01.4)
EE BrightBox 1 aka A4001N (OpenWrt 17.01.4)
Sagemcom FAST@5364 (VDSL2,FTTC (Fibre to the Cabinet) Synced 65/17
Twitter: @francisuk1989
---------------------------------
Found a bug? Report it http://svn.dd-wrt.com
DD-WRT Official FB Group: https://www.facebook.com/groups/493762527744455
|
|