Skip to contentSkip to conversation

question about correct way of shapping

LARTC Paulo Ricardo Bruck 2 participants 6 messages Apr 7, 2005 – Apr 10, 2005

lore
Share & tools
lore
#0 lore raw

Hi Guys

After reading
http://lartc.org/lartc.html#LARTC.QDISC
http://www.docum.org/docum.org/
http://tldp.org/HOWTO/Traffic-Control-HOWTO/
http://www.opalsoft.net/qos/DS-21.htm

and a wonderful figure from: http://www.opalsoft.net/qos/ds-lb-214.gif

I have a newbie question. Suposse next figure:

		   <--- up 128K      
internet ----- dsl ---------------------eth1 -Linux Qos- eth0 ------ LAN
		   ---> down 450k	

If I want "shape" traffic to my LAN ( sharing equally download for all users) I have to insert a rule like this

tc qdisc add dev eth0 root handle 1:0 htb
tc class add dev eth0 parent 1:0 classid 1:1 htb rate 400kbit and ....other rules

and If I want "shape" traffic to Internet ( not allowing a single user to destroy upload) I have to insert a rule like this:

tc qdisc add dev eth1 root handle 1:0 htb
tc class add dev eth1 parent 1:0 classid 1:1 htb rate 100kbit and ...other rules

Is it correct?? or it is better to use IMQ or dummy to shape in both directions ??

thanks in advanced

Signature · 1 line
Paulo Ricardo Bruck - consultor

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#1 lore raw
Quoted 16 lines · Paulo Ricardo Bruck
		   <--- up 128K      
internet ----- dsl ---------------------eth1 -Linux Qos- eth0 ------ LAN
		   ---> down 450k	

If I want "shape" traffic to my LAN ( sharing equally download for all users) I have to insert a rule like this

tc qdisc add dev eth0 root handle 1:0 htb
tc class add dev eth0 parent 1:0 classid 1:1 htb rate 400kbit and ....other rules

and If I want "shape" traffic to Internet ( not allowing a single user to destroy upload) I have to insert a rule like this:

Quoted 6 lines

tc qdisc add dev eth1 root handle 1:0 htb
tc class add dev eth1 parent 1:0 classid 1:1 htb rate 100kbit and ...other rules

Is it correct??

Yes. That's the way to do it. Don't forget to add some filters (tc filter add ...) to send traffic into those queues.

-Corey
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#2 lore raw
In reply to Paulo Ricardo Bruck

Em Qui, 2005-04-07 às 10:22 -0700, Corey Hickey escreveu:

Quoted 23 lines
Quoted 21 lines · Paulo Ricardo Bruck
		   <--- up 128K      
internet ----- dsl ---------------------eth1 -Linux Qos- eth0 ------ LAN
		   ---> down 450k	

If I want "shape" traffic to my LAN ( sharing equally download for all users) I have to insert a rule like this

tc qdisc add dev eth0 root handle 1:0 htb
tc class add dev eth0 parent 1:0 classid 1:1 htb rate 400kbit and ....other rules

and If I want "shape" traffic to Internet ( not allowing a single user to destroy upload) I have to insert a rule like this:

tc qdisc add dev eth1 root handle 1:0 htb
tc class add dev eth1 parent 1:0 classid 1:1 htb rate 100kbit and ...other rules

Quoted 5 lines
Quoted 1 line

Is it correct??

Yes. That's the way to do it. Don't forget to add some filters (tc filter add ...) to send traffic into those queues.

Yes I'll not forget 8)
thanks for quickly answer Corey

Just another question related w/ shapping

at some documents it's describe the use of IMQ and some other the use of dummy device. What's the best method ? From what I've read we use dummy to shape both lan and wan using dummy device. It's correct? If it's correct why does we use dummy insted shape at LAn and Wan Interfaces ?

I intend use TC + iptables + debian sarge, but I'm not sure about using dummy device....

