IEEE P802.11
Wireless LANs
Wireless Multimedia Enhancements (WME)
Date:	11-July-2003
Primary Author: 
Thomas Kuehnel
Microsoft Corporation
One Microsoft Way
Redmond, WA 98052
Tel: (425) 706-4351
Fax: (425) 936-7329
Email: tkuehnel@microsoft.com
Contributions from: 
Mark Bilstad, Cisco Systems
Greg Chesson, Atheros Communications
Matthew Fischer, Broadcom
Garth Hillman, AMD
Wayne King, Microsoft
Duncan Kitchin, Intel
Thomas Kuehnel, Microsoft
Richard van Leeuwen, Agere Systems
Partho Mishra, Airgonetworks
Andrew Myles, Cisco Systems
Stephen Palm, Broadcom
Sid Schrum, Texas Instruments
Menzo Wentink, Intersil Corporation

Abstract

This submission documents an effort by the authors to create an unambiguous, implementable and interoperable specification compatible with 802.11 TGe drafts.  It defines a Phase 1 WME which is viewed as a guideline for implementors in advance of the availability of a final TGe standard.
Contents
1	Overview
1.1	Purpose of This Document
1.2	Terms and Definitions
1.3	WME Features
2	WME Frame Formats
2.1	Data Frame Formats
2.1.1	Fields
2.1.2	Frame Control Field
2.1.3	Duration Field
2.1.4	Addresses
2.1.5	Sequence Control Field
2.1.6	QoS Control Field
2.2	Management Frame Formats
2.2.1	WME Information Element
2.2.2	WME Parameter Element
2.2.3	Beacon Frame
2.2.4	Probe Request Frame
2.2.5	Probe Response Frame
2.2.6	Association Request Frame
2.2.7	Association Response Frame
2.2.8	Management Notification Frame
2.2.9	WME TSPEC Element
3	WME Protocol Specification
3.1	Association and Capability Negotiation
3.1.1	Procedure at an AP
3.1.2	Procedure at a STA in an Infrastructure Network
3.1.3	Procedure at a STA in an IBSS
3.2	Setting of WME Parameters
3.2.1	Default WME parameters
3.2.2	WME Parameters in an Infrastructure Network
3.2.3	WME Parameters in an IBSS
3.3	Assignment of Frames to Queues
3.3.1	Mappings for Unicast Frames
3.3.2	Mappings for Received Unicast Frames at an AP
3.3.3	Mappings for Group Addressed and Buffered Frames at an AP
3.4	Channel Access Protocol
3.4.1	Reference Implementation
3.4.2	Transmit Opportunities & TXOP Limits
3.4.3	Obtaining an EDCA TXOP
3.4.4	Obtaining a Continuation of TXOP
3.4.5	Backoff Procedure
3.4.6	Retransmit Procedures
3.4.7	Admission Control Procedures
WME (Informative) Recommended Practices Annex
References

1	Overview
1.1	Purpose of This Document
This document defines the specification for WME, an 802.11 quality of service (QoS) implementation based on a subset of the draft 802.11e standard supplement. It is motivated by the need to prevent market fragmentation caused by multiple, non-interoperable pre-standard subsets of the draft 802.11e standard that would otherwise occur. It is intended that WME can be implemented, subjected to interoperability testing and deployed in the market before the availability of 802.11e. This is facilitated by selecting a subset of the features of 802.11e. It in no way should be taken to detract from 802.11e itself, which is viewed as the long term endpoint of WME. Deployment of WME will deliver useful QoS functionality for streaming media and also provide key lessons which will benefit eventual deployment of 802.11e.
1.2	Terms and Definitions
Access category (AC): A label for a set of MSDUs for which a set of enhanced distributed channel access (EDCA) parameters are used for contending the channel.  WME defines 4 ACs.
Admitted AC: Traffic transmitted using an AC based on parameters in a WME TSPEC element contained in a Setup response frame
AIFS: Arbitration Inter Frame Spacing 
AIFSN: Arbitration Inter Frame Spacing Number
ECWmin: Exponent form of CWmin
ECWmax: Exponent form of CWmax
Enhanced Distributed Coordination Function (EDCF)
Group traffic: Multicast and broadcast traffic
Transmission Opportunity (TXOP): An interval of time when a particular WME STA has the right to initiate transmissions onto the wireless medium (WM). 
Un-admitted AC: Traffic transmitted using an AC based that did not require admission. 

