All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] Trivial newbie HTB problem
@ 2003-08-25 10:50 Jan Rovner
  2003-08-25 12:27 ` Stef Coene
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Rovner @ 2003-08-25 10:50 UTC (permalink / raw)
  To: lartc

Hello,

I'm newbie to HTB and need to solve really simple problem:

I have an single IP internet connection @ 1024kbit attached to a linux 
box (2.4.21), doing NAT for clients at internal 192.168.1.x network.

I need to setup a simple traffic shaping, for a single PC 192.168.1.2
I wish to guarantee minimum rate of 768kbit, for others 32kbit.
Maximum rates must be always full speed (1024kbit) !

Can you please tell me what's wrong with that (wlan0 is the internal
iface),
because this does not work (192.168.1.2 does not get the guaranteed
bandwidth,
but only a 1/n of bandwidth for case that another n stations saturate
the line).

Thank you. My script follows.

tc qdisc del dev wlan0 root

#by default, all clients go through slow :30 class
tc qdisc add dev wlan0 root handle 1: htb default 30

tc class add dev wlan0 parent 1: classid 1:1 htb rate 1024kbit ceil
1024kbit

# i wish :10 class 768-1024, :30 class 32-1024
tc class add dev wlan0 parent 1:1 classid 1:10 htb rate 768kbit ceil
1024kbit prio 0
tc class add dev wlan0 parent 1:1 classid 1:30 htb rate 32kbit ceil
1024kbit prio 2

tc qdisc add dev wlan0 parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev wlan0 parent 1:30 handle 30: sfq perturb 10

# client 192.168.1.2 is privileged, should be in :10 class
tc filter add dev wlan0 protocol ip parent 1:0 prio 0 u32 match ip dst
192.168.1.2 flowid 1:10

_______________________________________________
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] Trivial newbie HTB problem
  2003-08-25 10:50 [LARTC] Trivial newbie HTB problem Jan Rovner
@ 2003-08-25 12:27 ` Stef Coene
  0 siblings, 0 replies; 2+ messages in thread
From: Stef Coene @ 2003-08-25 12:27 UTC (permalink / raw)
  To: lartc

On Monday 25 August 2003 12:50, Jan Rovner wrote:
> Hello,
>
> I'm newbie to HTB and need to solve really simple problem:
>
> I have an single IP internet connection @ 1024kbit attached to a linux
> box (2.4.21), doing NAT for clients at internal 192.168.1.x network.
>
> I need to setup a simple traffic shaping, for a single PC 192.168.1.2
> I wish to guarantee minimum rate of 768kbit, for others 32kbit.
> Maximum rates must be always full speed (1024kbit) !
>
> Can you please tell me what's wrong with that (wlan0 is the internal
> iface),
> because this does not work (192.168.1.2 does not get the guaranteed
> bandwidth,
> but only a 1/n of bandwidth for case that another n stations saturate
> the line).
>
> Thank you. My script follows.
>
> tc qdisc del dev wlan0 root
>
> #by default, all clients go through slow :30 class
> tc qdisc add dev wlan0 root handle 1: htb default 30
>
> tc class add dev wlan0 parent 1: classid 1:1 htb rate 1024kbit ceil
> 1024kbit
You have to limit the total bandwidth to less then your link bandwidth so YOU 
are the bottleneck.  So take 1000kbit as the ceil and not 1024kbit.

> # i wish :10 class 768-1024, :30 class 32-1024
> tc class add dev wlan0 parent 1:1 classid 1:10 htb rate 768kbit ceil
> 1024kbit prio 0
> tc class add dev wlan0 parent 1:1 classid 1:30 htb rate 32kbit ceil
> 1024kbit prio 2
Give both classes the same prio.

Also see www.docum.org for more info.

Stef

-- 

stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
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-08-25 12:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-25 10:50 [LARTC] Trivial newbie HTB problem Jan Rovner
2003-08-25 12:27 ` 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.