0

I want to construct a cellular router/modem/gateway with simu5g and Omnet++. I do this by extending the UE and creating an ethernet port and an ethernet layer.
However, this does not work.

Below is my code:-

 module NRModem extends NRUe
{
    parameters:
        ethernet.typename = default("EthernetLayer");
        numEthInterfaces = default(0);  // minimum number of ethernet interfaces
        int numEth = default(1);
        int numPppInterfaces = default(0);
    gates:
        inout pppg[numPppInterfaces] @labels(PppFrame-conn) @allowUnconnected;
        inout ethg[numEth] @labels(EtherFrame-conn) @allowUnconnected;
    submodules:
        ethernet: <default(sizeof(ethg) > 0 ? "EthernetEncapsulation" : "")> like IEthernetLayer if typename != "" {
            @display("p=54.365997,513.162;is=s");
        }
        ppp[sizeof(pppg)]: <default("PppInterface")> like IPppInterface {
            @display("p=259.896,588.744;row=150;q=txQueue");
        }
        eth2[sizeof(ethg)]: <default("EthernetInterface")> like IEthernetInterface {
            @display("p=168.402,547.638;q=txQueue");
        }
        li: MessageDispatcher {
            @display("p=298.35,511.836");
        }

    connections:

        for i=0..sizeof(ethg)-1 {
            ethg[i] <--> { @display("m=s"); } <--> eth2[i].phys;
        }
        for i=0..sizeof(pppg)-1 {
            pppg[i] <--> { @display("m=s"); } <--> ppp[i].phys;
        }
        for i=0..sizeof(ethg)-1 {
            eth2[i].upperLayerOut --> li.in++;
            eth2[i].upperLayerIn <-- li.out++;
        }
        eth2[0].upperLayerOut --> li.in++;
        li.out++ --> ethernet.lowerLayerIn;
        ethernet.lowerLayerOut --> li.in++;
        nl.out++ --> ethernet.upperLayerIn;
        nl.in++ <-- ethernet.upperLayerOut;
}

Is this the correct procedure?

Piper
  • 149
  • 11

0 Answers0