<div dir="ltr"><div class="gmail_default" style="color:rgb(102,0,0)">If it helps understanding the difference between DSCP and TOS, here is a table I put together years back that shows all the common values.</div><div class="gmail_default" style="color:rgb(102,0,0)">
<br></div><div class="gmail_default" style="color:rgb(102,0,0)"><span style="color:rgb(51,51,51);font-family:Arial,Verdana,sans-serif;font-size:13px">QoS Values are very confusing, so I'm making a table of the different types of values that mean the same thing.</span><div style="color:rgb(51,51,51);font-family:Arial,Verdana,sans-serif;font-size:13px">
<br></div><div style="color:rgb(51,51,51);font-family:Arial,Verdana,sans-serif;font-size:13px"><br></div><div style="color:rgb(51,51,51);font-family:Arial,Verdana,sans-serif;font-size:13px"><table border="1" cellspacing="0" style="margin:0px;border-collapse:collapse;border-color:rgb(136,136,136);border-width:1px">
<tbody><tr><td style="vertical-align:top;width:60px"> USED FOR</td><td style="vertical-align:top;width:60px"> Cisco Type</td><td style="vertical-align:top;width:60px"> Prec. Level</td><td style="vertical-align:top;width:60px">
 DSCP Binary</td><td style="vertical-align:top;width:60px"> DSCP Hex</td><td style="vertical-align:top;width:60px"> DSCP Decimal</td><td style="vertical-align:top;width:60px"> Diffserv/ TOS Hex</td><td style="vertical-align:top;width:60px">
Diffserv/ TOS Dec.</td></tr><tr><td style="vertical-align:top;width:60px"> Not Used</td><td style="vertical-align:top;width:60px"> cs7</td><td style="vertical-align:top;width:60px"> 7</td><td style="vertical-align:top;width:60px">
 111XXX</td><td style="vertical-align:top;width:60px"> 40-4E</td><td style="vertical-align:top;width:60px"> </td><td style="vertical-align:top;width:60px"> </td><td style="vertical-align:top;width:60px"> </td></tr><tr><td style="vertical-align:top;width:60px">
 Not Used</td><td style="vertical-align:top;width:60px"> cs6</td><td style="vertical-align:top;width:60px"> 6</td><td style="vertical-align:top;width:60px"> 110XXX</td><td style="vertical-align:top;width:60px"> 30-3E</td>
<td style="vertical-align:top;width:60px"> </td><td style="vertical-align:top;width:60px"> </td><td style="vertical-align:top;width:60px"> </td></tr><tr><td style="vertical-align:top;width:60px"> AUDIO</td><td style="vertical-align:top;width:60px">
 ef</td><td style="vertical-align:top;width:60px"> 5</td><td style="vertical-align:top;width:60px"> 101110</td><td style="vertical-align:top;width:60px"> 2E</td><td style="vertical-align:top;width:60px"> 46</td><td style="vertical-align:top;width:60px">
 B8</td><td style="vertical-align:top;width:60px"> 184</td></tr><tr><td style="vertical-align:top"> </td><td style="vertical-align:top"> cs5</td><td style="vertical-align:top"> 5</td><td style="vertical-align:top"> 101000</td>
