error iogate[] gates are all connected, no gate left for `++' operator

427 views
Skip to first unread message

ada81

unread,
Feb 1, 2017, 4:43:02 PM2/1/17
to OMNeT++ Users
Hi,
I need your help about this problem.
I used Omnet 4.6 with inet 2.5. When i run my project i get this error

                    Error in module (cModule) NaasDatacenter.DC1 (id=2) during network setup: 
                    iogate[] gates are all connected, no gate left for `++' operator, 


This is my Network description file


module ThreeTierDatacenter
{
    parameters:
        @display("bgb=1074,458");
        int aggregateswitch = default(4);
        int corerouter = default(2);
        int accessswitch = default(16);
    gates:
        inout iogate[];

    submodules:
        AS1[aggregateswitch]: Router {
            @display("i=abstract/router2;p=210.21,199.43001,r,300,80,80");
        }

        CS1[corerouter]: Router {
            @display("i=abstract/switch;p=455,200,r,300,80,80");
        }

        Rks[accessswitch]: Racks {
            @display("p=121.275,377.30002,m,16,80,80;i=device/router");
        }

        central: Router {
            @display("i=abstract/switch;p=419,319,r,300,80,80");
        }
       
    connections allowunconnected:
        for i=0..corerouter-1, for j=0..aggregateswitch-1 {
            CS1[i].ethg++ <--> Eth10G {  ber = default(1e-5); } <--> AS1[j].ethg++;
            CS1[i].ethg++ <--> Eth10G {  ber = default(1e-5); } <--> central.ethg++;
            central.ethg++<-->iogate++;
        }
        
        for j=0..3 {
            AS1[0].ethg++ <--> Eth1G {  ber = default(1e-5); } <--> Rks[j].ioport++;
        }
        //
        for j=4..7 {
            AS1[1].ethg++ <--> Eth1G {  ber = default(1e-5); } <--> Rks[j].ioport++;
        }
        for j=8..11 {
            AS1[2].ethg++ <--> Eth1G {  ber = default(1e-5); } <--> Rks[j].ioport++;
        }
        for j=12..15 {
            AS1[3].ethg++ <--> Eth1G {  ber = default(1e-5); } <--> Rks[j].ioport++;
        }
}

network NaasDatacenter
{
    parameters:
        int numSenders = default(10);
        
    types:
        channel C extends DatarateChannel
        {
            delay = 20ms;
            datarate = 5Mbps;
        }
    submodules:
        DC1: ThreeTierDatacenter {

            @display("i=device/server;p=452,61");
        }
        DC2: ThreeTierDatacenter {

            @display("i=device/server;p=452,160");
        }
        netconfig: IPv4NetworkConfigurator {
            parameters:
                @display("p=63,81");
        }

        srouter[numSenders]: Router {
            @display("p=262,176");
        }
        sender[numSenders]: StandardHost {
            @display("p=84,176");
        }
 }
    connections allowunconnected:
            DC1.iogate++ <--> Eth10G <--> internet.pppg++;
            DC2.iogate++ <--> Eth10G <--> internet.pppg++;
      
        for i=0..numSenders-1 {
            srouter[i].pppg++ <--> C <--> internet.pppg++;
            sender[i].ethg++ <--> Eth100M <--> srouter[i].ethg++;
        }
}

Thanks.

Michael Kirsche

unread,
Feb 2, 2017, 10:30:54 AM2/2/17
to OMNeT++ Users
The OMNeT manual explains the situation: https://omnetpp.org/doc/omnetpp/manual/#sec:ned-lang:connections


Gates are specified as modulespec.gatespec (to connect a submodule), or as gatespec (to connect the compound module). modulespec is either a submodule name (for scalar submodules), or a submodule name plus an index in square brackets (for submodule vectors). For scalar gates, gatespec is the gate name; for gate vectors it is either the gate name plus an index in square brackets, or gatename++.

The gatename++ notation causes the first unconnected gate index to be used. If all gates of the given gate vector are connected, the behavior is different for submodules and for the enclosing compound module. For submodules, the gate vector expands by one. For a compound module, after the last gate is connected, ++ will stop with an error.

    NOTE
    Why is it not possible to expand a gate vector of the compound module? The model structure is built in top-down order, so new gates would be left unconnected on the outside, as there is no way in NED to "go back" and connect them afterwards.
Your module "ThreeTierDatacenter" is a compound module, where the iogates are connected to the central router ("central.ethg++").
Afterwards, you try to connect the iogates of the ThreeTierDatacenter compound module via a 10G Ethernet channel to this ominous internet.pppg gate.
But there is no open/unconnected iogate available and, as the manual states, the gate vector of the compound module can thus not be extended any further.

You compound module would need another gate for an outside connection (I assume) to the Ethernet channel (and this Internet pppg gate).
Probably (not knowing your scenario), there should be a connection from the central router to the outside world ?!?

ada81

unread,
Feb 2, 2017, 2:25:32 PM2/2/17
to OMNeT++ Users

Thanks for your explanation. 
You are right. In the scenario there is a connection from the central router to the outside. Do you have an idea?

Michael Kirsche

unread,
Feb 6, 2017, 4:34:19 AM2/6/17
to OMNeT++ Users
Well like you said, there is a connection from the central router to the outside.
Define a new gate for the central router for its outside connection and connect it in your network definition to the Internet pppg gate.
You will need source code in the central router (handleMessage) to redirect incoming messages to their specific destinations (routing) and hand over outgoing messages to the correct gate.
Routing functionalities... like the central router should provide anyway.
Reply all
Reply to author
Forward
0 new messages