Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-07-2005, 10:20 PM
|
#1
|
LQ Newbie
Registered: Jul 2005
Posts: 12
Rep:
|
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
|
|
|
09-08-2005, 01:30 AM
|
#2
|
Senior Member
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713
Rep:
|
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.
|
|
|
09-08-2005, 12:36 PM
|
#3
|
LQ Newbie
Registered: Jul 2005
Posts: 12
Original Poster
Rep:
|
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.
|
|
|
09-08-2005, 09:39 PM
|
#4
|
Senior Member
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713
Rep:
|
I'm afraid I have no experience in cbq or htb. But if the commercial one worked then why not use that?
|
|
|
09-12-2005, 04:45 PM
|
#5
|
LQ Newbie
Registered: Jul 2005
Posts: 12
Original Poster
Rep:
|
Does anybody out there knows if having a firewall installed and activated on the bandwidth controller machine is mandatory?
Thanks in advance,
|
|
|
09-25-2005, 02:25 PM
|
#6
|
Member
Registered: Apr 2004
Distribution: Gentoo
Posts: 95
Rep:
|
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.
|
|
|
09-27-2005, 09:43 PM
|
#7
|
LQ Newbie
Registered: Jul 2005
Posts: 12
Original Poster
Rep:
|
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,
|
|
|
09-28-2005, 07:41 AM
|
#8
|
Member
Registered: Apr 2004
Distribution: Gentoo
Posts: 95
Rep:
|
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...
|
|
|
All times are GMT -5. The time now is 09:00 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|