8/4/2019 PhyLayer
1/3
Physical Layer (in MiXiM)
The physical layer, which is implemented by the MiXiM framework, will be used in the
simulation. The PhyLayer is the core part of the wireless node in MiXiM. Its responsible for
sending and receiving messages and models the physical channel (attenuation and BER). The
PhyLayer contains three main components: (1) The PhyLayer OMNeT++ Module itself,
providing interface to upper layer and the channel (2) AnalogueModel as attenuation filter (3)Decidercalculates BER.
The PhyLayer is the only OMNeT module in the PhyLayer, while all the components are pure
C++ classes, which can be easily substituted with other components.
BasePhyLayerDecider
Inheritance
Inheritance
PhyLayer
MACToPhyInterface
AnalogueModelAnalogueModel
Listdecider
Figure 1: Physical Layer Collaboration Diagram
PhyLayer OMNeT++ class
The PhyLayer OMNeT++ class provides an interface to the MAC layer. It is directly connected
to the MAC layer via OMNeT++ gates. In addition PhyLayer is able to send messages to other
physical layers using ChannelAccess which provides an access to the channel. Two important
entities are encapsulated by this class; the AnalogueModel used to calculate attenuation of the
received message and Decider which decides whether the received signal is receivable message
or noise/interference. In addition it calculates BER for the receivable messages. In addition it
holds parameters such as, thermal noise value, sensitivity for receiving messages and information
regarding all messages currently transmitted on its entire channels.
PhyLayer phases:
1. Module initialing: reads NED parameters and initializing module, Decider andAnalogueModels.
2. Message handling: Receives AirFrames from MAC layer and send them to the channel.
8/4/2019 PhyLayer
2/3
Receives AirFrames from channel, hand them to the AnalogueModels forfiltering and for the Decider for evaluating. The PhyLayer can forward the packet
up to the MAC layer.
Analogue ModelThe AnalogueModel module is a filter, responsible for simulating the attenuation of received
signals. One PhyLayer may hold a list of AnalogueModel filters for the receiving signals, and all
can be applied on the received message. This is the place to set different radio propagation
models for the channels. A filter can attenuate the signal by simulating fading, shadowing, path
loss and more. All the operations are done on the Signal module (see MiXiM API) within the
AirFrame. The Signal holds some parameters which are used by the AnalogueModel, such as
starting and ending time of the signal, the sender position at a given time, the transmitter power,
propagation delay and bit-rate. The Signal also has a member which describes the attenuation. To
add attenuation to the Signal, the physical layer module iterates all the AnalogueModels on every
Signal. For each AnalogueModel the filterSignal(signal& S) method is invoked. This method
makes the desired mathematics evaluations according to a theoretical channel model, andinvokes S.addAttenuation(ConstMapping* att) method when finished. The attenuation value
inside
Three Analogue models are already implemented in MiXiM: JakesFading,
LogNormalShadowing and SimplePathlossModel (see 2.2.1.2).
This function has to be overridden by every implementation:
virtual void filterSignal(signal&)=0: Filters a specific signal by adding attenuation to the signal.
The steps to add a new channel model goes as follow:
Create new ChannelModel class, which publics the AnalogueModel class. Implement the filterSignal(signal& S) method. Make sure to update the signals
attenuation at the end.
Initialize the new ChannelModel from the physical layer module.Decider
The Decider provides the main functionality of the physical later, like signal classification and
demodulation. The Decider evaluates received signals and categorizes them to interference/noise
or receivable message, with a given bit error rate (BER). The channel modulation in MiXiM is
represented by the relation between BER to SINR (signal to interference and noise ratio), anddepends on the Decider implementation. Additionally, the Decider provides channel carrier
sensing information for the MAC layer. Two Deciders are already implemented in MiXiM:
Decider80211 and SNRThresholdDecider.
The next function has to be overridden in new implementations:
virtual simtime_t processSignal(AirFrame*): Processes an AirFrame given by the PhyLayer.
8/4/2019 PhyLayer
3/3
AirFrame
This packet format is used to send messages from the physical layer to the channel. All other
physical layers that can 'hear' (within its maximal interference distance) this message can
evaluate noise, interference and the payload. The payload is carried by a Signal class.
Signal class stores the physical representation of the payload of an AirFrame. This includes
propagation delay, the sender host move pattern, the transmission power, bit rate, attenuation and
more. The signal is created at the sender MAC layer.
Some class methods (for all methods see MiXiM API):
simtime_t getSignalLength() - Returns the length of the signal transmission.
simtime_t getPropagationDelay() - Returns the propagation delay of the signal.
void setBitrate(Mapping* bitrate) - Sets the function representing the bit rate of the signal.
void addAttenuation(ConstMapping* att) - Adds a function representing the attenuation of the
signal.
const ConstMapping* getTransmissionPower() - Returns a function representing the
transmission power of the signal
This Message class is taken directly from the MiXiM framework without any modifications.
http://c/Documents%20and%20Settings/efraima/Desktop/MiXiM-1.1/MiXiM/doc/doxy/a00017.html%236de2ca07018de313a7147a03e6d77bffhttp://c/Documents%20and%20Settings/efraima/Desktop/MiXiM-1.1/MiXiM/doc/doxy/a00017.html%236de2ca07018de313a7147a03e6d77bffhttp://c/Documents%20and%20Settings/efraima/Desktop/MiXiM-1.1/MiXiM/doc/doxy/a00017.html%236de2ca07018de313a7147a03e6d77bffhttp://c/Documents%20and%20Settings/efraima/Desktop/MiXiM-1.1/MiXiM/doc/doxy/a00017.html%236de2ca07018de313a7147a03e6d77bffRecommended