LMac

Package: inet.linklayer.lmac

compound module LMac

Implementation of L-MAC (Lightweight Medium Access Protocol for Wireless Sensor Networks).

See C++ documentation for details.

LMac

Inheritance diagram

Extends

Name

Type

Description

MacProtocolBase

simple module

Module base for different MAC protocols.

Parameters

Name

Type

Default value

Description

displayStringTextFormat

string

“”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

interfaceTableModule

string

address

string

“auto”

MAC address as hex string (12 hex digits), or

slotDuration

double

100ms

“auto”. “auto” values will be replaced by a generated MAC address in init stage 0. how long is a slot?

headerLength

int

10b

ctrlFrameLength

int

headerLength

mtu

int

0B

defaultChannel

double

0

default channel

bitrate

double

19200bps

bit rate

reservedMobileSlots

int

2

level at which we consider medium busy FIXME not used currently double busyRSSI;

numSlots

int

64

radioModule

string

“^.radio”

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

Properties

Name

Value

Description

class

LMac

display

i=block/rxtx

selfMessageKinds

inet::LMacType

Gates

Name

Direction

Size

Description

upperLayerIn

input

upperLayerOut

output

lowerLayerIn

input

lowerLayerOut

output

Signals

Name

Type

Unit

Description

packetDropped

cPacket

packetReceivedFromLower

cPacket

packetReceivedFromUpper

cPacket

packetSentToLower

cPacket

packetSentToUpper

cPacket

Statistics

Name

Title

Source

Record

Unit

Interpolation Mode

Description

packetDropIncorrectlyReceived

packet drop: incorrectly received

packetDropReasonIsIncorrectlyReceived(packetDropped)

count,sum(packetBytes),vector(packetBytes)

none

packetDropNotAddressedToUs

packet drop: not addressed to us

packetDropReasonIsNotAddressedToUs(packetDropped)

count,sum(packetBytes),vector(packetBytes)

none

Source code

//
// Implementation of L-MAC (Lightweight Medium Access Protocol for
// Wireless Sensor Networks).
//
// See C++ documentation for details.
//
module LMac extends MacProtocolBase like IMacProtocol
{
    parameters:
        string address @mutable = 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.
        // how long is a slot?
        double slotDuration @unit(s) = default(100ms);
        int headerLength @unit(b) = default(10b);
        int ctrlFrameLength @unit(b) = default(headerLength);
        int mtu @unit(B) = default(0B);
        // default channel
        double defaultChannel = default(0);
        // bit rate
        double bitrate @unit(bps) = default(19200bps);
        // level at which we consider medium busy FIXME not used currently
//        double busyRSSI;

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

        @class(LMac);
        @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);
        @selfMessageKinds(inet::LMacType);
}

File: src/inet/linklayer/lmac/LMac.ned