On Sat, 09 Aug 2003 03:39:51 +1200, max barwell wrote:
> Could someone please tell me how, or point to appropriate fm, to load
> balance between several people sharing the same internet connection (I
> wish to share with my flatmates), so that each machine gets a slice of
> whatever bandwidth is available, and no one gets to hog the lot?
>
> also could I have two connections, and share those amongst multiple
> clients?
>
> regards max
After going through the tc man page etc, you need a plan. The easiest
would be to create a class that takes up the full upload bandwidth. Then,
attach stochastic fairness queuing to it. SFQ does some magic so one
stream ( the one dl-ing iso's, say) does not drown out your shoutcast
stream.
#!/bin/bash
TC=/sbin/tc
EXT=ppp0
MAXRATE="160kbit"
BW="bandwidth $MAXRATE"
AVPKT="avpkt 1200"
ALLOT="allot 1400"
# Delete any old stuff hanging around - deleting the
# root removes all the sub qdiscs and classes
$TC qdisc del dev $EXT root 2> /dev/null >/dev/null
$TC qdisc add dev $EXT root handle 1:0 cbq $AVPKT $BW
# A root CLASS set to bandwidth we are capable of..
$TC class add dev $EXT parent 1:0 classid 1:1 cbq rate $MAXRATE $ALLOT
prio 5 $AVPKT $BW bounded isolated
###############################################
# Q U E U E D I S C IP L I N E S #
###############################################
#
# perturb : seconds to wait before changing
# hash function
# quantum values : 1492 1 packet
# 2984 2 packets
# 4476 3 packets
# 5968 4 packets
# 7460 5 packets
$TC qdisc add dev $EXT parent 1:1 sfq perturb 10 quantum 1492
You can also specify a ratio based distribution of bandwidth, which the
lartc.org has an example of.
x-- 100 Proof News -
http://www.100ProofNews.com
x-- 3,500+ Binary NewsGroups, and over 90,000 other groups
x-- Access to over 800 Gigs/Day - $8.95/Month
x-- UNLIMITED DOWNLOAD