Package: inet.linklayer.bmac
BMac
compound moduleImplementation of B-MAC (called also Berkeley MAC, Low Power Listening or LPL). 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 | 0.1s |
BMAC specific parameters how long is one slot? |
headerLength | int | 10b | |
ctrlFrameLength | int | headerLength | |
mtu | int | 0B | |
checkInterval | double | 0.01s |
how long is the check interval (CCA)? |
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? |
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 | BMac | |
selfMessageKinds | inet::BMacType |
Gates
Name | Direction | Size | Description |
---|---|---|---|
upperLayerIn | input | ||
upperLayerOut | output | ||
lowerLayerIn | input | ||
lowerLayerOut | output |
Signals
Name | Type | Unit |
---|---|---|
linkBroken | inet::Packet |
Statistics
Name | Title | Source | Record | Unit | Interpolation Mode |
---|---|---|---|---|---|
packetDropNotAddressedToUs | packet drop: not addressed to us | packetDropReasonIsNotAddressedToUs(packetDropped) | count, sum(packetBytes), vector(packetBytes) | none | |
packetDropQueueOverflow | packet drop: queue overflow | packetDropReasonIsQueueOverflow(packetDropped) | count, sum(packetBytes), vector(packetBytes) | none | |
linkBroken | link break | linkBroken | count | none | |
packetDropIncorrectlyReceived | packet drop: incorrectly received | packetDropReasonIsIncorrectlyReceived(packetDropped) | count, sum(packetBytes), vector(packetBytes) | none |
Scheduled messages (observed)
msg | kind | ctrl | tags | msgname | context |
---|---|---|---|---|---|
Packet | 192 (BMacType::BMAC_DATA) | ErrorRateInd, PacketProtocolTag, SignalPowerInd, SignalTimeInd, SnirInd | pingNN | ||
omnetpp::cMessage | 196 (BMacType::BMAC_START_BMAC) | start_bmac | |||
omnetpp::cMessage | 197 (BMacType::BMAC_WAKE_UP) | wakeup | |||
omnetpp::cMessage | 199 (BMacType::BMAC_CCA_TIMEOUT) | cca_timeout | |||
omnetpp::cMessage | 201 (BMacType::BMAC_SEND_PREAMBLE) | send_preamble | |||
omnetpp::cMessage | 202 (BMacType::BMAC_STOP_PREAMBLES) | stop_preambles | |||
omnetpp::cMessage | 203 (BMacType::BMAC_DATA_TX_OVER) | data_tx_over | |||
omnetpp::cMessage | 204 (BMacType::BMAC_DATA_TIMEOUT) | data_timeout |
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::BMac::handleCanPullPacketChanged | handleCanPullPacketChanged | DropTailQueue |
inet::BMac::receiveSignal | radioModeChanged | ApskDimensionalRadio, ApskScalarRadio, UnitDiskRadio |
inet::BMac::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, InterfaceReq?, MacAddressReq? | |
lowerLayerOut | Packet | 0 | ApskScalarRadio | PacketProtocolTag, DispatchProtocolInd?, InterfaceReq?, MacAddressReq?, MulticastReq?, NetworkProtocolInd?, TransportProtocolInd? | |
lowerLayerOut | Packet | 0 | UnitDiskRadio | PacketProtocolTag, DispatchProtocolInd?, InterfaceReq?, MacAddressReq?, NetworkProtocolInd?, SocketReq? | |
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 |
---|---|
BMacControlFrame | insertAtFront |
BMacDataFrameHeader | insertAtFront, peekAtFront, popAtFront |
BMacHeaderBase | peekAtFront |
Shared Tagging operations (observed)
tagType | tagAction |
---|---|
DispatchProtocolReq | addTagIfAbsent |
InterfaceInd | addTagIfAbsent |
MacAddressInd | addTagIfAbsent |
MacAddressReq | getTag |
PacketProtocolTag | addTag, addTagIfAbsent, getTag |
Source code
// // Implementation of B-MAC (called also Berkeley MAC, Low Power Listening or // LPL). // See C++ documentation for details. // module BMac 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. // BMAC specific parameters // how long is one slot? double slotDuration @unit(s) = default(0.1s); int headerLength @unit(b) = default(10b); int ctrlFrameLength @unit(b) = default(headerLength); int mtu @unit(B) = default(0B); // how long is the check interval (CCA)? double checkInterval @unit(s) = default(0.01s); // 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); 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(BMac); @signal[linkBroken](type=inet::Packet); @statistic[linkBroken](title="link break"; source=linkBroken; record=count; interpolationmode=none); @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); @statistic[packetDropQueueOverflow](title="packet drop: queue overflow"; source=packetDropReasonIsQueueOverflow(packetDropped); record=count,sum(packetBytes),vector(packetBytes); interpolationmode=none); @selfMessageKinds(inet::BMacType); }File: src/inet/linklayer/bmac/BMac.ned