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.

ShortcutMac

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

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 = 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);
        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