Bonjour,
<BR>
<BR>J'ai un petit problème avec mon script de QoS qui est en fait le script WonderShaper que j'ai voulu modifié.
<BR>
<BR>Voilà le script
<BR>
<BR>
- Code: Tout sélectionner
<BR>#!/bin/bash
<BR># Wonder Shaper
<BR># please read the README before filling out these values
<BR>#
<BR># Set the following values to somewhat less than your actual download
<BR># and uplink speed. In kilobits. Also set the device that is to be shaped.
<BR>
<BR>DOWNLINK=480
<BR>UPLINK=115
<BR>DEV=ppp0
<BR>
<BR># low priority OUTGOING traffic - you can leave this blank if you want
<BR># low priority source netmasks
<BR>NOPRIOHOSTSRC=192.168.0.3
<BR>
<BR># low priority destination netmasks
<BR>NOPRIOHOSTDST=
<BR>
<BR># low priority source ports
<BR>NOPRIOPORTSRC=
<BR>
<BR># low priority destination ports
<BR>NOPRIOPORTDST=
<BR>
<BR>
<BR># Now remove the following two lines <IMG SRC="images/smiles/icon_smile.gif">
<BR>
<BR>#echo Please read the documentation in 'README' first
<BR>#exit
<BR>
<BR>if [ "$1" = "status" ]
<BR>then
<BR> tc -s qdisc ls dev $DEV
<BR> tc -s class ls dev $DEV
<BR> exit
<BR>fi
<BR>
<BR>
<BR># clean existing down- and uplink qdiscs, hide errors
<BR>tc qdisc del dev $DEV root 2> /dev/null > /dev/null
<BR>tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null
<BR>
<BR>if [ "$1" = "stop" ]
<BR>then
<BR> exit
<BR>fi
<BR>
<BR>
<BR>###### uplink
<BR>
<BR># install root HTB, point default traffic to 1:20:
<BR>
<BR>tc qdisc add dev $DEV root handle 1: htb default 20
<BR>
<BR># shape everything at $UPLINK speed - this prevents huge queues in your
<BR># DSL modem which destroy latency:
<BR>
<BR>tc class add dev $DEV parent 1: classid 1:1 htb rate ${UPLINK}kbit burst 6k
<BR>
<BR># high prio class 1:10:
<BR>
<BR>tc class add dev $DEV parent 1:1 classid 1:10 htb rate ${UPLINK}kbit
<BR> burst 6k prio 1
<BR>
<BR># bulk & default class 1:20 - gets slightly less traffic,
<BR># and a lower priority:
<BR>
<BR>tc class add dev $DEV parent 1:1 classid 1:20 htb rate $[9*$UPLINK/10]kbit
<BR> burst 6k prio 2
<BR>
<BR>tc class add dev $DEV parent 1:1 classid 1:30 htb rate $[8*$UPLINK/10]kbit
<BR> burst 6k prio 2
<BR>
<BR># all get Stochastic Fairness:
<BR>tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
<BR>tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
<BR>tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10
<BR>
<BR># Pour donner la priorité à Half-Life
<BR>
<BR>tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32
<BR> match ip sport 27005 0xffff flowid 1:10
<BR>
<BR># ICMP (ip protocol 1) in the interactive class 1:10 so we
<BR># can do measurements & impress our friends:
<BR>tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32
<BR> match ip protocol 1 0xff flowid 1:10
<BR>
<BR># To speed up downloads while an upload is going on, put ACK packets in
<BR># the interactive class:
<BR>
<BR>tc filter add dev $DEV parent 1: protocol ip prio 10 u32
<BR> match ip protocol 6 0xff
<BR> match u8 0x05 0x0f at 0
<BR> match u16 0x0000 0xffc0 at 2
<BR> match u8 0x10 0xff at 33
<BR> flowid 1:10
<BR>
<BR># rest is 'non-interactive' ie 'bulk' and ends up in 1:20
<BR>
<BR># some traffic however suffers a worse fate
<BR>for a in $NOPRIOPORTDST
<BR>do
<BR> tc filter add dev $DEV parent 1: protocol ip prio 14 u32
<BR> match ip dport $a 0xffff flowid 1:30
<BR>done
<BR>
<BR>for a in $NOPRIOPORTSRC
<BR>do
<BR> tc filter add dev $DEV parent 1: protocol ip prio 15 u32
<BR> match ip sport $a 0xffff flowid 1:30
<BR>done
<BR>
<BR>for a in $NOPRIOHOSTSRC
<BR>do
<BR> tc filter add dev $DEV parent 1: protocol ip prio 16 u32
<BR> match ip src $a flowid 1:30
<BR>done
<BR>
<BR>for a in $NOPRIOHOSTDST
<BR>do
<BR> tc filter add dev $DEV parent 1: protocol ip prio 17 u32
<BR> match ip dst $a flowid 1:30
<BR>done
<BR>
<BR># rest is 'non-interactive' ie 'bulk' and ends up in 1:20
<BR>
<BR>tc filter add dev $DEV parent 1: protocol ip prio 18 u32
<BR> match ip dst 0.0.0.0/0 flowid 1:20
<BR>
<BR>
<BR>########## downlink #############
<BR># slow downloads down to somewhat less than the real speed to prevent
<BR># queuing at our ISP. Tune to see how high you can set it.
<BR># ISPs tend to have *huge* queues to make sure big downloads are fast
<BR>#
<BR># attach ingress policer:
<BR>
<BR>tc qdisc add dev $DEV handle ffff: ingress
<BR>
<BR># filter *everything* to it (0.0.0.0/0), drop everything that's
<BR># coming in too fast:
<BR>
<BR>tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src
<BR> 0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1
<BR>
<BR>
<BR>
<BR>Les modifications visent donc à donner la priorité à l'upload générée par Half-Life et à l'opposé de donner une priorité minimale à l'IP 192.168.0.3 qui génère constamment de l'upload.
<BR>
<BR>Le problème est que, quand je fais un wshaper status, voilà ce que j'ai :
<BR>
<BR>
- Code: Tout sélectionner
<BR>qdisc ingress ffff:
<BR> Sent 3971503 bytes 21038 pkts (dropped 0, overlimits 0)
<BR>
<BR> qdisc sfq 30: quantum 9178b perturb 10sec
<BR> Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
<BR>
<BR> qdisc sfq 20: quantum 9178b perturb 10sec
<BR> Sent 8471635 bytes 18790 pkts (dropped 0, overlimits 0)
<BR>
<BR> qdisc sfq 10: quantum 9178b perturb 10sec
<BR> Sent 216086 bytes 5387 pkts (dropped 0, overlimits 0)
<BR>
<BR> qdisc htb 1: r2q 10 default 20 direct_packets_stat 2
<BR> Sent 8688153 bytes 24186 pkts (dropped 0, overlimits 17128)
<BR>
<BR> class htb 1:1 root rate 115Kbit ceil 115Kbit burst 6Kb cburst 1746b
<BR> Sent 8688051 bytes 24184 pkts (dropped 0, overlimits 0)
<BR> rate 12515bps 34pps
<BR> lended: 0 borrowed: 0 giants: 0
<BR> tokens: 257354 ctokens: 12652
<BR>
<BR>class htb 1:10 parent 1:1 leaf 10: prio 1 rate 115Kbit ceil 115Kbit burst 6Kb cburst 1746b
<BR> Sent 216086 bytes 5387 pkts (dropped 0, overlimits 0)
<BR> rate 265bps 6pps
<BR> lended: 5387 borrowed: 0 giants: 0
<BR> tokens: 339701 ctokens: 94999
<BR>
<BR>class htb 1:20 parent 1:1 leaf 20: prio 2 rate 103Kbit ceil 103Kbit burst 6Kb cburst 1730b
<BR> Sent 8471965 bytes 18797 pkts (dropped 0, overlimits 0)
<BR> rate 12246bps 27pps
<BR> lended: 18797 borrowed: 0 giants: 0
<BR> tokens: 208403 ctokens: -65803
<BR>
<BR>class htb 1:30 parent 1:1 leaf 30: prio 2 rate 92Kbit ceil 92Kbit burst 6Kb cburst 1716b
<BR> Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
<BR> lended: 0 borrowed: 0 giants: 0
<BR> tokens: 427408 ctokens: 119443
<BR>
<BR>
<BR>Le traffic de l'IP 192.168.0.3 n'est absolument pas rangé dans la classe 1:30 mais dans la 1:20 <IMG SRC="images/smiles/icon_frown.gif">
<BR>
<BR>Quelqu'un aurait-il une idée du pourquoi ? <IMG SRC="images/smiles/icon_wink.gif">