[LARTC] HTB Question

Linux Advanced Routing and Traffic Control

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

 



Hi Stef,
	Sorry to write to you directly but my list membership is not working, I
receive the archive but cant send to the list, cant delete myself because I
don't exist and can't rejoin as they say I do exist, anyway hope you don't
mind

Can you tell me what the difference between these two scripts is please.

What I want to achieve is a high speed channel 1000kbit from port 3000 from
an application running on the box doing the shaping, while shaping the
traffic at 64kbit going thru the box to the network, WITHOUT affecting the
small 64kbit bandwidth.

In EXAMPLE 1 ALL traffic goes thru 1:1 but does not seem to affect the slow
channels 1:2,1:3 and 1:4
In EXAMPLE 2 the port 3000 traffic only goes thru 1:998 and 1:997 but it
shows "lended" packets in the "tc stats"
My feeling is EXAMPLE 2 is the right way but I would like your input



EXAMPLE 1:
tc qdisc del dev eth0 root handle 1: htb default 999
tc qdisc add dev eth0 root handle 1: htb default 999 r2q 1
tc class add dev eth0 parent 1: classid 1:1 htb rate 64kbit

tc class add dev eth0 parent 1: classid 1:998 htb rate 1000kbit
tc qdisc add dev eth0 parent 1:998 handle 1998: sfq perturb 10
tc class add dev eth0 parent 1:998 classid 1:997 htb rate 1000kbit ceil
1000kbit prio 0 quantum 15140
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport 3000
0xffff flowid 1:997

tc class add dev eth0 parent 1:1 classid 1:999 htb rate 6kbit ceil 64kbit
prio 0 quantum 1514
tc qdisc add dev eth0 parent 1:999 handle 1999: sfq perturb 10
tc class add dev eth0 parent 1:1 classid 1:2 htb rate 24kbit ceil 64kbit
prio 0 quantum 1514
tc class add dev eth0 parent 1:1 classid 1:3 htb rate 24kbit ceil 24kbit
prio 0 quantum 1514
tc class add dev eth0 parent 1:1 classid 1:4 htb rate 10kbit ceil 64kbit
prio 0 quantum 1514
tc qdisc add dev eth0 parent 1:2 handle 200: sfq perturb 2
tc qdisc add dev eth0 parent 1:3 handle 300: sfq perturb 2
tc qdisc add dev eth0 parent 1:4 handle 400: sfq perturb 2
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 80
0xffff flowid 1:2
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 25
0xffff flowid 1:3
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 53
0xffff flowid 1:4
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 53
0xffff match ip protocol 17 0xff flowid 1:4
END EXAMPLE 1

EXAMPLE 2:
tc qdisc del dev eth0 root handle 1: htb default 999
tc qdisc add dev eth0 root handle 1: htb default 999 r2q 1
tc class add dev eth0 parent 1: classid 1:1 htb rate 64kbit
tc class add dev eth0 parent 1:1 classid 1:999 htb rate 6kbit ceil 64kbit
prio 0 quantum 1514
tc qdisc add dev eth0 parent 1:999 handle 1999: sfq perturb 10
tc class add dev eth0 parent 1:1 classid 1:2 htb rate 24kbit ceil 64kbit
prio 0 quantum 1514
tc class add dev eth0 parent 1:1 classid 1:3 htb rate 24kbit ceil 24kbit
prio 0 quantum 1514
tc class add dev eth0 parent 1:1 classid 1:4 htb rate 10kbit ceil 64kbit
prio 0 quantum 1514
tc class add dev eth0 parent 1:1 classid 1:5 htb rate 1000kbit ceil 1000kbit
prio 0 quantum 15140
tc class add dev eth0 parent 1:5 classid 1:6 htb rate 1000kbit ceil 1000kbit
prio 0 quantum 15140
tc qdisc add dev eth0 parent 1:2 handle 200: sfq perturb 2
tc qdisc add dev eth0 parent 1:3 handle 300: sfq perturb 2
tc qdisc add dev eth0 parent 1:4 handle 400: sfq perturb 2
tc qdisc add dev eth0 parent 1:6 handle 600: sfq perturb 5
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 80
0xffff flowid 1:2
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 25
0xffff flowid 1:3
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 53
0xffff flowid 1:4
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 53
0xffff match ip protocol 17 0xff flowid 1:4
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport 3000
0xffff flowid 1:6
END EXAMPLE 2


Regards Allan Gee
Equation
021 4181777
www.equation.co.za



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