File: qos.tex

package info (click to toggle)
asterisk 1%3A1.8.13.1~dfsg1-3%2Bdeb7u3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 49,336 kB
  • sloc: ansic: 497,975; sh: 11,763; cpp: 5,934; makefile: 3,065; perl: 3,019; yacc: 2,147; xml: 498; sql: 387; tcl: 113; php: 62; python: 42
file content (144 lines) | stat: -rw-r--r-- 5,511 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
\subsubsection{Introduction}

Asterisk supports different QoS settings at the application level for various
protocols on both signaling and media. The Type of Service (TOS) byte can be
set 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.

Asterisk running on Linux can also set 802.1p CoS marks in VLAN packets for the 
VoIP protocols it uses. This is useful when working in a switched environment.
In fact Asterisk only set priority for Linux socket. For mapping this priority
and VLAN CoS mark you need to use this command:

\begin{verbatim}
vconfig set_egress_map [vlan-device] [skb-priority] [vlan-qos]
\end{verbatim}

The table below shows all VoIP channel drivers and other Asterisk modules that
support QoS settings for network traffic. It also shows the type(s) of
traffic for which each module can support setting QoS settings.

\begin{table}[h!]
\begin{center}
\begin{tabular}{ | l || c | c | c | c | }
 \hline
              & Signaling & Audio & Video & Text \\ \hline \hline
 chan\_sip    &     +     &   +   &   +   &   +  \\ \hline
 chan\_skinny &     +     &   +   &   +   &      \\ \hline
 chan\_mgcp   &     +     &   +   &       &      \\ \hline
 chan\_unistm &     +     &   +   &       &      \\ \hline
 chan\_h323   &           &   +   &       &      \\ \hline
 chan\_iax2   & \multicolumn{4}{|c|}{+}          \\
 \hline
\end{tabular}
\end{center}
\caption{Channel Driver QoS Settings}
\end{table}

\begin{table}[h!]
\begin{center}
\begin{tabular}{ | l || c | c | c | c | }
 \hline
              & Signaling & Audio & Video & Text          \\ \hline \hline
 dundi.conf   & \multicolumn{4}{ | c | }{+ (tos setting)} \\ \hline
 iaxprov.conf & \multicolumn{4}{ | c | }{+ (tos setting)} \\ \hline
 \hline
\end{tabular}
\end{center}
\caption{Other ToS Settings}
\end{table}

\subsubsection{IP TOS values}
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),

The tos* parameters also take numeric values.

Note that on a Linux system, Asterisk must be compiled with libcap in order to
use the ef tos setting if Asterisk is not run as root.

The lowdelay, throughput, reliability, mincost, and none values have been removed
in current releases.

\subsubsection{802.1p CoS values}

Because 802.1p uses 3 bits of the VLAN header, this parameter can take integer
values from 0 to 7.

\subsubsection{Recommended values}
The recommended values shown below are also included in sample configuration files:

\begin{table}[h!]
\begin{center}
\begin{tabular}{ | l || l | l | }
\hline
          & tos  & cos \\ \hline \hline
Signaling & cs3  & 3   \\ \hline
Audio     & ef   & 5   \\ \hline
Video     & af41 & 4   \\ \hline
Text      & af41 & 3   \\ \hline
Other     & ef   &     \\
\hline
\end{tabular}
\end{center}
\caption{Recommended QoS Settings}
\end{table}

\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
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
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.

\subsubsection{SIP}

In sip.conf, there are four parameters that control the TOS settings:
"tos\_sip", "tos\_audio", "tos\_video" and "tos\_text". tos\_sip controls
what TOS SIP call signaling packets are set to. tos\_audio, tos\_video
and tos\_text control what TOS values are used for RTP audio, video, and text
packets, respectively.

There are four parameters to control 802.1p CoS: "cos\_sip", "cos\_audio",
"cos\_video" and "cos\_text". The behavior of these parameters is the
same as for the SIP TOS settings described above.

\subsubsection{Other RTP channels}

chan\_mgcp, chan\_h323, chan\_skinny and chan\_unistim also support TOS and
CoS via setting tos and cos parameters in their corresponding configuration
files. Naming style and behavior are the same as for chan\_sip.

\subsubsection{Reference}

IEEE 802.1Q Standard:
\url{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
\url{http://www.iana.org/assignments/dscp-registry}

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 
\url{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:
\url{http://www.cisco.com/application/pdf/en/us/guest/netsol/ns432/c649/ccmigration\_09186a008049b062.pdf}