TsnDevice

Package: inet.node.tsn

TsnDevice

compound module

This module represents a Time-Sensitive Networking (TSN) hardware end device that supports time synchronization, per-stream filtering and policing, scheduling and traffic shaping, frame replication and elimination, frame preemption for Ethernet networks. All TSN features are optional and they can be combined with other Ethernet features.

status : NodeStatus

Keeps track of the status of network node (up, down, etc.) for other modules, and also displays it...

Source:
status: NodeStatus if hasStatus {
    @display("p=125,80;is=s");
} clock : like IClock

IClock: This module interface is implemented by clock models.

Source:
clock: <default("")> like IClock if typename != "" {
    @display("p=125,320;is=s");
} energyStorage : like IEnergyStorage

IEnergyStorage: The energy storage models describe devices that absorb energy produced by generators, and provide...

Source:
energyStorage: <default("")> like IEnergyStorage if typename != "" {
    @display("p=125,400;is=s");
} energyManagement : like IEnergyManagement

IEnergyManagement: The energy management models monitors an energy storage, estimates its state, and controls the...

Source:
energyManagement: <default("")> like IEnergyManagement if typename != "" {
    @display("p=125,480;is=s");
} energyGenerator : like IEnergyGenerator

IEnergyGenerator: The energy generator models describe the energy generation process of devices over time.

Source:
energyGenerator: <default("")> like IEnergyGenerator if typename != "" {
    @display("p=125,560;is=s");
} mobility : like IMobility

IMobility: The module interface for mobility models.

Source:
mobility: <default("")> like IMobility if typename != "" {
    @display("p=125,160;is=s");
} measurer : like IMeasurer

IMeasurer: This module interface is implemented by all standalone measurement modules.

Source:
measurer: <default("")> like IMeasurer if typename != "" {
    @display("p=125,660;is=s");
} pcapRecorder[numPcapRecorders] : PcapRecorder

Records PCAP traces of frames sent/received by other modules within the same host.

Source:
pcapRecorder[numPcapRecorders]: PcapRecorder {
    @display("p=125,640;is=s");
} interfaceTable : InterfaceTable

Keeps the table of network interfaces.

Source:
interfaceTable: InterfaceTable {
    @display("p=125,240;is=s");
} llc : like IIeee8022Llc

Source:
llc: <default("")> like IIeee8022Llc if typename != "" {
    @display("p=375,525");
} cb : MessageDispatcher

This module connects multiple applications, protocols and interfaces with each other and...

Source:
cb: MessageDispatcher {
    @display("p=750,600;b=1000,5");
} bridging : like IProtocolLayer

IProtocolLayer: This module interface is implemented by all protocol layer modules that connect to a higher and to...

Source:
bridging: <default("")> like IProtocolLayer if typename != "" {
    @display("p=750,675");
} bl : MessageDispatcher

This module connects multiple applications, protocols and interfaces with each other and...

Source:
bl: MessageDispatcher {
    @display("p=750,750;b=1000,5");
} ethernet : like IEthernetLayer

Source:
ethernet: <default(sizeof(ethg) > 0 ? "EthernetEncapsulation" : "")> like IEthernetLayer if typename != "" {
    @display("p=375,825");
} ieee8021q : like IIeee8021qLayer

Source:
ieee8021q: <default("")> like IIeee8021qLayer if typename != "" {
    @display("p=525,825");
} ieee8021r : like IIeee8021rLayer

Source:
ieee8021r: <default("")> like IIeee8021rLayer if typename != "" {
    @display("p=675,825");
} li : MessageDispatcher

This module connects multiple applications, protocols and interfaces with each other and...

Source:
li: MessageDispatcher {
    @display("p=750,900;b=1000,5,,,,1");
} lo[numLoInterfaces] : like ILoopbackInterface

LoopbackInterface: This module implements a loopback network interface.

ILoopbackInterface: This module interface is implemented by loopback network interfaces.

Source:
lo[numLoInterfaces]: <default("LoopbackInterface")> like ILoopbackInterface {
    @display("p=750,975,row,150");
} wlan[numWlanInterfaces] : like IWirelessInterface

Ieee80211Interface: This module implements an IEEE 802.11 network interface.

IWirelessInterface: This module interface is implemented by wireless network interfaces.

Source:
wlan[numWlanInterfaces]: <default("Ieee80211Interface")> like IWirelessInterface {
    @display("p=375,1000,row,150;q=queue");
} ppp[sizeof(pppg)] : like IPppInterface

PppInterface: This module implements a PPP network interface.

IPppInterface: This module interface is implemented by PPP network interfaces.

Source:
ppp[sizeof(pppg)]: <default("PppInterface")> like IPppInterface {
    @display("p=300,975,row,150;q=txQueue");
} eth[sizeof(ethg)] : like IEthernetInterface

EthernetInterface: This module represents an Ethernet network interface.

IEthernetInterface: This module interface is implemented by Ethernet network interfaces.

Source:
eth[sizeof(ethg)]: <default("EthernetInterface")> like IEthernetInterface {
    @display("p=900,975,row,150;q=txQueue");
} tun[numTunInterfaces] : like ITunnelInterface

TunInterface: This module implements a TUN network interface.

ITunnelInterface: This module interface is implemnted by tunnel network interfaces.

Source:
tun[numTunInterfaces]: <default("TunInterface")> like ITunnelInterface {
    @display("p=975,1000,row,150;q=txQueue");
} virt[numVirtInterfaces] : like IVirtualInterface

VirtualInterface: This module implements a virtual network interface.

IVirtualInterface: This module interface is implemnted by virtual network interfaces.

Source:
virt[numVirtInterfaces]: <default("VirtualInterface")> like IVirtualInterface {
    @display("p=975,1000,row,150;q=txQueue");
} ipv4 : like INetworkLayer

Ipv4NetworkLayer: Network layer of an IPv4 node.

Source:
ipv4: <default("Ipv4NetworkLayer")> like INetworkLayer if hasIpv4 {
    @display("p=375,375;q=queue");
} ipv6 : like INetworkLayer

Ipv6NetworkLayer: Represents an IPv6 network layer (L3).

Source:
ipv6: <default("Ipv6NetworkLayer")> like INetworkLayer if hasIpv6 {
    @display("p=525,375;q=queue");
} generic : like INetworkLayer

Source:
generic: <default("")> like INetworkLayer if hasGn {
    @display("p=675,375;q=queue");
} nl : MessageDispatcher

This module connects multiple applications, protocols and interfaces with each other and...

Source:
nl: MessageDispatcher {
    @display("p=750,450;b=1000,5,,,,1");
} udp : like IUdp

IUdp: UDP protocol interface.

Source:
udp: <default(firstAvailableOrEmpty("Udp"))> like IUdp if hasUdp {
    @display("p=375,225");
} tcp : like ITcp

ITcp: Interface for TCP protocol implementations.

Source:
tcp: <default(firstAvailableOrEmpty("Tcp", "TcpLwip", "TcpNsc"))> like ITcp if hasTcp {
    @display("p=525,225");
} sctp : like ISctp

ISctp: Interface for SCTP protocol.

Source:
sctp: <default(firstAvailableOrEmpty("Sctp"))> like ISctp if hasSctp {
    @display("p=675,225");
} tn : MessageDispatcher

This module connects multiple applications, protocols and interfaces with each other and...

Source:
tn: MessageDispatcher {
    @display("p=750,300;b=1000,5,,,,1");
} app[numApps] : like IApp

IApp: Generic application interface.

Source:
app[numApps]: <> like IApp {
    @display("p=375,75,row,150");
} at : MessageDispatcher

This module connects multiple applications, protocols and interfaces with each other and...

Source:
at: MessageDispatcher {
    @display("p=750,150;b=1000,5,,,,1");
} gptp : like IApp

Gptp: This module implements the IEEE 802.1as protocol also known as gPTP.

IApp: Generic application interface.

Source:
gptp: <default("Gptp")> like IApp if hasTimeSynchronization {
    gptpNodeType = default("SLAVE_NODE");
    slavePort = default("eth0");
    masterPorts = default([]);
    @display("p=700,75");
}

Usage diagram

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Extends

Name Type Description
StandardHost compound module

IPv4 host with SCTP, TCP, UDP layers and applications. IP forwarding is disabled by default (see forwarding).

Parameters

Name Type Default value Description
hasStatus bool false
osgModel string ""

3D model for OSG visualization, no 3D model by default

osgModelColor string ""

tint color, no colorization by default

canvasImage string ""

image for canvas visualization, no image by default

canvasImageColor string ""

tint color, no colorization by default

recordPcap bool false
numPcapRecorders int recordPcap ? 1 : 0
numLoInterfaces int 1
numWlanInterfaces int 0
numEthInterfaces int 0

minimum number of ethernet interfaces

numPppInterfaces int 0

minimum number of PPP interfaces

numTunInterfaces int 0
numVirtInterfaces int 0
fcsMode string "declared"
hasIpv4 bool true
hasIpv6 bool false
hasGn bool false
forwarding bool false
multicastForwarding bool false
hasUdp bool firstAvailableOrEmpty("Udp") != ""
hasTcp bool firstAvailableOrEmpty("Tcp", "TcpLwip", "TcpNsc") != ""
hasSctp bool false
numApps int 0
hasTimeSynchronization bool false

enable IEEE 802.1 AS time synchronization

hasIngressTrafficFiltering bool false

enable IEEE 802.1 Qci ingress per-stream filtering

hasEgressTrafficFiltering bool false

enable IEEE 802.1 Qci egress per-stream filtering

hasEgressTrafficShaping bool false

enable IEEE 802.1 egress traffic shaping (credit based shaping, time aware shaping, asynchronous shaping)

hasStreamRedundancy bool false

enable IEEE 802.1 CB frame replication and elimination

hasIncomingStreams bool false

enable IEEE 802.1 stream decoding

hasOutgoingStreams bool false

enable IEEE 802.1 stream identification and stream encoding

hasFramePreemption bool false

enable IEEE 802.1 Qbu frame preemption

hasCutthroughSwitching bool false

enable cut-through switching support

Properties

Name Value Description
networkNode
labels node
class NodeBase
display i=device/card

change icon to emphasise hardware device

Gates

Name Direction Size Description
radioIn [ ] input numWlanInterfaces
pppg [ ] inout numPppInterfaces
ethg [ ] inout numEthInterfaces

Unassigned submodule parameters

Name Type Default value Description
status.initialStatus string "UP"

TODO @signal, @statistic

pcapRecorder.verbose bool true

whether to log packets on the module output

pcapRecorder.pcapFile string ""

the PCAP file to be written

pcapRecorder.fileFormat string "pcapng"
pcapRecorder.snaplen int 65535

maximum number of bytes to record per packet

pcapRecorder.dumpBadFrames bool true

enable dump of frames with hasBitError

pcapRecorder.moduleNamePatterns string "wlan[*] eth[*] ppp[*]"

space-separated list of sibling module names to listen on

pcapRecorder.sendingSignalNames string "packetSentToLower"

space-separated list of outbound packet signals to subscribe to

pcapRecorder.receivingSignalNames string "packetReceivedFromLower"

space-separated list of inbound packet signals to subscribe to

pcapRecorder.dumpProtocols string "ethernetmac ppp ieee80211mac"

space-separated list of protocol names as defined in the Protocol class

pcapRecorder.packetFilter object "*"

which packets are considered, matches all packets by default

pcapRecorder.helpers string ""

usable PcapRecorder::IHelper helpers for accept packettype and store/convert packet as specified linktype currently available: "inet::AckingMacToEthernetPcapRecorderHelper"

pcapRecorder.alwaysFlush bool false

flush the pcapFile after each write to ensure that all packets are captured in case of a crash

pcapRecorder.displayStringTextFormat string "rec: %n pks"
interfaceTable.displayAddresses bool false

whether to display IP addresses on links

cb.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

cb.forwardServiceRegistration bool true
cb.forwardProtocolRegistration bool true
bl.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

bl.forwardServiceRegistration bool true
bl.forwardProtocolRegistration bool true
li.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

li.forwardServiceRegistration bool true
li.forwardProtocolRegistration bool true
eth.bitrate double
nl.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

nl.forwardServiceRegistration bool true
nl.forwardProtocolRegistration bool true
tn.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

tn.forwardServiceRegistration bool true
tn.forwardProtocolRegistration bool true
at.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

at.forwardServiceRegistration bool true
at.forwardProtocolRegistration bool true

Source code