<td style="vertical-align:top"> 28</td><td style="vertical-align:top"> 40</td><td style="vertical-align:top"> A0</td><td style="vertical-align:top"> 160</td></tr><tr><td style="vertical-align:top;width:60px"><br></td><td style="vertical-align:top;width:60px">
 af43</td><td style="vertical-align:top;width:60px"> 4</td><td style="vertical-align:top;width:60px"> 100110</td><td style="vertical-align:top;width:60px"> 26</td><td style="vertical-align:top;width:60px"> 38</td><td style="vertical-align:top;width:60px">
 98</td><td style="vertical-align:top;width:60px"> 152</td></tr><tr><td style="vertical-align:top;width:60px"><br></td><td style="vertical-align:top;width:60px"> af42</td><td style="vertical-align:top;width:60px"> 4</td><td style="vertical-align:top;width:60px">
 100100</td><td style="vertical-align:top;width:60px">24</td><td style="vertical-align:top;width:60px"> 36</td><td style="vertical-align:top;width:60px">90</td><td style="vertical-align:top;width:60px">144</td></tr><tr><td style="vertical-align:top">
 </td><td style="vertical-align:top"> af41</td><td style="vertical-align:top"> 4</td><td style="vertical-align:top"> 100010</td><td style="vertical-align:top"> 22</td><td style="vertical-align:top"> 34</td><td style="vertical-align:top">
 88</td><td style="vertical-align:top"> 136</td></tr><tr><td style="vertical-align:top"> </td><td style="vertical-align:top">cs4</td><td style="vertical-align:top">4</td><td style="vertical-align:top">100000</td><td style="vertical-align:top">
 20</td><td style="vertical-align:top"> 32</td><td style="vertical-align:top"> 80</td><td style="vertical-align:top"> 128</td></tr><tr><td style="vertical-align:top"> </td><td style="vertical-align:top"> af33</td><td style="vertical-align:top">
 3</td><td style="vertical-align:top"> 011110</td><td style="vertical-align:top"> 1E</td><td style="vertical-align:top"> 30</td><td style="vertical-align:top"> 78</td><td style="vertical-align:top"> 120</td></tr><tr><td style="vertical-align:top">
 </td><td style="vertical-align:top"> af32</td><td style="vertical-align:top"> 3</td><td style="vertical-align:top"> 011100</td><td style="vertical-align:top"> 1D</td><td style="vertical-align:top"> 28</td><td style="vertical-align:top">
 70</td><td style="vertical-align:top"> 112</td></tr><tr><td style="vertical-align:top"> </td><td style="vertical-align:top"> af31</td><td style="vertical-align:top"> 3</td><td style="vertical-align:top"> 011010</td><td style="vertical-align:top">
 1A</td><td style="vertical-align:top"> 26</td><td style="vertical-align:top"> 68</td><td style="vertical-align:top"> 104</td></tr><tr><td style="vertical-align:top"> SIP</td><td style="vertical-align:top"> cs3</td><td style="vertical-align:top">
 3</td><td style="vertical-align:top"> 011000</td><td style="vertical-align:top"> 18</td><td style="vertical-align:top"> 24</td><td style="vertical-align:top"> 60</td><td style="vertical-align:top"> 96<br></td></tr><tr><td style="vertical-align:top">
 </td><td style="vertical-align:top"> af23</td><td style="vertical-align:top"> 2</td><td style="vertical-align:top"> 010110</td><td style="vertical-align:top"> 16</td><td style="vertical-align:top"> 22</td><td style="vertical-align:top">
 58</td><td style="vertical-align:top"> 88</td></tr><tr><td style="vertical-align:top"> </td><td style="vertical-align:top"> af22</td><td style="vertical-align:top"> 2</td><td style="vertical-align:top"> 010100</td><td style="vertical-align:top">
 14</td><td style="vertical-align:top"> 20</td><td style="vertical-align:top"> 50</td><td style="vertical-align:top"> 80</td></tr><tr><td style="vertical-align:top"> </td><td style="vertical-align:top"> af21</td><td style="vertical-align:top">
 2</td><td style="vertical-align:top"> 010010</td><td style="vertical-align:top"> 12</td><td style="vertical-align:top"> 18</td><td style="vertical-align:top"> 48</td><td style="vertical-align:top"> 72</td></tr><tr><td style="vertical-align:top">
 </td><td style="vertical-align:top"> cs2</td><td style="vertical-align:top"> 2</td><td style="vertical-align:top"> 010000</td><td style="vertical-align:top"> 10</td><td style="vertical-align:top"> 16</td><td style="vertical-align:top">
