0

Hello OmNetPP and simu5G users,

I have the same questions on this link: How to add an ethernet port to a simu5G UE?

What I am trying to do is directly add an Ethernet interface in NRUe.ned and establish a Ethernet link between UE and TSN device in the main network file (TSN_5G.ned).

However, the following error message pops up: No submodule 'ue[1]' to be connected, at /home//Simu5G/simulations/NR/networks/TSN_5G.ned:107 -- in module (omnetpp::cModule) TSN_5G (id=1), during network setup

Can someone give me some hints to solve the problem? Thank you and best regards.


My codes are as follows:

  1. omnetpp.ini (Basically copy from NR tutorial with single UE scenario)
[General]
output-scalar-file-append = false 
 
# Network configuration 
network = simu5g.simulations.NR.networks.TSN_5G
sim-time-limit = 10s 
warmup-period = 1s 
seed-set = ${repetition} 
 
# Statistics 
output-scalar-file = ${resultdir}/${configname}/${repetition}.sca 
output-vector-file = ${resultdir}/${configname}/${repetition}.vec 
**.routingRecorder.enabled = false 
  
# General parameters 
**.amcType = "NRAmc" 
**.targetBler = 0.01 
**.blerShift = 5   
*.configurator.config = xmldoc("./demo.xml") 

# Floorplan definition 
**.mobility.constraintAreaMaxX = 1000m 
**.mobility.constraintAreaMaxY = 1000m 
**.mobility.constraintAreaMinX = 0m 
**.mobility.constraintAreaMinY = 0m 
**.mobility.constraintAreaMinZ = 0m 
**.mobility.constraintAreaMaxZ = 0m 
**.mobility.initFromDisplayString = false 
# --------------------------------------------------------# 
  

# --------------------------------------------------------# 
# Config "Single-UE" 
# 
# Simple scenario with one UE attached to one gNB. A remote  
# server sends 800 kbps CBR traffic to the UE 
# 
[Config Single-UE]

# gNodeB position 
*.gnb.mobility.initialX = 500m 
*.gnb.mobility.initialY = 500m 

# UE configuration 
*.numUe = 1

# UE position (400m far from the gNB)
*.ue[*].mobility.initialX = 500m 
*.ue[*].mobility.initialY = 900m 

 
# connect the UE's NIC (NR side) to the corresponding serving gNB 
*.ue[*].macCellId = 0 
*.ue[*].masterId = 0 
*.ue[*].nrMacCellId = 1 
*.ue[*].nrMasterId = 1 
 
# Application Setup 
# *.ue[*].numApps = 1
#*.ue[*].app[*].typename = "CbrReceiver" 
#*.ue[*].app[*].localPort = 1000

#*.ue[*].app[*].source.packetLengths = 128B CbrReceiver
#*.ue[*].app[*].source.productionInterval = 1s
#*.ue[*].app[*].io.destPort = 1001
 
#*.server.app[*].typename = "CbrSender" UdpSourceApp  
#*.server.app[*].PacketSize = 1000      # send 800 Kb/s 
#*.server.app[*].sampling_time = 0.01s 
#*.server.app[*].destAddress = "ue["+string(ancestorIndex(0))+"]" # obtain the address of the client by reading its index in the array of Apps 
#*.server.app[*].destPort = 1000  
#*.server.app[*].localPort = 3088+ancestorIndex(0)  
#*.server.app[*].startTime = uniform(0.01s,0.05s) 
# --------------------------------------------------------# 
*.tsnDevice1.numApps = 1
*.tsnDevice1.app[0].typename = "CbrReceiver"
*.tsnDevice1.app[0].io.localPort = 1001
# --------------------------------------------------------# 
*.tsnDevice.numApps = 1
*.tsnDevice.app[0].typename = "CbrSender"
*.tsnDevice.app[0].display-name = "tactile"
#*.tsnDevice.app[0].destAddress = "ue[0]"
*.tsnDevice.app[0].io.destAddress = "tsnDevice1"
#*.tsnDevice.app[0].destAddress = "ue["+string(ancestorIndex(0))+"]"
#*.tsnDevice.app[0].destPort = 1000
*.tsnDevice.app[0].io.destPort = 1001
*.tsnDevice.app[0].source.packetLength = 512B
*.tsnDevice.app[0].source.productionInterval = 0.5ms
 
  1. TSN_5G.ned
