ShortcutMac

Package: inet.linklayer.shortcut

ShortcutMac

simple module

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.

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 tofunctioninfo
MessageDispatcherinet::MessageDispatcher::arrivedarrived
InterfaceTableinet::InterfaceTable::interfaceChangedinterfaceChanged

Incoming messages (observed)

gatemsgkindctrlsrcModuletags
peerInPacket0ShortcutMacPacketProtocolTag
upperLayerInPacket0ArpInterfaceReq, MacAddressReq, PacketProtocolTag
upperLayerInPacket0Ipv4DispatchProtocolInd, InterfaceReq, MacAddressReq, NetworkProtocolInd, PacketProtocolTag, SocketReq?

Outgoing messages (observed)

gatemsgkindctrldestModuletags
upperLayerOutPacket0ArpDispatchProtocolReq, InterfaceInd, PacketProtocolTag
upperLayerOutPacket0Ipv4DispatchProtocolReq, InterfaceInd, PacketProtocolTag

Packet operations (observed)

chunkTypepacketAction
ShortcutMacHeaderinsertAtFront, popAtFront

Shared Tagging operations (observed)

tagTypetagAction
clearTags
DispatchProtocolReqaddTag
InterfaceIndaddTag
MacAddressReqgetTag
PacketProtocolTagaddTag, 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