All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] Bandwidth Limiting using HTB?
@ 2004-05-23 23:47 Gerry Weaver
  2004-05-24  1:57 ` Gerry Weaver
  0 siblings, 1 reply; 2+ messages in thread
From: Gerry Weaver @ 2004-05-23 23:47 UTC (permalink / raw)
  To: lartc


Hello All,



I've been playing around with HTB and reading the various lists for 
information on how to limit bandwidth on a particular ip or mac address. 
If I understand correctly, in order to use HTB for this, I would have to 
create a separate root class for each ip address that I wanted to limit. 
I have tried this and it seems to work.  This seems okay for a few ips, 
but seems excessive for 100+ addresses. Especially if you wanted to add 
some interactive traffic shaping. Is this how it's done or is there a 
better approach?



Thanks in advance,

Gerry


_______________________________________________
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

* Re: [LARTC] Bandwidth Limiting using HTB?
  2004-05-23 23:47 [LARTC] Bandwidth Limiting using HTB? Gerry Weaver
@ 2004-05-24  1:57 ` Gerry Weaver
  0 siblings, 0 replies; 2+ messages in thread
From: Gerry Weaver @ 2004-05-24  1:57 UTC (permalink / raw)
  To: lartc

Hi,

Thanks for the reply. I guess it would be best to provide a little more 
detail on the problem.

I've got 100+ users. Each of these users have a particular level/speed 
of service. These range from 128kbit to 1024kbit. I need a way to set a 
limit for each user based on their level/speed of service. My initial 
approach was to use 2 machines set up as bridges. One would handle 
limiting and the other would do shaping.  There are currently 2 T1s 
supporting this.

 I did the following:

WAN_IFACE="eth0"
WAN_RATE="3mbit"

# add root qdisc
tc qdisc add dev $WAN_IFACE root handle 1: htb default 1:2

# add main link ( I assume this will slow the interface down to 3mbit? )
tc class add dev $WAN_IFACE parent 1: classid 1:1 htb rate $WAN_RATE

# typical user
tc class add dev $WAN_IFACE parent 1:1 classid 1:2 htb rate 128kbit
...

tc filter add dev $WAN_IFACE parent 1:1 protocol ip prio16 u32 match ip 
src 192.168.1.1  \ flowid 1:2
...

If my understanding is correct this should limit the bandwidth of ip 
address 192.168.1.1 to 128kbit?

Any other unclassified traffic should also be limited to 128kbit?

I'm new to this. Do the above lines look correct?

Thanks,
Gerry


Adrian Vasile wrote:

>There are 2 ways:
>1. as you said, each ip has its own class. this approach is used by an
>ISP that I know and works great (if you have the bandwidth).
>2. you classify traffic. each type with its own class (eg. http class,
>ftp class and so on). here we have a (small) problem. if you have
>bandwidth hogs (p2p) it is possible that they'll eat up most of the
>bandwidth or other services (eg http) be confused with p2p traffic. and
>all this match-making would consume some cpu.
>
>I'm open to suggestions. which is better 1 or 2?
>  
>
>
> ------------------------------------------------------------------------
>
> Subject:
> [LARTC] Bandwidth Limiting using HTB?
> From:
> Gerry Weaver <gerryw@it-procorp.com>
> Date:
> Sun, 23 May 2004 18:47:34 -0500
> To:
> lartc@mailman.ds9a.nl
>
> To:
> lartc@mailman.ds9a.nl
>
>
>
> Hello All,
>
>
>
> I've been playing around with HTB and reading the various lists for 
> information on how to limit bandwidth on a particular ip or mac 
> address. If I understand correctly, in order to use HTB for this, I 
> would have to create a separate root class for each ip address that I 
> wanted to limit. I have tried this and it seems to work.  This seems 
> okay for a few ips, but seems excessive for 100+ addresses. Especially 
> if you wanted to add some interactive traffic shaping. Is this how 
> it's done or is there a better approach?
>
>
>
> Thanks in advance,
>
> Gerry
>
>
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>

-- 
Gerry Weaver

IT-Pro Corp.

Office: (254) 883-9040
Mobile: (512) 663-9550
Fax   : (254) 883-9041

_______________________________________________
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:[~2004-05-24  1:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-23 23:47 [LARTC] Bandwidth Limiting using HTB? Gerry Weaver
2004-05-24  1:57 ` Gerry Weaver

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.