40</td><td style="vertical-align:top"> 64</td></tr><tr><td style="vertical-align:top"> </td><td style="vertical-align:top"> af13</td><td style="vertical-align:top"> 1</td><td style="vertical-align:top"> 001110</td><td style="vertical-align:top">
 0E</td><td style="vertical-align:top"> 14</td><td style="vertical-align:top"> 38</td><td style="vertical-align:top"> 56</td></tr><tr><td style="vertical-align:top"> </td><td style="vertical-align:top"> af12</td><td style="vertical-align:top">
 1</td><td style="vertical-align:top"> 001100</td><td style="vertical-align:top"> 0D</td><td style="vertical-align:top"> 12</td><td style="vertical-align:top"> 30</td><td style="vertical-align:top"> 48</td></tr><tr><td style="vertical-align:top">
 </td><td style="vertical-align:top"> af11</td><td style="vertical-align:top"> 1</td><td style="vertical-align:top"> 001010</td><td style="vertical-align:top"> 0A</td><td style="vertical-align:top"> 10</td><td style="vertical-align:top">
 28</td><td style="vertical-align:top"> 40</td></tr><tr><td style="vertical-align:top"> </td><td style="vertical-align:top"> cs1</td><td style="vertical-align:top"> 1</td><td style="vertical-align:top"> 001000</td><td style="vertical-align:top">
 08</td><td style="vertical-align:top"> 8</td><td style="vertical-align:top"> 20</td><td style="vertical-align:top"> 32</td></tr><tr><td style="vertical-align:top"> DATA</td><td style="vertical-align:top"> be</td><td style="vertical-align:top">
 0</td><td style="vertical-align:top"> 000000</td><td style="vertical-align:top"> 00</td><td style="vertical-align:top"> 0</td><td style="vertical-align:top"> 0</td><td style="vertical-align:top"> 0</td></tr></tbody></table>
<br></div><div style="color:rgb(51,51,51);font-family:Arial,Verdana,sans-serif;font-size:13px">Precedence Values:</div><div style="color:rgb(51,51,51);font-family:Arial,Verdana,sans-serif;font-size:13px"><table border="1" cellspacing="0" style="margin:0px;border-collapse:collapse;border-color:rgb(136,136,136);border-width:1px">
<tbody><tr><td style="vertical-align:top;width:59px;height:14px">7</td><td style="vertical-align:top;width:97px;height:14px"> Reserved</td></tr><tr><td style="vertical-align:top;width:59px;height:14px"> 6</td><td style="vertical-align:top;width:97px;height:14px">
 Routing</td></tr><tr><td style="vertical-align:top;width:59px;height:14px"> 5</td><td style="vertical-align:top;width:97px;height:14px"> Voice</td></tr><tr><td style="vertical-align:top;width:59px;height:28px"> 4</td><td style="vertical-align:top;width:97px;height:28px">
 Streaming Video</td></tr><tr><td style="vertical-align:top;width:59px;height:28px"> 3</td><td style="vertical-align:top;width:97px;height:28px"> Call Signalling</td></tr><tr><td style="vertical-align:top;width:59px;height:28px">
 2</td><td style="vertical-align:top;width:97px;height:28px"> Transactional</td></tr><tr><td style="vertical-align:top;width:59px;height:14px"> 1</td><td style="vertical-align:top;width:97px;height:14px"> Bulk Data</td></tr>
<tr><td style="vertical-align:top;width:59px;height:14px"> 0</td><td style="vertical-align:top;width:97px;height:14px"> Best Effort<br><br></td></tr></tbody></table></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Feb 10, 2014 at 11:23 AM, Jonathan Rose <span dir="ltr"><<a href="mailto:jrose@digium.com" target="_blank">jrose@digium.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">I've been looking into this issue and researching how TOS became the DiffServ field, but there are some issues with changing configuration options during a release that we feel the community needs to have some input on. We have a few options for going forward here, and some are more disruptive to existing configurations than others.<div>

<br></div><div>1. We can change the names of the fields and correct the behavior so that all values set for pjsip.conf are DSCP values. In this case, 'tos' becomes 'dscp' while 'tos_audio' and 'tos_video' become 'dscp_audio' and 'dscp_video' respectively. Databases and the alembic scripts we supply for building them would need to add the new fields. This change would certainly break existing configurations if we don't alias the TOS fields. If we do alias the TOS fields, then people expecting the current behavior will likely have QOS values that don't reflect their expectations. It's an obscure problem that would probably go unnoticed for a while.</div>

