QoS and guaranteed bandwidth

Chris Dionissopoulos dionch at freemail.gr
Mon May 23 20:29:06 GMT 2005


>I must have two different values for every user: guaranteed bandwidth and
> maximum bandwidth
> 
> Citat "Alexandre D." <alexandre.delay at free.fr>:

This adds a little complexity to the previous procedure.

Variables:
~~~~~~~~
$N = group number of users [1,2,.....]
$USER_MAX_BW[$N] max bandwidth of a single user in group $N.
$USER_MIN_BW[$N] min bandwidth of a single user in group $N.
$USERS_SUBNET[$N], a group subnet (of users) in CIDR format.
$WAN_INTERFACE, your gateway wan interface name.


Procedure:
========
1. Calculate your priority
~~~~~~~~~~~~~~~~~~~
The rule says that the priority in WFQ is calculated if you divide your total  bandiwdth 
with the minimum allocated bandwidth to each user. So we have:

$WFQ_Priority[$N] =  $USER_MAX_BW[$N] / $USER_MIN_BW[$N].


2.Add a proper Pipe and Queue
~~~~~~~~~~~~~~~~~~~~~~~~~
ipfw pipe $N config bw  $USER_MAX_BW[$N]  queue 20Kbytes
ipfw queue $N pipe $N weight $WFQ_Priority[$N]  mask src-ip 0xffffffff queue 10kbytes

ipfw add queue $N ip from $USERS_SUBNET[$N]  to any xmit out $WAN_INTERFACE


example:
=======
2 groups of users:
Group1 - 192.168.0.0/28 , Bandwidth = min 32Kbps - max 256kbps
Group2 - 192.168.0.16/28 , Bandwidth = min 32Kbps - max 384Kbps
$wan  = fxp0

(I assume that your line has at least the minimum bandwidth you guarantee.
in our case is 32users x 32kbps = 1024Kbps )

1.priorities:

$wfq[1] = 256 / 32 = 12
$wfq[2] = 384/ 32  = 16

2.ipfw commands:

ipfw pipe 1 config bw  256Kb/s  queue 20Kbytes
ipfw queue 1 pipe 1 weight 12  mask src-ip 0xffffffff queue 10kbytes
ipfw add queue 1 ip from 192.168.0.0/28  to any xmit out fxp0
ipfw pipe 2 config bw  384Kb/s  queue 20Kbytes
ipfw queue 2 pipe 2 weight 16 mask src-ip 0xffffffff queue 10kbytes
ipfw add queue 2 ip from 192.168.0.16/28  to any xmit out fxp0


So simple!

Chris.

____________________________________________________________________
http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
http://www.freemail.gr - free email service for the Greek-speaking.


More information about the freebsd-ipfw mailing list