Newer
Older
Kevin P. Fleming
committed
Asterisk can set the Type of Service (TOS) byte on outgoing IP packets
for various protocols. The TOS byte is used by the network to provide
some level of Quality of Service (QoS) even if the network is
congested with other traffic.
Kevin P. Fleming
committed
Russell Bryant
committed
Also asterisk running on Linux can set 802.1p CoS marks in VLAN packets
for all used VoIP protocols. It is useful when you are working in switched
enviropment. For maping skb->priority and VLAN CoS mark you need to use
command "vconfig set\_egress\_map [vlan-device] [skb-priority] [vlan-qos]".
Russell Bryant
committed
Kevin P. Fleming
committed
In sip.conf, there are three parameters that control the TOS settings:
Russell Bryant
committed
"tos\_sip", "tos\_audio" and "tos\_video". tos\_sip controls what TOS SIP
call signalling packets are set to. tos\_audio controls what TOS RTP audio
packets are set to. tos\_video controls what TOS RTP video packets are
Kevin P. Fleming
committed
Russell Bryant
committed
There are four parameters to control 802.1p CoS: "cos\_sip", "cos\_audio",
"cos\_video" and "cos\_text". It's behavior the same as writen above.
There is a "tos" parameter that is supported for backwards
compatibility. The tos parameter should be avoided in sip.conf
because it sets all three tos settings in sip.conf to the same value.
\subsubsection{IAX2}
In iax.conf, there is a "tos" parameter that sets the global default TOS
for IAX packets generated by chan\_iax2. Since IAX connections combine
Kevin P. Fleming
committed
signalling, audio, and video into one UDP stream, it is not possible
to set the TOS separately for the different types of traffic.
In iaxprov.conf, there is a "tos" parameter that tells the IAXy what TOS
Kevin P. Fleming
committed
to set on packets it generates. As with the parameter in iax.conf,
IAX packets generated by an IAXy cannot have different TOS settings
based upon the type of packet. However different IAXy devices can
have different TOS settings.
Russell Bryant
committed
\subsubsection{H.323}
Also support TOS and CoS.
\subsubsection{MGCP}
Also support TOS and CoS.
\subsubsection{IP TOS values}
Kevin P. Fleming
committed
The allowable values for any of the tos* parameters are:
CS0, CS1, CS2, CS3, CS4, CS5, CS6, CS7, AF11, AF12, AF13,
AF21, AF22, AF23, AF31, AF32, AF33, AF41, AF42, AF43 and
ef (expedited forwarding),
Kevin P. Fleming
committed
The tos* parameters also take numeric values.
The lowdelay, throughput, reliability, mincost, and none values are
deprecated because they set the IP TOS using the outdated "IP
precedence" model as defined in RFC 791 and RFC 1349. They still
work in this version of Asterisk, but will be removed in future releases.
Kevin P. Fleming
committed
Russell Bryant
committed
\subsubsection{802.1p CoS values}
As 802.1p uses 3 bites from VLAN header, there are parameter can take
integer values from 0 to 7.
Kevin P. Fleming
committed
===========================================
Kevin P. Fleming
committed
File Setting
-------------------------------------------
sip.conf tos\_sip cs3
sip.conf tos\_audio ef
sip.conf tos\_video af41
Russell Bryant
committed
sip.conf tos\_text af41
sip.conf cos\_sip 4
sip.conf cos\_audio 6
sip.conf cos\_video 5
sip.conf cos\_text 0
Kevin P. Fleming
committed
-------------------------------------------
iax.conf tos ef
Russell Bryant
committed
iax.conf cos 6
Kevin P. Fleming
committed
-------------------------------------------
iaxprov.conf tos ef
Russell Bryant
committed
-------------------------------------------
mgcp.conf tos ef
mgcp.conf cos 6
-------------------------------------------
h323.conf tos ef
h323.conf cos 6
Kevin P. Fleming
committed
===========================================
Kevin P. Fleming
committed
Russell Bryant
committed
IEEE 802.1Q Standard:
http://standards.ieee.org/getieee802/download/802.1Q-1998.pdf
Related protocols: IEEE 802.3, 802.2, 802.1D, 802.1Q
RFC 2474 - "Definition of the Differentiated Services Field
(DS field) in the IPv4 and IPv6 Headers", Nichols, K., et al,
December 1998.
IANA Assignments, DSCP registry
Differentiated Services Field Codepoints
http://www.iana.org/assignments/dscp-registry
Kevin P. Fleming
committed
To get the most out of setting the TOS on packets generated by
Asterisk, you will need to ensure that your network handles packets
with a TOS properly. For Cisco devices, see the previously mentioned
"Enterprise QoS Solution Reference Network Design Guide". For Linux
systems see the "Linux Advanced Routing \& Traffic Control HOWTO" at
Kevin P. Fleming
committed
<http://www.lartc.org/>.
For more information on Quality of
Service for VoIP networks see the "Enterprise QoS Solution Reference
Network Design Guide" version 3.3 from Cisco at:
<http://www.cisco.com/application/pdf/en/us/guest/netsol/ns432/c649/ccmigration\_09186a008049b062.pdf>