Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:network:traffic-shaping:traffic_shaping [2018/03/03 20:13] – ↷ Page moved from docs:user-guide:network:traffic-shaping:traffic_shaping to docs:guide-user:network:traffic-shaping:traffic_shaping bobafetthotmail | docs:guide-user:network:traffic-shaping:traffic_shaping [2019/03/22 15:33] – [Quality of Service (qos-scripts) configuration] title vgaetera | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| - | This is the documentation for the UCI configuration file **/// | + | This is the documentation for the UCI configuration file '' |
| - | **WARNING**: //luci-app-qos// won’t start until you enable the //qos// Initscript within the System-→Startup tab as well as enable qos under Network-→QoS | + | | {{:meta: |
| + | |||
| + | | {{: | ||
| + | |||
| + | | {{: | ||
| + | |||
| + | :!: '' | ||
| ===== Sections ===== | ===== Sections ===== | ||
| Line 110: | Line 116: | ||
| ===== Quick start guide ===== | ===== Quick start guide ===== | ||
| + | |||
| + | :!: check free space first. At least 200kb free. Run **df** | ||
| + | :!: if you get no left space... opkg may has been corrupted. I recommend re-flash ( sysupgrade firware file stuff ) before reboot | ||
| 1. Install the qos-scripts package: | 1. Install the qos-scripts package: | ||
| Line 123: | Line 132: | ||
| uci set qos.wan.download=16000 | uci set qos.wan.download=16000 | ||
| uci set qos.wan.enabled=1 | uci set qos.wan.enabled=1 | ||
| - | uci commit qos</ | + | uci commit qos |
| + | </ | ||
| 3. Start it and look for error output and test): | 3. Start it and look for error output and test): | ||
| Line 138: | Line 148: | ||
| ===== Troubleshooting ===== | ===== Troubleshooting ===== | ||
| + | (Last updated for: Barrier Breaker 14.07) | ||
| - | Look at the generated traffic control qdisc settings by running: | + | If your QoS doesn' |
| + | |||
| + | * Check '' | ||
| + | |||
| + | * Run '' | ||
| + | < | ||
| + | -A qos_Default -p tcp -m mark --mark 0x0/0xf0 -m tcp --sport 1024:65535 --dport 1024:65535 -j MARK --set-xmark 0x44/0xff | ||
| + | </ | ||
| + | The '' | ||
| + | |||
| + | * Look at the generated traffic control qdisc settings by running: | ||
| < | < | ||
| Line 149: | Line 170: | ||
| qdisc fq_codel 0: dev eth0 root refcnt 2 limit 1024p flows 1024 quantum 300 target 5.0ms interval 100.0ms ecn | qdisc fq_codel 0: dev eth0 root refcnt 2 limit 1024p flows 1024 quantum 300 target 5.0ms interval 100.0ms ecn | ||
| </ | </ | ||
| - | Any interface with only a single qdisc line printed, showing the same settings as this line (this one is for //dev eth0//), indicates no QoS on that interface. | + | Any interface with only a single qdisc line printed, showing the same settings as this line (this one is for '' |
| Network interfaces with QoS enabled will have multiple qdisc lines printed, each corresponding to a QoS class, etc. | Network interfaces with QoS enabled will have multiple qdisc lines printed, each corresponding to a QoS class, etc. | ||
| - | If the printed qdisc settings don’t seem to be correct, you can preview the //tc// commands generated from the OpenWRT | + | * If the printed qdisc settings don't seem to be correct, you can preview the '' |
| < | < | ||
| / | / | ||
| </ | </ | ||
| - | (Replace //wan// with the UCI interface name you’re debugging, as given in the /// | ||
| - | This should print a series of //insmod// and //tc// commands used to set up the QoS subsystem. You can debug any errors caused by running these commands by running: | + | (Replace '' |
| + | |||
| + | This should print a series of '' | ||
| < | < | ||
| / | / | ||
| </ | </ | ||
| - | The output of /// | + | (Note '' |
| + | |||
| + | The output of '' | ||
| + | |||
| + | ===== txqueuelen ===== | ||
| + | //Recent versions of trunk uses [[http:// | ||
| + | |||
| + | /* This whole section seems a bit rambling /Cybjit */ | ||
| + | |||
| + | ( Note: after i know about bufferbloat - websearchd and many misguided users are asking about //raising// txqueuelen, or how to set it, and this was a recommended read posted for them -, and that just enabling QoS and setting up the rules i wanted didnt produce results, i thought of reduce txqueuelen from the default size of 1000 packets. On most SOHO applications the upload speed is much-much lower than the interface speed (100M or 1G), and it's written that the def buffer is tailored for enterprise size usage. I used values of 90 where[only] it was 1000 and it is wonderfully responsive and effective now, on a 256k connection. I also raised lenghts of 3 and 5 to 20 as i imagined it might be hard to do any queuing/ | ||
| + | |||
| + | First we list the stuff with | ||
| + | < | ||
| + | Then apply for example | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | / | ||
| + | |||
| + | ===== Types and Groups ===== | ||
| + | |||
| + | The '' | ||
| + | |||
| + | The biggest item of contention was which group setting gives better performance, | ||
| + | |||
| + | Another biggie was the exact meaning of each type. Types are necessary for connection tracking. By default, **Classify** is not run on a connection that had already been assigned a traffic class, so it is the initial connection-tracked classification. **Reclassify** can override the traffic class per packet, without altering the connection tracking mark. **Default** is a fall-back for everything that has not been marked by Classify/ | ||
| + | |||
| + | ===== Traffic Shaping ===== | ||
| + | |||
| + | Basic Shaping | ||
| + | |||
| + | Create a new classes at the end of qos file: | ||
| + | |||
| + | config class " | ||
| + | option packetsize | ||
| + | option packetdelay 100 | ||
| + | option avgrate | ||
| + | option limitrate | ||
| + | |||
| + | config class " | ||
| + | option packetsize | ||
| + | option packetdelay 100 | ||
| + | option avgrate | ||
| + | option limitrate | ||
| + | |||
| + | Add it to class group: | ||
| + | |||
| + | config classgroup " | ||
| + | | ||
| + | | ||
| + | |||
| + | Add next stuff to begin of qos file, after Priority, Express... | ||
| + | |||
| + | Shaping a user: | ||
| + | |||
| + | config classify | ||
| + | option target ' | ||
| + | option srchost ' | ||
| + | option comment ' | ||
| + | |||
| + | Shaping a site: | ||
| + | |||
| + | config classify | ||
| + | option target ' | ||
| + | option dsthost ' | ||
| + | option comment ' | ||
| + | |||
| + | Two users: will share X1. Example: 500kB/s for both. Max user1+user2=500kB/ | ||
| + | |||
| + | config classify | ||
| + | option target ' | ||
| + | option srchost ' | ||
| + | option comment ' | ||
| + | |||
| + | config classify | ||
| + | option target ' | ||
| + | option srchost ' | ||
| + | option comment ' | ||
| + | |||
| + | Two users: diferent buckets. 500kB/s and 300kB/s .. as example. Max 500+300=800kB/ | ||
| + | |||
| + | config classify | ||
| + | option target ' | ||
| + | option srchost ' | ||
| + | option comment ' | ||
| + | |||
| + | config classify | ||
| + | option target ' | ||
| + | option srchost ' | ||
| + | option comment ' | ||
| + | |||
| + | Calc %: | ||
| + | |||
| + | 8000kbps * 50% / 8 = 500kB/s | ||
| + | |||
| + | Notes: | ||
| + | |||
| + | Will affect both upload/ | ||
| + | A 12000/1000 line will be shaped at 6000/ | ||
| + | |||
| + | edit: *X1* limit upload or both if *X1_down* not present... | ||
| + | *X1_down* limit down... | ||
| + | |||
| + | ===== TS: 8Mb/8Mb LTE ===== | ||
| + | |||
| + | **Why shaping? | ||
| + | |||
| + | - Now i have 100GB quota, it will go wasted easly with youtube... | ||
| + | |||
| + | - Youtube android app cache all video, even if you only see a few seconds | ||
| + | |||
| + | - 1080p smart tv are :evil: | ||
| + | |||
| + | **About Youtube** | ||
| + | |||
| + | - Shape google 216.* may not work, because cache.google.com are in your ISP | ||
| + | |||
| + | - Shaping YouTube will shape all cacheable contents: Play Store... | ||
| + | |||
| + | - YouTube use port 443 almost | ||
| + | |||
| + | - Almost all web traffic are port 443. Http priority is useless today | ||
| + | |||
| + | |||
| + | config interface ' | ||
| + | option classgroup ' | ||
| + | option upload | ||
| + | option download ' | ||
| + | option overhead ' | ||
| + | option enabled | ||
| + | |||
| + | config classify | ||
| + | option target ' | ||
| + | option proto ' | ||
| + | option dstports ' | ||
| + | option srchost ' | ||
| + | option comment 'tv youtube' | ||
| + | |||
| + | config classgroup ' | ||
| + | option classes 'n yt' | ||
| + | option default ' | ||
| + | |||
| + | config class ' | ||
| + | option packetsize ' | ||
| + | option packetdelay ' | ||
| + | option avgrate ' | ||
| + | option priority ' | ||
| + | |||
| + | config class ' | ||
| + | option avgrate ' | ||
| + | |||
| + | config class ' | ||
| + | option avgrate | ||
| + | |||
| + | config class ' | ||
| + | option avgrate | ||
| + | option limitrate | ||
| + | |||
| + | {{tag> | ||