IClock

Package: inet.clock.contract

IClock

module interface

This module interface is implemented by clock models. Clocks are typically modules, and are used by other modules via direct C++ method calls.

The IClock C++ interface provides an API similar to the standard OMNeT++ simulation time based scheduling mechanism but relies on the underlying clock implementation for (re)scheduling events according to the clock. These events are transparently scheduled for the client module and will be delivered to it when the clock timer expires.

The typical way to use clock modules is to include a clock submodule somewhere in the model (e.g. in the network interfaces, in the network nodes) and add optional module parameters (i.e. module path to the clock module) to modules using the clock.

For example, having a clock submodule in the model of a network interface and using it for all timing (instead of the standard OMNeT++ simulation time based scheduling mechanism) allows for modeling clock skew and clock drift and their effect on the link layer protocol performance.

See also: IOscillator

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Implemented by

Name Type Description
IdealClock compound module

Models a clock where the clock time is identical to the simulation time.

MultiClock compound module

This module contains several subclocks and also implements the clock module interface itself. It exposes the currently active clock to its users. The active clock can be changed programmatically. This module is primarily useful for multi domain gPTP time synchronization.

OscillatorBasedClock compound module (no description)
SettableClock compound module

Models a clock which can be set to a different clock time. The clock time can be set from C++ or using a <set-clock module="..." time="..."/> command in a ScenarioManager script.

Used in compound modules

Name Type Description
EthernetSwitch compound module

Model of an Ethernet switch.

MultiClock compound module

This module contains several subclocks and also implements the clock module interface itself. It exposes the currently active clock to its users. The active clock can be changed programmatically. This module is primarily useful for multi domain gPTP time synchronization.

NetworkInterface compound module

This module serves as the base module for all network interfaces.

NodeBase compound module

This module contains the most basic infrastructure for network nodes that is not strictly communication protocol related.

Properties

Name Value Description
display i=block/timer

Source code

//
// This module interface is implemented by clock models. Clocks are typically
// modules, and are used by other modules via direct C++ method calls.
//
// The IClock C++ interface provides an API similar to the standard OMNeT++
// simulation time based scheduling mechanism but relies on the underlying
// clock implementation for (re)scheduling events according to the clock.
// These events are transparently scheduled for the client module and will be
// delivered to it when the clock timer expires.
//
// The typical way to use clock modules is to include a clock submodule somewhere
// in the model (e.g. in the network interfaces, in the network nodes) and add
// optional module parameters (i.e. module path to the clock module) to modules
// using the clock.
//
// For example, having a clock submodule in the model of a network interface
// and using it for all timing (instead of the standard OMNeT++ simulation time
// based scheduling mechanism) allows for modeling clock skew and clock drift
// and their effect on the link layer protocol performance.
//
// @see ~IOscillator
//
moduleinterface IClock
{
    parameters:
        @display("i=block/timer");
}

File: src/inet/clock/contract/IClock.ned