# Simulating networks with GNPy¶

Running simulations with GNPy requires three pieces of information:

the network topology, which describes how the network looks like, what are the fiber lengths, what amplifiers are used, etc.,

the equipment library, which holds machine-readable datasheets of the equipment used in the network,

the simulation options holding instructions about what to simulate, and under which conditions.

## Network Topology¶

The *topology* acts as a “digital self” of the simulated network.
When given a network topology, GNPy can either run a specific simulation as-is, or it can *optimize* the topology before performing the simulation.

A network topology for GNPy is often a generic, mesh network.
This enables GNPy to take into consideration the current spectrum allocation as well as availability and resiliency considerations.
When the time comes to run a particular *propagation* of a signal and its impairments are computed, though, a linear path through the network is used.
For this purpose, the *path* through the network refers to an ordered, acyclic sequence of *nodes* that are processed.
This path is directional, and all “GNPy elements” along the path match the unidirectional part of a real-world network equipment.

Note

In practical terms, an amplifier in GNPy refers to an entity with a single input port and a single output port. A real-world inline EDFA enclosed in a single chassis will be therefore represented as two GNPy-level amplifiers.

The network topology contains not just the physical topology of the network, but also references to the equipment library and a set of *operating parameters* for each entity.
These parameters include the **fiber length** of each fiber, the connector **attenutation losses**, or an amplifier’s specific **gain setting**.
The topology is specified via XLS files or via JSON.

### Fully Specified vs. Partially Designed Networks¶

Let’s consider a simple triangle topology with three PoPs covering three cities:

In the real world, each city would probably host a ROADM and some transponders:

GNPy simulation works by propagating the optical signal over a sequence of elements, which means that one has to add some preamplifiers and boosters. The amplifiers are, by definition, unidirectional, so the graph becomes quite complex:

In many regions, the ROADMs are not placed physically close to each other, so the long-haul fiber links (OMS) are split into individual spans (OTS) by in-line amplifiers, resulting in an even more complicated topology graphs:

In such networks, GNPy’s autodesign features becomes very useful. It is possible to connect ROADMs via “tentative links” which will be replaced by a sequence of actual fibers and specific amplifiers. In other cases where the location of amplifier huts is already known, but the specific EDFA models have not yet been decided, one can put in amplifier placeholders and let GNPy assign the best amplifier.

## The Equipment Library¶

In order to produce an accurate simulation, GNPy needs to know the physical properties of each entity which affects the optical signal. Entries in the equipment library correspond to actual real-world, tangible entities. Unlike a typical NMS, GNPy considers not just the active NEs such as amplifiers and ROADMs, but also the passive ones, such as the optical fiber.

As the signal propagates through the network, the largest source of optical impairments is the noise introduced from amplifiers.
An accurate description of the EDFA and especially its noise characteristics is required.
GNPy describes this property in terms of the **Noise Figure (NF)** of an amplifier model as a function of its operating point.

The amplifiers compensate power losses induced on the signal in the optical fiber.
The linear losses, however, are just one phenomenon of a multitude of effects that affect the signals in a long fiber run.
While a more detailed description is available in the literature, for the purpose of the equipment library, the description of the *optical fiber* comprises its **linear attenutation coefficient**, a set of parameters for the **Raman effect**, optical **dispersion**, etc.

Signals are introduced into the network via *transponders*.
The set of parameters that are required describe the physical properties of each supported *mode* of the transponder, including its **symbol rate**, spectral **width**, etc.

In the junctions of the network, *ROADMs* are used for spectrum routing.
GNPy currently does not take into consideration the spectrum filtering penalties of the WSSes, but the equipment library nonetheless contains a list of required parameters, such as the attenuation options, so that the network can be properly simulated.

### Amplifier Noise Figure Models¶

One of the key parameters of an amplifier is the method to use for computing the Noise Figure (NF). GNPy supports several different noise models with varying level of accuracy. When in doubt, contact your vendor’s technical support and ask them to contribute their equipment descriptions to GNPy.

The most accurate noise models describe the resulting NF of an EDFA as a third-degree polynomial. GNPy understands polynomials as a NF-yielding function of the gain difference from the optimal gain, or as a function of the input power resulting in an incremental OSNR as used in OpenROADM inline amplifiers and OpenROADM booster/preamps in the ROADMs. For scenarios where the vendor has not yet contributed an accurate EDFA NF description to GNPy, it is possible to approximate the characteristics via an operator-focused, min-max NF model.

#### Min-max NF¶

This is an operator-focused model where performance is defined by the *minimal* and *maximal NF*.
These are especially suited to model a dual-coil EDFA with a VOA in between.
In these amplifiers, the minimal NF is achieved when the EDFA operates at its maximal (and usually optimal, in terms of flatness) gain.
The worst (maximal) NF applies when the EDFA operates at its minimal gain.

This model is suitable for use when the vendor has not provided a more accurate performance description of the EDFA.

#### Raman Approximation¶

While GNPy is fully Raman-aware, under certain scenarios it is useful to be able to run a simulation without an accurate Raman description. For these purposes the polynomial NF model with \(\text{a} = \text{b} = \text{c} = 0\), and \(\text{d} = NF\) can be used.

## Simulation¶

When the network model has been instantiated and the physical properties and operational settings of the actual physical devices are known, GNPy can start simulating how the signal propagate through the optical fiber.

This set of input parameters include options such as the *spectrum allocation*, i.e., the number of channels and their spacing.
Various strategies for network optimization can be provided as well.