Route planning and optimization tool for mesh optical networks

optics, network, fiber, communication, route, planning, optimization, mesh-networks, optical-network, python, route-optimization, route-planning, telecominfraproject
pip install gnpy==2.2.0


GNPy with an OLS system

gnpy: mesh optical network route planning and optimization library

Documentation Status Build Status via Travis CI DOI Code Contributors via GitHub Code Quality via Code Coverage via codecov

`gnpy` is an open-source, community-developed library for building route planning and optimization tools in real-world mesh optical networks.

gnpy is:

  • a sponsored project of the OOPT/PSE working group of the Telecom Infra Project
  • 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


Get In Touch

There are weekly calls about our progress. Newcomers, users and telecom operators are especially welcome there. We encourage all interested people outside the TIP to join the project.

How to Install

Install either via Docker, or as a Python package.

Instructions for First Use

gnpy is a library for building route planning and optimization tools.

It ships with a number of example programs. Release versions will ship with fully-functional programs.

Note: If you are a network operator or involved in route planning and optimization for your organization, please contact project maintainer Jan Kundrát <>. gnpy is looking for users with specific, delineated use cases to drive requirements for future development.

This example demonstrates how GNPy can be used to check the expected SNR at the end of the line by varying the channel input power:

Running a simple simulation example

By default, this script operates on a single span network defined in gnpy/example-data/edfa_example_network.json

You can specify a different network at the command line as follows. For example, to use the CORONET Global network defined in gnpy/example-data/CORONET_Global_Topology.json:

$ gnpy-transmission-example $(gnpy-example-data)/CORONET_Global_Topology.json

It is also possible to use an Excel file input (for example gnpy/example-data/CORONET_Global_Topology.xlsx). The Excel file will be processed into a JSON file with the same prefix. Further details about the Excel data structure are available in the documentation.

The main transmission example will calculate the average signal OSNR and SNR across network elements (transceiver, ROADMs, fibers, and amplifiers) between two transceivers selected by the user. Additional details are provided by doing gnpy-transmission-example -h. (By default, for the CORONET Global network, it will show the transmission of spectral information between Abilene and Albany)

This script calculates the average signal OSNR = Pch/Pase and SNR = Pch/(Pnli+Pase).

Pase is the amplified spontaneous emission noise, and Pnli the non-linear interference noise.

Further Instructions for Use

Simulations are driven by a set of JSON or XLS files.

The gnpy-transmission-example script propagates a spectrum of channels at 32 Gbaud, 50 GHz spacing and 0 dBm/channel. Launch power can be overridden by using the --power argument. Spectrum information is not yet parametrized but can be modified directly in the eqpt_config.json (via the SpectralInformation -SI- structure) to accommodate any baud rate or spacing. The number of channel is computed based on spacing and f_min, f_max values.

An experimental support for Raman amplification is available:

$ gnpy-transmission-example \
  $(gnpy-example-data)/raman_edfa_example_network.json \
  --sim $(gnpy-example-data)/sim_params.json --show-channels

Configuration of Raman pumps (their frequencies, power and pumping direction) is done via the RamanFiber element in the network topology. General numeric parameters for simulaiton control are provided in the gnpy/example-data/sim_params.json.

Use gnpy-path-request to request several paths at once:

$ cd $(gnpy-example-data)
$ gnpy-path-request -o output_file.json \
  meshTopologyExampleV2.xls meshTopologyExampleV2_services.json

This program operates on a network topology (JSON or Excel format), processing the list of service requests (JSON or XLS again). The service requests and reply formats are based on the draft-ietf-teas-yang-path-computation-01 with custom extensions (e.g., for transponder modes). An example of the JSON input is provided in file service-template.json, while results are shown in path_result_template.json.

Important note: gnpy-path-request is not a network dimensionning tool: each service does not reserve spectrum, or occupy ressources such as transponders. It only computes path feasibility assuming the spectrum (between defined frequencies) is loaded with "nb of channels" spaced by "spacing" values as specified in the system parameters input in the service file, each cannel having the same characteristics in terms of baudrate, format,... as the service transponder. The transceiver element acts as a "logical starting/stopping point" for the spectral information propagation. At that point it is not meant to represent the capacity of add drop ports. As a result transponder type is not part of the network info. it is related to the list of services requests.

The current version includes a spectrum assigment features that enables to compute a candidate spectrum assignment for each service based on a first fit policy. Spectrum is assigned based on service specified spacing value, path_bandwidth value and selected mode for the transceiver. This spectrum assignment includes a basic capacity planning capability so that the spectrum resource is limited by the frequency min and max values defined for the links. If the requested services reach the link spectrum capacity, additional services feasibility are computed but marked as blocked due to spectrum reason.


gnpy is looking for additional contributors, especially those with experience planning and maintaining large-scale, real-world mesh optical networks.

To get involved, please contact Jan Kundrát <> or Gert Grammel <>.

gnpy contributions are currently limited to members of TIP. Membership is free and open to all.

See the Onboarding Guide for specific details on code contributions.

See AUTHORS.rst for past and present contributors.

Project Background

Data Centers are built upon interchangeable, highly standardized node and network architectures rather than a sum of isolated solutions. This also translates to optical networking. It leads to a push in enabling multi-vendor optical network by disaggregating HW and SW functions and focusing on interoperability. In this paradigm, the burden of responsibility for ensuring the performance of such disaggregated open optical systems falls on the operators. Consequently, operators and vendors are collaborating in defining control models that can be readily used by off-the-shelf controllers. However, node and network models are only part of the answer. To take reasonable decisions, controllers need to incorporate logic to simulate and assess optical performance. Hence, a vendor-independent optical quality estimator is required. Given its vendor-agnostic nature, such an estimator needs to be driven by a consortium of operators, system and component suppliers.

Founded in February 2016, the Telecom Infra Project (TIP) is an engineering-focused initiative which is operator driven, but features collaboration across operators, suppliers, developers, integrators, and startups with the goal of disaggregating the traditional network deployment approach. The group’s ultimate goal is to help provide better connectivity for communities all over the world as more people come on-line and demand more bandwidth- intensive experiences like video, virtual reality and augmented reality.

Within TIP, the Open Optical Packet Transport (OOPT) project group is chartered with unbundling monolithic packet-optical network technologies in order to unlock innovation and support new, more flexible connectivity paradigms.

The key to unbundling is the ability to accurately plan and predict the performance of optical line systems based on an accurate simulation of optical parameters. Under that OOPT umbrella, the Physical Simulation Environment (PSE) working group set out to disrupt the planning landscape by providing an open source simulation model which can be used freely across multiple vendor implementations.


We believe that openly sharing ideas, specifications, and other intellectual property is the key to maximizing innovation and reducing complexity

TIP OOPT/PSE's 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 is distributed under a standard BSD 3-Clause License.

See LICENSE for more details.