mnoptical.node

Module Contents

Classes

Node

LineTerminal

Transceiver

OpticalSignal

Roadm

This implementation of Reconfigurable Optical Add/Drop Multiplexing nodes considers

Amplifier

Attenuator

Monitor

This implementation of Monitors could be used for ROADMs and Amplifiers.

SignalTracing

Routines for Signal tracing and debugging

NodeAuditing

WIP: Auditing class with propagation checks

Attributes

SwitchRule

class mnoptical.node.Node(name, debugger=None)

Bases: object

input_port_base = 0
output_port_base = 0
debugger = True
set_output_port(dst_node, link, output_port=-1)
set_input_port(src_node, link, input_port=-1)
include_optical_signal_in(optical_signal, power=None, ase_noise=None, nli_noise=None, in_port=0)
Parameters:
  • optical_signal – OpticalSignal object, OpticalSignal uid

  • power – power level of OpticalSignal

  • ase_noise – ase noise level of OpticalSignal

  • nli_noise – nli noise level of OpticalSignal

  • in_port – input port of node (optional)

include_optical_signal_out(optical_signal, power=None, ase_noise=None, nli_noise=None, out_port=None)
Parameters:
  • optical_signal – OpticalSignal object

  • power – power level of OpticalSignal

  • ase_noise – ase noise level of OpticalSignal

  • nli_noise – nli noise level of OpticalSignal

  • out_port – output port of node (optional)

remove_optical_signal(optical_signal)
remove_signal_from_out_port(port_out, optical_signal)
reset_component()

reset the dynamic attributes from node

describe()
__repr__()

Human-readable representation

class mnoptical.node.LineTerminal(name, transceivers=None, monitor_mode='out', debugger=False)

Bases: Node

monitor_query()
get_optical_signals()

Get all optical signals by looking into the Transceiver objects

reset_transceivers()

Disassociate signals from all transceivers

reset()

Remove all optical signals from the LineTerminal, and reset dynamic data structures

add_transceivers(transceivers)

For-loop for adding transceivers to LT :param transceivers: list of tuples (t_name, operational_power, spectrum band) :return:

existing_transceiver(transceiver)
add_transceiver(transceiver)

Add a new transceiver to the Terminal :return: added transceiver

set_modulation_format(transceiver, modulation_format, tx=False)

Update the modulation format of a transceiver :param transceiver: transmit transceiver object to configure :param modulation_format: string, i.e., ‘16_QAM’ (see units.py) :return:

tx_config(transceiver, operational_power_dBm)

Configure the operational power of the transceiver

assoc_tx_to_channel(transceiver, channel, out_port=-1)

Configures a Terminal by associating a transmission (tx) transceiver to a channel (int); the out_port is previously defined at Network creation :param transceiver: transceiver to use for transmission :param channel: the channel to be transmitted :param out_port: input port to terminal, -1 if none. :return: associate a transceiver to an optical signal

assoc_channel(transceiver, channel, out_port)
disassoc_tx_to_channel(out_port)

Disassociate a transmitter transceiver (tx) to an output port

assoc_rx_to_channel(transceiver, channel_id, in_port)

Associate a receiver transceiver (rx) to a signal at an input port :param transceiver: Transceiver object :param channel_id: int of channel index :param in_port: int, input port

disassoc_rx_to_channel(in_port, channel_id)

Disassociate a receiver transceiver (rx) to an input port :param in_port: int, input port

turn_on(safe_switch=False)

Propagate signals to the link that the transceivers point to Note: This configuration does not support connecting LT to multiple ROADMs

turn_off(ports_out)
static osnr(power, ase_noise)
static gosnr(power, ase_noise, nli_noise, baud_rate)
receiver(optical_signal, in_port)

Will verify that the signal can be received, then compute the OSNR and gOSNR levels of the signal, and will do a callback to dataplane (if run in emulation mode). :param optical_signal: OpticalSignal object :param in_port: int, input port

