Why do I get cast error with INET configurator

Viewed 80

The following error appears during initializing my network:

<!> check_and_cast(): Cannot cast (inet::Ipv4FlatNetworkConfigurator*)GigabitNetwork.configurator to type 'inet::Ipv4NetworkConfigurator *' -- in module (inet::Ipv4NodeConfigurator) GigabitNetwork.standardHost[0].ipv4.configurator (id=421), during network initialization

I have been trying to solve it for a while, but without success.

Here is my network:

Network GigabitNetwork
{
    parameters:
        int numHosts;
        @display("bgb=449,342");
    types:
        channel Ether1000m extends DatarateChannel
        {
            datarate = 1000Mbps;
            delay = 0.1s;
        }
submodules:
    CentralSwitch: EtherSwitch {
        @display("p=189,139");
    }
    Switch1: EtherSwitch {
        @display("p=149,198");
    }
    Switch2: EtherSwitch {
        @display("p=271,198");
    }
    Switch3: EtherSwitch {
        @display("p=258,76");
    }
    Switch4: EtherSwitch {
        @display("p=143,94");
    }
    standardHost[numHosts]: StandardHost {
        @display("p=334,38");
    }
    standardHost1[numHosts]: StandardHost {
        @display("p=342,205");
    }
    standardHost2[numHosts]: StandardHost {
        @display("p=57,256");
    }
    standardHost3[numHosts]: StandardHost {
        @display("p=42,38");
    }
    Server: StandardHost {
        @display("p=42,146;i=device/server");
    }
    configurator: Ipv4FlatNetworkConfigurator {
        @display("p=201,293");
    }
connections:
    CentralSwitch.ethg++ <--> Ether1000m <--> Server.ethg++;
    CentralSwitch.ethg++ <--> Ether1000m <--> Switch4.ethg++;
    CentralSwitch.ethg++ <--> Ether1000m <--> Switch3.ethg++;
    CentralSwitch.ethg++ <--> Ether1000m <--> Switch2.ethg++;
    CentralSwitch.ethg++ <--> Ether1000m <--> Switch1.ethg++;
    for i=0..numHosts-1 {
        standardHost1[i].ethg++ <--> Ether1000m <--> Switch2.ethg++;
        standardHost2[i].ethg++ <--> Ether1000m <--> Switch1.ethg++;
        standardHost[i].ethg++ <--> Ether1000m <--> Switch3.ethg++;
        standardHost3[i].ethg++ <--> Ether1000m <--> Switch4.ethg++;
    }
}

And my INI file:

[General]
network = GigabitNetwork

sim-time-limit = 120s

**.numHosts = 5

*.*.numApps = 1

**.channel.throughput.statistic-recording = true
**.channel.throughput.result-recording-modes = all
**.*.vector-recording = true 
**.*.vector-recording-intervals= 0..3600

[Config Udp]
*.standardHost[*].app[0].typename = "UdpVideoStreamClient"
*.standardHost[*].app[0].serverAddress = "Server"
*.standardHost[*].app[0].serverPort = 1000
*.standardHost[*].app[0].startTime = uniform(0s, 0.1s)

*.standardHost1[*].app[0].typename = "UdpVideoStreamClient"
*.standardHost1[*].app[0].serverAddress = "Server"
*.standardHost1[*].app[0].serverPort = 1000
*.standardHost1[*].app[0].startTime = uniform(0s, 0.1s)

*.standardHost2[*].app[0].typename = "UdpVideoStreamClient"
*.standardHost2[*].app[0].serverAddress = "Server"
*.standardHost2[*].app[0].serverPort = 1000
*.standardHost2[*].app[0].startTime = uniform(0s, 0.1s)

*.standardHost3[*].app[0].typename = "UdpVideoStreamClient"
*.standardHost3[*].app[0].serverAddress = "Server"
*.standardHost3[*].app[0].serverPort = 1000
*.standardHost3[*].app[0].startTime = uniform(0s, 0.1s)

*.Server.app[0].typename = "UdpVideoStreamServer"
*.Server.app[0].localPort = 1000
*.Server.app[0].sendInterval = 0.001s
*.Server.app[0].packetLen =1400B
*.Server.app[0].videoSize = 1Gb
1 Answers

In your NED try to change the line
configurator: Ipv4FlatNetworkConfigurator {

into:
configurator: Ipv4NetworkConfigurator {

Related