//
// This module represents a Time-Sensitive Networking (TSN) hardware end device
// that supports time synchronization, per-stream filtering and policing, scheduling
// and traffic shaping, frame replication and elimination, frame preemption for
// Ethernet networks. All TSN features are optional and they can be combined with
// other Ethernet features.
//
module TsnDevice extends StandardHost
{
    parameters:
        bool hasTimeSynchronization = default(false); // enable IEEE 802.1 AS time synchronization
        bool hasIngressTrafficFiltering = default(false); // enable IEEE 802.1 Qci ingress per-stream filtering
        bool hasEgressTrafficFiltering = default(false); // enable IEEE 802.1 Qci egress per-stream filtering
        bool hasEgressTrafficShaping = default(false); // enable IEEE 802.1 egress traffic shaping (credit based shaping, time aware shaping, asynchronous shaping)
        bool hasStreamRedundancy = default(false); // enable IEEE 802.1 CB frame replication and elimination
        bool hasIncomingStreams = default(false); // enable IEEE 802.1 stream decoding
        bool hasOutgoingStreams = default(false); // enable IEEE 802.1 stream identification and stream encoding
        bool hasFramePreemption = default(false); // enable IEEE 802.1 Qbu frame preemption
        bool hasCutthroughSwitching = default(false); // enable cut-through switching support
        clock.typename = default(hasTimeSynchronization ? "SettableClock" : ""); // enable explicit local clock model
        ethernet.typename = default("EthernetLayer"); // use Ethernet protocol layer outside of network interfaces
        eth[*].typename = default("LayeredEthernetInterface"); // switch to modular Ethernet interface
        eth[*].macLayer.typename = default(hasFramePreemption ? "EthernetPreemptingMacLayer" : "EthernetMacLayer");
        eth[*].macLayer.queue.typename = default(hasEgressTrafficShaping ? "Ieee8021qTimeAwareShaper" : (hasFramePreemption ? "" : "PacketQueue")); // use priority queue having multiple subqueues controlled by separate gates
        eth[*].phyLayer.typename = default(hasCutthroughSwitching ? "EthernetStreamingPhyLayer" : (hasFramePreemption ? "EthernetPreemptingPhyLayer" : "EthernetPhyLayer")); // use packet streaming when cut-through switching is enabled
        bridging.typename = default(hasIncomingStreams || hasOutgoingStreams || hasStreamRedundancy || hasIngressTrafficFiltering || hasEgressTrafficFiltering ? "BridgingLayer" : ""); // switch to modular bridging
        bridging.interfaceRelay.typename = default(""); // disable frame relaying
        bridging.streamIdentifier.typename = default(hasOutgoingStreams || hasStreamRedundancy ? "StreamIdentifierLayer" : ""); // enable stream identification when stream redundancy is enabled
        bridging.streamIdentifier.identifier.hasSequenceNumbering = default(hasStreamRedundancy); // enable sequence numberinf if stream redundancy is enabled
        bridging.streamRelay.typename = default(hasStreamRedundancy ? "StreamRelayLayer" : ""); // enable stream merging and stream splitting when stream redundancy is enabled
        bridging.streamFilter.typename = default(hasIngressTrafficFiltering || hasEgressTrafficFiltering ? "StreamFilterLayer" : ""); // enable stream filtering when ingress or egress per-stream filtering is enabled
        bridging.streamFilter.ingress.typename = default(hasIngressTrafficFiltering ? "SimpleIeee8021qFilter" : ""); // use IEEE 802.1 Qci ingress filter when ingress per-stream filtering is enabled
        bridging.streamFilter.egress.typename = default(hasEgressTrafficFiltering ? "SimpleIeee8021qFilter" : ""); // use IEEE 802.1 Qci egress filter when egress per-stream filtering is enabled
        bridging.streamCoder.typename = default(hasIncomingStreams || hasOutgoingStreams || hasStreamRedundancy ? "StreamCoderLayer" : ""); // enable stream endocing/decoding when stream redundancy is enabled
        ieee8021r.typename = default(hasStreamRedundancy ? "Ieee8021rProtocol" : "");
        ieee8021q.typename = default(hasIncomingStreams || hasOutgoingStreams || hasStreamRedundancy ? "Ieee8021qProtocol" : "");
        @display("i=device/card"); // change icon to emphasise hardware device
    submodules:
        gptp: <default("Gptp")> like IApp if hasTimeSynchronization {
            gptpNodeType = default("SLAVE_NODE");
            slavePort = default("eth0");
            masterPorts = default([]);
            @display("p=700,75");
        }
    connections:
        if hasTimeSynchronization {
            gptp.socketOut --> at.in++;
            at.out++ --> gptp.socketIn;
        }
}
File: src/inet/node/tsn/TsnDevice.ned