模块不在节点内(节点必须在 ned 模块中由@node 属性 标记)

Module is not inside a Node (Node must be marked by @node property in ned module)

每当我 运行 OMNet++ 模拟时,它都会给我一个 运行 时间异常

" Error in module (cModule) CompleteScenarioIncludingGateway (id=1) during network initialization: Module is not inside a Node (Node must be marked by @node property in ned module)."

我想知道这是什么意思以及如何解决。

代表网络中节点的每个模块(例如主机、路由器)都应标有@node 属性(在最新版本的 INET 中,它被称为@networkNode 而不是@node)。这是在 INET 的 NodeBase.ned:

中是如何完成的
module NodeBase like INetworkNode
{
    parameters:
        @networkNode
        @display("bgb=,448");
        ...

@networkNode 实际上是一个标记,因此放置在节点内的任何模块都可以在模块父链中向上移动,并找到哪个模块代表它所在的实际主机。这有助于主机内的模块更容易地导航。例如,如果一个模块对主机的物理位置感兴趣,它就开始在模块链上向上移动,并每次检查这个模块是否有@networkNode 属性。如果有,那么按照惯例,它应该有一个名为 "mobility" 的子模块,可用于检索位置。