From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Furniss Date: Mon, 26 Apr 2004 08:01:34 +0000 Subject: Re: [LARTC] newbie: TC[NG] with (256kbit/s down and 768kbit/s up) Message-Id: <408CC1DE.10704@dsl.pipex.com> List-Id: References: <46799.82.82.95.252.1082769835.squirrel@mail.surakware.net> In-Reply-To: <46799.82.82.95.252.1082769835.squirrel@mail.surakware.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Christian Parpart wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Sunday 25 April 2004 09:06, Andy Furniss wrote: > >>Jason Boxman wrote: >> >>>Egress is easy. Ingress seems to be a topic that is discussed often on >>>LARTC, and I believe your options are to either use an ingress policer or >>>the IMQ target. The former you can do directly with tcng, the latter I >>>believe you cannot. >> >>I know nothing about TCNG so can't help there. >> >>You can shape ingress without using IMQ as long as you have just one LAN >>interface and don't care about traffic headed for the shaping PC. You >>just shape on the LAN interface. > > > But *how* does such a setup now looks like, either in tcng or in gc syntax? > > This is what I actually do: > - -------------------------------------------------- > #! /bin/sh > > DEV=ppp0 > UP%6 > DOWNv8 > CLIENTS="192.168.2.1 192.168.2.2 192.168.2.3 192.168.2.5 192.168.2.6 192.168.2.7 192.168.2.8" > TC=$(which tc) > > # reset > $TC qdisc del dev ${DEV} root &>/dev/null > $TC qdisc del dev ${DEV} ingress &>/dev/null > > # attach HTB queue discipline to device $DEV > $TC qdisc add dev $DEV root handle 1: htb default 12 > > # create client classes for shaping DOWN-stream > crate=$[DOWN / NumClients] > i=0 > for host in $CLIENTS; do > $TC class add dev $DEV parent 1:1 classid 1:1$i htb rate ${crate}kbit ceil ${DOWN}kbit > $TC filter add dev $DEV protocol ip parent 1:0 prio 1 u32 match ip src $host flowid 1:1$i > i=$[i + 1] > done > > # TODO shaping UP stream > - -------------------------------------------------- > > This is my script. And I do not really now, *where* to differ > here to once shape down-stream, and once to shape the up-stream > > I'd be really really very happy, if someone would point > me in this *wrong* script to the right direction. > You have to set you rates lower than your real rates - for ingress about 80% so you actually get queues growing that you can control. For egress about 85% with dsl as there are extra overheads and TC counts IP size. You should be shaping on eth0 if that's your LAN facing interface - you shape egress from the shaping box to the LAN to do ingress (on simple setups). The src IP match needs to change to dst. As it is the script may have too big queues - but should work as a test, you may also endup wanting to split interactive traffic from bulk to make things nicer for users - but that sort of thing is policy to be thought about/agreed by users. Andy. > Many thanks, > Christian Parpart. > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.4 (GNU/Linux) > > iD8DBQFAi/jRPpa2GmDVhK0RAiyiAJ9t1LngvstQqwqGkTC367USYfcQtQCeNHUV > nc9176QOuUWp1XqeCSrbj8g> =Po1b > -----END PGP SIGNATURE----- > _______________________________________________ > LARTC mailing list / LARTC@mailman.ds9a.nl > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/ > _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/