{"id":4392918,"date":"2024-02-04T15:04:49","date_gmt":"2024-02-04T15:04:49","guid":{"rendered":"https:\/\/www.lastopinion.io\/?p=4392918"},"modified":"2024-02-16T07:46:17","modified_gmt":"2024-02-16T07:46:17","slug":"qos-should-we-define-the-percentage-value-for-the-default-class","status":"publish","type":"post","link":"https:\/\/www.lastopinion.io\/index.php\/2024\/02\/04\/qos-should-we-define-the-percentage-value-for-the-default-class\/","title":{"rendered":"QoS &#8211; Should we assign a value for the default-class?"},"content":{"rendered":"\n<p class=\"has-black-color has-text-color wp-block-paragraph\">Here is how the CBWFQ (Class-Based Weighted Fair Queueing)  allocation mechanism is described on Cisco website : <a href=\"https:\/\/www.cisco.com\/c\/en\/us\/support\/docs\/quality-of-service-qos\/qos-packet-marking\/10100-priorityvsbw.html\" target=\"_blank\" rel=\"noopener\" title=\"\">&#8220;<strong>If excess bandwidth is available, the excess bandwidth is divided amongst the traffic classes in proportion to their configured bandwidths. If not all of the bandwidth is allocated, the remaining bandwidth is proportionally allocated among the classes, based on their configured bandwidth<\/strong>.&#8221;<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading has-text-color has-medium-font-size\" style=\"color:#e50055\"><strong>How Is Unused Bandwidth Allocated?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In this example, policy-map &#8220;TOP&#8221; guarantees 20 percent of the bandwidth to class aaa and 40 percent of the bandwidth to class bbb.<\/p>\n\n\n\n<p class=\"has-white-color has-black-background-color has-text-color has-background wp-block-paragraph\">policy-map TOP<br> class C1<br>  bandwidth percent 20<br> class C2<br>  bandwidth percent 40<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If we apply this policy to a 100 Mbps link, it means that 20 Mbps is the minimum guaranteed to class aaa, and 40 Mbps is minimum guaranteed to class bbb. Importantly, 40 Mbps is leftover for class-default.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color wp-block-paragraph\">Should both classes C1 and C2 require bandwidth simultaneously, they proportionally share the unused bandwith 40 Mbps based on the configured rates.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color wp-block-paragraph\">The sharing ratio, in this case, is set at 20:40 or 1:2 so they share it in proportion to the configured rates, reflecting the respective allocations to class aaa and class bbb.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, let&#8217;s explore the scenarios where we explicitly specify the class-default and those where we don&#8217;t<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-text-color\" style=\"color:#e50055\">Test environment :<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We can conduct the tests using EVE-NG and iperf as follow :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"360\" height=\"673\" src=\"https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/02\/2024-02-05_16-08-03.png\" alt=\"\" class=\"wp-image-4392922\" style=\"width:133px;height:auto\" srcset=\"https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/02\/2024-02-05_16-08-03.png 360w, https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/02\/2024-02-05_16-08-03-160x300.png 160w, https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/02\/2024-02-05_16-08-03-6x12.png 6w\" sizes=\"(max-width: 360px) 100vw, 360px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>From the client, we initiate two flows as follows:<\/strong><\/p>\n\n\n\n<p class=\"has-white-color has-black-background-color has-text-color has-background wp-block-paragraph\">\u2514\u2500# iperf -c 5.5.5.2 -u -P 1 -i 1 -p 5000 -f k -b 1.0M -t 0<\/p>\n\n\n\n<p class=\"has-white-color has-black-background-color has-text-color has-background wp-block-paragraph\">\u2514\u2500# iperf -c 5.5.5.2 -u -P 1 -i 1 -p 5001 -f k -b 1.0M -t 0<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On the server, we simultaneously listen to both UDP ports:<\/p>\n\n\n\n<p class=\"has-white-color has-black-background-color has-text-color has-background wp-block-paragraph\">\u2514\u2500# iperf -s -u -P 0 -i 1 -p 5001 -f k<\/p>\n\n\n\n<p class=\"has-white-color has-black-background-color has-text-color has-background wp-block-paragraph\">\u2514\u2500# iperf -s -u -P 0 -i 1 -p 5000 -f k<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We use a Cisco CSR1K router, and we match the port UDP 5000 to class CM1 (so 5001 will go to class-default) :<\/p>\n\n\n\n<p class=\"has-white-color has-black-background-color has-text-color has-background wp-block-paragraph\">class-map match-all CM1<br>match access-group name ACL1<\/p>\n\n\n\n<p class=\"has-white-color has-black-background-color has-text-color has-background wp-block-paragraph\">ip access-list extended ACL1<br>permit udp any any eq 5000<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-text-color\" style=\"color:#e50055\">Without Explicitly Allocating Bandwidth on class-default:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We configure the CSR Cisco router as follow :<\/p>\n\n\n\n<p class=\"has-white-color has-black-background-color has-text-color has-background wp-block-paragraph\">policy-map TEST<br>class CM1<br>bandwidth percent 20<br>class class-default<\/p>\n\n\n\n<p class=\"has-white-color has-black-background-color has-text-color has-background wp-block-paragraph\">policy-map SHAPE<br>class class-default<br>shape average 1000000<br>service-policy TEST<\/p>\n\n\n\n<p class=\"has-white-color has-black-background-color has-text-color has-background wp-block-paragraph\">interface GigabitEthernet5<br>service-policy output SHAPE<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the Cisco output, implicitly, the class-default has been allocated 80%.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code>Router#show policy-map interface gigabitEthernet 5\nGigabitEthernet5\n\nService-policy output: SHAPE\nClass-map: class-default (match-any)  \n  441009 packets, 666677500 bytes\n  5 minute offered rate 2157000 bps, drop rate 1162000 bps\n  Match: any \n  Queueing\n  queue limit 64 packets\n  (queue depth\/total drops\/no-buffer drops) 0\/228229\/0\n  (pkts output\/bytes output) 213515\/322756330\n  shape (average) cir 1000000, bc 4000, be 4000\n  target shape rate 1000000\n\n  Service-policy : TEST\n\n    Class-map: CM1 (match-all)  \n      212393 packets, 321138216 bytes\n      5 minute offered rate 1078000 bps, drop rate 878000 bps\n      Match: access-group name ACL1\n      Queueing\n      queue limit 64 packets\n      (queue depth\/total drops\/no-buffer drops) 64\/166765\/0\n      (pkts output\/bytes output) 46862\/70855344\n      bandwidth 20% (200 kbps)\n\n    Class-map: class-default (match-any)  \n      226849 packets, 342867580 bytes\n      5 minute offered rate 1079000 bps, drop rate 285000 bps\n      Match: any \n      Queueing\n      queue limit 64 packets\n      (queue depth\/total drops\/no-buffer drops) 63\/61464\/0\n      (pkts output\/bytes output) 166653\/251900986\n      <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\">bandwidth 80% <\/mark><\/strong>(800 kbps)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, let&#8217;s launch the trafic from the iPerf and see what we&#8217;ve got :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"287\" src=\"https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/02\/Implicit_class-default_set-1024x287.png\" alt=\"\" class=\"wp-image-4392924\" srcset=\"https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/02\/Implicit_class-default_set-980x275.png 980w, https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/02\/Implicit_class-default_set-480x135.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">As observed, the default class did not receive the entire 80% of the remaining share. Instead, the excess share was proportionally divided. In our case, with only the CM1 class having a 20% minimum guaranteed, it received 20 + (20 * 80%) = 36%<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">without explicitly assigning bandwidth to the default class, it operates on a best-effort basis. All classes will contend for the remaining bandwidth after claiming their designated shares.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-text-color\" style=\"color:#e50055\">With Explicitly Allocating Bandwidth on Default-Class:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now, let&#8217;s explicitly define the allocation for the class-default :<\/p>\n\n\n\n<p class=\"has-white-color has-black-background-color has-text-color has-background wp-block-paragraph\">policy-map TEST<br>class CM1<br>bandwidth percent 20<br>class class-default<br>bandwidth percent 80<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When bandwidth is explicitly allocated to the default class (80% in this example), it ensures that default traffic will receive its designated share, even when CM1 attempts to utilize the entire link.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"364\" src=\"https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/02\/Explicite_class-default_set-1024x364.png\" alt=\"\" class=\"wp-image-4392923\" srcset=\"https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/02\/Explicite_class-default_set-980x348.png 980w, https:\/\/www.lastopinion.io\/wp-content\/uploads\/2024\/02\/Explicite_class-default_set-480x171.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading has-text-color\" style=\"color:#e50055\">In summary<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In situations where non-default classes saturate the bandwidth, it becomes crucial to explicitly allocate bandwidth for the default-class. This explicit assignment ensures that unclassified or traffic not specified by other classes receives a dedicated share.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Failure to assign a specific bandwidth percentage to the default-class under such saturation scenarios may lead to potential capacity starvation for critical business applications or essential traffic falling within the default class (if there is), particularly when not explicitly identified and classified.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Leveraging ChatGPT3&#8217;s assistance, I&#8217;ve crafted a tool for pasting the class-map configuration and monitoring the dynamic distribution behavior \ud83d\ude42<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Feel free to make use of it (<a href=\"https:\/\/lastopinion.io\/public\/QoS_CBWFQ_proportion.html\" target=\"_blank\" rel=\"noopener\" title=\"Cisco CBWFQ QoS Bandwidth Analyzer - Proportional distribution of excess bandwidth\">https:\/\/lastopinion.io\/public\/QoS_CBWFQ_proportion.html<\/a>)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can download the Lab <a href=\"https:\/\/lastopinion.io\/wp-content\/uploads\/2024\/02\/LAB_class-default_QoS.zip\" target=\"_blank\" rel=\"noopener\" title=\"\">here <\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hope this helps !<\/p>\n\n\n\n<p class=\"has-vivid-red-color has-text-color has-link-color wp-elements-01c21b0ed3b0a9d8c4c809f13b74fe9d wp-block-paragraph\">Are you currently evaluating the adoption of a new Quality of Service (QoS) strategy for your network and seeking a professional second opinion to address any uncertainties?<\/p>\n\n\n\n<p class=\"has-vivid-red-color has-text-color has-link-color wp-elements-c2057cfa2061188a695170420d3ddc52 wp-block-paragraph\">We can assist you. Please don\u2019t hesitate to reach out to us through the&nbsp;<a href=\"https:\/\/www.lastopinion.io\/index.php\/contact-us\/\" target=\"_blank\" rel=\"noopener\" title=\"\">CONTACT-US<\/a>&nbsp;page or by emailing us at&nbsp;<a href=\"mailto:contact@lastopinion.io\">contact@lastopinion.io<\/a>&nbsp;for advise assistance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.linkedin.com\/in\/mehdi-sfar-b4a42910\/\" target=\"_blank\" rel=\"noreferrer noopener\">Mehdi SFAR (CCDE 2021:3, CCIE #51583)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is how the CBWFQ (Class-Based Weighted Fair Queueing) allocation mechanism is described on Cisco website : &#8220;If excess bandwidth is available, the excess bandwidth is divided amongst the traffic classes in proportion to their configured bandwidths. If not all of the bandwidth is allocated, the remaining bandwidth is proportionally allocated among the classes, based [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4392961,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[18],"tags":[16,23,30,14,29],"class_list":["post-4392918","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-ccde","tag-cisco","tag-default-class","tag-network-design","tag-qos"],"_links":{"self":[{"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/posts\/4392918","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/comments?post=4392918"}],"version-history":[{"count":14,"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/posts\/4392918\/revisions"}],"predecessor-version":[{"id":4392976,"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/posts\/4392918\/revisions\/4392976"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/media\/4392961"}],"wp:attachment":[{"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/media?parent=4392918"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/categories?post=4392918"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lastopinion.io\/index.php\/wp-json\/wp\/v2\/tags?post=4392918"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}