动态模块:Ipv4 配置器没有为动态模块 omnet++ 分配地址

dynamic module : Ipv4 configurator does not assign address to the dynamic module omnet++

我使用下面的代码创建了一个动态模块。模块创建成功,但 ipv4configurator 模块没有为创建的动态模块分配 IP 地址。所以当我 运行 模拟时,我得到这个错误:

" 断言:条件 '!myIPAddress.isUnspecified()' 在函数 'sendArpRequest' at inet/networklayer/arp/ipv4/Arp.cc:173 中不成立 -- 在模块 (inet::Arp) Drones.clone.ipv4.arp (id=323),t=1.057126851753s,事件#272“

moduleType = cModuleType::get("inet.node.inet.WirelessHost");
module = moduleType->create("clone", this);
module->finalizeParameters();
module->buildInside();
module->scheduleStart(simTime() + updateInterval);
cPreModuleInitNotification pre;
pre.module = module;
emit(POST_MODEL_CHANGE, &pre);
module->callInitialize();
cPostModuleInitNotification post;
post.module = module;
emit(POST_MODEL_CHANGE, &post);

是的,这是Ipv4Configurator的限制。它需要提前了解网络拓扑结构,才能分配 IP 地址、优化子网掩码和设置路由 table 条目。

全局IpV4NetworkConfigurator首先建立一个数据库,然后每个节点在设置过程中查看这个数据库并拉取与自己相关的信息并设置接口和路由table等。