Deprecating old QoS APIs
A while back I wrote about the fundamentals of networking Quality of Service (QoS) including 802.1p and DSCP. Gabe recently wrote about WMM. With Vista soon to hit the market, it's time for us to talk about the new and old QoS APIs. Let's start with the old ones.
The idea of networking Quality of Service in Windows has been around for a long time. If you look at the APIs in Windows 2000 and Windows XP, you'll find at least 3 APIs for QoS. We reviewed each of them and decided to deprecate them. What this means is that, some time in the future, each of these APIs will be removed from Windows. Until they're removed though, backwards compatibility remains important. Therefore, although all of these APIs have been changed to some extent in Vista, we made sure to NOT break any dependencies applications might have on header files, libraries or DLLs. Here's what we did:
- IP_TOS
When I wrote about DSCP, I mentioned that the RFC which defined Type Of Service (TOS) in IP, RFC 1349, is now obsolete. Back in XP we had disabled the Winsock IP_TOS option. If you used this socket option, the call would succeed but be ignored silently. You could re-enable it through a registry value. In Vista, this registry mechanism has been removed: Winsock IP_TOS option is no longer available. The call will always be ignored silently. Why silently? Because otherwise we would have had to return an error. This would have broken legacy applications. To get DSCP marking, you should use the QOS2 API. - Generic Quality of Service (GQoS)
The feedback we received from developers was GQoS, with token bucket semantics, is too hard to use - especially if you are not certain what the network traffic characteristics of your application look like. If you were using this API, we encourage you to switch to the new, much simpler, QOS2 API which you can find in QOS2.h. In the meantime, the old QOS.h header file has been updated with a warning. - Traffic Control (TC)
If you've ever looked at the TC API, you might have noticed two things:- It uses filters to identify outgoing traffic of interest. Compare this to the GQoS or QOS2 APIs which are built around sockets. When a packet travels down the networking stack, the QoS subsystem knows immediately whether or not the packet is part of a flow since each flow is affiliated to a specific socket. When TC is used, every packet needs to first be classified. This adds needless CPU overhead to many networking scenarios.
- You need to be an admin to use the TC API. As you've probably heard, Vista has a new security model for user accounts. Should your application really have to run under administrative credentials to shape its outgoing traffic?
Overall, with QOS2 and Policy-based QoS, the TC API is no longer the right API to program to for your scenarios. Again, to maintain backwards compatibility, we kept this API in Vista. However, every one of its functions has been marked deprecated in the header file. If need be, with some work you can still compile against this API, and of course, the DLL will remain to ensure application compatibility.
Deprecating an API and its technology is never an easy decision. When we reviewed why and how people were using these APIs, we found that the new QOS2 API could always be used instead much more easily. If the new API doesn't meet your needs, please email us a description of your scenario and what you'd like this new platform API to do.
- Mathias Jourdain
Comments
- Anonymous
July 19, 2006
If I understand this correctly, you are depricating the TC API. However, the QOS2 API seems to be, just like GQoS, a socket layer API. GQoS was based on TC API internally, correct? So my question: is there, or will there be, an API similar to TC which allows me to apply (lower layer) QoS setting to flows based on packet filters as opposed to sockets?
Thanks,
-Dan - Anonymous
August 11, 2006
Great question Dan!
In Vista, we focused on providing a more rich TC-like feature set for non-developers. This feature is called Policy-Based QoS, and allows Group Policies to be set for applying marking/throttling based on application name, socket 5-tuple (like TC), username, group, etc. Check out my post on using policy-based QoS for WMM for more details.
That said, Vista does not provide a new administrative API replacement for TC (hence why we did not remove it yet). We are starting planning for the next Windows release, and one of the features on our plate is a more friendly TC replacement. I'd love to hear your thoughts, needs, and suggestions on such an API. This goes out to everyone, if you have scenarios that existing APIs do not enable, or you don't like the way existing APIs work, please let me know.
- Gabe