1.3	WME Features
The features supported by WME in this phase are as follows:
1.	Capability negotiation independent of 802.11e. That is, WME devices will not advertise 802.11e capability unless they also support those features independently. This is part of a forward compatibility strategy which is described in detail in a subsequent paragraph.
2.	Frame formats and over the air protocols will be based on those currently proposed for 802.11e. However, no attempt will be made to track future changes in 802.11e and reflect them back into the WME specification. Divergence between the two specifications is a necessary side effect of the need to freeze the WME specification as soon as possible.
3.	WME will use an EDCF mechanism only, and except where explicitly indicated otherwise in this specification other 802.11e features, including HCF polling and associated signaling, Block Acknowledgement, and side traffic, are not part of WME.
4.	Interfaces to the MAC which signal per-packet priority will be consistent with those used for Ethernet, both in terms of the driver API and bridging to other 802 link layers via an 802.1D bridge.
5.	The number of exposed queues will be fixed at four.  A fixed mapping of 802.1D Tags to those four queues will be defined, together with suggested uses for each priority consistent with the suggested uses in 802.1D.
Capability negotiation is designed to permit ultimate forward compatibility with 802.11e, taking into account the fact that the formats used for QoS data frames cannot be assumed to remain consistent. It is important feature that, on receipt of a frame, it is possible to uniquely decode it.
An AP or STA may support both WME and 802.11e. Only one may be in use for a specific association at any time, but an AP may permit both 802.11e and WME associations from different STAs at the same time.
A WME-only AP or STA does not set the “QoS” bit in the capability field of association, beacon and probe management frames. A new WME Information Element is defined in this specification and is carried in those frames. An AP may support and advertise both 802.11e and WME in probe responses and beacons, but both association requests and responses must only request or specify one of these capabilities. As a result, a given association is either WME or 802.11e, but not both, and this defines how data frames with QoS subtypes must be interpreted, should they ultimately be different.
2	WME Frame Formats
2.1	Data Frame Formats
2.1.1	Fields
Data, Control and Management frames are indicated by a type subfield in the frame control field, as defined for [1]. Data frames include additional WME-specified subtypes and conditional fields.
The general frame format for data type frames is shown in Figure 1.
2	2	6	6	6	2	6 or 0	2 or 0	n	4	
Frame Control	Dur	Address 1	Address 2	Address 3	Seq Control	Address 4	QoS Control	Body	FCS	
MAC Header			
Figure 1 WME QoS Data Frame Format
The Address 4 and QoS control fields are conditionally present in the MAC header, determined by values in the frame control field. The Address 4 field is present if and only if both toDS and fromDS bits are set in the frame control field (see 2.1.2). The QoS control field is present if and only if the frame is of subtype QoS data or QoS null.
2.1.2	Frame Control Field
There are no changes to the definition of the frame control field division into subfields. Subfield allocations are identical to [1].
Additional data subtypes are defined for WME as shown in Table 1.
Table 1 Additional WME Data Subtype Codes
Type (MSB-LSB)	Subtype (MSB-LSB)	Subtype Description	
10	1000	QoS data	
10	1100	QoS null	
00	1101	Management Action	

2.1.3	Duration Field
The definition of the duration field is unchanged from [1] aside from the addition of the following provision:
When transmitting bursts of multiple MSDUs using continuation TXOPs, the duration field of a data or management frame in that burst may be selected to protect, using the NAV mechanism, either:
a)	only the acknowledgement frame, if present, or 
b)	the acknowledgement frame, if present, plus the following data or management frame and its expected acknowledgement, if present or
c)	the entire burst of frames.
2.1.4	Addresses
The definition and interpretation of address fields is unchanged from [1].
2.1.5	Sequence Control Field
15	4	3	0	
Sequence Number	Fragment Number	
Figure 2 Sequence Control Field
The sequence control field contains two subfields, the sequence number and fragment number.  Definition and use of the fragment number is unchanged from [1].  A sequence number is maintained separately for each Access Category and non-QoS traffic including management frames and group traffic.
Sequence and fragment numbers shall be selected and inserted on the initial transmission attempt of each data or management frame. Any subsequent retransmissions shall use the same sequence control field as the first transmission attempt.
The sequence number is selected by the transmitter from a modulo-4096 counter, which shall be incremented by 1 for each unique MSDU or MMPDU that is queued to the associated AC for delivery.

In addition to the RA and TA of the frame, the receiver shall use the 802.1D Tag that is carried in the QoS Control field in order to allow correct differentiation of the sequence number spaces among frames sent using different ACs.
2.1.6	QoS Control Field
The QoS control field consists of two octets and is shown in Figure 3.

15	7	6	5	4	3	2	0	
0	ack policy	0	0	802.1D Tag	
Figure 3 QoS Control Field
The three bit 802.1D Tag signals the priority for this frame.
The ack policy field specifies the expected acknowledgement response and contains one of the values shown in Table 2. All other bits are reserved and shall be set to zero on transmission and ignored on receipt.
Table 2 Ack Policy Field Values
Ack Policy Value	Meaning	
00	Acknowledge	
01	Do not Acknowledge	

Note that the 802.1D Tag is included here for signaling priority across the link layer.
2.2	Management Frame Formats
2.2.1	WME Information Element
The WME Information Element indicates capability or use of WME according to context and is shown in Figure 4. The fields contained in the WME Information Element are listed in Table 3.  The WME Information Element contains a version number, which is 1 for version 1.0 of the WME specification. The WME Information Element contains an AC Info field.

Octets:1	1	3	1	1	1	1	
Element  	ID	Length	OUI	OUI Type	OUI Subtype	Version	AC Info field	
Figure 4 WME Information Element
Table 3 WME Information Element Field Values
Field	Value	
Element ID	221	
Length	7	
OUI	00:50:f2 (hex)	
OUI Type	2	
OUI Subtype	0	
Version	1	
AC Info field	See Figure 5	

The AC Info field is shown in Figure 5. The AC Info field contains the Parameter Set Count, which is initially arbitrary and is incremented each time any of the AC parameters changes. 