<div><br></div><div>2. We can have the 'tos' value for transports be set correctly by dropping the ECN portion (bits 7 and 8) and have the remaining 6 bits form the DSCP value so that it is being set as a TOS value would be.  The benefit here is that this would require no significant changes on the configuration end while still being more or less accurate to what the settings are. We would probably want to display a warning message indicating that the field doesn't have support for the ECN bits if a value is supplied that includes them. In this scenario, 'tos_audio' and 'tos_video' for endpoints could be left alone and remain functioning as they do in chan_sip.<br>

</div><div><br></div><div>3. We can leave the existing TOS values functioning in the TOS manner while adding DSCP values that override them if provided. This would require correcting the behavior of the 'tos' setting for transports while we leave 'tos_audio' and 'tos_video' in 12 and then adding options for 'dscp', 'dscp_audio', and 'dscp_video' to trunk. In trunk the TOS options would be considered deprecated (but still functional). This is probably the cleanest way to do it, but it's still a bit more disruptive (when Asterisk 13 gets rolled out anyway) than option 2.<br>

</div><div><br></div><div>Another thing to consider is whether or not we want to add support for reading the TOS/DSCP values as strings. While this wouldn't break any existing pjsip.conf files, we would need to update the alembic scripts for changing the TOS values to be strings in databases and this would require a little effort in upgrades. This is another change that might be better left as trunk only.</div>

<div><br></div><div>Personally, I favor options 2 and 3. If the community feels differently though, I'm open to other approaches.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="">On Mon, Feb 3, 2014 at 11:24 AM, George Joseph <span dir="ltr"><<a href="mailto:george.joseph@fairview5.com" target="_blank">george.joseph@fairview5.com</a>></span> wrote:<br>

</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><br><div>As I was playing around with TOS/COS in pjsip last week I noticed some inconsistencies that I'd like to correct...</div>

<div><br></div><div>There's a 'tos' parameter on the transport object but not only does it actually set DSCP instead of TOS, it sets it in pjproject only and therefore for signalling only.</div>
<div><br></div><div>There are tos_audio and tos_video parameters on endpoint which do set tos for the rtp engine but they don't accept hex or symbolic values as chan_sip does.</div><div><br></div><div>So, given that DSCP has been around for a while and that's what the symbolic values represent anyway, Id like to do the following...</div>


<div><br></div><div>In transport, rename tos and cos to dscp_sip and cos_sip respectively and for dscp_sip,  create a new function ast_str2dscp() as a companion to the existing ast_str2tos that resolves the symbolics.  The new function is needed because while the existing ast_str2tos function takes in a string representation of DSCP, it left-shifts it 2 bits to go into the rtp_engine's tos field.  pjproject only accepts dscp.</div>


<div><br></div><div>In endpoint, rename tos_audio and tos_video to dscp_audio and dscp_video respectively, then use ast_str2tos to resolve the symbolics.</div><div><br></div><div>I could also add the new parameters and leave the old ones there for backwards compatibility for a while if that makes sense.</div>


<div><br></div><div>What do you think?</div><div><a href="https://issues.asterisk.org/jira/browse/ASTERISK-23235" target="_blank">https://issues.asterisk.org/jira/browse/ASTERISK-23235</a><br></div><div><br></div><div><br>

</div><div><br>
</div></div>
<br></div></div><div class="">--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">

Jonathan R. Rose<br>Digium, Inc. | Software Engineer<div class=""><br>445 Jan Davis Drive NW - Huntsville, AL 35806 - US<br></div>direct +1 256 428 6139 <br><br>Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> & <a href="http://asterisk.org" target="_blank">http://asterisk.org</a><br>

<br></div>
</div>
<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">
<img alt="Digium logo" src="https://my.digium.com/images/graphics/digium_RGB_signature.gif" width="288" height="50" style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:12px"><div>Scott Griepentrog<br>
Digium, Inc · Software Developer<br>445 Jan Davis Drive NW · Huntsville, AL 35806 · US<br>direct/fax: +1 256 428 6239 · mobile: +1 317 507 4029<br>Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> · <a href="http://asterisk.org" target="_blank">http://asterisk.org</a><br>
</div></div>
</div>