LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-10-2009, 09:46 AM   #1
sebelk
Member
 
Registered: Jan 2007
Posts: 66

Rep: Reputation: 15
QoS and VoIP


Hi,

I work on a organization that have a little office near to main building. That office has only 3 PC's and 3 telephone. Phones are "connected" to an asterisk server.

The problem is that ISP service is not simmetric. ISP provides 1 bit for download and hopefully 256k for upload. PC's are connected to a hub that is connected to a Linksys WRT54GL router with OpenWRT which in turn is connected to ISP modem.

I'd wonder if I can tweak in some way qos on OpenWRT in order to avoid "jerky" voice when someone make a phone call.

The following is my script, please could you help me to improve it?

Thanks in advance


Code:
UPVOIPSVR=X.X.X.X                                      
MYORGNET=X.X.X.Y/24                                           
IFWAN=eth0.1                                                    
PHYSICALBW_MBPS=10 # mbps                                       
let PHYSICALBW=$PHYSICALBW_MBPS*1000000 # bps                   
CONTRACTBW_MBPS=1  # mbps 
let CONTRACTBW=$CONTRACTBW_MBPS*1000000  # bps                               
CODEC=g711                                                                   
CALLBW_KBPS=87 # kbps                                                        
let CALLBW=$CALLBW_KBPS*1000 # bps                                           
FRAMEINTERVAL_MS=20 # in miliseconds                                         
CALLS=3                                                                      
let VOIPBW=$CALLS*$CALLBW                                                    
let VOIPBW_KPBS=$VOIPBW/1000                                                 
let NONVOIPBW=$CONTRACTBW-$VOIPBW                                            
let NONVOIPBW_KPBS=$NONVOIPBW/1000                                           
let NONVOIPBWUP=$NONVOIPBW/4
let NONVOIPBWUP_KBPS=$NONVOIPBWUP/1000
UPVOIPSVR=200.69.213.172                                        
UPNET=200.69.213.0/24                                           
IFWAN=eth0.1                                                    
PHYSICALBW_MBPS=10 # mbps                                       
let PHYSICALBW=$PHYSICALBW_MBPS*1000000 # bps                   
CONTRACTBW_MBPS=1  # mbps 
let CONTRACTBW=$CONTRACTBW_MBPS*1000000  # bps                               
CODEC=g711                                                                   
CALLBW_KBPS=87 # kbps                                                        
let CALLBW=$CALLBW_KBPS*1000 # bps                                           
FRAMEINTERVAL_MS=20 # in miliseconds                                         
CALLS=3                                                                      
let VOIPBW=$CALLS*$CALLBW                                                    
let VOIPBW_KPBS=$VOIPBW/1000                                                 
let NONVOIPBW=$CONTRACTBW-$VOIPBW                                            
let NONVOIPBW_KPBS=$NONVOIPBW/1000                                           
let NONVOIPBWUP=$NONVOIPBW/4
let NONVOIPBWUP_KBPS=$NONVOIPBWUP/1000

let INTERVALCAPACITY=$CONTRACTBW*$FRAMEINTERVAL_MS/1000/8 # bytes
let INTERVALVOIPUSAGE=$CALLS*$CALLBW*$FRAMEINTERVAL_MS/1000/8 #bytes
let NONVOIPBURST=$INTERVALCAPACITY-$INTERVALVOIPUSAGE

tc qdisc add dev $IFWAN ingress handle ffff:
tc filter add dev $IFWAN parent ffff: protocol ip prio 1 u32 \
    match ip src $UPVOIPSVR \
    flowid ffff:1
tc filter add dev $IFWAN parent ffff: protocol ip prio 2 u32 \
    match ip src 0.0.0.0/0 \
    police rate $NONVOIPBW burst 100kb drop \
    flowid ffff:2
tc qdisc add dev $IFWAN root handle 1:0 prio
tc filter add dev $IFWAN parent 1:0 protocol ip prio 1 u32 \
    match ip dst $UPVOIPSVR \
    police rate $VOIPBW burst 100kb continue \
    flowid 1:1
tc filter add dev $IFWAN parent 1:0 protocol ip prio 2 u32 \
    match ip dst 0.0.0.0/0 \
    flowid 1:2
tc qdisc add dev $IFWAN parent 1:2 handle 12: tbf \
        rate $NONVOIPBWUP burst $NONVOIPBURST limit 100kb

let INTERVALCAPACITY=$CONTRACTBW*$FRAMEINTERVAL_MS/1000/8 # bytes
let INTERVALVOIPUSAGE=$CALLS*$CALLBW*$FRAMEINTERVAL_MS/1000/8 #bytes
let NONVOIPBURST=$INTERVALCAPACITY-$INTERVALVOIPUSAGE

tc qdisc add dev $IFWAN ingress handle ffff:
tc filter add dev $IFWAN parent ffff: protocol ip prio 1 u32 \
    match ip src $UPVOIPSVR \
    flowid ffff:1
tc filter add dev $IFWAN parent ffff: protocol ip prio 2 u32 \
    match ip src 0.0.0.0/0 \
    police rate $NONVOIPBW burst 100kb drop \
    flowid ffff:2
tc qdisc add dev $IFWAN root handle 1:0 prio
tc filter add dev $IFWAN parent 1:0 protocol ip prio 1 u32 \
    match ip dst $UPVOIPSVR \
    police rate $VOIPBW burst 100kb continue \
    flowid 1:1
tc filter add dev $IFWAN parent 1:0 protocol ip prio 2 u32 \
    match ip dst 0.0.0.0/0 \
    flowid 1:2
tc qdisc add dev $IFWAN parent 1:2 handle 12: tbf \
        rate $NONVOIPBWUP burst $NONVOIPBURST limit 100kb
 
Old 12-10-2009, 09:54 AM   #2
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Before doing any changes, make some experiment - change HUB to (not cheap) SWITCH, then disconnect any computers from switch, and try to call from ALL phones at the same time.

Why I suggest it to you, because these problems could be outside of your network.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
{VoIP} Anyone experienced/using "Brama Telecom" VoIP service? Does it suck? GrapefruiTgirl General 4 08-27-2009 03:16 PM
Asterisk Predictive Dialer need VOIP adapters to Make a VOIP call... jpmaxyusuf Linux - Server 4 04-05-2009 08:12 AM
LXer: QoS And Traffic Shaping For VoIP Users Using iproute2 And Asterisk LXer Syndicated Linux News 0 05-21-2007 08:31 PM
QOS for VOIP on Linux MarleyGPN Linux - Networking 1 01-29-2006 11:37 PM
Qos + RH9 for voip stephadou Linux - Networking 0 12-01-2004 10:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration