hold per-remote-station state. More...
#include <wifi-remote-station-manager.h>
Public Member Functions | |
WifiRemoteStation () | |
virtual | ~WifiRemoteStation () |
void | Reset (void) |
void | AddSupportedMode (WifiMode mode) |
bool | IsBrandNew (void) const |
bool | IsAssociated (void) const |
bool | IsWaitAssocTxOk (void) const |
void | RecordWaitAssocTxOk (void) |
void | RecordGotAssocTxOk (void) |
void | RecordGotAssocTxFailed (void) |
void | RecordDisassociated (void) |
void | PrepareForQueue (Ptr< const Packet > packet, uint32_t fullPacketSize) |
WifiMode | GetDataMode (Ptr< const Packet > packet, uint32_t fullPacketSize) |
WifiMode | GetRtsMode (Ptr< const Packet > packet) |
void | ReportRtsFailed (void) |
void | ReportDataFailed (void) |
void | ReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr) |
void | ReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr) |
void | ReportFinalRtsFailed (void) |
void | ReportFinalDataFailed (void) |
void | ReportRxOk (double rxSnr, WifiMode txMode) |
virtual bool | NeedRts (Ptr< const Packet > packet) |
virtual bool | NeedRtsRetransmission (Ptr< const Packet > packet) |
virtual bool | NeedDataRetransmission (Ptr< const Packet > packet) |
virtual bool | NeedFragmentation (Ptr< const Packet > packet) |
virtual uint32_t | GetFragmentSize (Ptr< const Packet > packet, uint32_t fragmentNumber) |
virtual uint32_t | GetFragmentOffset (Ptr< const Packet > packet, uint32_t fragmentNumber) |
virtual bool | IsLastFragment (Ptr< const Packet > packet, uint32_t fragmentNumber) |
WifiMode | GetCtsMode (WifiMode rtsMode) |
WifiMode | GetAckMode (WifiMode dataMode) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Protected Member Functions | |
virtual void | DoReportRtsFailed (void)=0 |
virtual void | DoReportDataFailed (void)=0 |
virtual void | DoReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr)=0 |
virtual void | DoReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr)=0 |
virtual void | DoReportFinalRtsFailed (void)=0 |
virtual void | DoReportFinalDataFailed (void)=0 |
virtual void | DoReportRxOk (double rxSnr, WifiMode txMode)=0 |
uint32_t | GetNSupportedModes (void) const |
WifiMode | GetSupportedMode (uint32_t i) const |
Private Types | |
enum | { BRAND_NEW, DISASSOC, WAIT_ASSOC_TX_OK, GOT_ASSOC_TX_OK } |
typedef std::vector< WifiMode > | SupportedModes |
Private Member Functions | |
virtual Ptr < WifiRemoteStationManager > | GetManager (void) const =0 |
virtual WifiMode | DoGetDataMode (uint32_t size)=0 |
virtual WifiMode | DoGetRtsMode (void)=0 |
uint32_t | GetNFragments (Ptr< const Packet > packet) |
bool | IsIn (WifiMode mode) const |
WifiMode | GetControlAnswerMode (WifiMode reqMode) |
Private Attributes | |
enum ns3::WifiRemoteStation:: { ... } | m_state |
SupportedModes | m_modes |
TracedValue< uint32_t > | m_ssrc |
TracedValue< uint32_t > | m_slrc |
hold per-remote-station state.
The state in this class is used to keep track of association status if we are in an infrastructure network and to perform the selection of tx parameters on a per-packet basis.
Definition at line 114 of file wifi-remote-station-manager.h.
typedef std::vector<WifiMode> ns3::WifiRemoteStation::SupportedModes [private] |
Definition at line 262 of file wifi-remote-station-manager.h.
anonymous enum [private] |
Definition at line 280 of file wifi-remote-station-manager.h.
ns3::WifiRemoteStation::WifiRemoteStation | ( | ) |
Definition at line 422 of file wifi-remote-station-manager.cc.
ns3::WifiRemoteStation::~WifiRemoteStation | ( | ) | [virtual] |
Definition at line 427 of file wifi-remote-station-manager.cc.
void ns3::WifiRemoteStation::AddSupportedMode | ( | WifiMode | mode | ) |
Invoked in a STA or AP to store the set of modes supported by a destination which is also supported locally. The set of supported modes includes the BSSBasicRateSet.
Definition at line 474 of file wifi-remote-station-manager.cc.
References IsIn(), and m_modes.
Referenced by ns3::AdhocWifiMac::Enqueue(), ns3::NqstaWifiMac::Receive(), ns3::NqapWifiMac::Receive(), and Reset().
virtual WifiMode ns3::WifiRemoteStation::DoGetDataMode | ( | uint32_t | size | ) | [private, pure virtual] |
virtual WifiMode ns3::WifiRemoteStation::DoGetRtsMode | ( | void | ) | [private, pure virtual] |
virtual void ns3::WifiRemoteStation::DoReportDataFailed | ( | void | ) | [protected, pure virtual] |
virtual void ns3::WifiRemoteStation::DoReportDataOk | ( | double | ackSnr, | |
WifiMode | ackMode, | |||
double | dataSnr | |||
) | [protected, pure virtual] |
virtual void ns3::WifiRemoteStation::DoReportFinalDataFailed | ( | void | ) | [protected, pure virtual] |
virtual void ns3::WifiRemoteStation::DoReportFinalRtsFailed | ( | void | ) | [protected, pure virtual] |
virtual void ns3::WifiRemoteStation::DoReportRtsFailed | ( | void | ) | [protected, pure virtual] |
virtual void ns3::WifiRemoteStation::DoReportRtsOk | ( | double | ctsSnr, | |
WifiMode | ctsMode, | |||
double | rtsSnr | |||
) | [protected, pure virtual] |
virtual void ns3::WifiRemoteStation::DoReportRxOk | ( | double | rxSnr, | |
WifiMode | txMode | |||
) | [protected, pure virtual] |
dataMode | the transmission mode used to send an ACK we just received |
Definition at line 545 of file wifi-remote-station-manager.cc.
References GetControlAnswerMode().
Referenced by ns3::MacLow::GetAckTxModeForData().
see ieee 802.11e, section 9.6:
To allow the transmitting STA to calculate the contents of the Duration/ID field, a STA responding to a received frame shall transmit its Control Response frame (either CTS or ACK) frames, other than the Block-Ack control frame, at the highest rate in the BSSBasicRateSet parameter that is less than or equal to the rate of the immediately previous frame in the frame exchange sequence (as defined in 9.79.12) and that is of the same modulation type as the received frame. If no rate in the basic rate set meets these conditions, then the control frame sent in response to a received frame shall be transmitted at the highest mandatory rate of the PHY that is less than or equal to the rate of the received frame, and that is of the same modulation type as the received frame. In addition, the Control Response frame shall be sent using the same PHY options as the received frame, unless they conflict with the requirement to use the BSSBasicRateSet parameter.
Definition at line 497 of file wifi-remote-station-manager.cc.
References GetManager(), ns3::WifiMode::GetModulationType(), and ns3::WifiMode::GetPhyRate().
Referenced by GetAckMode(), and GetCtsMode().
rtsMode | the transmission mode used to send an RTS we just received |
Definition at line 540 of file wifi-remote-station-manager.cc.
References GetControlAnswerMode().
Referenced by ns3::MacLow::GetCtsTxModeForRts().
WifiMode ns3::WifiRemoteStation::GetDataMode | ( | Ptr< const Packet > | packet, | |
uint32_t | fullPacketSize | |||
) |
packet | the packet to send | |
fullPacketSize | the size of the packet after its 802.11 MAC header has been added. |
Definition at line 572 of file wifi-remote-station-manager.cc.
References DoGetDataMode(), ns3::TxModeTag::GetDataMode(), GetManager(), and NS_ASSERT.
Referenced by ns3::MacLow::GetDataTxMode().
uint32_t ns3::WifiRemoteStation::GetFragmentOffset | ( | Ptr< const Packet > | packet, | |
uint32_t | fragmentNumber | |||
) | [virtual] |
packet | the packet to send | |
fragmentNumber | the fragment index of the next fragment to send (starts at zero). |
Definition at line 660 of file wifi-remote-station-manager.cc.
References GetManager(), GetNFragments(), and NS_ASSERT.
Referenced by ns3::DcaTxop::GetFragmentOffset().
uint32_t ns3::WifiRemoteStation::GetFragmentSize | ( | Ptr< const Packet > | packet, | |
uint32_t | fragmentNumber | |||
) | [virtual] |
packet | the packet to send | |
fragmentNumber | the fragment index of the next fragment to send (starts at zero). |
Definition at line 642 of file wifi-remote-station-manager.cc.
References GetManager(), and GetNFragments().
Referenced by ns3::DcaTxop::GetFragmentSize(), and ns3::DcaTxop::GetNextFragmentSize().
virtual Ptr<WifiRemoteStationManager> ns3::WifiRemoteStation::GetManager | ( | void | ) | const [private, pure virtual] |
Implemented in ns3::AmrrWifiRemoteStation, ns3::ArfWifiRemoteStation, ns3::ConstantRateWifiRemoteStation, ns3::IdealWifiRemoteStation, ns3::OnoeWifiRemoteStation, ns3::RraaWifiRemoteStation, and ns3::NonUnicastWifiRemoteStation.
Referenced by GetControlAnswerMode(), GetDataMode(), GetFragmentOffset(), GetFragmentSize(), GetNFragments(), GetRtsMode(), NeedDataRetransmission(), NeedFragmentation(), NeedRts(), NeedRtsRetransmission(), PrepareForQueue(), and Reset().
Definition at line 635 of file wifi-remote-station-manager.cc.
References GetManager().
Referenced by GetFragmentOffset(), GetFragmentSize(), and IsLastFragment().
uint32_t ns3::WifiRemoteStation::GetNSupportedModes | ( | void | ) | const [protected] |
Definition at line 551 of file wifi-remote-station-manager.cc.
References m_modes.
Referenced by ns3::OnoeWifiRemoteStation::DoGetDataMode(), ns3::AmrrWifiRemoteStation::DoGetDataMode(), ns3::RraaWifiRemoteStation::GetMaxRate(), ns3::ArfWifiRemoteStation::GetMaxRate(), ns3::AmrrWifiRemoteStation::IncreaseRate(), ns3::AmrrWifiRemoteStation::IsMaxRate(), ns3::OnoeWifiRemoteStation::UpdateMode(), and ns3::AmrrWifiRemoteStation::UpdateMode().
packet | the packet to send |
Definition at line 585 of file wifi-remote-station-manager.cc.
References DoGetRtsMode(), GetManager(), ns3::TxModeTag::GetRtsMode(), and NS_ASSERT.
Referenced by ns3::MacLow::GetRtsTxMode().
WifiMode ns3::WifiRemoteStation::GetSupportedMode | ( | uint32_t | i | ) | const [protected] |
Definition at line 556 of file wifi-remote-station-manager.cc.
References m_modes, and NS_ASSERT.
Referenced by ns3::RraaWifiRemoteStation::DoGetDataMode(), ns3::OnoeWifiRemoteStation::DoGetDataMode(), ns3::ArfWifiRemoteStation::DoGetDataMode(), ns3::AmrrWifiRemoteStation::DoGetDataMode(), ns3::RraaWifiRemoteStation::DoGetRtsMode(), ns3::OnoeWifiRemoteStation::DoGetRtsMode(), ns3::ArfWifiRemoteStation::DoGetRtsMode(), ns3::AmrrWifiRemoteStation::DoGetRtsMode(), and ns3::RraaWifiRemoteStation::GetThresholds().
TypeId ns3::WifiRemoteStation::GetTypeId | ( | void | ) | [static] |
Definition at line 410 of file wifi-remote-station-manager.cc.
References m_slrc, m_ssrc, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
bool ns3::WifiRemoteStation::IsAssociated | ( | void | ) | const |
Definition at line 437 of file wifi-remote-station-manager.cc.
References GOT_ASSOC_TX_OK, and m_state.
Referenced by ns3::NqapWifiMac::Receive().
bool ns3::WifiRemoteStation::IsBrandNew | ( | void | ) | const |
Definition at line 431 of file wifi-remote-station-manager.cc.
References BRAND_NEW, and m_state.
Referenced by ns3::AdhocWifiMac::Enqueue().
bool ns3::WifiRemoteStation::IsIn | ( | WifiMode | mode | ) | const [private] |
Definition at line 484 of file wifi-remote-station-manager.cc.
References m_modes.
Referenced by AddSupportedMode().
bool ns3::WifiRemoteStation::IsLastFragment | ( | Ptr< const Packet > | packet, | |
uint32_t | fragmentNumber | |||
) | [virtual] |
packet | the packet to send | |
fragmentNumber | the fragment index of the next fragment to send (starts at zero). |
Definition at line 668 of file wifi-remote-station-manager.cc.
References GetNFragments().
Referenced by ns3::DcaTxop::IsLastFragment().
bool ns3::WifiRemoteStation::IsWaitAssocTxOk | ( | void | ) | const |
Definition at line 442 of file wifi-remote-station-manager.cc.
References m_state, and WAIT_ASSOC_TX_OK.
Referenced by ns3::NqapWifiMac::TxFailed(), and ns3::NqapWifiMac::TxOk().
packet | the packet to send |
Definition at line 617 of file wifi-remote-station-manager.cc.
References GetManager(), and m_slrc.
Referenced by ns3::DcaTxop::NeedDataRetransmission().
packet | the packet to send |
Definition at line 623 of file wifi-remote-station-manager.cc.
References GetManager().
Referenced by ns3::DcaTxop::NeedFragmentation().
packet | the packet to send |
Reimplemented in ns3::RraaWifiRemoteStation.
Definition at line 599 of file wifi-remote-station-manager.cc.
References GetManager().
Referenced by ns3::RraaWifiRemoteStation::NeedRts(), and ns3::DcaTxop::NeedRts().
packet | the packet to send |
Definition at line 611 of file wifi-remote-station-manager.cc.
References GetManager(), and m_ssrc.
Referenced by ns3::DcaTxop::NeedRtsRetransmission().
void ns3::WifiRemoteStation::PrepareForQueue | ( | Ptr< const Packet > | packet, | |
uint32_t | fullPacketSize | |||
) |
packet | the packet to queue | |
fullPacketSize | the size of the packet after its 802.11 MAC header has been added. |
This method is typically invoked just before queuing a packet for transmission. It is a no-op unless the IsLowLatency attribute of the attached ns3::WifiRemoteStationManager is set to false, in which case, the tx parameters of the packet are calculated and stored in the packet as a tag. These tx parameters are later retrieved from GetDadaMode and GetRtsMode.
Definition at line 562 of file wifi-remote-station-manager.cc.
References DoGetDataMode(), DoGetRtsMode(), and GetManager().
Referenced by ns3::DcaTxop::Queue().
void ns3::WifiRemoteStation::RecordDisassociated | ( | void | ) |
Definition at line 462 of file wifi-remote-station-manager.cc.
References DISASSOC, and m_state.
Referenced by ns3::AdhocWifiMac::Enqueue(), ns3::NonUnicastWifiRemoteStation::NonUnicastWifiRemoteStation(), and ns3::NqapWifiMac::Receive().
void ns3::WifiRemoteStation::RecordGotAssocTxFailed | ( | void | ) |
Definition at line 457 of file wifi-remote-station-manager.cc.
References DISASSOC, and m_state.
Referenced by ns3::NqapWifiMac::TxFailed().
void ns3::WifiRemoteStation::RecordGotAssocTxOk | ( | void | ) |
Definition at line 452 of file wifi-remote-station-manager.cc.
References GOT_ASSOC_TX_OK, and m_state.
Referenced by ns3::NqapWifiMac::TxOk().
void ns3::WifiRemoteStation::RecordWaitAssocTxOk | ( | void | ) |
Definition at line 447 of file wifi-remote-station-manager.cc.
References m_state, and WAIT_ASSOC_TX_OK.
Referenced by ns3::NqapWifiMac::Receive().
void ns3::WifiRemoteStation::ReportDataFailed | ( | void | ) |
Should be invoked whenever the AckTimeout associated to a transmission attempt expires.
Definition at line 688 of file wifi-remote-station-manager.cc.
References DoReportDataFailed(), and m_slrc.
Referenced by ns3::MacLow::FastAckTimeout(), ns3::MacLow::NormalAckTimeout(), and ns3::MacLow::SuperFastAckTimeout().
void ns3::WifiRemoteStation::ReportDataOk | ( | double | ackSnr, | |
WifiMode | ackMode, | |||
double | dataSnr | |||
) |
Should be invoked whenever we receive the Ack associated to a data packet we just sent.
Definition at line 702 of file wifi-remote-station-manager.cc.
References DoReportDataOk(), and m_slrc.
Referenced by ns3::MacLow::ReceiveOk().
void ns3::WifiRemoteStation::ReportFinalDataFailed | ( | void | ) |
Should be invoked after calling ReportDataFailed if NeedDataRetransmission returns false
Definition at line 716 of file wifi-remote-station-manager.cc.
References DoReportFinalDataFailed(), and m_slrc.
Referenced by ns3::DcaTxop::MissedAck().
void ns3::WifiRemoteStation::ReportFinalRtsFailed | ( | void | ) |
Should be invoked after calling ReportRtsFailed if NeedRtsRetransmission returns false
Definition at line 709 of file wifi-remote-station-manager.cc.
References DoReportFinalRtsFailed(), and m_ssrc.
Referenced by ns3::DcaTxop::MissedCts().
void ns3::WifiRemoteStation::ReportRtsFailed | ( | void | ) |
Should be invoked whenever the RtsTimeout associated to a transmission attempt expires.
Definition at line 681 of file wifi-remote-station-manager.cc.
References DoReportRtsFailed(), and m_ssrc.
Referenced by ns3::MacLow::CtsTimeout().
void ns3::WifiRemoteStation::ReportRtsOk | ( | double | ctsSnr, | |
WifiMode | ctsMode, | |||
double | rtsSnr | |||
) |
Should be invoked whenever we receive the Cts associated to an RTS we just sent.
Definition at line 695 of file wifi-remote-station-manager.cc.
References DoReportRtsOk(), and m_ssrc.
Referenced by ns3::MacLow::ReceiveOk().
void ns3::WifiRemoteStation::ReportRxOk | ( | double | rxSnr, | |
WifiMode | txMode | |||
) |
rxSnr | the snr of the packet received | |
txMode | the transmission mode used for the packet received. |
Should be invoked whenever a packet is successfully received.
Definition at line 723 of file wifi-remote-station-manager.cc.
References DoReportRxOk().
Referenced by ns3::MacLow::ReceiveOk().
void ns3::WifiRemoteStation::Reset | ( | void | ) |
Invoked in an AP upon disassociation of a specific STA.
Definition at line 468 of file wifi-remote-station-manager.cc.
References AddSupportedMode(), GetManager(), and m_modes.
Referenced by ns3::WifiRemoteStationManager::Lookup().
Definition at line 286 of file wifi-remote-station-manager.h.
Referenced by AddSupportedMode(), GetNSupportedModes(), GetSupportedMode(), IsIn(), and Reset().
TracedValue<uint32_t> ns3::WifiRemoteStation::m_slrc [private] |
Definition at line 288 of file wifi-remote-station-manager.h.
Referenced by GetTypeId(), NeedDataRetransmission(), ReportDataFailed(), ReportDataOk(), and ReportFinalDataFailed().
TracedValue<uint32_t> ns3::WifiRemoteStation::m_ssrc [private] |
Definition at line 287 of file wifi-remote-station-manager.h.
Referenced by GetTypeId(), NeedRtsRetransmission(), ReportFinalRtsFailed(), ReportRtsFailed(), and ReportRtsOk().
enum { ... } ns3::WifiRemoteStation::m_state [private] |