Ieee80211Mac

Package: inet.linklayer.ieee80211.mac

Ieee80211Mac

compound module

Implementation of the 802.11b MAC protocol. This module is intended to be used in combination with the Ieee80211Radio module as the physical layer. (The SnrEval80211 and Decider80211 modules should also work if per-packet bitrate setting gets implemented.)

Encapsulation/decapsulation must be done in the upper layers. (It is typically in the 802.11 management module, see in Ieee80211Interface). The base class for 802.11 frame messages is Ieee80211MacHeader, but this module expects Ieee80211DataOrMgmtHeader (a subclass) from upper layers (the management module). This module will assign the transmitter address (address 2) and the frame sequence number/fragment number fields in the frames; all other fields must already be filled when this module gets the frame for transmission.

The module has an internal queue, but usually it is to be used with an external passive queue module (its name should be given in the queueModule parameter; specifying "" causes the internal queue to be used). The passive queue module is a simple module whose C++ class implements the IPassiveQueue interface.

Limitations

The following features not supported: 1) power management, 2) polling (PCF). Physical layer algorithms such as frequency hopping and direct sequence spread spectrum are not modelled directly.

Fields related to the above unsupported features are omitted from management frame formats as well (for example, FH/DS/CF parameter sets, beacon/probe timestamp which is related to physical layer synchronization, listen interval which is related to power management, capability information which is related to PCF and other non-modelled features).

IDcf IHcf IDs IRx ITx IStatistics

Usage diagram

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Extends

Name Type Description
MacProtocolBase simple module

Module base for different MAC protocols.

Parameters

Name Type Default value Description
interfaceTableModule string
mibModule string
modeSet string "g(mixed)"
fcsMode string "declared"
initialRadioMode string "receiver"
mtu int 2304B
qosStation bool false

Properties

Name Value Description
display i=block/layer
class Ieee80211Mac

Gates

Name Direction Size Description
upperLayerIn input
upperLayerOut output
lowerLayerIn input
lowerLayerOut output
mgmtIn input
mgmtOut output

Signals

Name Type Unit
modesetChanged inet::physicallayer::Ieee80211ModeSet
packetReceivedFromPeer inet::Packet
packetSentToPeer inet::Packet
linkBroken

Statistics

Name Title Source Record Unit Interpolation Mode
passedUpPk packets passed to higher layer packetSentToUpper count, sum(packetBytes), vector(packetBytes) none
rcvdPkFromHl packets received from higher layer packetReceivedFromUpper count, sum(packetBytes), vector(packetBytes) none
packetDropNotAddressedToUs packet drop: not addressed to us packetDropReasonIsNotAddressedToUs(packetDropped) count, sum(packetBytes), vector(packetBytes) none
packetDropQueueOverflow packet drop: queue overflow packetDropReasonIsQueueOverflow(packetDropped) count, sum(packetBytes), vector(packetBytes) none
packetDropRetryLimitReached packet drop: retry limit reached packetDropReasonIsRetryLimitReached(packetDropped) count, sum(packetBytes), vector(packetBytes) none
sentDownPk packets sent to lower layer packetSentToLower count, sum(packetBytes), vector(packetBytes) none
rcvdPkFromLl packets received from lower layer packetReceivedFromLower count, sum(packetBytes), vector(packetBytes) none
linkBroken link break linkBroken count none
packetDropIncorrectlyReceived packet drop: incorrectly received packetDropReasonIsIncorrectlyReceived(packetDropped) count, sum(packetBytes), vector(packetBytes) none

Source code

