MiXiM
2.3
|
Physical layer that models an Ultra Wideband Impulse Radio wireless communication system. More...
#include <PhyLayerUWBIR.h>
Public Types | |
typedef t_dynamic_expression_value(* | fptr )(cComponent *context, t_dynamic_expression_value argv[], int argc) |
Public Member Functions | |
virtual void | finish () |
Only calls the deciders finish method. | |
virtual void | initialize (int stage) |
OMNeT++ initialization function. | |
virtual simtime_t | setRadioState (int rs) |
Captures radio switches to adjust power consumption. | |
virtual bool | isRadioInRX () const |
Returns the true if the radio is in RX state. | |
Static Public Member Functions | |
static t_dynamic_expression_value | ghassemzadehNLOSFunc (cComponent *, t_dynamic_expression_value argv[] __attribute__((unused)), int) |
Static Public Attributes | |
static fptr | ghassemzadehNLOSFPtr |
Protected Types | |
enum | Activities { SLEEP_ACCT = 0, RX_ACCT, TX_ACCT, SWITCHING_ACCT, SYNC_ACCT } |
Defines the power consuming activities (accounts) of the NIC. Should be the same as defined in the decider. | |
enum | ProtocolIds { IEEE_802154_UWB = 3200 } |
Protected Member Functions | |
virtual airframe_ptr_t | encapsMsg (cPacket *msg) |
This function encapsulates messages from the upper layer into an AirFrame and sets all necessary attributes. | |
virtual AnalogueModel * | getAnalogueModelFromName (const std::string &name, ParameterMap ¶ms) const |
Creates and returns an instance of the AnalogueModel with the specified name. | |
virtual Decider * | getDeciderFromName (const std::string &name, ParameterMap ¶ms) |
Creates and returns an instance of the decider with the specified name. | |
virtual MiximRadio * | initializeRadio () const |
Initializes and returns the radio class to use. | |
virtual void | switchRadioToRX () |
virtual void | switchRadioToSync () |
virtual void | setRadioCurrent (int rs) |
Updates the actual current drawn for the passed state. | |
virtual void | setSwitchingCurrent (int from, int to) |
Updates the actual current drawn for switching between the passed states. | |
Protected Attributes | |
RadioUWBIR * | uwbradio |
double | syncCurrent |
The different currents in mA. | |
Private Member Functions | |
PhyLayerUWBIR (const PhyLayerUWBIR &) | |
Copy constructor is not allowed. | |
PhyLayerUWBIR & | operator= (const PhyLayerUWBIR &) |
Assignment operator is not allowed. | |
Friends | |
class | DeciderUWBIRED |
Physical layer that models an Ultra Wideband Impulse Radio wireless communication system.
This class loads channel models and deliver frames to an UWB Decider. It is independent of the modulation technique, as long as the frames are represented using the same approach as in IEEE802154A.h (Maximum Pulse Amplitude Estimation).
Several channel models are possible: Ghassemzadeh-LOS, Ghassemadeh-NLOS (see UWBIRStochasticPathlossModel.h) and the IEEE 802.15.4A UWB channel models that use the default power delay profile (see UWBIRIEEE802154APathlossModel.h).
Currently, an energy detection receiver is modeled in UWBIRED.h. Several synchronization logics have been implemented in derived classes: see DeciderUWBIREDSync.h and and DeciderUWBIREDSyncOnAddress.h.
If you want to add a novel receiver (e.g. coherent demodulation), either derive UWBIRED or write your own, then add functionality in this module to load your decider. The same apply for new channel models.
To change the modulation, refer to UWBIRMac.h, IEEE802154A.h and UWBIRED.h. To implement optional modes of IEEE802154A, refer to IEEE802154A.h.
Refer to the following publications for more information: [1] An Ultra Wideband Impulse Radio PHY Layer Model for Network Simulation, J. Rousselot, J.-D. Decotignie, Simulation: Transactions of the Society for Computer Simulation, 2010 (to appear). [2] A High-Precision Ultra Wideband Impulse Radio Physical Layer Model for Network Simulation, Jérôme Rousselot, Jean-Dominique Decotignie, Second International Omnet++ Workshop,Simu'TOOLS, Rome, 6 Mar 09. http://portal.acm.org/citation.cfm?id=1537714
AnalogueModel * PhyLayerUWBIR::getAnalogueModelFromName | ( | const std::string & | name, |
ParameterMap & | params | ||
) | const [protected, virtual] |
Creates and returns an instance of the AnalogueModel with the specified name.
Is able to initialize the following AnalogueModels:
Reimplemented from PhyLayer.
{ if (name == "UWBIRStochasticPathlossModel") return createAnalogueModel<UWBIRStochasticPathlossModel>(params); if (name == "UWBIRIEEE802154APathlossModel") return createAnalogueModel<UWBIRIEEE802154APathlossModel>(params); return PhyLayerBattery::getAnalogueModelFromName(name, params); }
Decider * PhyLayerUWBIR::getDeciderFromName | ( | const std::string & | name, |
ParameterMap & | params | ||
) | [protected, virtual] |
Creates and returns an instance of the decider with the specified name.
Is able to initialize directly the following decider:
Reimplemented from PhyLayerBattery.
{ if (name == "DeciderUWBIREDSyncOnAddress") { protocolId = IEEE_802154_UWB; return createDecider<DeciderUWBIREDSyncOnAddress>(params);; } if (name == "DeciderUWBIREDSync") { protocolId = IEEE_802154_UWB; return createDecider<DeciderUWBIREDSync>(params); } if (name=="DeciderUWBIRED") { protocolId = IEEE_802154_UWB; return createDecider<DeciderUWBIRED>(params); } return PhyLayerBattery::getDeciderFromName(name, params); }
void PhyLayerUWBIR::initialize | ( | int | stage | ) | [virtual] |
OMNeT++ initialization function.
Read simple parameters. Read and parse xml file for decider and analogue models configuration.
Reimplemented from PhyLayerBattery.
References ConnectionManagerAccess::getNic(), BasePhyLayer::radio, and syncCurrent.
{ PhyLayerBattery::initialize(stage); if (stage == 0) { /* parameters belong to the NIC, not just phy layer * * if/when variable transmit power is supported, txCurrent * should be specified as an xml table of available transmit * power levels and corresponding txCurrent */ syncCurrent = getNic()->par( "syncCurrent" ); // assume instantaneous transitions between rx and sync uwbradio = dynamic_cast<RadioUWBIR*>(radio); } }
MiximRadio * PhyLayerUWBIR::initializeRadio | ( | ) | const [protected, virtual] |
Initializes and returns the radio class to use.
Can be overridden by sub-classing phy layers to use their own Radio implementations.
Reimplemented from BasePhyLayer.
References BasePhyLayer::readPar(), BasePhyLayer::recordStats, MiximRadio::RX, MiximRadio::setSwitchTime(), MiximRadio::SLEEP, and MiximRadio::TX.
{ int initialRadioState = par("initialRadioState"); //readPar("initalRadioState", (int) RadioUWBIR::SYNC); double radioMinAtt = readPar("radioMinAtt", 1.0); double radioMaxAtt = readPar("radioMaxAtt", 0.0); RadioUWBIR* uwbradio = RadioUWBIR::createNewUWBIRRadio(recordStats, initialRadioState, radioMinAtt, radioMaxAtt); // Radio timers // From Sleep mode uwbradio->setSwitchTime(RadioUWBIR::SLEEP, RadioUWBIR::RX, (hasPar("timeSleepToRX") ? par("timeSleepToRX") : par("timeTXToRX")).doubleValue()); uwbradio->setSwitchTime(RadioUWBIR::SLEEP, RadioUWBIR::TX, (hasPar("timeSleepToTX") ? par("timeSleepToTX") : par("timeRXToTX")).doubleValue()); // From TX mode uwbradio->setSwitchTime(RadioUWBIR::TX, RadioUWBIR::SYNC, (hasPar("timeTXToRX") ? par("timeTXToRX") : par("timeSleepToRX")).doubleValue()); uwbradio->setSwitchTime(RadioUWBIR::TX, RadioUWBIR::RX, (hasPar("timeTXToRX") ? par("timeTXToRX") : par("timeSleepToRX")).doubleValue()); // From RX mode uwbradio->setSwitchTime(RadioUWBIR::RX, RadioUWBIR::TX, (hasPar("timeRXToTX") ? par("timeRXToTX") : par("timeSleepToTX")).doubleValue()); uwbradio->setSwitchTime(RadioUWBIR::RX, RadioUWBIR::SYNC, (readPar("timeRXToSYNC", readPar("timeSYNCToRX", 0.000000001)))); uwbradio->setSwitchTime(RadioUWBIR::SYNC, RadioUWBIR::TX, (hasPar("timeRXToTX") ? par("timeRXToTX") : par("timeSleepToTX")).doubleValue()); // From SYNC mode uwbradio->setSwitchTime(RadioUWBIR::SYNC, RadioUWBIR::RX, (readPar("timeSYNCToRX", readPar("timeRXToSYNC", 0.000000001)))); return uwbradio; }