receiver_callback(in_port, signalDictInfo)
class mnoptical.node.Transceiver(tr_id, name, operation_power=0, channel_spacing_nm=0.4 * 1e-09, channel_spacing_H=50000000000.0, bandwidth=2.99792458 * 1000000000.0, modulation_format='16QAM', bits_per_symbol=4.0, symbol_rate=32000000000.0, rx_threshold_dB=20.0)

Bases: object

assoc_optical_signal(optical_signal)
remove_optical_signal()
set_modulation_format(modulation_format, tx)

Update modulation format, bits per symbol, symbol rate and rx-threshold based on a modulation format label (i.e., 16QAM). :param modulation_format: string i.e., ‘16QAM’ (see units.py) :param tx: boolean; True if transceiver is a transmitter

describe()
class mnoptical.node.OpticalSignal(index, channel_spacing_H, channel_spacing_nm, modulation_format, symbol_rate, bits_per_symbol, power=0, ase_noise=0, nli_noise=0)

Bases: object

spectrum_band_init_nm = 1567.132556194459
spectrum_band_init_H = 191300000000000.0
describe()
__repr__()

Return repr(self).

assoc_loc_in(loc, power=None, ase_noise=None, nli_noise=None)

Associate a location to signal performance values at the input interface of this point :param loc: location (i.e., node, span) :param power: power levels [mW] (or None for default/launch state) :param ase_noise: ase levels [mW] (or None for default/launch state) :param nli_noise: nli levels [mW] (or None for default/launch state)

assoc_loc_out(loc, power=None, ase_noise=None, nli_noise=None)

Associate a location to signal performance values at the output interface of this point :param loc: location (i.e., node, span) :param power: power levels [mW] (or None for default/launch state) :param ase_noise: ase levels [mW] (or None for default/launch state) :param nli_noise: nli levels [mW] (or None for default/launch state)

reset(component=None)

Reset signal state, optionally preserving output state at originating component

set_modulation_format(modulation_format)
mnoptical.node.SwitchRule
class mnoptical.node.Roadm(name, insertion_loss_dB=17, reference_power_dBm=0, preamp=None, boost=None, monitor_mode=None, debugger=False)

Bases: Node

This implementation of Reconfigurable Optical Add/Drop Multiplexing nodes considers only common ports. That is, not including the internal connections between reconfiguration components (i.e., WSSs).

get_optical_signals()
reset()
monitor_query()
include_optical_signal_in(optical_signal, power=None, ase_noise=None, nli_noise=None, in_port=0)

Include optical signals in preamp if object exists, and include input signals at a Node level :param optical_signal: OpticalSignal object :param in_port: int, input port

remove_switch_rule(rule_in_port, rule_signal_index, rule_out_port)

Removes a switch rule from switch_table and removes the signal object from the output port to model blocking

check_switch_rule(in_port, out_port, signal_indices)

Check if there are conflicting rules switching signals with equal frequencies on the same output port. If so, delete the previously allocated rule, and remove the signal from the output port and propagate this removal (modeling blocking that signal and cleaning the data structures). :param in_port: int, input port :param out_port: int, output port :param signal_indices: int or list, signal indices

install_switch_rule(in_port, out_port, signal_indices, src_node=None)

Switching rule installation, accessible from a Control System :param in_port: input port for incoming signals :param out_port: switching/output port for incoming signals :param signal_indices: int or list, signal index or indices :param src_node: source node :return:

update_switch_rule(in_port, signal_index, new_port_out, switch=False)

Update/create a new rule for switching :param in_port: int, input port of existing rule :param signal_index: int, signal index of existing rule :param new_port_out: int, new output port :param switch: boolean, specify if we want to switch

to avoid unecessary switching checkups in self.can_switch()

delete_switch_rule(in_port, signal_index, switch=False)

