Quality of Service Policies
Complete the full lesson to earn 25 points
Work through each section, then tap “Mark as Complete” on the last one.
✦ Skip the page breaks and see fewer ads — read each lesson on a single page with Pro
Networking for Azure Virtual Desktop: Mastering Quality of Service (QoS) Policies
Introduction: Why QoS Matters in Virtual Environments
When you deploy Azure Virtual Desktop (AVD), you are essentially moving the user's desktop experience from a local machine to a remote virtual machine (VM) running in a data center. Unlike local applications, which have immediate access to hardware resources, AVD relies entirely on the network to transport screen updates, mouse movements, keyboard input, and audio/video streams between the user and the virtual desktop. If the network becomes congested, the user experience degrades rapidly. You might notice choppy audio, laggy mouse input, or blurred video, all of which contribute to user frustration and reduced productivity.
Quality of Service (QoS) is the set of technologies and policies used to manage network traffic in a way that ensures critical data gets the priority it needs to function correctly. In the context of AVD, QoS allows you to "tag" traffic generated by the Remote Desktop Protocol (RDP) and ensure it is treated preferentially by your network infrastructure compared to less time-sensitive traffic, such as background file downloads or software updates. Without a thoughtful QoS strategy, your high-priority real-time traffic is forced to compete on a "first-come, first-served" basis with every other packet on your network, leading to unpredictable performance.
This lesson explores how to plan, configure, and implement QoS policies for AVD. We will look at how traffic prioritization works, how to identify RDP packets, and how to apply these policies across both your local office network and the Azure environment. By the end of this guide, you will have the knowledge required to create a predictable and responsive environment for your end users, regardless of network load.
Understanding the Fundamentals of Traffic Prioritization
At its core, QoS is about traffic classification and marking. When a packet enters a network device, the device needs a way to decide which packets should be sent first and which can wait. This is typically achieved using Differentiated Services Code Point (DSCP) values. DSCP is a 6-bit field in the IP header of a packet that tells routers and switches exactly how to treat that specific packet.
By tagging RDP traffic with a specific DSCP value, you provide an instruction to every network device that touches that packet. For example, if you set your RDP traffic to a DSCP value of 46 (often referred to as Expedited Forwarding or EF), your network equipment can be configured to place those packets into a high-priority queue. This queue is serviced more frequently than the default queue, ensuring that the latency-sensitive RDP traffic reaches its destination as quickly as possible.
The Role of Latency, Jitter, and Packet Loss
To understand why QoS is essential, we must define the three "enemies" of a smooth virtual desktop experience:
- Latency: This is the time it takes for a packet to travel from the user to the virtual machine and back. High latency manifests as "mushy" mouse movement or a delay between typing a key and seeing the character appear on the screen.
- Jitter: This is the variation in latency over time. If your packets arrive at inconsistent intervals, the RDP client has to buffer the stream, which causes audio to stutter or video to become jerky.
- Packet Loss: If data is lost in transit, the RDP protocol must request a retransmission. This creates a noticeable "freeze" in the user interface.
QoS policies help mitigate these issues by ensuring that RDP packets are not dropped or delayed during periods of network congestion. While QoS cannot fix a fundamentally broken network, it ensures that your most important traffic is the last to be affected when bandwidth becomes scarce.
Callout: The Difference Between Bandwidth and QoS A common misconception is that increasing bandwidth solves all network issues. While having a large pipe is helpful, it does not guarantee that your traffic will be prioritized. Think of bandwidth as the width of a highway and QoS as a dedicated emergency lane. Even on a very wide highway, traffic jams happen; QoS ensures that your critical RDP traffic always has a clear path, regardless of how many other "cars" are on the road.
Identifying RDP Traffic for QoS
Before you can implement a policy, you must be able to identify the traffic you want to prioritize. AVD uses the RDP protocol, which operates primarily over TCP and UDP. Modern RDP clients and gateways prefer UDP (specifically via the RDP Shortpath or standard RDP transport) because it handles packet loss better than TCP for real-time streams.
Microsoft recommends specific DSCP markings for different types of traffic within the RDP stream:
- Real-time transport (Audio/Video): Typically marked with DSCP 46 (Expedited Forwarding).
- Interactive traffic (Mouse/Keyboard/Screen updates): Typically marked with DSCP 34 (Assured Forwarding 41).
To apply these, you need to configure your Group Policy Objects (GPOs) on the AVD session hosts to mark the outgoing packets. This ensures that every packet originating from the desktop carries the "priority tag" from the moment it leaves the virtual machine.
Step-by-Step: Configuring GPO for QoS Marking
- Open Group Policy Management: On your domain controller or management workstation, open the Group Policy Management Console.
- Create a New GPO: Create a new GPO and link it to the Organizational Unit (OU) containing your AVD session host virtual machines.
- Navigate to Policy Settings: Go to
Computer Configuration->Policies->Windows Settings->Policy-based QoS. - Create a New Policy: Right-click and select "Create new policy."
- Define the Policy:
- Name: Give it a descriptive name like "AVD-RDP-Priority."
- DSCP Value: Enter 46 for high-priority streams.
- Application Name: Specify
svchost.exeor leave it as "All applications" (though specifying the process name is safer to avoid tagging unrelated traffic). - Source IP/Destination: You can leave these as "Any" to ensure all RDP traffic is tagged, regardless of destination.
- Apply and Update: Once the GPO is saved, ensure the session hosts refresh their policies by running
gpupdate /forceor waiting for the next background refresh cycle.
Note: Applying QoS policies via GPO only marks the traffic. Your network switches, routers, and firewalls must be configured to honor these markings. If your network hardware is set to ignore DSCP tags, the policy will have no effect.
Implementing QoS Across the Network Infrastructure
Once your session hosts are tagging traffic, the focus shifts to the infrastructure. You need to ensure that your internal switches, corporate firewalls, and WAN optimizers are configured to respect these tags. This process is known as "Trusting the DSCP markings."
Configuring Network Devices
Most enterprise-grade switches (Cisco, Aruba, Juniper, etc.) operate in a mode where they strip DSCP tags by default for security reasons. You must explicitly configure your ports to "trust" the incoming packets.
- Access Ports: If a user is connecting from a local office, the switch port they are plugged into must be set to trust the DSCP markings coming from their machine.
- Core Switches: These devices should be configured with a "Priority Queue" or "Strict Priority" scheduler. This ensures that any packet with a DSCP value of 46 is moved to the front of the line.
- Firewalls: Ensure your firewall rules allow the RDP traffic and, more importantly, do not overwrite the DSCP field. Some firewalls perform "traffic shaping" that can inadvertently reset DSCP values to 0.
Practical Example: Cisco Switch Configuration
If you are using a Cisco switch, you would typically use the following logic to trust the traffic:
! Enter interface configuration mode
interface GigabitEthernet0/1
! Trust the DSCP markings from the connected device
mls qos trust dscp
! Define the priority queue for DSCP 46
priority-queue out
Explanation: The mls qos trust dscp command tells the switch to look at the 6-bit DSCP field in the IP header and use that value to determine the internal priority of the packet. The priority-queue out command ensures that if the egress port is congested, packets in the priority queue are sent before packets in the standard queues.
QoS in the Azure Environment
One of the most common questions regarding AVD networking is: "How do I implement QoS within Azure itself?" The answer is nuanced. Azure's internal software-defined network (SDN) does not allow you to configure custom QoS queues in the same way you would with physical hardware. Microsoft manages the Azure backbone, and they optimize it for performance automatically.
However, you still have control over how your traffic leaves your Azure Virtual Network (VNet). If you use a Network Virtual Appliance (NVA) or a VPN gateway to route traffic back to your on-premises office, you must ensure that your transit configuration supports DSCP.
Best Practices for Azure-to-Office Connectivity
- ExpressRoute: If you use ExpressRoute, you can take advantage of the "QoS for ExpressRoute" feature. This allows you to tag traffic in your virtual network, and those tags are honored by the ExpressRoute circuit, ensuring priority across the private connection to your office.
- VPN Gateways: Standard Site-to-Site VPNs often strip DSCP tags. If you require strict QoS, verify if your VPN gateway supports "DSCP Preservation."
- Azure Front Door/Traffic Manager: These services handle traffic at the application layer and generally do not pass through DSCP tags from the underlying RDP stream. QoS in these scenarios is managed by the service provider's internal routing.
Warning: Do not attempt to over-engineer QoS in Azure by trying to implement custom traffic-shaping software inside the VMs. This often leads to "double-shaping," where the software inside the VM and the Azure fabric compete to manage the same packets, resulting in severe performance degradation.
Common Pitfalls and How to Avoid Them
Even with a solid plan, many administrators run into issues when implementing QoS. Let’s look at the most frequent mistakes.
1. Inconsistent End-to-End Configuration
The most common mistake is configuring QoS on the session host but failing to configure it on the intermediate switches and routers. QoS is an end-to-end concept. If your session host marks a packet, but your core switch ignores that mark, the traffic will be treated as "best effort," effectively negating your work.
2. Over-Prioritizing Traffic
It is tempting to put every type of traffic into the high-priority queue. However, if you mark too much traffic as "High Priority," you end up with a high-priority queue that is just as congested as the standard queue. Only mark traffic that is truly latency-sensitive (RDP, voice, video) as high priority.
3. Ignoring MTU Issues
QoS tagging adds a tiny amount of overhead to packets, and sometimes the way a network device handles tagged packets can lead to fragmentation if the Maximum Transmission Unit (MTU) isn't set correctly. Ensure your network path supports a standard MTU of 1500 bytes, and be aware that some tunneling protocols (like GRE or IPsec) might require you to lower the MTU to avoid fragmentation.
4. Forgetting About the Return Path
Administrators often focus on the traffic moving from the VM to the user. However, the traffic moving from the user's keyboard and mouse back to the VM is equally important. If your return path is congested, the user will experience lag. Ensure your QoS policy is symmetric—apply it to both the session host and the client-side network equipment.
Comparison: QoS Strategies
To help you decide how to approach your deployment, refer to the following comparison of common network environments.
| Environment | QoS Implementation Method | Effectiveness |
|---|---|---|
| Pure Cloud (All Azure) | Azure Internal Fabric (Automatic) | High (Optimized by MS) |
| Hybrid (VPN to Office) | GPO Marking + VPN Preservation | Moderate (Depends on VPN) |
| Hybrid (ExpressRoute) | GPO Marking + ExpressRoute QoS | Very High |
| Local/On-Prem AVD | GPO Marking + Switch/Router Config | High |
Step-by-Step: Validating Your QoS Implementation
After configuring your policies, you must verify that they are working as expected. Do not assume that because the GPO is applied, the traffic is being prioritized.
- Use a Packet Capture Tool: Use Wireshark on the session host. Start a capture while initiating an RDP session.
- Filter for RDP Traffic: Use the display filter
rdpor filter by the specific IP of your client. - Inspect the IP Header: Select an RDP packet and expand the "Internet Protocol Version 4" section. Look for the "Differentiated Services Field."
- Verify the Value: Check if the DSCP value matches the one you set in your GPO (e.g., 46).
- Test the Network Path: If possible, perform a packet capture at the destination (or a mid-point switch) to confirm the tag is still present. If the tag is 0 at the destination, it is being stripped somewhere along the path.
Tip: If you cannot perform a packet capture at every hop, use a tool like
iperfto simulate RDP-like traffic. You can manually set the DSCP tag on theiperfclient and observe how the network handles that traffic compared to standard traffic.
Best Practices for Long-Term Maintenance
QoS is not a "set it and forget it" task. As your network grows and your user base expands, your requirements will change. Follow these best practices to ensure your policies remain effective:
- Regular Audits: Conduct quarterly reviews of your network performance. If users report sluggishness, check the interface statistics on your switches to see if the priority queues are dropping packets.
- Documentation: Maintain a clear diagram of your network path, including which devices are responsible for honoring DSCP tags. When you upgrade hardware, ensure the new devices are configured to replicate the QoS settings of the old ones.
- Capacity Planning: QoS is a tool to manage congestion, not a replacement for sufficient bandwidth. If your priority queues are consistently full, it is a clear indicator that you need to increase your total network capacity.
- Test Before Deployment: Always apply QoS changes to a small group of pilot users first. Monitor their performance and check for any unexpected side effects on other applications before rolling the policy out to the entire organization.
Frequently Asked Questions (FAQ)
Q: Does QoS consume extra bandwidth? A: No, QoS does not increase the amount of data being sent; it only changes the order in which packets are processed.
Q: Can I use QoS for non-RDP traffic? A: Yes, but be careful. Prioritizing too many things will negate the benefits. Stick to real-time protocols like RDP, VoIP, and video conferencing.
Q: Why is my DSCP tag being stripped? A: This is usually caused by a firewall or a switch configured to "reset" the DSCP field to 0 for security or policy reasons. Check your "Trust" settings on all intermediate devices.
Q: Is there a way to automate QoS in Azure? A: Azure handles the internal backbone automatically. For your own resources, use infrastructure-as-code (like Terraform or Bicep) to ensure that your network gateway configurations are consistent across all environments.
Q: What if I have multiple AVD workspaces? A: You can use different DSCP tags for different workspaces if you need to prioritize one group of users (e.g., executives) over another, but this adds significant complexity to your network configuration. It is generally better to treat all AVD traffic with the same high priority.
Key Takeaways
As we conclude this lesson on QoS for AVD, keep these essential points in mind to ensure your infrastructure remains responsive and reliable:
- Prioritization requires visibility: You must identify RDP traffic using DSCP markings. Without these markings, your network devices cannot distinguish between a high-priority screen update and a low-priority background file transfer.
- End-to-end consistency is non-negotiable: A QoS policy is only as strong as its weakest link. If one switch in the path strips your DSCP tags, the entire strategy fails. Always verify the configuration of every hop.
- Use the right tools for validation: Never assume a policy is working. Use packet capture tools like Wireshark to inspect the actual DSCP values on the wire and confirm they persist from source to destination.
- Prioritize judiciously: Do not mark everything as high priority. If you treat everything as important, nothing is important. Focus your QoS efforts on RDP, voice, and video traffic.
- QoS is a management tool, not a bandwidth solution: If your network is consistently saturated, QoS will only delay the inevitable performance degradation. Ensure you have the raw bandwidth required to handle your peak user load.
- Understand the Azure distinction: Azure handles internal prioritization for you. Focus your QoS efforts on the "last mile" connectivity, such as your VPN, ExpressRoute, or local office network, where you have full control over the infrastructure.
- Monitor and adapt: Network needs evolve. Regularly review your traffic patterns and update your QoS policies to ensure they align with the current demands of your organization.
By implementing these strategies, you move from a reactive state—where you are constantly troubleshooting performance issues—to a proactive state where your infrastructure is tuned to provide the best possible experience for your virtual desktop users. This is the hallmark of a well-managed AVD environment.
Enjoying the courses?
Everything stays free. Pro shows fewer ads, doubles your daily points limit so you progress twice as fast, and lets you read each lesson on one page.
- ✓ Fewer advertisements
- ✓ 2× daily points limit
- ✓ Distraction-free lessons