LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2005,2006,2007 INRIA | 3 * Copyright (c) 2005,2006,2007 INRIA |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 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 | 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 | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> | 18 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
19 */ | 19 */ |
20 | 20 |
21 #include "wifi-remote-station-manager.h" | |
22 #include "ns3/simulator.h" | |
23 #include "ns3/log.h" | 21 #include "ns3/log.h" |
24 #include "ns3/boolean.h" | 22 #include "ns3/boolean.h" |
| 23 #include "ns3/uinteger.h" |
25 #include "ns3/enum.h" | 24 #include "ns3/enum.h" |
| 25 #include "ns3/packet.h" |
| 26 #include "ns3/simulator.h" |
| 27 #include "ns3/tag.h" |
| 28 #include "wifi-remote-station-manager.h" |
| 29 #include "wifi-phy.h" |
26 #include "wifi-mac.h" | 30 #include "wifi-mac.h" |
27 #include "wifi-utils.h" | 31 #include "wifi-utils.h" |
28 #include "wifi-mac-header.h" | 32 #include "wifi-mac-header.h" |
29 #include "wifi-mac-trailer.h" | 33 #include "wifi-mac-trailer.h" |
| 34 #include "ht-capabilities.h" |
| 35 #include "vht-capabilities.h" |
| 36 #include "he-capabilities.h" |
30 | 37 |
31 /*************************************************************** | 38 /*************************************************************** |
32 * Packet Mode Tagger | 39 * Packet Mode Tagger |
33 ***************************************************************/ | 40 ***************************************************************/ |
34 | 41 |
35 namespace ns3 { | 42 namespace ns3 { |
36 | 43 |
37 NS_LOG_COMPONENT_DEFINE ("WifiRemoteStationManager"); | 44 NS_LOG_COMPONENT_DEFINE ("WifiRemoteStationManager"); |
38 | 45 |
39 /** | 46 /** |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 "Otherwise, we modelize a high-latency device, that is a devi
ce where we cannot update " | 330 "Otherwise, we modelize a high-latency device, that is a devi
ce where we cannot update " |
324 "our decision about tx parameters after every packet transmis
sion.", | 331 "our decision about tx parameters after every packet transmis
sion.", |
325 TypeId::ATTR_GET, | 332 TypeId::ATTR_GET, |
326 BooleanValue (true), //this value is ignored because there is
no setter | 333 BooleanValue (true), //this value is ignored because there is
no setter |
327 MakeBooleanAccessor (&WifiRemoteStationManager::IsLowLatency)
, | 334 MakeBooleanAccessor (&WifiRemoteStationManager::IsLowLatency)
, |
328 MakeBooleanChecker ()) | 335 MakeBooleanChecker ()) |
329 .AddAttribute ("MaxSsrc", | 336 .AddAttribute ("MaxSsrc", |
330 "The maximum number of retransmission attempts for an RTS. " | 337 "The maximum number of retransmission attempts for an RTS. " |
331 " This value will not have any effect on some rate control al
gorithms.", | 338 " This value will not have any effect on some rate control al
gorithms.", |
332 UintegerValue (7), | 339 UintegerValue (7), |
333 MakeUintegerAccessor (&WifiRemoteStationManager::m_maxSsrc), | 340 MakeUintegerAccessor (&WifiRemoteStationManager::SetMaxSsrc), |
334 MakeUintegerChecker<uint32_t> ()) | 341 MakeUintegerChecker<uint32_t> ()) |
335 .AddAttribute ("MaxSlrc", | 342 .AddAttribute ("MaxSlrc", |
336 "The maximum number of retransmission attempts for a DATA pac
ket. " | 343 "The maximum number of retransmission attempts for a DATA pac
ket. " |
337 "This value will not have any effect on some rate control alg
orithms.", | 344 "This value will not have any effect on some rate control alg
orithms.", |
338 UintegerValue (7), | 345 UintegerValue (7), |
339 MakeUintegerAccessor (&WifiRemoteStationManager::m_maxSlrc), | 346 MakeUintegerAccessor (&WifiRemoteStationManager::SetMaxSlrc), |
340 MakeUintegerChecker<uint32_t> ()) | 347 MakeUintegerChecker<uint32_t> ()) |
341 .AddAttribute ("RtsCtsThreshold", | 348 .AddAttribute ("RtsCtsThreshold", |
342 "If the size of the PSDU is bigger than this value, we use an
RTS/CTS handshake before sending the data frame." | 349 "If the size of the PSDU is bigger than this value, we use an
RTS/CTS handshake before sending the data frame." |
343 "This value will not have any effect on some rate control alg
orithms.", | 350 "This value will not have any effect on some rate control alg
orithms.", |
344 UintegerValue (65535), | 351 UintegerValue (65535), |
345 MakeUintegerAccessor (&WifiRemoteStationManager::m_rtsCtsThre
shold), | 352 MakeUintegerAccessor (&WifiRemoteStationManager::SetRtsCtsThr
eshold), |
346 MakeUintegerChecker<uint32_t> ()) | 353 MakeUintegerChecker<uint32_t> ()) |
347 .AddAttribute ("FragmentationThreshold", | 354 .AddAttribute ("FragmentationThreshold", |
348 "If the size of the PSDU is bigger than this value, we fragme
nt it such that the size of the fragments are equal or smaller. " | 355 "If the size of the PSDU is bigger than this value, we fragme
nt it such that the size of the fragments are equal or smaller. " |
349 "This value does not apply when it is carried in an A-MPDU. " | 356 "This value does not apply when it is carried in an A-MPDU. " |
350 "This value will not have any effect on some rate control alg
orithms.", | 357 "This value will not have any effect on some rate control alg
orithms.", |
351 UintegerValue (2346), | 358 UintegerValue (2346), |
352 MakeUintegerAccessor (&WifiRemoteStationManager::DoSetFragmen
tationThreshold, | 359 MakeUintegerAccessor (&WifiRemoteStationManager::DoSetFragmen
tationThreshold, |
353 &WifiRemoteStationManager::DoGetFragmen
tationThreshold), | 360 &WifiRemoteStationManager::DoGetFragmen
tationThreshold), |
354 MakeUintegerChecker<uint32_t> ()) | 361 MakeUintegerChecker<uint32_t> ()) |
355 .AddAttribute ("NonUnicastMode", | 362 .AddAttribute ("NonUnicastMode", |
356 "Wifi mode used for non-unicast transmissions.", | 363 "Wifi mode used for non-unicast transmissions.", |
357 WifiModeValue (), | 364 WifiModeValue (), |
358 MakeWifiModeAccessor (&WifiRemoteStationManager::m_nonUnicast
Mode), | 365 MakeWifiModeAccessor (&WifiRemoteStationManager::m_nonUnicast
Mode), |
359 MakeWifiModeChecker ()) | 366 MakeWifiModeChecker ()) |
360 .AddAttribute ("DefaultTxPowerLevel", | 367 .AddAttribute ("DefaultTxPowerLevel", |
361 "Default power level to be used for transmissions. " | 368 "Default power level to be used for transmissions. " |
362 "This is the power level that is used by all those WifiManage
rs that do not implement TX power control.", | 369 "This is the power level that is used by all those WifiManage
rs that do not implement TX power control.", |
363 UintegerValue (0), | 370 UintegerValue (0), |
364 MakeUintegerAccessor (&WifiRemoteStationManager::m_defaultTxP
owerLevel), | 371 MakeUintegerAccessor (&WifiRemoteStationManager::m_defaultTxP
owerLevel), |
365 MakeUintegerChecker<uint8_t> ()) | 372 MakeUintegerChecker<uint8_t> ()) |
366 .AddAttribute ("ErpProtectionMode", | 373 .AddAttribute ("ErpProtectionMode", |
367 "Protection mode used when non-ERP STAs are connected to an E
RP AP: Rts-Cts or Cts-To-Self", | 374 "Protection mode used when non-ERP STAs are connected to an E
RP AP: Rts-Cts or Cts-To-Self", |
368 EnumValue (WifiRemoteStationManager::CTS_TO_SELF), | 375 EnumValue (WifiRemoteStationManager::CTS_TO_SELF), |
369 MakeEnumAccessor (&WifiRemoteStationManager::SetErpProtection
Mode, | 376 MakeEnumAccessor (&WifiRemoteStationManager::m_erpProtectionM
ode), |
370 &WifiRemoteStationManager::GetErpProtection
Mode), | |
371 MakeEnumChecker (WifiRemoteStationManager::RTS_CTS, "Rts-Cts"
, | 377 MakeEnumChecker (WifiRemoteStationManager::RTS_CTS, "Rts-Cts"
, |
372 WifiRemoteStationManager::CTS_TO_SELF, "Cts-
To-Self")) | 378 WifiRemoteStationManager::CTS_TO_SELF, "Cts-
To-Self")) |
373 .AddAttribute ("HtProtectionMode", | 379 .AddAttribute ("HtProtectionMode", |
374 "Protection mode used when non-HT STAs are connected to a HT
AP: Rts-Cts or Cts-To-Self", | 380 "Protection mode used when non-HT STAs are connected to a HT
AP: Rts-Cts or Cts-To-Self", |
375 EnumValue (WifiRemoteStationManager::CTS_TO_SELF), | 381 EnumValue (WifiRemoteStationManager::CTS_TO_SELF), |
376 MakeEnumAccessor (&WifiRemoteStationManager::SetHtProtectionM
ode, | 382 MakeEnumAccessor (&WifiRemoteStationManager::m_htProtectionMo
de), |
377 &WifiRemoteStationManager::GetHtProtectionM
ode), | |
378 MakeEnumChecker (WifiRemoteStationManager::RTS_CTS, "Rts-Cts"
, | 383 MakeEnumChecker (WifiRemoteStationManager::RTS_CTS, "Rts-Cts"
, |
379 WifiRemoteStationManager::CTS_TO_SELF, "Cts-
To-Self")) | 384 WifiRemoteStationManager::CTS_TO_SELF, "Cts-
To-Self")) |
380 .AddTraceSource ("MacTxRtsFailed", | 385 .AddTraceSource ("MacTxRtsFailed", |
381 "The transmission of a RTS by the MAC layer has failed", | 386 "The transmission of a RTS by the MAC layer has failed", |
382 MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTx
RtsFailed), | 387 MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTx
RtsFailed), |
383 "ns3::Mac48Address::TracedCallback") | 388 "ns3::Mac48Address::TracedCallback") |
384 .AddTraceSource ("MacTxDataFailed", | 389 .AddTraceSource ("MacTxDataFailed", |
385 "The transmission of a data packet by the MAC layer has fai
led", | 390 "The transmission of a data packet by the MAC layer has fai
led", |
386 MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTx
DataFailed), | 391 MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTx
DataFailed), |
387 "ns3::Mac48Address::TracedCallback") | 392 "ns3::Mac48Address::TracedCallback") |
388 .AddTraceSource ("MacTxFinalRtsFailed", | 393 .AddTraceSource ("MacTxFinalRtsFailed", |
389 "The transmission of a RTS has exceeded the maximum number
of attempts", | 394 "The transmission of a RTS has exceeded the maximum number
of attempts", |
390 MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTx
FinalRtsFailed), | 395 MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTx
FinalRtsFailed), |
391 "ns3::Mac48Address::TracedCallback") | 396 "ns3::Mac48Address::TracedCallback") |
392 .AddTraceSource ("MacTxFinalDataFailed", | 397 .AddTraceSource ("MacTxFinalDataFailed", |
393 "The transmission of a data packet has exceeded the maximum
number of attempts", | 398 "The transmission of a data packet has exceeded the maximum
number of attempts", |
394 MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTx
FinalDataFailed), | 399 MakeTraceSourceAccessor (&WifiRemoteStationManager::m_macTx
FinalDataFailed), |
395 "ns3::Mac48Address::TracedCallback") | 400 "ns3::Mac48Address::TracedCallback") |
396 ; | 401 ; |
397 return tid; | 402 return tid; |
398 } | 403 } |
399 | 404 |
400 WifiRemoteStationManager::WifiRemoteStationManager () | 405 WifiRemoteStationManager::WifiRemoteStationManager () |
401 : m_qosSupported (false), | 406 : m_htSupported (false), |
402 m_htSupported (false), | |
403 m_vhtSupported (false), | 407 m_vhtSupported (false), |
404 m_heSupported (false), | 408 m_heSupported (false), |
405 m_useNonErpProtection (false), | 409 m_useNonErpProtection (false), |
406 m_useNonHtProtection (false), | 410 m_useNonHtProtection (false), |
407 m_useGreenfieldProtection (false), | 411 m_useGreenfieldProtection (false), |
408 m_shortPreambleEnabled (false), | 412 m_shortPreambleEnabled (false), |
409 m_shortSlotTimeEnabled (false), | 413 m_shortSlotTimeEnabled (false), |
410 m_rifsPermitted (false) | 414 m_rifsPermitted (false) |
411 { | 415 { |
| 416 NS_LOG_FUNCTION (this); |
412 } | 417 } |
413 | 418 |
414 WifiRemoteStationManager::~WifiRemoteStationManager () | 419 WifiRemoteStationManager::~WifiRemoteStationManager () |
415 { | 420 { |
| 421 NS_LOG_FUNCTION (this); |
416 } | 422 } |
417 | 423 |
418 void | 424 void |
419 WifiRemoteStationManager::DoDispose (void) | 425 WifiRemoteStationManager::DoDispose (void) |
420 { | 426 { |
421 for (StationStates::const_iterator i = m_states.begin (); i != m_states.end ()
; i++) | 427 NS_LOG_FUNCTION (this); |
422 { | 428 Reset (); |
423 delete (*i); | |
424 } | |
425 m_states.clear (); | |
426 for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end ();
i++) | |
427 { | |
428 delete (*i); | |
429 } | |
430 m_stations.clear (); | |
431 } | 429 } |
432 | 430 |
433 void | 431 void |
434 WifiRemoteStationManager::SetupPhy (const Ptr<WifiPhy> phy) | 432 WifiRemoteStationManager::SetupPhy (const Ptr<WifiPhy> phy) |
435 { | 433 { |
| 434 NS_LOG_FUNCTION (this << phy); |
436 //We need to track our PHY because it is the object that knows the | 435 //We need to track our PHY because it is the object that knows the |
437 //full set of transmit rates that are supported. We need to know | 436 //full set of transmit rates that are supported. We need to know |
438 //this in order to find the relevant mandatory rates when chosing a | 437 //this in order to find the relevant mandatory rates when chosing a |
439 //transmit rate for automatic control responses like | 438 //transmit rate for automatic control responses like |
440 //acknowledgements. | 439 //acknowledgements. |
441 m_wifiPhy = phy; | 440 m_wifiPhy = phy; |
442 m_defaultTxMode = phy->GetMode (0); | 441 m_defaultTxMode = phy->GetMode (0); |
443 NS_ASSERT (m_defaultTxMode.IsMandatory ()); | 442 NS_ASSERT (m_defaultTxMode.IsMandatory ()); |
444 if (HasHtSupported () || HasVhtSupported () || HasHeSupported ()) | 443 if (HasHtSupported () || HasVhtSupported () || HasHeSupported ()) |
445 { | 444 { |
446 m_defaultTxMcs = phy->GetMcs (0); | 445 m_defaultTxMcs = phy->GetMcs (0); |
447 } | 446 } |
448 Reset (); | 447 Reset (); |
449 } | 448 } |
450 | 449 |
451 void | 450 void |
452 WifiRemoteStationManager::SetupMac (const Ptr<WifiMac> mac) | 451 WifiRemoteStationManager::SetupMac (const Ptr<WifiMac> mac) |
453 { | 452 { |
| 453 NS_LOG_FUNCTION (this << mac); |
454 //We need to track our MAC because it is the object that knows the | 454 //We need to track our MAC because it is the object that knows the |
455 //full set of interframe spaces. | 455 //full set of interframe spaces. |
456 m_wifiMac = mac; | 456 m_wifiMac = mac; |
457 Reset (); | 457 Reset (); |
458 } | 458 } |
459 | 459 |
460 void | 460 void |
461 WifiRemoteStationManager::SetQosSupported (bool enable) | 461 WifiRemoteStationManager::SetMaxSsrc (uint32_t maxSsrc) |
462 { | 462 { |
463 m_qosSupported = enable; | 463 NS_LOG_FUNCTION (this << maxSsrc); |
| 464 m_maxSsrc = maxSsrc; |
| 465 } |
| 466 |
| 467 void |
| 468 WifiRemoteStationManager::SetMaxSlrc (uint32_t maxSlrc) |
| 469 { |
| 470 NS_LOG_FUNCTION (this << maxSlrc); |
| 471 m_maxSlrc = maxSlrc; |
| 472 } |
| 473 |
| 474 void |
| 475 WifiRemoteStationManager::SetRtsCtsThreshold (uint32_t threshold) |
| 476 { |
| 477 NS_LOG_FUNCTION (this << threshold); |
| 478 m_rtsCtsThreshold = threshold; |
464 } | 479 } |
465 | 480 |
466 void | 481 void |
467 WifiRemoteStationManager::SetHtSupported (bool enable) | 482 WifiRemoteStationManager::SetHtSupported (bool enable) |
468 { | 483 { |
| 484 NS_LOG_FUNCTION (this << enable); |
469 m_htSupported = enable; | 485 m_htSupported = enable; |
470 } | 486 } |
471 | 487 |
472 void | 488 void |
473 WifiRemoteStationManager::SetMaxSsrc (uint32_t maxSsrc) | |
474 { | |
475 m_maxSsrc = maxSsrc; | |
476 } | |
477 | |
478 void | |
479 WifiRemoteStationManager::SetMaxSlrc (uint32_t maxSlrc) | |
480 { | |
481 m_maxSlrc = maxSlrc; | |
482 } | |
483 | |
484 void | |
485 WifiRemoteStationManager::SetRtsCtsThreshold (uint32_t threshold) | |
486 { | |
487 m_rtsCtsThreshold = threshold; | |
488 } | |
489 | |
490 void | |
491 WifiRemoteStationManager::SetFragmentationThreshold (uint32_t threshold) | 489 WifiRemoteStationManager::SetFragmentationThreshold (uint32_t threshold) |
492 { | 490 { |
| 491 NS_LOG_FUNCTION (this << threshold); |
493 DoSetFragmentationThreshold (threshold); | 492 DoSetFragmentationThreshold (threshold); |
494 } | |
495 | |
496 void | |
497 WifiRemoteStationManager::SetErpProtectionMode (WifiRemoteStationManager::Protec
tionMode mode) | |
498 { | |
499 NS_LOG_FUNCTION (this << mode); | |
500 m_erpProtectionMode = mode; | |
501 } | |
502 | |
503 void | |
504 WifiRemoteStationManager::SetHtProtectionMode (WifiRemoteStationManager::Protect
ionMode mode) | |
505 { | |
506 NS_LOG_FUNCTION (this << mode); | |
507 m_htProtectionMode = mode; | |
508 } | 493 } |
509 | 494 |
510 void | 495 void |
511 WifiRemoteStationManager::SetShortPreambleEnabled (bool enable) | 496 WifiRemoteStationManager::SetShortPreambleEnabled (bool enable) |
512 { | 497 { |
513 NS_LOG_FUNCTION (this << enable); | 498 NS_LOG_FUNCTION (this << enable); |
514 m_shortPreambleEnabled = enable; | 499 m_shortPreambleEnabled = enable; |
515 } | 500 } |
516 | 501 |
517 void | 502 void |
(...skipping 21 matching lines...) Expand all Loading... |
539 { | 524 { |
540 return m_shortPreambleEnabled; | 525 return m_shortPreambleEnabled; |
541 } | 526 } |
542 | 527 |
543 bool | 528 bool |
544 WifiRemoteStationManager::GetRifsPermitted (void) const | 529 WifiRemoteStationManager::GetRifsPermitted (void) const |
545 { | 530 { |
546 return m_rifsPermitted; | 531 return m_rifsPermitted; |
547 } | 532 } |
548 | 533 |
549 WifiRemoteStationManager::ProtectionMode | |
550 WifiRemoteStationManager::GetErpProtectionMode (void) const | |
551 { | |
552 return m_erpProtectionMode; | |
553 } | |
554 | |
555 WifiRemoteStationManager::ProtectionMode | |
556 WifiRemoteStationManager::GetHtProtectionMode (void) const | |
557 { | |
558 return m_htProtectionMode; | |
559 } | |
560 | |
561 bool | |
562 WifiRemoteStationManager::HasQosSupported (void) const | |
563 { | |
564 return m_qosSupported; | |
565 } | |
566 | |
567 bool | 534 bool |
568 WifiRemoteStationManager::HasHtSupported (void) const | 535 WifiRemoteStationManager::HasHtSupported (void) const |
569 { | 536 { |
570 return m_htSupported; | 537 return m_htSupported; |
571 } | 538 } |
572 | 539 |
573 void | 540 void |
574 WifiRemoteStationManager::SetVhtSupported (bool enable) | 541 WifiRemoteStationManager::SetVhtSupported (bool enable) |
575 { | 542 { |
576 m_vhtSupported = enable; | 543 m_vhtSupported = enable; |
577 } | 544 } |
578 | 545 |
579 bool | 546 bool |
580 WifiRemoteStationManager::HasVhtSupported (void) const | 547 WifiRemoteStationManager::HasVhtSupported (void) const |
581 { | 548 { |
582 return m_vhtSupported; | 549 return m_vhtSupported; |
583 } | 550 } |
584 | 551 |
585 void | 552 void |
586 WifiRemoteStationManager::SetHeSupported (bool enable) | 553 WifiRemoteStationManager::SetHeSupported (bool enable) |
587 { | 554 { |
588 m_heSupported = enable; | 555 m_heSupported = enable; |
589 } | 556 } |
590 | 557 |
591 bool | 558 bool |
592 WifiRemoteStationManager::HasHeSupported (void) const | 559 WifiRemoteStationManager::HasHeSupported (void) const |
593 { | 560 { |
594 return m_heSupported; | 561 return m_heSupported; |
595 } | |
596 | |
597 uint32_t | |
598 WifiRemoteStationManager::GetMaxSsrc (void) const | |
599 { | |
600 return m_maxSsrc; | |
601 } | |
602 | |
603 uint32_t | |
604 WifiRemoteStationManager::GetMaxSlrc (void) const | |
605 { | |
606 return m_maxSlrc; | |
607 } | |
608 | |
609 uint32_t | |
610 WifiRemoteStationManager::GetRtsCtsThreshold (void) const | |
611 { | |
612 return m_rtsCtsThreshold; | |
613 } | 562 } |
614 | 563 |
615 uint32_t | 564 uint32_t |
616 WifiRemoteStationManager::GetFragmentationThreshold (void) const | 565 WifiRemoteStationManager::GetFragmentationThreshold (void) const |
617 { | 566 { |
618 return DoGetFragmentationThreshold (); | 567 return DoGetFragmentationThreshold (); |
619 } | 568 } |
620 | 569 |
621 void | 570 void |
622 WifiRemoteStationManager::AddSupportedPlcpPreamble (Mac48Address address, bool i
sShortPreambleSupported) | 571 WifiRemoteStationManager::AddSupportedPlcpPreamble (Mac48Address address, bool i
sShortPreambleSupported) |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 ConstCast<Packet> (packet)->RemovePacketTag (ctstoselftag); | 755 ConstCast<Packet> (packet)->RemovePacketTag (ctstoselftag); |
807 datatag = HighLatencyDataTxVectorTag (data); | 756 datatag = HighLatencyDataTxVectorTag (data); |
808 rtstag = HighLatencyRtsTxVectorTag (rts); | 757 rtstag = HighLatencyRtsTxVectorTag (rts); |
809 ctstoselftag = HighLatencyCtsToSelfTxVectorTag (ctstoself); | 758 ctstoselftag = HighLatencyCtsToSelfTxVectorTag (ctstoself); |
810 //and then, add it back | 759 //and then, add it back |
811 packet->AddPacketTag (datatag); | 760 packet->AddPacketTag (datatag); |
812 packet->AddPacketTag (rtstag); | 761 packet->AddPacketTag (rtstag); |
813 packet->AddPacketTag (ctstoselftag); | 762 packet->AddPacketTag (ctstoselftag); |
814 } | 763 } |
815 | 764 |
816 uint8_t | 765 uint16_t |
817 WifiRemoteStationManager::GetChannelWidthForTransmission (WifiMode mode, uint8_t
maxSupportedChannelWidth) | 766 WifiRemoteStationManager::GetChannelWidthForTransmission (WifiMode mode, uint16_
t maxSupportedChannelWidth) |
818 { | 767 { |
819 NS_LOG_FUNCTION (mode << static_cast<uint16_t> (maxSupportedChannelWidth)); | 768 NS_LOG_FUNCTION (mode << maxSupportedChannelWidth); |
820 WifiModulationClass modulationClass = mode.GetModulationClass (); | 769 WifiModulationClass modulationClass = mode.GetModulationClass (); |
821 if (maxSupportedChannelWidth > 20 | 770 if (maxSupportedChannelWidth > 20 |
822 && (modulationClass == WifiModulationClass::WIFI_MOD_CLASS_OFDM // all non
-HT OFDM control and management frames | 771 && (modulationClass == WifiModulationClass::WIFI_MOD_CLASS_OFDM // all non
-HT OFDM control and management frames |
823 || modulationClass == WifiModulationClass::WIFI_MOD_CLASS_ERP_OFDM)) /
/ special case of beacons at 2.4 GHz | 772 || modulationClass == WifiModulationClass::WIFI_MOD_CLASS_ERP_OFDM)) /
/ special case of beacons at 2.4 GHz |
824 { | 773 { |
825 NS_LOG_LOGIC ("Channel width reduced to 20 MHz"); | 774 NS_LOG_LOGIC ("Channel width reduced to 20 MHz"); |
826 return 20; | 775 return 20; |
| 776 } |
| 777 //at 2.4 GHz basic rate can be non-ERP DSSS |
| 778 if (modulationClass == WifiModulationClass::WIFI_MOD_CLASS_DSSS |
| 779 || modulationClass == WifiModulationClass::WIFI_MOD_CLASS_HR_DSSS) |
| 780 { |
| 781 return 22; |
827 } | 782 } |
828 return maxSupportedChannelWidth; | 783 return maxSupportedChannelWidth; |
829 } | 784 } |
830 | 785 |
831 WifiTxVector | 786 WifiTxVector |
832 WifiRemoteStationManager::GetDataTxVector (Mac48Address address, const WifiMacHe
ader *header, Ptr<const Packet> packet) | 787 WifiRemoteStationManager::GetDataTxVector (Mac48Address address, const WifiMacHe
ader *header, Ptr<const Packet> packet) |
833 { | 788 { |
834 NS_LOG_FUNCTION (this << address << *header << packet); | 789 NS_LOG_FUNCTION (this << address << *header << packet); |
835 if (address.IsGroup ()) | 790 if (address.IsGroup ()) |
836 { | 791 { |
837 WifiMode mode = GetNonUnicastMode (); | 792 WifiMode mode = GetNonUnicastMode (); |
838 WifiTxVector v; | 793 WifiTxVector v; |
839 v.SetMode (mode); | 794 v.SetMode (mode); |
840 v.SetPreambleType (GetPreambleForTransmission (mode, address)); | 795 v.SetPreambleType (GetPreambleForTransmission (mode, address)); |
841 v.SetTxPowerLevel (m_defaultTxPowerLevel); | 796 v.SetTxPowerLevel (m_defaultTxPowerLevel); |
842 v.SetChannelWidth (GetChannelWidthForTransmission (mode, m_wifiPhy->GetCha
nnelWidth ())); | 797 v.SetChannelWidth (GetChannelWidthForTransmission (mode, m_wifiPhy->GetCha
nnelWidth ())); |
843 v.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mode, m_wifiPhy->Ge
tShortGuardInterval (), m_wifiPhy->GetGuardInterval ())); | 798 v.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mode, m_wifiPhy->Ge
tShortGuardInterval (), m_wifiPhy->GetGuardInterval ())); |
| 799 v.SetNTx (1); |
844 v.SetNss (1); | 800 v.SetNss (1); |
845 v.SetNess (0); | 801 v.SetNess (0); |
846 v.SetStbc (m_wifiPhy->GetStbc ()); | 802 v.SetStbc (m_wifiPhy->GetStbc ()); |
847 return v; | 803 return v; |
848 } | 804 } |
849 if (!IsLowLatency ()) | 805 if (!IsLowLatency ()) |
850 { | 806 { |
851 HighLatencyDataTxVectorTag datatag; | 807 HighLatencyDataTxVectorTag datatag; |
852 bool found; | 808 bool found; |
853 found = ConstCast<Packet> (packet)->PeekPacketTag (datatag); | 809 found = ConstCast<Packet> (packet)->PeekPacketTag (datatag); |
854 NS_ASSERT (found); | 810 NS_ASSERT (found); |
855 //cast found to void, to suppress 'found' set but not used | 811 //cast found to void, to suppress 'found' set but not used |
856 //compiler warning | 812 //compiler warning |
857 (void) found; | 813 (void) found; |
858 return datatag.GetDataTxVector (); | 814 return datatag.GetDataTxVector (); |
859 } | 815 } |
860 return DoGetDataTxVector (Lookup (address, header)); | 816 WifiTxVector txVector = DoGetDataTxVector (Lookup (address, header)); |
| 817 if (header->IsMgt ()) |
| 818 { |
| 819 //Use the lowest basic rate for management frames |
| 820 WifiMode mgtMode; |
| 821 if (GetNBasicModes () > 0) |
| 822 { |
| 823 mgtMode = GetBasicMode (0); |
| 824 } |
| 825 else |
| 826 { |
| 827 mgtMode = GetDefaultMode (); |
| 828 } |
| 829 txVector.SetMode (mgtMode); |
| 830 txVector.SetPreambleType (GetPreambleForTransmission (mgtMode, address)); |
| 831 txVector.SetChannelWidth (GetChannelWidthForTransmission (mgtMode, m_wifiP
hy->GetChannelWidth ())); |
| 832 txVector.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mgtMode, m_w
ifiPhy->GetShortGuardInterval (), m_wifiPhy->GetGuardInterval ())); |
| 833 } |
| 834 return txVector; |
861 } | 835 } |
862 | 836 |
863 WifiTxVector | 837 WifiTxVector |
864 WifiRemoteStationManager::GetCtsToSelfTxVector (const WifiMacHeader *header, | 838 WifiRemoteStationManager::GetCtsToSelfTxVector (const WifiMacHeader *header, |
865 Ptr<const Packet> packet) | 839 Ptr<const Packet> packet) |
866 { | 840 { |
867 NS_LOG_FUNCTION (this << *header << packet); | 841 NS_LOG_FUNCTION (this << *header << packet); |
868 if (!IsLowLatency ()) | 842 if (!IsLowLatency ()) |
869 { | 843 { |
870 HighLatencyCtsToSelfTxVectorTag ctstoselftag; | 844 HighLatencyCtsToSelfTxVectorTag ctstoselftag; |
(...skipping 25 matching lines...) Expand all Loading... |
896 { | 870 { |
897 defaultPreamble = WIFI_PREAMBLE_HT_MF; | 871 defaultPreamble = WIFI_PREAMBLE_HT_MF; |
898 } | 872 } |
899 else | 873 else |
900 { | 874 { |
901 defaultPreamble = WIFI_PREAMBLE_LONG; | 875 defaultPreamble = WIFI_PREAMBLE_LONG; |
902 } | 876 } |
903 | 877 |
904 return WifiTxVector (defaultMode, | 878 return WifiTxVector (defaultMode, |
905 GetDefaultTxPowerLevel (), | 879 GetDefaultTxPowerLevel (), |
906 0, | |
907 defaultPreamble, | 880 defaultPreamble, |
908 ConvertGuardIntervalToNanoSeconds (defaultMode, m_wifiPhy
->GetShortGuardInterval (), m_wifiPhy->GetGuardInterval ()), | 881 ConvertGuardIntervalToNanoSeconds (defaultMode, m_wifiPhy
->GetShortGuardInterval (), m_wifiPhy->GetGuardInterval ()), |
909 GetNumberOfAntennas (), | 882 GetNumberOfAntennas (), |
910 GetMaxNumberOfTransmitStreams (), | 883 GetMaxNumberOfTransmitStreams (), |
911 0, | 884 0, |
912 GetChannelWidthForTransmission (defaultMode, m_wifiPhy->G
etChannelWidth ()), | 885 GetChannelWidthForTransmission (defaultMode, m_wifiPhy->G
etChannelWidth ()), |
913 false, | 886 false, |
914 false); | 887 false); |
915 } | 888 } |
916 | 889 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 } | 988 } |
1016 WifiRemoteStation *station = Lookup (address, header); | 989 WifiRemoteStation *station = Lookup (address, header); |
1017 DoReportRxOk (station, rxSnr, txMode); | 990 DoReportRxOk (station, rxSnr, txMode); |
1018 } | 991 } |
1019 | 992 |
1020 void | 993 void |
1021 WifiRemoteStationManager::ReportAmpduTxStatus (Mac48Address address, uint8_t tid
, | 994 WifiRemoteStationManager::ReportAmpduTxStatus (Mac48Address address, uint8_t tid
, |
1022 uint8_t nSuccessfulMpdus, uint8_t
nFailedMpdus, | 995 uint8_t nSuccessfulMpdus, uint8_t
nFailedMpdus, |
1023 double rxSnr, double dataSnr) | 996 double rxSnr, double dataSnr) |
1024 { | 997 { |
1025 NS_LOG_FUNCTION (this << address << static_cast<uint16_t> (tid) << static_cast
<uint16_t> (nSuccessfulMpdus) << static_cast<uint16_t> (nFailedMpdus) << rxSnr <
< dataSnr); | 998 NS_LOG_FUNCTION (this << address << +tid << +nSuccessfulMpdus << +nFailedMpdus
<< rxSnr << dataSnr); |
1026 NS_ASSERT (!address.IsGroup ()); | 999 NS_ASSERT (!address.IsGroup ()); |
1027 WifiRemoteStation *station = Lookup (address, tid); | 1000 WifiRemoteStation *station = Lookup (address, tid); |
1028 for (uint8_t i = 0; i < nFailedMpdus; i++) | 1001 for (uint8_t i = 0; i < nFailedMpdus; i++) |
1029 { | 1002 { |
1030 m_macTxDataFailed (address); | 1003 m_macTxDataFailed (address); |
1031 } | 1004 } |
1032 DoReportAmpduTxStatus (station, nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr
); | 1005 DoReportAmpduTxStatus (station, nSuccessfulMpdus, nFailedMpdus, rxSnr, dataSnr
); |
1033 } | 1006 } |
1034 | 1007 |
1035 bool | 1008 bool |
(...skipping 18 matching lines...) Expand all Loading... |
1054 } | 1027 } |
1055 else if (m_htProtectionMode == RTS_CTS | 1028 else if (m_htProtectionMode == RTS_CTS |
1056 && ((mode.GetModulationClass () == WIFI_MOD_CLASS_HT) | 1029 && ((mode.GetModulationClass () == WIFI_MOD_CLASS_HT) |
1057 || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)) | 1030 || (mode.GetModulationClass () == WIFI_MOD_CLASS_VHT)) |
1058 && m_useNonHtProtection | 1031 && m_useNonHtProtection |
1059 && !(m_erpProtectionMode != RTS_CTS && m_useNonErpProtection)) | 1032 && !(m_erpProtectionMode != RTS_CTS && m_useNonErpProtection)) |
1060 { | 1033 { |
1061 NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRTS returning true to protect
non-HT stations"); | 1034 NS_LOG_DEBUG ("WifiRemoteStationManager::NeedRTS returning true to protect
non-HT stations"); |
1062 return true; | 1035 return true; |
1063 } | 1036 } |
1064 bool normally = (packet->GetSize () + header->GetSize () + WIFI_MAC_FCS_LENGTH
) > GetRtsCtsThreshold (); | 1037 bool normally = (packet->GetSize () + header->GetSize () + WIFI_MAC_FCS_LENGTH
) > m_rtsCtsThreshold; |
1065 return DoNeedRts (Lookup (address, header), packet, normally); | 1038 return DoNeedRts (Lookup (address, header), packet, normally); |
1066 } | 1039 } |
1067 | 1040 |
1068 bool | 1041 bool |
1069 WifiRemoteStationManager::NeedCtsToSelf (WifiTxVector txVector) | 1042 WifiRemoteStationManager::NeedCtsToSelf (WifiTxVector txVector) |
1070 { | 1043 { |
1071 WifiMode mode = txVector.GetMode (); | 1044 WifiMode mode = txVector.GetMode (); |
1072 NS_LOG_FUNCTION (this << mode); | 1045 NS_LOG_FUNCTION (this << mode); |
1073 if (m_erpProtectionMode == CTS_TO_SELF | 1046 if (m_erpProtectionMode == CTS_TO_SELF |
1074 && ((mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM) | 1047 && ((mode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM) |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1157 return m_useGreenfieldProtection; | 1130 return m_useGreenfieldProtection; |
1158 } | 1131 } |
1159 | 1132 |
1160 bool | 1133 bool |
1161 WifiRemoteStationManager::NeedRtsRetransmission (Mac48Address address, const Wif
iMacHeader *header, | 1134 WifiRemoteStationManager::NeedRtsRetransmission (Mac48Address address, const Wif
iMacHeader *header, |
1162 Ptr<const Packet> packet) | 1135 Ptr<const Packet> packet) |
1163 { | 1136 { |
1164 NS_LOG_FUNCTION (this << address << packet << *header); | 1137 NS_LOG_FUNCTION (this << address << packet << *header); |
1165 NS_ASSERT (!address.IsGroup ()); | 1138 NS_ASSERT (!address.IsGroup ()); |
1166 WifiRemoteStation *station = Lookup (address, header); | 1139 WifiRemoteStation *station = Lookup (address, header); |
1167 bool normally = station->m_ssrc < GetMaxSsrc (); | 1140 bool normally = station->m_ssrc < m_maxSsrc; |
1168 NS_LOG_DEBUG ("WifiRemoteStationManager::NeedDataRetransmission count: " << st
ation->m_ssrc << " result: " << std::boolalpha << normally); | 1141 NS_LOG_DEBUG ("WifiRemoteStationManager::NeedDataRetransmission count: " << st
ation->m_ssrc << " result: " << std::boolalpha << normally); |
1169 return DoNeedRtsRetransmission (station, packet, normally); | 1142 return DoNeedRtsRetransmission (station, packet, normally); |
1170 } | 1143 } |
1171 | 1144 |
1172 bool | 1145 bool |
1173 WifiRemoteStationManager::NeedDataRetransmission (Mac48Address address, const Wi
fiMacHeader *header, | 1146 WifiRemoteStationManager::NeedDataRetransmission (Mac48Address address, const Wi
fiMacHeader *header, |
1174 Ptr<const Packet> packet) | 1147 Ptr<const Packet> packet) |
1175 { | 1148 { |
1176 NS_LOG_FUNCTION (this << address << packet << *header); | 1149 NS_LOG_FUNCTION (this << address << packet << *header); |
1177 NS_ASSERT (!address.IsGroup ()); | 1150 NS_ASSERT (!address.IsGroup ()); |
1178 WifiRemoteStation *station = Lookup (address, header); | 1151 WifiRemoteStation *station = Lookup (address, header); |
1179 bool normally = station->m_slrc < GetMaxSlrc (); | 1152 bool normally = station->m_slrc < m_maxSlrc; |
1180 NS_LOG_DEBUG ("WifiRemoteStationManager::NeedDataRetransmission count: " << st
ation->m_slrc << " result: " << std::boolalpha << normally); | 1153 NS_LOG_DEBUG ("WifiRemoteStationManager::NeedDataRetransmission count: " << st
ation->m_slrc << " result: " << std::boolalpha << normally); |
1181 return DoNeedDataRetransmission (station, packet, normally); | 1154 return DoNeedDataRetransmission (station, packet, normally); |
1182 } | 1155 } |
1183 | 1156 |
1184 bool | 1157 bool |
1185 WifiRemoteStationManager::NeedFragmentation (Mac48Address address, const WifiMac
Header *header, | 1158 WifiRemoteStationManager::NeedFragmentation (Mac48Address address, const WifiMac
Header *header, |
1186 Ptr<const Packet> packet) | 1159 Ptr<const Packet> packet) |
1187 { | 1160 { |
1188 NS_LOG_FUNCTION (this << address << packet << *header); | 1161 NS_LOG_FUNCTION (this << address << packet << *header); |
1189 if (address.IsGroup ()) | 1162 if (address.IsGroup ()) |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1516 v.SetGuardInterval (DoGetBlockAckTxGuardInterval (address, blockAckMode)); | 1489 v.SetGuardInterval (DoGetBlockAckTxGuardInterval (address, blockAckMode)); |
1517 v.SetNss (DoGetBlockAckTxNss (address, blockAckMode)); | 1490 v.SetNss (DoGetBlockAckTxNss (address, blockAckMode)); |
1518 v.SetNess (DoGetBlockAckTxNess (address, blockAckMode)); | 1491 v.SetNess (DoGetBlockAckTxNess (address, blockAckMode)); |
1519 v.SetStbc (m_wifiPhy->GetStbc ()); | 1492 v.SetStbc (m_wifiPhy->GetStbc ()); |
1520 return v; | 1493 return v; |
1521 } | 1494 } |
1522 | 1495 |
1523 uint8_t | 1496 uint8_t |
1524 WifiRemoteStationManager::DoGetCtsTxPowerLevel (Mac48Address address, WifiMode c
tsMode) | 1497 WifiRemoteStationManager::DoGetCtsTxPowerLevel (Mac48Address address, WifiMode c
tsMode) |
1525 { | 1498 { |
1526 NS_LOG_FUNCTION (this << address << ctsMode); | |
1527 return m_defaultTxPowerLevel; | 1499 return m_defaultTxPowerLevel; |
1528 } | 1500 } |
1529 | 1501 |
1530 uint8_t | 1502 uint16_t |
1531 WifiRemoteStationManager::DoGetCtsTxChannelWidth (Mac48Address address, WifiMode
ctsMode) | 1503 WifiRemoteStationManager::DoGetCtsTxChannelWidth (Mac48Address address, WifiMode
ctsMode) |
1532 { | 1504 { |
1533 NS_LOG_FUNCTION(this << address << ctsMode); | |
1534 return m_wifiPhy->GetChannelWidth (); | 1505 return m_wifiPhy->GetChannelWidth (); |
1535 } | 1506 } |
1536 | 1507 |
1537 uint16_t | 1508 uint16_t |
1538 WifiRemoteStationManager::DoGetCtsTxGuardInterval (Mac48Address address, WifiMod
e ctsMode) | 1509 WifiRemoteStationManager::DoGetCtsTxGuardInterval (Mac48Address address, WifiMod
e ctsMode) |
1539 { | 1510 { |
1540 NS_LOG_FUNCTION(this << address << ctsMode); | |
1541 return ConvertGuardIntervalToNanoSeconds (ctsMode, m_wifiPhy->GetShortGuardInt
erval (), m_wifiPhy->GetGuardInterval ()); | 1511 return ConvertGuardIntervalToNanoSeconds (ctsMode, m_wifiPhy->GetShortGuardInt
erval (), m_wifiPhy->GetGuardInterval ()); |
1542 } | 1512 } |
1543 | 1513 |
1544 uint8_t | 1514 uint8_t |
1545 WifiRemoteStationManager::DoGetCtsTxNss (Mac48Address address, WifiMode ctsMode) | 1515 WifiRemoteStationManager::DoGetCtsTxNss (Mac48Address address, WifiMode ctsMode) |
1546 { | 1516 { |
1547 NS_LOG_FUNCTION(this << address << ctsMode); | |
1548 return 1; | 1517 return 1; |
1549 } | 1518 } |
1550 | 1519 |
1551 uint8_t | 1520 uint8_t |
1552 WifiRemoteStationManager::DoGetCtsTxNess (Mac48Address address, WifiMode ctsMode
) | 1521 WifiRemoteStationManager::DoGetCtsTxNess (Mac48Address address, WifiMode ctsMode
) |
1553 { | 1522 { |
1554 NS_LOG_FUNCTION(this << address << ctsMode); | |
1555 return 0; | 1523 return 0; |
1556 } | 1524 } |
1557 | 1525 |
1558 uint8_t | 1526 uint8_t |
1559 WifiRemoteStationManager::DoGetAckTxPowerLevel (Mac48Address address, WifiMode a
ckMode) | 1527 WifiRemoteStationManager::DoGetAckTxPowerLevel (Mac48Address address, WifiMode a
ckMode) |
1560 { | 1528 { |
1561 NS_LOG_FUNCTION (this << address << ackMode); | |
1562 return m_defaultTxPowerLevel; | 1529 return m_defaultTxPowerLevel; |
1563 } | 1530 } |
1564 | 1531 |
1565 uint8_t | 1532 uint16_t |
1566 WifiRemoteStationManager::DoGetAckTxChannelWidth (Mac48Address address, WifiMode
ctsMode) | 1533 WifiRemoteStationManager::DoGetAckTxChannelWidth (Mac48Address address, WifiMode
ctsMode) |
1567 { | 1534 { |
1568 NS_LOG_FUNCTION(this << address << ctsMode); | |
1569 return m_wifiPhy->GetChannelWidth (); | 1535 return m_wifiPhy->GetChannelWidth (); |
1570 } | 1536 } |
1571 | 1537 |
1572 uint16_t | 1538 uint16_t |
1573 WifiRemoteStationManager::DoGetAckTxGuardInterval (Mac48Address address, WifiMod
e ackMode) | 1539 WifiRemoteStationManager::DoGetAckTxGuardInterval (Mac48Address address, WifiMod
e ackMode) |
1574 { | 1540 { |
1575 NS_LOG_FUNCTION(this << address << ackMode); | |
1576 return ConvertGuardIntervalToNanoSeconds (ackMode, m_wifiPhy->GetShortGuardInt
erval (), m_wifiPhy->GetGuardInterval ()); | 1541 return ConvertGuardIntervalToNanoSeconds (ackMode, m_wifiPhy->GetShortGuardInt
erval (), m_wifiPhy->GetGuardInterval ()); |
1577 } | 1542 } |
1578 | 1543 |
1579 uint8_t | 1544 uint8_t |
1580 WifiRemoteStationManager::DoGetAckTxNss (Mac48Address address, WifiMode ackMode) | 1545 WifiRemoteStationManager::DoGetAckTxNss (Mac48Address address, WifiMode ackMode) |
1581 { | 1546 { |
1582 NS_LOG_FUNCTION(this << address << ackMode); | |
1583 return 1; | 1547 return 1; |
1584 } | 1548 } |
1585 | 1549 |
1586 uint8_t | 1550 uint8_t |
1587 WifiRemoteStationManager::DoGetAckTxNess (Mac48Address address, WifiMode ackMode
) | 1551 WifiRemoteStationManager::DoGetAckTxNess (Mac48Address address, WifiMode ackMode
) |
1588 { | 1552 { |
1589 NS_LOG_FUNCTION(this << address << ackMode); | |
1590 return 0; | 1553 return 0; |
1591 } | 1554 } |
1592 | 1555 |
1593 uint8_t | 1556 uint8_t |
1594 WifiRemoteStationManager::DoGetBlockAckTxPowerLevel (Mac48Address address, WifiM
ode blockAckMode) | 1557 WifiRemoteStationManager::DoGetBlockAckTxPowerLevel (Mac48Address address, WifiM
ode blockAckMode) |
1595 { | 1558 { |
1596 NS_LOG_FUNCTION(this << address << blockAckMode); | |
1597 return m_defaultTxPowerLevel; | 1559 return m_defaultTxPowerLevel; |
1598 } | 1560 } |
1599 | 1561 |
1600 uint8_t | 1562 uint16_t |
1601 WifiRemoteStationManager::DoGetBlockAckTxChannelWidth (Mac48Address address, Wif
iMode ctsMode) | 1563 WifiRemoteStationManager::DoGetBlockAckTxChannelWidth (Mac48Address address, Wif
iMode ctsMode) |
1602 { | 1564 { |
1603 NS_LOG_FUNCTION(this << address << ctsMode); | |
1604 return m_wifiPhy->GetChannelWidth (); | 1565 return m_wifiPhy->GetChannelWidth (); |
1605 } | 1566 } |
1606 | 1567 |
1607 uint16_t | 1568 uint16_t |
1608 WifiRemoteStationManager::DoGetBlockAckTxGuardInterval (Mac48Address address, Wi
fiMode blockAckMode) | 1569 WifiRemoteStationManager::DoGetBlockAckTxGuardInterval (Mac48Address address, Wi
fiMode blockAckMode) |
1609 { | 1570 { |
1610 NS_LOG_FUNCTION(this << address << blockAckMode); | |
1611 return ConvertGuardIntervalToNanoSeconds (blockAckMode, m_wifiPhy->GetShortGua
rdInterval (), m_wifiPhy->GetGuardInterval ()); | 1571 return ConvertGuardIntervalToNanoSeconds (blockAckMode, m_wifiPhy->GetShortGua
rdInterval (), m_wifiPhy->GetGuardInterval ()); |
1612 } | 1572 } |
1613 | 1573 |
1614 uint8_t | 1574 uint8_t |
1615 WifiRemoteStationManager::DoGetBlockAckTxNss (Mac48Address address, WifiMode blo
ckAckMode) | 1575 WifiRemoteStationManager::DoGetBlockAckTxNss (Mac48Address address, WifiMode blo
ckAckMode) |
1616 { | 1576 { |
1617 NS_LOG_FUNCTION(this << address << blockAckMode); | |
1618 return 1; | 1577 return 1; |
1619 } | 1578 } |
1620 | 1579 |
1621 uint8_t | 1580 uint8_t |
1622 WifiRemoteStationManager::DoGetBlockAckTxNess (Mac48Address address, WifiMode bl
ockAckMode) | 1581 WifiRemoteStationManager::DoGetBlockAckTxNess (Mac48Address address, WifiMode bl
ockAckMode) |
1623 { | 1582 { |
1624 NS_LOG_FUNCTION(this << address << blockAckMode); | |
1625 return 0; | 1583 return 0; |
1626 } | 1584 } |
1627 | 1585 |
1628 uint8_t | 1586 uint8_t |
1629 WifiRemoteStationManager::GetDefaultTxPowerLevel (void) const | 1587 WifiRemoteStationManager::GetDefaultTxPowerLevel (void) const |
1630 { | 1588 { |
1631 return m_defaultTxPowerLevel; | 1589 return m_defaultTxPowerLevel; |
1632 } | 1590 } |
1633 | 1591 |
1634 WifiRemoteStationInfo | 1592 WifiRemoteStationInfo |
(...skipping 15 matching lines...) Expand all Loading... |
1650 return (*i); | 1608 return (*i); |
1651 } | 1609 } |
1652 } | 1610 } |
1653 WifiRemoteStationState *state = new WifiRemoteStationState (); | 1611 WifiRemoteStationState *state = new WifiRemoteStationState (); |
1654 state->m_state = WifiRemoteStationState::BRAND_NEW; | 1612 state->m_state = WifiRemoteStationState::BRAND_NEW; |
1655 state->m_address = address; | 1613 state->m_address = address; |
1656 state->m_operationalRateSet.push_back (GetDefaultMode ()); | 1614 state->m_operationalRateSet.push_back (GetDefaultMode ()); |
1657 state->m_operationalMcsSet.push_back (GetDefaultMcs ()); | 1615 state->m_operationalMcsSet.push_back (GetDefaultMcs ()); |
1658 state->m_channelWidth = m_wifiPhy->GetChannelWidth (); | 1616 state->m_channelWidth = m_wifiPhy->GetChannelWidth (); |
1659 state->m_shortGuardInterval = m_wifiPhy->GetShortGuardInterval (); | 1617 state->m_shortGuardInterval = m_wifiPhy->GetShortGuardInterval (); |
1660 state->m_guardInterval = static_cast<uint16_t>(m_wifiPhy->GetGuardInterval ().
GetNanoSeconds ()); | 1618 state->m_guardInterval = static_cast<uint16_t> (m_wifiPhy->GetGuardInterval ()
.GetNanoSeconds ()); |
1661 state->m_greenfield = m_wifiPhy->GetGreenfield (); | 1619 state->m_greenfield = m_wifiPhy->GetGreenfield (); |
1662 state->m_streams = 1; | 1620 state->m_streams = 1; |
1663 state->m_ness = 0; | 1621 state->m_ness = 0; |
1664 state->m_aggregation = false; | 1622 state->m_aggregation = false; |
1665 state->m_stbc = false; | 1623 state->m_stbc = false; |
1666 state->m_ldpc = false; | 1624 state->m_ldpc = false; |
1667 state->m_qosSupported = false; | 1625 state->m_qosSupported = false; |
1668 state->m_htSupported = false; | 1626 state->m_htSupported = false; |
1669 state->m_vhtSupported = false; | 1627 state->m_vhtSupported = false; |
1670 state->m_heSupported = false; | 1628 state->m_heSupported = false; |
(...skipping 13 matching lines...) Expand all Loading... |
1684 else | 1642 else |
1685 { | 1643 { |
1686 tid = 0; | 1644 tid = 0; |
1687 } | 1645 } |
1688 return Lookup (address, tid); | 1646 return Lookup (address, tid); |
1689 } | 1647 } |
1690 | 1648 |
1691 WifiRemoteStation * | 1649 WifiRemoteStation * |
1692 WifiRemoteStationManager::Lookup (Mac48Address address, uint8_t tid) const | 1650 WifiRemoteStationManager::Lookup (Mac48Address address, uint8_t tid) const |
1693 { | 1651 { |
1694 NS_LOG_FUNCTION (this << address << static_cast<uint16_t> (tid)); | 1652 NS_LOG_FUNCTION (this << address << +tid); |
1695 for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end ();
i++) | 1653 for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end ();
i++) |
1696 { | 1654 { |
1697 if ((*i)->m_tid == tid | 1655 if ((*i)->m_tid == tid |
1698 && (*i)->m_state->m_address == address) | 1656 && (*i)->m_state->m_address == address) |
1699 { | 1657 { |
1700 return (*i); | 1658 return (*i); |
1701 } | 1659 } |
1702 } | 1660 } |
1703 WifiRemoteStationState *state = LookupState (address); | 1661 WifiRemoteStationState *state = LookupState (address); |
1704 | 1662 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1765 { | 1723 { |
1766 state->m_channelWidth = 80; | 1724 state->m_channelWidth = 80; |
1767 } | 1725 } |
1768 //This is a workaround to enable users to force a 20 or 40 MHz channel for a V
HT-compliant device, | 1726 //This is a workaround to enable users to force a 20 or 40 MHz channel for a V
HT-compliant device, |
1769 //since IEEE 802.11ac standard says that 20, 40 and 80 MHz channels are mandat
ory. | 1727 //since IEEE 802.11ac standard says that 20, 40 and 80 MHz channels are mandat
ory. |
1770 if (m_wifiPhy->GetChannelWidth () < state->m_channelWidth) | 1728 if (m_wifiPhy->GetChannelWidth () < state->m_channelWidth) |
1771 { | 1729 { |
1772 state->m_channelWidth = m_wifiPhy->GetChannelWidth (); | 1730 state->m_channelWidth = m_wifiPhy->GetChannelWidth (); |
1773 } | 1731 } |
1774 state->m_ldpc = (vhtCapabilities.GetRxLdpc () != 0); | 1732 state->m_ldpc = (vhtCapabilities.GetRxLdpc () != 0); |
1775 state->m_stbc = (vhtCapabilities.GetTxStbc () != 0 && vhtCapabilities.GetRxStb
c () != 0); | 1733 state->m_stbc = (vhtCapabilities.GetTxStbc () != 0 || vhtCapabilities.GetRxStb
c () != 0); |
1776 for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++) | 1734 for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++) |
1777 { | 1735 { |
1778 for (uint8_t j = 0; j < m_wifiPhy->GetNMcs (); j++) | 1736 for (uint8_t j = 0; j < m_wifiPhy->GetNMcs (); j++) |
1779 { | 1737 { |
1780 WifiMode mcs = m_wifiPhy->GetMcs (j); | 1738 WifiMode mcs = m_wifiPhy->GetMcs (j); |
1781 if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities
.IsSupportedMcs (mcs.GetMcsValue (), i)) | 1739 if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities
.IsSupportedMcs (mcs.GetMcsValue (), i)) |
1782 { | 1740 { |
1783 AddSupportedMcs (from, mcs); | 1741 AddSupportedMcs (from, mcs); |
1784 } | 1742 } |
1785 } | 1743 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1822 state->m_guardInterval = 800; | 1780 state->m_guardInterval = 800; |
1823 } | 1781 } |
1824 else if (heCapabilities.GetHeLtfAndGiForHePpdus () == 1) | 1782 else if (heCapabilities.GetHeLtfAndGiForHePpdus () == 1) |
1825 { | 1783 { |
1826 state->m_guardInterval = 1600; | 1784 state->m_guardInterval = 1600; |
1827 } | 1785 } |
1828 else | 1786 else |
1829 { | 1787 { |
1830 state->m_guardInterval = 3200; | 1788 state->m_guardInterval = 3200; |
1831 } | 1789 } |
| 1790 for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++) |
| 1791 { |
| 1792 for (uint8_t j = 0; j < m_wifiPhy->GetNMcs (); j++) |
| 1793 { |
| 1794 WifiMode mcs = m_wifiPhy->GetMcs (j); |
| 1795 if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE |
| 1796 && heCapabilities.GetHighestNssSupported () >= i |
| 1797 && heCapabilities.GetHighestMcsSupported () >= j) |
| 1798 { |
| 1799 AddSupportedMcs (from, mcs); |
| 1800 } |
| 1801 } |
| 1802 } |
1832 state->m_heSupported = true; | 1803 state->m_heSupported = true; |
1833 SetQosSupport (from, true); | 1804 SetQosSupport (from, true); |
1834 } | 1805 } |
1835 | 1806 |
1836 bool | 1807 bool |
1837 WifiRemoteStationManager::GetGreenfieldSupported (Mac48Address address) const | 1808 WifiRemoteStationManager::GetGreenfieldSupported (Mac48Address address) const |
1838 { | 1809 { |
1839 return LookupState (address)->m_greenfield; | 1810 return LookupState (address)->m_greenfield; |
1840 } | 1811 } |
1841 | 1812 |
1842 WifiMode | 1813 WifiMode |
1843 WifiRemoteStationManager::GetDefaultMode (void) const | 1814 WifiRemoteStationManager::GetDefaultMode (void) const |
1844 { | 1815 { |
1845 return m_defaultTxMode; | 1816 return m_defaultTxMode; |
1846 } | 1817 } |
1847 | 1818 |
1848 WifiMode | 1819 WifiMode |
1849 WifiRemoteStationManager::GetDefaultMcs (void) const | 1820 WifiRemoteStationManager::GetDefaultMcs (void) const |
1850 { | 1821 { |
1851 return m_defaultTxMcs; | 1822 return m_defaultTxMcs; |
1852 } | 1823 } |
1853 | 1824 |
1854 void | 1825 void |
1855 WifiRemoteStationManager::Reset (void) | 1826 WifiRemoteStationManager::Reset (void) |
1856 { | 1827 { |
1857 NS_LOG_FUNCTION (this); | 1828 NS_LOG_FUNCTION (this); |
| 1829 for (StationStates::const_iterator i = m_states.begin (); i != m_states.end ()
; i++) |
| 1830 { |
| 1831 delete (*i); |
| 1832 } |
| 1833 m_states.clear (); |
1858 for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end ();
i++) | 1834 for (Stations::const_iterator i = m_stations.begin (); i != m_stations.end ();
i++) |
1859 { | 1835 { |
1860 delete (*i); | 1836 delete (*i); |
1861 } | 1837 } |
1862 m_stations.clear (); | 1838 m_stations.clear (); |
1863 m_bssBasicRateSet.clear (); | 1839 m_bssBasicRateSet.clear (); |
1864 m_bssBasicMcsSet.clear (); | 1840 m_bssBasicMcsSet.clear (); |
1865 } | 1841 } |
1866 | 1842 |
1867 void | 1843 void |
(...skipping 10 matching lines...) Expand all Loading... |
1878 { | 1854 { |
1879 return; | 1855 return; |
1880 } | 1856 } |
1881 } | 1857 } |
1882 m_bssBasicRateSet.push_back (mode); | 1858 m_bssBasicRateSet.push_back (mode); |
1883 } | 1859 } |
1884 | 1860 |
1885 uint8_t | 1861 uint8_t |
1886 WifiRemoteStationManager::GetNBasicModes (void) const | 1862 WifiRemoteStationManager::GetNBasicModes (void) const |
1887 { | 1863 { |
1888 return static_cast<uint8_t>(m_bssBasicRateSet.size ()); | 1864 return static_cast<uint8_t> (m_bssBasicRateSet.size ()); |
1889 } | 1865 } |
1890 | 1866 |
1891 WifiMode | 1867 WifiMode |
1892 WifiRemoteStationManager::GetBasicMode (uint8_t i) const | 1868 WifiRemoteStationManager::GetBasicMode (uint8_t i) const |
1893 { | 1869 { |
1894 NS_ASSERT (i < GetNBasicModes ()); | 1870 NS_ASSERT (i < GetNBasicModes ()); |
1895 return m_bssBasicRateSet[i]; | 1871 return m_bssBasicRateSet[i]; |
1896 } | 1872 } |
1897 | 1873 |
1898 uint32_t | 1874 uint32_t |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1931 } | 1907 } |
1932 index++; | 1908 index++; |
1933 j++; | 1909 j++; |
1934 } | 1910 } |
1935 return m_bssBasicRateSet[index]; | 1911 return m_bssBasicRateSet[index]; |
1936 } | 1912 } |
1937 | 1913 |
1938 void | 1914 void |
1939 WifiRemoteStationManager::AddBasicMcs (WifiMode mcs) | 1915 WifiRemoteStationManager::AddBasicMcs (WifiMode mcs) |
1940 { | 1916 { |
1941 NS_LOG_FUNCTION (this << static_cast<uint16_t> (mcs.GetMcsValue ())); | 1917 NS_LOG_FUNCTION (this << +mcs.GetMcsValue ()); |
1942 for (uint8_t i = 0; i < GetNBasicMcs (); i++) | 1918 for (uint8_t i = 0; i < GetNBasicMcs (); i++) |
1943 { | 1919 { |
1944 if (GetBasicMcs (i) == mcs) | 1920 if (GetBasicMcs (i) == mcs) |
1945 { | 1921 { |
1946 return; | 1922 return; |
1947 } | 1923 } |
1948 } | 1924 } |
1949 m_bssBasicMcsSet.push_back (mcs); | 1925 m_bssBasicMcsSet.push_back (mcs); |
1950 } | 1926 } |
1951 | 1927 |
1952 uint8_t | 1928 uint8_t |
1953 WifiRemoteStationManager::GetNBasicMcs (void) const | 1929 WifiRemoteStationManager::GetNBasicMcs (void) const |
1954 { | 1930 { |
1955 return static_cast<uint8_t>(m_bssBasicMcsSet.size ()); | 1931 return static_cast<uint8_t> (m_bssBasicMcsSet.size ()); |
1956 } | 1932 } |
1957 | 1933 |
1958 WifiMode | 1934 WifiMode |
1959 WifiRemoteStationManager::GetBasicMcs (uint8_t i) const | 1935 WifiRemoteStationManager::GetBasicMcs (uint8_t i) const |
1960 { | 1936 { |
1961 NS_ASSERT (i < GetNBasicMcs ()); | 1937 NS_ASSERT (i < GetNBasicMcs ()); |
1962 return m_bssBasicMcsSet[i]; | 1938 return m_bssBasicMcsSet[i]; |
1963 } | 1939 } |
1964 | 1940 |
1965 WifiMode | 1941 WifiMode |
(...skipping 13 matching lines...) Expand all Loading... |
1979 else | 1955 else |
1980 { | 1956 { |
1981 return m_nonUnicastMode; | 1957 return m_nonUnicastMode; |
1982 } | 1958 } |
1983 } | 1959 } |
1984 | 1960 |
1985 bool | 1961 bool |
1986 WifiRemoteStationManager::DoNeedRts (WifiRemoteStation *station, | 1962 WifiRemoteStationManager::DoNeedRts (WifiRemoteStation *station, |
1987 Ptr<const Packet> packet, bool normally) | 1963 Ptr<const Packet> packet, bool normally) |
1988 { | 1964 { |
1989 NS_LOG_FUNCTION (this << station << packet << normally); | |
1990 return normally; | 1965 return normally; |
1991 } | 1966 } |
1992 | 1967 |
1993 bool | 1968 bool |
1994 WifiRemoteStationManager::DoNeedRtsRetransmission (WifiRemoteStation *station, | 1969 WifiRemoteStationManager::DoNeedRtsRetransmission (WifiRemoteStation *station, |
1995 Ptr<const Packet> packet, boo
l normally) | 1970 Ptr<const Packet> packet, boo
l normally) |
1996 { | 1971 { |
1997 NS_LOG_FUNCTION(this << station << packet << normally); | |
1998 return normally; | 1972 return normally; |
1999 } | 1973 } |
2000 | 1974 |
2001 bool | 1975 bool |
2002 WifiRemoteStationManager::DoNeedDataRetransmission (WifiRemoteStation *station, | 1976 WifiRemoteStationManager::DoNeedDataRetransmission (WifiRemoteStation *station, |
2003 Ptr<const Packet> packet, bo
ol normally) | 1977 Ptr<const Packet> packet, bo
ol normally) |
2004 { | 1978 { |
2005 NS_LOG_FUNCTION(this << station << packet << normally); | |
2006 return normally; | 1979 return normally; |
2007 } | 1980 } |
2008 | 1981 |
2009 bool | 1982 bool |
2010 WifiRemoteStationManager::DoNeedFragmentation (WifiRemoteStation *station, | 1983 WifiRemoteStationManager::DoNeedFragmentation (WifiRemoteStation *station, |
2011 Ptr<const Packet> packet, bool no
rmally) | 1984 Ptr<const Packet> packet, bool no
rmally) |
2012 { | 1985 { |
2013 NS_LOG_FUNCTION(this << station << packet << normally); | |
2014 return normally; | 1986 return normally; |
2015 } | 1987 } |
2016 | 1988 |
2017 void | 1989 void |
2018 WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uin
t8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr) | 1990 WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uin
t8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr) |
2019 { | 1991 { |
2020 NS_LOG_FUNCTION(this << station << nSuccessfulMpdus << nFailedMpdus << rxSnr <
< dataSnr); | |
2021 NS_LOG_DEBUG ("DoReportAmpduTxStatus received but the manager does not handle
A-MPDUs!"); | 1992 NS_LOG_DEBUG ("DoReportAmpduTxStatus received but the manager does not handle
A-MPDUs!"); |
2022 } | 1993 } |
2023 | 1994 |
2024 WifiMode | 1995 WifiMode |
2025 WifiRemoteStationManager::GetSupported (const WifiRemoteStation *station, uint8_
t i) const | 1996 WifiRemoteStationManager::GetSupported (const WifiRemoteStation *station, uint8_
t i) const |
2026 { | 1997 { |
2027 NS_ASSERT (i < GetNSupported (station)); | 1998 NS_ASSERT (i < GetNSupported (station)); |
2028 return station->m_state->m_operationalRateSet[i]; | 1999 return station->m_state->m_operationalRateSet[i]; |
2029 } | 2000 } |
2030 | 2001 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2062 } | 2033 } |
2063 return station->m_state->m_operationalRateSet[index]; | 2034 return station->m_state->m_operationalRateSet[index]; |
2064 } | 2035 } |
2065 | 2036 |
2066 Mac48Address | 2037 Mac48Address |
2067 WifiRemoteStationManager::GetAddress (const WifiRemoteStation *station) const | 2038 WifiRemoteStationManager::GetAddress (const WifiRemoteStation *station) const |
2068 { | 2039 { |
2069 return station->m_state->m_address; | 2040 return station->m_state->m_address; |
2070 } | 2041 } |
2071 | 2042 |
2072 uint8_t | 2043 uint16_t |
2073 WifiRemoteStationManager::GetChannelWidth (const WifiRemoteStation *station) con
st | 2044 WifiRemoteStationManager::GetChannelWidth (const WifiRemoteStation *station) con
st |
2074 { | 2045 { |
2075 return station->m_state->m_channelWidth; | 2046 return station->m_state->m_channelWidth; |
2076 } | 2047 } |
2077 | 2048 |
2078 bool | 2049 bool |
2079 WifiRemoteStationManager::GetShortGuardInterval (const WifiRemoteStation *statio
n) const | 2050 WifiRemoteStationManager::GetShortGuardInterval (const WifiRemoteStation *statio
n) const |
2080 { | 2051 { |
2081 return station->m_state->m_shortGuardInterval; | 2052 return station->m_state->m_shortGuardInterval; |
2082 } | 2053 } |
(...skipping 21 matching lines...) Expand all Loading... |
2104 { | 2075 { |
2105 return station->m_state->m_streams; | 2076 return station->m_state->m_streams; |
2106 } | 2077 } |
2107 | 2078 |
2108 uint32_t | 2079 uint32_t |
2109 WifiRemoteStationManager::GetNess (const WifiRemoteStation *station) const | 2080 WifiRemoteStationManager::GetNess (const WifiRemoteStation *station) const |
2110 { | 2081 { |
2111 return station->m_state->m_ness; | 2082 return station->m_state->m_ness; |
2112 } | 2083 } |
2113 | 2084 |
2114 uint32_t | |
2115 WifiRemoteStationManager::GetShortRetryCount (const WifiRemoteStation *station)
const | |
2116 { | |
2117 return station->m_ssrc; | |
2118 } | |
2119 | |
2120 Ptr<WifiPhy> | 2085 Ptr<WifiPhy> |
2121 WifiRemoteStationManager::GetPhy (void) const | 2086 WifiRemoteStationManager::GetPhy (void) const |
2122 { | 2087 { |
2123 return m_wifiPhy; | 2088 return m_wifiPhy; |
2124 } | 2089 } |
2125 | 2090 |
2126 Ptr<WifiMac> | 2091 Ptr<WifiMac> |
2127 WifiRemoteStationManager::GetMac (void) const | 2092 WifiRemoteStationManager::GetMac (void) const |
2128 { | 2093 { |
2129 return m_wifiMac; | 2094 return m_wifiMac; |
2130 } | 2095 } |
2131 | 2096 |
2132 uint32_t | |
2133 WifiRemoteStationManager::GetLongRetryCount (const WifiRemoteStation *station) c
onst | |
2134 { | |
2135 return station->m_slrc; | |
2136 } | |
2137 | |
2138 uint8_t | 2097 uint8_t |
2139 WifiRemoteStationManager::GetNSupported (const WifiRemoteStation *station) const | 2098 WifiRemoteStationManager::GetNSupported (const WifiRemoteStation *station) const |
2140 { | 2099 { |
2141 return static_cast<uint8_t> (station->m_state->m_operationalRateSet.size ()); | 2100 return static_cast<uint8_t> (station->m_state->m_operationalRateSet.size ()); |
2142 } | 2101 } |
2143 | 2102 |
2144 bool | 2103 bool |
2145 WifiRemoteStationManager::GetQosSupported (const WifiRemoteStation *station) con
st | 2104 WifiRemoteStationManager::GetQosSupported (const WifiRemoteStation *station) con
st |
2146 { | 2105 { |
2147 return station->m_state->m_qosSupported; | 2106 return station->m_state->m_qosSupported; |
(...skipping 13 matching lines...) Expand all Loading... |
2161 | 2120 |
2162 bool | 2121 bool |
2163 WifiRemoteStationManager::GetHeSupported (const WifiRemoteStation *station) cons
t | 2122 WifiRemoteStationManager::GetHeSupported (const WifiRemoteStation *station) cons
t |
2164 { | 2123 { |
2165 return station->m_state->m_heSupported; | 2124 return station->m_state->m_heSupported; |
2166 } | 2125 } |
2167 | 2126 |
2168 uint8_t | 2127 uint8_t |
2169 WifiRemoteStationManager::GetNMcsSupported (const WifiRemoteStation *station) co
nst | 2128 WifiRemoteStationManager::GetNMcsSupported (const WifiRemoteStation *station) co
nst |
2170 { | 2129 { |
2171 return static_cast<uint8_t>(station->m_state->m_operationalMcsSet.size ()); | 2130 return static_cast<uint8_t> (station->m_state->m_operationalMcsSet.size ()); |
2172 } | 2131 } |
2173 | 2132 |
2174 uint32_t | 2133 uint32_t |
2175 WifiRemoteStationManager::GetNNonErpSupported (const WifiRemoteStation *station)
const | 2134 WifiRemoteStationManager::GetNNonErpSupported (const WifiRemoteStation *station)
const |
2176 { | 2135 { |
2177 uint32_t size = 0; | 2136 uint32_t size = 0; |
2178 for (WifiModeListIterator i = station->m_state->m_operationalRateSet.begin ();
i != station->m_state->m_operationalRateSet.end (); i++) | 2137 for (WifiModeListIterator i = station->m_state->m_operationalRateSet.begin ();
i != station->m_state->m_operationalRateSet.end (); i++) |
2179 { | 2138 { |
2180 if (i->GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM) | 2139 if (i->GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM) |
2181 { | 2140 { |
2182 continue; | 2141 continue; |
2183 } | 2142 } |
2184 size++; | 2143 size++; |
2185 } | 2144 } |
2186 return size; | 2145 return size; |
2187 } | 2146 } |
2188 | 2147 |
2189 uint8_t | 2148 uint16_t |
2190 WifiRemoteStationManager::GetChannelWidthSupported (Mac48Address address) const | 2149 WifiRemoteStationManager::GetChannelWidthSupported (Mac48Address address) const |
2191 { | 2150 { |
2192 return LookupState (address)->m_channelWidth; | 2151 return LookupState (address)->m_channelWidth; |
2193 } | 2152 } |
2194 | 2153 |
2195 bool | 2154 bool |
2196 WifiRemoteStationManager::GetShortGuardInterval (Mac48Address address) const | 2155 WifiRemoteStationManager::GetShortGuardInterval (Mac48Address address) const |
2197 { | 2156 { |
2198 return LookupState (address)->m_shortGuardInterval; | 2157 return LookupState (address)->m_shortGuardInterval; |
2199 } | 2158 } |
2200 | 2159 |
2201 uint8_t | 2160 uint8_t |
2202 WifiRemoteStationManager::GetNumberOfSupportedStreams (Mac48Address address) con
st | 2161 WifiRemoteStationManager::GetNumberOfSupportedStreams (Mac48Address address) con
st |
2203 { | 2162 { |
2204 return LookupState (address)->m_streams; | 2163 return LookupState (address)->m_streams; |
2205 } | 2164 } |
2206 | 2165 |
2207 uint8_t | 2166 uint8_t |
2208 WifiRemoteStationManager::GetNMcsSupported (Mac48Address address) const | 2167 WifiRemoteStationManager::GetNMcsSupported (Mac48Address address) const |
2209 { | 2168 { |
2210 return static_cast<uint8_t>(LookupState (address)->m_operationalMcsSet.size ()
); | 2169 return static_cast<uint8_t> (LookupState (address)->m_operationalMcsSet.size (
)); |
2211 } | 2170 } |
2212 | 2171 |
2213 bool | 2172 bool |
2214 WifiRemoteStationManager::GetHtSupported (Mac48Address address) const | 2173 WifiRemoteStationManager::GetHtSupported (Mac48Address address) const |
2215 { | 2174 { |
2216 return LookupState (address)->m_htSupported; | 2175 return LookupState (address)->m_htSupported; |
2217 } | 2176 } |
2218 | 2177 |
2219 bool | 2178 bool |
2220 WifiRemoteStationManager::GetVhtSupported (Mac48Address address) const | 2179 WifiRemoteStationManager::GetVhtSupported (Mac48Address address) const |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2277 WifiRemoteStation::~WifiRemoteStation () | 2236 WifiRemoteStation::~WifiRemoteStation () |
2278 { | 2237 { |
2279 NS_LOG_FUNCTION (this); | 2238 NS_LOG_FUNCTION (this); |
2280 } | 2239 } |
2281 | 2240 |
2282 WifiRemoteStationInfo::WifiRemoteStationInfo () | 2241 WifiRemoteStationInfo::WifiRemoteStationInfo () |
2283 : m_memoryTime (Seconds (1.0)), | 2242 : m_memoryTime (Seconds (1.0)), |
2284 m_lastUpdate (Seconds (0.0)), | 2243 m_lastUpdate (Seconds (0.0)), |
2285 m_failAvg (0.0) | 2244 m_failAvg (0.0) |
2286 { | 2245 { |
| 2246 NS_LOG_FUNCTION (this); |
2287 } | 2247 } |
2288 | 2248 |
2289 double | 2249 double |
2290 WifiRemoteStationInfo::CalculateAveragingCoefficient () | 2250 WifiRemoteStationInfo::CalculateAveragingCoefficient () |
2291 { | 2251 { |
2292 double retval = std::exp (static_cast<double> (m_lastUpdate.GetMicroSeconds ()
- Simulator::Now ().GetMicroSeconds ()) / m_memoryTime.GetMicroSeconds ()); | 2252 double retval = std::exp (static_cast<double> (m_lastUpdate.GetMicroSeconds ()
- Simulator::Now ().GetMicroSeconds ()) / m_memoryTime.GetMicroSeconds ()); |
2293 m_lastUpdate = Simulator::Now (); | 2253 m_lastUpdate = Simulator::Now (); |
2294 return retval; | 2254 return retval; |
2295 } | 2255 } |
2296 | 2256 |
(...skipping 11 matching lines...) Expand all Loading... |
2308 m_failAvg = (1 - coefficient) + coefficient * m_failAvg; | 2268 m_failAvg = (1 - coefficient) + coefficient * m_failAvg; |
2309 } | 2269 } |
2310 | 2270 |
2311 double | 2271 double |
2312 WifiRemoteStationInfo::GetFrameErrorRate () const | 2272 WifiRemoteStationInfo::GetFrameErrorRate () const |
2313 { | 2273 { |
2314 return m_failAvg; | 2274 return m_failAvg; |
2315 } | 2275 } |
2316 | 2276 |
2317 } //namespace ns3 | 2277 } //namespace ns3 |
LEFT | RIGHT |