18 Commits

Author SHA1 Message Date
James Powell
c5a52fdb6d small setup.py fixes 2018-03-22 13:17:06 -04:00
James Powell
2dd096cfab bump version to v0.1.2 2018-03-22 13:07:58 -04:00
James Powell
80e1ce12ce bump version to v0.1.1 2018-03-22 13:04:00 -04:00
James Powell
2777d957e4 add long_description_content_type 2018-03-22 13:00:47 -04:00
James Powell
898aa4f41a space align __str__ output 2018-03-20 22:44:32 -04:00
James Powell
c9ece6ad7c use scipy.constants 2018-03-20 22:44:17 -04:00
James Powell
a6265c1b8d document modules 2018-03-20 21:32:02 -04:00
James Powell
5646714c13 small setup.py fixes 2018-03-16 16:45:18 -04:00
James Powell
8ab13537a9 prettier printing 2018-03-15 19:09:29 -04:00
James Powell
25e14e4846 fixed __repr__
__repr__ "should look like a valid Python expression that could be used
to recreate an object with the same value" - https://docs.python.org/3/reference/datamodel.html#object.__repr__
2018-03-15 18:29:26 -04:00
James Powell
55d67f890d clean up examples/ directory 2018-03-15 15:52:39 -04:00
James Powell
9b3d7614f5 remove unused network files 2018-03-15 15:50:17 -04:00
James Powell
a3273d24b5 doc fixes 2018-03-15 14:46:24 -04:00
James Powell
ffd7bec485 docs fix 2018-03-15 14:42:36 -04:00
James Powell
0aef76407d small documentation fixes 2018-03-15 14:35:34 -04:00
James Powell
f2ad236863 fix authors 2018-03-15 14:26:16 -04:00
James Powell
487237638e Merge branch 'develop' 2018-03-15 14:25:26 -04:00
James Powell
3a78ccafce add AUTHORS.rst 2018-03-15 14:18:34 -04:00
24 changed files with 356 additions and 8954 deletions

19
AUTHORS.rst Normal file
View File

@@ -0,0 +1,19 @@
gnpy is written and maintained by the Telecom Infra Project with work
contributed by the following TIP members.
To learn how to contribute, please see CONTRIBUTING.md
(*in alphabetical order*)
- Alessio Ferrari (Politecnico di Torino) <alessio.ferrari@polito.it>
- Brian Taylor (Facebook) <briantaylor@fb.com>
- David Boertjes (Ciena) <dboertje@ciena.com>
- Esther Le Rouzic (Orange) <esther.lerouzic@orange.com>
- Gabriele Galimberti (Cisco) <ggalimbe@cisco.com>
- Gert Grammel (Juniper Networks) <ggrammel@juniper.net>
- Gilad Goldfarb (Facebook) <giladg@fb.com>
- James Powell (Telecom Infra Project) <james.powell@telecominfraproject.com>
- Jeanluc Auge (Orange) <jeanluc.auge@orange.com>
- Mattia Cantono (Politecnico di Torino) <mattia.cantono@polito.it>
- Vittorio Curri (Politecnico di Torino) <vittorio.curri@polito.it>
- Xufeng Liu (Jabil) <xufeng_liu@jabil.com>

View File

@@ -1,17 +0,0 @@
Contributors in alphabetical order
==================================
Name | Surname | Affiliation | Contact
-----|---------|-------------|--------
Alessio | Ferrari | Politecnico di Torino | alessio.ferrari@polito.it
Brian | Taylor | Facebook | briantaylor@fb.com
David | Boertjes | Ciena | dboertje@ciena.com
Esther | Le Rouzic | Orange | esther.lerouzic@orange.com
Gabriele | Galimberti | Cisco | ggalimbe@cisco.com
Gert | Grammel | Juniper Networks | ggrammel@juniper.net
Gilad | Goldfarb | Facebook | giladg@fb.com
James | Powell | Consultant | james@dontusethiscode.com
Jeanluc | Auge | Orange | jeanluc.auge@orange.com
Liu | Xufeng | Jabil | Xufeng_Liu@jabil.com
Mattia | Cantono | Politecnico di Torino | mattia.cantono@polito.it
Vittorio | Curri | Politecnico di Torino | vittorio.curri@polito.it

View File

@@ -1,13 +1,13 @@
====
====================================================================
`gnpy`: mesh optical network route planning and optimization library
====
====================================================================
|docs| |build|
**gnpy is an open-source, community-developed library for building route planning
and optimization tools in real-world mesh optical networks.**
`gnpy <http://github.com/telecominfraproject/gnpy>`_ is:
`gnpy <http://github.com/telecominfraproject/gnpy>`__ is:
- a sponsored project of the `OOPT/PSE <http://telecominfraproject.com/project-groups-2/backhaul-projects/open-optical-packet-transport/>`_ working group of the `Telecom Infra Project <http://telecominfraproject.com>`_.
- fully community-driven, fully open source library
@@ -21,7 +21,7 @@ Documentation: https://gnpy.readthedocs.io
Installation
------------
``gnpy`` is hosted in the `Python Package Index <http://pypi.org/>`_ (`gnpy <https://pypi.org/project/gnpy/>`_). It can be installed via:
``gnpy`` is hosted in the `Python Package Index <http://pypi.org/>`_ (`gnpy <https://pypi.org/project/gnpy/>`__). It can be installed via:
.. code-block:: shell
@@ -114,7 +114,7 @@ See the `Onboarding Guide
<https://github.com/Telecominfraproject/gnpy/wiki/Onboarding-Guide>`_ for
specific details on code contribtions.
See `AUTHORS.Md <AUTHORS.Md>`_ for past and present contributors.
See `AUTHORS.rst <AUTHORS.rst>`_ for past and present contributors.
Project Background
------------------
@@ -187,5 +187,5 @@ License
``gnpy`` is distributed under a standard BSD 3-Clause License.
See `LICENSE <LICENSE>`_ for more details.
See `LICENSE <LICENSE>`__ for more details.

View File

@@ -1,17 +0,0 @@
Contributors in alphabetical order
==================================
Name | Surname | Affiliation | Contact
-----|---------|-------------|--------
Alessio | Ferrari | Politecnico di Torino | alessio.ferrari@polito.it
Brian | Taylor | Facebook | briantaylor@fb.com
David | Boertjes | Ciena | dboertje@ciena.com
Esther | Le Rouzic | Orange | esther.lerouzic@orange.com
Gabriele | Galimberti | Cisco | ggalimbe@cisco.com
Gert | Grammel | Juniper Networks | ggrammel@juniper.net
Gilad | Goldfarb | Facebook | giladg@fb.com
James | Powell | Consultant | james@dontusethiscode.com
Jeanluc | Auge | Orange | jeanluc.auge@orange.com
Liu | Xufeng | Jabil | Xufeng_Liu@jabil.com
Mattia | Cantono | Politecnico di Torino | mattia.cantono@polito.it
Vittorio | Curri | Politecnico di Torino | vittorio.curri@polito.it

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# GNpy documentation build configuration file, created by
# gnpy documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 18 14:41:01 2017.
#
# This file is execfile()d with the current directory set to its
@@ -47,8 +47,8 @@ source_suffix = ['.rst', '.md']
master_doc = 'index'
# General information about the project.
project = 'GNpy'
copyright = '2017, Telecom InfraProject - OOPT PSE Group'
project = 'gnpy'
copyright = '2018, Telecom InfraProject - OOPT PSE Group'
author = 'Telecom InfraProject - OOPT PSE Group'
# The version info for the project you're documenting, acts as replacement for
@@ -120,7 +120,7 @@ html_sidebars = {
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'GNpydoc'
htmlhelp_basename = 'gnpydoc'
# -- Options for LaTeX output ---------------------------------------------
@@ -147,7 +147,7 @@ latex_elements = {
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'GNpy.tex', 'GNpy Documentation',
(master_doc, 'gnpy.tex', 'gnpy Documentation',
'Telecom InfraProject - OOPT PSE Group', 'manual'),
]
@@ -157,7 +157,7 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'gnpy', 'GNpy Documentation',
(master_doc, 'gnpy', 'gnpy Documentation',
[author], 1)
]
@@ -168,8 +168,8 @@ man_pages = [
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'GNpy', 'GNpy Documentation',
author, 'GNpy', 'One line description of project.',
(master_doc, 'gnpy', 'gnpy Documentation',
author, 'gnpy', 'One line description of project.',
'Miscellaneous'),
]

View File

@@ -1,37 +1,33 @@
.. GNpy documentation master file, created by
.. gnpy documentation master file, created by
sphinx-quickstart on Mon Dec 18 14:41:01 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to GNpy's documentation!
Welcome to gnpy's documentation!
================================
Gaussian Noise (GN) based modeling library for physical layer impairment evaluation in optical networks.
**gnpy is an open-source, community-developed library for building route planning
and optimization tools in real-world mesh optical networks.**
Summary
--------
We believe that openly sharing ideas, specifications, and other intellectual property is the key to maximizing innovation and reducing complexity
PSE WG Charter
--------------
- Goal is to build an end-to-end simulation environment which defines the network models of the optical device transfer functions and their parameters. This environment will provide validation of the optical performance requirements for the TIP OLS building blocks.
- The model may be approximate or complete depending on the network complexity. Each model shall be validated against the proposed network scenario.
- The environment must be able to process network models from multiple vendors, and also allow users to pick any implementation in an open source framework.
- The PSE will influence and benefit from the innovation of the DTC, API, and OLS working groups.
- The PSE represents a step along the journey towards multi-layer optimization.
`gnpy <http://github.com/telecominfraproject/gnpy>`_ is:
- a sponsored project of the `OOPT/PSE <http://telecominfraproject.com/project-groups-2/backhaul-projects/open-optical-packet-transport/>`_ working group of the `Telecom Infra Project <http://telecominfraproject.com>`_.
- fully community-driven, fully open source library
- driven by a consortium of operators, vendors, and academic researchers
- intended for rapid development of production-grade route planning tools
- easily extensible to include custom network elements
- performant to the scale of real-world mesh optical networks
Documentation
=============
The following pages are meant to describe specific implementation details and modeling assumptions behind GNpy.
The following pages are meant to describe specific implementation details and
modeling assumptions behind gnpy.
.. toctree::
:maxdepth: 2
gn_model
model
Indices and tables
==================
@@ -42,29 +38,44 @@ Indices and tables
Contributors in alphabetical order
==================================
+----------+------------+-----------------------+----------------------------+
| Name | Surname | Affiliation | Contact |
+==========+============+=======================+============================+
| Alessio | Ferrari | Politecnico di Torino | alessio.ferrari@polito.it |
+----------+------------+-----------------------+----------------------------+
| Brian | Taylor | Facebook | briantaylor@fb.com |
+----------+------------+-----------------------+----------------------------+
| David | Boertjes | Ciena | dboertje@ciena.com |
+----------+------------+-----------------------+----------------------------+
| Esther | Le Rouzic | Orange | esther.lerouzic@orange.com |
+----------+------------+-----------------------+----------------------------+
| Gabriele | Galimberti | Cisco | ggalimbe@cisco.com |
+----------+------------+-----------------------+----------------------------+
| Gert | Grammel | Juniper Networks | ggrammel@juniper.net |
+----------+------------+-----------------------+----------------------------+
| Gilad | Goldfarb | Facebook | giladg@fb.com |
+----------+------------+-----------------------+----------------------------+
| James | Powell | Consultant | james@dontusethiscode.com |
+----------+------------+-----------------------+----------------------------+
| Jeanluc | Auge | Orange | jeanluc.auge@orange.com |
+----------+------------+-----------------------+----------------------------+
| Mattia | Cantono | Politecnico di Torino | mattia.cantono@polito.it |
+----------+------------+-----------------------+----------------------------+
| Vittorio | Curri | Politecnico di Torino | vittorio.curri@polito.it |
+----------+------------+-----------------------+----------------------------+
+----------+------------+-----------------------+--------------------------------------+
| Name | Surname | Affiliation | Contact |
+==========+============+=======================+======================================+
| Alessio | Ferrari | Politecnico di Torino | alessio.ferrari@polito.it |
+----------+------------+-----------------------+--------------------------------------+
| Brian | Taylor | Facebook | briantaylor@fb.com |
+----------+------------+-----------------------+--------------------------------------+
| David | Boertjes | Ciena | dboertje@ciena.com |
+----------+------------+-----------------------+--------------------------------------+
| Esther | Le Rouzic | Orange | esther.lerouzic@orange.com |
+----------+------------+-----------------------+--------------------------------------+
| Gabriele | Galimberti | Cisco | ggalimbe@cisco.com |
+----------+------------+-----------------------+--------------------------------------+
| Gert | Grammel | Juniper Networks | ggrammel@juniper.net |
+----------+------------+-----------------------+--------------------------------------+
| Gilad | Goldfarb | Facebook | giladg@fb.com |
+----------+------------+-----------------------+--------------------------------------+
| James | Powell | Telecom Infra Project | james.powell@telecominfraproject.com |
+----------+------------+-----------------------+--------------------------------------+
| Jeanluc | Auge | Orange | jeanluc.auge@orange.com |
+----------+------------+-----------------------+--------------------------------------+
| Mattia | Cantono | Politecnico di Torino | mattia.cantono@polito.it |
+----------+------------+-----------------------+--------------------------------------+
| Vittorio | Curri | Politecnico di Torino | vittorio.curri@polito.it |
+----------+------------+-----------------------+--------------------------------------+
PSE WG Charter
--------------
- Goal is to build an end-to-end simulation environment which defines the
network models of the optical device transfer functions and their parameters.
This environment will provide validation of the optical performance
requirements for the TIP OLS building blocks.
- The model may be approximate or complete depending on the network complexity.
Each model shall be validated against the proposed network scenario.
- The environment must be able to process network models from multiple vendors,
and also allow users to pick any implementation in an open source framework.
- The PSE will influence and benefit from the innovation of the DTC, API, and
OLS working groups.
- The PSE represents a step along the journey towards multi-layer optimization.

View File

@@ -4,15 +4,15 @@ The QoT estimation in the PSE framework of TIP-OOPT
QoT-E including ASE noise and NLI accumulation
----------------------------------------------
The operations of PSE simulative framework are based on the capability to estimate the QoT of one
or more channels operating lightpaths over a given network route. For
backbone transport networks, we can suppose that transceivers are
operating polarization-division-multiplexed multilevel modulation
formats with DSP-based coherent receivers, including equalization. For
the optical links, we focus on state-of-the-art amplified and
uncompensated fiber links, connecting network nodes including ROADMs,
where add and drop operations on data traffic are performed. In such a
transmission scenario, it is well accepted
The operations of PSE simulative framework are based on the capability to
estimate the QoT of one or more channels operating lightpaths over a given
network route. For backbone transport networks, we can suppose that
transceivers are operating polarization-division-multiplexed multilevel
modulation formats with DSP-based coherent receivers, including equalization.
For the optical links, we focus on state-of-the-art amplified and uncompensated
fiber links, connecting network nodes including ROADMs, where add and drop
operations on data traffic are performed. In such a transmission scenario, it
is well accepted
:cite:`vacondio_nonlinear_2012,bononi_modeling_2012,carena_modeling_2012,mecozzi_nonlinear_2012,secondini_analytical_2012,johannisson_perturbation_2013,dar_properties_2013,serena_alternative_2013,secondini_achievable_2013,poggiolini_gn-model_2014,dar_accumulation_2014,poggiolini_analytical_2011,savory_approximations_2013,bononi_single-_2013,johannisson_modeling_2014`
to assume that transmission performances are limited by the amplified
spontaneous emission (ASE) noise generated by optical amplifiers and and
@@ -49,7 +49,6 @@ filtering effects. Note that for state-of-the art equipment, filtering
effects can be typically neglected over routes with few hops
:cite:`rahman_mitigation_2014,foggi_overcoming_2015`.
To properly estimate :math:`P_{\text{ch}}` and :math:`P_{\text{ASE}}`
the transmitted power at the beginning of the considered route must be
known, and losses and amplifiers gain and noise figure, including their
@@ -62,8 +61,10 @@ models have been proposed and validated in the technical literature
The decision about which model to test within the PSE activities was
driven by requirements of the entire PSE framework:
i. the model must be *local*, i.e., related individually to each network element (i.e. fiber span) generating NLI, independently of preceding and subsequent elements; and
ii. the related computational time must be compatible with interactive operations.
i. the model must be *local*, i.e., related individually to each network
element (i.e. fiber span) generating NLI, independently of preceding and
subsequent elements; and ii. the related computational time must be compatible
with interactive operations.
So, the choice fell on the Gaussian Noise
(GN) model with incoherent accumulation of NLI over fiber spans
@@ -79,46 +80,67 @@ for fiber types with chromatic dispersion roughly larger than 4
ps/nm/km, the analytical approximation ensures an excellent accuracy
with a computational time compatible with real-time operations.
The Gaussian Noise Model to evaluate the NLI
--------------------------------------------
As previously stated, fiber propagation of multilevel modulation formats relying on the polarization-division-multiplexing
generates impairments that can be summarized as a disturbance called nonlinear interference (NLI),
when exploiting a DSP-based coherent receiver, as in all state-of-the-art equipment.
From a practical point of view, the NLI can be modeled as an additive
Gaussian random process added by each fiber span, and whose strength depends on the cube of the input power spectral density and
on the fiber-span parameters.
Since the introduction in the market in 2007 of the first transponder based on such a transmission technique, the scientific
community has intensively worked to define the propagation behavior of such a trasnmission technique.
First, the role of in-line chromatic dispersion compensation has been investigated, deducing that besides being
not essential, it is indeed detrimental for performances :cite:`curri_dispersion_2008`.
Then, it has been observed that the fiber propagation impairments are practically summarized by the sole NLI, being all the other
phenomena compensated for by the blind equalizer implemented in the receiver DSP :cite:`carena_statistical_2010`.
Once these assessments have been accepted by the community, several prestigious research groups have started to work
on deriving analytical models able to estimating the NLI accumulation, and consequentially the generalized SNR that sets the BER,
according to the transponder BER vs. SNR performance.
Many models delivering different levels of accuracy have been developed and validated. As previously clarified, for the purposes
of the PSE framework, the GN-model with incoherent accumulation of NLI over fiber spans has been selected as adequate.
The reason for such a choice is first such a model being a "local" model, so related to each fiber spans, independently of
the preceding and succeeding network elements. The other model characteristic driving the choice is
the availability of a closed form for the model, so permitting a real-time evaluation, as required by the PSE framework.
For a detailed derivation of the model, please refer to :cite:`poggiolini_analytical_2011`, while a qualitative description
can be summarized as in the following.
The GN-model assumes that the channel comb propagating in the fiber is well approximated by unpolarized spectrally shaped
Gaussian noise. In such a scenario, supposing to rely - as in state-of-the-art equipment - on a receiver entirely compensating for linear propagation effects, propagation in the fiber only excites the four-wave mixing (FWM) process among the continuity of
the tones occupying the bandwidth. Such a FWM generates an unpolarized complex Gaussian disturbance in each spectral slot
that can be easily evaluated extending the FWM theory from a set of discrete tones - the standard FWM theory introduced back in the 90s by Inoue :cite:`Innoue-FWM`- to a continuity of tones, possibly spectrally shaped.
Signals propagating in the fiber are not equivalent to Gaussian noise, but thanks to the absence of in-line compensation for choromatic dispersion,
the become so, over short distances.
So, the Gaussian noise model with incoherent accumulation of NLI has estensively proved to be a quick yet accurate and conservative tool
to estimate propagation impairments of fiber propagation.
Note that the GN-model has not been derived with the aim of an *exact* performance estimation, but to pursue a conservative performance prediction. So, considering these characteristics, and the fact that the NLI is always a secondary effect with respect to the ASE noise accumulation, and - most importantly - that typically linear propagation parameters (losses, gains and noise figures) are known within
a variation range, a QoT estimator based on the GN model is adequate to deliver performance predictions in terms of a reasonable SNR range, rather than an exact value.
As final remark, it must be clarified that the GN-model is adequate to be used when relying on a relatively narrow bandwidth up to few THz. When exceeding such a bandwidth occupation, the GN-model must be generalized introducing the interaction with the Stimulated
Raman Scattering in order to give a proper estimation for all channels :cite:`cantono2018modeling`.
This will be the main upgrade required within the PSE framework.
As previously stated, fiber propagation of multilevel modulation formats
relying on the polarization-division-multiplexing generates impairments that
can be summarized as a disturbance called nonlinear interference (NLI), when
exploiting a DSP-based coherent receiver, as in all state-of-the-art equipment.
From a practical point of view, the NLI can be modeled as an additive Gaussian
random process added by each fiber span, and whose strength depends on the cube
of the input power spectral density and on the fiber-span parameters.
Since the introduction in the market in 2007 of the first transponder based on
such a transmission technique, the scientific community has intensively worked
to define the propagation behavior of such a trasnmission technique. First,
the role of in-line chromatic dispersion compensation has been investigated,
deducing that besides being not essential, it is indeed detrimental for
performances :cite:`curri_dispersion_2008`. Then, it has been observed that
the fiber propagation impairments are practically summarized by the sole NLI,
being all the other phenomena compensated for by the blind equalizer
implemented in the receiver DSP :cite:`carena_statistical_2010`. Once these
assessments have been accepted by the community, several prestigious research
groups have started to work on deriving analytical models able to estimating
the NLI accumulation, and consequentially the generalized SNR that sets the
BER, according to the transponder BER vs. SNR performance. Many models
delivering different levels of accuracy have been developed and validated. As
previously clarified, for the purposes of the PSE framework, the GN-model with
incoherent accumulation of NLI over fiber spans has been selected as adequate.
The reason for such a choice is first such a model being a "local" model, so
related to each fiber spans, independently of the preceding and succeeding
network elements. The other model characteristic driving the choice is the
availability of a closed form for the model, so permitting a real-time
evaluation, as required by the PSE framework. For a detailed derivation of the
model, please refer to :cite:`poggiolini_analytical_2011`, while a qualitative
description can be summarized as in the following. The GN-model assumes that
the channel comb propagating in the fiber is well approximated by unpolarized
spectrally shaped Gaussian noise. In such a scenario, supposing to rely - as in
state-of-the-art equipment - on a receiver entirely compensating for linear
propagation effects, propagation in the fiber only excites the four-wave mixing
(FWM) process among the continuity of the tones occupying the bandwidth. Such a
FWM generates an unpolarized complex Gaussian disturbance in each spectral slot
that can be easily evaluated extending the FWM theory from a set of discrete
tones - the standard FWM theory introduced back in the 90s by Inoue
:cite:`Innoue-FWM`- to a continuity of tones, possibly spectrally shaped.
Signals propagating in the fiber are not equivalent to Gaussian noise, but
thanks to the absence of in-line compensation for choromatic dispersion, the
become so, over short distances. So, the Gaussian noise model with incoherent
accumulation of NLI has estensively proved to be a quick yet accurate and
conservative tool to estimate propagation impairments of fiber propagation.
Note that the GN-model has not been derived with the aim of an *exact*
performance estimation, but to pursue a conservative performance prediction.
So, considering these characteristics, and the fact that the NLI is always a
secondary effect with respect to the ASE noise accumulation, and - most
importantly - that typically linear propagation parameters (losses, gains and
noise figures) are known within a variation range, a QoT estimator based on the
GN model is adequate to deliver performance predictions in terms of a
reasonable SNR range, rather than an exact value. As final remark, it must be
clarified that the GN-model is adequate to be used when relying on a relatively
narrow bandwidth up to few THz. When exceeding such a bandwidth occupation, the
GN-model must be generalized introducing the interaction with the Stimulated
Raman Scattering in order to give a proper estimation for all channels
:cite:`cantono2018modeling`. This will be the main upgrade required within the
PSE framework.
.. bibliography:: biblio.bib
.. bibliography:: biblio.bib

