All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] how to guarantee bandwidth for a service
@ 2003-04-10  7:32 Adam Schrader
  2003-04-10 16:20 ` Jay Wineinger
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Schrader @ 2003-04-10  7:32 UTC (permalink / raw)
  To: lartc

[-- Attachment #1: Type: text/plain, Size: 646 bytes --]


How can I guarantee a certain amount of bandwidth for a certain service, ie web browsing (port 80) or half-life (27015) or even per ip and then just leave the rest of the bw to be fought over. The problem is that people have file sharing programs edonkey, kazaa and so on and rather than keep track of them all and try to manage their bandwidth usage so as so leave some for the other services I would just like to let them fight over as much bw as they can take after guaranteeing a certain amount for certain services/ips.

-Adam



---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more

[-- Attachment #2: Type: text/html, Size: 722 bytes --]

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

* Re: [LARTC] how to guarantee bandwidth for a service
  2003-04-10  7:32 [LARTC] how to guarantee bandwidth for a service Adam Schrader
@ 2003-04-10 16:20 ` Jay Wineinger
  0 siblings, 0 replies; 2+ messages in thread
From: Jay Wineinger @ 2003-04-10 16:20 UTC (permalink / raw)
  To: lartc

I have a similar situation in which I provide internet for about 12 people
on a dorm floor.  What I do is use iptables to mark everything to bulk to
start with, and then I remark the stuff I want prioritized (ssh, icmp, www,
smtp, pop, etc) and place those into htb classes with certain amounts of
guaranteed bandwidth.  Everything else that stays with the initial mark is
placed in the lowest priority class with a small amount of guaranteed
bandwidth.  That class can borrow from others if there is not much traffic
in them, but useful services definitely get the lions share of the link if
needed.  If you want to guarantee bandwidth for a specific service, just
mark all packets related to that and place them in a class by themselves
with a certain rate.  Generally, create a parent class at just below your
link's rate, then child-classes to hold all the different kinds of traffic
you want.

perhaps for halflife, something like this:
iptables -t mangle -A POSTROUTING -p tcp --dport 27005:27015 -j
MARK --set-mark 0x1    <--- mark halflife packets with 1 (hex)

Create root qdisc and classes for traffic, defaulting to class 104 for bulk
tc qdisc add dev eth1 root handle 1: htb default 104
tc class add dev eth1 parent 1:1 classid 1:10 htb rate 100kbps
    tc class add dev eth1 parent 1:10 classid 1:101 htb rate 50kbps prio 1
ceil 95kbps    <--- halflife class
    tc class add dev eth1 parent 1:10 classid 1:104 htb rate 10kbps prio 4
ceil 95kbps    <--- bulk class

tc filter add dev eth1 parent 1: protocol ip prio 1 handle 1 fw classid
1:101    <--- filter to catch the halflife packets marked with 1 and place
them in 101


Any corrections or suggestions are welcome
Jay

<snip>
>How can I guarantee a certain amount of bandwidth for a certain service, ie
web browsing (port 80) or half-life (27015) or even per ip and then >just
leave the rest of the bw to be fought over. The problem is that people have
file sharing programs edonkey, kazaa and so on and rather than >keep track
of them all and try to manage their bandwidth usage so as so leave some for
the other services I would just like to let them fight over as >much bw as
they can take after guaranteeing a certain amount for certain services/ips

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

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

end of thread, other threads:[~2003-04-10 16:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-10  7:32 [LARTC] how to guarantee bandwidth for a service Adam Schrader
2003-04-10 16:20 ` Jay Wineinger

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.