7	4	3	0	
Reserved	Parameter Set Count	
Figure 5 AC Info field 
The reserved bits are set to 0 upon transmission and should be ignored upon reception. The Parameter Set Count is set to “0” in the association request frames and ignored upon reception.
2.2.2	WME Parameter Element
The WME Parameter Element contains a set of parameters (EDCA parameters) for the EDCF channel access protocol and is shown in Figure 6. The fields contained in the WME Parameter Element are listed in Table 4.  The WME Parameter Element contains an AC Info field. The format of the AC Info field is shown in Figure 5. The AC Info field contains the Parameter Set Count, which is initially arbitrary and is incremented each time any of the AC parameters changes. The reserved bits are set to 0 upon transmission and shall be ignored upon reception.

Octets: 1	1	3	1	1	1	1	1	16	
ElementID	Length	OUI	OUI Type	OUI Subtype	Version	AC Info field	Reserved	AC Parameters	
Figure 6 WME Parameter Element
Table 4 WME Parameter Element Field Values
Field	Value	
Element ID	221	
Length	24	
OUI	00:50:f2 (hex)	
OUI Type	2	
OUI Subtype	1	
Version	1	
AC Info field	See Figure 5	
Reserved	0	
AC Parameters Best_Effort	AC Parameters Record AC_BE	
AC Parameters Background	AC Parameters Record AC_BK	
AC Parameters Video	AC Parameters Record AC_VI	
AC Parameters Voice	AC Parameters Record AC_VO	

Each access category (AC) parameter record has the format shown in Figure 7.  The formats of the ACI/AIFSN and ECWmin/ECWmax fields are shown in Figure 8 and Figure 9, respectively.

Octets: 1	1	2	
ACI/AIFSN	ECWmin/ ECWmax	TXOP Limit	
Figure 7 AC Parameters Record Format

7	6	5	4	3	0	
Reserved	ACI	ACM	AIFSN	
Figure 8 ACI/AIFSN Field 
The value of TXOP limit is specified as an unsigned integer, with the least significant octet transmitted first, in units of 32ms. A TXOP limit value of 0 indicates that a single MPDU, in addition to a possible RTS/CTS exchange or CTS to itself, may be transmitted at any rate for each TXOP.  The value of the AC references the AC to which all parameters in this record correspond. The mapping between AC index (ACI) and AC is defined in Table 6.
Table 5 ACI to AC coding
ACI	AC	Access Category	
00	AC_BE	Best Effort	
01	AC_BK	Background	
10	AC_VI	Video	
11	AC_VO	Voice	

The ACM (Admission Control Mandatory) flag indicates that Admission Control is required for the AC.  If bit ACM is set to 0, the AC may be used without Admission Control. If bit ACM is set to 1, admission control must be performed prior to transmission at the respective AC.  If an STA desires to send data without admission control using an AC that mandates admission control, the STA must use an AC that corresponds to a lower priority and does not require admission control. Note: The 802.1D Tag that is carried in the QoS control field (see 2.1.6) remains unchanged.

7	4	3	0	
ECWmax	ECWmin	
Figure 9 ECWmin/ECWmax field
The fields ECWmin and ECWmax encode the values of CWmin and CWmax respectively in an exponent form. The values ECWmin and ECWmax are defined such that:

Hence the minimum encoded value of CWmin is 0, and the maximum value is 32767.
2.2.3	Beacon Frame
Every beacon frame transmitted by a WME-enabled AP shall contain, in addition to those elements specified in [1], either a WME Information Element or a WME Parameter Element.
2.2.4	Probe Request Frame
Probe request frames transmitted by a WME-enabled STA are unchanged from [1].
2.2.5	Probe Response Frame
A probe response frame transmitted by a WME-enabled AP shall contain a WME Parameter Element.
2.2.6	Association Request Frame
An association request frame contains a WME Information Element in addition to the information elements in [1]. 
2.2.7	Association Response Frame
An association response frame shall contain a WME Parameter Element in addition to the information elements in [1]. 
2.2.8	Management Notification Frame
The management notification frame is carried in a management action frame and has a format as shown in Figure 10, with fields as described in Table 6.
The action code field contains the values shown in Table 7.

24/30	1	1	1	1		4	
MAC Header	Category Code	Action Code	Dialog Token	Status Code	Elements	FCS	
Figure 10 Management Notification Frame Format
Table 6 Management Notification Frame Fields
Field	Value	
MAC Header	See [1]	
Category code	17	
Action code	See below	
Dialog token	See below	
Status Code	See below	
Elements	One or more information elements	
FCS	See [1]	

Table 7 Management Notification Frame Action Codes
Value	Action code	
0	Setup  request	
1	Setup response	
2	Teardown	
3-255	Reserved	

The Setup request, Setup response, and Teardown management frames are used for Admission Control and shall at minimum contain a WME TSPEC element.
The Dialog Token field shall be set by the STA to a non-zero value in the Setup Request frame and shall be copied into the corresponding Setup Response notification frame. The Dialog Token shall be set to 0 in the Teardown frame.
The status code field is only filled in for the Setup response, and contains the values shown in Table 8. For other action codes, this field should be set to zero and ignored on receive.
Table 8 Setup Response Status Codes
Value	Operation	
0	Admission accepted	
1	Invalid parameters	
2	reserved	
3	refused	
4-255	Reserved	

