Implements a trivial MAC layer for use in IdealWirelessNic.
This module only provides encapsulation/decapsulation (into IdealMacFrame), but no real medium access protocol.
Higher layer packets should have Ieee802Ctrl attached to them as control info.
See IdealWirelessNic for rationale and details.
The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Name | Type | Description |
---|---|---|
MACProtocolBase | simple module |
Module base for different MAC protocols. |
Name | Type | Description |
---|---|---|
IdealWirelessNic | compound module |
Highly abstracted wireless NIC that consists of a unit disk radio and a trivial MAC protocol. It offers simplicity for scenarios where Layer 1 and 2 effects can be completely ignored, for example testing the basic functionality of a wireless ad-hoc routing protocol. |
Ieee802154UWBIRNic | compound module | (no description) |
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. |
bitrate | double | ||
mtu | int | 4470B | |
headerLength | int | 0B |
IdealMacFrame.byteLength = headerLength + packetFromUpperLayer.byteLength |
promiscuous | bool | false | |
fullDuplex | bool | true |
allows transmitting and receiving simultaneously (transceiver radio mode) |
useAck | bool | true | |
ackTimeout | double | 100ms |
Name | Value | Description |
---|---|---|
display | i=block/rxtx | |
class | IdealMac |
Name | Direction | Size | Description |
---|---|---|---|
upperLayerIn | input | ||
upperLayerOut | output | ||
lowerLayerIn | input | ||
lowerLayerOut | output |
Name | Type | Unit |
---|---|---|
dropPkNotForUs | IdealMacFrame | |
NF_LINK_BREAK | IdealMacFrame |
Name | Title | Source | Record | Unit | Interpolation Mode |
---|---|---|---|---|---|
passedUpPk | packets passed to higher layer | packetSentToUpper | count, sum(packetBytes), vector(packetBytes) | none | |
rcvdPkFromHL | packets received from higher layer | packetReceivedFromUpper | count, sum(packetBytes), vector(packetBytes) | none | |
droppedPkNotForUs | packets dropped/not for us | dropPkNotForUs | count, sum(packetBytes), vector(packetBytes) | none | |
sentDownPk | packets sent to lower layer | packetSentToLower | count, sum(packetBytes), vector(packetBytes) | none | |
rcvdPkFromLL | packets received from lower layer | packetReceivedFromLower | count, sum(packetBytes), vector(packetBytes) | none |
// // Implements a trivial MAC layer for use in ~IdealWirelessNic. // // This module only provides encapsulation/decapsulation (into IdealMacFrame), // but no real medium access protocol. // // Higher layer packets should have Ieee802Ctrl attached to them as // control info. // // See ~IdealWirelessNic for rationale and details. // simple IdealMac extends MACProtocolBase like ILinkLayer { parameters: string address = 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. double bitrate @unit("bps"); int mtu @unit("B") = default(4470B); int headerLength @unit("B") = default(0B); // IdealMacFrame.byteLength = headerLength + packetFromUpperLayer.byteLength bool promiscuous = default(false); bool fullDuplex = default(true); // allows transmitting and receiving simultaneously (transceiver radio mode) bool useAck = default(true); double ackTimeout @unit("s") = default(100ms); @class(IdealMac); @signal[dropPkNotForUs](type=IdealMacFrame); @signal[NF_LINK_BREAK](type=IdealMacFrame); @statistic[passedUpPk](title="packets passed to higher layer"; source=packetSentToUpper; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none); @statistic[sentDownPk](title="packets sent to lower layer"; source=packetSentToLower; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none); @statistic[rcvdPkFromHL](title="packets received from higher layer"; source=packetReceivedFromUpper; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none); @statistic[rcvdPkFromLL](title="packets received from lower layer"; source=packetReceivedFromLower; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none); @statistic[droppedPkNotForUs](title="packets dropped/not for us"; source=dropPkNotForUs; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none); }