LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-07-2005, 10:20 PM   #1
ALMAM
LQ Newbie
 
Registered: Jul 2005
Posts: 12

Rep: Reputation: 0
Bandwidth control not working as expected.


Hi Folks,

For quite a while, I have been trying to use a gateway to control the bandwidth for specific users and specific networks. Plain bandwidth consumption control, using ip addresses (hosts and networks), without marking packets or controlling ports. Apparently, a simple task, but it's turning into a nightmare.

I have tried cbq and htb, distros fedora (core 1, 2, 3 and 4), redhat (8 and 9) and also, conectiva. But with no success at all in any of the installations. The problema is that I cannot achieve the desired speed. For example, if I want to allow just 8kbps, it goes as fast as 80kbps, if I want 16, it goes 200. No matter the desired speed, I never get the expected results. It goes way above.

I have tried to find information, but none helped me to find out what is going wrong.

I had in my hands, a commercial product the does work using cbq. No rocket science. A few differences: this product performs a bunch of other functions like firewall, squid, mail, and so on. On this very same product, under the directory /lib/modules/kernel_version/kernel/net/sched, all the files have a .o as extension and on my installations, under the same directory, I always have .ko as extensions.

Could anybody explain to me the differences between sch_htb.o and sch_htb.ko? How can I make a .ko file turn into a .o file?

I did not try, not yet, to copy the .o files over the .ko. I may end up trying this, but I bet it's not going to work.

The configuration files I am using on my tests were copied to this commercial product and they worked. So, I guess that the problem lies somewhere else other than my configs. Most probably, it's the installation itself. Since I am not very savvy in terms of linux, it was done the dumb way. Through the gui as if I were installing a windows box.

Could anybody help me to try to find what is wrong?

According to what I have seen, the kernel parameters I am using are correct and are as follows:

#
# QoS and/or fair queueing
#
CONFIG_NET_SCHED=y
CONFIG_NET_SCH_CLK_JIFFIES=y
# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
# CONFIG_NET_SCH_CLK_CPU is not set
CONFIG_NET_SCH_CBQ=m
CONFIG_NET_SCH_HTB=m
CONFIG_NET_SCH_HFSC=m
CONFIG_NET_SCH_ATM=m
CONFIG_NET_SCH_PRIO=m
CONFIG_NET_SCH_RED=m
CONFIG_NET_SCH_SFQ=m
CONFIG_NET_SCH_TEQL=m
CONFIG_NET_SCH_TBF=m
CONFIG_NET_SCH_GRED=m
CONFIG_NET_SCH_DSMARK=m
CONFIG_NET_SCH_NETEM=m
CONFIG_NET_SCH_INGRESS=m
CONFIG_NET_QOS=y
CONFIG_NET_ESTIMATOR=y
CONFIG_NET_CLS=y
CONFIG_NET_CLS_BASIC=m
CONFIG_NET_CLS_TCINDEX=m
CONFIG_NET_CLS_ROUTE4=m
CONFIG_NET_CLS_ROUTE=y
CONFIG_NET_CLS_FW=m
CONFIG_NET_CLS_U32=m
CONFIG_CLS_U32_PERF=y
CONFIG_NET_CLS_IND=y
CONFIG_CLS_U32_MARK=y
CONFIG_NET_CLS_RSVP=m
CONFIG_NET_CLS_RSVP6=m
CONFIG_NET_EMATCH=y
CONFIG_NET_EMATCH_STACK=32
CONFIG_NET_EMATCH_CMP=m
CONFIG_NET_EMATCH_NBYTE=m
CONFIG_NET_EMATCH_U32=m
CONFIG_NET_EMATCH_META=m
# CONFIG_NET_CLS_ACT is not set
CONFIG_NET_CLS_POLICE=y

Any help is very appreciated.

Thanks in advance.

Regards,

AL
 
Old 09-08-2005, 01:30 AM   #2
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
Quote:
For example, if I want to allow just 8kbps, it goes as fast as 80kbps, if I want 16, it goes 200.
Is this running by itself? In other words is it using it's allotted bandwidth while the network is under load? If not - and depending on how you set it up - it will only throttle when another node on the network starts downloading. Until then, it's given pretty much free reign. This is - of course - dependent on how it's set up.

