Simple Module BMacLayer

Package: inet.linklayer.bmac
File: src/inet/linklayer/bmac/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.

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
address string "auto"

MAC address as hex string (12 hex digits), or "auto". "auto" values will be replaced by a generated MAC address in init stage 0.

slotDuration double 0.1s

BMAC specific parameters how long is one slot?

headerLength int 10B
mtu int 0B
checkInterval double 0.01s

how long is the check interval (CCA)?

queueLength int 20
animation bool true

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

bitrate double 19200 bps

bit rate

useMACAcks bool false

should mac send and expect acknowledgments?

macMaxFrameRetries int 3

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

radioModule string "^.radio"

The path to the Radio module //FIXME remove default value

maxTxAttempts int 2

Maximum transmission attempts per data packet, when ACKs are used

Properties:

Name Value Description
display i=block/rxtx
class BMacLayer

Gates:

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

Signals:

Name Type Unit
NF_LINK_BREAK BMacFrame

Source code:

//
// Implementation of B-MAC (called also Berkeley MAC, Low Power Listening or 
// LPL).
// See C++ documentation for details.
//
simple BMacLayer extends MACProtocolBase like IMACProtocol
{
    parameters:
        string address = default("auto"); // MAC address as hex string (12 hex digits), or
                                          // "auto". "auto" values will be replaced by
                                          // a generated MAC address in init stage 0.
        // BMAC specific parameters
        // how long is one slot?
        double slotDuration @unit(s) = default(0.1s);

        int headerLength @unit(B) = default(10B);
        int mtu @unit("B") = default(0B);

        // 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)
        int 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);

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

        string radioModule = default("^.radio");   // The path to the Radio module  //FIXME remove default value

        int maxTxAttempts = default(2);     //  Maximum transmission attempts per data packet, when ACKs are used

        @class(BMacLayer);
        @signal[NF_LINK_BREAK](type=BMacFrame);
}