Explicitly consider "system margins" instead of stashing them to transponder modes

Since 30234f913c, the code just added the
"system margins" to each transponder's minimal required OSNR. That's
simple and straightforward, but I think that mutating "equipment
library" in response to a "global simulation parameter" is not really
the right way to go.

Make this explicit; always check the resulting OSNR against the
transponder's minimum plus the margin.

I got into this when checking the fixups that are performed within the
JSON loader. I don't think that the JSON loader is an appropriate place
for this.

Change-Id: Ic8f8385cbbb29dc0d769462f17caad47c2b36940
This commit is contained in:
Jan Kundrát
2020-09-15 00:00:26 +02:00
parent e13d27c1f5
commit e6ee512001
3 changed files with 9 additions and 15 deletions

View File

@@ -410,7 +410,8 @@ def path_requests_run(args=None):
f'-', f'{rqs[i].blocking_reason}']
except AttributeError:
line = [f'{rqs[i].request_id}', f' {rqs[i].source} to {rqs[i].destination} : ', psnrb,
psnr, f'{rqs[i].OSNR}', f'{rqs[i].tsp_mode}', f'{round(rqs[i].path_bandwidth * 1e-9,2)}',
psnr, f'{rqs[i].OSNR + equipment["SI"]["default"].sys_margins}',
f'{rqs[i].tsp_mode}', f'{round(rqs[i].path_bandwidth * 1e-9,2)}',
f'{ceil(rqs[i].path_bandwidth / rqs[i].bit_rate) }', f'({rqs[i].N},{rqs[i].M})']
data.append(line)

View File

@@ -230,14 +230,6 @@ def load_equipment(filename):
return _equipment_from_json(json_data, filename)
def _update_trx_osnr(equipment):
"""add sys_margins to all Transceivers OSNR values"""
for trx in equipment['Transceiver'].values():
for m in trx.mode:
m['OSNR'] = m['OSNR'] + equipment['SI']['default'].sys_margins
return equipment
def _update_dual_stage(equipment):
edfa_dict = equipment['Edfa']
for edfa in edfa_dict.values():
@@ -298,7 +290,6 @@ def _equipment_from_json(json_data, filename):
equipment[key][subkey] = RamanFiber(**entry)
else:
raise EquipmentConfigError(f'Unrecognized network element type "{key}"')
equipment = _update_trx_osnr(equipment)
equipment = _update_dual_stage(equipment)
_roadm_restrictions_sanity_check(equipment)
return equipment

View File

@@ -375,7 +375,8 @@ def propagate_and_optimize_mode(path, req, equipment):
path[-1].update_snr(this_mode['tx_osnr'], equipment['Roadm']['default'].add_drop_osnr)
else:
path[-1].update_snr(this_mode['tx_osnr'])
if round(min(path[-1].snr + lin2db(this_br / (12.5e9))), 2) > this_mode['OSNR']:
if round(min(path[-1].snr + lin2db(this_br / (12.5e9))), 2) \
> this_mode['OSNR'] + equipment['SI']['default'].sys_margins:
return path, this_mode
else:
last_explored_mode = this_mode
@@ -1092,11 +1093,11 @@ def compute_path_with_disjunction(network, equipment, pathreqlist, pathlist):
# baud_rate was defined
propagate(total_path, pathreq, equipment)
temp_snr01nm = round(mean(total_path[-1].snr+lin2db(pathreq.baud_rate/(12.5e9))), 2)
if temp_snr01nm < pathreq.OSNR:
if temp_snr01nm < pathreq.OSNR + equipment['SI']['default'].sys_margins:
msg = f'\tWarning! Request {pathreq.request_id} computed path from' +\
f' {pathreq.source} to {pathreq.destination} does not pass with' +\
f' {pathreq.tsp_mode}\n\tcomputedSNR in 0.1nm = {temp_snr01nm} ' +\
f'- required osnr {pathreq.OSNR}'
f'- required osnr {pathreq.OSNR} + {equipment["SI"]["default"].sys_margins} margin'
print(msg)
LOGGER.warning(msg)
pathreq.blocking_reason = 'MODE_NOT_FEASIBLE'
@@ -1139,11 +1140,12 @@ def compute_path_with_disjunction(network, equipment, pathreqlist, pathlist):
propagated_reversed_path = rev_p
temp_snr01nm = round(mean(propagated_reversed_path[-1].snr +\
lin2db(pathreq.baud_rate/(12.5e9))), 2)
if temp_snr01nm < pathreq.OSNR:
if temp_snr01nm < pathreq.OSNR + equipment['SI']['default'].sys_margins:
msg = f'\tWarning! Request {pathreq.request_id} computed path from' +\
f' {pathreq.source} to {pathreq.destination} does not pass with' +\
f' {pathreq.tsp_mode}\n' +\
f'\tcomputedSNR in 0.1nm = {temp_snr01nm} - required osnr {pathreq.OSNR}'
f'\tcomputedSNR in 0.1nm = {temp_snr01nm} -' \
f' required osnr {pathreq.OSNR} + {equipment["SI"]["default"].sys_margins} margin'
print(msg)
LOGGER.warning(msg)
# TODO selection of mode should also be on reversed direction !!