From owner-freebsd-ipfw@FreeBSD.ORG Mon May 23 20:29:06 2005 Return-Path: X-Original-To: freebsd-ipfw@freebsd.org Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7852D16A41C for ; Mon, 23 May 2005 20:29:06 +0000 (GMT) (envelope-from dionch@freemail.gr) Received: from smtp.freemail.gr (smtp.freemail.gr [213.239.180.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id F27F043D49 for ; Mon, 23 May 2005 20:29:05 +0000 (GMT) (envelope-from dionch@freemail.gr) Received: by smtp.freemail.gr (Postfix, from userid 101) id C61E2BC071; Mon, 23 May 2005 23:29:04 +0300 (EEST) Received: from R3B (unknown [62.38.169.49])by smtp.freemail.gr (Postfix) with ESMTP id 67C22BC070; Mon, 23 May 2005 23:29:03 +0300 (EEST) Message-ID: <008801c55fd5$d6e7dec0$0100000a@R3B> From: "Chris Dionissopoulos" To: , References: <1116872082.42921d92b020d@webmail.unixware.ro> Date: Mon, 23 May 2005 23:27:26 +0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Cc: Subject: Re: QoS and guaranteed bandwidth X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Chris Dionissopoulos List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 May 2005 20:29:06 -0000 >I must have two different values for every user: guaranteed bandwidth and > maximum bandwidth > > Citat "Alexandre D." : 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.