Re: Prioritizing VOIP traffic without sacrificing throughput

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm not sure what the standard way to post configs is, but here is an
attempt.

I know that I have to limit my bandwidth in order to to traffic shaping.
 The problem is that in order to get good VOIP calls, I have to throttle
the bandwidth by a lot.   When shaping is turned on, my download speed
drops by more than half.   That's fine when I'm actually making a phone
call, but it is also much slower even when I'm not on the phone.  So I
was wondering if there was some way to turn on shaping only when I'm on
the phone, and otherwise don't do anything.

Thanks,

Stefanie



root@openwrtrouter:~$ tc -d -s qdisc
qdisc pfifo_fast 0: dev eth0 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1
1 1 1
 Sent 80516522 bytes 296966 pkts (dropped 0, overlimits 0)
qdisc pfifo_fast 0: dev eth1 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1
1 1 1
 Sent 134572731 bytes 169287 pkts (dropped 0, overlimits 0)
qdisc sfq 8004: dev vlan1 limit 128p quantum 1600b flows 128/1024
perturb 10sec
 Sent 303188 bytes 3819 pkts (dropped 0, overlimits 0)
qdisc sfq 8003: dev vlan1 limit 128p quantum 1600b flows 128/1024
perturb 10sec
 Sent 11613498 bytes 25012 pkts (dropped 0, overlimits 0)
qdisc sfq 8002: dev vlan1 limit 128p quantum 1600b flows 128/1024
perturb 10sec
 Sent 5074 bytes 21 pkts (dropped 0, overlimits 0)
qdisc sfq 8001: dev vlan1 limit 128p quantum 1600b flows 128/1024
perturb 10sec
 Sent 16443879 bytes 143434 pkts (dropped 0, overlimits 0)
qdisc htb 1: dev vlan1 r2q 1 default 40 direct_packets_stat 0 ver 3.17
 Sent 28365639 bytes 172286 pkts (dropped 0, overlimits 11574)
qdisc red 8008: dev imq0 limit 64000b min 8000b max 32000b ewma 4 Plog
21 Scell_log 11
 Sent 6280529 bytes 14541 pkts (dropped 12, overlimits 12)
  marked 0 early 12 pdrop 0 other 0
qdisc red 8007: dev imq0 limit 64000b min 8000b max 32000b ewma 4 Plog
21 Scell_log 11
 Sent 149830593 bytes 145595 pkts (dropped 1893, overlimits 1893)
 backlog 4476b 3p
  marked 0 early 1893 pdrop 0 other 0
qdisc red 8006: dev imq0 limit 64000b min 8000b max 32000b ewma 4 Plog
21 Scell_log 11
 Sent 28810 bytes 157 pkts (dropped 0, overlimits 0)
  marked 0 early 0 pdrop 0 other 0
qdisc red 8005: dev imq0 limit 64000b min 8000b max 32000b ewma 4 Plog
21 Scell_log 11
 Sent 6794403 bytes 24493 pkts (dropped 0, overlimits 0)
  marked 0 early 0 pdrop 0 other 0
qdisc htb 1: dev imq0 r2q 1 default 40 direct_packets_stat 0 ver 3.17
 Sent 162934335 bytes 184786 pkts (dropped 1905, overlimits 224775)
 backlog 3p


Leigh Sharpe wrote:
> Can you post your configs?
> Essentially, in order to keep the latency as low as possible, you need
> to make sure that you never exceed the bandwidth of the upstream link.
> Whilst doing this, you are able to ensure that your VOIP performance is
> good. If you are not throttling your bandwidth, then just
> re-prioritising your VOIP traffic will not help. As soon as you do a
> large download, your link gets saturated and the latency goes up. Once
> that happens, even if your router is re-prioritising the VOIP traffic,
> it is still latent, which means that your phone performance will suffer.
> By setting the upload and download speeds lower than the line speed, you
> ensure that the line does not get latent, and then your re-prioritising
> is effective.
> Most people seem to be of the opinion that around 80% or so of the line
> speed is a good rule of thumb. 
> 
> -----Original Message-----
> From: lartc-bounces@xxxxxxxxxxxxxxx
> [mailto:lartc-bounces@xxxxxxxxxxxxxxx] On Behalf Of Stefanie Tellex
> Sent: Friday, 7 September 2007 11:49 PM
> To: lartc@xxxxxxxxxxxxxxx
> Subject:  Prioritizing VOIP traffic without sacrificing
> throughput
> 
> Hi,
> 
> I would like to prioritize VOIP traffic when we use the phone, but other
> times not do traffic shaping at all.
> 
> Right now I have my openwrt router set up with htb to do shaping.  In
> order to get it to work well I had to set my upload and download speeds
> much lower than my line speed.  With these settings, I get good VOIP
> reception even while surfing the net and doing a long download.
> However, even when I'm not using the phone, a long download is more than
> twice as slow than it is with shaping turned off.
> 
> Is there some way to configure it to only do shaping when it detects
> VOIP packets, and otherwise not limit traffic?
> 
> Thanks,
> 
> Stefanie
> _______________________________________________
> LARTC mailing list
> LARTC@xxxxxxxxxxxxxxx
> http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

