[General] network = inet.networks.tsn.TsnLinearNetwork sim-time-limit = 1s description = "Traffic shaping using mixed asynchronous and credit-based shapers" # client applications *.client.numApps = 2 *.client.app[*].typename = "UdpSourceApp" *.client.app[0].display-name = "best effort" *.client.app[1].display-name = "video" *.client.app[*].io.destAddress = "server" *.client.app[0].io.destPort = 1000 *.client.app[1].io.destPort = 1001 *.client.app[*].source.packetLength = 1000B - 54B # 42B = 8B (UDP) + 20B (IP) + 14B (ETH MAC) + 4B (ETH FCS) + 8B (ETH PHY) *.client.app[0].source.productionInterval = exponential(200us) # ~40Mbps *.client.app[1].source.productionInterval = exponential(400us) # ~20Mbps # server applications *.server.numApps = 2 *.server.app[*].typename = "UdpSinkApp" *.server.app[0].display-name = "best effort" *.server.app[1].display-name = "video" *.server.app[0].io.localPort = 1000 *.server.app[1].io.localPort = 1001 # enable outgoing streams *.client.hasOutgoingStreams = true # enable incoming streams *.server.hasIncomingStreams = true # client stream identification *.client.bridging.streamIdentifier.identifier.mapping = [{stream: "best effort", packetFilter: expr(udp.destPort == 1000)}, {stream: "video", packetFilter: expr(udp.destPort == 1001)}] # client stream encoding *.client.bridging.streamCoder.encoder.mapping = [{stream: "best effort", pcp: 0}, {stream: "video", pcp: 4}] # switch stream decoding *.switch.bridging.streamCoder.decoder.mapping = [{pcp: 0, stream: "best effort"}, {pcp: 4, stream: "video"}] # enable egress traffic shaping *.switch.hasEgressTrafficShaping = true # credit-based and asynchronous traffic shaping *.switch.eth[*].macLayer.queue.numTrafficClasses = 2 *.switch.eth[*].macLayer.queue.*[0].display-name = "best effort" *.switch.eth[*].macLayer.queue.*[1].display-name = "video" *.switch.eth[*].macLayer.queue.transmissionSelectionAlgorithm[0].typename = "Ieee8021qCreditBasedShaper" *.switch.eth[*].macLayer.queue.transmissionSelectionAlgorithm[0].idleSlope = 60Mbps *.switch.eth[*].macLayer.queue.transmissionSelectionAlgorithm[1].typename = "Ieee8021qCreditBasedShaper" *.switch.eth[*].macLayer.queue.transmissionSelectionAlgorithm[1].idleSlope = 60Mbps *.switch.eth[*].macLayer.queue.transmissionGate[0].initiallyOpen = true *.switch.eth[*].macLayer.queue.transmissionGate[1].initiallyOpen = false *.switch.eth[*].macLayer.queue.transmissionGate[*].durations = [4ms, 2ms]