All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] Bridge + leased line + tc
@ 2004-01-13 16:15 Wouter Coppens
  2004-01-13 21:24 ` Stef Coene
  2004-01-14  9:21 ` Andy Furniss
  0 siblings, 2 replies; 3+ messages in thread
From: Wouter Coppens @ 2004-01-13 16:15 UTC (permalink / raw)
  To: lartc

Hi,

I can't get traffic shaping working.

This is my situation:


	     --------                       ------
Net1 ----- |router|  -------------------- | TC | ----------- Net2
           --------      leased line      ------

						   eth1    eth0

We use the leased line for normal traffic but also for synchronisation
between 2 servers. The leased line is 2mbit. The synchronisation
generates too much traffic and uses completely the 2mbit capacity of the
leased line. This is no problem during night, but we want to limit the
synchronisation traffic during day (or in other words: the sync-traffic
should get the lowest priority and the other traffic can use up to
2mbit).

According to the documentation, you can only shape outgoing traffic. We
took a PC (named TC) and put the network interfaces in bridge mode.
The synchronisation happens from Net1 to Net2, so TC is after the leased
line.
Normally you would shape the outgoing traffic on eth0, but this doesn't
work. We even tried to limit eth0 to 20kbit, but the synch-traffic
completely fills the leased line and no other traffic gets through.

We found a temporary fix by using IMQ with iptables:
/sbin/tc qdisc del root dev imq0
/sbin/tc qdisc add dev imq0 root handle 1: htb default 20
/sbin/tc class add dev imq0 parent 1: classid 1:1 htb rate 2Mbit burst
6k
/sbin/tc class add dev imq0 parent 1:1 classid 1:10 htb rate 64kbit ceil
787kbit
/sbin/tc class add dev imq0 parent 1:1 classid 1:20 htb rate 2Mbit
/sbin/tc qdisc add dev imq0 parent 1:10 handle 10: sfq perturb 10
/sbin/tc qdisc add dev imq0 parent 1:20 handle 20: sfq perturb 10
/sbin/tc filter add dev imq0 parent 1: protocol ip prio 18 u32 match ip
dst 10.10.10.10 flowid 1:10	(10.10.10.10 is ip of server in Net2).


Is there a better way to give the sync-traffic the lowest priority? If
somybody starts a download it should get 2mbit and the sync-traffic
should get the rest (if any).

We would like to upgrade to 2.6, but imq is not maintained. Any help?


Thanks in advance,

Wouter
			
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [LARTC] Bridge + leased line + tc
  2004-01-13 16:15 [LARTC] Bridge + leased line + tc Wouter Coppens
@ 2004-01-13 21:24 ` Stef Coene
  2004-01-14  9:21 ` Andy Furniss
  1 sibling, 0 replies; 3+ messages in thread
From: Stef Coene @ 2004-01-13 21:24 UTC (permalink / raw)
  To: lartc

On Tuesday 13 January 2004 17:15, Wouter Coppens wrote:
> Hi,
>
> I can't get traffic shaping working.
>
> This is my situation:
>
>
> 	     --------                       ------
> Net1 ----- |router|  -------------------- | TC | ----------- Net2
>            --------      leased line      ------
>
> 						   eth1    eth0
>
> We use the leased line for normal traffic but also for synchronisation
> between 2 servers. The leased line is 2mbit. The synchronisation
> generates too much traffic and uses completely the 2mbit capacity of the
> leased line. This is no problem during night, but we want to limit the
> synchronisation traffic during day (or in other words: the sync-traffic
> should get the lowest priority and the other traffic can use up to
> 2mbit).
>
> According to the documentation, you can only shape outgoing traffic. We
> took a PC (named TC) and put the network interfaces in bridge mode.
> The synchronisation happens from Net1 to Net2, so TC is after the leased
> line.
> Normally you would shape the outgoing traffic on eth0, but this doesn't
> work. We even tried to limit eth0 to 20kbit, but the synch-traffic
> completely fills the leased line and no other traffic gets through.
>
> We found a temporary fix by using IMQ with iptables:
> /sbin/tc qdisc del root dev imq0
> /sbin/tc qdisc add dev imq0 root handle 1: htb default 20
> /sbin/tc class add dev imq0 parent 1: classid 1:1 htb rate 2Mbit burst
> 6k
> /sbin/tc class add dev imq0 parent 1:1 classid 1:10 htb rate 64kbit ceil
> 787kbit
> /sbin/tc class add dev imq0 parent 1:1 classid 1:20 htb rate 2Mbit
> /sbin/tc qdisc add dev imq0 parent 1:10 handle 10: sfq perturb 10
> /sbin/tc qdisc add dev imq0 parent 1:20 handle 20: sfq perturb 10
> /sbin/tc filter add dev imq0 parent 1: protocol ip prio 18 u32 match ip
> dst 10.10.10.10 flowid 1:10	(10.10.10.10 is ip of server in Net2).
>
>
> Is there a better way to give the sync-traffic the lowest priority? If
> somybody starts a download it should get 2mbit and the sync-traffic
> should get the rest (if any).
>
> We would like to upgrade to 2.6, but imq is not maintained. Any help?
Your idea of using eth0 for shaping should work.  What if you add a simple tbf 
qdisc to eth0?  This limits all traffic leaving eth0 and can be used to 
"test" tc.
If the tbf works, you can try to replace it with htb or cbq to do more fancy 
shaping.
I never used a bridge to shape the traffic, but I found this im own faq :
http://docum.org/stef.coene/qos/faq/cache/41.html

