Simple Module BMacLayer

Package: org.mixim.modules.mac
File: modules/mac/BMacLayer.ned

C++ definition

Implementation of B-MAC (called also Berkeley MAC, Low Power Listening or LPL). See C++ documentation for details.

BMacLayer

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram. Click here to see the full picture.

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram. Click here to see the full picture.

Extends:

BaseMacLayer (simple module)

Base module for every mac layer module

Used in compound modules:

If a module type shows up more than once, that means it has been defined in more than one NED file.

NicBMAC (compound module)

This module implements a BMAC network interface card using the "BMACLayer" MAC layer module

Parameters:

Name Type Default value Description
notAffectedByHostState bool false
coreDebug bool

debug switch

headerLength double

length of the MAC packet header (in bits)

debug bool false

debug switch

stats bool true

collect statistics?

slotDuration double 1s

BMAC specific parameters how long is one slot?

checkInterval double 0.01s

how long is the check interval (CCA)?

queueLength double 20
animation bool true

should we animate the nodes with colors depending on their state or not?

bitrate double 19200 bps

bit rate

txPower double 50 mW

tx power [mW]

useMACAcks bool false

should mac send and expect acknowledgments?

macMaxFrameRetries double 3

maximum number of frame retransmission only used when usage of MAC acks is enabled

Properties:

Name Value Description
class BMacLayer

Gates:

Name Direction Size Description
upperGateIn input

from upper layer

upperGateOut output

to uppe layer

upperControlIn input

control from upper layer

upperControlOut output

control to upper layer

lowerGateIn input

from lower layer

lowerGateOut output

to lower layer

lowerControlIn input

control from lower layer

lowerControlOut output

control to lower layer

Source code:

//
// Implementation of B-MAC (called also Berkeley MAC, Low Power Listening or 
// LPL).
// See C++ documentation for details.
//
simple BMacLayer extends BaseMacLayer
{
    parameters:
        @class(BMacLayer);
        // debug switch
        bool debug = default(false);
        //collect statistics?
        bool stats = default(true);

        // BMAC specific parameters
        // how long is one slot?
        double slotDuration @unit(s) = default(1s);

        // how long is the check interval (CCA)?
        double checkInterval @unit(s) = default(0.01s);

		// size of the MAC queue (maximum number of packets in Tx buffer)
        double queueLength = default(20);

        // should we animate the nodes with colors depending on their state or 
        // not?
        bool animation = default(true);

        // bit rate 
        double bitrate @unit(bps) = default(19200 bps);

        //tx power [mW]
        double txPower @unit(mW) = default(50 mW);

        //should mac send and expect acknowledgments?
        bool useMACAcks = default(false);
        // maximum number of frame retransmission
        // only used when usage of MAC acks is enabled
        double macMaxFrameRetries = default(3);
}