INET Framework for OMNeT++/OMNEST
SnrEval80211 Class Reference

A SnrEval for the 802.11b protocol. More...

#include <SnrEval80211.h>

Inheritance diagram for SnrEval80211:
SnrEval BasicSnrEval ChannelAccess BasicModule INotifiable

List of all members.

Protected Member Functions

virtual void initialize (int)
 Some extra parameters have to be read in.
virtual double calcDuration (cPacket *)
 computes the duration of a 802.11 frame in seconds

Detailed Description

A SnrEval for the 802.11b protocol.

Subclass of SnrEval. Basically the same except for some extra parameters of 802.11 and the duration of the packet that has to be computed differently as the modulation of header and data part of the packet are different. This module forms a physical layer together with the Decider80211 module. The resulting physical layer is intended to be used together with the Mac80211 module.

Author:
Marc Löbbers

Member Function Documentation

double SnrEval80211::calcDuration ( cPacket *  frame) [protected, virtual]

computes the duration of a 802.11 frame in seconds

The duration of the packet is computed, with respect to the different bitrates of header and data. The header is sent with 1Mbit/s and the rest with the bitrate read in in initialize().

Reimplemented from BasicSnrEval.

{
    EV << "bits without header: " << frame->getBitLength() -
        headerLength << ", bits header: " << headerLength << endl;
    return ((frame->getBitLength() - headerLength) / bitrate + headerLength / BITRATE_HEADER);
}
void SnrEval80211::initialize ( int  stage) [protected, virtual]

Some extra parameters have to be read in.

Reimplemented from SnrEval.

{
    SnrEval::initialize(stage);

    if (stage == 0)
    {
        EV << "initializing stage 0\n";
        if (bitrate != 1E+6 && bitrate != 2E+6 && bitrate != 5.5E+6 && bitrate != 11E+6)
            error("Wrong bit rate for 802.11, valid values are 1E+6, 2E+6, 5.5E+6 or 11E+6");
        headerLength = 192;     //has to be 192; this makes sure it is!
    }
}

The documentation for this class was generated from the following files: