[LARTC] dont know why htb is not working

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stef or any "qos" guru!!: 

hi, im managing a 1 mega connection for a company...i use debian, kernel 2.4.20.
my idea is to priorice all www traffic..but i dont know some stuff about matching with the u32 filter.
can anyone give me some idea of what is goinng worng here?
about kazza, bseiides filtering the out, should filter the ingress too?

well, thanks for your time

mi script is this: 

DOWNLINK=1024
UPLINK=1024
DEV=eth0

tc qdisc del dev $DEV root    2> /dev/null > /dev/null
tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null

tc qdisc add dev $DEV root handle 1: htb default 20 

tc class add dev $DEV parent 1: classid 1:1 htb rate 1024kbit burst 6k
tc class add dev $DEV parent 1:1 classid 1:10 htb rate 450kbit ceil 1024kbit burst 6k prio 1 
tc class add dev $DEV parent 1:1 classid 1:20 htb rate 500kbit ceil 1024kbit burst 6k prio 2
# for people i dont want to browse...
tc class add dev $DEV parent 1:1 classid 1:30 htb rate 74kbit ceil 110kbit burst 6k prio 3

tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10

#this is not working!! he downloads at 32k all the time!!
tc filter add dev $DEV parent 1: protocol ip prio 1 u32 match ip src 200.69.147.69 flowid 1:30
tc filter add dev $DEV parent 1: protocol ip prio 1 u32 match ip dst 200.69.147.69 flowid 1:30

# TOS Minimum Delay (ssh, NOT scp) in 1:10:
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip tos 0x10 0xff flowid 1:10 
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip protocol 1 0xff flowid 1:10 
tc filter add dev $DEV parent 1: protocol ip prio 2 u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16 0x0000 0xffc0 at 2 match u8 0x10 0xff at 33 flowi
d 1:10

# icmp
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip protocol 1 0xff flowid 1:10

# IMPORTANT AND FAST! ALWAYS! (all related to web browsing)
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip dport 80 0xffff flowid 1:10 
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip dport 8080 0xffff flowid 1:10 
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip sport 8080 0xffff flowid 1:10 
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip dport 443 0xffff flowid 1:10 
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip sport 80 0xffff flowid 1:10 
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip sport 443 0xffff flowid 1:10 
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip dport 1863 0xffff flowid 1:10 
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip sport 22 0xffff flowid 1:10 
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip dport 22 0xffff flowid 1:10 
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip dport 53 0xffff flowid 1:10 
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip sport 53 0xffff flowid 1:10 

# counter strike..low bw consumer
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip sport 27015 0xffff flowid 1:10 
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip dport 27015 0xffff flowid 1:10 
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip sport 27005 0xffff flowid 1:10
tc filter add dev $DEV parent 1:0 protocol ip prio 2 u32 match ip dport 27005 0xffff flowid 1:10 

# kazaa and friends to the least posible bw and prio
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 match ip sport 25 0xffff flowid 1:30
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 match ip dport 25 0xffff flowid 1:30
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 match ip sport 21 0xffff flowid 1:30
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 match ip dport 21 0xffff flowid 1:30
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 match ip sport 6346 0xffff flowid 1:30
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 match ip dport 6346 0xffff flowid 1:30
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 match ip sport 4662 0xffff flowid 1:30
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 match ip dport 4662 0xffff flowid 1:30
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 match ip sport 4661 0xffff flowid 1:30
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 match ip dport 4661 0xffff flowid 1:30
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 match ip sport 1214 0xffff flowid 1:30
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 match ip dport 1214 0xffff flowid 1:30

# the rest, if need must wait and be shaped 
tc filter add dev $DEV parent 1: protocol ip prio 18 u32 match ip dst 0.0.0.0/0 flowid 1:20 

# download, not much to do right?
tc qdisc add dev $DEV handle ffff: ingress
tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate 1024kbit burst 10k drop flowid :1




[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux