Package: inet.linklayer.lmac
LMac
compound moduleImplementation 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)
msg | kind | ctrl | tags | msgname | context |
---|---|---|---|---|---|
omnetpp::cMessage | 168 (LMacType::LMAC_TIMEOUT) | timeout | |||
omnetpp::cMessage | 169 (LMacType::LMAC_WAKEUP) | wakeup | |||
omnetpp::cMessage | 170 (LMacType::LMAC_SEND_DATA) | sendData | |||
omnetpp::cMessage | 171 (LMacType::LMAC_SETUP_PHASE_END) | setup phase | |||
omnetpp::cMessage | 172 (LMacType::LMAC_CHECK_CHANNEL) | checkchannel | |||
omnetpp::cMessage | 175 (LMacType::LMAC_START_LMAC) | start_lmac | |||
omnetpp::cMessage | 176 (LMacType::LMAC_SEND_CONTROL) | send_control |
Direct method calls (observed)
call to | function | info |
---|---|---|
MessageDispatcher | inet::MessageDispatcher::arrived | arrived |
PcapRecorder | inet::PcapRecorder::receiveSignal | packetReceivedFromLower |
InterfaceTable | inet::InterfaceTable::interfaceChanged | interfaceChanged |
ApskDimensionalRadio | inet::physicallayer::ApskRadio::setRadioMode | setRadioMode |
ApskScalarRadio | inet::physicallayer::ApskRadio::setRadioMode | setRadioMode |
UnitDiskRadio | inet::physicallayer::UnitDiskRadio::setRadioMode | setRadioMode |
DropTailQueue | inet::queueing::PacketQueue::pullPacket | pullPacket |
Called methods (observed)
function | info | call from |
---|---|---|
inet::LMac::handleCanPullPacketChanged | handleCanPullPacketChanged | DropTailQueue |
inet::LMac::receiveSignal | radioModeChanged | ApskDimensionalRadio, ApskScalarRadio, UnitDiskRadio |
inet::LMac::receiveSignal | transmissionStateChanged | ApskDimensionalRadio, ApskScalarRadio, UnitDiskRadio |
Incoming messages (observed)
gate | msg | kind | ctrl | srcModule | tags |
---|---|---|---|---|---|
lowerLayerIn | Packet | 0 | ApskDimensionalRadio | ErrorRateInd, PacketProtocolTag, SignalPowerInd, SignalTimeInd, SnirInd | |
lowerLayerIn | Packet | 0 | ApskScalarRadio | ErrorRateInd, PacketProtocolTag, SignalPowerInd, SignalTimeInd, SnirInd | |
lowerLayerIn | Packet | 0 | UnitDiskRadio | ErrorRateInd, PacketProtocolTag, SignalPowerInd, SignalTimeInd, SnirInd |
Outgoing messages (observed)
gate | msg | kind | ctrl | destModule | tags |
---|---|---|---|---|---|
lowerLayerOut | Packet | 0 | ApskDimensionalRadio | PacketProtocolTag | |
lowerLayerOut | Packet | 0 | ApskScalarRadio | PacketProtocolTag | |
lowerLayerOut | Packet | 0 | UnitDiskRadio | PacketProtocolTag | |
upperLayerOut | Packet | 0 | Arp | DispatchProtocolReq, ErrorRateInd, InterfaceInd, MacAddressInd, PacketProtocolTag, SignalPowerInd, SignalTimeInd, SnirInd | |
upperLayerOut | Packet | 0 | Ipv4 | DispatchProtocolReq, ErrorRateInd, InterfaceInd, MacAddressInd, PacketProtocolTag, SignalPowerInd, SignalTimeInd, SnirInd |
Pull in messages (observed)
gate | msg | kind | ctrl | srcModule | tags |
---|---|---|---|---|---|
upperLayerIn | Packet | 0 | DropTailQueue | InterfaceReq, MacAddressReq, PacketProtocolTag, DispatchProtocolInd?, MulticastReq?, NetworkProtocolInd?, SocketReq?, TransportProtocolInd? |
Packet operations (observed)
chunkType | packetAction |
---|---|
peekData | |
LMacControlFrame | insertAtFront, peekAtFront |
LMacDataFrameHeader | insertAtFront, peekAtFront, popAtFront, removeAtFront |
LMacHeaderBase | peekAtFront |
SequenceChunk | insertAtBack |
Shared Tagging operations (observed)
tagType | tagAction |
---|---|
DispatchProtocolReq | addTagIfAbsent |
InterfaceInd | addTagIfAbsent |
MacAddressInd | addTagIfAbsent |
MacAddressReq | getTag |
PacketProtocolTag | addTag, 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