cohydra.node.base¶
Base abstract class for a node.
Classes
A node represents a computer in the simulation. |
-
class
cohydra.node.base.
Node
(name)[source]¶ Bases:
object
A node represents a computer in the simulation.
It has a unique name.
- Parameters
name (str) – A unique name for this node.
-
channels
= None¶ The cannels the node is connected to.
-
name
= None¶ The name of the node.
-
ns3_node
= None¶ The ns-3 internal node.
-
position
= None¶ The position of the node (used by wifi models and visualization)
-
color
= None¶ The color of the node used in the visualization.
-
interfaces
= None¶ The interfaces (~network cards) of this node.
-
command_executor
= None¶ The command executor for running (shell) commands.
-
set_position
(x, y, z=0)[source]¶ Set the position of the node and updates the mobitlity model.
- Parameters
x (float) – The x-position.
y (float) – The y-position.
z (float) – The z-position.
-
add_interface
(interface, name=None, prefix='eth')[source]¶ Add an interface to the node.
- Warning: Do not call this function manually.
The functionality is handled by the network and channels.
- Parameters
interface (
Interface
) – The interface to add.name (str) – The name of the interface.
prefix (str) – If no name is supplied, the function works out a name by appending a number to the prefix.
-
prepare
(simulation)[source]¶ Do all neccesary steps to prepare a node for the simulation.
- Parameters
simulation (
Simulation
) – The simulation to prepare the node for.
-
wants_ip_stack
()[source]¶ Indicates whether a IP stack shall be installed onto the node.
Installing is handled by the Channel.
- Returns
True
indicates that a ns-3 IP stack shall be installed when preparing this node.- Return type
bool
Inheritance Diagramm