Fixed DevStudio 2003 build with memory check code.
[pwlib.git] / ReadMe_QOS.txt
blob910a83207af405bb51eaf8cd015c271458ee9d11
1  README
2 ==========
3 ==========
6 This document explains the revised QOS implementation for PTLIB and openh323.
8 ============
9 Update 25.4.05:
10 802.1p/q is now supported natively however is disabled 
11 To enable set the Static PUDPSocket::disableQoS = FALSE;
13 QoS support is now negotiated between the calling parties
14 and will only functions when both parties have.
15 1. Enabled QoS within Openh323 (as above)
16 2. Window XP OS
17 3. Managed NIC with 802.1p enabled.(May have to Set Manually)
19 ============
21 Contents:
23 1) Setting a QOS specification in openh323
24 2) Diffserv support
25 3) 802.1Q support
26 4) Windows 2000 issues
27 5) Windows XP and Server 2003 issues
29 1) Setting a QOS specification in openh323
30 ==========================================
32 The basic approach is as follows:
34 ****
36 RTP_QOS * rtpqos = new RTP_QOS;
37 rtpqos->dataQoS.SetWinServiceType(DWORD winServiceType);
38 rtpqos->dataQoS.SetAvgBytesPerSec(DWORD avgBytesPerSec);
39 rtpqos->dataQoS.SetMaxFrameBytes(DWORD maxFrameBytes);
40 rtpqos->dataQoS.SetPeakBytesPerSec(DWORD peakBytesPerSec);
41 rtpqos->dataQoS.SetDSCP(int DSCPvalue);
43 [If desired:
44 rtpqos->controlQoS.SetWinServiceType(...)
45 etc.]
47 H323Capability * cap = new xxxxx;
48 cap->AttachQoS(rtpqos);
50 SetCapability(....);
52 ****
54 Notes:
56 i) winServiceType is either SERVICETYPE_GUARANTEED,
57 SERVICETYPE_CONTROLLEDLOAD, SERVICETYPE_BESTEFFORT, or
58 SERVICETYPE_PNOTSPECIFIED
60 ii) for Windows XP or Windows Server 2003, if setting aaaaa as
61 SERVICETYPE_GUARANTEED or SERVICETYPE_CONTROLLEDLOAD then avgBytesPerSec,
62 maxFrameBytes, and peakBytesPerSec MUST be set to appropriate values
64 iii) Calling SetDSCP(DSCPvalue) has no effect on Windows XP or Windows Server
65 2003 but on other platforms (earlier versions of Windows, and Linux) it will
66 set the DSCP directly. SetDSCP(-1) clears the effect of any previous call to
67 SetDSCP()
69 iv) on platforms other than WinXP or Windows Server 2003, if SetDSCP(...) is
70 not called but SetWinServiceType(...) is, then an appropriate DSCP
71 substitution will be made. The substitutions can be changed globally by
72 calling PQoS::SetDSCPAlternative(DWORD winServiceType, UINT DSCP)
74 v) if an RTP_QOS is not attached to a capability, the
75 H323Endpoint::rtpIpTypeofService will be used to set IP_TOS but this has no
76 effect on WinXP or Windows Server 2003 (and see below for notes relating to
77 Windows 2000)
80 2) Diffserv support
81 ===================
83 Setting of DSCP on packets is supported for most Windows and Linux platforms.
84 The mechanism is platform-dependent:
86 Windows XP and Windows Server 2003:
87 -----------------------------------
89 Based on the parameters passed to PQoS::SetWinServiceType(...),
90 PQoS::SetAvgBytesPerSec(...), PQoS::SetMaxFrameBytes(...) and
91 PQoS::SetPeakBytesPerSec(...)
93 Linux and earlier versions of Windows:
94 --------------------------------------
96 Based either on:
98 a) the parameter passed to PQoS::SetDSCP(...), or
99 b) the parameter passed to PQoS::SetWinServiceType(...) plus (optionally) the
100 parameters passed to any calls to PQoS::SetDSCPAlternative(...)
102 Unsupported Windows versions
103 ----------------------------
105 Windows ME - setsockopt/IP_TOS appears to be unsupported and it is impossible
106 to turn off RSVP signalling for GQOS
107 Windows NT4 without SP4 - there is a known problem using setsockopt/IP_TOS on
108 unconnected UDP sockets. SP4 solves this problem (see Microsoft KB article
109 Q196358).
112 3) 802.1Q support
113 =================
115 Where enabled, 802.1Q is supported on Windows XP and Windows Server 2003 based
116 on the same calls as for Diffserv support on these platforms
118 A note for developers
119 ---------------------
121 In principle, it is possible to support 802.1Q on Windows 2000, but this is
122 not implemented for the following reason.
124 Currently, Winsock support in openh323 writes to UDP sockets using sendto(...)
125 on unconnected UDP sockets. As a result, setting QOS using GQOS (which enables
126 802.1Q) requires that the QUALITYOFSERVICE structure include a QOS_DESTADDR.
127 QOS_DESTADDR is not supported on Windows 2000.
129 If anyone wants to rewrite pwlib winsock support to use WSASendTo, or openh323
130 to use connected UDP sockets, it should then - in principle - be possible to
131 remove the requirement for QOS_DESTADDR and use the GQOS API on Windows 2000.
132 However, note the "in principle". This principle has not been tested!
135 4) Windows 2000 support
136 =======================
138 Diffserv support on Windows 2000 is implemented using the traditional
139 setsockopt(...) approach with an IP_TOS parameter. The reason for using this
140 approach rather than the GQOS API is explained in the note to section 3 above.
142 In order to enable the use of setsockopt(...) with IP_TOS on Windows 2000, it
143 is necessary to set the following registry setting (unset by default):
145 HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\DisableUserTOSSetting
146 = 0
148 After setting this, you will need to reboot the machine.
150 A note for those horrified by this
151 ----------------------------------
153 Unfortunately, even if someone does enable the use of GQOS on Windows 2000, it
154 will still be necessary to make a non-default registry setting. This is
155 because by default, Windows 2000 implements RSVP (ie intserv rather than
156 diffserv). On the grounds that nobody actually uses intserv, PTLIB disables
157 RSVP in its calls to GQOS, but then to enable diffserv it is necessary to set:
159 HKLM\System\CurrentControlSet\Services\Qossp\EnablePriorityBoost = 1
161 Sorry! Blame Microsoft...
164 5) Windows XP and Server 2003 support
165 =====================================
167 The approach used for QOS support on these platforms does not allow the DSCP
168 or 802.1Q COS to be set directly. However, it should be possible for the
169 system administrator to modify the DSCP that is used for any of the service
170 types specified in the call to PQoS::SetWinServiceType(...).
172 To do this:
174 * run "mmc"
175 * go to File\Add/Remove Snap-in
176 * add the Group Policy object (shows up as Local Computer Policy)
177 * within Local COmputer Policy, go to:
179 Computer Configuration\Administrative Templates\Netrwork\QoS Packet Scheduler.
181 This will allow you to configure DSCP and Layer-2 priority values (802.1Q
182 COS). Note that only Guaranteed service type, Controlled load service type,
183 and Best effort service type are supported.