// 
//                  Simu5G
//
// Authors: Giovanni Nardini, Giovanni Stea, Antonio Virdis (University of Pisa)
// 
// This file is part of a software released under the license included in file
// "license.pdf". Please read LICENSE and README files before using it.
// The above files and the present reference are part of the software itself, 
// and cannot be removed from it.
// 
package simu5g.simulations.NR.networks;

import inet.networklayer.configurator.ipv4.Ipv4NetworkConfigurator;
import inet.networklayer.ipv4.RoutingTableRecorder;
import inet.node.ethernet.Eth10G;
import inet.node.ethernet.Eth1G;
import inet.node.ethernet.EthernetSwitch;
import inet.node.inet.Router;
import inet.node.inet.StandardHost;
import inet.node.tsn.TsnDevice;
import inet.node.tsn.TsnSwitch;
import inet.node.contract.IEthernetNetworkNode;
import inet.node.base.LinkLayerNodeBase;
import inet.linklayer.contract.IEthernetInterface;

import simu5g.common.binder.Binder;
import simu5g.common.carrierAggregation.CarrierAggregation;
import simu5g.nodes.Upf;
import simu5g.nodes.NR.gNodeB;
import simu5g.nodes.NR.NRUe;
import simu5g.nodes.backgroundCell.BackgroundCell;
import simu5g.world.radio.LteChannelControl;

// SingleCell_standalone
//
// This network represents the deployment option 3 in 3GPP 38.801
//
network TSN_5G
{
    parameters:
        int numUe = default(0);
        int numBgCells = default(0);
        @display("i=block/network2;bgb=1000,1000;bgi=background/pisa");
        *.eth[*].bitrate = default(1000Mbps);
    types:
        module Translators extends Router like IEthernetNetworkNode
        {
            parameters:
                bool hasCutthroughSwitching = default(false);
                bool hasFramePreemption = default(false);
                bool hasEgressTrafficShaping = default(false);
                ethernet.typename = default("EthernetLayer"); // use Ethernet protocol layer outside of network interfaces
                eth[*].typename = default(hasCutthroughSwitching ? "EthernetCutthroughInterface" : "LayeredEthernetInterface"); // switch to modular Ethernet interface
                eth[*].macLayer.typename = default(hasFramePreemption ? "EthernetPreemptingMacLayer" : "EthernetMacLayer");
                eth[*].macLayer.queue.typename = default(hasEgressTrafficShaping ? "Ieee8021qTimeAwareShaper" : "PacketQueue"); // use compound priority queue having multiple subqueues controlled by separate gates when egress traffic shaping is enabled
                eth[*].phyLayer.typename = default(hasCutthroughSwitching ? "EthernetStreamThroughPhyLayer" : (hasFramePreemption ? "EthernetPreemptingPhyLayer" : "EthernetPhyLayer")); // use packet streaming when cut-through switching is enabled
        }

    submodules:
        channelControl: LteChannelControl {
            @display("p=50,25;is=s");
        }
        routingRecorder: RoutingTableRecorder {
            @display("p=78.312,86.343994;is=s");
        }
        configurator: Ipv4NetworkConfigurator {
            @display("p=78.312,194.776");
        }
        binder: Binder {
            @display("p=78.312,311.24;is=s");
        }
        carrierAggregation: CarrierAggregation {
            @display("p=62.247997,395.576;is=s");
        }
        router: Router {
            @display("p=363.175,115.66875;i=device/smallrouter");
        }
        upf: Upf {
            @display("p=527.35,116.9125");
        }
        iUpf: Upf {
            @display("p=725,118");
        }
        gnb: gNodeB {
            @display("p=726.35,277.35626;is=vl");
        }
        ue[numUe]: NRUe {
            @display("p=628.09375,411.68124");
        }
        tsnDevice: TsnDevice {
            @display("p=200.79999,524.088");
        }
        tsnSwitch: <default("TsnSwitch")> like IEthernetNetworkNode {
            @display("p=361.44,522.07996");
        }
        tsnDevice1: TsnDevice {
            @display("p=628.50397,642.56");
        }
        translators: Translators {
            @display("p=465.856,305.216");
        }
    connections allowunconnected:
        //router.pppg++ <--> Eth10G <--> upf.filterGate;
        translators.pppg++ <--> Eth10G <--> upf.filterGate;
        upf.pppg++ <--> Eth10G <--> iUpf.pppg++;
        iUpf.pppg++ <--> Eth10G <--> gnb.ppp;
        ue[numUe].ethg++ <--> Eth1G <--> tsnDevice1.ethg++;
        tsnDevice.ethg++ <--> Eth1G <--> tsnSwitch.ethg++;
        tsnSwitch.ethg++ <--> Eth1G <--> translators.ethg++;//router.ethg++;
        
}

  1. NRUe.ned
// 
//                  Simu5G
//
// Authors: Giovanni Nardini, Giovanni Stea, Antonio Virdis (University of Pisa)
// 
// This file is part of a software released under the license included in file
// "license.pdf". Please read LICENSE and README files before using it.
// The above files and the present reference are part of the software itself, 
// and cannot be removed from it.
// 


package simu5g.nodes.NR;

import simu5g.nodes.Ue;
import simu5g.stack.NRNicUe;

import simu5g.corenetwork.statsCollector.NRueStatsCollector;
import inet.linklayer.ethernet.contract.IEthernetLayer;
// 
// User Equipment Module
//
module NRUe extends Ue
{
    parameters:
        nicType = default("NRNicUe");
        int numEth = default(1);
        int nrMasterId @mutable = default(0);
        int nrMacNodeId @mutable = default(0); // TODO: this is not a real parameter
        int nrMacCellId @mutable = default(0); // TODO: this is not a real parameter

    gates:
        input nrRadioIn @directIn;     // connection to master  
        inout ethg[numEth] @labels(EtherFrame-conn) @allowUnconnected;

    submodules:
        //# UeStatsCollector - for MEC
//        NRueCollector: NRueStatsCollector if hasRNISupport {
//            @display("p=73.687996,445.75198;is=s");
//        }

    connections allowunconnected:
        for i=0..sizeof(ethg)-1 {
            ethg[i] <--> { @display("m=s"); } <--> eth[i].phys;
        }
        cellularNic.nrRadioIn <-- nrRadioIn;
}

  1. demo.xml
<config>
    <interface hosts="tsnDevice" names="eth0" address="10.0.0.50" />
    <interface hosts="ue[0]" names="eth0" address="10.0.0.51"/>
    <interface hosts="*" address="10.x.x.x" netmask="255.255.255.x" />
    <!--<route hosts="router" destination="10.0.1.1" netmask="255.255.255.255" gateway="10.0.0.14" />-->
    <!-- <route hosts="*"> -->
</config>

Expected to happen: The simulatoin can run.

Actually resulted: A error during network setup

  • Hi, I see that the above UE is still not able to forward packet through the ethernet port. Did you get it working? – Piper Feb 08 '23 at 23:33

1 Answers1

0

You've set *.numUe = 1 in your ini file as well as ue[numUe].ethg++ <--> Eth1G <--> tsnDevice1.ethg++; --> ue[1].ethg++ <--> Eth1G <--> tsnDevice1.ethg++; in your ned file. As a consequence: 1) you're not connecting all your modules from vector, only ue[1], 2) you're going out of range since the only element presented in your vector is ue[0].

Try to change ue[numUe].ethg++ <--> Eth1G <--> tsnDevice1.ethg++; to:

for i=0..numUe-1 {
    ue[i].ethg++ <--> Eth1G <--> tsnDevice1.ethg++;
}
gehirndienst
  • 424
  • 2
  • 13