Binary file not shown.

View File

@@ -1,11 +0,0 @@
REGIONS = europe asia conus
TARGETS = $(foreach region,$(REGIONS),coronet.$(region).json)
all: $(TARGETS)
$(TARGETS): convert.py CORONET_Global_Topology.xls
python $< -f $(subst .json,,$(subst coronet.,,$@)) > $@
.PHONY: clean
clean:
-rm $(TARGETS) -f

View File

@@ -1,143 +0,0 @@
{
"networks": {
"network": [
{
"network-types": {
"tip-oopt-pse": {}
},
"network-id": "pt-to-pt",
"node": [
{
"node-id": "M_KMA",
"type":"roadm",
"termination-point": [
{
"tp-id": "1-2-1"
}
]
},
{
"node-id": "T_CAS",
"type":"roadm",
"termination-point": [
{
"tp-id": "2-1-1"
},
{
"tp-id": "2-3-1"
}
]
},
{
"node-id": "LA",
"type":"ila",
"termination-point": [
{
"tp-id": "3-2-1"
},
{
"tp-id": "3-4-1"
}
]
},
{
"node-id": "SR",
"type":"fused",
"termination-point": [
{
"tp-id": "4-3-1"
}
]
},
{
"node-id": "C",
"type":"ila",
"termination-point": [
{
"tp-id": "5-6-1"
}
]
},
{
"node-id": "N_KBE",
"type":"roadm",
"termination-point": [
{
"tp-id": "6-5-1"
},
{
"tp-id": "6-7-1"
}
]
},
{
"node-id": "N_KBA",
"type":"roadm",
"termination-point": [
{
"tp-id": "7-6-1"
}
]
}
],
"link": [
{
"link-id": "M_KMA,1-2-1,T_CAS,2-1-1",
"source": {
"source-node": "M_KMA",
"source-tp": "1-2-1"
}
"destination": {
"dest-node": "T_CAS",
"dest-tp": "2-1-1"
}
},
{
"link-id": "T_CAS,2-3-1,LA,3-2-1",
"source": {
"source-node": "T_CAS",
"source-tp": "2-3-1"
}
"destination": {
"dest-node": "LA",
"dest-tp": "3-2-1"
}
},
{
"link-id": "LA,3-4-1,SR,4-3-1",
"source": {
"source-node": "LA",
"source-tp": "3-4-1"
}
"destination": {
"dest-node": "SR",
"dest-tp": "4-3-1"
}
},
{
"link-id": "C,5-6-1,N_KBE,6-5-1",
"source": {
"source-node": "C",
"source-tp": "5-6-1"
}
"destination": {
"dest-node": "N_KBE",
"dest-tp": "6-5-1"
}
},
{
"link-id": "N_KBE,6-7-1,N_KBA,7-6-1",
"source": {
"source-node": "N_KBE",
"source-tp": "6-7-1"
}
"destination": {
"dest-node": "N_KBA",
"dest-tp": "7-6-1"
}
}
]
}
]
}
}

View File

@@ -1,157 +0,0 @@
{
"network_name": "pt to pt",
"nodes_elements":
[
{
"id":"M_KMA",
"type":"ROADM",
"metadata": {
"city":"M",
"region":"RLD",
"latitude":0,
"longitude":0
}
},
{
"id":"T_CAS",
"type":"ROADM",
"metadata": {
"city":"T",
"region":"RLD",
"latitude":0,
"longitude":0
}
},
{
"id":"LA",
"type":"ILA",
"metadata": {
"city":"LA",
"region":"RLD",
"latitude":0,
"longitude":0
}
},
{
"id":"SR",
"type":"fused",
"metadata": {
"city":"SR",
"region":"RLD",
"latitude":0,
"longitude":0
}
},
{
"id":"C",
"type":"ILA",
"metadata": {
"city":"C",
"region":"RLD",
"latitude":0,
"longitude":0
}
},
{
"id":"N_KBE",
"type":"ROADM",
"metadata": {
"city":"N",
"region":"RLD",
"latitude":0,
"longitude":0
}
},
{
"id":"N_KBA",
"type":"ROADM",
"metadata": {
"city":"N",
"region":"RLD",
"latitude":0,
"longitude":0
}
},
],
"OTS_elements":[
{
"id":1,
"source_id":"M_KMA",
"dest_id":"T_CAS",
"parameters_cable":{
"units":"km",
"length":60,
"id":"F060",
"type":"G652"
},
"parameters_east":{
"con_in":0.5,
"con_out":0.5,
"loss":16,
"pmd":2,
"fo_id":5
},
"parameters_west":{
"con_in":0.5,
"con_out":0.5,
"loss":15,
"pmd":2,
"fo_id":6
}
},
{
"id":2,
"source_id":"T_CAS",
"dest_id":"LA",
"parameters_cable":{
},
"parameters_east":{
},
"parameters_west":{
}
},
{
"id":3,
"source_id":"LA",
"dest_id":"SR",
"parameters_cable":{
},
"parameters_east":{
},
"parameters_west":{
}
},
{
"id":3,
"source_id":"SR",
"dest_id":"C",
"parameters_cable":{
},
"parameters_east":{
},
"parameters_west":{
}
},
{
"id":5,
"source_id":"C",
"dest_id":"N_KBE",
"parameters_cable":{
},
"parameters_east":{
},
"parameters_west":{
}
},
{
"id":6,
"source_id":"N_KBE",
"dest_id":"N_KBA",
"parameters_cable":{
},
"parameters_east":{
},
"parameters_west":{
}
},
]}