2.2.9	WME TSPEC Element
The format of the WME TSPEC element is shown in Figure 11.  The fields contained in the WME TSPEC element are listed in Table 9.  (Note: The fields are a snapshot of the TSPEC element in IEEE Std 802.11e/D4.3 plus an appended Media Time field.)  Fields marked with a hyphen are optional, and shall be set to zero if not used. The value of zero for any field is a special reserved value, meaning "no information provided". The WME TSPEC body format is shown in Figure 12.

Octets: 1	1	3	1	1	1	50	
ID	Length	OUI	OUI Type	OUI Subtype	Version	WME TSPEC body	
Figure 11 WME TSPEC Element

Octets: 2	2	2	4	4	4	4	4	
TS Info
	Nominal MSDU Size	Maximum MSDU Size	Minimum Service Interval	Maximum Service Interval	Inactivity Interval	Service Start Time	Minimum
Data Rate	
4	4	4	4	4	2	2	
Mean Data Rate	Maximum Burst Size	Minimum PHY Rate 	Peak Data Rate 	Delay
Bound 	Surplus Bandwidth Allowance	Medium Time	
Figure 12 WME TSPEC Body format

Table 9 WME TSPEC Element Field Values
Field	Value	
Element ID	221	
Length	6 + 50 = 56	
OUI	00:50:f2 (hex)	
OUI Type	2	
OUI Subtype	2	
Version	1	
TS Info	See below	
Nominal MSDU Size	See below	
Maximum MSDU Size	-	
Minimum Service Interval	-	
Maximum Service Interval	-	
Inactivity Interval	-	
Service Start Time	-	
Minimum Data Rate	-	
Mean Data Rate	See below	
Maximum Burst Size	-	
Minimum PHY Rate	See below	
Peak Data Rate	-	
Delay Bound	-	
Surplus Bandwidth Allowance	See below	
Medium Time	See below	

A WME TSPEC request shall be transmitted by a STA to an AP in order to request admission for an AC that requires admission control. The STA may transmit unadmitted traffic based on available 802.1D tags for those ACs for which the AP does not mandate admission control. A STA shall not transmit a WME TSPEC request for an AC that does not mandate admission control. 
The TS Info field contains the subfields shown in Figure 13. The Contention-based access flag is always set to one. The 802.1D fields contain the 802.1D Tag of the traffic for which a request is being made. The direction field contains values shown in Table 10. 

15              14	13	12               10	9	8	7	5	4	3	0	
Reserved
	0	802.1D	Direction	802.1D	Contention-based access	Reserved	
Figure 13 TS Info Field in WME TSPEC Element
Table 10 Direction Field Values
Direction Value	Meaning	
00	Uplink	
01	Downlink	
10	Reserved	
11	Bi-directional	

The uplink and downlink characteristics are symmetric for a bidirectional reservation. The value of a TSPEC field for a bidirectional reservation represents the resources for one direction.
The Nominal MSDU Size field is 2 octets long and contains an unsigned integer that specifies the nominal size, in octets, of MSDUs belonging to the traffic under this traffic specification and is defined in Figure 14. If the Fixed subfield is set to 1, then the size of the MSDU is fixed and is indicated by the Size Subfield. If the Fixed subfield is set to 0, then the size of the MSDU might not be fixed and the Size indicates the nominal MSDU size. 
15	14	0	
Fixed	Size	
Figure 14 Nominal MSDU Size Field
The Mean Data Rate field is 4 octets long and contains an unsigned integer that specifies the average data rate, in units of bits per second, for transport of MSDUs belonging to this traffic within the bounds under this traffic specification.  The Mean Data Rate does not include the MAC and PHY overheads incurred in transferring the MSDUs.

The Minimum PHY Rate field is 4 octets long and contains an unsigned integer that specifies the minimum PHY rate, in units of bits per second that is required for transport of the MSDUs belonging to the traffic in this TSPEC. 

The Surplus Bandwidth Allowance Factor field is 2 octets long and contains specifies the excess allocation of time (and bandwidth) over and above the stated rates required to transport an MSDU belonging to the traffic in this TSPEC.  This field is represented as an unsigned binary number with an implicit binary point after the leftmost 3 bits.  This field is included to account for retransmissions. As such, the value of this field must be greater than unity.

Medium Time is a 16-bit unsigned integer which describes the amount of time admitted to access the medium, in units of 32 microsecond periods per second.  