Delete a switch rule from switch_table and remove the signal(s) associated with that rule at a Node level. Then switch. Switch rules are identified by in_port and signal_index :param in_port: int, input port associated with switch rule :param signal_index: int, signal index associated with switch rule :param switch: boolean, , specify if we want to switch

to avoid unecessary switching checkups in self.can_switch()

delete_switch_rules()

Delete all switching rules

power_divergence(optical_signals, in_port)

Check if the power state of the incoming signals to be switched are different from the previous power state at the same input port

get_in_port(optical_signal, out_port)
can_switch(in_port, safe_switch)

Check if switching is possible (i.e., no loops) :param in_port: int, input port triggering switching :param safe_switch: boolean, indicates whether it needs

to check for switch feasibility.

can_switch_from_lt(src_node, safe_switch)

Check all input ports for signals coming from a LineTerminal. :param src_node: LineTerminal object :param safe_switch: boolean, indicates whether it needs

to check for switch feasibility.

switch(in_port, src_node, safe_switch=False)

Check for switch feasibility Prepare switch internal configuration (i.e., preamp) Propagate (physical layer simulation) Route (relay signals to next Link) :param in_port: int, input port triggering switching :param src_node: LineTerminal, ROADM or Amplifier object :param safe_switch: boolean, indicates whether it needs

to check for switch feasibility.

Note: check for switch feasibility unless performing tasks

independent of switching (i.e., EDFA gain configuration).

prepropagation(port_out_to_port_in_signals, src_node)

Preparing structures for propagation :param port_out_to_port_in_signals: dict, hash of switch rules :param src_node: LineTerminal, ROADM or Amplifier object

compute_carrier_attenuation(in_port, amp=None)

Compute the total power at an input port, and use it to compute the carriers attenuation :param in_port: int, input port for total power calculation :param amp: Amplifier object, if there are boost and preamp

the signals are contained within these objects

process_att(out_port, in_port, optical_signals, src_node, dst_node, link, amp=None)

Compute the attenuation effects at the ROADM :param out_port: int, output port (direction of signals) :param in_port: int, input port (direction of signals) :param optical_signals: list of optical signals :param src_node: LineTerminal or Amplifier object :param dst_node: LineTerminal or Amplifier object :param link: Link object (direction of signals) :param amp: Amplifier object, if there are boost and preamp

the signals are contained within these objects

propagate(out_port, in_port, optical_signals)

Compute physical layer simulation for one direction given by the out_port :param out_port: int, output port (direction of signals) :param in_port: int, input port (direction of signals) :param optical_signals: list of optical signals

route(out_port, safe_switch)

Calling route will continue to propagate the signals in this link :param out_port: int, output port indicating direction :param safe_switch: boolean, indicates whether it needs

to check for switch feasibility.

set_boost_gain(gain_dB)

Configure the gain of the boost amplifier and call fast_switch() :param gain_dB: int or float, gain to set

set_preamp_gain(gain_dB)

Configure the gain of the preamp amplifier and call fast_switch() :param gain_dB: int or float, gain to set

set_reference_power(ref_power_dBm, ch_index=None)

Configure the reference power for ROADM to act upon, similar to setting a VOA reference power. and call fast_switch() :param gain_dB: int or float, gain to set

fast_switch()

Call switch for all switching rules with safe_switch=True

class mnoptical.node.Amplifier(name, amplifier_type='EDFA', target_gain=17.6, noise_figure=(5.5, 91), noise_figure_function=None, bandwidth=32000000000.0, wdg_id='linear', preamp=False, boost=False, monitor_mode=None, debugger=False)

Bases: Node

reset()
monitor_query()
reset_gain()
power_excursions_flags_off()
load_wavelength_dependent_gain(wdg_id)
Parameters:

wdg_id – file name id (see top of script) - string

Returns:

Return wavelength dependent gain array

set_ripple_function(wdg_id)

Update attribute self.wavelength_dependent_gain with wdg_id

