|
|
| 30 |
#include "dcf.h" |
30 |
#include "dcf.h" |
| 31 |
#include "dcf-manager.h" |
31 |
#include "dcf-manager.h" |
| 32 |
#include "wifi-phy.h" |
32 |
#include "wifi-phy.h" |
| 33 |
#include "msdu-aggregator.h" |
33 |
#include "msdu-standard-aggregator.h" |
|
|
34 |
#include "mpdu-standard-aggregator.h" |
| 34 |
|
35 |
|
| 35 |
namespace ns3 { |
36 |
namespace ns3 { |
| 36 |
|
37 |
|
|
|
| 137 |
} |
138 |
} |
| 138 |
|
139 |
|
| 139 |
void |
140 |
void |
|
|
141 |
RegularWifiMac::SetVoMaxAmsduSize (uint32_t size) |
| 142 |
{ |
| 143 |
NS_LOG_FUNCTION (this << size); |
| 144 |
if (m_edca.find (AC_VO)->second->GetMsduAggregator () != 0) |
| 145 |
{ |
| 146 |
m_edca.find (AC_VO)->second->GetMsduAggregator ()->SetMaxAmsduSize (size); |
| 147 |
} |
| 148 |
} |
| 149 |
|
| 150 |
void |
| 151 |
RegularWifiMac::SetViMaxAmsduSize (uint32_t size) |
| 152 |
{ |
| 153 |
NS_LOG_FUNCTION (this << size); |
| 154 |
if (m_edca.find (AC_VI)->second->GetMsduAggregator () != 0) |
| 155 |
{ |
| 156 |
m_edca.find (AC_VI)->second->GetMsduAggregator ()->SetMaxAmsduSize (size); |
| 157 |
} |
| 158 |
} |
| 159 |
|
| 160 |
void |
| 161 |
RegularWifiMac::SetBeMaxAmsduSize (uint32_t size) |
| 162 |
{ |
| 163 |
NS_LOG_FUNCTION (this << size); |
| 164 |
if (m_edca.find (AC_BE)->second->GetMsduAggregator () != 0) |
| 165 |
{ |
| 166 |
m_edca.find (AC_BE)->second->GetMsduAggregator ()->SetMaxAmsduSize (size); |
| 167 |
} |
| 168 |
} |
| 169 |
|
| 170 |
void |
| 171 |
RegularWifiMac::SetBkMaxAmsduSize (uint32_t size) |
| 172 |
{ |
| 173 |
NS_LOG_FUNCTION (this << size); |
| 174 |
if (m_edca.find (AC_BK)->second->GetMsduAggregator () != 0) |
| 175 |
{ |
| 176 |
m_edca.find (AC_BK)->second->GetMsduAggregator ()->SetMaxAmsduSize (size); |
| 177 |
} |
| 178 |
} |
| 179 |
|
| 180 |
void |
| 181 |
RegularWifiMac::SetVoMaxAmpduSize (uint32_t size) |
| 182 |
{ |
| 183 |
NS_LOG_FUNCTION (this << size); |
| 184 |
if (m_edca.find (AC_VO)->second->GetMpduAggregator () != 0) |
| 185 |
{ |
| 186 |
m_edca.find (AC_VO)->second->GetMpduAggregator ()->SetMaxAmpduSize (size); |
| 187 |
} |
| 188 |
} |
| 189 |
|
| 190 |
void |
| 191 |
RegularWifiMac::SetViMaxAmpduSize (uint32_t size) |
| 192 |
{ |
| 193 |
NS_LOG_FUNCTION (this << size); |
| 194 |
if (m_edca.find (AC_VI)->second->GetMpduAggregator () != 0) |
| 195 |
{ |
| 196 |
m_edca.find (AC_VI)->second->GetMpduAggregator ()->SetMaxAmpduSize (size); |
| 197 |
} |
| 198 |
} |
| 199 |
|
| 200 |
void |
| 201 |
RegularWifiMac::SetBeMaxAmpduSize (uint32_t size) |
| 202 |
{ |
| 203 |
NS_LOG_FUNCTION (this << size); |
| 204 |
if (m_edca.find (AC_BE)->second->GetMpduAggregator () != 0) |
| 205 |
{ |
| 206 |
m_edca.find (AC_BE)->second->GetMpduAggregator ()->SetMaxAmpduSize (size); |
| 207 |
} |
| 208 |
} |
| 209 |
|
| 210 |
void |
| 211 |
RegularWifiMac::SetBkMaxAmpduSize (uint32_t size) |
| 212 |
{ |
| 213 |
NS_LOG_FUNCTION (this << size); |
| 214 |
if (m_edca.find (AC_BK)->second->GetMpduAggregator () != 0) |
| 215 |
{ |
| 216 |
m_edca.find (AC_BK)->second->GetMpduAggregator ()->SetMaxAmpduSize (size); |
| 217 |
} |
| 218 |
} |
| 219 |
|
| 220 |
void |
| 221 |
RegularWifiMac::SetVoBlockAckThreshold (uint8_t threshold) |
| 222 |
{ |
| 223 |
NS_LOG_FUNCTION (this << threshold); |
| 224 |
m_edca.find (AC_VO)->second->SetBlockAckThreshold (threshold); |
| 225 |
} |
| 226 |
|
| 227 |
void |
| 228 |
RegularWifiMac::SetViBlockAckThreshold (uint8_t threshold) |
| 229 |
{ |
| 230 |
NS_LOG_FUNCTION (this << threshold); |
| 231 |
m_edca.find (AC_VI)->second->SetBlockAckThreshold (threshold); |
| 232 |
} |
| 233 |
|
| 234 |
void |
| 235 |
RegularWifiMac::SetBeBlockAckThreshold (uint8_t threshold) |
| 236 |
{ |
| 237 |
NS_LOG_FUNCTION (this << threshold); |
| 238 |
m_edca.find (AC_BE)->second->SetBlockAckThreshold (threshold); |
| 239 |
} |
| 240 |
|
| 241 |
void |
| 242 |
RegularWifiMac::SetBkBlockAckThreshold (uint8_t threshold) |
| 243 |
{ |
| 244 |
NS_LOG_FUNCTION (this << threshold); |
| 245 |
m_edca.find (AC_BK)->second->SetBlockAckThreshold (threshold); |
| 246 |
} |
| 247 |
|
| 248 |
void |
| 249 |
RegularWifiMac::SetVoBlockAckInactivityTimeout (uint16_t timeout) |
| 250 |
{ |
| 251 |
NS_LOG_FUNCTION (this << timeout); |
| 252 |
m_edca.find (AC_VO)->second->SetBlockAckInactivityTimeout (timeout); |
| 253 |
} |
| 254 |
|
| 255 |
void |
| 256 |
RegularWifiMac::SetViBlockAckInactivityTimeout (uint16_t timeout) |
| 257 |
{ |
| 258 |
NS_LOG_FUNCTION (this << timeout); |
| 259 |
m_edca.find (AC_VI)->second->SetBlockAckInactivityTimeout (timeout); |
| 260 |
} |
| 261 |
|
| 262 |
void |
| 263 |
RegularWifiMac::SetBeBlockAckInactivityTimeout (uint16_t timeout) |
| 264 |
{ |
| 265 |
NS_LOG_FUNCTION (this << timeout); |
| 266 |
m_edca.find (AC_BE)->second->SetBlockAckInactivityTimeout (timeout); |
| 267 |
} |
| 268 |
|
| 269 |
void |
| 270 |
RegularWifiMac::SetBkBlockAckInactivityTimeout (uint16_t timeout) |
| 271 |
{ |
| 272 |
NS_LOG_FUNCTION (this << timeout); |
| 273 |
m_edca.find (AC_BK)->second->SetBlockAckInactivityTimeout (timeout); |
| 274 |
} |
| 275 |
|
| 276 |
void |
| 140 |
RegularWifiMac::SetupEdcaQueue (enum AcIndex ac) |
277 |
RegularWifiMac::SetupEdcaQueue (enum AcIndex ac) |
| 141 |
{ |
278 |
{ |
| 142 |
NS_LOG_FUNCTION (this << ac); |
279 |
NS_LOG_FUNCTION (this << ac); |
|
|
| 146 |
NS_ASSERT (m_edca.find (ac) == m_edca.end ()); |
283 |
NS_ASSERT (m_edca.find (ac) == m_edca.end ()); |
| 147 |
|
284 |
|
| 148 |
Ptr<EdcaTxopN> edca = CreateObject<EdcaTxopN> (); |
285 |
Ptr<EdcaTxopN> edca = CreateObject<EdcaTxopN> (); |
|
|
286 |
Ptr<MsduStandardAggregator> msduAggregator = CreateObject<MsduStandardAggregator> (); |
| 287 |
Ptr<MpduStandardAggregator> mpduAggregator = CreateObject<MpduStandardAggregator> (); |
| 288 |
|
| 149 |
edca->SetLow (m_low); |
289 |
edca->SetLow (m_low); |
| 150 |
edca->SetManager (m_dcfManager); |
290 |
edca->SetManager (m_dcfManager); |
| 151 |
edca->SetTxMiddle (m_txMiddle); |
291 |
edca->SetTxMiddle (m_txMiddle); |
| 152 |
edca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this)); |
292 |
edca->SetTxOkCallback (MakeCallback (&RegularWifiMac::TxOk, this)); |
| 153 |
edca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this)); |
293 |
edca->SetTxFailedCallback (MakeCallback (&RegularWifiMac::TxFailed, this)); |
| 154 |
edca->SetAccessCategory (ac); |
294 |
edca->SetAccessCategory (ac); |
|
|
295 |
edca->SetMsduAggregator (msduAggregator); |
| 296 |
edca->SetMpduAggregator (mpduAggregator); |
| 155 |
edca->CompleteConfig (); |
297 |
edca->CompleteConfig (); |
|
|
298 |
|
| 156 |
m_edca.insert (std::make_pair (ac, edca)); |
299 |
m_edca.insert (std::make_pair (ac, edca)); |
| 157 |
} |
300 |
} |
| 158 |
|
301 |
|
|
|
| 684 |
MakeBooleanAccessor (&RegularWifiMac::SetCtsToSelfSupported, |
827 |
MakeBooleanAccessor (&RegularWifiMac::SetCtsToSelfSupported, |
| 685 |
&RegularWifiMac::GetCtsToSelfSupported), |
828 |
&RegularWifiMac::GetCtsToSelfSupported), |
| 686 |
MakeBooleanChecker ()) |
829 |
MakeBooleanChecker ()) |
|
|
830 |
.AddAttribute ("VO_MaxAmsduSize", |
| 831 |
"Maximum length in bytes of an A-MSDU for AC_VO access class", |
| 832 |
UintegerValue (0), |
| 833 |
MakeUintegerAccessor (&RegularWifiMac::SetVoMaxAmsduSize), |
| 834 |
MakeUintegerChecker<uint32_t> ()) |
| 835 |
.AddAttribute ("VI_MaxAmsduSize", |
| 836 |
"Maximum length in bytes of an A-MSDU for AC_VI access class", |
| 837 |
UintegerValue (0), |
| 838 |
MakeUintegerAccessor (&RegularWifiMac::SetViMaxAmsduSize), |
| 839 |
MakeUintegerChecker<uint32_t> ()) |
| 840 |
.AddAttribute ("BE_MaxAmsduSize", |
| 841 |
"Maximum length in bytes of an A-MSDU for AC_BE access class", |
| 842 |
UintegerValue (0), |
| 843 |
MakeUintegerAccessor (&RegularWifiMac::SetBeMaxAmsduSize), |
| 844 |
MakeUintegerChecker<uint32_t> ()) |
| 845 |
.AddAttribute ("BK_MaxAmsduSize", |
| 846 |
"Maximum length in bytes of an A-MSDU for AC_BK access class", |
| 847 |
UintegerValue (0), |
| 848 |
MakeUintegerAccessor (&RegularWifiMac::SetBkMaxAmsduSize), |
| 849 |
MakeUintegerChecker<uint32_t> ()) |
| 850 |
.AddAttribute ("VO_MaxAmpduSize", |
| 851 |
"Maximum length in bytes of an A-MPDU for AC_VO access class", |
| 852 |
UintegerValue (0), |
| 853 |
MakeUintegerAccessor (&RegularWifiMac::SetVoMaxAmpduSize), |
| 854 |
MakeUintegerChecker<uint32_t> ()) |
| 855 |
.AddAttribute ("VI_MaxAmpduSize", |
| 856 |
"Maximum length in bytes of an A-MPDU for AC_VI access class", |
| 857 |
UintegerValue (0), |
| 858 |
MakeUintegerAccessor (&RegularWifiMac::SetViMaxAmpduSize), |
| 859 |
MakeUintegerChecker<uint32_t> ()) |
| 860 |
.AddAttribute ("BE_MaxAmpduSize", |
| 861 |
"Maximum length in bytes of an A-MPDU for AC_BE access class", |
| 862 |
UintegerValue (0), |
| 863 |
MakeUintegerAccessor (&RegularWifiMac::SetBeMaxAmpduSize), |
| 864 |
MakeUintegerChecker<uint32_t> ()) |
| 865 |
.AddAttribute ("BK_MaxAmpduSize", |
| 866 |
"Maximum length in bytes of an A-MPDU for AC_BK access class", |
| 867 |
UintegerValue (0), |
| 868 |
MakeUintegerAccessor (&RegularWifiMac::SetBkMaxAmpduSize), |
| 869 |
MakeUintegerChecker<uint32_t> ()) |
| 870 |
.AddAttribute ("VO_BlockAckThreshold", |
| 871 |
"If number of packets in VO queue reaches this value, " |
| 872 |
"block ack mechanism is used. If this value is 0, block ack is never used.", |
| 873 |
UintegerValue (0), |
| 874 |
MakeUintegerAccessor (&RegularWifiMac::SetVoBlockAckThreshold), |
| 875 |
MakeUintegerChecker<uint8_t> (0, 64)) |
| 876 |
.AddAttribute ("VI_BlockAckThreshold", |
| 877 |
"If number of packets in VI queue reaches this value, " |
| 878 |
"block ack mechanism is used. If this value is 0, block ack is never used.", |
| 879 |
UintegerValue (0), |
| 880 |
MakeUintegerAccessor (&RegularWifiMac::SetViBlockAckThreshold), |
| 881 |
MakeUintegerChecker<uint8_t> (0, 64)) |
| 882 |
.AddAttribute ("BE_BlockAckThreshold", |
| 883 |
"If number of packets in BE queue reaches this value, " |
| 884 |
"block ack mechanism is used. If this value is 0, block ack is never used.", |
| 885 |
UintegerValue (0), |
| 886 |
MakeUintegerAccessor (&RegularWifiMac::SetBeBlockAckThreshold), |
| 887 |
MakeUintegerChecker<uint8_t> (0, 64)) |
| 888 |
.AddAttribute ("BK_BlockAckThreshold", |
| 889 |
"If number of packets in BK queue reaches this value, " |
| 890 |
"block ack mechanism is used. If this value is 0, block ack is never used.", |
| 891 |
UintegerValue (0), |
| 892 |
MakeUintegerAccessor (&RegularWifiMac::SetBkBlockAckThreshold), |
| 893 |
MakeUintegerChecker<uint8_t> (0, 64)) |
| 894 |
.AddAttribute ("VO_BlockAckInactivityTimeout", |
| 895 |
"Represents max time (blocks of 1024 micro seconds) allowed for block ack" |
| 896 |
"inactivity for AC_VO. If this value isn't equal to 0 a timer start after that a" |
| 897 |
"block ack setup is completed and will be reset every time that a block ack" |
| 898 |
"frame is received. If this value is 0, block ack inactivity timeout won't be used.", |
| 899 |
UintegerValue (0), |
| 900 |
MakeUintegerAccessor (&RegularWifiMac::SetVoBlockAckInactivityTimeout), |
| 901 |
MakeUintegerChecker<uint16_t> ()) |
| 902 |
.AddAttribute ("VI_BlockAckInactivityTimeout", |
| 903 |
"Represents max time (blocks of 1024 micro seconds) allowed for block ack" |
| 904 |
"inactivity for AC_VI. If this value isn't equal to 0 a timer start after that a" |
| 905 |
"block ack setup is completed and will be reset every time that a block ack" |
| 906 |
"frame is received. If this value is 0, block ack inactivity timeout won't be used.", |
| 907 |
UintegerValue (0), |
| 908 |
MakeUintegerAccessor (&RegularWifiMac::SetViBlockAckInactivityTimeout), |
| 909 |
MakeUintegerChecker<uint16_t> ()) |
| 910 |
.AddAttribute ("BE_BlockAckInactivityTimeout", |
| 911 |
"Represents max time (blocks of 1024 micro seconds) allowed for block ack" |
| 912 |
"inactivity for AC_BE. If this value isn't equal to 0 a timer start after that a" |
| 913 |
"block ack setup is completed and will be reset every time that a block ack" |
| 914 |
"frame is received. If this value is 0, block ack inactivity timeout won't be used.", |
| 915 |
UintegerValue (0), |
| 916 |
MakeUintegerAccessor (&RegularWifiMac::SetBeBlockAckInactivityTimeout), |
| 917 |
MakeUintegerChecker<uint16_t> ()) |
| 918 |
.AddAttribute ("BK_BlockAckInactivityTimeout", |
| 919 |
"Represents max time (blocks of 1024 micro seconds) allowed for block ack" |
| 920 |
"inactivity for AC_BK. If this value isn't equal to 0 a timer start after that a" |
| 921 |
"block ack setup is completed and will be reset every time that a block ack" |
| 922 |
"frame is received. If this value is 0, block ack inactivity timeout won't be used.", |
| 923 |
UintegerValue (0), |
| 924 |
MakeUintegerAccessor (&RegularWifiMac::SetBkBlockAckInactivityTimeout), |
| 925 |
MakeUintegerChecker<uint16_t> ()) |
| 687 |
.AddAttribute ("DcaTxop", "The DcaTxop object", |
926 |
.AddAttribute ("DcaTxop", "The DcaTxop object", |
| 688 |
PointerValue (), |
927 |
PointerValue (), |
| 689 |
MakePointerAccessor (&RegularWifiMac::GetDcaTxop), |
928 |
MakePointerAccessor (&RegularWifiMac::GetDcaTxop), |
|
|
| 723 |
void |
962 |
void |
| 724 |
RegularWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard) |
963 |
RegularWifiMac::FinishConfigureStandard (enum WifiPhyStandard standard) |
| 725 |
{ |
964 |
{ |
| 726 |
uint32_t cwmin; |
965 |
uint32_t cwmin = 0; |
| 727 |
uint32_t cwmax; |
966 |
uint32_t cwmax = 0; |
| 728 |
|
967 |
|
| 729 |
switch (standard) |
968 |
switch (standard) |
| 730 |
{ |
969 |
{ |