Quote:
Could anybody explain to me the differences between sch_htb.o and sch_htb.ko?
*.o modules come from 2.4 (and earlier) series kernels and *.ko come from 2.6.

Quote:
How can I make a .ko file turn into a .o file?
You can't. If you need to run this program (are you sure it's a "program"?) you'll need a version compiled for 2.6 kernels or run with a 2.4 kernel.
 
Old 09-08-2005, 12:36 PM   #3
ALMAM
LQ Newbie
 
Registered: Jul 2005
Posts: 12

Original Poster
Rep: Reputation: 0
Hi adz, thanks for your reply.

Actually, during the tests I had only my machine conected to the network. The same situation when I used the commercial package, when my config files worked.

Thanks for clarifying the files extensions issue.

In order to have the box controlling bw, does it need any special configuration during the installation?

Do you have experience with cbq or htb in any of the mentioned distros?

Any other ideas?

Again, thanks for your time.

Best regads.
 
Old 09-08-2005, 09:39 PM   #4
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
I'm afraid I have no experience in cbq or htb. But if the commercial one worked then why not use that?
 
Old 09-12-2005, 04:45 PM   #5
ALMAM
LQ Newbie
 
Registered: Jul 2005
Posts: 12

Original Poster
Rep: Reputation: 0
Does anybody out there knows if having a firewall installed and activated on the bandwidth controller machine is mandatory?

Thanks in advance,
 
Old 09-25-2005, 02:25 PM   #6
frostschutz
Member
 
Registered: Apr 2004
Distribution: Gentoo
Posts: 95

Rep: Reputation: 28
I don't have a firewall, but iptables support is enabled nevertheless. (I use it to mark packets that get shaped later). The distro, by the way, should not matter to shaping at all (as long as a proper tc tool is available). Shaping is done completely by iptables / sched / the kernel, not in userspace.
 
Old 09-27-2005, 09:43 PM   #7
ALMAM
LQ Newbie
 
Registered: Jul 2005
Posts: 12

Original Poster
Rep: Reputation: 0
Hi frostschutz; thanks a lot for your reply.

What do you mean by not having a firewall and having support for it? Do you mean that your kernel is compiled with the parameters related to iptables (Netfilter) and you do not have it installed?

Did you have the chance to browse the QoS parameters I've sent? Does it agree with the ones you use? Any other hint in terms of kernel's settings? Maybe you have a recommendation for Netfiter parameters.

I agree with you that the distro should not play any important role on this matter. I mentioned that to show you guys how lost I am.

How do you get your packets marked? Do you mark just any packet travelling the gateway from inside to outside?

Anyway, I managed to make it work, achieving the desired results (or close) but the only way was making use of nat. If I remove the nat, the results get way above the intended ones, exectly like before.

The problem is that I cannot do nat to all the outgoing traffic. A few would do fine (namely private address space).

Once again, thanks a million for your reply.

I appreciate any help.

Regards,
 
Old 09-28-2005, 07:41 AM   #8
frostschutz
Member
 
Registered: Apr 2004
Distribution: Gentoo
Posts: 95

Rep: Reputation: 28
I have netfilter installed and enabled and everything, but I don't actually have a firewall (I don't use netfilter to drop packets). About the schedulers and kernel configuration and stuff, I just set everything to 'y' because I don't have to worry about kernel size and I'm too lazy to load modules...
 
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
S_ISDIR not working as expected. what is going on? zeppelin Programming 8 04-19-2007 11:21 AM
Crontab not working as expected nro Linux - Newbie 7 08-29-2005 01:56 PM
LinkSys EZXS55W not working as expected spaaarky21 Linux - Networking 2 09-06-2004 12:44 AM
chmod u+s not working as expected clinton Linux - Newbie 3 03-19-2004 08:49 PM
up2date not working as expected johnny13 Linux - Newbie 7 07-21-2003 02:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:00 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration