From: Andy Furniss Date: Tue, 28 Aug 2007 20:21:04 +0000 Subject: Re: [LARTC] Help about a QoS configuration Message-Id: <46D483B0.2040008@andyfurniss.entadsl.com> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Javier Ors wrote: > Hi, I would like to make a QoS configuration on a linux based dsl router. It > is for a server, so I want to shape outgoing traffic, incoming traffic > should not be a problem as long as I have a quite assymetric connection. I > would like to achieve the following goals: > > 1) To have one class (p2p) having all the available bandwith if there is no > activity on other classes. > 2) If another class (ftp server), starts to transmit, to take it all the > available bandwith except for, say 20 KB/s, reserved for p2p. > 3) If a third class (ssh, web), starts to transmit, again, to take all the > available bandwith except for the 20KB/s for p2p and 40 KB/s for ftp. > etc... > > I have an upload link that varies from 700kbit to 1000kbit depending on the > negotiation of the line. I wouldn't like to artificially underlimit it to > work properly, remember that I'm doing the shaping on the same router, on > the real (nas0) interface, so in this case the speed of the interface is the > speed of the link, and I think that it's shouldn't be necessary to slow down > the upload speed... am I wrong? Probably, both my PCI modems still had big buffers beyond the ppp that I shaped on. Even if nas0 did only accept traffic when it had finished transmitting I don't think you could do what you want above. > > The case is that I have tried to achieve this goals with several > configurations of htb, but none of them has worked as I expected. I set the > rate of the p2p class to 20KB/s and a higer one for ftp (40KB/s for > example), and also a higher priority. But when the ftp class begin to > transmit, the p2p class still remains borrowing from the paren over 20KB/s > while the ftp class is below its rate. I set the rate of the parent to > 1000kbit. Is this behaviour normal? Is there any other way to achive the > above goals? The problem is that DSL sync rates are ATM rates so there are quite alot of overheads. A small eg. ack packet may be seen as 40 bytes by HTB on nas0, but will use 106 bytes (2 cells) on the wire. If you connection is highly asymmetric acks can eat a fair chunk of upload bandwidth. It affects bigger packets aswell 1500 = 32 cells = 1696 bytes ATM level. There is a solution, but you'll need to patch your kernel and iproute2(tc), and find out what your overheads are - it depends how you connect to your ISP, see - http://ace-host.stuart.id.au/russell/files/tc/tc-atm/ To handle your varying sync rate you would need to make a script to check periodically and restart your script with the new rate. If you patch you can run almost at sync rate - back off a few kbit to allow for modem rounding down to whole cells/sec for it's own aal0/5 QOS and if ppp lcp pings can eat a a few bits/sec if used. Also to cover yourself for restarting the script when active so any backlog can slowly drain. Andy. > > Thanks in advance for your help and your attention. _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc