NodeBase

Package: inet.node.base

compound module NodeBase

The fundamental infrastructure for all network nodes focusing on non-communication aspects of network nodes.

It provides among others:

  • Node lifecycle management through NodeStatus

  • Optional local clock for modeling clock skew

  • Optional modules for with energy storage, management, and generation

  • Support for node mobility

NodeBase is not intended to be used directly in simulations but rather serves as a base module for more specialized node types that add communication capabilities.

See also: StandardHost, WirelessHost, AdhocHost, Router

NodeBasestatus: inet.common.lifecycle.NodeStatus Keeps track of the status of the network node (up, down, etc.) for other modules, and also displa... Source: status: NodeStatus if hasStatus { @display("p=125,80;is=s"); }statusclock: inet.clock.contract.IClock (like IClock) IClock: Interface for clock models. Source: clock: <default("")> like IClock if typename != "" { @display("p=125,320;is=s"); }clockenergyStorage: inet.power.contract.IEnergyStorage (like IEnergyStorage) IEnergyStorage: The energy storage models describe devices that absorb energy produced by generators, and provide... Source: energyStorage: <default("")> like IEnergyStorage if typename != "" { @display("p=125,400;is=s"); }energyStorageenergyManagement: inet.power.contract.IEnergyManagement (like IEnergyManagement) IEnergyManagement: The energy management models monitor an energy storage, estimate its state, and control the consu... Source: energyManagement: <default("")> like IEnergyManagement if typename != "" { @display("p=125,480;is=s"); }energyManagementenergyGenerator: inet.power.contract.IEnergyGenerator (like IEnergyGenerator) IEnergyGenerator: The energy generator models describe the energy generation process of devices over time. Source: energyGenerator: <default("")> like IEnergyGenerator if typename != "" { @display("p=125,560;is=s"); }energyGeneratormobility: inet.mobility.contract.IMobility (like IMobility) IMobility: The module interface for mobility models. Source: mobility: <default("")> like IMobility if typename != "" { @display("p=125,160;is=s"); }mobilitymeasurer: inet.common.IMeasurer (like IMeasurer) IMeasurer: Interface for all standalone measurement modules. Source: measurer: <default("")> like IMeasurer if typename != "" { @display("p=125,640;is=s"); }measurerenvironment: inet.common.ExternalEnvironment Executes a setup command on the host OS during initialization and another teardown command during... Source: environment: ExternalEnvironment if hasEnvironment { @display("p=125,800;is=s"); }environment

Usage diagram

Inheritance diagram

Known subclasses

Name

Type

Description

LinkLayerNodeBase

compound module

An extension of the basic node infrastructure with link layer functionality. Provides support for various network interfaces and link layer protocols, forming the foundation for network connectivity.

Extends

Name

Type

Description

Module

compound module

Base module for all INET compound modules.

Parameters

Name

Type

Default value

Description

displayStringTextFormat

string

“”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

hasStatus

bool

false

hasEnvironment

bool

false

osgModel

string

“”

3D model for OSG visualization, no 3D model by default

osgModelColor

string

“”

Tint color, no colorization by default

canvasImage

string

“”

Image for canvas visualization, no image by default

canvasImageColor

string

“”

Tint color, no colorization by default

Properties

Name

Value

Description

class

NodeBase

display

bgb=1256,1125

labels

node,ethernet-node,wireless-node

networkNode

Unassigned submodule parameters

Name

Type

Default value

Description

status.displayStringTextFormat

string

“{stateStr}”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

status.initialStatus

string

“UP”

Initial status of the network node

environment.displayStringTextFormat

string

“”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

environment.initStage

int

0

Initialization stage for the setup command

environment.globalNamespace

bool

false

Create new network namespaces under /var/run/netns/ (Linux only)

environment.namespace

string

“”

Name of the host OS network namespace (optional) (Linux only)

environment.setupCommand

string

“”

A host OS system command

environment.teardownCommand

string

“”

A host OS system command

Source code

//
// The fundamental infrastructure for all network nodes focusing on non-communication
// aspects of network nodes.
//
// It provides among others:
// - Node lifecycle management through NodeStatus
// - Optional local clock for modeling clock skew
// - Optional modules for with energy storage, management, and generation
// - Support for node mobility
//
// NodeBase is not intended to be used directly in simulations but rather serves
// as a base module for more specialized node types that add communication capabilities.
//
// @see ~StandardHost, ~WirelessHost, ~AdhocHost, ~Router
//
module NodeBase extends Module like INetworkNode
{
    parameters:
        @networkNode;
        @labels(node,ethernet-node,wireless-node);
        bool hasStatus = default(false);
        bool hasEnvironment = default(false);
        string osgModel = default(""); // 3D model for OSG visualization, no 3D model by default
        string osgModelColor = default(""); // Tint color, no colorization by default
        string canvasImage = default(""); // Image for canvas visualization, no image by default
        string canvasImageColor = default(""); // Tint color, no colorization by default
        mobility.subjectModule = default("^");
        *.mobilityModule = default(exists(mobility) ? absPath(".mobility") : "");
        *.energySourceModule = default(exists(energyStorage) ? absPath(".energyStorage") : "");
        *.energyGeneratorModule = default(exists(energyGenerator) ? absPath(".energyGenerator") : "");
        *.clockModule = default(exists(clock) ? absPath(".clock") : "");
        @class(NodeBase);
        @display("bgb=1256,1125");
    submodules:
        status: NodeStatus if hasStatus {
            @display("p=125,80;is=s");
        }
        clock: <default("")> like IClock if typename != "" {
            @display("p=125,320;is=s");
        }
        energyStorage: <default("")> like IEnergyStorage if typename != "" {
            @display("p=125,400;is=s");
        }
        energyManagement: <default("")> like IEnergyManagement if typename != "" {
            @display("p=125,480;is=s");
        }
        energyGenerator: <default("")> like IEnergyGenerator if typename != "" {
            @display("p=125,560;is=s");
        }
        // TODO move mobility right after the status to have it in the same order as their positions, it changes fingerprints
        mobility: <default("")> like IMobility if typename != "" {
            @display("p=125,160;is=s");
        }
        measurer: <default("")> like IMeasurer if typename != "" {
            @display("p=125,640;is=s");
        }
        environment: ExternalEnvironment if hasEnvironment {
            @display("p=125,800;is=s");
        }
}

File: src/inet/node/base/NodeBase.ned