Skip to main content
TechNet

The Cable GuyQoS Support in Windows

Joseph Davies


This article is based in part on a prerelease version of Windows Server 2008. All information herein is subject to change.


Quality of Service (QoS) encompasses a set of technologies for managing network traffic in a cost-effective manner to enhance user experiences in home and enterprise environments. QoS technologies allow you to measure bandwidth, detect changing network conditions (such as congestion or availability of bandwidth),
and prioritize or throttle traffic. For example, QoS can be applied to prioritize the delivery of latency-sensitive traffic (such as voice or video applications) and to control the impact of latency-insensitive traffic such as bulk data transfers. Providing prioritized delivery for TCP/IP traffic requires support from hosts and network infrastructure devices. This column describes the methods for using QoS with Microsoft® Windows®-based hosts.
The central problem of defining QoS for TCP/IP networks is how to specify and provide for prioritized delivery of IP traffic. Although the original RFC 791 for IP defined the Type of Service (TOS) field with the ability to specify precedence, delay, throughput, reliability, and cost characteristics, IP is fundamentally a best-effort, datagram-based packet-switching technology that typically treats each packet the same and on a first-come, first-served basis.


Configuring Prioritized Delivery
To provide prioritized delivery service, there are a few things you can do. You can configure the network infrastructure to provide special handling for marked traffic, and then have the sending hosts mark their outgoing traffic. Alternatively, you can have the sending hosts dynamically program the network infrastructure to provide special handling based on the characteristics of their outgoing traffic (such as addresses and port numbers).
For TCP/IP traffic, you can use a few different methods to provide prioritized delivery. For example, at the Network Interface layer for Ethernet, IEEE 802.1p tagging will mark frames sent by a host for prioritized delivery using a 3-bit Priority field in the virtual local area network (VLAN) header of the Ethernet frame. The VLAN header is placed inside the Ethernet header, between the Source Address field and either the Length field (for an IEEE 802.3 frame) or the EtherType field (for an Ethernet II frame).
Implementing 802.1p tagging on a sending host requires that the network adapter and device driver support 802.1p and that the network adapter has 802.1p support enabled. You can typically enable 802.1p support on the Advanced tab from the properties of a network adapter driver. Ethernet switches also must have 802.1p support enabled.
At the Network Interface layer for IEEE 802.11 wireless, the Wi-Fi Alliance certification for Wi-Fi Multimedia (WMM) defines four access categories for prioritizing network traffic. These access categories are (in order of highest to lowest priority) voice, video, best-effort, and background. Host support for WMM prioritization requires that both wireless network adapters and their drivers support WMM. Wireless access points (APs) must have WMM enabled.
At the Internet layer, you can use Differentiated Services and set the value of the Differentiated Services Code Point (DSCP) in the IP header. As defined in RFC 2472, the DSCP value is the high-order 6 bits of the IP version 4 (IPv4) TOS field and the IP version 6 (IPv6) Traffic Class field.
Most modern enterprise routers support DSCP traffic differentiation, but it is typically disabled by default. During forwarding, DSCP-capable routers read the DSCP value and place the packet into a specific queue. For example, you can configure your routers to place forwarded packets into high priority, best-effort, or lower than best-effort queues based on DSCP values you define. By configuring queues and DSCP values, DSCP-marked traffic can have differentiated levels of service. For example, mission-critical network traffic gets forwarding preference and is not delayed by other lower-priority bulk data traffic. The WMM specification defines how the WMM access categories map to DSCP values. A WMM-capable wireless AP reads the DSCP value and handles the traffic based on its access category.
At the Internet layer, you can also use the Resource Reservation Protocol (RSVP), a signaling protocol defined in RFC 2205. Hosts can use this protocol to attempt to reserve bandwidth across a network to an endpoint. RSVP is not widely deployed on networks, however, and is not currently supported in Windows XP, Windows Server® 2003, Windows Vista™, or Windows Server 2008.
To send packets marked for prioritized delivery, applications or operating system components must be able to specify the values of either the 802.1p priority or the DSCP value. The following sections describe how Windows components or Windows-based applications can specify the 802.1p priority for Ethernet frames or the DSCP value for TCP/IP traffic.


QoS in Windows XP and Windows Server 2003
Windows XP and Windows Server 2003 provide APIs for assigning QoS parameters to traffic. Application developers can use the Windows Sockets (Winsock) and Generic QoS (GQoS) APIs to apply QoS parameters at the application level on a per-socket basis. Network administrators can use traffic management tools written to call the Traffic Control (TC) API to apply QoS parameters at the host level.
You can use Winsock and the IP_TOS socket option to set the DSCP value for outgoing packets for a socket. However, by default the TCP/IP stack ignores the IP_TOS socket option. To use the IP_TOS socket option, you must first create and set the DWORD registry value DisableUserTOSSetting=0 under the following registry key (see Figure 1):
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

