Package: inet.linklayer.xmac
XMac
compound moduleImplementation of X-MAC. 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. |
| debug | bool | false |
debug switch |
| stats | bool | true |
collect statistics? |
| slotDuration | double | 1s |
BMAC specific parameters how long is one slot? |
| 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 |
| txPower | double | 50 mW |
tx power |
| 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 |
| headerLength | int | 80b |
length of MAC headers |
| ctrlFrameLength | int | headerLength | |
| mtu | int | 0B |
mtu |
| maxTxAttempts | int | 2 |
Maximum transmission attempts per data packet, when ACKs are used |
| radioModule | string | "^.radio" |
The path to the Radio module //FIXME remove default value |
Properties
| Name | Value | Description |
|---|---|---|
| display | i=block/rxtx | |
| class | XMac | |
| selfMessageKinds | inet::XMacTypes |
Gates
| Name | Direction | Size | Description |
|---|---|---|---|
| upperLayerIn | input | ||
| upperLayerOut | output | ||
| lowerLayerIn | input | ||
| lowerLayerOut | output |
Signals
| Name | Type | Unit |
|---|---|---|
| packetDropped | inet::Packet |
Scheduled messages (observed)
| msg | kind | ctrl | tags | msgname | context |
|---|---|---|---|---|---|
| Packet | 192 (XMacTypes::XMAC_DATA) | ErrorRateInd, PacketProtocolTag, SignalPowerInd, SignalTimeInd, SnirInd | pingNN-reply | ||
| omnetpp::cMessage | 196 (XMacTypes::XMAC_START_XMAC) | start_xmac | |||
| omnetpp::cMessage | 197 (XMacTypes::XMAC_WAKE_UP) | wakeup | |||
| omnetpp::cMessage | 199 (XMacTypes::XMAC_CCA_TIMEOUT) | cca_timeout | |||
| omnetpp::cMessage | 200 (XMacTypes::XMAC_ACK_TX_OVER) | ack_tx_over | |||
| omnetpp::cMessage | 202 (XMacTypes::XMAC_STOP_PREAMBLES) | stop_preambles | |||
| omnetpp::cMessage | 203 (XMacTypes::XMAC_DATA_TX_OVER) | data_tx_over | |||
| omnetpp::cMessage | 204 (XMacTypes::XMAC_DATA_TIMEOUT) | data_timeout | |||
| omnetpp::cMessage | 205 (XMacTypes::SWITCH_PREAMBLE_PHASE) | switch_preamble_phase | |||
| omnetpp::cMessage | 206 (XMacTypes::DELAY_FOR_ACK_WITHIN_REMOTE_RX) | delay_for_ack_within_remote_rx | |||
| omnetpp::cMessage | 207 (XMacTypes::XMAC_SWITCHING_FINISHED) | switching_done |
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::XMac::handleCanPullPacketChanged | handleCanPullPacketChanged | DropTailQueue |
| inet::XMac::receiveSignal | radioModeChanged | ApskDimensionalRadio, ApskScalarRadio, UnitDiskRadio |
| inet::XMac::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 | |
| lowerLayerIn | Packet | 192 | ApskDimensionalRadio | ErrorRateInd, PacketProtocolTag, SignalPowerInd, SignalTimeInd, SnirInd | |
| lowerLayerIn | Packet | 192 | ApskScalarRadio | ErrorRateInd, PacketProtocolTag, SignalPowerInd, SignalTimeInd, SnirInd | |
| lowerLayerIn | Packet | 192 | 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 | |
| lowerLayerOut | Packet | 192 | ApskDimensionalRadio | InterfaceReq, MacAddressReq, PacketProtocolTag, DispatchProtocolInd?, NetworkProtocolInd?, SocketReq? | |
| lowerLayerOut | Packet | 192 | ApskScalarRadio | InterfaceReq, MacAddressReq, PacketProtocolTag, DispatchProtocolInd?, MulticastReq?, NetworkProtocolInd?, SocketReq?, TransportProtocolInd? | |
| lowerLayerOut | Packet | 192 | UnitDiskRadio | InterfaceReq, MacAddressReq, PacketProtocolTag, DispatchProtocolInd?, 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 |
|---|---|
| XMacControlFrame | Packet, peekAtFront |
| XMacDataFrameHeader | insertAtFront, peekAtFront, popAtFront |
| XMacHeaderBase | peekAtFront |
Shared Tagging operations (observed)
| tagType | tagAction |
|---|---|
| DispatchProtocolReq | addTagIfAbsent |
| InterfaceInd | addTagIfAbsent |
| MacAddressInd | addTagIfAbsent |
| MacAddressReq | getTag |
| PacketProtocolTag | addTag, addTagIfAbsent, getTag |
Source code
// // Implementation of X-MAC. // See C++ documentation for details. // module XMac 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. // debug switch bool debug = default(false); //collect statistics? bool stats = default(true); // BMAC specific parameters // how long is one slot? double slotDuration @unit(s) = default(1s); // 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); //tx power double txPower @unit(W) = default(50 mW); //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); // length of MAC headers int headerLength @unit(b) = default(80b); int ctrlFrameLength @unit(b) = default(headerLength); // mtu int mtu @unit(B) = default(0B); // Maximum transmission attempts per data packet, when ACKs are used int maxTxAttempts = default(2); string radioModule = default("^.radio"); // The path to the Radio module //FIXME remove default value @class(XMac); @signal[packetDropped](type=inet::Packet); @selfMessageKinds(inet::XMacTypes); }File: src/inet/linklayer/xmac/XMac.ned