View File

@@ -1,162 +0,0 @@
#!/usr/bin/env python3
from sys import exit
try:
from xlrd import open_workbook
except ModuleNotFoundError:
exit('Required: `pip install xlrd`')
from argparse import ArgumentParser
from collections import namedtuple, Counter
from itertools import chain
from json import dumps
from uuid import uuid4
import math
import numpy as np
output_json_file_name = 'coronet_conus_example.json'
Node = namedtuple('Node', 'city state country region latitude longitude')
class Link(namedtuple('Link', 'from_city to_city distance distance_units')):
def __new__(cls, from_city, to_city, distance, distance_units='km'):
return super().__new__(cls, from_city, to_city, distance, distance_units)
def define_span_range(min_span, max_span, nspans):
srange = (max_span - min_span) + min_span*np.random.rand(nspans)
return srange
def amp_spacings(min_span,max_span,length):
nspans = math.ceil(length/100)
spans = define_span_range(min_span, max_span, nspans)
tot = spans.sum()
delta = length -tot
if delta > 0 and delta < 25:
ind = np.where(np.min(spans))
spans[ind] = spans[ind] + delta
elif delta >= 25 and delta < 40:
spans = spans + delta/float(nspans)
elif delta > 40 and delta < 100:
spans = np.append(spans,delta)
elif delta > 100:
spans = np.append(spans, [delta/2, delta/2])
elif delta < 0:
spans = spans + delta/float(nspans)
return list(spans)
def parse_excel(args):
with open_workbook(args.workbook) as wb:
nodes_sheet = wb.sheet_by_name('Nodes')
links_sheet = wb.sheet_by_name('Links')
# sanity check
header = [x.value.strip() for x in nodes_sheet.row(4)]
expected = ['City', 'State', 'Country', 'Region', 'Latitude', 'Longitude']
if header != expected:
raise ValueError(f'Malformed header on Nodes sheet: {header} != {expected}')
nodes = []
for row in all_rows(nodes_sheet, start=5):
nodes.append(Node(*(x.value for x in row)))
# sanity check
header = [x.value.strip() for x in links_sheet.row(4)]
expected = ['Node A', 'Node Z', 'Distance (km)']
if header != expected:
raise ValueError(f'Malformed header on Nodes sheet: {header} != {expected}')
links = []
for row in all_rows(links_sheet, start=5):
links.append(Link(*(x.value for x in row)))
# sanity check
all_cities = Counter(n.city for n in nodes)
if len(all_cities) != len(nodes):
ValueError(f'Duplicate city: {all_cities}')
if any(ln.from_city not in all_cities or
ln.to_city not in all_cities for ln in links):
ValueError(f'Bad link.')
return nodes, links
parser = ArgumentParser()
parser.add_argument('workbook', nargs='?', default='CORONET_Global_Topology.xls')
parser.add_argument('-f', '--filter-region', action='append', default=[])
all_rows = lambda sh, start=0: (sh.row(x) for x in range(start, sh.nrows))
def midpoint(city_a, city_b):
lats = city_a.latitude, city_b.latitude
longs = city_a.longitude, city_b.longitude
return {
'latitude': sum(lats) / 2,
'longitude': sum(longs) / 2,
}
if __name__ == '__main__':
args = parser.parse_args()
nodes, links = parse_excel(args)
if args.filter_region:
nodes = [n for n in nodes if n.region.lower() in args.filter_region]
cities = {n.city for n in nodes}
links = [lnk for lnk in links if lnk.from_city in cities and
lnk.to_city in cities]
cities = {lnk.from_city for lnk in links} | {lnk.to_city for lnk in links}
nodes = [n for n in nodes if n.city in cities]
nodes_by_city = {n.city: n for n in nodes}
data = {
'elements':
[{'uid': f'trx {x.city}',
'metadata': {'location': {'city': x.city,
'region': x.region,
'latitude': x.latitude,
'longitude': x.longitude}},
'type': 'Transceiver'}
for x in nodes] +
[{'uid': f'roadm {x.city}',
'metadata': {'location': {'city': x.city,
'region': x.region,
'latitude': x.latitude,
'longitude': x.longitude}},
'type': 'Roadm'}
for x in nodes] +
[{'uid': f'fiber ({x.from_city}{x.to_city})',
'metadata': {'location': midpoint(nodes_by_city[x.from_city],
nodes_by_city[x.to_city])},
'type': 'Fiber',
'params': {'length': round(x.distance, 3),
'length_units': x.distance_units,
'loss_coef': 0.2,
'dispersion': 16.7E-6,
'gamma': 1.27E-3}
}
for x in links],
'connections':
list(chain.from_iterable(zip( # put bidi next to each other
[{'from_node': f'roadm {x.from_city}',
'to_node': f'fiber ({x.from_city}{x.to_city})'}
for x in links],
[{'from_node': f'fiber ({x.from_city}{x.to_city})',
'to_node': f'roadm {x.from_city}'}
for x in links])))
+
list(chain.from_iterable(zip(
[{'from_node': f'fiber ({x.from_city}{x.to_city})',
'to_node': f'roadm {x.to_city}'}
for x in links],
[{'from_node': f'roadm {x.to_city}',
'to_node': f'fiber ({x.from_city}{x.to_city})'}
for x in links])))
+
list(chain.from_iterable(zip(
[{'from_node': f'trx {x.city}',
'to_node': f'roadm {x.city}'}
for x in nodes],
[{'from_node': f'roadm {x.city}',
'to_node': f'trx {x.city}'}
for x in nodes])))
}
print(dumps(data, indent=2))
with open(output_json_file_name,'w') as edfa_json_file:
edfa_json_file.write(dumps(data, indent=2))

View File

