Package: inet.linklayer.shortcut
ShortcutMac
simple moduleThis module implements a simple shortcut to peer MAC protocol that completely bypasses the physical layer. Packets received from the upper layer protocols are never lost. The MAC protocol directly sends packets to the destination MAC protocol without any physical layer processing. Physical layer overhead is simply simulated by overhead bits, overhead transmission duration and a propagation delay.
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. |
bitrate | double | ||
mtu | int | 1500B | |
lengthOverhead | int | 0b |
extra length added to packets |
durationOverhead | double | 0s |
extra transmission duration added to packets |
propagationDelay | double | 0s |
propagation time to all destinations |
packetLoss | double | 0 |
packet loss probability |
Properties
Name | Value | Description |
---|---|---|
display | i=block/rxtx | |
class | ShortcutMac |
Gates
Name | Direction | Size | Description |
---|---|---|---|
upperLayerIn | input | ||
upperLayerOut | output | ||
lowerLayerIn | input | ||
lowerLayerOut | output | ||
peerIn | input |
Signals
Name | Type | Unit |
---|---|---|
packetReceivedFromUpper | cPacket | |
packetReceivedFromLower | cPacket | |
packetDropped | cPacket | |
packetSentToLower | cPacket | |
packetSentToUpper | cPacket |
Direct method calls (observed)
call to | function | info |
---|---|---|
MessageDispatcher | inet::MessageDispatcher::arrived | arrived |
InterfaceTable | inet::InterfaceTable::interfaceChanged | interfaceChanged |
Incoming messages (observed)
gate | msg | kind | ctrl | srcModule | tags |
---|---|---|---|---|---|
peerIn | Packet | 0 | ShortcutMac | PacketProtocolTag | |
upperLayerIn | Packet | 0 | Arp | InterfaceReq, MacAddressReq, PacketProtocolTag | |
upperLayerIn | Packet | 0 | Ipv4 | DispatchProtocolInd, InterfaceReq, MacAddressReq, NetworkProtocolInd, PacketProtocolTag, SocketReq? |
Outgoing messages (observed)
gate | msg | kind | ctrl | destModule | tags |
---|---|---|---|---|---|
upperLayerOut | Packet | 0 | Arp | DispatchProtocolReq, InterfaceInd, PacketProtocolTag | |
upperLayerOut | Packet | 0 | Ipv4 | DispatchProtocolReq, InterfaceInd, PacketProtocolTag |
Packet operations (observed)
chunkType | packetAction |
---|---|
ShortcutMacHeader | insertAtFront, popAtFront |
Shared Tagging operations (observed)
tagType | tagAction |
---|---|
clearTags | |
DispatchProtocolReq | addTag |
InterfaceInd | addTag |
MacAddressReq | getTag |
PacketProtocolTag | addTag, getTag, getTagForUpdate |
Source code
// // This module implements a simple shortcut to peer MAC protocol that completely // bypasses the physical layer. Packets received from the upper layer protocols // are never lost. The MAC protocol directly sends packets to the destination // MAC protocol without any physical layer processing. Physical layer overhead // is simply simulated by overhead bits, overhead transmission duration and // a propagation delay. // simple ShortcutMac extends MacProtocolBase like ILinkLayer, 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. double bitrate @unit(bps); int mtu @unit(B) = default(1500B); volatile int lengthOverhead @unit(b) = default(0b); // extra length added to packets volatile double durationOverhead @unit(s) = default(0s); // extra transmission duration added to packets volatile double propagationDelay @unit(s) = default(0s); // propagation time to all destinations volatile double packetLoss = default(0); // packet loss probability @class(ShortcutMac); @display("i=block/rxtx"); gates: input peerIn; }File: src/inet/linklayer/shortcut/ShortcutMac.ned