Limiting outgoing bandwidth per machine, using Linux (2.2.19) on ADSL

Limiting outgoing bandwidth per machine, using Linux (2.2.19) on ADSL

Post by paul lesi » Tue, 17 Jul 2001 04:18:19



Hello,

Ok, to start, some facts:

- I have a local network within my home, with IP addresses in the
192.168.0.0/24 subnet, assigned via DHCP
- I'm using a linux 2.2.19 machine as a router/server, that does IP
masquerading to allow all the machines within my network to share the
one internet connection I have. The local network interface is eth0,
while the internet connection is ppp0 (or eth1).
 - I have an ADSL connection with 640 kilobits/sec downstream (80
kilobytes/sec), 90 kilobits/sec upstream (11.25 kilobytes/sec).
My service provider (Verizon Online) is rather facist with their
bandwidth allocation -- when anymore than 50% of my upstream bandwidth
is utilized, it cuts into my downstream. So say I'm downloading
something at 70 kilobytes/sec, and another computer on my network is
sending some data upstream, at 8 kilobytes/sec, my download speed will
drop to about 10kilobytes/sec, and it will stay that way until the
upstream bandwidth is no longer used.
 - I have iproute2 installed with support built into the kernel

I want to setup some kind of traffic shaping policy so each computer
in the network can only send a certain kilobytes/sec upstream, via the
adsl interface (ppp0).

I have read the linux advanced routing howto, and that only left me
really confused. I fiddled around with the tc command but
unfortunately I wasn't able to make any progress.

I would really appreciate any help anyone could give me.

Thanks in advance,

Paul Lesiak

 
 
 

Limiting outgoing bandwidth per machine, using Linux (2.2.19) on ADSL

Post by Steve Parde » Tue, 17 Jul 2001 02:36:26


Paul,

Here is one idea.  I am not sure which of the newer kernels fiirst
supported traffic shaping.  But if you make one of the new 2.4.x kernels
you should be able to do what you want.  Here is how you make a new
kernel: Untar whichever version of the kernel you want from
www.kernel.org into /usr/src/linux and do "make xconfig" in the
/usr/src/linux directory. Then go into network device support and select
traffic shaping.  You'll probably want to go through all the menus to
make the best kernel possible while you do this.  Then after you save,
then do "make dep && make clean && make bzImage && make modules && make
modules_install and let it compile.  After you do this, then, you'll need
to copy /usr/src/linux/arch/i386/boot/bzImage to /boot.  Then you'll need
to edit /etc/lilo.conf and add the additional info for your new kernel.
Here is an example of one of the systems I built where I called the new
kernel "optimized."
boot = /dev/hda
timeout = 50
linear
prompt
  message = /boot/message
  default = optimized
  vga = normal
  read-only
map=/boot/map
install=/boot/boot.b
image = /boot/vmlinuz-2.2.16-22
  label = linux
  root = /dev/hda5
image = /boot/bzImage
  label = optimized
  append = "idebus=66"
  root = /dev/hda5

Then run the lilo command from the command prompt.  Reboot your system
and see if your new kernel works.  If it does, you should have your
traffic shaping.  Let me know if you try this and get stuck anywhere.

Cheers,
Steve Pardee


> Hello,

> Ok, to start, some facts:

> - I have a local network within my home, with IP addresses in the
> 192.168.0.0/24 subnet, assigned via DHCP
> - I'm using a linux 2.2.19 machine as a router/server, that does IP
> masquerading to allow all the machines within my network to share the
> one internet connection I have. The local network interface is eth0,
> while the internet connection is ppp0 (or eth1).
>  - I have an ADSL connection with 640 kilobits/sec downstream (80
> kilobytes/sec), 90 kilobits/sec upstream (11.25 kilobytes/sec).
> My service provider (Verizon Online) is rather facist with their
> bandwidth allocation -- when anymore than 50% of my upstream bandwidth
> is utilized, it cuts into my downstream. So say I'm downloading
> something at 70 kilobytes/sec, and another computer on my network is
> sending some data upstream, at 8 kilobytes/sec, my download speed will
> drop to about 10kilobytes/sec, and it will stay that way until the
> upstream bandwidth is no longer used.
>  - I have iproute2 installed with support built into the kernel

> I want to setup some kind of traffic shaping policy so each computer
> in the network can only send a certain kilobytes/sec upstream, via the
> adsl interface (ppp0).

> I have read the linux advanced routing howto, and that only left me
> really confused. I fiddled around with the tc command but
> unfortunately I wasn't able to make any progress.

> I would really appreciate any help anyone could give me.