Figure 1 Setting the Registry Value of DisableUserTOSSetting 
You must restart the computer for this registry setting to take effect.
To specify the DSCP value for traffic without having to use the IP_TOS socket option, you can use the GQoS APIs. GQoS is part of Windows Sockets 2.0 (Winsock2). Most QoS-enabled applications use the GQoS API to invoke QoS capabilities in Windows. GQoS in Windows XP Service Pack 2 (SP2) allows an application to set a DSCP value and throttle its outbound traffic. To set 802.1p priorities on computers running Windows XP SP2, you must use the TC API.
The TC API provides access to traffic control mechanisms that regulate network traffic on the local host. It allows direct control over DSCP values, 802.1p tags, and throttle rate. Network administrators can use traffic management programs to invoke the TC API directly on behalf of applications that are not QoS-aware. Because it is a lower-level API than the GQoS API, the TC API requires administrator-level privileges.
Unlike the GQoS API, the TC API allows traffic from multiple applications on the same sending host to be aggregated into a single QoS flow. As part of this aggregation, traffic can be identified by a combination of its source and destination IP addresses, source and destination ports, and protocol (TCP or UDP). For example, all of the traffic to a specific destination IP address can be included in a single QoS flow for any source port and destination port, regardless of the sending application on the host. The GQoS API, on the other hand, allows an application to define its own QoS treatment on the data that it sends over a socket.
To support QoS capability, Windows XP and Windows Server 2003-based computers must have the QoS Packet Scheduler component installed and enabled from the properties of network connections in the Network Connections folder (see Figure 2). The QoS Packet Scheduler component (Psched.sys) is installed and enabled by default for computers running Windows XP. The Packet Scheduler component can be installed on Windows Server 2003.

Figure 2 Configuring the QoS Packet Scheduler 


QoS in Windows Vista and Windows Server 2008
QoS support in Windows Vista and Windows Server 2008 has been both enhanced and simplified. For IT staff, it is now possible to use Policy-based QoS to set DSCP values and control application sending rates without having to use APIs or modify existing applications. For developers, the GQoS and TC APIs are supported, though support for these APIs is not planned for future versions of Windows. Additionally, the IP_TOS Winsock option has been removed. To replace the GQoS and TC APIs and simplify QoS support in upgraded or future applications, Windows Vista and Windows Server 2008 support the new QoS2 API, also known as Quality Windows Audio-Video Experience (qWAVE).
Policy-based QoS in Windows Server 2008 and Windows Vista allows you to offer better end-user experiences, control bandwidth costs, or negotiate finer service levels with bandwidth providers or business departments. You can centrally manage the network bandwidth of computers running Windows Vista or Windows Server 2008, regardless of the application and across an entire Active Directory® infrastructure. Because the traffic management is occurring below the application layer, existing applications do not need to be modified for Policy-based QoS traffic management.

Policy-based QoS settings in Windows Server 2008 and Windows Vista allow you to prioritize or manage the sending rate for outgoing traffic based on the following conditions:

  • Sending application (executable path and name)
  • Source or destination IPv4 or IPv6 addresses or address prefixes
  • Protocol (TCP, UDP, or both)
  • Source or destination ports or port ranges (TCP or UDP)
QoS policies are applied to a user login session or a computer as part of a Group Policy object (GPO) that is linked to an Active Directory container such as a domain, site, or organizational unit (OU), or they may be applied to a security group. As part of Group Policy, QoS policies build on your existing Active Directory management infrastructure.
Policy-based QoS allows you to define the priority of traffic. You can configure a QoS policy to mark outbound IPv4 or IPv6 traffic with a specific DSCP value. You can also manage the use of bandwidth for outbound traffic. You can configure a QoS policy with a throttle rate for outbound traffic. With throttling, the QoS components limit the aggregate outgoing network traffic to a specified rate. For computers, you can manage the use of bandwidth for inbound traffic, configuring advanced settings to specify inbound throughput for TCP traffic by setting a maximum value for the TCP receive window size.
In Windows Vista and Windows Server 2008, the QoS Packet Scheduler is installed and enabled by default. The Pacer.sys component is a new Network Device Interface Specification (NDIS) 6.0 lightweight filter driver that controls packet scheduling for Policy-based QoS and for the traffic of QoS-enabled applications. Pacer.sys replaces Psched.sys in Windows XP and Windows Server 2003.
To deploy Policy-based QoS on your intranet, configure user or computer-based QoS policies and apply them to the appropriate Active Directory container. Windows Vista or Windows Server 2008-based computers download and apply their Policy-based QoS settings when they update User Configuration or Computer Configuration Group Policy.
Because networks are increasingly being shared by both data and audio/video (AV) applications, a QoS solution is needed so that time-dependent AV traffic can be given preferential treatment over data traffic. Additionally, networks are increasingly becoming wireless, which introduces additional complications for latency and bandwidth-sensitive applications.
The qWAVE feature in Windows Vista provides a collection of QoS-related software modules that address the network challenges introduced by AV applications and wireless networks. qWAVE is integrated into the QoS subsystem and works with multiple Internet and Network Interface layer packet priority technologies. qWAVE supports multiple AV streams (real-time flows requiring QoS) and data streams (best-effort flows, such as e-mail or file transfers) simultaneously.
The collection of qWAVE technologies detect and monitor LAN bandwidth, discover the QoS capability of the network, and provide distributed admission control for fair and consistent usage of network bandwidth. These technologies enable advanced AV streaming techniques so that applications can dynamically adapt to changing network conditions, and are only available to developers through the QoS2 API.
The QoS2 API in Windows Vista and Windows Server 2008 replaces the GQoS API and IP_TOS Winsock option and you should find it easier to use than the GQoS API.


For More Information
To learn more about QoS, there are a number of excellent sources available through TechNet. Start with the Microsoft Quality of Service Web site. Also check out the QoS section of the Windows Core Networking blog.


Joseph Davies is a technical writer with Microsoft and has been teaching and writing about Windows networking topics since 1992. He has written eight books for Microsoft Press® and is the author of the monthly TechNet Cable Guy column.

© 2008 Microsoft Corporation and CMP Media, LLC. All rights reserved; reproduction in part or in whole without permission is prohibited.