* [LARTC] HTB + ESFQ in nat router for shape incoming by ip
@ 2004-01-18 12:58 JaNzUn
2004-01-18 18:37 ` rubens
2004-01-18 18:53 ` Andy Furniss
0 siblings, 2 replies; 3+ messages in thread
From: JaNzUn @ 2004-01-18 12:58 UTC (permalink / raw)
To: lartc
Hi, i´ve read about this problem but i didn´t find any solution.
I have a router with nat like that:
internet - eth0 - Router - eth1 - Lan
I made a htb script for shaping outgoing in eth0 and it works great. The
problem begin with the incoming traffic... Like other people said, when
somebody in the lan uses the tipical download accelerator, the line is
out because the bandwidth is divided by conexions. So, i decided to use
htb (with one class, filter and iptables mark per ip) for shaping an
ceil traffic if it isn´t in use. All ok. Now i need to shape by ip, so i
use esfq... but nothing happend.
A few lines of my script can be read here: (Only for 2 ips, there are a
lot of them, but i do the test with two machines, one with daccelerator
an other with simple download).
$tc qdisc add dev eth1 root handle 2:0 htb default 20
$tc class add dev eth1 parent 2:0 classid 2:2 htb rate 10mbit ceil 100mbit
$tc class add dev eth1 parent 2:2 classid 2:9 htb rate 10mbit prio 2
$tc class add dev eth1 parent 2:2 classid 2:10 htb rate $DOWN ceil
$TDOWN prio 2
$tc class add dev eth1 parent 2:2 classid 2:11 htb rate $DOWN ceil
$TDOWN prio 2
$tc class add dev eth1 parent 2:2 classid 2:20 htb rate 10kbit ceil
100mbit prio 2
$tc qdisc add dev eth1 parent 2:10 handle 10: esfq perturb 10 hash dst
$tc qdisc add dev eth1 parent 2:11 handle 11: esfq perturb 10 hash dst
$tc filter add dev eth1 parent 2:0 protocol ip prio 2 handle 1 fw
classid 2:9
$tc filter add dev eth1 parent 2:0 protocol ip prio 2 handle 10 fw
classid 2:10
$tc filter add dev eth1 parent 2:0 protocol ip prio 2 handle 11 fw
classid 2:11
iptables -A POSTROUTING -t mangle -o eth1 -p tcp --destination
192.168.1.88 -j MARK --set-mark 10
iptables -A POSTROUTING -t mangle -o eth1 -p tcp --destination
192.168.1.222 -j MARK --set-mark 11
I know rates are a bit stranges, but its only a test and htb works
fine. The problem is the esfq, not work!
Has anybody make to work esfq? In this case, could you put a real script
with it?
Or... anybody knows any metod to split incoming traffic by ip testing
and working?
Thanks.
_______________________________________________
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] HTB + ESFQ in nat router for shape incoming by ip
2004-01-18 12:58 [LARTC] HTB + ESFQ in nat router for shape incoming by ip JaNzUn
@ 2004-01-18 18:37 ` rubens
2004-01-18 18:53 ` Andy Furniss
1 sibling, 0 replies; 3+ messages in thread
From: rubens @ 2004-01-18 18:37 UTC (permalink / raw)
To: lartc
> I made a htb script for shaping outgoing in eth0 and it works great. The
> problem begin with the incoming traffic... Like other people said, when
> somebody in the lan uses the tipical download accelerator, the line is
> out because the bandwidth is divided by conexions. So, i decided to use
Only if sfq is the outgoing scheduler; other schedulers will give
different results.
> htb (with one class, filter and iptables mark per ip) for shaping an
> ceil traffic if it isn´t in use. All ok. Now i need to shape by ip, so i
> use esfq... but nothing happend.
If you want to share the bandwidth equally among IPs, you can use ESFQ as
root qdisc. What your script is doing is creating a class for each IP and
defining a rate for it.
Rubens
_______________________________________________
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] HTB + ESFQ in nat router for shape incoming by ip
2004-01-18 12:58 [LARTC] HTB + ESFQ in nat router for shape incoming by ip JaNzUn
2004-01-18 18:37 ` rubens
@ 2004-01-18 18:53 ` Andy Furniss
1 sibling, 0 replies; 3+ messages in thread
From: Andy Furniss @ 2004-01-18 18:53 UTC (permalink / raw)
To: lartc
On Sunday 18 January 2004 12:58 pm, JaNzUn wrote:
> Hi, i´ve read about this problem but i didn´t find any solution.
>
> I have a router with nat like that:
> internet - eth0 - Router - eth1 - Lan
>
> I made a htb script for shaping outgoing in eth0 and it works great. The
> problem begin with the incoming traffic... Like other people said, when
> somebody in the lan uses the tipical download accelerator, the line is
> out because the bandwidth is divided by conexions. So, i decided to use
> htb (with one class, filter and iptables mark per ip) for shaping an
> ceil traffic if it isn´t in use. All ok. Now i need to shape by ip, so i
> use esfq... but nothing happend.
> A few lines of my script can be read here: (Only for 2 ips, there are a
> lot of them, but i do the test with two machines, one with daccelerator
> an other with simple download).
>
> $tc qdisc add dev eth1 root handle 2:0 htb default 20
> $tc class add dev eth1 parent 2:0 classid 2:2 htb rate 10mbit ceil
> 100mbit $tc class add dev eth1 parent 2:2 classid 2:9 htb rate 10mbit
> prio 2 $tc class add dev eth1 parent 2:2 classid 2:10 htb rate $DOWN
> ceil $TDOWN prio 2
> $tc class add dev eth1 parent 2:2 classid 2:11 htb rate $DOWN ceil
> $TDOWN prio 2
> $tc class add dev eth1 parent 2:2 classid 2:20 htb rate 10kbit ceil
> 100mbit prio 2
>
> $tc qdisc add dev eth1 parent 2:10 handle 10: esfq perturb 10 hash dst
> $tc qdisc add dev eth1 parent 2:11 handle 11: esfq perturb 10 hash dst
>
> $tc filter add dev eth1 parent 2:0 protocol ip prio 2 handle 1 fw
> classid 2:9
> $tc filter add dev eth1 parent 2:0 protocol ip prio 2 handle 10 fw
> classid 2:10
> $tc filter add dev eth1 parent 2:0 protocol ip prio 2 handle 11 fw
> classid 2:11
>
> iptables -A POSTROUTING -t mangle -o eth1 -p tcp --destination
> 192.168.1.88 -j MARK --set-mark 10
> iptables -A POSTROUTING -t mangle -o eth1 -p tcp --destination
> 192.168.1.222 -j MARK --set-mark 11
>
> I know rates are a bit stranges, but its only a test and htb works
> fine. The problem is the esfq, not work!
>
> Has anybody make to work esfq? In this case, could you put a real script
> with it?
> Or... anybody knows any metod to split incoming traffic by ip testing
> and working?
>
> Thanks.
I think if you want esqf to do dst filtering, then you should use htb to
seperate interactive traffic and have just one class for everyones bulk
traffic with one esqf attached. You are already splitting with htb the ips
to 10 and 11 then giving them one queue each - they should go to one esqf.
I'm not sure, but shouldn't you use flowid rather than classid in the $tc
filter add lines.
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-18 18:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-18 12:58 [LARTC] HTB + ESFQ in nat router for shape incoming by ip JaNzUn
2004-01-18 18:37 ` rubens
2004-01-18 18:53 ` 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.