All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] ADSL/Ethernet differentiation
@ 2002-01-27 23:35 tc
  2002-01-28  8:14 ` Stef Coene
  0 siblings, 1 reply; 2+ messages in thread
From: tc @ 2002-01-27 23:35 UTC (permalink / raw)
  To: lartc

Hi all,

I am new to traffic management and I am having some difficulty working out
how to differentiate between my ADSL link and LAN.

Background: I recently purchased an "Audiotron", which is a networked device
that allows me to play MP3's over my LAN and also allows me to listen to
Internet Radio, through my ADSL link (512Kb/s) and then over the LAN.
I discovered, however, that when I am doing large downloads, the Internet
Radio on the Audiotron suffers (no bandwidth), so I have started looking
into traffic shaping.
Seeing as I am doing this, I decided that I would also like to give priority
to web, news and mail, over any other service, so that large FTP downloads
would not affect web browsing speed.
My LAN consists of a Linux box with a USB ADSL modem (ppp) and a 100Mb/s
network card (eth0). The other machines on my network are all 100Mb/s

To sum it up simply: Top priority is Audiotron, which should never take up
ALL of the bandwidth (it should never need to), but I would like it to have
256 Kb/s if needed.
Next up is web, news and mail, which should take priority over everything
else, so I reckon 248Kb/s, leaving 8Kb/s for the rest (which will borrow
from the others alot :)

I have read the documentation and I think that the rules included at the
bottom of this email should work. However, I am not sure whether this would
also restrict the bandwidth between machines, which I would like to remain
at 100Mb/s.

I would appreciate opinions from more experienced people as to how I can
manage this. Also, if there are any flaws (read: stupid mistakes) in my
rules, I would appreciate comments!

Cheers,

Ben

Rules:

# Add HTB as the queue discipline on eth0.
tc qdisc add dev eth0 root handle 1: htb default 20

# Add a root class rated at 512kbit (the speed of my adsl downloads)
tc class add dev eth0 parent 1: classid 1:1 htb rate 512kbit burst 2k

# Add a class with a guaranteed rate of 256kbit and ceiling of 512kbit for
the Audiotron
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 256kbit ceil 512kbit
burst 2k

# Add a class for all web, news and mail traffic, rated at 248kbit with
512kbit ceiling
tc class add dev eth0 parent 1:1 classid 1:15 htb rate 248kbit ceil 512kbit
burst 2k

# Add default class for all other traffic, rated at 8kbit with 512kbit
ceiling
tc class add dev eth0 parent 1:1 classid 1:20 htb rate 8kbit ceil 512kbit
burst 2k

# OK, we have our classes, now add some filters.

# First the Audiotron
tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip dst
192.168.0.9/32 flowid 1:10

# Next for Web, News and Mail
# http/https
tc filter add dev eth0 protocol ip parent 1: prio 2 u32 match ip dport 80
0xffff flowid 1:15
tc filter add dev eth0 protocol ip parent 1: prio 2 u32 match ip dport 443
0xffff flowid 1:15
# pop3/smtp
tc filter add dev eth0 protocol ip parent 1: prio 2 u32 match ip dport 25
0xffff flowid 1:15
tc filter add dev eth0 protocol ip parent 1: prio 2 u32 match ip dport 110
0xffff flowid 1:15

# news/home news
tc filter add dev eth0 protocol ip parent 1: prio 2 u32 match ip dport 119
0xffff flowid 1:15

# Everything else comes under the default.
tc filter add dev eth0 protocol ip parent 1: prio 3 flowid 1:20


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

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

end of thread, other threads:[~2002-01-28  8:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-27 23:35 [LARTC] ADSL/Ethernet differentiation tc
2002-01-28  8:14 ` Stef Coene

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.