From: Gustavo Homem Date: Sun, 30 Jul 2006 23:01:23 +0000 Subject: Re: [LARTC] questions about HFSC, VoIP and (dynamic) ingress shaping Message-Id: <20060730230123.GF15275@angulosolido.pt> List-Id: References: <200607302309.05290.Daniel@musketa.de> In-Reply-To: <200607302309.05290.Daniel@musketa.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org On Sun, Jul 30, 2006 at 11:52:48PM +0100, Gustavo Homem wrote: > On Sun, Jul 30, 2006 at 11:09:04PM +0200, Daniel Musketa wrote: > > Hello, > >=20 > > I just found the great howto and started shaping my internet connection= . The=20 > > howto's last update is a liitle in the past now so I have some question= s=20 > > about how things are done the best way nowadays ;-) > >=20 > >=20 > > To ensure a stable and low latency voip communication I added an HFSC q= disc to=20 > > device ppp0 (1 Mbit SDSL). There are two classes (by now): One for SIP = and=20 > > RTP and one for the rest. > >=20 > > Question 1: I defined the voip qdisc as > >=20 > > tc class add dev ppp0 parent 1:1 classid 1:11 \ > > hfsc sc umax 1500b dmax 30ms rate 500kbit ul rate 900kbit > >=20 > > but "tc -s class show dev ppp0" shows > >=20 > > class hfsc 1:11 parent 1:1 sc m1 0bit d 6.0ms m2 500000bit \ > > ul m1 0bit d 0us m2 900000bit > >=20 > > Where does the "0bit d 6.0ms" come from, (what does the other stuff exa= ctly=20 > > mean) and what would be a good setting for voip traffic? > >=20 > >=20 > >=20 > >=20 > > This qdisc only affects outgoing traffic. But I also want to control in= coming=20 > > packets and keep the isp's queue empty. > >=20 > > Question 2: What is the best solution for doing this: ingress qdisc, IM= Q, ...=20 > > (thers's only one link to isp)? > >=20 >=20 > If you don't want to patch the kernel and your machine has only two netwo= rk interfaces you can shape the outgoing traffic to the internal interface = instead of the incoming traffic to the internal interface. I have an exampl= e script here: "you can shape the outgoing traffic to the internal interface instead of th= e incoming traffic to the *external* interface" >=20 > http://downloads.angulosolido.pt/QoS/HTB_shaper_adv.sh >=20 > It uses HTB for shapping though. >=20 >=20 >=20 > >=20 > >=20 > > Much traffic on this line is UDP traffic (OpenVPN).=20 > >=20 > > Question 3: If I do policing on incoming traffic, do UDP transmissions = care=20 > > about dropping and reduce transmit speed? > >=20 > >=20 >=20 > I don't think so, unless that is implemented at the application level. Th= e UDP packets shouldn't be dropped unless that's acceptable to a certain ex= tend (VoIP) or the application resends as necessary. >=20 >=20 > >=20 > >=20 > > If I begin to control incoming traffic I only want to drop packets that= are=20 > > non voip traffic. > >=20 > > Question 4: Is it possible to control what packets are dropped? > >=20 >=20 > Depends if you know the ports they use. If you know it, you just have to = mark them accordingly. >=20 > For example with skype it's a pain in the ass, as it seems not to respect= the port chosen on the configuration. I solved that by reserving bandwidth= per workstation, so that each one get's TOTAL/N, extensible to TOTAL of th= e others don't request it. For each workstation there is also a priority ra= nk, but for cases like skype, whose ports we can't control, it ends up bein= g up to each user to ensure there's enough bandwidth on her share for skype= to work. >=20 > Take a look at the link I pasted above. >=20 > >=20 > >=20 > > I always want to have enough bandwith for incoming voip traffic. But li= miting=20 > > the other stuff to static 180 kbit only because voip packets could some= times=20 > > reach a maximum of 800 kbit sounds not so good. > >=20 >=20 > Sure! >=20 > > My idea: A script that periodically (or even better: triggered by aster= isk)=20 > > controls the parameters for the ingress shaper (depending on the actual= =20 > > upload traffic produced by voip which could easily be measured with tc). > >=20 > > Question 5: Is that possible? Is this necessary at all? Is there alread= y a=20 > > solution? > >=20 >=20 > I don't think you need this. A setup with HTB solves this problem, since = each traffic class has a defined RATE as well as a defined CEIL rate, which= it will take whenever available. >=20 > I can't comment about HFSC as I never used it.=20 >=20 > Best regards > Gustavo >=20 > >=20 > >=20 > > Regards > > Daniel > > _______________________________________________ > > LARTC mailing list > > LARTC@mailman.ds9a.nl > > http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc >=20 > --=20 > Angulo S=F3lido - Tecnologias de Informa=E7=E3o > http://angulosolido.pt >=20 > _______________________________________________ > LARTC mailing list > LARTC@mailman.ds9a.nl > http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc --=20 Angulo S=F3lido - Tecnologias de Informa=E7=E3o http://angulosolido.pt _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc