Unknown protocol error, using TSN devices as a relay unit in omnet++ (without using switches or routers)

75 Views Asked by At

I have created a simple network for relaying or forwarding UDP packets from one device to another. The .ned for my network is as mentioned below:

import inet.node.ethernet.EthernetLink;
import inet.node.ethernet.Eth100M;
import inet.networklayer.configurator.ipv4.Ipv4NetworkConfigurator;
import inet.node.inet.StandardHost;

network UdpExample
{
    @display("bgb=655,369");
    submodules:
        configurator: Ipv4NetworkConfigurator {
            parameters:
                @display("p=100,100;is=s");
        }
        client: StandardHost {
            parameters:
                @display("p=250,100");
        }
        server: StandardHost {
            parameters:
                @display("p=544,100;i=device/pc2");
        }
        relay: StandardHost {
            @display("p=402,100");
            forwarding = default(true);
        }
    connections:
        client.ethg++ <--> EthernetLink {  datarate = 100Mbps; } <--> relay.ethg++;
        relay.ethg++ <--> EthernetLink {  datarate = 100Mbps; } <--> server.ethg++;
}

import inet.common.scenario.ScenarioManager;
import inet.node.tsn.TsnDevice;
import inet.networks.base.TsnNetworkBase;
import inet.node.ethernet.Eth100M;

network UdpExample1 extends TsnNetworkBase
{
    parameters:
    @display("bgb=2230.5361,1700.952");
    
    
    submodules:
        tsnDevice1: TsnDevice {
            @display("p=991.728,620.256");
        }
        tsnDevice2: TsnDevice {
            @display("p=1359.792,620.256");
            forwarding = default(true);
        }
        tsnDevice3: TsnDevice {
            @display("p=1751.712,620.256");
        }
        scenarioManager: ScenarioManager {
            @display("p=98.736,839.25604");
        }

    connections:

        tsnDevice1.ethg++ <--> Eth100M <--> tsnDevice2.ethg++;
        tsnDevice2.ethg++ <--> Eth100M <--> tsnDevice3.ethg++;
}

The first network is using a "StandardHost", while the second one is using "TsnDevice".For the networks the "relay" and "tsnDevice2" has forwarding = true as shown in the .ned file.

The .ini file for this network is:

[Config exp1]
sim-time-limit = 3s

network = UdpExample
*.*.eth[*].bitrate = 100Mbps
*.client.numApps = 1
*.client.app[0].typename = "UdpSourceApp"
*.client.app[0].display-name = "video-Device1"
*.client.app[0].io.destAddress = "server"
*.client.app[0].io.destPort = 1000
*.client.app[0].source.packetLength = 1000B 
*.client.app[0].source.productionInterval = 1ms

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


[Config exp2]

network = UdpExample1
sim-time-limit = 2s

*.tsnDevice2.hasIncomingStreams = true
*.tsnDevice2.hasOutgoingStreams = true

#Ethernet links are 100Mbps
*.*.eth[*].bitrate = 100Mbps

#source
*.tsnDevice1.numApps = 1
*.tsnDevice1.app[0].typename = "UdpSourceApp"
*.tsnDevice1.app[0].source.packetNameFormat = "%M->tsnDevice1:-%c"
*.tsnDevice1.app[0].source.packetLength = 175B
*.tsnDevice1.app[0].source.productionInterval = 1ms 
*.tsnDevice1.app[0].io.destAddress = "tsnDevice3"
*.tsnDevice1.app[0].io.destPort = 1004
*.tsnDevice1.app[0].source.initialProductionOffset = 1ms


#client
*.tsnDevice3.numApps = 1
*.tsnDevice3.app[0].typename = "UdpSinkApp"
*.tsnDevice3.app[0].display-name = "tsnDevice1"
*.tsnDevice3.app[0].io.localPort = 1004

The first network works without any issue but the second one(which uses tsn devices) pops this issue:

<!> handlePacket(): Unknown protocol: protocolId = 24, protocolName = ethernetmac, servicePrimitive = INDICATION, pathStartGate = combNetwork.tsnDevice2.ipv4.ip.queueOut, pathEndGate = combNetwork.tsnDevice2.ipv4.lp.in[1] -- in module (inet::MessageDispatcher) combNetwork.tsnDevice2.ipv4.lp (id=258), at t=0.00101837s, event #16

I'm new to using the omnet++ simulator, and it's possible that the problem has already been resolved. Could someone assist me in resolving the error or guide me on the necessary changes to be made in the .ini file?

1

There are 1 best solutions below

0
Jerzy D. On

First of all remove the line forwarding = default(true) from parameters of tsnDevice2 in NED file. That parameter means that the host forwards IP packets processed in a Layer 3 (i.e. network layer). However, TSN is a Layer 2 technology.
Moreover, change the type of tsnDevice2 to TsnSwitch - a dedicated switch for TSN.
So you should modify your NED file as below:

import inet.node.tsn.TsnSwitch;
// ...

tsnDevice2: TsnSwitch {
    @display("p=1359.792,620.256");
    //forwarding = default(true);
}
// ...