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