Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

SnrEval Class Reference
[snrEval - modules for attenuation and interference calculation]

Keeps track of the different snir levels when receiving a packet. More...

#include <SnrEval.h>

Inherits BasicSnrEval.

Inherited by GilbertElliotSnr, and SnrEval80211.

Inheritance diagram for SnrEval:

Inheritance graph
[legend]
Collaboration diagram for SnrEval:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void initialize (int)
 Initialize variables and publish the radio status.
virtual void receiveBBItem (int category, const BBItem *details, int scopeModuleId)
 Called by the Blackboard whenever a change occurs we're interested in.

Protected Types

typedef std::map< AirFrame *,
double > 
cRecvBuff
 Typedef used to store received messages together with receive power.

Protected Member Functions

virtual void handleLowerMsgStart (AirFrame *)
 Buffer the frame and update noise levels and snr information...
virtual void handleLowerMsgEnd (AirFrame *)
 Unbuffer the frame and update noise levels and snr information.
virtual double calcRcvdPower (AirFrame *frame)
 Calculates the power with which a packet is received. Overwrite this function to call all required loss elements, by default only pathloss is calculated. Fading, shadowing, antenna pattern are not evaluated in this class.
double calcPathloss (AirFrame *frame)
 Calculate the path loss.
void addNewSnr ()
 updates the snr information of the relevant AirFrames called in handleLowerMsgStart(AirFrame*)
void handlePublish (RSSI *r)
void modifySnrList (SnrList &list)
 updates the snr information of the relevant AirFrame called in handleLowerMsgEnd(AirFrame*)
virtual double calcDuration (cMessage *m)
 Calculate duration of this message.

Protected Attributes

SnrStruct snrInfo
 SnrInfo stores the snrList and the the recvdPower for the message currently beeing received together with a pointer to the message.
cRecvBuff recvBuff
 A buffer to store a pointer to a message and the related receive power.
RadioState::States radioState
 Current state of active channel (radio), set using radio, updated via BB.
int catRadioState
 category number given by bb for RadioState
RSSI rssi
 Last RSSI level.
int catRSSI
 category number given by bb for RSSI
bool publishRSSIAlways
 if false, the RSSI will not be published during the reception of a frame
MediumIndication indication
 track and publish current occupation state of medium
int catIndication
int nicModuleId
 Cache the module ID of the NIC.
double noiseLevel
 The noise level of the channel.
double recvTime
 Used to store the time a radio switched to recieve.
double waveLength
 The wavelength. Calculated from the carrier frequency specified in the omnetpp.ini The carrier frequency used. Can be specified in the omnetpp.ini file. If not present it is read from the ChannelControl module.
double thermalNoise
 Thermal noise on the channel. Can be specified in omnetpp.ini. Default: -100 dBm.
double pathLossAlphaHalf
 Path loss coefficient.
bool useTorus
 do we send on the surface of a torus
Coord playground
 then we need to know the edges of the playground
double bitrate
 keep bitrate to calculate duration
int catBitrate
 BB category of bitrate.

Static Protected Attributes

static const double speedOfLight = 300000000.0
 Speed of light.

Private Member Functions

 Module_Class_Members (SnrEval, BasicSnrEval, 0)

Classes

struct  SnrStruct
 Struct to store a pointer to the mesage, rcvdPower AND a SnrList, needed in SnrEval::addNewSnr. More...

Detailed Description

Keeps track of the different snir levels when receiving a packet.

This module keeps track of the noise level of the channel.

When receiving a packet this module updates the noise level of the channel. Based on the receive power of the packet it is processed and handed to upper layers or just treated as noise.

After the packet is completely received the snir information is attached and it is handed to the deceider module. The snir information may be manipulated if the module received the frame before the radio was in received mode. The snir information is a SnrList that lists all different snr levels together with the point of time starting from which the radio is switched in the received mode.

On top of that this module subscribs the RadioState on the Blackboard. The radio state gives information about whether this module is sending a packet, receiving a packet or idle. This information can be accessed via the Blackboard by other modules, e.g. a CSMAMacLayer.

Author:
Marc Loebbers, Jamarin Phongcharoen, Andreas Koepke


Member Function Documentation

void SnrEval::addNewSnr  )  [protected]
 

updates the snr information of the relevant AirFrames called in handleLowerMsgStart(AirFrame*)

The Snr information of the buffered message is updated....

double SnrEval::calcPathloss AirFrame *  frame  )  [protected]
 

Calculate the path loss.

This function simply calculates with how much power the signal arrives "here". If a different way of computing the path loss is required this function can be redefined.

void SnrEval::handleLowerMsgEnd AirFrame *  frame  )  [protected, virtual]
 

Unbuffer the frame and update noise levels and snr information.

This function is called right after the transmission is over, i.e. right after unbuffering.

First check the current radio state. The radio must not be switched from RECV state before the end of message is received. Otherwise drop the message. Additionally the snr information of the currently being received message (if any) has to be updated with the receivetime as timestamp and a new snr value. The new SnrList and the AirFrame are sent to the decider.

Reimplemented from BasicSnrEval.

Reimplemented in GilbertElliotSnr.

void SnrEval::handleLowerMsgStart AirFrame *  frame  )  [protected, virtual]
 

Buffer the frame and update noise levels and snr information...

This function is called right after a packet arrived, i.e. right before it is buffered for 'transmission time'.

First must to decide whether the message is "really" received or whether it's receive power is so low that it is just treated as noise. If the energy of the message is high enough to really receive it an snr list (SnrList) should be created to be able to store sn(i)r information for that message. Every time a new message a new snr value with a timestamp is added to that list. If the receive power of the frame is below the receiver sensibility, the frame is added to the accumulated noise.

Implements BasicSnrEval.

Reimplemented in GilbertElliotSnr.

void SnrEval::initialize int  stage  )  [virtual]
 

Initialize variables and publish the radio status.

All values not present in the ned file will be read from the ChannelControl module or assigned default values.

Reimplemented from BasicSnrEval.

Reimplemented in GilbertElliotSnr, and SnrEval80211.

void SnrEval::modifySnrList SnrList list  )  [protected]
 

updates the snr information of the relevant AirFrame called in handleLowerMsgEnd(AirFrame*)

The Snr information of the buffered message is updated....

If the frame arrived before the radio was ready to received, the snir information must be new calculated. The new snir information is a SnrList that lists all different snr levels together with the point of time starting from which the radio is switched in the received mode.

void SnrEval::receiveBBItem int  category,
const BBItem details,
int  scopeModuleId
[virtual]
 

Called by the Blackboard whenever a change occurs we're interested in.

The SnrEval has subscreibed the NewRadioState and will be informed each time the radio state changes. The time radio switched to RECV must be noted.

Reimplemented from BasicSnrEval.


Member Data Documentation

double SnrEval::pathLossAlphaHalf [protected]
 

Path loss coefficient.

Can be specified in omnetpp.ini. If not it is read from the ChannelControl module. This value CANNOT be smaller than the one specified in the ChannelControl module. The simulation will exit with an error! The stored value is smaller to enable faster calculation using the square of the distance.

bool SnrEval::publishRSSIAlways [protected]
 

if false, the RSSI will not be published during the reception of a frame

Set it to false if you want a small speed up in the simulation.


The documentation for this class was generated from the following files:
Generated on Fri Jan 12 08:30:21 2007 for Mobility Framework by  doxygen 1.4.4