| 
									
										
										
										
											2007-03-16 01:41:00 +00:00
										 |  |  | IP Type of Service settings for VoIP channels | 
					
						
							|  |  |  | --------------------------------------------- | 
					
						
							| 
									
										
										
										
											2006-03-28 03:28:52 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 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 | 
					
						
							| 
									
										
										
										
											2006-03-28 17:18:02 +00:00
										 |  |  | congested with other traffic.  | 
					
						
							| 
									
										
										
										
											2006-03-28 03:28:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-16 01:41:00 +00:00
										 |  |  | * SIP | 
					
						
							|  |  |  | ----- | 
					
						
							| 
									
										
										
										
											2006-03-28 03:28:52 +00:00
										 |  |  | In sip.conf, there are three parameters that control the TOS settings: | 
					
						
							| 
									
										
										
										
											2007-03-16 01:41:00 +00:00
										 |  |  | "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 | 
					
						
							| 
									
										
										
										
											2006-03-28 17:18:02 +00:00
										 |  |  | set to.   | 
					
						
							|  |  |  | There is a "tos" parameter that is supported for backwards | 
					
						
							| 
									
										
										
										
											2006-03-28 03:28:52 +00:00
										 |  |  | compatibility.  The tos parameter should be avoided in sip.conf | 
					
						
							|  |  |  | because it sets all three tos settings in sip.conf to the same value. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-16 01:41:00 +00:00
										 |  |  | * IAX2 | 
					
						
							|  |  |  | ------ | 
					
						
							| 
									
										
										
										
											2006-03-28 17:18:02 +00:00
										 |  |  | In iax.conf, there is a "tos" parameter that sets the global default TOS | 
					
						
							| 
									
										
										
										
											2007-03-16 01:41:00 +00:00
										 |  |  | for IAX packets generated by chan_iax2.  Since IAX connections combine | 
					
						
							| 
									
										
										
										
											2006-03-28 03:28:52 +00:00
										 |  |  | signalling, audio, and video into one UDP stream, it is not possible | 
					
						
							|  |  |  | to set the TOS separately for the different types of traffic. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-28 17:18:02 +00:00
										 |  |  | In iaxprov.conf, there is a "tos" parameter that tells the IAXy what TOS | 
					
						
							| 
									
										
										
										
											2006-03-28 03:28:52 +00:00
										 |  |  | 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. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The allowable values for any of the tos* parameters are: | 
					
						
							| 
									
										
										
										
											2006-03-28 17:18:02 +00:00
										 |  |  | CS0, CS1, CS2, CS3, CS4, CS5, CS6, CS7, AF11, AF12, AF13, | 
					
						
							|  |  |  | AF21, AF22, AF23, AF31, AF32, AF33, AF41, AF42, AF43 and | 
					
						
							|  |  |  | ef (expedited forwarding), | 
					
						
							| 
									
										
										
										
											2006-03-28 03:28:52 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 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 | 
					
						
							| 
									
										
										
										
											2006-09-11 17:02:37 +00:00
										 |  |  | precedence" model as defined in RFC 791 and RFC 1349. They still | 
					
						
							| 
									
										
										
										
											2006-03-28 17:18:02 +00:00
										 |  |  | work in this version of Asterisk, but will be removed in future releases. | 
					
						
							| 
									
										
										
										
											2006-03-28 03:28:52 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | =========================================== | 
					
						
							| 
									
										
										
										
											2006-09-11 17:02:37 +00:00
										 |  |  | Configuration	Parameter	Recommended | 
					
						
							| 
									
										
										
										
											2006-03-28 03:28:52 +00:00
										 |  |  | File				Setting | 
					
						
							|  |  |  | ------------------------------------------- | 
					
						
							| 
									
										
										
										
											2007-03-16 01:41:00 +00:00
										 |  |  | sip.conf	tos_sip		cs3 | 
					
						
							|  |  |  | sip.conf	tos_audio	ef | 
					
						
							|  |  |  | sip.conf	tos_video	af41 | 
					
						
							| 
									
										
										
										
											2006-03-28 03:28:52 +00:00
										 |  |  | ------------------------------------------- | 
					
						
							|  |  |  | iax.conf	tos		ef | 
					
						
							|  |  |  | ------------------------------------------- | 
					
						
							|  |  |  | iaxprov.conf	tos		ef | 
					
						
							|  |  |  | =========================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-28 17:18:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-16 01:41:00 +00:00
										 |  |  | * REFERENCE | 
					
						
							|  |  |  | ----------- | 
					
						
							| 
									
										
										
										
											2006-03-28 17:18:02 +00:00
										 |  |  | 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 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-28 03:28:52 +00:00
										 |  |  | 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 | 
					
						
							| 
									
										
										
										
											2007-03-16 01:41:00 +00:00
										 |  |  | systems see the "Linux Advanced Routing & Traffic Control HOWTO" at | 
					
						
							| 
									
										
										
										
											2006-03-28 03:28:52 +00:00
										 |  |  | <http://www.lartc.org/>. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-03-28 17:18:02 +00:00
										 |  |  | 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: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-16 01:41:00 +00:00
										 |  |  | <http://www.cisco.com/application/pdf/en/us/guest/netsol/ns432/c649/ccmigration_09186a008049b062.pdf> | 
					
						
							| 
									
										
										
										
											2006-03-28 17:18:02 +00:00
										 |  |  | 
 |