StreamRelayLayer

Package: inet.protocolelement.redundancy

compound module StreamRelayLayer

Combines a stream merger and a stream splitter module into a stream relay layer. For incoming packets, the identified streams are merged by the stream merger. For outgoing packets, the requested streams are split by the stream splitter.

Usage diagram

Inheritance diagram

Used in compound modules

Name

Type

Description

StreamPolicyLayer

compound module

(no description)

Parameters

Name

Type

Default value

Description

interfaceTableModule

string

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

merger.displayStringTextFormat

string

“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})”

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

merger.backpressure

bool

false

merger.mapping

object

{}

Map of input streams to output streams. An empty string means no stream. For example, {s0: “s1”, …}

merger.bufferSize

int

10

Window size for sequence numbers per stream.

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

splitter.mapping

object

{}

Map from input stream names to array of output stream names, empty string means no stream

Source code

//
// Combines a stream merger and a stream splitter module into a
// stream relay layer. For incoming packets, the identified streams are merged
// by the stream merger. For outgoing packets, the requested streams are split
// by the stream splitter.
//
module StreamRelayLayer like IProtocolLayer
{
    parameters:
        string interfaceTableModule;
        *.interfaceTableModule = default(this.interfaceTableModule);
        @display("i=block/layer");
    gates:
        input upperLayerIn;
        output upperLayerOut;
        input lowerLayerIn;
        output lowerLayerOut;
    submodules:
        merger: <default("StreamMerger")> like IPacketFilter if typename != "" {
            @display("p=200,150;i=block/join");
        }
        splitter: <default("StreamSplitter")> like IPacketPusher if typename != "" {
            @display("p=500,150;i=block/fork");
        }
    connections:
        upperLayerIn --> { @display("m=n"); } --> splitter.in;
        splitter.out --> { @display("m=s"); } --> lowerLayerOut;

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

File: src/inet/protocolelement/redundancy/StreamRelayLayer.ned