[Freeswitch-dev] Using TC to prioritise VOIP traffic
Tom Parrott
tomp at tomp.co.uk
Sat Mar 1 19:10:57 MSK 2014
Hi,
I have been experimenting with the tc command to prioritise VOIP
traffic, and I wondered if anyone could check over my script and see if
it does what I think it does :)
Effectively I want to create 3 queues, one for UDP traffic (RTP) with
highest priority, one for SIP traffic (port 5060 TCP) with 2nd highest
priority, and finally a 3rd queue for everything else.
#Put everything in 3rd queue by default?
tc qdisc add dev $DEV root handle 1: prio priomap 2 2 2 2 2 2 2 2 2 2 2
2 2 2 2 2
#Create 3 SFQ queues
tc qdisc add dev $DEV parent 1:1 handle 10: sfq limit 3000
tc qdisc add dev $DEV parent 1:2 handle 20: sfq
tc qdisc add dev $DEV parent 1:3 handle 30: sfq
#Match UDP traffic and put into priority 1 queue
${TC} filter add dev $DEV parent 1: protocol ip prio 1 u32 \
match ip protocol 17 0xff flowid 1:1
#Match SIP traffic and put into priority 2 queue
${TC} filter add dev $DEV parent 1: protocol ip prio 1 u32 \
match ip dport 5060 0xffff flowid 1:2
${TC} filter add dev $DEV parent 1: protocol ip prio 1 u32 \
match ip sport 5060 0xffff flowid 1:2
I have check the status of the queues, and it seems to be correctly
classifying the different packets.
But I am not sure whether it is prioritising them correctly or not.
Thanks
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4237 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20140301/b0436625/attachment.bin
Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-dev
mailing list