From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wayne de Nobrega" Date: Fri, 09 Aug 2002 22:10:50 +0000 Subject: [LARTC] Managing Inbound Traffic MIME-Version: 1 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C23FF1.9EF6516A" Message-Id: List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. ------_=_NextPart_001_01C23FF1.9EF6516A Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I have been playing around with traffic shaping using htb and imq but am battling to get any control over the inbound traffic. Managing the outgoing is working perfectly. To manage the inbound internet traffic which is running on a 64kbit line, I have tried the following including various permutations of priorities, bursts, and ceilings with no affect. (Does the ceil option work becuase when I did have it set higher than the rate, the traffic did not increase even with no other traffic on the line. I noticed the same thing with the burst option. I cannot place the shaper at the ISP in this case. =20 modprobe imq numdevs=3D1 =20 tc qdisc add dev imq0 handle 1: root htb default 1 tc class add dev imq0 parent 1: classid 1:1 htb rate 64kbit =20 tc qdisc add dev imq0 parent 1:1 handle 10: htb default 5 tc class add dev imq0 parent 10: classid 10:1 htb rate 12kbit burst 16kbit prio 3 tc class add dev imq0 parent 10: classid 10:2 htb rate 28kbit burst 16kbit prio 2 tc class add dev imq0 parent 10: classid 10:3 htb rate 16kbit burst 16kbit prio 1 tc class add dev imq0 parent 10: classid 10:5 htb rate 8kbit prio 4 =20 tc qdisc add dev imq0 parent 10:1 handle 21:0 sfq tc qdisc add dev imq0 parent 10:2 handle 22:0 sfq tc qdisc add dev imq0 parent 10:3 handle 23:0 sfq tc qdisc add dev imq0 parent 10:5 handle 24:0 sfq =20 tc filter add dev imq0 protocol ip pref 1 parent 10: handle 1 fw classid 10:1 tc filter add dev imq0 protocol ip pref 2 parent 10: handle 2 fw classid 10:2 tc filter add dev imq0 protocol ip pref 3 parent 10: handle 3 fw classid 10:3 =20 iptables -t mangle -A PREROUTING -i eth0 -j IMQ iptables -t mangle -A PREROUTING -i eth0 -p tcp --sport 20 --dport 1024: -m state --state ESTABLISHED -j MARK --set-mark 1 iptables -t mangle -A PREROUTING -i eth0 -p tcp --sport 80 --dport 1024: -m state --state ESTABLISHED -j MARK --set-mark 2 iptables -t mangle -A PREROUTING -i eth0 -p tcp --sport 22 --dport 1024: -m state --state ESTABLISHED -j MARK --set-mark 3 =20 ip link set imq0 up What I want to have is that they all have a minimum rate set which can grow to fill the line if it is available. =20 =20 Any help or ideas if this is possible??? =20 Thanks Wayne =20 ------_=_NextPart_001_01C23FF1.9EF6516A Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Managing Inbound Traffic

I have been playing around with traffic shaping using = htb and imq but am battling to get any control over the inbound = traffic.  Managing the outgoing is working perfectly.  To = manage the inbound internet traffic which is running on a 64kbit line, I = have tried the following including various permutations of priorities, = bursts, and ceilings with no affect.  (Does the ceil option work = becuase when I did have it set higher than the rate, the traffic did not = increase even with no other traffic on the line. I noticed the same = thing with the burst option.  I cannot place the shaper at the ISP = in this case.

 
modprobe imq numdevs=3D1
 
tc qdisc add dev imq0 handle 1: root htb default = 1
tc class add dev imq0 parent 1: classid 1:1 htb rate = 64kbit
 
tc qdisc add dev imq0 parent 1:1 handle 10: htb = default 5
tc class add dev imq0 parent 10: classid 10:1 htb = rate 12kbit burst 16kbit prio 3
tc class add dev imq0 parent 10: classid 10:2 htb = rate 28kbit burst 16kbit prio 2
tc class add dev imq0 parent 10: classid 10:3 htb = rate 16kbit burst 16kbit prio 1
tc class add dev imq0 parent 10: classid 10:5 htb = rate 8kbit prio 4
 
tc qdisc add dev imq0 parent 10:1 handle 21:0 = sfq
tc qdisc add dev imq0 parent 10:2 handle 22:0 = sfq
tc qdisc add dev imq0 parent 10:3 handle 23:0 = sfq
tc qdisc add dev imq0 parent 10:5 handle 24:0 = sfq
 
tc filter add dev imq0 protocol ip pref 1 parent 10: = handle 1 fw classid 10:1
tc filter add dev imq0 protocol ip pref 2 parent 10: = handle 2 fw classid 10:2
tc filter add dev imq0 protocol ip pref 3 parent 10: = handle 3 fw classid 10:3
 
iptables -t mangle -A PREROUTING -i eth0 -j = IMQ
iptables -t mangle -A PREROUTING -i eth0 -p tcp = --sport 20 --dport 1024: -m state --state ESTABLISHED -j MARK --set-mark = 1

iptables -t mangle -A PREROUTING -i eth0 -p tcp = --sport 80 --dport 1024: -m state --state ESTABLISHED -j MARK --set-mark = 2

iptables -t mangle -A PREROUTING -i eth0 -p tcp = --sport 22 --dport 1024: -m state --state ESTABLISHED -j MARK --set-mark = 3

 
ip link set imq0 up

What I want to have is that they all have a minimum = rate set which can grow to fill the line if it is available.  =
 
Any help or ideas if this is possible???
 
Thanks

Wayne
 

------_=_NextPart_001_01C23FF1.9EF6516A-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/