{"id":883,"date":"2024-12-22T03:22:29","date_gmt":"2024-12-22T00:22:29","guid":{"rendered":"https:\/\/itgen.itbumper.com\/?page_id=883"},"modified":"2024-12-22T03:22:30","modified_gmt":"2024-12-22T00:22:30","slug":"0070_cisco-qos-dscp","status":"publish","type":"page","link":"https:\/\/itgen.itbumper.com\/?page_id=883","title":{"rendered":"0070_Cisco: QoS\/DSCP"},"content":{"rendered":"<p style=\"text-align: justify;\"><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"0:3\">QoS<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"4:1\">(<\/span><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"5:7\">Quality<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"13:2\">of<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"16:7\">Service<\/span><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"23:1\">)<\/span><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"24:1\">,<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"26:3\">ToS<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"30:1\">(<\/span><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"31:4\">Type<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"36:2\">of<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"39:7\">Service<\/span><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"46:1\">)<\/span><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"47:1\">,<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"49:1\">and<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"51:4\">DSCP<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"56:1\">(<\/span><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"57:14\">Differentiated<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"72:8\">Services<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"81:4\">Code<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"86:5\">Point<\/span><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"91:1\">)<\/span> are <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"93:5\">closely<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"99:7\">related. They are<\/span>\u00a0<span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"109:12\">used<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"122:3\">to<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"126:10\">manage<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"137:7\">network<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"145:8\">traffic<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"155:5\">to<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"161:10\">ensure<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"172:9\">priority<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"182:3\">for<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"186:12\">certain<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"199:5\">types<\/span> of <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"205:6\">data<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"212:1\">(<\/span><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"213:8\">e.g.<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"223:5\">voice<\/span><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"228:1\">,<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"230:5\">video<\/span><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"235:1\">)<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"237:3\">or<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"241:10\">limit<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"266:18\">bandwidth<\/span> <span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"252:13\">usage<\/span><span class=\"EzKURWReUAB5oZgtQNkl\" data-src-align=\"284:1\">.<\/span><\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#QoS\n#\t1. Bandwidth: kbps, Mbps, Gbps, etc\n#\tQoS tools allow you to reserv a certain amount of link`s bandwidth for specific kinds of traffic\n#\tExample: 20% voice traffic, 30% for specific kinds of data traffic, leaving 50% for all other traffic\n\n\n#\t2. Delay\n#\t\t- The amount of time it takes traffic to go from source to destination \t\t\t   = one-way-delay\n#\t\t- The amount of time it takes traffic to go from source to destination\tand return = two-way-delay\n\n\n#\t3. Jitter\n#\t\t- The variation in one way delay between packets sent by the same application. 10ms = ok, 100ms = high jitter \n#\t\t- Jitter buffer provides a fixing delay to audio packets\n\n#\t4. Loss\n#\t\t- The % of packets sent that do not reached their destination\n#\t\t- Can be caused by faulty cables\n#\t\t- Device packet queus get full (discarding packets)\n\n#\tQoS Quening\n#\t\t-FIFO - First In, First Out. If buffer is full, then Tail Drop.\n#\tTail Drop is harmful because it can lead to TCP global synchronization\n#\tTCP Sliding window - network traffic starts to float\n#\t\t-&gt;&gt;&gt;Network-&gt;Tail Drop-&gt;Global TCP window size decrease-Network-underutilized-&gt;&gt;&gt; and traffic starts float ...\n\n#\tTo prevent use RED (Random Early Detaction). Be aware it affects on all kind of traffics!\n#\tSolution --&gt; Use WRED (Weighted Random Early Detaction)\n\n#===========================\n#\tAudio quality\n#\tDelay: 150ms or less\n#\tJitter: 30 ms or less\n#\tLoss: 1% or less\n#===========================\n\n# There are many methods of classifying traffic, for example:\n#\t- An ACL\n#\t- NBAR (Network Based Application Recognition) - deep packet inspection, looking beyond the layer 3 and 4 up to\n#\t\t\t\t\t\t\t\t\t\t\t\t\t layer 7 to identify the specific kind of traffic\n#\t- The PCP (Priority Code Point) or CoS - field of 802.1Q tag (It works then tag uses only)\n#\t- DSCP (Differentiated Service Code Point) - field of the IP header can also used to identify high\/low priority traffic\n\n#===========================\n\n#\tPCP\/CoS\n#\t3 bits = 8 possible values (2^3=8)\n#\tPCP field in 802.1Q tag\n#-----------------------------------------------\n#\tPCP\/CoS values\t|\t\tTraffic types\t\t|\n#-----------------------------------------------\n#\t0 -no priority\t|\tBest effort (default)\t|\n#-----------------------------------------------\n#\t\t1\t\t\t|\t\tBackground\t\t\t|\n#-----------------------------------------------\n#\t\t2\t\t\t|\t\tExcellent effort\t|\n#-----------------------------------------------\n#\t3 (like SIP)\t|\tCritical Application\t|\n#-----------------------------------------------\n#\t\t4\t\t\t|\t\tVideo\t\t\t\t|\n#-----------------------------------------------\n#\t\t5\t\t\t|\t\tVoice\t\t\t\t|\n#-----------------------------------------------\n#\t\t6\t\t\t|\t\tInternet work\t\t|\t\n#-----------------------------------------------\n#\t\t7\t\t\t|\t\tNetwork control \t|\n#-----------------------------------------------\n\n#===========================\n\n#\tIP ToS\/DSCP (Type of Service \/ Differentiated Services Code Point)\n#\t are mechanisms used to manage traffic priority and service classes in IP networks. \n#\t DSCP is an extension of ToS and provides more granular traffic control.\n#\tToS (Type of Service) \u2013 8-bit Field in IPv4 Header:\n#\t\t- The first 3 bits: Precedence (priority level)\n#\t\t- The next 4 bits: Service parameters (Delay, Throughput, Reliability, Cost).\n#\t\t- The last bit: Reserved (unused).\n\n#-----------------------------------------------|\n#\tPrecedence\t\t|\t\tPurpose\t\t\t\t|\n#-----------------------------------------------|\n#\t\t000\t\t\t|\t\tRoutine\t\t\t\t|\n#-----------------------------------------------|\n#\t\t001\t\t\t|\t\tPriority\t\t\t|\n#-----------------------------------------------|\n#\t\t010\t\t\t|\t\tImmediate\t\t\t|\n#-----------------------------------------------|\n#\t\t011\t\t\t|\t\tFlash\t\t\t\t|\n#-----------------------------------------------|\n#\t\t100\t\t\t|\t  Flash Override\t\t|\n#-----------------------------------------------|\n#\t\t101\t\t\t|\t\tCritical\t\t\t|\n#-----------------------------------------------|\n#\t\t110\t\t\t|\tInternetwork Control\t|\n#-----------------------------------------------|\n#\t\t111\t\t\t|\t\tNetwork Control\t\t|\n#-----------------------------------------------|\n\n\n#\tDSCP (6-bit field) = 64 possible values (0-63)\n#\tDSCP \u2013 Used in QoS for Traffic Classification:\n#------------------------------------------------------------------------------------------|\n#DSCP Value\t|\tBinary\t|\tClass Selector (ToS Precedence)\tPurpose (Per-Hop Behavior, PHB)|\n#-----------|-----------|------------------------------------------------------------------|\n#\t0\t\t|\t000000\t|\tCS0 (Best Effort)\tStandard traffic\t\t\t\t\t\t   |\n#-----------|-----------|------------------------------------------------------------------|\n#\t8\t\t|\t001000\t|\tCS1\tBackground traffic\t\t\t\t\t\t\t\t\t\t   |\n#-----------|-----------|------------------------------------------------------------------|\n#\t16\t\t|\t010000\t|\tCS2\tStandard data\t\t\t\t\t\t\t\t\t\t\t   |\n#-----------|-----------|------------------------------------------------------------------|\n#\t24\t\t|\t011000\t|\tCS3\tStreaming video\t\t\t\t\t\t\t\t\t\t\t   |\n#-----------|-----------|------------------------------------------------------------------|\n#\t32\t\t|\t100000\t|\tCS4\tVoice signaling\t\t\t\t\t\t\t\t\t\t\t   |\n#-----------|-----------|------------------------------------------------------------------|\n#\t40\t\t|\t101000\t|\tCS5\tVoIP\t\t\t\t\t\t\t\t\t\t\t\t\t   |\n#-----------|-----------|------------------------------------------------------------------|\n#\t48\t\t|\t110000\t|\tCS6\tNetwork control\t\t\t\t\t\t\t\t\t\t\t   |\n#-----------|-----------|------------------------------------------------------------------|\n#\t56\t\t|\t111000\t|\tCS7\tReserved (Network Control)\t\t\t\t\t\t\t\t   |\n#-----------|-----------|------------------------------------------------------------------|\n\n\n#Common DSCP Values for QoS:\n#-----------|--------------------|--------------------------------|\n#\tDSCP\t| \t\tPHB\t\t\t |\t\t\tPurpose\t\t\t\t  |\n#-----------|--------------------|--------------------------------|\n#\tEF (46)\t|Expedited Forwarding| Real-time traffic (e.g., voice)|\n#-----------|--------------------|--------------------------------|\n#  AF11 (10)| Assured Forwarding | Low priority\t\t\t\t\t  |\n#-----------|--------------------|--------------------------------|\n#  AF21 (18)| Assured Forwarding | Medium priority\t\t\t\t  |\n#  AF31 (26)| Assured Forwarding | High priority\t\t\t\t  |\n#-----------|--------------------|--------------------------------|\n#  AF41 (34)| Assured Forwarding | Very high priority             |\n#-----------|--------------------|--------------------------------|\n\n#\tMapping DSCP to ToS\n#\t\tDSCP uses the first 6 bits of the ToS field. Thus:\n#\t\tDSCP (6 bits) + 2 reserved bits = ToS (8 bits)\n#\t\tExample:\n#\t\t\tDSCP: 101000 (CS5)\n#\t\t\tToS: 10100000 (160 in decimal)\n\n#\n#\t\tRound-Robin - for guarantee must be in Strict mode. Packets go until the queue is empty.\n#\t\t\t\t\t  To avoid traffic stacking use Policing\n\n#\tShaping \/ Policing\n#\tTraffic  shaping and policing are both used to control the rate of traffic\n#\t\t-Shaping buffers traffic in a queue if the traffic rate goes over the configured rate\n#\t\t-Policing drops traffic in the traffic rate goes over the configured rate or re-marking the traffic\n#\t\t instead of dropping it\n#\tIn both cases, classification can be used to allow for different rates for different kinds of traffic\n\n#\tSteps\n#\t\t1. Classification\n#\t\t2. Quening (% bandwidth guarantee)\n#\t\t3. Scheduling (Round-Robin, Weighted, CBWFQ&lt;-popular)\n#\t\t4. Transmission\n\n\n#Example\nenable\n\tconfigure terminal\t\t\n#\t\tSTEP-1\n#\t\tSTEP-2\n\t\tclass-map HTTP_MAP\t\t\t\t#Create the HTTP_MAP class\n\t\t\tmatch protocol http\t\t\t#Mark HTTP traffic as AF32 &amp; provide min 10% bandwidth as a priority queue\n\t\t\texit\n\t\t\t\n\t\tclass-map HTTPS_MAP\t\t\t\t#Create the HTTPS_MAP class\n\t\t\tmatch protocol https\t\t#Mark HTTPS traffic as AF31 &amp; provide min 10% bandwidth as a priority queue\n\t\t\texit\n\t\tclass-map ICMP_MAP\t\t\t\t#Create the ICMP_MAP class\n\t\t\tmatch protocol icmp\t\t\t#Mark ICMP traffic as CS2 &amp; provide min 5% bandwidth as a priority queue\n\t\t\texit\n\t\t\n\t\tclass-map match-any VOIP\t\t\t\t#Create the VOIP class\n\t\t\tmatch dscp ef\n\t\t\texit\n\t\t\t\n\t\tdo show running config | selection class-map\n\t\t\n#\t\tSTEP-3\n\t\tpolicy-map QOS_POLICY\t\t\t\t\t#Create the QoS politice for HTTPS traffic\n\t\t\tclass HTTPS_MAP\t\t\t\t\t\t\n\t\t\tset ip dscp af31 \t\t\t\t\t#\n\t\t\tpriority percent 10\t\t\t\n\t\t\t\n\t\t\tclass HTTP_MAP\n\t\t\tpolice 500000 8000 8000 conform-action transmit exceed-action drop #Limit HTTP up to 500 kbps\n\t\t\tbandwidth percent 10\n\t\t\t\n\t\t\tclass ICMP_MAP\n\t\t\tset ip dscp cs2\n\t\t\tbandwidth percent 5\n\t\t\t\n\t\t\tclass VOIP\n\t\t\tpriority 1000    \t\t\t\t\t#Set min bandwidth 1000 kbps for VoIP\n\t\t\t\n\t\t\tclass class-default\n\t\t\tfair-queue       \t\t\t\t\t#The remaining traffic is distributed evenly\n\t\t\texit\n\t\tend\n\t\t\n#\t\tSTEP-4\n\t\t\tinterface GigabitEthernet0\/0\t\t#Apply the policy to WAN interface\n\t\t\t\tservice-policy output QOS_POLICY\n\t\t\t\t\n#\t- class-map: Defines traffic categories based on DSCP or other criteria\n#\t- policy-map: Sets the processing rules for each class\n#\t- priority: Guarantees minimum bandwidth\n#\t- police: Limits the speed of traffic with certain actions when exceeded\n#\t- class-default: Handles all traffic that does not fall under the rules\n\n\n\tshow policy-map interface GigabitEthernet0\/0\t#to show active politics on the interface\n\tdebug qos\t\t\t\t\t\t\t\t\t\t#to debug QoS\n\tshow mls qos interface statistics\t\t\t\t#to monitoring packets marked DSCP\n\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>QoS (Quality of Service), ToS (Type of Service), and DSCP (Differentiated Services Code Point) are closely related. They are\u00a0used to manage network traffic to ensure priority for certain types of data (e.g. voice, video) or limit bandwidth usage.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages\/883"}],"collection":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=883"}],"version-history":[{"count":1,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages\/883\/revisions"}],"predecessor-version":[{"id":884,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=\/wp\/v2\/pages\/883\/revisions\/884"}],"wp:attachment":[{"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itgen.itbumper.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}