@@ -1,542 +0,0 @@
{
"elements": [
{
"uid": "Bangkok",
"metadata": {
"location": {
"city": "Bangkok",
"region": "Asia",
"latitude": 13.73,
"longitude": 100.5
}
},
"type": "Transceiver"
},
{
"uid": "Beijing",
"metadata": {
"location": {
"city": "Beijing",
"region": "Asia",
"latitude": 39.92999979,
"longitude": 116.4000013
}
},
"type": "Transceiver"
},
{
"uid": "Delhi",
"metadata": {
"location": {
"city": "Delhi",
"region": "Asia",
"latitude": 28.6700003,
"longitude": 77.2099989
}
},
"type": "Transceiver"
},
{
"uid": "Hong_Kong",
"metadata": {
"location": {
"city": "Hong_Kong",
"region": "Asia",
"latitude": 22.267,
"longitude": 114.14
}
},
"type": "Transceiver"
},
{
"uid": "Honolulu",
"metadata": {
"location": {
"city": "Honolulu",
"region": "Asia",
"latitude": 21.3199996,
"longitude": -157.800003
}
},
"type": "Transceiver"
},
{
"uid": "Mumbai",
"metadata": {
"location": {
"city": "Mumbai",
"region": "Asia",
"latitude": 18.9599987,
"longitude": 72.8199999
}
},
"type": "Transceiver"
},
{
"uid": "Seoul",
"metadata": {
"location": {
"city": "Seoul",
"region": "Asia",
"latitude": 37.56000108,
"longitude": 126.9899988
}
},
"type": "Transceiver"
},
{
"uid": "Shanghai",
"metadata": {
"location": {
"city": "Shanghai",
"region": "Asia",
"latitude": 31.23,
"longitude": 121.47
}
},
"type": "Transceiver"
},
{
"uid": "Singapore",
"metadata": {
"location": {
"city": "Singapore",
"region": "Asia",
"latitude": 1.299999907,
"longitude": 103.8499992
}
},
"type": "Transceiver"
},
{
"uid": "Sydney",
"metadata": {
"location": {
"city": "Sydney",
"region": "Asia",
"latitude": -33.86999896,
"longitude": 151.2100066
}
},
"type": "Transceiver"
},
{
"uid": "Taipei",
"metadata": {
"location": {
"city": "Taipei",
"region": "Asia",
"latitude": 25.0200005,
"longitude": 121.449997
}
},
"type": "Transceiver"
},
{
"uid": "Tokyo",
"metadata": {
"location": {
"city": "Tokyo",
"region": "Asia",
"latitude": 35.6699986,
"longitude": 139.770004
}
},
"type": "Transceiver"
},
{
"uid": "fiber (Bangkok \u2192 Delhi)",
"metadata": {
"length": 3505.95,
"units": "km",
"location": {
"latitude": 21.20000015,
"longitude": 88.85499945000001
}
},
"type": "Fiber"
},
{
"uid": "fiber (Bangkok \u2192 Hong_Kong)",
"metadata": {
"length": 2070.724,
"units": "km",
"location": {
"latitude": 17.9985,
"longitude": 107.32
}
},
"type": "Fiber"
},
{
"uid": "fiber (Beijing \u2192 Seoul)",
"metadata": {
"length": 1146.124,
"units": "km",
"location": {
"latitude": 38.745000434999994,
"longitude": 121.69500005
}
},
"type": "Fiber"
},
{
"uid": "fiber (Beijing \u2192 Shanghai)",
"metadata": {
"length": 1284.465,
"units": "km",
"location": {
"latitude": 35.579999895,
"longitude": 118.93500065
}
},
"type": "Fiber"
},
{
"uid": "fiber (Delhi \u2192 Mumbai)",
"metadata": {
"length": 1402.141,
"units": "km",
"location": {
"latitude": 23.8149995,
"longitude": 75.0149994
}
},
"type": "Fiber"
},
{
"uid": "fiber (Hong_Kong \u2192 Shanghai)",
"metadata": {
"length": 1480.406,
"units": "km",
"location": {
"latitude": 26.7485,
"longitude": 117.805
}
},
"type": "Fiber"
},
{
"uid": "fiber (Hong_Kong \u2192 Sydney)",
"metadata": {
"length": 8856.6,
"units": "km",
"location": {
"latitude": -5.801499479999999,
"longitude": 132.67500330000001
}
},
"type": "Fiber"
},
{
"uid": "fiber (Hong_Kong \u2192 Taipei)",
"metadata": {
"length": 966.177,
"units": "km",
"location": {
"latitude": 23.64350025,
"longitude": 117.79499849999999
}
},
"type": "Fiber"
},
{
"uid": "fiber (Honolulu \u2192 Sydney)",
"metadata": {
"length": 9808.616,
"units": "km",
"location": {
"latitude": -6.274999679999999,
"longitude": -3.294998199999995
}
},
"type": "Fiber"
},
{
"uid": "fiber (Honolulu \u2192 Taipei)",
"metadata": {
"length": 9767.013,
"units": "km",
"location": {
"latitude": 23.17000005,
"longitude": -18.175003000000004
}
},
"type": "Fiber"
},
{
"uid": "fiber (Mumbai \u2192 Singapore)",
"metadata": {
"length": 4692.708,
"units": "km",
"location": {
"latitude": 10.1299993035,
"longitude": 88.33499954999999
}
},
"type": "Fiber"
},
{
"uid": "fiber (Seoul \u2192 Tokyo)",
"metadata": {
"length": 1391.085,
"units": "km",
"location": {
"latitude": 36.614999839999996,
"longitude": 133.3800014
}
},
"type": "Fiber"
},
{
"uid": "fiber (Singapore \u2192 Sydney)",
"metadata": {
"length": 7562.331,
"units": "km",
"location": {
"latitude": -16.2849995265,
"longitude": 127.5300029
}
},
"type": "Fiber"
},
{
"uid": "fiber (Taipei \u2192 Tokyo)",
"metadata": {
"length": 2537.345,
"units": "km",
"location": {
"latitude": 30.344999549999997,
"longitude": 130.6100005
}
},
"type": "Fiber"
}
],
"connections": [
{
"from_node": "Bangkok",
"to_node": "fiber (Bangkok \u2192 Delhi)"
},
{
"from_node": "fiber (Bangkok \u2192 Delhi)",
"to_node": "Bangkok"
},
{
"from_node": "Bangkok",
"to_node": "fiber (Bangkok \u2192 Hong_Kong)"
},
{
"from_node": "fiber (Bangkok \u2192 Hong_Kong)",
"to_node": "Bangkok"
},
{
"from_node": "Beijing",
"to_node": "fiber (Beijing \u2192 Seoul)"
},
{
"from_node": "fiber (Beijing \u2192 Seoul)",
"to_node": "Beijing"
},
{
"from_node": "Beijing",
"to_node": "fiber (Beijing \u2192 Shanghai)"
},
{
"from_node": "fiber (Beijing \u2192 Shanghai)",
"to_node": "Beijing"
},
{
"from_node": "Delhi",
"to_node": "fiber (Delhi \u2192 Mumbai)"
},
{
"from_node": "fiber (Delhi \u2192 Mumbai)",
"to_node": "Delhi"
},
{
"from_node": "Hong_Kong",
"to_node": "fiber (Hong_Kong \u2192 Shanghai)"
},
{
"from_node": "fiber (Hong_Kong \u2192 Shanghai)",
"to_node": "Hong_Kong"
},
{
"from_node": "Hong_Kong",
"to_node": "fiber (Hong_Kong \u2192 Sydney)"
},
{
"from_node": "fiber (Hong_Kong \u2192 Sydney)",
"to_node": "Hong_Kong"
},
{
"from_node": "Hong_Kong",
"to_node": "fiber (Hong_Kong \u2192 Taipei)"
},
{
"from_node": "fiber (Hong_Kong \u2192 Taipei)",
"to_node": "Hong_Kong"
},
{
"from_node": "Honolulu",
"to_node": "fiber (Honolulu \u2192 Sydney)"
},
{
"from_node": "fiber (Honolulu \u2192 Sydney)",
"to_node": "Honolulu"
},
{
"from_node": "Honolulu",
"to_node": "fiber (Honolulu \u2192 Taipei)"
},
{
"from_node": "fiber (Honolulu \u2192 Taipei)",
"to_node": "Honolulu"
},
{
"from_node": "Mumbai",
"to_node": "fiber (Mumbai \u2192 Singapore)"
},
{
"from_node": "fiber (Mumbai \u2192 Singapore)",
"to_node": "Mumbai"
},
{
"from_node": "Seoul",
"to_node": "fiber (Seoul \u2192 Tokyo)"
},
{
"from_node": "fiber (Seoul \u2192 Tokyo)",
"to_node": "Seoul"
},
{
"from_node": "Singapore",
"to_node": "fiber (Singapore \u2192 Sydney)"
},
{
"from_node": "fiber (Singapore \u2192 Sydney)",
"to_node": "Singapore"
},
{
"from_node": "Taipei",
"to_node": "fiber (Taipei \u2192 Tokyo)"
},
{
"from_node": "fiber (Taipei \u2192 Tokyo)",
"to_node": "Taipei"
},
{
"from_node": "fiber (Bangkok \u2192 Delhi)",
"to_node": "Delhi"
},
{
"from_node": "Delhi",
"to_node": "fiber (Bangkok \u2192 Delhi)"
},
{
"from_node": "fiber (Bangkok \u2192 Hong_Kong)",
"to_node": "Hong_Kong"
},
{
"from_node": "Hong_Kong",
"to_node": "fiber (Bangkok \u2192 Hong_Kong)"
},
{
"from_node": "fiber (Beijing \u2192 Seoul)",
"to_node": "Seoul"
},
{
"from_node": "Seoul",
"to_node": "fiber (Beijing \u2192 Seoul)"
},
{
"from_node": "fiber (Beijing \u2192 Shanghai)",
"to_node": "Shanghai"
},
{
"from_node": "Shanghai",
"to_node": "fiber (Beijing \u2192 Shanghai)"
},
{
"from_node": "fiber (Delhi \u2192 Mumbai)",
"to_node": "Mumbai"
},
{
"from_node": "Mumbai",
"to_node": "fiber (Delhi \u2192 Mumbai)"
},
{
"from_node": "fiber (Hong_Kong \u2192 Shanghai)",
"to_node": "Shanghai"
},
{
"from_node": "Shanghai",
"to_node": "fiber (Hong_Kong \u2192 Shanghai)"
},
{
"from_node": "fiber (Hong_Kong \u2192 Sydney)",
"to_node": "Sydney"
},
{
"from_node": "Sydney",
"to_node": "fiber (Hong_Kong \u2192 Sydney)"
},
{
"from_node": "fiber (Hong_Kong \u2192 Taipei)",
"to_node": "Taipei"
},
{
"from_node": "Taipei",
"to_node": "fiber (Hong_Kong \u2192 Taipei)"
},
{
"from_node": "fiber (Honolulu \u2192 Sydney)",
"to_node": "Sydney"
},
{
"from_node": "Sydney",
"to_node": "fiber (Honolulu \u2192 Sydney)"
},
{
"from_node": "fiber (Honolulu \u2192 Taipei)",
"to_node": "Taipei"
},
{
"from_node": "Taipei",
"to_node": "fiber (Honolulu \u2192 Taipei)"
},
{
"from_node": "fiber (Mumbai \u2192 Singapore)",
"to_node": "Singapore"
},
{
"from_node": "Singapore",
"to_node": "fiber (Mumbai \u2192 Singapore)"
},
{
"from_node": "fiber (Seoul \u2192 Tokyo)",
"to_node": "Tokyo"
},
{
"from_node": "Tokyo",
"to_node": "fiber (Seoul \u2192 Tokyo)"
},
{
"from_node": "fiber (Singapore \u2192 Sydney)",
"to_node": "Sydney"
},
{
"from_node": "Sydney",
"to_node": "fiber (Singapore \u2192 Sydney)"
},
{
"from_node": "fiber (Taipei \u2192 Tokyo)",
"to_node": "Tokyo"
},
{
"from_node": "Tokyo",
"to_node": "fiber (Taipei \u2192 Tokyo)"
}
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,582 +0,0 @@
{
"elements": [
{
"uid": "Amsterdam",
"metadata": {
"location": {
"city": "Amsterdam",
"region": "Europe",
"latitude": 52.3699996,
"longitude": 4.88999915
}
},
"type": "Transceiver"
},
{
"uid": "Berlin",
"metadata": {
"location": {
"city": "Berlin",
"region": "Europe",
"latitude": 52.520002,
"longitude": 13.379995
}
},
"type": "Transceiver"
},
{
"uid": "Brussels",
"metadata": {
"location": {
"city": "Brussels",
"region": "Europe",
"latitude": 50.830002,
"longitude": 4.330002
}
},
"type": "Transceiver"
},
{
"uid": "Bucharest",
"metadata": {
"location": {
"city": "Bucharest",
"region": "Europe",
"latitude": 44.44,
"longitude": 26.1
}
},
"type": "Transceiver"
},
{
"uid": "Frankfurt",
"metadata": {
"location": {
"city": "Frankfurt",
"region": "Europe",
"latitude": 50.1199992,
"longitude": 8.68000104
}
},
"type": "Transceiver"
},
{
"uid": "Istanbul",
"metadata": {
"location": {
"city": "Istanbul",
"region": "Europe",
"latitude": 41.1,
"longitude": 29.0
}
},
"type": "Transceiver"
},
{
"uid": "London",
"metadata": {
"location": {
"city": "London",
"region": "Europe",
"latitude": 51.5200005,
"longitude": -0.100000296
}
},
"type": "Transceiver"
},
{
"uid": "Madrid",
"metadata": {
"location": {
"city": "Madrid",
"region": "Europe",
"latitude": 40.419998,
"longitude": -3.7100002
}
},
"type": "Transceiver"
},
{
"uid": "Paris",
"metadata": {
"location": {
"city": "Paris",
"region": "Europe",
"latitude": 48.86,
"longitude": 2.3399995
}
},
"type": "Transceiver"
},
{
"uid": "Rome",
"metadata": {
"location": {
"city": "Rome",
"region": "Europe",
"latitude": 41.8899996,
"longitude": 12.5000004
}
},
"type": "Transceiver"
},
{
"uid": "Vienna",
"metadata": {
"location": {
"city": "Vienna",
"region": "Europe",
"latitude": 48.2200024,
"longitude": 16.3700005
}
},
"type": "Transceiver"
},
{
"uid": "Warsaw",
"metadata": {
"location": {
"city": "Warsaw",
"region": "Europe",
"latitude": 52.2599987,
"longitude": 21.0200005
}
},
"type": "Transceiver"
},
{
"uid": "Zurich",
"metadata": {
"location": {
"city": "Zurich",
"region": "Europe",
"latitude": 47.3800015,
"longitude": 8.5399996
}
},
"type": "Transceiver"
},
{
"uid": "fiber (Amsterdam \u2192 Berlin)",
"metadata": {
"length": 690.608,
"units": "km",
"location": {
"latitude": 52.4450008,
"longitude": 9.134997075
}
},
"type": "Fiber"
},
{
"uid": "fiber (Amsterdam \u2192 Brussels)",
"metadata": {
"length": 210.729,
"units": "km",
"location": {
"latitude": 51.600000800000004,
"longitude": 4.610000575000001
}
},
"type": "Fiber"
},
{
"uid": "fiber (Amsterdam \u2192 Frankfurt)",
"metadata": {
"length": 436.324,
"units": "km",
"location": {
"latitude": 51.2449994,
"longitude": 6.785000095000001
}
},
"type": "Fiber"
},
{
"uid": "fiber (Berlin \u2192 Warsaw)",
"metadata": {
"length": 623.015,
"units": "km",
"location": {
"latitude": 52.390000349999994,
"longitude": 17.199997749999998
}
},
"type": "Fiber"
},
{
"uid": "fiber (Brussels \u2192 London)",
"metadata": {
"length": 381.913,
"units": "km",
"location": {
"latitude": 51.17500125,
"longitude": 2.115000852
}
},
"type": "Fiber"
},
{
"uid": "fiber (Bucharest \u2192 Istanbul)",
"metadata": {
"length": 528.58,
"units": "km",
"location": {
"latitude": 42.769999999999996,
"longitude": 27.55
}
},
"type": "Fiber"
},
{
"uid": "fiber (Bucharest \u2192 Warsaw)",
"metadata": {
"length": 1136.2,
"units": "km",
"location": {
"latitude": 48.34999935,
"longitude": 23.56000025
}
},
"type": "Fiber"
},
{
"uid": "fiber (Frankfurt \u2192 Vienna)",
"metadata": {
"length": 717.001,
"units": "km",
"location": {
"latitude": 49.1700008,
"longitude": 12.52500077
}
},
"type": "Fiber"
},
{
"uid": "fiber (Istanbul \u2192 Rome)",
"metadata": {
"length": 1650.406,
"units": "km",
"location": {
"latitude": 41.4949998,
"longitude": 20.7500002
}
},
"type": "Fiber"
},
{
"uid": "fiber (London \u2192 Paris)",
"metadata": {
"length": 411.692,
"units": "km",
"location": {
"latitude": 50.19000025,
"longitude": 1.1199996019999998
}
},
"type": "Fiber"
},
{
"uid": "fiber (Madrid \u2192 Paris)",
"metadata": {
"length": 1263.619,
"units": "km",
"location": {
"latitude": 44.639999,
"longitude": -0.6850003500000001
}
},
"type": "Fiber"
},
{
"uid": "fiber (Madrid \u2192 Zurich)",
"metadata": {
"length": 1497.358,
"units": "km",
"location": {
"latitude": 43.89999975,
"longitude": 2.4149997
}
},
"type": "Fiber"
},
{
"uid": "fiber (Rome \u2192 Vienna)",
"metadata": {
"length": 920.026,
"units": "km",
"location": {
"latitude": 45.055001000000004,
"longitude": 14.43500045
}
},
"type": "Fiber"
},
{
"uid": "fiber (Rome \u2192 Zurich)",
"metadata": {
"length": 823.4,
"units": "km",
"location": {
"latitude": 44.63500055,
"longitude": 10.52
}
},
"type": "Fiber"
},
{
"uid": "fiber (Vienna \u2192 Warsaw)",
"metadata": {
"length": 669.297,
"units": "km",
"location": {
"latitude": 50.24000055,
"longitude": 18.6950005
}
},
"type": "Fiber"
}
],
"connections": [
{
"from_node": "Amsterdam",
"to_node": "fiber (Amsterdam \u2192 Berlin)"
},
{
"from_node": "fiber (Amsterdam \u2192 Berlin)",
"to_node": "Amsterdam"
},
{
"from_node": "Amsterdam",
"to_node": "fiber (Amsterdam \u2192 Brussels)"
},
{
"from_node": "fiber (Amsterdam \u2192 Brussels)",
"to_node": "Amsterdam"
},
{
"from_node": "Amsterdam",
"to_node": "fiber (Amsterdam \u2192 Frankfurt)"
},
{
"from_node": "fiber (Amsterdam \u2192 Frankfurt)",
"to_node": "Amsterdam"
},
{
"from_node": "Berlin",
"to_node": "fiber (Berlin \u2192 Warsaw)"
},
{
"from_node": "fiber (Berlin \u2192 Warsaw)",
"to_node": "Berlin"
},
{
"from_node": "Brussels",
"to_node": "fiber (Brussels \u2192 London)"
},
{
"from_node": "fiber (Brussels \u2192 London)",
"to_node": "Brussels"
},
{
"from_node": "Bucharest",
"to_node": "fiber (Bucharest \u2192 Istanbul)"
},
{
"from_node": "fiber (Bucharest \u2192 Istanbul)",
"to_node": "Bucharest"
},
{
"from_node": "Bucharest",
"to_node": "fiber (Bucharest \u2192 Warsaw)"
},
{
"from_node": "fiber (Bucharest \u2192 Warsaw)",
"to_node": "Bucharest"
},
{
"from_node": "Frankfurt",
"to_node": "fiber (Frankfurt \u2192 Vienna)"
},
{
"from_node": "fiber (Frankfurt \u2192 Vienna)",
"to_node": "Frankfurt"
},
{
"from_node": "Istanbul",
"to_node": "fiber (Istanbul \u2192 Rome)"
},
{
"from_node": "fiber (Istanbul \u2192 Rome)",
"to_node": "Istanbul"
},
{
"from_node": "London",
"to_node": "fiber (London \u2192 Paris)"
},
{
"from_node": "fiber (London \u2192 Paris)",
"to_node": "London"
},
{
"from_node": "Madrid",
"to_node": "fiber (Madrid \u2192 Paris)"
},
{
"from_node": "fiber (Madrid \u2192 Paris)",
"to_node": "Madrid"
},
{
"from_node": "Madrid",
"to_node": "fiber (Madrid \u2192 Zurich)"
},
{
"from_node": "fiber (Madrid \u2192 Zurich)",
"to_node": "Madrid"
},
{
"from_node": "Rome",
"to_node": "fiber (Rome \u2192 Vienna)"
},
{
"from_node": "fiber (Rome \u2192 Vienna)",
"to_node": "Rome"
},
{
"from_node": "Rome",
"to_node": "fiber (Rome \u2192 Zurich)"
},
{
"from_node": "fiber (Rome \u2192 Zurich)",
"to_node": "Rome"
},
{
"from_node": "Vienna",
"to_node": "fiber (Vienna \u2192 Warsaw)"
},
{
"from_node": "fiber (Vienna \u2192 Warsaw)",
"to_node": "Vienna"
},
{
"from_node": "fiber (Amsterdam \u2192 Berlin)",
"to_node": "Berlin"
},
{
"from_node": "Berlin",
"to_node": "fiber (Amsterdam \u2192 Berlin)"
},
{
"from_node": "fiber (Amsterdam \u2192 Brussels)",
"to_node": "Brussels"
},
{
"from_node": "Brussels",
"to_node": "fiber (Amsterdam \u2192 Brussels)"
},
{
"from_node": "fiber (Amsterdam \u2192 Frankfurt)",
"to_node": "Frankfurt"
},
{
"from_node": "Frankfurt",
"to_node": "fiber (Amsterdam \u2192 Frankfurt)"
},
{
"from_node": "fiber (Berlin \u2192 Warsaw)",
"to_node": "Warsaw"
},
{
"from_node": "Warsaw",
"to_node": "fiber (Berlin \u2192 Warsaw)"
},
{
"from_node": "fiber (Brussels \u2192 London)",
"to_node": "London"
},
{
"from_node": "London",
"to_node": "fiber (Brussels \u2192 London)"
},
{
"from_node": "fiber (Bucharest \u2192 Istanbul)",
"to_node": "Istanbul"
},
{
"from_node": "Istanbul",
"to_node": "fiber (Bucharest \u2192 Istanbul)"
},
{
"from_node": "fiber (Bucharest \u2192 Warsaw)",
"to_node": "Warsaw"
},
{
"from_node": "Warsaw",
"to_node": "fiber (Bucharest \u2192 Warsaw)"
},
{
"from_node": "fiber (Frankfurt \u2192 Vienna)",
"to_node": "Vienna"
},
{
"from_node": "Vienna",
"to_node": "fiber (Frankfurt \u2192 Vienna)"
},
{
"from_node": "fiber (Istanbul \u2192 Rome)",
"to_node": "Rome"
},
{
"from_node": "Rome",
"to_node": "fiber (Istanbul \u2192 Rome)"
},
{
"from_node": "fiber (London \u2192 Paris)",
"to_node": "Paris"
},
{
"from_node": "Paris",
"to_node": "fiber (London \u2192 Paris)"
},
{
"from_node": "fiber (Madrid \u2192 Paris)",
"to_node": "Paris"
},
{
"from_node": "Paris",
"to_node": "fiber (Madrid \u2192 Paris)"
},
{
"from_node": "fiber (Madrid \u2192 Zurich)",
"to_node": "Zurich"
},
{
"from_node": "Zurich",
"to_node": "fiber (Madrid \u2192 Zurich)"
},
{
"from_node": "fiber (Rome \u2192 Vienna)",
"to_node": "Vienna"
},
{
"from_node": "Vienna",
"to_node": "fiber (Rome \u2192 Vienna)"
},
{
"from_node": "fiber (Rome \u2192 Zurich)",
"to_node": "Zurich"
},
{
"from_node": "Zurich",
"to_node": "fiber (Rome \u2192 Zurich)"
},
{
"from_node": "fiber (Vienna \u2192 Warsaw)",
"to_node": "Warsaw"
},
{
"from_node": "Warsaw",
"to_node": "fiber (Vienna \u2192 Warsaw)"
}
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,28 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
########################################################################
# _____ ___ ____ ____ ____ _____ #
# |_ _|_ _| _ \ | _ \/ ___|| ____| #
# | | | || |_) | | |_) \___ \| _| #
# | | | || __/ | __/ ___) | |___ #
# |_| |___|_| |_| |____/|_____| #
# #
# == Physical Simulation Environment == #
# #
########################################################################
'''
gnpy route planning and optimization library
============================================
gnpy is a route planning and optimization library, written in Python, for
operators of large-scale mesh optical networks.
:copyright: © 2018, Telecom Infra Project
:license: BSD 3-Clause, see LICENSE for more details.
'''
from . import elements
from .execute import *

View File

@@ -1,17 +1,24 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Network elements class with SpectralInformation propagation using
__call__ and propagate methods
@author: Alessio Ferrari
@author: Mattia Cantono
@author: Vittorio Curri
@author: giladgoldfarb
@author: briantaylor
@author: jeanluc-auge
@acknowledgement : Dave Boertjes
"""
'''
gnpy.core.elements
==================
This module contains standard network elements.
A network element is a Python callable. It takes a .info.SpectralInformation
object and returns a copy with appropriate fields affected. This structure
represents spectral information that is "propogated" by this network element.
Network elements must have only a local "view" of the network and propogate
SpectralInformation using only this information. They should be independent and
self-contained.
Network elements MUST implement two attributes .uid and .name representing a
unique identifier and a printable name.
'''
import numpy as np
from scipy.constants import c, h
@@ -31,28 +38,38 @@ class Transceiver(Node):
def _calc_snr(self, spectral_info):
ase = [c.power.ase for c in spectral_info.carriers]
nli = [c.power.nli for c in spectral_info.carriers]
if min(ase)>1e-20:
if min(ase)>1e-20:
self.osnr_ase = [lin2db(c.power.signal/c.power.ase)
for c in spectral_info.carriers]
ratio_01nm = [lin2db(12.5e9/c.baud_rate) for c in spectral_info.carriers]
self.osnr_ase_01nm = [ase - ratio for ase, ratio
self.osnr_ase_01nm = [ase - ratio for ase, ratio
in zip(self.osnr_ase, ratio_01nm)]
if min(nli)>1e-20:
self.osnr_nli = [lin2db(c.power.signal/c.power.nli)
self.osnr_nli = [lin2db(c.power.signal/c.power.nli)
for c in spectral_info.carriers]
self.snr = [lin2db(c.power.signal/(c.power.nli+c.power.ase))
self.snr = [lin2db(c.power.signal/(c.power.nli+c.power.ase))
for c in spectral_info.carriers]
def __repr__(self):
if self.snr != None and self.osnr_ase != None:
snr = round(np.mean(self.snr),2)
osnr_ase = round(np.mean(self.osnr_ase),2)
osnr_ase_01nm = round(np.mean(self.osnr_ase_01nm), 2)
return f'{type(self).__name__}(uid={self.uid}, \
osnr_ase(in 0.1nm)={osnr_ase_01nm}dB, osnr_ase(in signal bw)={osnr_ase}dB, \
snr total(in signal bw)={snr})'
else:
return f'{type(self).__name__}(uid={self.uid})'
return (f'{type(self).__name__}('
'uid={self.uid!r}, '
'config={self.config!r}, '
'osnr_ase_01nm={osnr_ase_01nm!r}, '
'osnr_ase={osnr_ase!r}, '
'osnr_ase_nli={osnr_ase_nli!r}, '
'snr={snr!r})')
def __str__(self):
if self.snr is None or self.osnr_ase is None:
return f'{type(self).__name__} {self.uid}'
snr = round(np.mean(self.snr),2)
osnr_ase = round(np.mean(self.osnr_ase),2)
osnr_ase_01nm = round(np.mean(self.osnr_ase_01nm), 2)
return '\n'.join([f'{type(self).__name__} {self.uid}',
f' OSNR ASE (1nm): {np.mean(self.osnr_ase_01nm):.2f}',
f' OSNR ASE (signal bw): {np.mean(self.osnr_ase):.2f}',
f' SNR total (signal bw): {np.mean(snr):.2f}'])
def __call__(self, spectral_info):
self._calc_snr(spectral_info)
@@ -64,14 +81,17 @@ class Roadm(Node):
self.loss = 20 #dB
def __repr__(self):
return f'{type(self).__name__}(uid={self.uid}, \
loss={round(self.loss,1)}dB)'
return f'{type(self).__name__}(uid={self.uid!r}, loss={self.loss!r})'
def __str__(self):
return '\n'.join([f'{type(self).__name__} {self.uid}',
f' loss (dB): {self.loss:.2f}'])
def propagate(self, *carriers):
attenuation = db2lin(self.loss)
for carrier in carriers:
pwr = carrier.power
pwr = carrier.power
pwr = pwr._replace(signal=pwr.signal/attenuation,
nonlinear_interference=pwr.nli/attenuation,
amplified_spontaneous_emission=pwr.ase/attenuation)
@@ -94,9 +114,12 @@ class Fiber(Node):
#TODO discuss factor 2 in the linear lineic attenuation
def __repr__(self):
k = UNITS['km']
return f'{type(self).__name__}(uid={self.uid}, \
length={round(self.length/k, 1)}km, loss={round(self.loss,1)}dB)'
return f'{type(self).__name__}(uid={self.uid!r}, length={self.length!r}, loss={self.loss!r})'
def __str__(self):
return '\n'.join([f'{type(self).__name__} {self.uid}',
f' length (m): {self.length:.2f}',
f' loss (dB): {self.loss:.2f}'])
def lin_attenuation(self):
attenuation = self.length * self.loss_coef
@@ -141,7 +164,7 @@ length={round(self.length/k, 1)}km, loss={round(self.loss,1)}dB)'
'alpha_acoef': alpha_acoef,
'description:': s}
return d
def _psi(self, carrier, interfering_carrier):
""" Calculates eq. 123 from arXiv:1209.0394.
"""
@@ -156,7 +179,7 @@ length={round(self.length/k, 1)}km, loss={round(self.loss,1)}dB)'
carrier.baud_rate * (delta_f - 0.5 * interfering_carrier.baud_rate))
return psi
def _gn_analytic(self, carrier, *carriers):
""" Computes the nonlinear interference power on a single carrier.
The method uses eq. 120 from arXiv:1209.0394.
@@ -202,20 +225,31 @@ class Edfa(Node):
self.interpol_nf_ripple = None #nf_ripple: N numpy array
self.channel_freq = None #SI channel frequencies: N numpy array
"""nf, gprofile, pin and pout attributs are set by interpol_params"""
self.nf = None #dB edfa nf at operational.gain_target: N numpy array
self.nf = None #dB edfa nf at operational.gain_target: N numpy array
self.gprofile = None
self.pin_db = None
self.pout_db = None
def __repr__(self):
if self.pin_db != None and self.pout_db != None:
nf_avg = round(np.mean(self.nf),1)
return f'{type(self).__name__}(uid={self.uid}, \
gain={round(self.operational.gain_target,1)}dB, NF={nf_avg}dB, \
Pin={round(self.pin_db, 1)}dBm, Pout={round(self.pout_db,1)}dBm)'
else:
return f'{type(self).__name__}(uid={self.uid}, \
gain={self.operational.gain_target})'
return (f'{type(self).__name__}(uid={self.uid!r}, '
f'interpol_dgt={self.interpol_dgt!r}, '
f'interpol_gain_ripple={self.interpol_gain_ripple!r}, '
f'interpol_nf_ripple={self.interpol_nf_ripple!r}, '
f'channel_freq={self.channel_freq!r}, '
f'nf={self.nf!r}, '
f'gprofile={self.gprofile!r}, '
f'pin_db={self.pin_db!r}, '
f'pout_db={self.pout_db!r})')
def __str__(self):
if self.pin_db is None or self.pout_db is None:
return f'{type(self).__name__} {self.uid}'
return '\n'.join([f'{type(self).__name__} {self.uid}',
f' gain (dB): {self.operational.gain_target:.2f}',
f' noise figure (dB): {np.mean(self.nf):.2f}',
f' Power In (dBm): {self.pin_db:.2f}',
f' Power Out (dBm): {self.pout_db:.2f}'])
def interpol_params(self, frequencies, pin, baud_rates):
"""interpolate SI channel frequencies with the edfa dgt and gain_ripple frquencies from json
@@ -261,7 +295,7 @@ Pin={round(self.pin_db, 1)}dBm, Pout={round(self.pout_db,1)}dBm)'
return nf_array
def noise_profile(self, df):
""" noise_profile(bw) computes amplifier ase (W) in signal bw (Hz)
""" noise_profile(bw) computes amplifier ase (W) in signal bw (Hz)
noise is calculated at amplifier input
:bw: signal bandwidth = baud rate in Hz
@@ -297,7 +331,7 @@ Pin={round(self.pin_db, 1)}dBm, Pout={round(self.pout_db,1)}dBm)'
e.g. 12.5GHz."""
ase = h * df * self.channel_freq * db2lin(self.nf) #W
return ase #in W, @amplifier input
return ase #in W, @amplifier input
def _gain_profile(self, pin):
"""
@@ -397,7 +431,7 @@ Pin={round(self.pin_db, 1)}dBm, Pout={round(self.pout_db,1)}dBm)'
# Upper gain estimate
xhigh = dgts2 + deltax
ghigh = g1st - voa + np.array(self.interpol_dgt) * xhigh
pout_db = lin2db(np.sum(pin*1e3*db2lin(ghigh)))
pout_db = lin2db(np.sum(pin*1e3*db2lin(ghigh)))
gavg_high = pout_db - tot_in_power_db
# compute slope
@@ -426,14 +460,14 @@ Pin={round(self.pin_db, 1)}dBm, Pout={round(self.pout_db,1)}dBm)'
freq = np.array([c.frequency for c in carriers])
brate = np.array([c.baud_rate for c in carriers])
#interpolate the amplifier vectors with the carriers freq, calculate nf & gain profile
self.interpol_params(freq, pin, brate)
self.interpol_params(freq, pin, brate)
gain = db2lin(self.gprofile)
carrier_ase = self.noise_profile(brate)
for carrier in carriers:
pwr = carrier.power
bw = carrier.baud_rate
bw = carrier.baud_rate
pwr = pwr._replace(signal=pwr.signal*gain[i],
nonlinear_interference=pwr.nli*gain[i],
amplified_spontaneous_emission=(pwr.ase+carrier_ase[i])*gain[i])

View File

@@ -1,2 +1,9 @@
#!/usr/bin/env python3
'''
gnpy.core.execute
=================
This module contains functions for executing the propogation of
spectral information on a `gnpy` network.
'''

View File

@@ -1,8 +1,18 @@
#!/usr/bin/env python3
'''
gnpy.core.info
==============
This module contains classes for modelling SpectralInformation.
'''
from collections import namedtuple
class ConvenienceAccess:
def __init_subclass__(cls):
for abbrev, field in getattr(cls, '_ABBREVS', {}).items():
setattr(cls, abbrev, property(lambda self, f=field: getattr(self, f)))
@@ -13,20 +23,27 @@ class ConvenienceAccess:
kwargs[field] = kwargs.pop(abbrev)
return self._replace(**kwargs)
class Power(namedtuple('Power', 'signal nonlinear_interference amplified_spontaneous_emission'), ConvenienceAccess):
_ABBREVS = {'nli': 'nonlinear_interference',
'ase': 'amplified_spontaneous_emission',}
class Channel(namedtuple('Channel', 'channel_number frequency baud_rate roll_off power'), ConvenienceAccess):
_ABBREVS = {'channel': 'channel_number',
_ABBREVS = {'channel': 'channel_number',
'num_chan': 'channel_number',
'ffs': 'frequency',
'freq': 'frequency',}
'ffs': 'frequency',
'freq': 'frequency',}
class SpectralInformation(namedtuple('SpectralInformation', 'carriers'), ConvenienceAccess):
def __new__(cls, *carriers):
return super().__new__(cls, carriers)
if __name__ == '__main__':
si = SpectralInformation(
Channel(1, 193.95e12, 32e9, 0.15, # 193.95 THz, 32 Gbaud
@@ -39,12 +56,10 @@ if __name__ == '__main__':
spacing = 0.05 #THz
si = si.update(carriers=tuple(Channel(f+1, 191.3+spacing*(f+1), 32e9, 0.15, Power(1e-3, f, 1)) for f in range(96)))
print(f'si = {si}')
print(f'si = {si.carriers[0].power.nli}')
print(f'si = {si.carriers[20].power.nli}')
"""
si2 = si.update(carriers=tuple(c.update(power = c.power.update(nli = c.power.nli * 1e5))
for c in si.carriers))
print(f'si2 = {si2}')
"""

View File

@@ -1,15 +1,25 @@
#!/usr/bin/env python3
'''
gnpy.core.network
=================
This module contains functions for constructing networks of network elements.
'''
from networkx import DiGraph
from gnpy.core import elements
from gnpy.core.elements import Fiber, Edfa, Transceiver, Roadm
from gnpy.core.units import UNITS
MAX_SPAN_LENGTH = 125000
TARGET_SPAN_LENGTH = 100000
MIN_SPAN_LENGTH = 75000
def network_from_json(json_data):
# NOTE|dutc: we could use the following, but it would tie our data format
# too closely to the graph library
@@ -30,21 +40,21 @@ def calculate_new_length(fiber_length):
result = (fiber_length, 1)
if fiber_length > MAX_SPAN_LENGTH:
n_spans = int(fiber_length // TARGET_SPAN_LENGTH)
length1 = fiber_length / (n_spans+1)
result1 = (length1, n_spans+1)
delta1 = TARGET_SPAN_LENGTH-length1
length2 = fiber_length / n_spans
delta2 = length2-TARGET_SPAN_LENGTH
result2 = (length2, n_spans)
if length1<MIN_SPAN_LENGTH and length2<MAX_SPAN_LENGTH:
result = result2
elif length2>MAX_SPAN_LENGTH and length1>MIN_SPAN_LENGTH:
result = result1
else:
if delta1 < delta2:
if delta1 < delta2:
result = result1
else:
result = result2
@@ -78,17 +88,17 @@ def split_fiber(network, fiber):
for next_node in next_nodes:
network.add_edge(prev_node, next_node)
network = add_egress_amplifier(network, prev_node)
return network
def add_egress_amplifier(network, node):
next_nodes = [n for n in network.successors(node)
next_nodes = [n for n in network.successors(node)
if not (isinstance(n, Edfa) or isinstance(n, Transceiver))]
i = 1
for next_node in next_nodes:
network.remove_edge(node, next_node)
uid = 'Edfa' + str(i)+ '_' + str(node.uid)
metadata = next_node.metadata
operational = {'gain_target': node.loss, 'tilt_target': 0}

View File

@@ -1,5 +1,23 @@
#! /bin/usr/python3
'''
gnpy.core.node
==============
This module contains the base class for a network element.
Strictly, a network element is any callable which accepts an immutable
.info.SpectralInformation object and returns a .info.SpectralInformation object
(a copy.)
Network elements MUST implement two attributes .uid and .name representing a
unique identifier and a printable name.
This base class provides a mode convenient way to define a network element
via subclassing.
'''
from uuid import uuid4
from gnpy.core.utils import load_json
@@ -33,11 +51,11 @@ class Node:
else:
self.uid = self.config.uid
if hasattr(self.config, 'params'):
self.params = self.config.params
self.params = self.config.params
if hasattr(self.config, 'metadata'):
self.metadata = self.config.metadata
if hasattr(self.config, 'operational'):
self.operational = self.config.operational
self.operational = self.config.operational
@property
def coords(self):

View File

@@ -1,10 +1,19 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
gnpy.core.utils
===============
This module contains utility functions that are used with gnpy.
'''
import json
import numpy as np
from numpy import pi, cos, sqrt, log10
from scipy import constants
def load_json(filename):
@@ -22,7 +31,7 @@ def c():
"""
Returns the speed of light in meters per second
"""
return 299792458.0
return constants.c
def itufs(spacing, startf=191.35, stopf=196.10):
@@ -45,7 +54,7 @@ def h():
"""
Returns plank's constant in J*s
"""
return 6.62607004e-34
return constants.h
def lin2db(value):
@@ -56,11 +65,8 @@ def db2lin(value):
return 10**(value / 10)
def wavelength2freq(value):
""" Converts wavelength units to frequeuncy units.
"""
return c() / value
wavelength2freq = constants.lambda2nu
freq2wavelength = constants.nu2lambda
def freq2wavelength(value):
""" Converts frequency units to wavelength units.

View File

@@ -11,29 +11,28 @@ with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
setup(
name='gnpy',
version='0.0.1',
description='TIP optical network modeling library',
version='0.1.3',
description='route planning and optimization tool for mesh optical networks',
long_description=long_description,
long_description_content_type='text/x-rst; charset=UTF-8',
url='https://github.com/Telecominfraproject/gnpy',
author='Telecom Infra Project',
author_email='james.powell@telecominfraproject.com',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Intended Audience :: Telecommunications Industry',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Physics',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.6',
],
keywords='optics network fiber communication',
keywords='optics network fiber communication route planning optimization',
packages=find_packages(exclude=['examples', 'docs', 'tests']), # Required
install_requires=['cycler',
'decorator',
'matplotlib',
'networkx',
'numpy',
'scipy',
'pyparsing',
'python-dateutil',
'pytz',
'six',
'xlrd']
install_requires=list(open('requirements.txt'))
)