Model

class NetworkSim.architecture.setup.model.Model(control_signal=None, data_signal=None, network=None, abstract=True, bidirectional=False)[source]

Constructor for model.

The model includes network, node and signal definitions.

Parameters
  • control_signal (ControlSignal, optional) – The control signal definition. Default is ControlSignal().

  • data_signal (DataSignal, optional) – The data signal definition. Default is DataSignal().

  • network (Network, optional) – The network definition. Default is Network().

  • abstract (bool) – Abstract representation of control and data packets. Default is True.

  • bidirectional (bool, optional) – The type of network architecture, either bidirectional or unidirectional. Default is False, which is unidirectional.

Variables
  • nodes (list) – A list containing the nodes in the model

  • data_rings (list) – A list containing the data rings in the model

  • control_ring (Ring) – The control ring in the network. The ring_id of this ring is -1.

  • constants (dict) –

    A dictionary containing:

    • speed : speed of light in the fibre, in m/s

    • maximum_bit_rate : maximum bit rate of each channel, in Gbit/s

    • average_bit_rate : average bit rate of each channel, in Gbit/s

    • data_guard_interval : guard interval of data packets, in ns

    • control_guard_interval : guard interval of control packets, in ns

    • tuning_time : tuning time of the receiver, in ns

  • data_packet_duration (float) – The total duration of the data packet, including the guard interval.

  • circulation_time (float) – The time for one complete circulation around the ring.

  • max_data_packet_num_on_ring (int) – The maximum number of data packets a ring can contain.

generate_control_ring()[source]

Generate a control ring based on the network configuration.

Returns

control_ring – List of Ring objects.

Return type

Ring

generate_data_rings()[source]

Generate a list of data rings based on the network configuration.

Returns

data_rings – List of Ring objects.

Return type

list

generate_nodes()[source]

Generate a list of nodes based on the network configuration.

Returns

nodes – List of Node objects.

Return type

list

generate_reversed_data_rings()[source]

Generate a list of data rings in the reversed transmission direction based on the network configuration.

Returns

data_rings – List of Ring objects with reversed=True.

Return type

list

get_circulation_time()[source]

Calculate time for a signal to circulate around the ring once.

Returns

circulation_time – The time taken for one circulation, in ns.

Return type

float

get_data_packet_duration()[source]

Calculation of the duration of a data packet excluding guard interval

Returns

packet_duration – Duration of the data packet, in ns

Return type

float

get_data_packet_total_duration()[source]

Calculation of the duration of a data packet including guard interval

Returns

total_duration – Duration of the data packet with guard interval, in ns

Return type

float

get_max_control_packet_num_between_nodes()[source]

Obtain the maximum number of control packets that can be fitted between two nodes.

Returns

max_packet_num_between_node – The maximum number of packets allowed between two nodes.

Return type

int

get_max_control_packet_num_on_ring()[source]

Obtain the maximum number of control packets that can be fitted in the ring.

Returns

max_packet_num – The maximum number of packets allowed.

Return type

int

get_max_data_packet_num_on_ring()[source]

Obtain the maximum number of data packets that can be fitted in the ring.

Returns

max_packet_num – The maximum number of packets allowed.

Return type

int