Table Of Contents
Table Of Contents

Frame Replication with Time-Aware Shaping

Goals

In this example we demonstrate how to automatically configure time-aware shaping in the presence of frame replication.

INET version: 4.4

The Model

The network contains a source and a destination node and five switches.

Here is the network:

../../../../../_images/Network11.png

Here is the configuration:

[General]
description = "Combining frame replication with time-aware shaping"
network = FrerAndTasShowcase
sim-time-limit = 5s

# disable automatic MAC forwarding table configuration
*.macForwardingTableConfigurator.typename = ""

# disable all non frame replication related TSN features in all network nodes
*.*.hasTimeSynchronization = false
*.*.hasIngressTrafficFiltering = false
*.*.hasEgressTrafficShaping = false
*.*.hasOutgoingStreams = false

# all Ethernet interfaces have 100 Mbps speed
*.*.eth[*].bitrate = 100Mbps

# packet error rate of all links is 20%
**.channel.per = 0.2

# enable frame replication and elimination
*.*.hasStreamRedundancy = true

# source application
*.source.numApps = 1
*.source.app[0].typename = "UdpSourceApp"
*.source.app[0].io.destAddress = "destination"
*.source.app[0].io.destPort = 1000
*.source.app[0].source.displayStringTextFormat = "sent %p pk (%l)"

# deterministic application traffic configuration
*.source.app[0].source.packetLength = 100B
*.source.app[0].source.productionInterval = 5ms

# destination application
*.destination.numApps = 1
*.destination.app[0].typename = "UdpSinkApp"
*.destination.app[0].io.localPort = 1000

# all interfaces must have the same address to accept packets from all streams
*.destination.eth[*].address = "0A-AA-12-34-56-78"

# visualizer
*.visualizer.infoVisualizer.modules = "*.source.app[0].source or *.destination.app[0].sink"

# enable all automatic configurators
*.gateScheduleConfigurator.typename = "EagerGateScheduleConfigurator"
*.streamRedundancyConfigurator.typename = "StreamRedundancyConfigurator"
*.failureProtectionConfigurator.typename = "FailureProtectionConfigurator"

# gate scheduling visualizer
*.visualizer.gateScheduleVisualizer.displayGateSchedules = true
*.visualizer.gateScheduleVisualizer.displayDuration = 100us
*.visualizer.gateScheduleVisualizer.gateFilter = "*.source.eth[0].** or *.s1.eth[0..1].** or *.s2*.eth[0..1].** or *.s3*.eth[0].** "
*.visualizer.gateScheduleVisualizer.height = 16

# gating configuration
*.*.eth[*].macLayer.queue.typename = "GatingPriorityQueue"
*.*.eth[*].macLayer.queue.numQueues = 1
*.*.eth[*].macLayer.queue.classifier.typename = "ContentBasedClassifier"
*.*.eth[*].macLayer.queue.classifier.packetFilters = ["*"]
*.*.eth[*].macLayer.queue.queue[*].typename = "DropTailQueue"
*.*.eth[*].macLayer.queue.gate[*].bitrate = 100Mbps

# enable stream policing in layer 2
*.*.bridging.streamRelay.typename = "StreamRelayLayer"
*.*.bridging.streamCoder.typename = "StreamCoderLayer"

# gate scheduling configuration
*.gateScheduleConfigurator.gateCycleDuration = 20ms

# TSN configuration
# 64B = 8B (UDP) + 20B (IP) + 4B (802.1R) + 6B (802.1Q) + 14B + 4B (ETH MAC) + 8B (ETH PHY)
*.failureProtectionConfigurator.configuration = [{name: "S1", application: "app[0]", source: "source", destination: "destination",
                                                  pcp: 0, gateIndex: 0, packetFilter: "*",
                                                  packetLength: 100B + 64B, packetInterval: 5ms, maxLatency: 100us,
                                                  nodeFailureProtection: [{any: 1, of: "s2a or s2b or s3a or s3b"}],
                                                  # this link failure protection is somewhat redundant for demonstration purposes
                                                  linkFailureProtection: [{any: 1, of: "*->* and not source->s1"},
                                                                          {any: 2, of: "s1->s2a or s2a->s2b or s2b->s3b"},
                                                                          {any: 2, of: "s1->s2b or s2b->s2a or s2a->s3a"}]}]

# visualizer
*.visualizer.failureProtectionConfigurationVisualizer.displayTrees = true
*.visualizer.failureProtectionConfigurationVisualizer.lineStyle = "dashed"
*.visualizer.streamRedundancyConfigurationVisualizer.displayTrees = true
*.visualizer.streamRedundancyConfigurationVisualizer.lineColor = "black"

Results

Here is the number of packets received and sent:

../../../../../_images/packetsreceivedsent.svg

Here is the ratio of received and sent packets:

../../../../../_images/packetratio.png

Sources: omnetpp.ini, FrerAndTasShowcase.ned

Try It Yourself

If you already have INET and OMNeT++ installed, start the IDE by typing omnetpp, import the INET project into the IDE, then navigate to the inet/showcases/tsn/combiningfeatures/frerandtas folder in the Project Explorer. There, you can view and edit the showcase files, run simulations, and analyze results.

Otherwise, there is an easy way to install INET and OMNeT++ using opp_env, and run the simulation interactively. Ensure that opp_env is installed on your system, then execute:

$ opp_env run inet-4.4 --init -w inet-workspace --install --chdir \
   -c 'cd inet-4.4.*/showcases/tsn/combiningfeatures/frerandtas && inet'

This command creates an inet-workspace directory, installs the appropriate versions of INET and OMNeT++ within it, and launches the inet command in the showcase directory for interactive simulation.

Alternatively, for a more hands-on experience, you can first set up the workspace and then open an interactive shell:

$ opp_env install --init -w inet-workspace inet-4.4
$ cd inet-workspace
$ opp_env shell

Inside the shell, start the IDE by typing omnetpp, import the INET project, then start exploring.

Discussion

Use this page in the GitHub issue tracker for commenting on this showcase.