3	WME Protocol Specification
3.1	Association and Capability Negotiation
3.1.1	Procedure at an AP
An AP that supports WME shall include either a WME Information Element or a WME Parameter Element in every beacon.  In response to a probe request, a WME-enabled AP shall include a WME Parameter Element in its probe response. 
On receipt of an association request and subsequent transmission of a corresponding association response: the AP shall include a WME Parameter Element in the association response if the corresponding association request contained a WME Information element and shall treat the association as WME association. 
If the destination address of a data frame to be transmitted on the wireless medium corresponds to a STA with a WME association, the AP shall use WME QoS data subtype frame formats when transmitting the frame to it. If the destination address corresponds to a STA associated as a non-WME STA, the AP shall not use QoS subtype data frames. 
The AP may modify the WME parameters at any time. To assure that all STAs are able to receive the updated WME parameters, the AP shall include the WME Parameter Element in multiple beacons following a change in AC parameters. The AC parameter set count that is contained in the WME Parameter Element and WME Information Element is incremented following the change of one or multiple WME parameters.
3.1.2	Procedure at a STA in an Infrastructure Network
A WME-enabled STA shall determine the WME capability of an AP with which it wishes to associate before transmitting an association request to it.  It may do this either passively, by receiving a beacon frame, or actively, by transmitting a probe request to it.
From the most recently received probe response or beacon from a specific AP, the STA shall determine whether the AP supports WME. 
A STA shall include a WME Information Element in an association request if it has determined that the recipient AP supports WME and shall treat the association as WME association if the association response contained a WME Parameter element.
The STA is required to monitor the change of WME parameters conveyed in the WME Parameter Element in beacons and shall update its values accordingly. It is the responsibility of the STA to use the current WME parameters for accessing the wireless medium.
3.1.3	Procedure at a STA in an IBSS
WME may be used in an IBSS, but since there is no negotiation of capability via association in this case, any STA wishing to use QoS data frame subtypes when transmitting to each STA must first infer the capability at that STA by other means.
A WME-capable STA operating in an IBSS shall maintain an inferred WME capability state for each destination address in the IBSS that it is aware of. It may set WME capability state to “supported” for a given destination address on receipt of a beacon frame from that STA containing a WME element, or on receipt of a probe response frame from that STA containing a WME Information Element. The WME capability state for each other STA shall be set to “not supported” until receipt of such a beacon or probe response.
WME STAs operating in an IBSS shall respond to probe frames from other STAs in the same IBSS by transmitting a probe response frame to that STA, containing a WME Information Element.
3.2	Setting of WME Parameters
3.2.1	Default WME parameters
Table 11 Default WME Parameters
 AC	CWmin	CWmax	AIFSN	TXOP Limit (802.11b)	TXOP Limit (802.11a/g)	
AC_BK	aCWmin	aCWmax	6	0	0	
AC_BE	aCWmin	aCWmax	2	0	0	
AC_VI	(aCWmin + 1)/2 -1	aCWmin	1	6.0ms	3.0ms	
AC_VO	(aCWmin+1)/4 - 1	(aCWmin+1)/2 -1	1	3.3ms	1.5ms	
3.2.2	WME Parameters in an Infrastructure Network
A WME-enabled AP may arbitrarily determine values for the parameters CWmin, CWmax, AIFS and TXOP limit for each of the four access categories.  An AP may change the values of these parameters at any beacon time.
An AP shall include a WME Parameter Element containing its currently determined values for all WME parameters in multiple beacon frames when WME parameters have changed. An AP shall include a WME Parameter element in probe response frames and in association response frames.
A STA associated with an infrastructure network shall maintain a set of parameters for each AC. Prior to association (and used only for transmitting probe, authentication and association request frames) it shall set these parameters to the default values shown in Table 11.
A STA shall subsequently update the values of these parameters from any successfully received probe response frame, association response frame, which are addressed to the STA or beacon frame transmitted by the AP with which the STA is associated.
The AP may use a different set of parameters than it advertises. A recommended set of default parameters for the AP is in the annex.
3.2.3	WME Parameters in an IBSS
A STA which is a member of an IBSS shall set the values of all WME parameters to the defaults listed in Table 11. In an IBSS, the WME Parameter element is not included in the beacon.
3.3	Assignment of Frames to Queues
3.3.1	Mappings for Unicast Frames
The MAC data service at a STA or AP provides for connectionless, asynchronous transport of MSDUs. Each MSDU transfer request includes an 802.1D Tag equal to that value. 802.1D Tags are mapped to Access Category (AC) according to Table 12 and are listed in increasing priority order. 
Table 12 802.1D Tag to AC mappings
Priority	802.1D Tag	802.1D Designation	Access Category	WME Designation	

lowest

highest

	1	BK	
AC_BK	
Background	
	2	-			
	0	BE	AC_BE	Best Effort	
	3	EE	
AC_VI	
Video	
	4	CL			
	5	VI			
	6	VO	
AC_VO	
Voice	
	7	NC			

Transmit frames are then placed in queues according to AC. The AP and STA may implement more queues for internal prioritization. Data frames with no priority information are treated as best effort.
Management frames have no 802.1D Tag, but should be mapped to AC_VO
PS-Poll frames should be mapped to AC_BE.
3.3.2	Mappings for Received Unicast Frames at an AP
Unicast frames received by an AP may be:
a)	Non-QoS subtypes, in which case the AP shall assign an 802.1D Tag of 0 (best effort) to them. See section 2.1
b)	QoS subtypes, in which case the AP shall use the 802.1D tag subfield of the QoS control field as the priority information.
In the event that the received frame has a destination address within the BSS, the AP shall determine the transmit queue according to the procedure described in section 3.3.1.
3.3.3	Mappings for Group Addressed and Buffered Frames at an AP
The AP forwards all group addressed frames (Multicast/Broadcast) using non-QoS data frame subtypes, if not all the recipients are WME capable STAs. The AP may forward Power Save frames that are buffered with QoS Data frame subtype only to WME stations. Otherwise the frames must be sent using non-QoS data frame subtypes. The AP is not required to implement multiple ACC queues for transmission of group addressed and buffered Power Save frames, and may use a single dedicated queue for this purpose. If the AP uses a single queue for pending group addressed frames, then the AP should maintain the queue in priority order if possible.
3.4	Channel Access Protocol
3.4.1	Reference Implementation
The channel access protocol is derived from the DCF procedures described in [1]. This document specifies only differences between the WME channel access protocol and the reference.

Figure 15 Reference Implementation Model
A model of the reference implementation is shown in Figure 15 and illustrates a mapping to access category, the four transmit queues and four independent channel access functions, one for each queue. The mapping of AC to priority is described in section 3.3. 
3.4.2	Transmit Opportunities & TXOP Limits 
There are two modes of TXOP defined, EDCA TXOP and continuation TXOP.
An EDCA TXOP occurs when the EDCA rules permit access to the medium. 
A continuation TXOP occurs when a channel access function retains the right to access the medium following the completion of a frame exchange sequence, such as on receipt of an Ack frame. 
The TXOP limit duration values advertised by the AP shall either be zero, or greater than the time required to transmit at the lowest available PHY rate, using the RTS/CTS protocol, one acknowledged MPDU of total length of 256 bytes, plus the time required to transmit any additional bytes required for encryption.
STAs shall ensure that the duration of TXOPs obtained using the EDCA rules do not exceed the TXOP limit.  The duration of a TXOP is the time the TXOP holder maintains uninterrupted control of the medium, and it includes the time required to transmit frames sent as an immediate response to TXOP holder transmissions.  
An STA shall fragment an MSDU so that the transmission of the first MPDU of the TXOP does not cause the TXOP limit to be exceeded at the PHY rate selected for the initial transmission attempt of that MPDU. The TXOP limit may be exceeded, when using a lower PHY rate than selected for the initial transmission attempt of the first MPDU, for a retransmission of an MPDU, or for the initial transmission of an MPDU if any previous MPDU in the current MSDU has been retransmitted. When the TXOP limit is exceeded due to the retransmission of a MPDU at a reduced PHY rate, the STA shall not transmit more than one MPDU in the TXOP.

3.4.3	Obtaining an EDCA TXOP
Each channel access timer shall maintain a backoff function timer, which has a value measured in backoff slots.
The duration AIFS[AC] is a duration derived from the value AIFSN[AC] by the relation
AIFS[AC] = AIFSN[AC] × aSlotTime + aSIFSTime 
An EDCA TXOP is granted to a channel access function when:
a)	the medium is indicated by CCA and virtual carrier sense to be idle, and has been idle for a time greater than or equal to AIFS[AC]+aSlotTime, where AC  is the AC of the channel access function, or a time greater than or equal to EIFS-DIFS+AIFS[AC] + aSlotTime in the event that the previously received frame was in error, and
b)	the backoff timer for that channel access function is zero, and
c)	these conditions are not simultaneously met by a channel access function of a higher AC within the same STA or AP.
These conditions may be met immediately at the time a frame is requested to be transmitted in the case that the medium is already idle, or it may be necessary to wait for the expiry of the relevant backoff timer.

Figure 16 EDCA Timing Relationships
An example showing the relationship between AIFS, AIFSN, DIFS and slot times immediately following a medium busy condition (and assuming that medium busy condition was not caused by a frame in error) is shown in Figure 16. In this case, with AIFSN=1, the channel access function starts observing CCA for backoff purposes at a time
aSIFSTime + aSlotTime + D2
following the end of the medium busy condition. If the medium remains idle for the duration of aSlotTime, the backoff counter will be decremented for the first time at a time
aSIFSTime + 2 × aSlotTime –- aRxTxTurnaroundTime
following the end of the medium busy condition. If, in this example, the backoff counter contained a value of 1 at the time the medium became idle, transmission would start as a result of an EDCA TXOP on-air at a time
aSIFSTime + 2 × aSlotTime 
following the end of the medium busy condition.
3.4.4	Obtaining a Continuation of TXOP
A continuation of TXOP is granted to a channel access function at a SIFS period following the successful completion of a transmit frame exchange if there is a frame available for transmission that meets the EDCA TXOP limit and frame sequence medium access rules. If a STA has in its transmit queue an additional frame of the same access category as the one just transmitted, and the duration of transmission of that frame plus any expected acknowledgement for that frame is less than the remaining medium occupancy timer value, then the STA may commence transmission of that frame within SIFS from the completion of the immediately preceeding frame exchange sequence.
A frame exchange may be either a multicast frame transmitted by an AP or a frame transmitted with “no acknowledgement” policy, for which there is no expected acknowledgement, or a unicast frame followed by a correctly received acknowledgement frame transmitted by either a STA or an AP.
Note that, as for an EDCA TXOP, a continuation TXOP is granted to a channel access function, not to a STA or AP, such that a continuation TXOP is only permitted for the transmission of a frame of the same access category as the frame that was granted the EDCA TXOP. 
3.4.5	Backoff Procedure
Each channel access function shall maintain a state variable CW[AC], which shall be initialized to the value of the parameter CWmin[AC] (see section 3.2).
If a frame is successfully transmitted for a specific channel access function, indicated by either the successful reception of a CTS in response to an RTS, or the successful reception of an Ack in response to a unicast MPDU or MMPDU, or by transmitting a multicast frame or a frame with “no acknowledgement” policy, CW[AC] shall be reset to CWmin[AC].
The backoff procedure shall be invoked for a channel access function when either:
a)	A frame with that AC is requested to be transmitted and the medium is busy as indicated by either physical or virtual carrier sense, and the backoff timer has a value of zero for that AC.
b)	The final transmission by the TXOP holder initiated during the TXOP for that AC was successful 
c)	The transmission of a frame of that AC fails, indicated by a failure to receive a CTS in response to an RTS, or a failure to receive an Ack that was expected in response to a unicast MPDU or MMPDU.
d)	The transmission attempt collides internally with another channel access function of an AC that has higher priority, that is, two channel access functions in the same STA or AP are granted a TXOP at the same time.
If the backoff procedure is invoked because of either reason a) above the value of CW[AC] shall be left unchanged. If the backoff procedure is invoked because of reason b) above, the value of CW[AC] shall be reset to CWmin[AC].

