From 928bc42cb9e3336525e04e4f95640d1e66de5dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20M=C3=A5rtensson?= Date: Thu, 8 Oct 2020 14:15:18 +0200 Subject: [PATCH 1/2] Fix calculation of gain for first Edfa after Roadm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See issue reported in #360 In autodesign, currently the calculation of gain for the first Edfa after a Roadm is incorrect when the reference channel power is different from 0 dBm. The bug is somewhat hidden by the fact that the gain is anyway updated during propagation in power mode, taking the reference channel power into account. But the gain reported by the to_json function of Edfa elements before propagation will be wrong. And more seriously, the incorrect gain will impact the Edfa selection in autodesign. Change-Id: I004de102832c3a0786435e21e71b0444d8901604 Signed-off-by: Jonas MÃ¥rtensson --- gnpy/core/network.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gnpy/core/network.py b/gnpy/core/network.py index 398ff86b..0db43626 100644 --- a/gnpy/core/network.py +++ b/gnpy/core/network.py @@ -239,7 +239,7 @@ def set_amplifier_voa(amp, power_target, power_mode): amp.out_voa = voa -def set_egress_amplifier(network, this_node, equipment, pref_total_db): +def set_egress_amplifier(network, this_node, equipment, pref_ch_db, pref_total_db): """ this node can be a transceiver or a ROADM (same function called in both cases) """ power_mode = equipment['Span']['default'].power_mode @@ -256,16 +256,16 @@ def set_egress_amplifier(network, this_node, equipment, pref_total_db): if this_node_degree: # find the target power on this degree if node.uid in this_node_degree.keys(): - prev_dp = this_node_degree[node.uid] + prev_dp = this_node_degree[node.uid] - pref_ch_db else: # if no target power is defined on this degree use the global one # if target_pch_out_db is not an attribute, then the element must be a transceiver - prev_dp = getattr(this_node.params, 'target_pch_out_db', 0) + prev_dp = getattr(this_node.params, 'target_pch_out_db', 0) - pref_ch_db this_node_degree[node.uid] = prev_dp else: # if no per degree target power is given use the global one # if target_pch_out_db is not an attribute, then the element must be a transceiver - prev_dp = getattr(this_node.params, 'target_pch_out_db', 0) + prev_dp = getattr(this_node.params, 'target_pch_out_db', 0) - pref_ch_db this_node_degree[node.uid] = prev_dp dp = prev_dp prev_voa = 0 @@ -484,10 +484,10 @@ def build_network(network, equipment, pref_ch_db, pref_total_db): roadms = [r for r in amplified_nodes if isinstance(r, elements.Roadm)] for roadm in roadms: - set_egress_amplifier(network, roadm, equipment, pref_total_db) + set_egress_amplifier(network, roadm, equipment, pref_ch_db, pref_total_db) # support older json input topology wo Roadms: if len(roadms) == 0: trx = [t for t in network.nodes() if isinstance(t, elements.Transceiver)] for t in trx: - set_egress_amplifier(network, t, equipment, pref_total_db) + set_egress_amplifier(network, t, equipment, 0, pref_total_db) From 3d5b1fcf64ad0a0bd871c9cc0b949c7af952e01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20M=C3=A5rtensson?= Date: Fri, 30 Oct 2020 09:57:52 +0100 Subject: [PATCH 2/2] Fix calculation of power target for Edfa in gain mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See GitHub issue #368 The out_voa attenuation of the previous Edfa is currently not taken into account when calculating power target for an Edfa in gain mode. This makes the calculated gain target (in case of autodesign) for the following Edfa in the chain incorrect and also impacts automatic amplifier selection. Change-Id: Idc473762ccf7b021a0885c7ce20de1abb66eb075 Signed-off-by: Jonas MÃ¥rtensson --- gnpy/core/network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnpy/core/network.py b/gnpy/core/network.py index 0db43626..32d6dc50 100644 --- a/gnpy/core/network.py +++ b/gnpy/core/network.py @@ -284,7 +284,7 @@ def set_egress_amplifier(network, this_node, equipment, pref_ch_db, pref_total_d gain_target = node_loss + dp - prev_dp + prev_voa else: # gain mode with effective_gain gain_target = node.effective_gain - dp = prev_dp - node_loss + gain_target + dp = prev_dp - node_loss - prev_voa + gain_target power_target = pref_total_db + dp