|
26 |
|
26 |
|
27 |
class Tag; |
27 |
class Tag; |
28 |
|
28 |
|
|
|
29 |
|
30 |
/** |
31 |
* As per IEEE Std. 802.11-2007, Section 6.1.1.1.1, when EDCA is used the |
32 |
* the Traffic ID (TID) value corresponds to one of the User Priority (UP) |
33 |
* values defined by the IEEE Std. 802.1D-2004, Annex G, table G-2. |
34 |
* |
35 |
* Note that this correspondence does not hold for HCCA, since in that |
36 |
* case the mapping between UPs and TIDs should be determined by a |
37 |
* TSPEC element as per IEEE Std. 802.11-2007, Section 7.3.2.30 |
38 |
*/ |
39 |
enum UserPriority { |
40 |
UP_BK = 1, /**< background */ |
41 |
UP_BE = 0, /**< best effort (default) */ |
42 |
UP_EE = 3, /**< excellent effort */ |
43 |
UP_CL = 4, /**< controlled load */ |
44 |
UP_VI = 5, /**< video, < 100ms latency and jitter */ |
45 |
UP_VO = 6, /**< voice, < 10ms latency and jitter */ |
46 |
UP_NC = 7 /**< network control */ |
47 |
}; |
48 |
|
49 |
|
50 |
|
51 |
/** |
52 |
* The aim of the QosTag is to provide means for an Application to |
53 |
* specify the TID which will be used by a QoS-aware WifiMac for a |
54 |
* given traffic flow. Note that the current QosTag class was |
55 |
* designed to be completely mac/wifi specific without any attempt |
56 |
* at being generic. |
57 |
*/ |
29 |
class QosTag : public Tag |
58 |
class QosTag : public Tag |
30 |
{ |
59 |
{ |
31 |
public: |
60 |
public: |
32 |
static TypeId GetTypeId (void); |
61 |
static TypeId GetTypeId (void); |
33 |
virtual TypeId GetInstanceTypeId (void) const; |
62 |
virtual TypeId GetInstanceTypeId (void) const; |
34 |
|
63 |
|
|
|
64 |
/** |
65 |
* Create a QosTag with the default TID = 0 (best effort traffic) |
66 |
*/ |
35 |
QosTag (); |
67 |
QosTag (); |
|
|
68 |
|
69 |
/** |
70 |
* Create a QosTag with the given TID |
71 |
*/ |
36 |
QosTag (uint8_t tid); |
72 |
QosTag (uint8_t tid); |
|
|
73 |
|
74 |
/** |
75 |
* Set the TID to the given value. This assumes that the |
76 |
* application is aware of the QoS support provided by the MAC |
77 |
* layer, and is therefore able to set the correct TID. |
78 |
* |
79 |
* @param tid the value of the TID to set |
80 |
*/ |
81 |
void SetTid (uint8_t tid); |
82 |
|
83 |
/** |
84 |
* Set the TID to the value that corresponds to the requested |
85 |
* UserPriority. Note that, since the mapping of UserPriority to TID |
86 |
* is defined for EDCA only, you should call this method only when |
87 |
* EDCA is used. When using HDCA, QosTag(uint8_t tid) should be used |
88 |
* instead. |
89 |
* |
90 |
* @param up the requested UserPriority |
91 |
* |
92 |
*/ |
93 |
void SetUserPriority (UserPriority up); |
94 |
|
37 |
virtual void Serialize (TagBuffer i) const; |
95 |
virtual void Serialize (TagBuffer i) const; |
38 |
virtual void Deserialize (TagBuffer i); |
96 |
virtual void Deserialize (TagBuffer i); |
39 |
virtual uint32_t GetSerializedSize () const; |
97 |
virtual uint32_t GetSerializedSize () const; |
40 |
virtual void Print (std::ostream &os) const; |
98 |
virtual void Print (std::ostream &os) const; |
41 |
|
99 |
|
42 |
uint8_t Get (void) const; |
100 |
uint8_t GetTid (void) const; |
43 |
void Set (uint8_t tid); |
101 |
|
44 |
private: |
102 |
private: |
45 |
uint8_t m_tid; |
103 |
uint8_t m_tid; |
46 |
}; |
104 |
}; |