From: Gustavo Homem Date: Sun, 30 Jul 2006 22:52:48 +0000 Subject: Re: [LARTC] questions about HFSC, VoIP and (dynamic) ingress shaping Message-Id: <20060730225248.GD15275@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: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 questions = > about how things are done the best way nowadays ;-) >=20 >=20 > To ensure a stable and low latency voip communication I added an HFSC qdi= sc to=20 > device ppp0 (1 Mbit SDSL). There are two classes (by now): One for SIP an= d=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 exact= ly=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 inco= ming=20 > packets and keep the isp's queue empty. >=20 > Question 2: What is the best solution for doing this: ingress qdisc, IMQ,= ...=20 > (thers's only one link to isp)? >=20 If you don't want to patch the kernel and your machine has only two network= interfaces you can shape the outgoing traffic to the internal interface in= stead of the incoming traffic to the internal interface. I have an example = script here: http://downloads.angulosolido.pt/QoS/HTB_shaper_adv.sh It uses HTB for shapping though. >=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 ca= re=20 > about dropping and reduce transmit speed? >=20 >=20 I don't think so, unless that is implemented at the application level. The = UDP packets shouldn't be dropped unless that's acceptable to a certain exte= nd (VoIP) or the application resends as necessary. >=20 >=20 > If I begin to control incoming traffic I only want to drop packets that a= re=20 > non voip traffic. >=20 > Question 4: Is it possible to control what packets are dropped? >=20 Depends if you know the ports they use. If you know it, you just have to ma= rk them accordingly. For example with skype it's a pain in the ass, as it seems not to respect t= he port chosen on the configuration. I solved that by reserving bandwidth p= er workstation, so that each one get's TOTAL/N, extensible to TOTAL of the = others don't request it. For each workstation there is also a priority rank= , but for cases like skype, whose ports we can't control, it ends up being = up to each user to ensure there's enough bandwidth on her share for skype t= o work. Take a look at the link I pasted above. >=20 >=20 > I always want to have enough bandwith for incoming voip traffic. But limi= ting=20 > the other stuff to static 180 kbit only because voip packets could someti= mes=20 > reach a maximum of 800 kbit sounds not so good. >=20 Sure! > My idea: A script that periodically (or even better: triggered by asteris= k)=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 already = a=20 > solution? >=20 I don't think you need this. A setup with HTB solves this problem, since ea= ch traffic class has a defined RATE as well as a defined CEIL rate, which i= t will take whenever available. I can't comment about HFSC as I never used it.=20 Best regards Gustavo >=20 >=20 > Regards > Daniel > _______________________________________________ > 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