All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] shaping from  ethernets to adsl
@ 2002-02-09 16:49 Nigel Jones
  2002-02-09 22:45 ` Martin Devera
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Nigel Jones @ 2002-02-09 16:49 UTC (permalink / raw)
  To: lartc

I have 2 ethernet subnets -- one wireless (eth0 192.168.0), one 10Mbs wired
(eth1 192.168.1) connected to a 512 up / 256 down adsl connection (ppp0). I
have a single ip address on the ppp0 connection, and use nat to the devices
on the ethernet networks (there's only 1 on each!)

I'd like to priotize small packets (<500 bytes). May also look at other
packet markings as time goes on (ie audio stream> icmp/small> http > ftp).
I'd also like local traffic to be unaffected.

To help in testing, I've bounded the classes for now, but will likely remove
this when I know it's working.

I've just realised something though.... How do I allow the total download
bandwidth hitting eth0+eth1 from the net connection (ppp0) to be limited at
512, but "pooled" it I don't want to divide 256/256 per ethernet segment.
All these restrictions are device specific?

Here's what I've done so far - I know it's rather long. I think it works in
part, but the multiple ethernet issue I'm really confused by!. Also I don't
know what to set the other cbq parms to

Help!?

I think I need to throttle
#!/bin/sh

tc qdisc del root dev eth0 2>/dev/null

tc qdisc del root dev eth1 2>/dev/null

tc qdisc del root dev ppp0 2>/dev/null

tc class del root dev eth0 2>/dev/null

tc class del root dev eth1 2>/dev/null

tc class del root dev ppp0 2>/dev/null

# small packets - mark with 3

iptables -t mangle -A OUTPUT -m length --length 0:500 -j MARK --set-mark 3

iptables -t mangle -A OUTPUT -p icmp -j MARK --set-mark 3

# large packets - mark with 4

iptables -t mangle -A OUTPUT -m length --length 500:15000 -j MARK --set-mark
4

iptables -t mangle -A OUTPUT -p icmp -j MARK --set-mark 3

# Mark local traffic between ethernet segments

iptables -t mangle -A OUTPUT -s 192.168.0.1/16 -d eth1 -j MARK --set-mark 9

iptables -t mangle -A OUTPUT -s 192.168.0.1/16 -d eth0 -j MARK --set-mark 9

#

# root queueing discipline - adsl is 256 upstream

tc qdisc add dev ppp0 root handle 10: cbq bandwidth 256kbit avpkt 1000

tc qdisc add dev eth0 root handle 11: cbq bandwidth 10Mbit avpkt 1000

tc qdisc add dev eth1 root handle 12: cbq bandwidth 10Mbit avpkt 1000

# see http://www.prout.be/qos/QoS-connection-tuning-HOWTO.txt

# here's the total 256 for upstream adsl

tc class add dev ppp0 parent 10:0 classid 10:1 cbq bandwidth 256kbit rate
256kbit prio 4 bounded isolated allot 1514

# 10:2 for interactive

tc class add dev ppp0 parent 10:1 classid 10:2 cbq bandwidth 256kbit rate
85Kbit prio 1 bounded isolated allot 1514

# 10:3 for large traffic

tc class add dev ppp0 parent 10:1 classid 10:3 cbq bandwidth 256kbit rate
171kbit prio 8 bounded isolated allot 1514

# base 10 Mbs ethernet

tc class add dev eth0 parent 11:0 classid 11:1 cbq bandwidth 10Mbit rate
512kbit prio 4 bounded isolated allot 1514

# local traffic on 11:9

tc class add dev eth0 parent 11:0 classid 11:9 cbq bandwidth 10Mbit rate
10Mbit prio 4 bounded allot 1514

# interactive traffic

tc class add dev eth0 parent 11:1 classid 11:2 cbq bandwidth 512kbit rate
171Kbit prio 1 bounded isolated allot 1514

# batch

tc class add dev eth0 parent 11:1 classid 11:3 cbq bandwidth 512kbit rate
442Kbit prio 8 bounded isolated allot 1514

tc class add dev eth1 parent 12:0 classid 12:1 cbq bandwidth 10Mbit rate
512Kbit prio 4 bounded isolated allot 1514

tc class add dev eth1 parent 12:1 classid 12:2 cbq bandwidth 512kbit rate
171Kbit prio 1 bounded isolated allot 1514

tc class add dev eth1 parent 12:1 classid 12:3 cbq bandwidth 512kbit rate
442Kbit prio 8 bounded isolated allot 1514

tc class add dev eth1 parent 12:0 classid 12:9 cbq bandwidth 10Mbit rate
10Mbit prio 4 bounded allot 1514

# Add sfq for fairness

tc qdisc add dev ppp0 parent 10:2 sfq quantum 1514b perturb 15

tc qdisc add dev ppp0 parent 10:3 sfq quantum 1514b perturb 15

tc qdisc add dev eth0 parent 11:2 sfq quantum 1514b perturb 15

tc qdisc add dev eth0 parent 11:3 sfq quantum 1514b perturb 15

tc qdisc add dev eth0 parent 11:9 sfq quantum 1514b perturb 15

tc qdisc add dev eth1 parent 12:2 sfq quantum 1514b perturb 15

tc qdisc add dev eth1 parent 12:3 sfq quantum 1514b perturb 15

tc qdisc add dev eth1 parent 12:9 sfq quantum 1514b perturb 15

#Use marks to allocate to queues

tc filter add dev ppp0 parent 10:0 protocol ip handle 3 fw flowid 10:2

tc filter add dev ppp0 parent 10:0 protocol ip handle 4 fw flowid 10:3

tc filter add dev eth0 parent 11:0 protocol ip handle 3 fw flowid 11:2

tc filter add dev eth0 parent 11:0 protocol ip handle 4 fw flowid 11:3

tc filter add dev eth0 parent 11:0 protocol ip handle 9 fw flowid 11:9

tc filter add dev eth1 parent 12:0 protocol ip handle 3 fw flowid 12:2

tc filter add dev eth1 parent 12:0 protocol ip handle 4 fw flowid 12:3

tc filter add dev eth1 parent 12:0 protocol ip handle 9 fw flowid 12:9

for dev in eth0 eth1 ppp0

Nigel Jones



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

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

end of thread, other threads:[~2002-02-12 10:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-09 16:49 [LARTC] shaping from ethernets to adsl Nigel Jones
2002-02-09 22:45 ` Martin Devera
2002-02-10  2:25 ` Ross Skaliotis
2002-02-10 10:40 ` Martin Devera
2002-02-11 22:22 ` Nigel Jones
2002-02-12 10:40 ` Martin Devera

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.