author | Junling Bu <linlinjavaer@gmail.com> |
Tue, 03 Dec 2013 11:25:59 -0800 | |
changeset 10459 | f2e90c12a44f |
parent 7386 | 2310ed220a61 |
child 11045 | 6024c150e4c8 |
permissions | -rw-r--r-- |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7141
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
4408 | 2 |
/* |
3 |
* Copyright (c) 2009 MIRKO BANCHI |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
4408 | 7 |
* published by the Free Software Foundation; |
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
18 |
* Author: Mirko Banchi <mk.banchi@gmail.com> |
|
19 |
*/ |
|
20 |
#ifndef QOS_WIFI_MAC_HELPER_H |
|
21 |
#define QOS_WIFI_MAC_HELPER_H |
|
22 |
||
23 |
#include "wifi-helper.h" |
|
24 |
#include "ns3/qos-utils.h" |
|
25 |
||
26 |
#include <map> |
|
27 |
||
28 |
namespace ns3 { |
|
29 |
||
4657
e72d6bc8b814
tweak doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
30 |
/** |
6673
ec22aa763e2d
Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents:
6331
diff
changeset
|
31 |
* \brief create QoS-enabled MAC layers for a ns3::WifiNetDevice. |
ec22aa763e2d
Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents:
6331
diff
changeset
|
32 |
* |
ec22aa763e2d
Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents:
6331
diff
changeset
|
33 |
* This class can create MACs of type ns3::ApWifiMac, ns3::StaWifiMac, |
ec22aa763e2d
Bug 978: Consolidate Wi-Fi MAC high functionality
Dean Armstrong <deanarm@gmail.com>
parents:
6331
diff
changeset
|
34 |
* and, ns3::AdhocWifiMac, with QosSupported attribute set to True. |
4657
e72d6bc8b814
tweak doxygen
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4408
diff
changeset
|
35 |
*/ |
4408 | 36 |
class QosWifiMacHelper : public WifiMacHelper |
37 |
{ |
|
38 |
public: |
|
5363 | 39 |
/** |
40 |
* Create a QosWifiMacHelper that is used to make life easier when working |
|
41 |
* with Wifi devices using a QOS MAC layer. |
|
42 |
*/ |
|
4408 | 43 |
QosWifiMacHelper (); |
5363 | 44 |
|
45 |
/** |
|
46 |
* \internal |
|
47 |
* Destroy a QosWifiMacHelper |
|
48 |
*/ |
|
4408 | 49 |
virtual ~QosWifiMacHelper (); |
5363 | 50 |
|
4408 | 51 |
/** |
52 |
* Create a mac helper in a default working state. |
|
53 |
*/ |
|
54 |
static QosWifiMacHelper Default (void); |
|
5363 | 55 |
|
4408 | 56 |
/** |
5363 | 57 |
* Set the underlying type of the MAC and its attributes. |
58 |
* |
|
4408 | 59 |
* \param type the type of ns3::WifiMac to create. |
60 |
* \param n0 the name of the attribute to set |
|
61 |
* \param v0 the value of the attribute to set |
|
62 |
* \param n1 the name of the attribute to set |
|
63 |
* \param v1 the value of the attribute to set |
|
64 |
* \param n2 the name of the attribute to set |
|
65 |
* \param v2 the value of the attribute to set |
|
66 |
* \param n3 the name of the attribute to set |
|
67 |
* \param v3 the value of the attribute to set |
|
68 |
* \param n4 the name of the attribute to set |
|
69 |
* \param v4 the value of the attribute to set |
|
70 |
* \param n5 the name of the attribute to set |
|
71 |
* \param v5 the value of the attribute to set |
|
72 |
* \param n6 the name of the attribute to set |
|
73 |
* \param v6 the value of the attribute to set |
|
74 |
* \param n7 the name of the attribute to set |
|
75 |
* \param v7 the value of the attribute to set |
|
76 |
* |
|
77 |
* All the attributes specified in this method should exist |
|
78 |
* in the requested mac. |
|
79 |
*/ |
|
10459
f2e90c12a44f
base implementation of the IEEE 802.11p standard
Junling Bu <linlinjavaer@gmail.com>
parents:
7386
diff
changeset
|
80 |
virtual void SetType (std::string type, |
4408 | 81 |
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (), |
82 |
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (), |
|
83 |
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (), |
|
84 |
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (), |
|
85 |
std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (), |
|
86 |
std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (), |
|
87 |
std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (), |
|
88 |
std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ()); |
|
89 |
/** |
|
6273
8d70de29d514
spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents:
5363
diff
changeset
|
90 |
* Set the class, type and attributes for the Msdu aggregator |
5363 | 91 |
* |
6331
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
6294
diff
changeset
|
92 |
* \param ac access category for which we are setting aggregator. Possibilities |
4408 | 93 |
* are: AC_BK, AC_BE, AC_VI, AC_VO. |
6294
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
94 |
* \param type the type of ns3::MsduAggregator to create. |
4408 | 95 |
* \param n0 the name of the attribute to set |
96 |
* \param v0 the value of the attribute to set |
|
97 |
* \param n1 the name of the attribute to set |
|
98 |
* \param v1 the value of the attribute to set |
|
99 |
* \param n2 the name of the attribute to set |
|
100 |
* \param v2 the value of the attribute to set |
|
101 |
* \param n3 the name of the attribute to set |
|
102 |
* \param v3 the value of the attribute to set |
|
103 |
* |
|
104 |
* All the attributes specified in this method should exist |
|
105 |
* in the requested aggregator. |
|
106 |
*/ |
|
6331
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
6294
diff
changeset
|
107 |
void SetMsduAggregatorForAc (AcIndex ac, std::string type, |
4408 | 108 |
std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (), |
109 |
std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (), |
|
110 |
std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (), |
|
111 |
std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue ()); |
|
6294
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
112 |
/** |
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
113 |
* This method sets value of block ack threshold for a specific access class. |
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
114 |
* If number of packets in the respective queue reaches this value block ack mechanism |
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
115 |
* is used. |
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
116 |
* |
6331
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
6294
diff
changeset
|
117 |
* \param ac access category for which we are setting block ack threshold. Possibilities |
6294
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
118 |
* are: AC_BK, AC_BE, AC_VI, AC_VO. |
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
119 |
* \param threshold the threshold (number of packets) |
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
120 |
*/ |
6331
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
6294
diff
changeset
|
121 |
void SetBlockAckThresholdForAc (enum AcIndex ac, uint8_t threshold); |
6294
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
122 |
/** |
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
123 |
* Sets value of block ack inactivity timeout for a specific access class. <i>timeout</i> |
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
124 |
* represents number of blocks of 1024 microseconds. When this timer expires the relative |
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
125 |
* block ack agreement is teared down. Timer is reset in an recipient station every time |
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
126 |
* that a block ack request or a MPDU with ack policy BLOCK ACK is received. |
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
127 |
* Timer is reset in a originator station every time that a block ack frame is received. |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
128 |
* |
6331
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
6294
diff
changeset
|
129 |
* \param ac access category for which we are setting block ack threshold. Possibilities |
6294
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
130 |
* are: AC_BK, AC_BE, AC_VI, AC_VO. |
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
131 |
* \param timeout number of block of 1024 microseconds. |
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
132 |
*/ |
6331
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
6294
diff
changeset
|
133 |
void SetBlockAckInactivityTimeoutForAc (enum AcIndex ac, uint16_t timeout); |
10459
f2e90c12a44f
base implementation of the IEEE 802.11p standard
Junling Bu <linlinjavaer@gmail.com>
parents:
7386
diff
changeset
|
134 |
protected: |
f2e90c12a44f
base implementation of the IEEE 802.11p standard
Junling Bu <linlinjavaer@gmail.com>
parents:
7386
diff
changeset
|
135 |
ObjectFactory m_mac; |
4408 | 136 |
private: |
137 |
/** |
|
5363 | 138 |
* \internal |
4408 | 139 |
* \returns a newly-created MAC object. |
140 |
* |
|
141 |
* This method implements the pure virtual method defined in \ref ns3::WifiMacHelper. |
|
142 |
*/ |
|
143 |
virtual Ptr<WifiMac> Create (void) const; |
|
6331
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
6294
diff
changeset
|
144 |
void Setup (Ptr<WifiMac> mac, enum AcIndex ac, std::string dcaAttrName) const; |
4720
15221757964f
bug 641: CwMin setting for 802.11b
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
4673
diff
changeset
|
145 |
|
6331
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
6294
diff
changeset
|
146 |
std::map<AcIndex, ObjectFactory> m_aggregators; |
7141
072fb225b714
run check-style.py on src/wifi
Nicola Baldo <nicola@baldo.biz>
parents:
6852
diff
changeset
|
147 |
/* |
6331
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
6294
diff
changeset
|
148 |
* Next maps contain, for every access category, the values for |
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
6294
diff
changeset
|
149 |
* block ack threshold and block ack inactivity timeout. |
6294
6cefb3c0696a
add methods in QosWifiMacHelper for block ack parameters setup
Mirko Banchi <mk.banchi@gmail.com>
parents:
6273
diff
changeset
|
150 |
*/ |
6331
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
6294
diff
changeset
|
151 |
std::map<AcIndex, uint8_t> m_bAckThresholds; |
eee2eab36748
Bug 910: Replace AccessClass with 802.11-style AcIndex
Dean Armstrong <deanarm@gmail.com>
parents:
6294
diff
changeset
|
152 |
std::map<AcIndex, uint16_t> m_bAckInactivityTimeouts; |
4408 | 153 |
}; |
154 |
||
7386
2310ed220a61
standardize ns-3 namespace declaration format
Vedran Miletić <rivanvx@gmail.com>
parents:
7385
diff
changeset
|
155 |
} // namespace ns3 |
4408 | 156 |
|
157 |
#endif /* QOS_WIFI_MAC_HELPER_H */ |