If the backoff procedure is invoked because of a failure event (either reason c) or d) above) the value of CW[AC] will be updated before invoking the backoff procedure:
a)	if the short or long retry count for the STA has reached aShortRetryLimit or aLongRetryLimit[AC] respectively, CW[AC] will be reset to CWmin[AC].
b)	Otherwise,
1)	if CW[AC] is less than CWmax[AC], CW[AC] shall be set to the value (CW[AC]+1)*2-1
2)	if CW[AC] is equal to CWmax[AC], CW[AC] shall remain unchanged for the remainder of any retries

Following the update of the value of CW[AC], the backoff timer is set to an integer value chosen randomly with a uniform distribution taking values in the range (1,CW[AC]+1) inclusive.
The backoff timer is decremented at the end of each backoff slot provided that the medium has been idle for the duration of the slot. Each backoff slot begins immediately following a previous backoff slot or, 
a)	following a period AIFS[AC] from the end of the last indicated busy medium; or
b)	following a period of EIFS - DIFS + AIFS[AC] in the event that the previously received frame was in error; or
c)	at the latter of the end of the ACK-Timeout interval and SIFS+AIFS[N] after the PHY-TXEND.indication, and the end of the first SIFS + AIFS[N] of IDLE time following the PHY-TXEND.indication, or at SIFS + AIFS[N] after the PHY-RXEND.indication when a PHY-RXSTART.indication occurs as specified in subclause 9.2.8 in [1],  when any channel access function at this STA transmitted a frame requiring acknowledgement immediately previously.
.
3.4.6	Retransmit Procedures
If a STA or AP, in an infrastructure BSS or an IBSS, transmits frames to a destination using QoS data types, it may following a failed transmission of a frame attempt to transmit another frame with a different access category to the same or any other destination. The STA has to contend for the medium when transmitting another frame with a different access category to the same or any other destination.
If a STA or an AP does not use QoS data types when transmitting frames to a particular receiver address, once an initial attempt, excluding internal collisions, has been made to transmit a frame, it shall not transmit other data frames to that receiver address until the first frame is either successfully transmitted or discarded. It may, however, transmit other frames to different receiver addresses.
3.4.7	Admission Control Procedures
WME STA may support admission control procedures.  APs shall support admission control procedures, at least to the minimal extent of advertising that admission is not mandatory on its ACs. 
The AP uses the ACM (admission control mandatory) flags advertised in the WME Parameter element to indicate whether admission control is enabled for each of the ACs, as a matter of policy. While the CWmin, CWmax, AIFS, TXOP limit parameters may be adjusted over time by the AP, the ACM bit shall be static for the duration of the lifetime of the BSS. A WME TSPEC request shall be transmitted by a STA to an AP in order to request admission of traffic in any direction (uplink, downlink, or bidirectional) employing an AC that requires admission control. The STA may transmit unadmitted traffic for those ACs which the AP does not require admission control.
3.4.7.1	Procedures at the AP
The AP shall respond to requests for admission conveyed in the WME TSPEC request elements for those AC with set ACM flag.  On receipt of a WME TSPEC request element conveyed in any management notification frame except a probe request from an associated STA, the AP shall make a determination as to whether to
a)	accept the request
b)	deny the request
The AP may use any algorithm in making such a determination. If the AP decides to accept the request, the AP shall also derive the Medium Time from the information conveyed in the WME TSPEC request element.  The AP may use any algorithm in deriving the Medium Time, but normally it will use the procedure described in the Annex. Having made such a determination, the AP shall transmit a WME TSPEC element to the requesting STA contained in a Setup response frame. If the AP is accepting the request, the Medium Time field shall be specified.
The AP may choose at any time to tear down an explicit admission by sending a management notification frame with the action code set to Teardown.
3.4.7.2	Procedure at STAs
Each channel access function shall maintain two variables. The first of these is the admitted time, and the second is the used time.
The admitted time and used time shall be set at association time to zero. The STA may subsequently decide, to explicitly request admission amount for a specific AC, which is associated with a specific 802.1D priority. 
In order to make such a request, the STA shall transmit a WME TSPEC element contained in a Setup request management frame with the following fields specified (i.e. non-zero):  Nominal MSDU Size, Mean Data Rate, Minimum PHY Rate, and Surplus Bandwidth Allowance. The Medium Time field is not used in the request frame and shall be set to zero.
On receipt of a WME TSPEC element, contained in a Setup response frame, indicating that the request has been accepted, the STA shall set the admitted time variable for the specified channel access function to the value contained in the Medium Time field of that element.
The STA or AP may choose to tear down the explicit request at any time. In order for the STA to tear down an explicit admission, the STA shall transmit a Teardown frame containing the WME TSPEC element to the AP. 
If the STA receives a management notification frame with the action code set to Teardown it shall disable the use of the specified AC. 
If an explicit admission is torn down, the STA shall disable the use of the AC. The admitted time and the used time for the AC shall both be set to zero.
The STA shall update the value of used time:
a) at one second intervals
    		used_time = max((used_time - admitted_time), 0) 
