LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices

Reply
 
LinkBack Search this Thread
Old 05-19-2010, 05:21 AM   #1
Lexus45
Member
 
Registered: Jan 2010
Location: Kurgan, Russia
Distribution: Slackware, Ubuntu
Posts: 242
Blog Entries: 3

Rep: Reputation: 34
Question OBSD 4.6, ALTQ: CBQ issues


Hi guys!
I'm new to OpenBSD but i try to do my best to master this OS and its features.

I have a router which does the shaping to my users. Now it runs Slackware Linux and works very well, but I have an idea to set it using OpenBSD. The root queue is 2 megabits/s and there are about 30 users. Each has 256 kbit/s after I organised the shaping.

I've read carefully an OpenBSD's PF faq, but still have 2 questions. (NOTE: I don't write here some details, like default queue or macroses, because it's not so importnat here)

1. As I create the root queue of 2 mbit/s and have 30 users, 256 kbit/s each, I wrote this:

Code:
altq on $int_if cbq bandwidth 2Mb queue {pc2, pc3, pc4 ....... pc30}

 queue pc2 $int_if bandwidth 256Kb cbq
 queue pc3 $int_if bandwidth 256Kb cbq
 queue pc4 $int_if bandwidth 256Kb cbq
 ...
 queue pc30 $int_if bandwidth 256Kb cbq

  pass out on $int_if from any to $pc2 queue pc2
  pass out on $int_if from any to $pc2 queue pc3
  pass out on $int_if from any to $pc2 queue pc4
  ...
  pass out on $int_if from any to $pc2 queue pc30
The QUESTION: as I understood from the PF's faq, the total sum of queues' bandwidths must be equal to the root queue's bandwidth. But I have 2 megabits/s all in all and 30 users * 0,25 megabits/s = 7,5 megabit/s. What I have to do, if I have only 2 mbit/s link but I'd like to give 256 kbit/s to each my user? I understand that in real life it will be OK, because all 30 users don't use all their 256 kbit/s simultaneously.

2 question. Is it possible to make this ruleset smaller? Or I have to write a line for each queue name and then - for each IP , to assign a queue to it ?
Say, I will not write many lines - a line for each IP, bit if I'll use '10.84.27.0/24' - will the queue be assigned to ALL subnet, or PF will understanf my desire to allocate the bandwidth to each IP of this subnet?
Code:
queue inet $int_if bandwidth 256Kb cbq
pass out on $int_if from any to 10.84.27.0/24 queue inet
^^ will this rule give 256 kbit/s to each IP from 10.84.27.0/24 range or 256 kbit/s for all subnet (so, when several IPs will start to surf the web or download anything, these 256 kbit/s will be allocated among all of them)?


I had the same question while writing the shaping rules in Linux, but didn't find anything and wrote a ruleset with an 'IP rule per line'.

PS: sorry for my English, I'm not a native speaker
 
Old 05-19-2010, 10:29 AM   #2
rocket357
Member
 
Registered: Mar 2007
Location: 127.0.0.1
Distribution: OpenBSD-CURRENT
Posts: 460
Blog Entries: 67

Rep: Reputation: 70
To handle the first question, I'd give each user 68 kbit/s (2 mbit/s divided by 30), but allow them to "borrow" bandwidth as per the pf faq. This means if by chance all users are on at once, you have a stable system, but if not then they are allowed to "borrow" bandwidth from each other's queues.
 
1 members found this post helpful.
Old 05-19-2010, 03:20 PM   #3
Lexus45
Member
 
Registered: Jan 2010
Location: Kurgan, Russia
Distribution: Slackware, Ubuntu
Posts: 242
Blog Entries: 3

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by rocket357 View Post
To handle the first question, I'd give each user 68 kbit/s (2 mbit/s divided by 30), but allow them to "borrow" bandwidth as per the pf faq. This means if by chance all users are on at once, you have a stable system, but if not then they are allowed to "borrow" bandwidth from each other's queues.
Thanks, friend!
I think this will do well:
Quote:
The hfsc scheduler supports some additional options:

linkshare <sc> The bandwidth share of a backlogged queue.
realtime <sc> The minimum required bandwidth for the queue.
upperlimit <sc> The maximum allowed bandwidth for the queue.

<sc> is an abbreviation for service curve.
And about the 2nd question.
I googled and devoured much info. And now I can say (according to what I've found/read) that the best way is still to write many rules manually.

Though, FreeBSD has some features to get rid of this routine; as far as I remember that tool is called DummyNet.
 
1 members found this post helpful.
Old 05-20-2010, 11:31 PM   #4
ocicat
Member
 
Registered: May 2007
Posts: 193

Rep: Reputation: 43
Quote:
Originally Posted by Lexus45 View Post
Though, FreeBSD has some features to get rid of this routine; as far as I remember that tool is called DummyNet.
I will caution you against mixing tools across different operating systems, as pf(4) available on FreeBSD is at least two versions behind that on OpenBSD. There has been a lot of structural & syntax changes to pf(4) on OpenBSD for several versions now, so I would be wary of the compatibility between the various *BSD's.

Although pf(4)'s grammar is publicly stated in the manpage, the correctness of third party tools to generate syntactically correct rulesets should be approached with caution. Because the tools are suspect, the OpenBSD developers advocate using the best tool -- an editor. Yes, working through the thorny issues of complex configurations has its aggravations, but the upside is that you will understand the ramifications of your decisions more clearly if you write your ruleset yourself.
 
  


Reply

Tags
cbq, pf


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
openBSd 4.4 altQ isue,.. spatieman *BSD 0 03-25-2009 03:44 PM
How do I use mail in OBSD 4.0? OlRoy *BSD 5 01-29-2007 07:33 PM
FreeBSD 6.1 + bridge + ALTQ ??? tritong *BSD 1 12-20-2006 07:36 PM
obsd: disabling isa Fonk *BSD 2 09-24-2005 11:34 AM
OBSD 3.4 and GNOME 2.4? german *BSD 0 10-30-2003 07:46 PM


All times are GMT -5. The time now is 07:30 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration