使用 INET getContainingNicModule() 构建节点:未找到 nic 模块

building node with INET getContainingNicModule(): nic module not found

我正在构建一个无线节点,它目前看起来像这样

 module Node extends NodeBase
 {
    parameters:
        mobility.typename = default("StationaryMobility");
        Physical.antenna.mobilityModule = default("^.^.mobility");
        @display("bgl=8;bgb=230.31801,357.28");
        *.interfaceTableModule = default(absPath(".interfaceTable"));
    gates:
        input radioIn @directIn;
    submodules:
        //Don't know what this does but need interfaceTableModule to be defined
        interfaceTable: InterfaceTable {
            parameters:
                @display("p=125,240;is=s");
        }
        Physical: Ieee802154UwbIrRadio{
            @display("p=41,74");
        }
        Link: <default("Ieee802154Mac")> like IMacProtocol {
            @display("p=41,169");
        }
        Net: BroadcastRouting {
            @display("p=41,248");
        }
    connections allowunconnected:
        radioIn --> Physical.radioIn;
        Physical.upperLayerOut --> Link.lowerLayerIn;
        Physical.upperLayerIn <-- Link.lowerLayerOut;
        Link.upperLayerOut --> Net.fromMac;
        Link.upperLayerIn <-- Net.toMac;
}

当模拟器尝试加载 LinkLayer 时产生运行时错误。

运行时错误:getContainingNicModule(): nic module not found (it should have a property named nic) for module 'network.componenet1.Link' ... during network initialisation

我认为函数 getContainingNicModule 试图做的是寻找作为 link 层父级的网络接口卡模块。 我搜索了 nic 属性 但找不到任何内容。它可能与 interface 属性 有关,但我正在镜像的 inet.LinkLayerNodeBase 没有这样的 属性.

为什么会出现这个错误?

任何 like IMacProtocol 的模块必须是 IWirelessInterface

的子模块

通过将 IRadioIMacProtocol 实现更改为 Ieee802154UwbIrInterface 中的组合 IWirelessInterface 实现,它不再给我 nic module not found error.

抛出错误的函数是 findContainingNicModule。它寻找是否可以将父模块转换为 InterfaceEntry 类型。如果失败,则它会显示与 nic 属性 有关的错误,但是没有模块再具有 属性。

从 inet 3.6.4 开始(我认为)Nic types have been replaced with Interface types。许多其他对 Nics 的引用并没有改变。所以错误并不能准确反映问题。

现在的工作模块:

module Node extends NodeBase
{

    parameters:
        mobility.typename = default("StationaryMobility");
        wlan.radio.antenna.mobilityModule = default("^.^.^.mobility");
        @display("bgl=8;bgb=230.31801,357.28");
    gates:
        input radioIn @directIn;
    submodules:
        //Don't know what this does but need interfaceTableModule to be defined
        interfaceTable: InterfaceTable {
            parameters:
                @display("p=125,240;is=s");
        }
        wlan: <default("Ieee802154UwbIrInterface")> like IWirelessInterface{
            parameters:
                @display("p=41,248,row,150;q=queue");
        }
        Net: BroadcastRouting {
            @display("p=41,148");
        }
    connections allowunconnected:
        radioIn --> wlan.radioIn;
        wlan.upperLayerOut --> Net.fromMac;
        wlan.upperLayerIn <-- Net.toMac;
}