802.11 PHY layer model
More...
#include <wifi-phy.h>
List of all members.
Public Types |
enum | State { SYNC,
TX,
CCA_BUSY,
IDLE
} |
typedef Callback< void, Ptr
< Packet >, double, WifiMode,
enum WifiPreamble > | SyncOkCallback |
typedef Callback< void, Ptr
< Packet >, double > | SyncErrorCallback |
Public Member Functions |
uint32_t | GetNTxPower (void) const |
void | SetChannel (Ptr< WifiChannel > channel) |
void | SetReceiveOkCallback (SyncOkCallback callback) |
void | SetReceiveErrorCallback (SyncErrorCallback callback) |
void | SendPacket (Ptr< const Packet > packet, WifiMode mode, enum WifiPreamble preamble, uint8_t txPowerLevel) |
void | RegisterListener (WifiPhyListener *listener) |
bool | IsStateCcaBusy (void) |
bool | IsStateIdle (void) |
bool | IsStateBusy (void) |
bool | IsStateSync (void) |
bool | IsStateTx (void) |
Time | GetStateDuration (void) |
Time | GetDelayUntilIdle (void) |
Time | CalculateTxDuration (uint32_t size, WifiMode payloadMode, enum WifiPreamble preamble) const |
uint32_t | GetNModes (void) const |
WifiMode | GetMode (uint32_t mode) const |
double | CalculateSnr (WifiMode txMode, double ber) const |
Static Public Member Functions |
static TypeId | GetTypeId (void) |
| This method returns the TypeId associated to ns3::WifiPhy.
|
Private Member Functions |
virtual void | DoDispose (void) |
Detailed Description
802.11 PHY layer model
This PHY implements a model of 802.11a. The model implemented here is based on the model described in "Yet Another Network Simulator", (http://cutebugs.net/files/wns2-yans.pdf).
This PHY model depends on a channel loss and delay model as provided by the ns3::PropagationLossModel and ns3::PropagationDelayModel classes, both of which are members of the ns3::WifiChannel class.
Member Typedef Documentation
arg1: packet received unsuccessfully arg2: snr of packet
arg1: packet received successfully arg2: snr of packet arg3: mode of packet arg4: type of preamble used for packet.
Member Enumeration Documentation
The state of the PHY layer.
- Enumerator:
SYNC |
The PHY layer is synchronized upon a packet.
|
TX |
The PHY layer is sending a packet.
|
CCA_BUSY |
The PHY layer has sense the medium busy through the CCA mechanism
|
IDLE |
The PHY layer is IDLE.
|
Member Function Documentation
double ns3::WifiPhy::CalculateSnr |
( |
WifiMode |
txMode, |
|
|
double |
ber | |
|
) |
| | const |
- Parameters:
-
| txMode | the transmission mode |
| ber | the probability of bit error rate |
- Returns:
- the minimum snr which is required to achieve the requested ber for the specified transmission mode.
Time ns3::WifiPhy::CalculateTxDuration |
( |
uint32_t |
size, |
|
|
WifiMode |
payloadMode, |
|
|
enum WifiPreamble |
preamble | |
|
) |
| | const |
- Parameters:
-
| size | the number of bytes in the packet to send |
| payloadMode | the transmission mode to use for this packet |
| preamble | the type of preamble to use for this packet. |
- Returns:
- the total amount of time this PHY will stay busy for the transmission of these bytes.
virtual void ns3::WifiPhy::DoDispose |
( |
void |
|
) |
[private, virtual] |
This method is called by Object::Dispose or by the object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e., for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose method.
Reimplemented from ns3::Object.
Time ns3::WifiPhy::GetDelayUntilIdle |
( |
void |
|
) |
|
- Returns:
- the predicted delay until this PHY can become WifiPhy::IDLE.
The PHY will never become WifiPhy::IDLE _before_ the delay returned by this method but it could become really idle later.
WifiMode ns3::WifiPhy::GetMode |
( |
uint32_t |
mode |
) |
const |
- Parameters:
-
| mode | index in array of supported modes |
- Returns:
- the mode whose index is specified.
uint32_t ns3::WifiPhy::GetNModes |
( |
void |
|
) |
const |
- Returns:
- the number of transmission modes supported by this PHY.
uint32_t ns3::WifiPhy::GetNTxPower |
( |
void |
|
) |
const |
- Returns:
- the number of tx power levels available for this PHY.
Time ns3::WifiPhy::GetStateDuration |
( |
void |
|
) |
|
- Returns:
- the amount of time since the current state has started.
static TypeId ns3::WifiPhy::GetTypeId |
( |
void |
|
) |
[static] |
This method returns the TypeId associated to ns3::WifiPhy.
This object is accessible through the following paths with Config::Set and Config::Connect:
-
/NodeList/[i]/DeviceList/[i]/$ns3WifiNetDevice/Phy
Attributes defined for this type:
-
EnergyDetectionThreshold: The energy of a received signal should be higher than this threshold (dbm) to allow the PHY layer to detect the signal.
-
Set with class: ns3::DoubleValue
-
Underlying type: double -1.79769e+308:1.79769e+308
-
Initial value: -140
-
Flags: construct write read
-
TxGain: Transmission gain (dB).
-
Set with class: ns3::DoubleValue
-
Underlying type: double -1.79769e+308:1.79769e+308
-
Initial value: 1
-
Flags: construct write read
-
RxGain: Reception gain (dB).
-
Set with class: ns3::DoubleValue
-
Underlying type: double -1.79769e+308:1.79769e+308
-
Initial value: 1
-
Flags: construct write read
-
TxPowerLevels: Number of transmission power levels available between TxPowerBase and TxPowerEnd included.
-
TxPowerEnd: Maximum available transmission level (dbm).
-
Set with class: ns3::DoubleValue
-
Underlying type: double -1.79769e+308:1.79769e+308
-
Initial value: 16.0206
-
Flags: construct write read
-
TxPowerStart: Minimum available transmission level (dbm).
-
Set with class: ns3::DoubleValue
-
Underlying type: double -1.79769e+308:1.79769e+308
-
Initial value: 16.0206
-
Flags: construct write read
-
RxNoise: Ratio of energy lost by receiver (dB).
-
Set with class: ns3::DoubleValue
-
Underlying type: double -1.79769e+308:1.79769e+308
-
Initial value: 7
-
Flags: construct write read
-
Standard: The standard chosen configures a set of transmission modes and some PHY-specific constants.
-
Set with class: ns3::EnumValue
-
Underlying type: 802.11a|holland
-
Initial value: 802.11a
-
Flags: construct write
TraceSources defined for this type:
-
State: The WifiPhy state
-
RxOk: A packet has been received successfully.
-
RxError: A packet has been received unsuccessfully.
-
Tx: Packet transmission is starting.
Reimplemented from ns3::Object.
bool ns3::WifiPhy::IsStateBusy |
( |
void |
|
) |
|
- Returns:
- true of the current state of the PHY layer is not WifiPhy::IDLE, false otherwise.
bool ns3::WifiPhy::IsStateCcaBusy |
( |
void |
|
) |
|
- Returns:
- true of the current state of the PHY layer is WifiPhy:LCCA_BUSY, false otherwise.
bool ns3::WifiPhy::IsStateIdle |
( |
void |
|
) |
|
- Returns:
- true of the current state of the PHY layer is WifiPhy::IDLE, false otherwise.
bool ns3::WifiPhy::IsStateSync |
( |
void |
|
) |
|
- Returns:
- true of the current state of the PHY layer is WifiPhy::SYNC, false otherwise.
bool ns3::WifiPhy::IsStateTx |
( |
void |
|
) |
|
- Returns:
- true of the current state of the PHY layer is WifiPhy::TX, false otherwise.
- Parameters:
-
| listener | the new listener |
Add the input listener to the list of objects to be notified of PHY-level events.
void ns3::WifiPhy::SendPacket |
( |
Ptr< const Packet > |
packet, |
|
|
WifiMode |
mode, |
|
|
enum WifiPreamble |
preamble, |
|
|
uint8_t |
txPowerLevel | |
|
) |
| | |
- Parameters:
-
| packet | the packet to send |
| mode | the transmission mode to use to send this packet |
| preamble | the type of preamble to use to send this packet. |
| txPowerLevel | a power level to use to send this packet. The real transmission power is calculated as txPowerMin + txPowerLevel * (txPowerMax - txPowerMin) / nTxLevels |
- Parameters:
-
| channel | the channel to connect to. |
- Parameters:
-
| callback | the callback to invoke upon erronous packet reception. |
- Parameters:
-
| callback | the callback to invoke upon successful packet reception. |
The documentation for this class was generated from the following files:
- src/devices/wifi/wifi-phy.h
- doc/introspected-doxygen.h