> Thanks in advance,

> Paul Lesiak


--

"There are two major products to come out of Berkeley: LSD and UNIX
We don't believe this to be a coincidence."

--Anonymous

 
 
 

Limiting outgoing bandwidth per machine, using Linux (2.2.19) on ADSL

Post by Michael Heimin » Tue, 17 Jul 2001 07:48:35



> Paul,

> Here is one idea.  I am not sure which of the newer kernels fiirst
> supported traffic shaping.  But if you make one of the new 2.4.x kernels
> you should be able to do what you want.  Here is how you make a new
> kernel: Untar whichever version of the kernel you want from
> www.kernel.org into /usr/src/linux and do "make xconfig" in the
> /usr/src/linux directory. Then go into network device support and select
> traffic shaping.  You'll probably want to go through all the menus to
> make the best kernel possible while you do this.  Then after you save,
> then do "make dep && make clean && make bzImage && make modules && make
> modules_install and let it compile.  After you do this, then, you'll need
> to copy /usr/src/linux/arch/i386/boot/bzImage to /boot.  Then you'll need
> to edit /etc/lilo.conf and add the additional info for your new kernel.
> Here is an example of one of the systems I built where I called the new
> kernel "optimized."
> boot = /dev/hda
> timeout = 50
> linear
> prompt
>   message = /boot/message
>   default = optimized
>   vga = normal
>   read-only
> map=/boot/map
> install=/boot/boot.b
> image = /boot/vmlinuz-2.2.16-22
>   label = linux
>   root = /dev/hda5
> image = /boot/bzImage
>   label = optimized
>   append = "idebus=66"
>   root = /dev/hda5

> Then run the lilo command from the command prompt.  Reboot your system
> and see if your new kernel works.  If it does, you should have your
> traffic shaping.  Let me know if you try this and get stuck anywhere.

> Cheers,
> Steve Pardee


> > Hello,

> > Ok, to start, some facts:

> > - I have a local network within my home, with IP addresses in the
> > 192.168.0.0/24 subnet, assigned via DHCP
> > - I'm using a linux 2.2.19 machine as a router/server, that does IP
> > masquerading to allow all the machines within my network to share the
> > one internet connection I have. The local network interface is eth0,
> > while the internet connection is ppp0 (or eth1).
> >  - I have an ADSL connection with 640 kilobits/sec downstream (80
> > kilobytes/sec), 90 kilobits/sec upstream (11.25 kilobytes/sec).
> > My service provider (Verizon Online) is rather facist with their
> > bandwidth allocation -- when anymore than 50% of my upstream bandwidth
> > is utilized, it cuts into my downstream. So say I'm downloading
> > something at 70 kilobytes/sec, and another computer on my network is
> > sending some data upstream, at 8 kilobytes/sec, my download speed will
> > drop to about 10kilobytes/sec, and it will stay that way until the
> > upstream bandwidth is no longer used.
> >  - I have iproute2 installed with support built into the kernel

> > I want to setup some kind of traffic shaping policy so each computer
> > in the network can only send a certain kilobytes/sec upstream, via the
> > adsl interface (ppp0).

> > I have read the linux advanced routing howto, and that only left me
> > really confused. I fiddled around with the tc command but
> > unfortunately I wasn't able to make any progress.

> > I would really appreciate any help anyone could give me.

> > Thanks in advance,

> > Paul Lesiak

> --

> "There are two major products to come out of Berkeley: LSD and UNIX
> We don't believe this to be a coincidence."

> --Anonymous

If the OP really wants to update his kernel, he should first read
Documentation/Changes (comes with the kernel source) and update his
system accordingly..

Please don't top post.

Michael Heiming

 
 
 

Limiting outgoing bandwidth per machine, using Linux (2.2.19) on ADSL

Post by Geof » Tue, 17 Jul 2001 12:57:39


Paul , try the LARTC mailing list which is a forum for solving
problems with traffic shaping. A search on Altavista or google will
point you there.

BTW i cant get my traffic shaping working at all, very frustrating.

 
 
 

Limiting outgoing bandwidth per machine, using Linux (2.2.19) on ADSL

Post by Tomi Holger Engdah » Tue, 17 Jul 2001 16:24:51



> I want to setup some kind of traffic shaping policy so each computer
> in the network can only send a certain kilobytes/sec upstream, via the
> adsl interface (ppp0).

Checkif the following easy to use tool is of any help to your problem:
http://lwn.net/1998/1119/shaper.html

--
Tomi Engdahl (http://www.iki.fi/then/)
Take a look at my electronics web links and documents at
http://www.epanorama.net/