Small Linux Traffic Control script to throttle network and change resolutions

124 views
Skip to first unread message

Marc Herbert

unread,
Apr 23, 2018, 2:32:28 AM4/23/18
to discuss-webrtc
In the context of bug http://crrev.com/c/1009324 I searched for a way to trigger as many resolution changes as possible. After some trial and error I came up with this Linux script which seems good enough to be worth sharing, hopefully it can save someone else doing the same research.



Caveat: resolution changes seem very difficult to trigger behind a proxy, this script works well on a "real" network.



https://wiki.archlinux.org/index.php/advanced_traffic_control

ETH=eth0
tc qdisc del root dev $ETH || true # clear
tc qdisc add dev $ETH root handle 1: htb default 30
tc class add dev $ETH parent 1:1 classid 1:30 htb rate 10Mbit burst 1k

tputreplace() {
        printf '%s' "$1  "
        tc class replace dev $ETH classid 1:30 htb rate "$1" burst 1k
}

while true; do
        tputreplace 350kbit; sleep 60
        tputreplace 10Mbit; sleep 60
done



Marc Herbert

unread,
Jan 17, 2019, 7:30:38 PM1/17/19
to discuss-webrtc
Interesting test alternatives built in the browser: https://bugs.chromium.org/p/chromium/issues/detail?id=908928 
Reply all
Reply to author
Forward
0 new messages