HQoS-VPP Case
24 min
\<font color="#1d50a2">introduction\</font> this guide provides a step by step tutorial for configuring hierarchical quality of service (hqos) on the asterfusion et2500 open intelligent gateway running asternos unlike traditional "flat qos" which only manages traffic based on interface or packet priority, hqos introduces the concept of organization into your network it allows you to model your traffic policies based on real world structures—tenants, departments, and users—ensuring critical business isolation in congested environments \<font color="#1d50a2">what this guide will accomplish\</font> by following this guide, you will upgrade a standard layer 3 gateway into an intelligent, multi tenant traffic manager you will learn how to map the logical 4 level scheduler hierarchy (port group user queue) to enforce strict service level agreements (slas) the scenarios covered are phase 1 multi tenant resource isolation (group shaping) we will configure two distinct departments "r\&d" and "guest" we will demonstrate that the "guest zone" is strictly capped at a specific bandwidth,preventing it from affecting the "r\&d department" even when the guests try to flood the network phase 2 micro level service assurance (queue scheduling) within the r\&d bandwidth pipe, we will implement a "voice first" policy we will verify that latency sensitive traffic strictly pre empts bulk data during congestion phase 3 traffic classification & mapping learning how to use access control lists (acls) to classify traffic from different physical subnets and map them into their respective hqos logic branches \<font color="#1d50a2">supported platforms \& modes\</font> asternos hqos is designed with a unified architecture that adapts to your underlying hardware hardware mode on supported platforms (e g , et2500), hqos policies can be offloaded to the npu for zero cpu overhead execution software mode on standard vms or non npu interfaces, hqos runs in software mode (vpp based), providing identical functionality with cpu dependent performance note this guide uses a virtual machine environment for demonstration \<font color="#1d50a2">preparation and environmental overview\</font> \<font color="#1d50a2">network topology plan\</font> the following diagram illustrates the logical and physical hierarchy we will implement it maps physical ports to logical "zones" with specific bandwidth guarantees \<font color="#1d50a2">target configuration plan\</font> device / interface ip address / subnet gateway role asternos (eth1) 192 168 200 166/24 192 168 200 1 wan uplink (nat outside / hqos root port) asternos (eth2) 10 10 10 1/24 n/a r\&d gateway (high priority zone / nat inside) asternos (eth3) 10 20 20 1/24 n/a guest gateway (restricted zone / nat inside) r\&d pc 10 10 10 100/24 10 10 10 1 traffic source a (simulating vip users) guest pc 10 20 20 100/24 10 20 20 1 traffic source b (simulating guest users) upstream server 192 168 200 153 traffic target (iperf3 server) \<font color="#1d50a2">basic network \& nat setup\</font> before configuring hqos, we must ensure basic connectivity and nat are working, as hqos relies on the underlying network flow we will configure port 2 for r\&d and port 3 for guests \<font color="#5fd74e">#1 global nat enable\</font> sonic(config)# nat enable \<font color="#5fd74e">#2 configure nat pool (using wan ip)\</font> sonic(config)# nat pool pool1 192 168 200 166 \<font color="#5fd74e">#3 configure nat binding\</font> sonic(config)# nat binding bind1 pool1 \<font color="#5fd74e">#4 configure wan interface (ethernet 1)\</font> sonic(config)# interface ethernet 1 sonic(config if 1)# ip address 192 168 200 166/24 sonic(config if 1)# nat zone 1 sonic(config if 1)# exit \<font color="#5fd74e">#5 configure lan interface 1 (ethernet 2 r\&d)\</font> sonic(config)# interface ethernet 2 sonic(config if 2)# ip address 10 10 10 1/24 sonic(config if 2)# exit \<font color="#5fd74e">#6 configure lan interface 2 (ethernet 3 guest)\</font> sonic(config)# interface ethernet 3 sonic(config if 3)# ip address 10 20 20 1/24 sonic(config if 3)# exit \<font color="#5fd74e">#7 configure default route\</font> sonic(config)# ip route 0 0 0 0/0 192 168 200 1 \<font color="#1d50a2">building the hqos hierarchy\</font> we construct the hqos policy from the bottom up maps > user profile > group profile > port profile \<font color="#1d50a2">step 1 qos mapping (dscp to tc)\</font> define how packets are mapped to internal traffic classes \<font color="#5fd74e">#map dscp 0 (data) to tc 0\</font> sonic(config)# qos map dscp to tc voice prio 0 0 \<font color="#5fd74e">#map dscp 46 (voice) to tc 7\</font> sonic(config)# qos map dscp to tc voice prio 46 7 \<font color="#1d50a2">step 2 user profiles (queue scheduling)\</font> we define two user templates one for standard employees (r\&d) who need voice priority, and one for guests who only get best effort service \<font color="#5fd74e">#template for r\&d employees\</font> sonic(config)# hqos user profile emp standard \<font color="#5fd74e">#bind the map for egress queue alignment\</font> sonic(config user emp standard)# qos map bind dscp to tc voice prio \<font color="#5fd74e">#queue 0 dwrr (data)\</font> sonic(config user emp standard)# tc queue 0 mode dwrr 1 \<font color="#5fd74e">#queue 7 strict priority (voice)\</font> sonic(config user emp standard)# tc queue 7 mode strict sonic(config user emp standard)# exit \<font color="#5fd74e">#template for guests\</font> sonic(config)# hqos user profile emp guest sonic(config user emp guest)# tc queue 0 mode dwrr 1 sonic(config user emp guest)# exit \<font color="#1d50a2">step 3 user group profiles (department isolation)\</font> here we define the bandwidth limits for each department \<font color="#5fd74e">#group 1 r\&d department\</font> \<font color="#5fd74e">#r\&d group limit 100 mbps (12,500,000 bytes/s) \#r\&d user limit 50 mbps (6,250,000 bytes/s)\</font> sonic(config)# hqos user group profile rd dept sonic(config group rd dept)# user profile emp standard shaping pir 6250000 pbs 1000000 sonic(config group rd dept)# exit \<font color="#5fd74e">#group 2 guest zone \#guest group limit 25 mbps (3,125,000 bytes/s)\</font> sonic(config)# hqos user group profile guest zone sonic(config group guest zone)# user profile emp guest shaping pir 3125000 pbs 1000000 sonic(config group guest zone)# exit note pir is in bytes/sec pbs is in bytes we set pbs to 1mb to ensure smooth tcp performance \<font color="#1d50a2">step 4 port profile (global level)\</font> define the physical port limit and attach the department groups sonic(config)# hqos profile wan policy \<font color="#5fd74e">#global port rate\</font> sonic(config hqos wan policy)# global rate 125000000 \<font color="#5fd74e">#attach r\&d group (limit 100 mbps)\</font> sonic(config hqos wan policy)# user group profile rd dept shaping pir 12500000 pbs 1000000 \<font color="#5fd74e">#attach guest group (limit 25 mbps)\</font> sonic(config hqos wan policy)# user group profile guest zone shaping pir 3125000 pbs 1000000 sonic(config hqos wan policy)# exit \<font color="#5fd74e">#enable hqos globally\</font> sonic(config)# hqos enable \<font color="#1d50a2">classification \& application\</font> now we map the subnets to the correct profiles and apply them to interfaces \<font color="#1d50a2">step 1 classification (acl)\</font> identify traffic from the lan subnets and mark them with the correct user profile sonic(config)# access list l3 download class ingress \<font color="#5fd74e">#rule 1 map 10 10 10 x (port 2) to r\&d user\</font> sonic(config l3 acl download class)# rule 1 src ip 10 10 10 0/24 packet action permit set hqos user emp standard \<font color="#5fd74e">#rule 2 map 10 20 20 x (port 3) to guest user\</font> sonic(config l3 acl download class)# rule 2 src ip 10 20 20 0/24 packet action permit set hqos user emp guest sonic(config l3 acl download class)# exit \<font color="#1d50a2">step 2 interface binding\</font> apply the configuration to the physical ports \<font color="#5fd74e">#wan interface\</font> sonic(config)# interface ethernet 1 sonic(config if 1)# hqos profile wan policy sonic(config if 1)# exit \<font color="#5fd74e">#lan interface 1 (port 2 r\&d)\</font> sonic(config)# interface ethernet 2 sonic(config if 2)# qos map bind dscp to tc voice prio \<font color="#5fd74e">#apply acl\</font> sonic(config if 2)# acl download class priority 10 sonic(config if 2)# exit \<font color="#5fd74e">#lan interface 2 (port 3 guest)\</font> sonic(config)# interface ethernet 3 \<font color="#5fd74e">#apply acl\</font> sonic(config if 3)# acl download class priority 10 sonic(config if 3)# exit \<font color="#1d50a2">verification scenario 1 inter department isolation\</font> this test validates the "firewall" between departments we demonstrate that even when the guest zone attempts to saturate the network with excessive traffic (dos simulation), the r\&d department remains completely unaffected \<font color="#1d50a2">test setup\</font> bottleneck none at the port level (1 gbps), but strict shaping at the group level victim (guest zone) configured with a hard cap of 25 mbps observer (r\&d dept) configured with a guaranteed 100 mbps attack scenario the guest pc attempts to blast 100 mbps of traffic while r\&d is transferring critical data at 40 mbps \<font color="#1d50a2">validation command\</font> we execute these commands simultaneously on two different terminals (representing port 3 and port 2) \# terminal a (guest port 3) attempt to use 100m iperf3 c \<server ip> p 5202 u b 100m t 20 \# terminal b (r\&d port 2) normal usage 40m iperf3 c \<server ip> p 5201 u b 40m t 20 \<font color="#1d50a2">observed result \</font> the screenshots below illustrate perfect isolation the guest (suppressed) as shown in the first screenshot, despite requesting 100 mbps, the guest traffic is ruthlessly throttled by the hqos group shaper throughput flatlines at 23 4 mbps (effective payload for a 25m shaper) packet loss high loss ( 77% ) confirms that excess traffic is dropped at the ingress, preventing it from consuming shared resources the r\&d department (unaffected) simultaneously, the r\&d traffic flows without interruption throughput maintains a rock solid 40 0 mbps packet loss 0% the congestion in the guest zone does not bleed over into the r\&d zone \<font color="#1d50a2">verification scenario 2 service assurance (r\&d internal)\</font> to verify the hqos logic within the r\&d department, we simulate a congestion scenario where the total traffic demand exceeds the configured user shaper bandwidth \<font color="#1d50a2">test setup\</font> bottleneck r\&d user profile limited to 50 mbps (pir) traffic a (vip voice) 30 mbps stream (dscp 46, queue 7, strict priority) traffic b (bulk data) 40 mbps stream (dscp 0, queue 0, dwrr) total demand 70 mbps > 50 mbps ( congestion triggered! ) \<font color="#1d50a2">validation command\</font> we initiate the bulk data stream first to saturate the link, then inject the voice stream to observe pre emption \# terminal 1 bulk data (target port 5201) iperf3 c \<server ip> p 5201 u b 40m dscp 0 t 30 \# terminal 2 voice (target port 5202) the "vip" \# start this 10 seconds after terminal 1 iperf3 c \<server ip> p 5202 u b 30m dscp 46 t 10 \<font color="#1d50a2">observed result \</font> as shown in the screenshot below, the hqos scheduler exhibits textbook strict priority behavior phase 1 (0s 9s) the bulk data stream (dscp 0) runs alone, utilizing 40 mbps with 0% packet loss phase 2 (congestion) as soon as the voice stream (dscp 46) starts, it instantly claims its required 30 mbps the squeeze the bulk data stream is immediately throttled down math 50 mbps (total) 30 mbps (vip)= 20 mbps (remaining) actual the iperf3 output shows the bulk stream stabilizing at 17 8 mbps note the difference between 20 mbps (physical) and 17 8 mbps (throughput) is due to ethernet/ip/udp header overheads phase 3 (recovery) once the voice stream stops, the bulk data stream immediately recovers to full capacity \<font color="#1d50a2">conclusion\</font> this guide has successfully demonstrated the implementation of a 4 level hierarchical quality of service (hqos) architecture on the asterfusion et2500 gateway it verifies the comprehensive qos capabilities of asternos, enabling granular traffic management from basic port limits to complex flow based and elastic bandwidth strategies this validated configuration transforms the gateway into a powerful, service aware edge device capable of enforcing complex service level agreements (slas) in multi tenant environments
