Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IpAddresses are not assigned name of Ipv4 module is not "ipv4" - fails silently #480

Open
edlongman opened this issue Nov 8, 2019 · 0 comments
Assignees
Labels
Bug

Comments

@edlongman
Copy link

@edlongman edlongman commented Nov 8, 2019

IpAddresses are not assigned to interfaces unless the module of the type Ipv4 is named "ipv4".

Reproduce

Create a node where the ipv4 submodule is not called ipv4. All interfaces are then not assigned an ip address.

Modified Example from https://inet.omnetpp.org/docs/users-guide/ch-network-nodes.html#custom-network-nodes

//NetworkNodeExample.ned
module NetworkNodeExample
{
    parameters:
    	@networkNode;
        *.interfaceTableModule = default(absPath(".interfaceTable"));
    gates:
        inout ethg; // ethernet interface connector
        input radioIn @directIn; // incoming radio frames from physical medium
    submodules:
        app: <> like IApp; // configurable application
        tcp: Tcp; // standard TCP protocol
        ip: Ipv4NetworkLayer; // standard IP protocol
        md: MessageDispatcher; // connects multiple interfaces to IP
        //wlan: Ieee80211Interface; // standard wifi interface
        eth: EthernetInterface; // standard ethernet interface
        interfaceTable: InterfaceTable;
    connections allowunconnected: // network node internal connections
        app.socketOut --> tcp.appIn; // application sends data stream
        app.socketIn <-- tcp.appOut; // application receives data stream
        tcp.ipOut --> ip.transportIn; // TCP sends segments
        tcp.ipIn <-- ip.transportOut; // TCP receives segments
        ip.ifOut --> md.in++; // IP sends datagrams
        ip.ifIn <-- md.out++; // IP receives datagrams
        //md.out++ --> wlan.upperLayerIn;
        //md.in++ <-- wlan.upperLayerOut;
        md.out++ --> eth.upperLayerIn;
        md.in++ <-- eth.upperLayerOut;
        eth.phys <--> ethg; // Ethernet sends frames to cable
        //radioIn --> wlan.radioIn; // IEEE 802.11 sends frames to medium
}
//SimplePing.ned
network SimplePing
{
    parameters:
    	@display("bgb=522,282");
        *.**.networkConfiguratorModule = absPath(".configurator");
    submodules:
        networkNodeExample: NetworkNodeExample {
            @display("p=42,56");
        }
        networkNodeExample1: NetworkNodeExample {
            @display("p=333,56");
        }
        networkNodeExample2: NetworkNodeExample {
            @display("p=86,194");
        }
        networkNodeExample3: NetworkNodeExample {
            @display("p=383,213");
        }
        radioMedium: Ieee80211RadioMedium {
            @display("p=469,34");
        }
        configurator: Ipv4NetworkConfigurator {
            @display("p=469,194");
        }
        visualizer: IntegratedCanvasVisualizer {
            @display("p=457,108");
        }
    connections:
        networkNodeExample3.ethg <--> Eth100M <--> networkNodeExample1.ethg;
        networkNodeExample2.ethg <--> Eth100M <--> networkNodeExample.ethg;
}
[General]
network = SimplePing
**.app.typename = "PingApp"
**.app.destAddr = "*"

Possible [Cause]

The NetworkConfiguratorBase::extractTopology function calls findRoutingTable https://github.com/inet-framework/inet/blob/master/src/inet/networklayer/configurator/base/NetworkConfiguratorBase.cc#L109 which in turn calls L3AddressResolver::findIpv4RoutingTableOf https://github.com/inet-framework/inet/blob/master/src/inet/networklayer/common/L3AddressResolver.cc#L480 which tries to get the routing table based on the default module name of ipv4.
There is no check to see if it was successful in finding the routing table.

Possible Improvement

Use the L3AddressResolver::getIpv4RoutingTableOf to include a check so that it doesn't fail silently but instead throws a runtime error.

I'm not exactly sure why not having the routing table means it doesn't correctly apply ip addresses to interface but the main problem surely is that it fails silently if the module is not called ipv4

@edlongman edlongman changed the title IpAddresses are not assigned name:Ipv4 module is "ipv4" - fails silently IpAddresses are not assigned name of Ipv4 module is not "ipv4" - fails silently Nov 11, 2019
@levy levy self-assigned this Nov 12, 2019
@levy levy added Feature Bug and removed Feature labels Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.