2
votes

I'm trying to send an Udp message from a WirelessHost (Host1) to a StandardHost (Host3) through an AP and a Router, but I get this error message when i run the simulation (i called my network "poi"):

check_and_cast(): Cannot cast 'inet::physicallayer::INoise*' to type 'const inet::physicallayer::NarrowbandNoiseBase *' -- in module (inet::physicallayer::Ieee80211Radio) poi.router.wlan[0].radio (id=80), during network initialization

I started using omnet++ with Inet a few days ago, and based my code on tutorials and documentation, but i can't find a solution to this error. Any experience or solution ? Thank you

This is the .ned code, without import:

network poi {
    parameters:
        @display("bgb=514,316;bgg=100,1,grey95");
        @figure[title](type=label; pos=0,-1; anchor=sw; color=darkblue);

        @figure[rcvdPkText](type=indicatorText; pos=380,20; anchor=w; font=,18; textFormat="packets received: %g"; initialValue=0);
        @statistic[packetReceived](source=host3.app[0].packetReceived; record=figure(count); targetFigure=rcvdPkText);

    submodules:
        host1: WirelessHost {
            @display("p=403,224");
            numWlanInterfaces = 1;
            numApps = 1;
        }
        router: Router {
            @display("p=193,224");
            numWlanInterfaces = 2;
            numEthInterfaces = 2;
            numApps = 4;
        }
        accessPoint: AccessPoint {
            @display("p=303,217;r=2000");
        }
        host3: StandardHost {
            @display("p=73,224");
            numEthInterfaces = 1;
            numApps = 1;
        }
        integratedCanvasVisualizer: IntegratedCanvasVisualizer {
            @display("p=379,57");
        }
        configurator: Ipv4NetworkConfigurator {
            @display("p=104,35");
        }
        unitDiskRadioMedium: UnitDiskRadioMedium {
            @display("p=216,100;r=10000");
        }

    connections:
        accessPoint.ethg++ <--> Eth10G { @display("ls=,0"); } <--> router.ethg[0];
        router.ethg[1] <--> Eth10G { @display("ls=,0"); } <--> host3.ethg[0];
}

and the .ini file:

[General]
network = poi
*.host*.ipv4.arp.typename = "GlobalArp"
*.router.ipv4.arp.typename = "GlobalArp"
*.router.app[*].typename = "UdpBasicApp"

*.host1.app[0].typename = "UdpBasicApp"
*.host1.app[0].destAddresses = "accessPoint"
*.host1.app[0].messageLength = 500B
*.host1.app[0].sendInterval = uniform(1ms,10ms)
*.host1.app[0].packetName = "UDPData"

*.host1.wlan[*].radio.radioMediumModule = "unitDiskRadioMedium"
*.router.wlan[*].radio.radioMediumModule = "unitDiskRadioMedium"
*.accessPoint.wlan[*].radio.radioMediumModule = "unitDiskRadioMedium"

*.host*.wlan[*].radio.receiver.ignoreInterference = true

*.host3.app[*].typename = "UdpBasicApp"

*.host*.wlan[0].typename = "AckingWirelessInterface"
*.host*.wlan[0].mac.useAck = false
*.host*.wlan[0].mac.fullDuplex = true
*.host*.wlan[0].radio.transmitter.communicationRange = 500m
*.host*.wlan[0].mac.headerLength = 1B

*.host*.**.bitrate = 1Gbps
1

1 Answers

0
votes

Add to your ini file:

**.wlan[*].radio.typename = "UnitDiskRadio"

Besides this you can set unassigned parameters in ini, for example:

**.app[0].destPort = 4000
**.app[0].messageLength= 100B
**.app[0].sendInterval= 1s
**.transmitter.communicationRange = 500m