b) after each frame exchange
    		used_time = used_time + FrameExchangeTime.
The FrameExchangeTime equals the time required to transmit the frame plus one ACK frame plus one SIFS interval. If the used time and the time reaches or exceeds the admitted time value, the corresponding channel access function shall no longer transmit using the EDCA parameters for that AC as specified in the QoS parameter set element. However, a STA may choose to temporarily replace the EDCA parameters for that channel access function with those specified for the access categories AC_BE or AC_BK in order to continue transmissions at a lower priority, if no admission control is required for those access categories.
If, for example, a STA has made and had accepted an explicit admission for a AC, and the channel conditions subsequently worsen, possibly including a change in PHY layer data rate, such that it requires more time to send the same data, the STA may make a request for more admitted time to the AP, and at the same time downgrade the EDCA parameters for short intervals in order to send some of the traffic at admitted priority, and some as unadmitted priority, whilst waiting for a response to the admission request.
WME (Informative) Recommended Practices Annex

QoS Parameter Updates
It is recommended that the mechanism to update QoS parameters by way of the WME Parameter Element in beacon frames be used infrequently. It is not the intent of the designers of the protocol to specify this as a dynamic adaptation mechanism, but rather as a means of auto-configuring policy at different locations.
However, in the event that the number of associated STAs changes or some other event occurs that significantly alters the conditions, it is expected that the AP may change the policy settings. There is no expectation of rapid update by the STAs, which may take of the order of seconds or tens of seconds if necessary to update their parameter settings.
To assure that all STAs use the proper QoS parameters following modification of AC parameters, the WME Parameter Element should be present for multiple beacon intervals. 

Use of Admission Control
It is recommended not to require Admission Control for the access categories AC_BE (Best Effort) and AC_BK (Background). The Admission Control Mandatory Bit (ACM) for these categories should be cleared to "0". The AC parameters chosen by the AP should account for unadmitted traffic in these access categories.

Deriving Medium Time
It is recommended that the AP use the following procedure to derive Medium Time in its Setup response.
There are two requirements to consider:  1) the traffic requirements of the application, and 2) the expected error performance of the medium.  The application requirements are captured by two TSPEC parameters:  Nominal MSDU Size and Mean Data Rate.  The medium requirements are captured by two TSPEC parameters:  Surplus Bandwidth Allowance and Minimum PHY Rate. The following formula describes how Medium Time may be calculated:

Medium Time = Surplus Bandwidth Allowance * pps * medium time per frame exchange
where:  
pps =  ceiling( (Mean Data Rate / 8) / Nominal MSDU Size ); medium time per frame exchange =  duration(Nominal MSDU Size, Minimum PHY Rate) + SIFS + ACK duration; duration() is the PLME-TXTIME primitive defined in the standard that returns the duration of a packet based on its payload size and the PHY data rate employed.

WME AP Default Parameter
It is recommended that the AP uses the default EDCA parameter listed in Table 13 .
Table 13 Default EDCA Parameters for the AP
 AC	CWmin	CWmax	AIFSN	TXOP Limit (802.11b)	TXOP Limit (802.11a/g)	
AC_BK	aCWmin	aCWmax	6	0	0	
AC_BE	aCWmin	4*(aCWmin+1) - 1	2	0	0	
AC_VI	(aCWmin + 1)/2 -1	aCWmin	0	6.0ms	3.0ms	
AC_VO	(aCWmin+1)/4 - 1	(aCWmin+1)/2 -1	0	3.3ms	1.5ms	

Differences between Legacy DCF Formulation and WME
DCF Formulation (IEEE Std 802.11-1999)
A random backoff value is selected in the range 0 to CW inclusive. CW is always of the form 2n-1. In the case of 802.11a, in which CWmin is 15, initial backoff values are therefore in the range [0,15].

 In congested conditions, decrement of the backoff counter may be interrupted by a transmission from another STA. The only STAs which will suspend decrement of their backoff counters are those which have not yet counted down to zero. Therefore, when resuming a suspended backoff, the smallest value of backoff counter is 1. As a result, the earliest time that a STA can transmit after the medium is no longer busy depends on whether the STA has selected a new backoff value (minimum value 0) or is resuming a previously suspended backoff (minimum value 1). Figure 17 illustrates the Backoff behavior.

Figure 17 Backoff Behavior
The AP may choose to adjust the backoff parameters for WME STAs to mitigate differences in the access priority with respect to Best_Effort traffic and legacy STAs. 
References
[1]	ISO/IEC 8802-11:1999(E) ANSI/IEEE Std 802.11, 1999 Reaffirmed 2003 edition