On Fri, 2012-06-22 at 14:43 -0300, Joaquim Pedro França Simão wrote: > I need a way to prioritize packets without setting bandwidth limits. > For example, I have a client using the whole bandwidth. As soon as other > clients need bandwidth, reduce the bandwidth of the former to not impair > navigation, but as soon as finish the download, restore the initial > client to his full bandwidth. The src-3tos.sh script below accomplishes this and creates three QoS levels for each host. If you don't need the later you can simplify it quite a bit. http://git.coverfire.com/?p=linux-qos-scripts.git;a=tree > I'm trying to control torrent bandwidth usage to not impact the > navigation, but at the same time using all the bandwidth when there is > no navigation. The torrent traffic had TOS 0x48. > > I tried a script using HFSC, but did not work as expected. > > #!/bin/bash > > TC=/usr/sbin/tc > > DEV=ppp0 > > ID=1 > > # Cleanup > $TC qdisc del dev $DEV root 2>/dev/null > > # Classes > > ## Dev class > $TC qdisc add dev $DEV root handle $ID: hfsc > > ## Root class > $TC class add dev $DEV parent $ID: classid $ID:1 hfsc \ > sc rate 600kbit \ > ul rate 600kbit > > ## HTTP and prioritized packets > $TC class add dev $DEV parent $ID:1 classid $ID:10 hfsc \ > sc rate 400kbit \ > ul rate 600kbit > > ## Trash traffic > $TC class add dev $DEV parent $ID:1 classid $ID:20 hfsc \ > ul rate 400kbit \ > ls rate 200kbit > > > # Filters > > ## Torrent > $TC filter add dev $DEV parent $ID:0 protocol ip prio 1 u32 \ > match ip tos 0x48 0xff \ > flowid 1:20 > > ## Resto > $TC filter add dev $DEV parent $ID:0 prio 5 u32 \ > match ip src any flowid 1:10 > > -- > To unsubscribe from this list: send the line "unsubscribe lartc" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html
Attachment:
signature.asc
Description: This is a digitally signed message part