//
// Implementation of the 802.11b MAC protocol. This module is intended
// to be used in combination with the ~Ieee80211Radio module as the physical
// layer. (The ~SnrEval80211 and ~Decider80211 modules should also work if
// per-packet bitrate setting gets implemented.)
//
// Encapsulation/decapsulation must be done in the upper layers. (It is
// typically in the 802.11 management module, see in ~Ieee80211Interface).
// The base class for 802.11 frame messages is ~Ieee80211MacHeader, but this
// module expects ~Ieee80211DataOrMgmtHeader (a subclass) from upper layers
// (the management module). This module will assign the transmitter address
// (address 2) and the frame sequence number/fragment number fields in the
// frames; all other fields must already be filled when this module gets
// the frame for transmission.
//
// The module has an internal queue, but usually it is to be used with an
// external passive queue module (its name should be given in the queueModule
// parameter; specifying "" causes the internal queue to be used). The passive
// queue module is a simple module whose C++ class implements the IPassiveQueue
// interface.
//
// <b>Limitations</b>
//
// The following features not supported: 1) power management, 2) polling (PCF).
// Physical layer algorithms such as frequency hopping and
// direct sequence spread spectrum are not modelled directly.
//
// Fields related to the above unsupported features are omitted from
// management frame formats as well (for example, FH/DS/CF parameter sets,
// beacon/probe timestamp which is related to physical layer synchronization,
// listen interval which is related to power management, capability information
// which is related to PCF and other non-modelled features).
//
module Ieee80211Mac extends MacProtocolBase like IIeee80211Mac
{
    parameters:
        string mibModule;
        string modeSet @enum("a","b","g(erp)","g(mixed)","n(mixed-2.4Ghz)","p","ac") = default("g(mixed)");
        string fcsMode @enum("declared","computed") = default("declared");
        string initialRadioMode @enum("off","sleep","receiver","transmitter","transceiver") = default("receiver");

        int mtu @unit(B) = default(2304B);
        bool qosStation = default(false);

        *.mibModule = default(absPath(mibModule));
        *.rxModule = "^.rx";
        *.txModule = "^.tx";

        @display("i=block/layer");
        @class(Ieee80211Mac);
        @signal[packetSentToPeer](type=inet::Packet);
        @signal[packetReceivedFromPeer](type=inet::Packet);
        @statistic[passedUpPk](title="packets passed to higher layer"; source=packetSentToUpper; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
        @statistic[sentDownPk](title="packets sent to lower layer"; source=packetSentToLower; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
        @statistic[rcvdPkFromHl](title="packets received from higher layer"; source=packetReceivedFromUpper; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
        @statistic[rcvdPkFromLl](title="packets received from lower layer"; source=packetReceivedFromLower; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);

        @signal[linkBroken];
        @statistic[linkBroken](title="link break"; source=linkBroken; record=count; interpolationmode=none);
        @statistic[packetDropIncorrectlyReceived](title="packet drop: incorrectly received"; source=packetDropReasonIsIncorrectlyReceived(packetDropped); record=count,sum(packetBytes),vector(packetBytes); interpolationmode=none);
        @statistic[packetDropNotAddressedToUs](title="packet drop: not addressed to us"; source=packetDropReasonIsNotAddressedToUs(packetDropped); record=count,sum(packetBytes),vector(packetBytes); interpolationmode=none);
        @statistic[packetDropQueueOverflow](title="packet drop: queue overflow"; source=packetDropReasonIsQueueOverflow(packetDropped); record=count,sum(packetBytes),vector(packetBytes); interpolationmode=none);
        @statistic[packetDropRetryLimitReached](title="packet drop: retry limit reached"; source=packetDropReasonIsRetryLimitReached(packetDropped); record=count,sum(packetBytes),vector(packetBytes); interpolationmode=none);
        @signal[modesetChanged](type=inet::physicallayer::Ieee80211ModeSet);
    gates:
        input mgmtIn;
        output mgmtOut;
    submodules:
        dcf: <default("Dcf")> like IDcf {
            parameters:
                @display("p=100,100");
        }
        hcf: <default("Hcf")> like IHcf {
            parameters:
                @display("p=250,100");
        }
        ds: <default("Ds")> like IDs {
            parameters:
                @display("p=400,100");
        }
        rx: <default("Rx")> like IRx {
            parameters:
                @display("p=100,200");
        }
        tx: <default("Tx")> like ITx {
            parameters:
                @display("p=250,200");
        }
        statistics: <default("BasicStatistics")> like IStatistics {
            parameters:
                @display("p=400,200");
        }
}

File: src/inet/linklayer/ieee80211/mac/Ieee80211Mac.ned