Skip to contentSkip to conversation

QoS for Voip.

LARTC Alessandro Ren 4 participants 7 messages Jul 16, 2004 – Jul 19, 2004

lore
Share & tools
lore
#0 lore raw

I've been using a altered version of the wshaper script to
priorize voip traffic for my customers.
I'd like to know if someone in the list has any tips on QoS for
voip, if someone has done some experimentation.
I am using HTB and if someone on the LAN uses a p2p program, I
started to noticed in the voip, with cuts, jitter and lag. If a reserve a fixed amount of bandwitdh not letting anyonbe borrow, it works fine, but then if noone is using voip, I have bandwidth going to waste.
I think I need some fine tunning oin the HTB parameters, but I am
not sure sure about that.
Any indeas?

#1 lore raw

Am Friday 16 July 2004 17:19 schrieb Alessandro Ren:

Quoted 2 lines

I am using HTB and if someone on the LAN uses a p2p program, I
started to noticed in the voip, with cuts, jitter and lag.

Have you tried filtering P2P traffic (using IPP2P or l7-filter)? With HTB, I'd suggest to put it into a class with low prio and low rate, so P2P has to borrow nearly everything. But on the other hand you should make sure Voip can't max out the line either. It's not easy to find a balance there.

At home, I have a different approach. There's just fair sharing between custumers (err, flatmates). Each person gets his HTB class, all HTB classes have the same priorities and rates, so everyone gets the same amount of bandwidth no matter what it's used for (p2p, www, voip, gaming). Prioritizing interactive over http over p2p traffic is then also done on a per-user basis. This way it doesn't matter to a single user what kind of traffic other users generates... the only guarantee there is that each user can get the same amount of bandwidth.

If this setup causes cuts, jitter and lag in voip, it's either because the same user is generating other traffic with same or higher priority than voip; or because there just isn't enough bandwidth available altogether to serve all the people.

However, that kind of setup requires a lot of classes in HTB (one per [active] client); so if there are too many clients, the rates per class get too low, which might impact HTB performance.

Andreas
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#2 lore raw
In reply to Alessandro Ren

On Friday 16 July 2004 11:53, Andreas Klauer wrote:
<snip>

Quoted 8 lines

At home, I have a different approach. There's just fair sharing between custumers (err, flatmates). Each person gets his HTB class, all HTB classes have the same priorities and rates, so everyone gets the same amount of bandwidth no matter what it's used for (p2p, www, voip, gaming). Prioritizing interactive over http over p2p traffic is then also done on a per-user basis. This way it doesn't matter to a single user what kind of traffic other users generates... the only guarantee there is that each user can get the same amount of bandwidth.

But how well does that scale?

# Default: Put stuff in class 2.

    $BIN_TC filter add dev $UC_DEV parent 1:$UC_MARK prio 100 \
                   protocol ip handle $UC_MARK fw flowid 1:$(($UC_MARK+2))

Would you want to do per user classifications to give SSH for each user a higher priority if you had, say, 230 users, for example? Or would each user merely need to find for himself with his slice?

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#3 lore raw
In reply to Alessandro Ren

Hi,

the hint from Martin A Brown which I am experimenting without regret yet is that you shoul decrease the queue lenght to say 30 from the default 100 and also reduce the MTU(MAX. TRANSFER UNIT) to the size of typical voice traffic say 256 using

ip link set dev eth0 qlen 30
ip link set dev eth0 mtu 1000

Hope it helps.

Ibrahim T.

--- Alessandro Ren <[email protected]>

Quoted 11 lines · wrote:

I've been using a altered version of the
wshaper script to
priorize voip traffic for my customers.
I'd like to know if someone in the list has any
tips on QoS for
voip, if someone has done some experimentation.
I am using HTB and if someone on the LAN uses a
p2p program, I
started to noticed in the voip, with cuts, jitter and lag. If a reserve

Quoted 11 lines

a fixed amount of bandwitdh not letting anyonbe
borrow, it works fine,
but then if noone is using voip, I have bandwidth
going to waste.
I think I need some fine tunning oin the HTB
parameters, but I am
not sure sure about that.
Any indeas?

__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#4 lore raw
In reply to Alessandro Ren

Am Friday 16 July 2004 18:54 schrieb Jason Boxman:

Quoted 5 lines

But how well does that scale?

Would you want to do per user classifications to give SSH for each user a higher priority if you had, say, 230 users, for example? Or would each user merely need to find for himself with his slice?

I wrote something about having to many users in my mail too. :-) And I made clear that this setup is what I do at home and I do not have (thank god) 230 flatmates. So hopefully there were no misunderstandings. :-)

The interesting question is... are the 230 users all active at the same time. You only need classes for active users. And for that many active users, you need a lot of bandwidth if each of them wants to be doing VoIP and P2P so I don't see *that* many problems there. Of course, I don't have any practical experience there.

From the point of view of a big ISP, I'd probably make my own life easier by just providing constant (ceiled) rates, no borrowing. Global prioritization (where theoretically each user can use the whole available bandwidth) has the risk that if a user finds out a special type of traffic is being prioritized, he abuses this. For example, he could use a prioritized protocol to tunnel other stuff through it... think of P2P over VoIP. If VoIP is allowed to use all the bandwith, such a user could steal way too many bandwidth from others. The only way to prevent this sort of thing would then be to make no global prioritizations, but give each user his own sandbox (which is more or less the idea behind my home setup).

Depending on the bandwidth your clients get, you don't have to do things like prioritizing SSH and VoIP for them... my ISP doesn't do that for me either, at least not on such a close level. And I doubt I would like my ISP to decide for me which traffic to prioritize for me. I just do this kind of stuff on my own home machine.

I hope it makes sense in a way :-0 It was a rather hasty rant, sorry

Andreas
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#5 lore raw
In reply to Alessandro Ren

Thanks for the tips Brian,

Actually, I have many sorts of links, line PPOE ADSL, PPPOA ADSL
which a use PPTP over PPOA relay, radio links that connect in the ethernet interface and cable modems.
To change the SFQ queue size I must recompile de kernel? I think a
saw some messages talking about that.
One other thing, I have the 1:10 a 1:20 class, let's assume there
is no voip traffic and all bandwidth is being consumed and it is in the other class. When the voip traffic starts, there is a inicial delay untill the 1:20 class starts to free bandwidth to the 1:10 class, as I've noticed. Should I change the burst and cburst parameters to get a better response or just make de queues smaller?
Thanks.

Brian Carrig wrote:

Quoted 6 lines · Alessandro Ren

Hello Brian,

This is the basis for the wshaper.
I have only two classes and I put voip on the 1:10 class and the rest in the 1:20. I

am not

Quoted 3 lines

listing here, but I have the rule marking packets and sorting then into classes,

actually, I just put

Quoted 3 lines

one port into the 1:10 class, that's the voip port and nothing else. I really want to

keep the best

Quoted 3 lines

quality I can for voip, without bandwidth waste., because, if a page takes 1

seconds longer do

Quoted 4 lines

load is ok, but if a voip packet starts to get delay, we got a problem, I think, I must have no queue for voip packets, all packtes should be forwarded as

soon as

Quoted 3 lines

they get to the box, right?

You do actually have a queue for VoIP, as you implement SFQ for both the 1:10 and 1:20 classes. To the best of my knowledge the default setting for this queue is 128 packets. This may be too large for VoIP if latency is a concern so I would suggest making this queue much smaller (limit option). Unfortunately without knowing the particulars of your link I am unable to suggest a figure but have play around and see what suits.

Regards
Brian

Quoted 19 lines

#
tc qdisc add dev $DEV root handle 1: htb default 20

# shape everything at $UPLINK speed - this prevents huge queues in your
# DSL modem which destroy latency:

tc class add dev $DEV parent 1: classid 1:1 htb rate ${UPLINK}kbit burst 6k

# high prio class 1:10:

tc class add dev $DEV parent 1:1 classid 1:10 htb rate $[4*$UPLINK/10]kbit \
burst 6k prio 1

# bulk & default class 1:20 - gets slightly less traffic,
# and a lower priority:

tc class add dev $DEV parent 1:1 classid 1:20 htb rate $[6*$UPLINK/10]kbit \
ceil $[10*$UPLINK/10]kbit burst 6k prio 2

Quoted 10 lines
# all get Stochastic Fairness:
tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10

Brian Carrig wrote:
We run something similar allowing customers to place traffic into gold, silver or bronze classes. I reserve a fixed amount of bandwidth for each class and allow

them

Quoted 3 lines

to borrow (I hate the idea of bandwidth going to waste). However, excess

bandwidth

Quoted 4 lines

is offered preferrentially to gold, then silver before being offered to bronze. Because p2p and other bw consuming traffic are unlikely to be in the gold and

silver

Quoted 4 lines

classes (they cost more) there haven't been any problems.
I haven't really looked at the wondershaper script in much detail, how is voip

traffic

Quoted 35 lines

prioritised?

Regards
Brian

On 16 Jul 2004 at 12:19, Alessandro Ren wrote:

I've been using a altered version of the wshaper script to priorize voip traffic for

my

customers.
I'd like to know if someone in the list has any tips on QoS for voip, if someone

has done some

experimentation.
I am using HTB and if someone on the LAN uses a p2p program, I started to

noticed in the

voip, with cuts, jitter and lag. If a reserve a fixed amount of bandwitdh not letting

anyonbe

borrow, it works fine, but then if noone is using voip, I have bandwidth going to

waste.

I think I need some fine tunning oin the HTB parameters, but I am not sure sure

about that.

#6 lore raw
In reply to Alessandro Ren

Am Monday 19 July 2004 14:45 schrieb Alessandro Ren:

Quoted 1 line

To change the SFQ queue size I must recompile de kernel?

Yes. It's not dynamic. But you could use ESFQ instead, I think it allows specifying the queue length with the tc command.

Quoted 4 lines

When the voip traffic starts, there is a inicial delay untill the 1:20 class starts to free bandwidth to the 1:10 class, as I've noticed. Should I change the burst and cburst parameters to get a better response or just make de queues smaller?

This is just guesswork, I haven't checked the code:

As far as I understand the way QoS is implemented in the kernel, a packet may only get out of the queue if the qdisc (in your case HTB) allows it to. If that's correct, the queue size should not matter, your problem is that HTB allows the 1:20 class to dequeue whilst 1:10 does not get a chance to do stuff. If you get a delay, then HTB is just too slow adjusting for the changed conditions.

I haven't noticed such a problem myself though, since there is usually always traffic in my classes...

Andreas
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/