Stef

-- 
stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.openprojects.net

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [LARTC] Bridge + leased line + tc
  2004-01-13 16:15 [LARTC] Bridge + leased line + tc Wouter Coppens
  2004-01-13 21:24 ` Stef Coene
@ 2004-01-14  9:21 ` Andy Furniss
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Furniss @ 2004-01-14  9:21 UTC (permalink / raw)
  To: lartc

On Tuesday 13 January 2004  4:15 pm, Wouter Coppens wrote:
> Hi,
>
> I can't get traffic shaping working.
>
> This is my situation:
>
>
> 	     --------                       ------
> Net1 ----- |router|  -------------------- | TC | ----------- Net2
>            --------      leased line      ------
>
> 						   eth1    eth0
>
> We use the leased line for normal traffic but also for synchronisation
> between 2 servers. The leased line is 2mbit. The synchronisation
> generates too much traffic and uses completely the 2mbit capacity of the
> leased line. This is no problem during night, but we want to limit the
> synchronisation traffic during day (or in other words: the sync-traffic
> should get the lowest priority and the other traffic can use up to
> 2mbit).
>
> According to the documentation, you can only shape outgoing traffic. We
> took a PC (named TC) and put the network interfaces in bridge mode.
> The synchronisation happens from Net1 to Net2, so TC is after the leased
> line.
> Normally you would shape the outgoing traffic on eth0, but this doesn't
> work. We even tried to limit eth0 to 20kbit, but the synch-traffic
> completely fills the leased line and no other traffic gets through.
>
> We found a temporary fix by using IMQ with iptables:
> /sbin/tc qdisc del root dev imq0
> /sbin/tc qdisc add dev imq0 root handle 1: htb default 20
> /sbin/tc class add dev imq0 parent 1: classid 1:1 htb rate 2Mbit burst
> 6k
> /sbin/tc class add dev imq0 parent 1:1 classid 1:10 htb rate 64kbit ceil
> 787kbit
> /sbin/tc class add dev imq0 parent 1:1 classid 1:20 htb rate 2Mbit
> /sbin/tc qdisc add dev imq0 parent 1:10 handle 10: sfq perturb 10
> /sbin/tc qdisc add dev imq0 parent 1:20 handle 20: sfq perturb 10
> /sbin/tc filter add dev imq0 parent 1: protocol ip prio 18 u32 match ip
> dst 10.10.10.10 flowid 1:10	(10.10.10.10 is ip of server in Net2).
>
>
> Is there a better way to give the sync-traffic the lowest priority? If
> somybody starts a download it should get 2mbit and the sync-traffichttp
> should get the rest (if any).
>
> We would like to upgrade to 2.6, but imq is not maintained. Any help?

IMQ has been ported to 2.6 http://www.digriz.org.uk/jdg-qos-script/

Andy.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-01-14  9:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-13 16:15 [LARTC] Bridge + leased line + tc Wouter Coppens
2004-01-13 21:24 ` Stef Coene
2004-01-14  9:21 ` Andy Furniss

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.