WireJunction

Package: inet.physicallayer.wired.common

simple module WireJunction

Models a generic wiring hub.

The model simply broadcasts messages (packets, frames, signals) received on one port to all other ports, mimicking the propagation of electrical signals. Messages are not interpreted by the model in any way, so this module is protocol agnostic.

Note that no special attention is made to appropriately model frame truncations that occur when the link breaks, or comes back up while a transmission is underway. If you need to precisely model what happens when the link state changes, you cannot use this module.

inet.physicallayer.wired.common.WireJunctionWireJunctionsimple

Inheritance diagram

Extends

Name

Type

Description

SimpleModule

simple module

Base module for all INET simple modules.

Parameters

Name

Type

Default value

Description

displayStringTextFormat

string

“”

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

Properties

Name

Value

Description

class

WireJunction

display

i=misc/node_vs

wireJunction

Gates

Name

Direction

Size

Description

port [ ]

inout

Signals

Name

Type

Unit

Description

packetReceived

cPacket

Statistics

Name

Title

Source

Record

Unit

Interpolation Mode

Description

channelOwner

channel owner

packetReceived

channelOwner

sample-hold

packetReceived

packets

packetReceived

count,”sum(packetBytes)”,”vector(packetBytes)”

none

Source code

//
// Models a generic wiring hub.
//
// The model simply broadcasts messages (packets, frames, signals)
// received on one port to all other ports, mimicking the propagation
// of electrical signals. Messages are not interpreted by the model
// in any way, so this module is protocol agnostic.
//
// Note that no special attention is made to appropriately model
// frame truncations that occur when the link breaks, or comes
// back up while a transmission is underway. If you need
// to precisely model what happens when the link state changes,
// you cannot use this module.
//
simple WireJunction extends SimpleModule
{
    parameters:
        @class(WireJunction);
        @wireJunction;
        @display("i=misc/node_vs");
        @signal[packetReceived](type=cPacket);
        @statistic[packetReceived](title="packets"; source=packetReceived; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
        @statistic[channelOwner](title="channel owner"; source=packetReceived; record=channelOwner; interpolationmode=sample-hold);
    gates:
        inout port[];
}

File: src/inet/physicallayer/wired/common/WireJunction.ned