DirectionReverserLayer

Package: inet.linklayer.ethernet.common

compound module DirectionReverserLayer

Provides a layer that combines the decision for local delivery with the service of reversing the direction of an incoming packet to outgoing for packet forwarding.

Usage diagram

Inheritance diagram

Used in compound modules

Name

Type

Description

BridgingLayer

compound module

Provides various layer 2 services such as packet forwarding, interface selection, virtual LAN handling, stream handling.

Parameters

Name

Type

Default value

Description

interfaceTableModule

string

Relative module path of the interface table

Properties

Name

Value

Description

display

i=block/layer

Gates

Name

Direction

Size

Description

upperLayerIn

input

upperLayerOut

output

lowerLayerIn

input

lowerLayerOut

output

Unassigned submodule parameters

Name

Type

Default value

Description

fork.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

fork.interfaceTableModule

string

Module path to the InterfaceTable module

fork.forwardProtocolRegistration

bool

true

fork.interfaceMapping

object

{}

Maps network interface names to connected submodule names (e.g. {“eth0”: “bridging”}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default

fork.serviceMapping

object

{}

Maps protocols to connected submodule names (e.g. {“ethernetmac”: “bridging”}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default

fork.protocolMapping

object

{}

Maps protocols to connected submodule names (e.g. {“ipv4”: “bridging”}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default

reverser.displayStringTextFormat

string

“processed {numProcessedPackets} pk ({processedTotalLength})”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

reverser.forwardVlan

bool

true

reverser.forwardPcp

bool

true

reverser.excludeEncapsulationProtocols

object

[]

join.displayStringTextFormat

string

“passed %p pk (%l)”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

join.forwardServiceRegistration

bool

true

Source code

//
// Provides a layer that combines the decision for local delivery
// with the service of reversing the direction of an incoming packet to outgoing
// for packet forwarding.
//
module DirectionReverserLayer like IProtocolLayer
{
    parameters:
        string interfaceTableModule; // Relative module path of the interface table
        *.interfaceTableModule = default(this.interfaceTableModule);
        @display("i=block/layer");
    gates:
        input upperLayerIn;
        output upperLayerOut;
        input lowerLayerIn;
        output lowerLayerOut;
    submodules:
        cutthroughBarrier: <default("")> like IPacketDelayer {
            @display("p=100,150");
        }
        fork: MessageDispatcher {
            forwardServiceRegistration = false;
            @display("p=100,300;i=-;b=10,10,oval,grey,,1");
        }
        delayer: <default("")> like IPacketDelayer {
            @display("p=300,300");
        }
        reverser: <default("PacketDirectionReverser")> like IPacketFlow {
            @display("p=500,300");
        }
        join: PacketMultiplexer {
            forwardProtocolRegistration = false;
            @display("p=700,300");
        }
    connections:
        upperLayerIn --> { @display("m=n"); } --> join.in++;
        join.out --> { @display("m=s"); } --> lowerLayerOut;

        lowerLayerIn --> { @display("m=s"); } --> fork.in++;
        fork.out++ --> cutthroughBarrier.in;
        cutthroughBarrier.out --> { @display("m=n"); } --> upperLayerOut;

        fork.out++ --> delayer.in;
        delayer.out --> reverser.in;
        reverser.out --> join.in++;
}

File: src/inet/linklayer/ethernet/common/DirectionReverserLayer.ned