thanks in advance

Quoted 1 line

-Corey

Signature · 1 line
Paulo Ricardo Bruck - consultor

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#3 lore raw
In reply to Paulo Ricardo Bruck
Quoted 6 lines · Paulo Ricardo Bruck

at some documents it's describe the use of IMQ and some other the use of dummy device. What's the best method ? From what I've read we use dummy to shape both lan and wan using dummy device. It's correct? If it's correct why does we use dummy insted shape at LAn and Wan Interfaces ?

I've never used a dummy device. This looks interesting, though it doesn't apply to your setup.

http://article.gmane.org/gmane.linux.network/21224

Were you reading something different? If so, post the link(s). IMQ probably doesn't apply to you either.

You might have come across documents describing ingress shaping, which deals with traffic coming into an interface rather than the usual methods of shaping traffic as it leaves an interface. For a router setup, like yours, ingress shaping is unnecessary because all traffic (except a little bit for the router itself) can be shaped normally as it leaves one interface or the other.

To shape upstream traffic, attach a qdisc to your Internet-side interface; to shape downstream traffic, attach a qdisc to your LAN-side interface.

Quoted 1 line

I intend use TC + iptables + debian sarge

That's what I use.

-Corey
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#4 lore raw
In reply to Paulo Ricardo Bruck

Em Sex, 2005-04-08 às 11:06 +0200, [email protected] escreveu:
Hy people and Corey

Quoted 3 lines

You might have come across documents describing ingress shaping, which deals with traffic coming into an interface rather than the usual methods of shaping traffic as it leaves an interface.

Yes a lot of documents including lartc..8)

Quoted 11 lines

For a router setup, like yours, ingress shaping is unnecessary
because all traffic
(except a little bit for the router itself) can be shaped normally as it
leaves one interface or the other.

To shape upstream traffic, attach a qdisc to your Internet-side interface; to shape downstream traffic, attach a qdisc to your LAN-side
interface.

all right . Let me insert more details about it. ( sorry I started w/ a single scenario just to understand things easier )

Quoted 5 lines
Quoted 2 lines
                   <--- up 128K          __________

internet ---- dsl -------------------eth1 -Linux Qos- eth0 --- LAN

Quoted 2 lines
                  ---> down 450k         ----------

At Linux Qos I have:
debian sarge ( iptables + squid + ntop + psad + apache (only for reports) + acid + snort)

Sometimes I use 2 links to ISP ( providing load balance) BTW nice work at lartc. w/ this session about it. 80)

It means that at Linux QoS I have not only linux as a router, but Linux serving some applications and QoS too.

Again sorry for make things not so clear at my first e-mail.

Then should I use only TC + iptables ?

Quoted 3 lines
Quoted 1 line

I intend use TC + iptables + debian sarge

That's what I use.

Signature · 1 line
Paulo Ricardo Bruck - consultor

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#5 lore raw
In reply to Paulo Ricardo Bruck
Quoted 11 lines · Paulo Ricardo Bruck

all right . Let me insert more details about it. ( sorry I started w/ a single scenario just to understand things easier )

At Linux Qos I have:
debian sarge ( iptables + squid + ntop + psad + apache (only for reports) + acid + snort)

Sometimes I use 2 links to ISP ( providing load balance) BTW nice work at lartc. w/ this session about it. 80)

Quoted 8 lines

It means that at Linux QoS I have not only linux as a router, but Linux serving some applications and QoS too.

Again sorry for make things not so clear at my first e-mail.

Then should I use only TC + iptables ?

If you want to shape traffic as it comes from the Internet, then you will have to use IMQ or dummy, which gets beyond my area of expertise.

I used IMQ for a little while several months ago and it worked very nicely for ingress shaping, but the machine kept hard-locking and I gave up on it. I don't mean to spread FUD about IMQ -- it may be more stable now -- but be wary.

-Corey
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc