ns3::WifiRemoteStation Class Reference

hold per-remote-station state. More...

#include <wifi-remote-station-manager.h>

Inheritance diagram for ns3::WifiRemoteStation:
Inheritance graph
[legend]
Collaboration diagram for ns3::WifiRemoteStation:
Collaboration graph
[legend]

List of all members.

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< WifiModeSupportedModes

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

Detailed Description

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.


Member Typedef Documentation

typedef std::vector<WifiMode> ns3::WifiRemoteStation::SupportedModes [private]

Definition at line 262 of file wifi-remote-station-manager.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
BRAND_NEW 
DISASSOC 
WAIT_ASSOC_TX_OK 
GOT_ASSOC_TX_OK 

Definition at line 280 of file wifi-remote-station-manager.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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]
WifiMode ns3::WifiRemoteStation::GetAckMode ( WifiMode  dataMode  ) 
Parameters:
dataMode the transmission mode used to send an ACK we just received
Returns:
the transmission mode to use for the ACK to complete the data/ACK handshake.

Definition at line 545 of file wifi-remote-station-manager.cc.

References GetControlAnswerMode().

Referenced by ns3::MacLow::GetAckTxModeForData().

WifiMode ns3::WifiRemoteStation::GetControlAnswerMode ( WifiMode  reqMode  )  [private]

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().

WifiMode ns3::WifiRemoteStation::GetCtsMode ( WifiMode  rtsMode  ) 
Parameters:
rtsMode the transmission mode used to send an RTS we just received
Returns:
the transmission mode to use for the CTS to complete the RTS/CTS handshake.

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 
)
Parameters:
packet the packet to send
fullPacketSize the size of the packet after its 802.11 MAC header has been added.
Returns:
the transmission mode to use to send this packet

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]
Parameters:
packet the packet to send
fragmentNumber the fragment index of the next fragment to send (starts at zero).
Returns:
the offset within the original packet where this fragment starts.

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]
Parameters:
packet the packet to send
fragmentNumber the fragment index of the next fragment to send (starts at zero).
Returns:
the size of the corresponding fragment.

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]
uint32_t ns3::WifiRemoteStation::GetNFragments ( Ptr< const Packet packet  )  [private]

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]
WifiMode ns3::WifiRemoteStation::GetRtsMode ( Ptr< const Packet packet  ) 
Parameters:
packet the packet to send
Returns:
the transmission mode to use to send the RTS prior to the transmission of the data packet itself.

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]
TypeId ns3::WifiRemoteStation::GetTypeId ( void   )  [static]
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]
Parameters:
packet the packet to send
fragmentNumber the fragment index of the next fragment to send (starts at zero).
Returns:
true if this is the last fragment, false otherwise.

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().

bool ns3::WifiRemoteStation::NeedDataRetransmission ( Ptr< const Packet packet  )  [virtual]
Parameters:
packet the packet to send
Returns:
true if we want to resend a packet after a failed transmission attempt, false otherwise.

Definition at line 617 of file wifi-remote-station-manager.cc.

References GetManager(), and m_slrc.

Referenced by ns3::DcaTxop::NeedDataRetransmission().

bool ns3::WifiRemoteStation::NeedFragmentation ( Ptr< const Packet packet  )  [virtual]
Parameters:
packet the packet to send
Returns:
true if this packet should be fragmented, false otherwise.

Definition at line 623 of file wifi-remote-station-manager.cc.

References GetManager().

Referenced by ns3::DcaTxop::NeedFragmentation().

bool ns3::WifiRemoteStation::NeedRts ( Ptr< const Packet packet  )  [virtual]
Parameters:
packet the packet to send
Returns:
true if we want to use an RTS/CTS handshake for this packet before sending it, false otherwise.

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().

bool ns3::WifiRemoteStation::NeedRtsRetransmission ( Ptr< const Packet packet  )  [virtual]
Parameters:
packet the packet to send
Returns:
true if we want to restart a failed RTS/CTS handshake, false otherwise.

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 
)
Parameters:
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   ) 
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 
)
Parameters:
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().


Member Data Documentation

enum { ... } ns3::WifiRemoteStation::m_state [private]

The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:11:28 2009 for NS-3 by  doxygen 1.6.3