Skip to content
Snippets Groups Projects
Commit 8affb263 authored by Christoph Sommer's avatar Christoph Sommer
Browse files

phy: rename sensitivity/noise parameters and change values used in tutorial simulation

parent a9543852
No related branches found
No related tags found
No related merge requests found
Showing with 51 additions and 51 deletions
......@@ -75,10 +75,10 @@ sim-time-limit = 200s
*.**.nic.mac1609_4.txPower = 20mW
*.**.nic.mac1609_4.bitrate = 6Mbps
*.**.nic.phy80211p.sensitivity = -89dBm
*.**.nic.phy80211p.minPowerLevel = -110dBm
*.**.nic.phy80211p.useThermalNoise = true
*.**.nic.phy80211p.thermalNoise = -110dBm
*.**.nic.phy80211p.useNoiseFloor = true
*.**.nic.phy80211p.noiseFloor = -98dBm
*.**.nic.phy80211p.decider = xmldoc("config.xml")
*.**.nic.phy80211p.analogueModels = xmldoc("config.xml")
......
......@@ -40,14 +40,14 @@ simtime_t BaseDecider::processNewSignal(AirFrame* frame)
double recvPower = signal.getMax();
// check whether signal is strong enough to receive
if (recvPower < sensitivity) {
EV_TRACE << "Signal is too weak (" << recvPower << " < " << sensitivity << ") -> do not receive." << endl;
if (recvPower < minPowerLevel) {
EV_TRACE << "Signal is too weak (" << recvPower << " < " << minPowerLevel << ") -> do not receive." << endl;
// Signal too weak, we can't receive it, tell PhyLayer that we don't want it again
return notAgain;
}
// Signal is strong enough, receive this Signal and schedule it
EV_TRACE << "Signal is strong enough (" << recvPower << " > " << sensitivity << ") -> Trying to receive AirFrame." << endl;
EV_TRACE << "Signal is strong enough (" << recvPower << " > " << minPowerLevel << ") -> Trying to receive AirFrame." << endl;
currentSignal.first = frame;
currentSignal.second = EXPECT_END;
......
......@@ -59,8 +59,8 @@ protected:
EXPECT_END,
};
/** @brief sensitivity value for receiving an AirFrame */
double sensitivity;
/** @brief minPowerLevel value for receiving an AirFrame */
double minPowerLevel;
/** @brief Pair of a AirFrame and the state it is in. */
typedef std::pair<AirFrame*, int> ReceivedSignal;
......@@ -79,11 +79,11 @@ public:
/**
* @brief Initializes the decider with the passed values.
*
* Needs a pointer to its physical layer, the sensitivity, and the index of the host.
* Needs a pointer to its physical layer, the minPowerLevel, and the index of the host.
*/
BaseDecider(cComponent* owner, DeciderToPhyInterface* phy, double sensitivity, int myIndex)
BaseDecider(cComponent* owner, DeciderToPhyInterface* phy, double minPowerLevel, int myIndex)
: Decider(owner, phy)
, sensitivity(sensitivity)
, minPowerLevel(minPowerLevel)
, isChannelIdle(true)
, myIndex(myIndex)
{
......@@ -110,7 +110,7 @@ protected:
* handle the signal again.
*
* Default implementation checks if the signals receiving power
* is above the sensitivity of the radio and we are not already trying
* is above the minPowerLevel of the radio and we are not already trying
* to receive another AirFrame. If thats the case it waits for the end
* of the signal.
*/
......
......@@ -54,14 +54,14 @@ void BasePhyLayer::initialize(int stage)
upperControlOut = findGate("upperControlOut");
upperControlIn = findGate("upperControlIn");
if (par("useThermalNoise").boolValue()) {
thermalNoiseValue = FWMath::dBm2mW(par("thermalNoise").doubleValue());
if (par("useNoiseFloor").boolValue()) {
noiseFloorValue = FWMath::dBm2mW(par("noiseFloor").doubleValue());
}
else {
thermalNoiseValue = 0;
noiseFloorValue = 0;
}
sensitivity = par("sensitivity").doubleValue();
sensitivity = FWMath::dBm2mW(sensitivity);
minPowerLevel = par("minPowerLevel").doubleValue();
minPowerLevel = FWMath::dBm2mW(minPowerLevel);
recordStats = par("recordStats").boolValue();
......@@ -72,8 +72,8 @@ void BasePhyLayer::initialize(int stage)
throw cRuntimeError("Could not find BaseWorldUtility module");
}
if (cc->hasPar("sat") && (sensitivity - FWMath::dBm2mW(cc->par("sat").doubleValue())) < -0.000001) {
throw cRuntimeError("Sensitivity can't be smaller than the signal attenuation threshold (sat) in ConnectionManager. Please adjust your omnetpp.ini file accordingly.");
if (cc->hasPar("sat") && (minPowerLevel - FWMath::dBm2mW(cc->par("sat").doubleValue())) < -0.000001) {
throw cRuntimeError("minPowerLevel can't be smaller than the signal attenuation threshold (sat) in ConnectionManager. Please adjust your omnetpp.ini file accordingly.");
}
initializeAnalogueModels(par("analogueModels").xmlValue());
......@@ -748,9 +748,9 @@ void BasePhyLayer::getChannelInfo(simtime_t_cref from, simtime_t_cref to, AirFra
channelInfo.getAirFrames(from, to, out);
}
double BasePhyLayer::getThermalNoiseValue()
double BasePhyLayer::getNoiseFloorValue()
{
return thermalNoiseValue;
return noiseFloorValue;
}
void BasePhyLayer::sendControlMsgToMac(cMessage* msg)
......
......@@ -90,8 +90,8 @@ protected:
}
int protocolId = PROTOCOL_ID_GENERIC; ///< The ID of the protocol this phy can transceive.
double thermalNoiseValue = 0; ///< Defines the strength of the thermal noise.
double sensitivity; ///< The sensitivity describes the minimum strength a signal must have to be received.
double noiseFloorValue = 0; ///< Catch-all for all factors negatively impacting SINR (e.g., thermal noise, noise figure, ...)
double minPowerLevel; ///< The minimum receive power needed to even attempt decoding a frame.
bool recordStats; ///< Stores if tracking of statistics (esp. cOutvectors) is enabled.
ChannelInfo channelInfo; ///< Channel info keeps track of received AirFrames and provides information about currently active AirFrames at the channel.
std::unique_ptr<Radio> radio; ///< The state machine storing the current radio state (TX, RX, SLEEP).
......@@ -406,9 +406,9 @@ public:
void getChannelInfo(simtime_t_cref from, simtime_t_cref to, AirFrameVector& out) override;
/**
* Return thermal noise power level (in mW).
* Return noise floor level (in mW).
*/
double getThermalNoiseValue() override;
double getNoiseFloorValue() override;
/**
* Send the given message to via the control gate to the mac.
......
......@@ -10,8 +10,8 @@ simple BasePhyLayer like IWirelessPhy
bool recordStats = default(false); //enable/disable tracking of statistics (eg. cOutvectors)
bool usePropagationDelay; //Should transmission delay be simulated?
double thermalNoise @unit(dBm); //the strength of the thermal noise [dBm]
bool useThermalNoise; //should thermal noise be considered?
double noiseFloor @unit(dBm); // catch-all for all factors negatively impacting SINR (e.g., thermal noise, noise figure, ...)
bool useNoiseFloor; // should a noise floor be considered when calculating SINR?
xml antenna = default(xml("<root><Antenna type=\"IsotropicAntenna\" id=\"default_isotropic\"></Antenna></root>"));
......@@ -22,7 +22,7 @@ simple BasePhyLayer like IWirelessPhy
xml analogueModels; //Specification of the analogue models to use and their parameters
xml decider; //Specification of the decider to use and its parameters
double sensitivity @unit(dBm); //The sensitivity of the physical layer [dBm]
double minPowerLevel @unit(dBm); // The minimum receive power needed to even attempt decoding a frame
//# switch times [s]:
double timeRXToTX = default(0) @unit(s); // Elapsed time to switch from receive to send state
......
......@@ -55,10 +55,10 @@ public:
virtual void getChannelInfo(simtime_t_cref from, simtime_t_cref to, AirFrameVector& out) = 0;
/**
* @brief Returns a constant which defines the thermal noise in
* @brief Returns a constant which defines the noise floor in
* the passed time frame (in mW).
*/
virtual double getThermalNoiseValue() = 0;
virtual double getNoiseFloorValue() = 0;
/**
* @brief Called by the Decider to send a control message to the MACLayer
......
......@@ -9,13 +9,13 @@ moduleinterface IWirelessPhy extends IChannelAccess
bool recordStats; //enable/disable tracking of statistics (eg. cOutvectors)
bool usePropagationDelay; //Should transmission delay be simulated?
double thermalNoise @unit(dBm); //the strength of the thermal noise [dBm]
bool useThermalNoise; //should thermal noise be considered?
double noiseFloor @unit(dBm); // catch-all for all factors negatively impacting SINR (e.g., thermal noise, noise figure, ...)
bool useNoiseFloor; // should a noise floor be considered when calculating SINR?
xml analogueModels; //Specification of the analogue models to use and their parameters
xml decider; //Specification of the decider to use and its parameters
double sensitivity @unit(dBm); //The sensitivity of the physical layer [dBm]
double minPowerLevel @unit(dBm); // The minimum receive power needed to even attempt decoding a frame
//# switch times [s]:
double timeRXToTX @unit(s); // Elapsed time to switch from receive to send state
......
......@@ -23,9 +23,9 @@ namespace Veins;
class AirFrame;
//
// Extension of base AirFrame message to have the underSensitivity field
// Extension of base AirFrame message to have the underMinPowerLevel field
//
message AirFrame11p extends AirFrame {
bool underSensitivity = false;
bool underMinPowerLevel = false;
bool wasTransmitting = false;
}
......@@ -47,10 +47,10 @@ simtime_t Decider80211p::processNewSignal(AirFrame* msg)
signalStates[frame] = EXPECT_END;
if (signal.smallerAtCenterFrequency(sensitivity)) {
if (signal.smallerAtCenterFrequency(minPowerLevel)) {
// annotate the frame, so that we won't try decoding it at its end
frame->setUnderSensitivity(true);
frame->setUnderMinPowerLevel(true);
// check channel busy status. a superposition of low power frames might turn channel status to busy
if (cca(simTime(), nullptr) == false) {
setChannelIdleStatus(false);
......@@ -73,14 +73,14 @@ simtime_t Decider80211p::processNewSignal(AirFrame* msg)
if (!currentSignal.first) {
// NIC is not yet synced to any frame, so lock and try to decode this frame
currentSignal.first = frame;
EV_TRACE << "AirFrame: " << frame->getId() << " with (" << recvPower << " > " << sensitivity << ") -> Trying to receive AirFrame." << std::endl;
EV_TRACE << "AirFrame: " << frame->getId() << " with (" << recvPower << " > " << minPowerLevel << ") -> Trying to receive AirFrame." << std::endl;
if (notifyRxStart) {
phy->sendControlMsgToMac(new cMessage("RxStartStatus", MacToPhyInterface::PHY_RX_START));
}
}
else {
// NIC is currently trying to decode another frame. this frame will be simply treated as interference
EV_TRACE << "AirFrame: " << frame->getId() << " with (" << recvPower << " > " << sensitivity << ") -> Already synced to another AirFrame. Treating AirFrame as interference." << std::endl;
EV_TRACE << "AirFrame: " << frame->getId() << " with (" << recvPower << " > " << minPowerLevel << ") -> Already synced to another AirFrame. Treating AirFrame as interference." << std::endl;
}
// channel turned busy
......@@ -118,7 +118,7 @@ DeciderResult* Decider80211p::checkIfSignalOk(AirFrame* frame)
AirFrameVector airFrames;
getChannelInfo(start, end, airFrames);
double noise = phy->getThermalNoiseValue();
double noise = phy->getNoiseFloorValue();
// Make sure to use the adjusted starting-point (which ignores the preamble)
double sinrMin = SignalUtils::getMinSINR(start, end, frame, airFrames, noise);
......@@ -260,7 +260,7 @@ bool Decider80211p::cca(simtime_t_cref time, AirFrame* exclude)
// In the reference implementation only centerFrequenvy - 5e6 (half bandwidth) is checked!
// Although this is wrong, the same is done here to reproduce original results
double minPower = phy->getThermalNoiseValue();
double minPower = phy->getNoiseFloorValue();
bool isChannelIdle = minPower < ccaThreshold;
if (airFrames.size() > 0) {
size_t usedFreqIndex = airFrames.front()->getSignal().getSpectrum().indexOf(centerFrequency - 5e6);
......@@ -287,7 +287,7 @@ simtime_t Decider80211p::processSignalEnd(AirFrame* msg)
DeciderResult* result;
if (frame->getUnderSensitivity()) {
if (frame->getUnderMinPowerLevel()) {
// this frame was not even detected by the radio card
result = new DeciderResult80211(false, 0, 0, recvPower_dBm);
}
......@@ -323,8 +323,8 @@ simtime_t Decider80211p::processSignalEnd(AirFrame* msg)
phy->sendUp(frame, result);
}
else {
if (frame->getUnderSensitivity()) {
EV_TRACE << "packet was not detected by the card. power was under sensitivity threshold\n";
if (frame->getUnderMinPowerLevel()) {
EV_TRACE << "packet was not detected by the card. power was under minPowerLevel threshold\n";
}
else if (whileSending) {
EV_TRACE << "packet was received while sending, sending it as control message to upper layer\n";
......
......@@ -153,10 +153,10 @@ protected:
public:
/**
* @brief Initializes the Decider with a pointer to its PhyLayer and
* specific values for threshold and sensitivity
* specific values for threshold and minPowerLevel
*/
Decider80211p(cComponent* owner, DeciderToPhyInterface* phy, double sensitivity, double ccaThreshold, bool allowTxDuringRx, double centerFrequency, int myIndex = -1, bool collectCollisionStatistics = false)
: BaseDecider(owner, phy, sensitivity, myIndex)
Decider80211p(cComponent* owner, DeciderToPhyInterface* phy, double minPowerLevel, double ccaThreshold, bool allowTxDuringRx, double centerFrequency, int myIndex = -1, bool collectCollisionStatistics = false)
: BaseDecider(owner, phy, minPowerLevel, myIndex)
, ccaThreshold(ccaThreshold)
, allowTxDuringRx(allowTxDuringRx)
, centerFrequency(centerFrequency)
......
......@@ -252,7 +252,7 @@ unique_ptr<AnalogueModel> PhyLayer80211p::initializeVehicleObstacleShadowing(Par
unique_ptr<Decider> PhyLayer80211p::initializeDecider80211p(ParameterMap& params)
{
double centerFreq = params["centerFrequency"];
auto dec = make_unique<Decider80211p>(this, this, sensitivity, ccaThreshold, allowTxDuringRx, centerFreq, findHost()->getIndex(), collectCollisionStatistics);
auto dec = make_unique<Decider80211p>(this, this, minPowerLevel, ccaThreshold, allowTxDuringRx, centerFreq, findHost()->getIndex(), collectCollisionStatistics);
dec->setPath(getParentModule()->getFullPath());
return unique_ptr<Decider>(std::move(dec));
}
......
......@@ -87,9 +87,9 @@ sim-time-limit = 100s
*.**.nic.mac1609_4.txPower = 20mW
*.**.nic.mac1609_4.bitrate = 18Mbps
*.**.nic.phy80211p.sensitivity = -89dBm
*.**.nic.phy80211p.useThermalNoise = true
*.**.nic.phy80211p.thermalNoise = -110dBm
*.**.nic.phy80211p.minPowerLevel = -110dBm
*.**.nic.phy80211p.useNoiseFloor = true
*.**.nic.phy80211p.noiseFloor = -98dBm
*.**.nic.phy80211p.decider = xmldoc("config.xml")
*.**.nic.phy80211p.analogueModels = xmldoc("config.xml")
*.**.nic.phy80211p.usePropagationDelay = true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment