LMac

Package: inet.linklayer.lmac

LMac

compound module

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

See C++ documentation for details.

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 100ms

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
numSlots int 64
radioModule string "^.radio"

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

Properties

Name Value Description
display i=block/rxtx
class LMac
selfMessageKinds inet::LMacType

Gates

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

Signals

Name Type Unit
packetReceivedFromUpper cPacket
packetReceivedFromLower cPacket
packetDropped cPacket
packetSentToLower cPacket
packetSentToUpper cPacket

Statistics

Name Title Source Record Unit Interpolation Mode
packetDropNotAddressedToUs packet drop: not addressed to us packetDropReasonIsNotAddressedToUs(packetDropped) count, sum(packetBytes), vector(packetBytes) none
packetDropIncorrectlyReceived packet drop: incorrectly received packetDropReasonIsIncorrectlyReceived(packetDropped) count, sum(packetBytes), vector(packetBytes) none

Scheduled messages (observed)

msgkindctrltagsmsgnamecontext
omnetpp::cMessage168 (LMacType::LMAC_TIMEOUT)timeout
omnetpp::cMessage169 (LMacType::LMAC_WAKEUP)wakeup
omnetpp::cMessage170 (LMacType::LMAC_SEND_DATA)sendData
omnetpp::cMessage171 (LMacType::LMAC_SETUP_PHASE_END)setup phase
omnetpp::cMessage172 (LMacType::LMAC_CHECK_CHANNEL)checkchannel
omnetpp::cMessage175 (LMacType::LMAC_START_LMAC)start_lmac
omnetpp::cMessage176 (LMacType::LMAC_SEND_CONTROL)send_control

Direct method calls (observed)

call tofunctioninfo
MessageDispatcherinet::MessageDispatcher::arrivedarrived
PcapRecorderinet::PcapRecorder::receiveSignalpacketReceivedFromLower
InterfaceTableinet::InterfaceTable::interfaceChangedinterfaceChanged
ApskDimensionalRadioinet::physicallayer::ApskRadio::setRadioModesetRadioMode
ApskScalarRadioinet::physicallayer::ApskRadio::setRadioModesetRadioMode
UnitDiskRadioinet::physicallayer::UnitDiskRadio::setRadioModesetRadioMode
DropTailQueueinet::queueing::PacketQueue::pullPacketpullPacket

Called methods (observed)

functioninfocall from
inet::LMac::handleCanPullPacketChangedhandleCanPullPacketChangedDropTailQueue
inet::LMac::receiveSignalradioModeChangedApskDimensionalRadio, ApskScalarRadio, UnitDiskRadio
inet::LMac::receiveSignaltransmissionStateChangedApskDimensionalRadio, ApskScalarRadio, UnitDiskRadio

Incoming messages (observed)

gatemsgkindctrlsrcModuletags
lowerLayerInPacket0ApskDimensionalRadioErrorRateInd, PacketProtocolTag, SignalPowerInd, SignalTimeInd, SnirInd
lowerLayerInPacket0ApskScalarRadioErrorRateInd, PacketProtocolTag, SignalPowerInd, SignalTimeInd, SnirInd
lowerLayerInPacket0UnitDiskRadioErrorRateInd, PacketProtocolTag, SignalPowerInd, SignalTimeInd, SnirInd

Outgoing messages (observed)

gatemsgkindctrldestModuletags
lowerLayerOutPacket0ApskDimensionalRadioPacketProtocolTag
lowerLayerOutPacket0ApskScalarRadioPacketProtocolTag
lowerLayerOutPacket0UnitDiskRadioPacketProtocolTag
upperLayerOutPacket0ArpDispatchProtocolReq, ErrorRateInd, InterfaceInd, MacAddressInd, PacketProtocolTag, SignalPowerInd, SignalTimeInd, SnirInd
upperLayerOutPacket0Ipv4DispatchProtocolReq, ErrorRateInd, InterfaceInd, MacAddressInd, PacketProtocolTag, SignalPowerInd, SignalTimeInd, SnirInd

Pull in messages (observed)

gatemsgkindctrlsrcModuletags
upperLayerInPacket0DropTailQueueInterfaceReq, MacAddressReq, PacketProtocolTag, DispatchProtocolInd?, MulticastReq?, NetworkProtocolInd?, SocketReq?, TransportProtocolInd?

Packet operations (observed)

chunkTypepacketAction
peekData
LMacControlFrameinsertAtFront, peekAtFront
LMacDataFrameHeaderinsertAtFront, peekAtFront, popAtFront, removeAtFront
LMacHeaderBasepeekAtFront
SequenceChunkinsertAtBack

Shared Tagging operations (observed)

tagTypetagAction
DispatchProtocolReqaddTagIfAbsent
InterfaceIndaddTagIfAbsent
MacAddressIndaddTagIfAbsent
MacAddressReqgetTag
PacketProtocolTagaddTag, addTagIfAbsent, getTag

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