get_wavelength_dependent_gain(signal_index)

Retrieve WDG by signal index :param signal_index: :return: WDG of signal

static get_noise_figure(noise_figure, noise_figure_function)

If noise figure is not passed as a function, create one with constant values from established NF (default value is 6 dB) :param noise_figure: tuple with NF value in dB and number of channels (def. 90) :param noise_figure_function: custom NF function with values in dB :return:

output_amplified_power(optical_signal)

Compute the output power levels of each signal after amplification :param optical_signal: signal object

nli_compensation(optical_signal)

Apply the amplification effects to the NLI noise and update EDFA and OpticalSignal state date structures

stage_amplified_spontaneous_emission_noise(optical_signal)
Returns:

Ch.5 Eqs. 4-16,18 in: Gumaste A, Antony T. DWDM network designs and engineering solutions. Cisco Press; 2003.

compute_power_excursions(optical_signals)

Balance system gain with respect with the mean gain of the signals in the amplifier: power excursions :return:

propagate(optical_signals, is_last_port=False, safe_switch=False)

Compute the amplification process :param optical_signals: list

set_gain(gain_dB)

Configure the gain attributes

__repr__()

String representation

mock_amp_gain_adjust(new_gain)
class mnoptical.node.Attenuator(name, loss=1, noise_figure=(0.0, 91), monitor='in')

Bases: Amplifier

attenuation(optical_signal)
propagate(optical_signals, is_last_port=False, safe_switch=False)

Compute the amplification process :param optical_signals: list

class mnoptical.node.Monitor(name, component, mode='out')

Bases: Node

This implementation of Monitors could be used for ROADMs and Amplifiers. FIXME: implementation of ports for Monitors

modify_mode(mode)

Change the monitoring interface; options are ‘in’ and ‘out’

get_optical_signals(port=None)
Return power:

Returns Optical signals for the required objects

get_list_osnr()

Get the OSNR values at this OPM as a list of tuples (optical signal, OSNR)

get_dict_osnr()

Get the OSNR values at this OPM as a dictionary {optical signal: OSNR}

get_list_gosnr()

Get the gOSNR values at this OPM as a list of tuples (optical signal, gOSNR)

get_dict_gosnr()

Get the gOSNR values at this OPM as a dictionary {optical signal: gOSNR}

get_ber(ber_method=None)

AD: We need to check this function Get’s the bit error rate based on gOSNR :return: BitErrorRate at this OPM Calculates Bit Error Rate based on equations from F. Forghieri doi: 10.1109/JLT.1012.2.2189198

get_dict_power()

Get the power values at this OPM as a dict

get_power(optical_signal)
get_dict_ase_noise()

Get the ASE noise values at this OPM as a dict

get_ase_noise(optical_signal)
get_dict_nli_noise()

Get the NLI noise values at this OPM as a dict

get_nli_noise(optical_signal)
get_osnr(optical_signal)

Compute OSNR levels of the signal :param optical_signal: OpticalSignal object :return: OSNR (linear)

get_gosnr(optical_signal)

Compute gOSNR levels of the signal :param optical_signal: OpticalSignal object :return: gOSNR (linear)

__repr__()

Human-readable representation

class mnoptical.node.SignalTracing

Routines for Signal tracing and debugging

pathEntry
static get_port(node, signal, in_out='out')
static signal_path(node, signal)

Return signal path [node, link, node….] for signal, starting from node node: starting Node signal: OpticalSignal missing: value to return for missing state

static channel_paths(node, channel=None)

Return signal paths for channel node: starting Node channel: signal index to match (or None to match all) returns: [path,…]

static path_state(signal, path, missing=None)

Return signal’s state along a path

class mnoptical.node.NodeAuditing

WIP: Auditing class with propagation checks

static check_roadm_propagation(roadm)

Check ROADM propagation and report errors

Check link propagation and report errors