################################################################################
##
## User configuration of the QoS script
##
## At a minimum, set the DOWNLOAD and UPLOAD variables below. Setting these
## slightly slower than the actual line speeds is critical to good QoS
## performance. With download and upload speeds set too high, the traffic queues
## in the modem (upload) and on the ISP side (download) will quickly fill up. As
## these queues can be very long --on the order of several seconds-- filling
## them will prohibit any meaningful traffic shaping.
##
## The default configuration, with the proper upload and download speeds set,
## should be adequate for most situations to separate out low-priority peer-to
## -peer traffic (eMule, Bittorrent, etc.) from interactive traffic such as web
## browsing and SSH sessions.
##
## The configuration can be refined by modifying the settings below. As an
## example, consider including support for VoIP. This may be accomplished by
## adding the IP address of a VoIP adapter to the IP_EXPR variable (e.g.
## IP_EXPR="192.168.1.10"). Doing so will elevate the status of traffic to and
## from the VoIP box to 'express'.
##
## In general, the configuration of the QoS script requires the setting of
## several variables. Most variables expect a space separated list of elements
## (ports, IP addresses, protocols). Adding an element to a list will, based on
## the variable name, either promote a certain connection to 'express' (highest
## priority) or 'priority' status, or demote it to 'bulk' status. The default
## status for all traffic is 'normal'. An example of setting a configuration
## variable to classify traffic is the statement
##
## TCP_PRIO="80 443"
##
## Including this line in the configuration will ensure that all TCP traffic to
## the listed ports (in this particular case for the http and https protocols)
## will be treated as 'priority' traffic.
##
## Another example (from the default configuration) is:
##
## TCP_BULK="1024: 21"
##
## which adds port 21 (the port used for ftp) and all ports 1024 and up to the
## list of destination ports for 'bulk' traffic. The result is that ftp
## downloads get a low priority, as does traffic to non-reserved ports (mostly
## peer-to-peer protocols). The notation '1024:' indicates a port range, in this
## case including all ports 1024 and higher. Another example of a port range is
## ':10' which means all ports from 0 to 10. A range from 10 to 20 is denoted as
## '10:20'.
##
## It is important to note that some variables take precedence over others. This
## becomes significant in cases where the same traffic is identified by
## different rules. An example is adding a UDP game port above 1024 to the
## express list. In the default configuration, all high ports (1024:) are
## included in the UDP_BULK variable. Without knowing the order of the rules, it
## is not possible to determine what the status of traffic to the game port will
## be. It turns out, the traffic will be classified as priority, since UDP_EXPR
## takes precedence over UDP_BULK.
##
## The order of the variables is (lowest precedence first): L7_BULK, L7_PRIO,
## L7_EXPR, IPP2P_BULK, IPP2P_PRIO, IPP2P_EXPR, TCP_BULK, UDP_BULK, TCP_PRIO,
## UDP_PRIO, TCP_EXPR, UDP_EXPR,  TOS_BULK, TOS_PRIO, TOS_EXPR, DSCP_BULK,
## DSCP_PRIO, DSCP_EXPR, IP_BULK, IP_PRIO, IP_EXPR
##
################################################################################

# Download speed in kilobits per second
# Set 5% - 10% lower than *measured* line speed (set to zero to disable)
DOWNLOAD=200

# Upload speed in kilobits per second
# Set 5% - 10% lower than *measured* line speed (set to zero to disable)
UPLOAD=70

# Bulk, prio and express Layer 7 protocol matches
L7_BULK=""
L7_PRIO=""
L7_EXPR=""

# IPP2P protocol matches
# Default 'ipp2p' includes all well-knows peer-to-peer protocols
IPP2P_BULK="ipp2p"
IPP2P_PRIO=""
IPP2P_EXPR=""

# Destination ports for classifying 'bulk' traffic
TCP_BULK="1024: 21"
UDP_BULK="1024:"

# Destination ports for classifying 'priority' traffic
TCP_PRIO="22 23"
UDP_PRIO=""

# Destination ports for classifying 'express' traffic
TCP_EXPR="53"
UDP_EXPR="53"

# ToS (Type of Service) matches (egress only)
#TOS_BULK="0x02"
#TOS_PRIO=""
#TOS_EXPR="0x10"

# DSCP (Differentiated Services Code Point) matches (egress only)
DSCP_BULK=""
DSCP_PRIO=""
DSCP_EXPR=""

# LAN IP addresses for 'bulk', 'priority' and 'express' traffic
# IP address can include a port number or range, such as 192.168.1.1:80 or
# 192.168.1.1:5900:5910. To include all ports, specify the IP address only.
IP_BULK=""
IP_PRIO=""
IP_EXPR="192.168.2.30"

# Define custom QoS interface. Defaults to wan interface.
#QOS_IF=eth1

# Enable 'small UDP packets get priority' feature.
# Sets the maximum length for priority UDP packets.
UDP_LENGTH=500

# Set to 1 to enable logging of packets to syslog
DEBUG=0
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux