diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..bb1e511 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,103 @@ +on: + push: + pull_request: + branches: + - main + +name: GNPY-API-CI + +jobs: + linters: + name: Lint Code + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install dependencies + run: | + pip install tox + - name: Run linters + run: | + tox -e linters + + build: + name: Tox test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: fedora-python/tox-github-action@v37.0 + with: + tox_env: ${{ matrix.tox_env }} + dnf_install: ${{ matrix.dnf_install }} + - uses: codecov/codecov-action@v3.1.1 + if: ${{ endswith(matrix.tox_env, '-cover') }} + with: + files: ${{ github.workspace }}/cover/coverage.xml + strategy: + fail-fast: false + matrix: + tox_env: + - py38 + - py39 + - py310 + - py311 + - py312-cover + include: + - tox_env: docs + dnf_install: graphviz + + other-platforms: + name: Tests on other platforms + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python_version }} + - run: | + pip install --editable .[tests] + pytest -vv + strategy: + fail-fast: false + matrix: + include: + - os: windows-2019 + python_version: "3.10" + - os: windows-2022 + python_version: "3.11" + - os: windows-2022 + python_version: "3.12" + - os: macos-13 + python_version: "3.12" + - os: macos-14 + python_version: "3.12" + + paywalled-platforms: + name: Tests on paywalled platforms + if: github.repository_owner == 'Telecominfraproject' + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python_version }} + - run: | + pip install --editable .[tests] + pytest -vv + strategy: + fail-fast: false + matrix: + include: + - os: macos-13-xlarge # Apple M1 CPU + python_version: "3.12" diff --git a/README.md b/README.md new file mode 100644 index 0000000..6cbcda7 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# GNPy API + + +REST API (experimental) +----------------------- +``gnpyapi`` provides an experimental api for requesting several paths at once. It is based on Flask server. +You can run it through command line or Docker. + +.. code-block:: shell-session + + $ gnpy-rest + +.. code-block:: shell-session + + $ docker run -p 8080:8080 -it emmanuelledelfour/gnpy-experimental:candi-1.1 gnpy-rest + +When starting the api server will aks for an encryption/decryption key. This key i used to encrypt equipment file when using /api/v1/equipments endpoint. +This key is a Fernet key and can be generated this way: + +.. code-block:: python + +from cryptography.fernet import Fernet +Fernet.generate_key() + + +After typing the key, you can detach the container by typing ^P^Q. +After starting the api server, you can launch a request + +.. code-block:: shell-session + + $ curl -v -X POST -H "Content-Type: application/json" -d @ https://localhost:8080/api/v1/path-computation -k + +TODO: api documentation, unit tests, real WSGI server with trusted certificates + +## Quick Start + +tbd \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile new file mode 100755 index 0000000..add4388 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = python -msphinx +SPHINXPROJ = GNPyAPI +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/images/GNPy-logo.png b/docs/images/GNPy-logo.png new file mode 100755 index 0000000..3618ea5 Binary files /dev/null and b/docs/images/GNPy-logo.png differ diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..8e84af4 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,19 @@ +GNPy API : Optical Route Planning API +===================================================================== + +`GNPy `_ + +tbd + +.. toctree:: + :maxdepth: 4 + + intro + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/docs/intro.rst b/docs/intro.rst new file mode 100644 index 0000000..6ca9b20 --- /dev/null +++ b/docs/intro.rst @@ -0,0 +1,6 @@ +.. _intro: + +Introduction +============ + +tbd \ No newline at end of file diff --git a/docs/make.bat b/docs/make.bat new file mode 100755 index 0000000..8f9d537 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,36 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=python -msphinx +) +set SOURCEDIR=. +set BUILDDIR=_build +set SPHINXPROJ=GNPyAPI + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The Sphinx module was not found. Make sure you have Sphinx installed, + echo.then set the SPHINXBUILD environment variable to point to the full + echo.path of the 'sphinx-build' executable. Alternatively you may add the + echo.Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% + +:end +popd diff --git a/gnpyapi/core/__init__.py.py b/gnpyapi/core/__init__.py.py new file mode 100644 index 0000000..746e650 --- /dev/null +++ b/gnpyapi/core/__init__.py.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python + +"""GNPy official API +""" diff --git a/gnpyapi/exampledata/planning_demand_example.json b/gnpyapi/exampledata/planning_demand_example.json new file mode 100644 index 0000000..165be1d --- /dev/null +++ b/gnpyapi/exampledata/planning_demand_example.json @@ -0,0 +1,1080 @@ +{ + "service":{ + "path-request": [ + { + "request-id": "0", + "source": "trx Alice", + "destination": "trx Bob", + "src-tp-id": "trx Alice", + "dst-tp-id": "trx Bob", + "bidirectional": false, + "path-constraints": { + "te-bandwidth": { + "technology": "flexi-grid", + "trx_type": "Voyager", + "trx_mode": "mode 1", + "effective-freq-slot": [ + { + "N": "null", + "M": "null" + } + ], + "spacing": 50000000000.0, + "max-nb-of-channel": null, + "output-power": null, + "path_bandwidth": 100000000000.0 + } + } + }, + { + "request-id": "1", + "source": "trx Alice", + "destination": "trx Bob", + "src-tp-id": "trx Alice", + "dst-tp-id": "trx Bob", + "bidirectional": false, + "path-constraints": { + "te-bandwidth": { + "technology": "flexi-grid", + "trx_type": "Voyager", + "trx_mode": "mode 1", + "effective-freq-slot": [ + { + "N": "null", + "M": "null" + } + ], + "spacing": 50000000000.0, + "max-nb-of-channel": null, + "output-power": null, + "path_bandwidth": 100000000000.0 + } + } + }, + { + "request-id": "2", + "source": "trx Alice", + "destination": "trx Bob", + "src-tp-id": "trx Alice", + "dst-tp-id": "trx Bob", + "bidirectional": false, + "path-constraints": { + "te-bandwidth": { + "technology": "flexi-grid", + "trx_type": "Voyager", + "trx_mode": null, + "effective-freq-slot": [ + { + "N": "null", + "M": "null" + } + ], + "spacing": 50000000000.0, + "max-nb-of-channel": null, + "output-power": null, + "path_bandwidth": 100000000000.0 + } + } + }, + { + "request-id": "3", + "source": "trx Alice", + "destination": "trx Bob", + "src-tp-id": "trx Alice", + "dst-tp-id": "trx Bob", + "bidirectional": false, + "path-constraints": { + "te-bandwidth": { + "technology": "flexi-grid", + "trx_type": "Voyager", + "trx_mode": null, + "effective-freq-slot": [ + { + "N": "null", + "M": "null" + } + ], + "spacing": 50000000000.0, + "max-nb-of-channel": null, + "output-power": null, + "path_bandwidth": 100000000000.0 + } + }, + "explicit-route-objects": { + "route-object-include-exclude": [ + { + "explicit-route-usage": "route-include-ero", + "index": 0, + "num-unnum-hop": { + "node-id": "Carol", + "link-tp-id": "link-tp-id is not used", + "hop-type": "LOOSE" + } + } + ] + } + } + ], + "synchronization": [ + { + "synchronization-id": "1", + "svec": { + "relaxable": "false", + "disjointness": "node link", + "request-id-number": [ + "1", + "0" + ] + } + } + ] + }, + "topology": { + "elements": [ + { + "uid": "trx Alice", + "type": "Transceiver", + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Alice", + "region": "" + } + } + }, + { + "uid": "trx Bob", + "type": "Transceiver", + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Bob", + "region": "" + } + } + }, + { + "uid": "trx Carol", + "type": "Transceiver", + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Carol", + "region": "" + } + } + }, + { + "uid": "roadm Alice", + "type": "Roadm", + "params": { + "target_pch_out_db": -20, + "restrictions": { + "preamp_variety_list": [], + "booster_variety_list": [] + } + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Alice", + "region": "" + } + } + }, + { + "uid": "roadm Bob", + "type": "Roadm", + "params": { + "target_pch_out_db": -20, + "restrictions": { + "preamp_variety_list": [], + "booster_variety_list": [] + } + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Bob", + "region": "" + } + } + }, + { + "uid": "roadm Carol", + "type": "Roadm", + "params": { + "target_pch_out_db": -20, + "restrictions": { + "preamp_variety_list": [], + "booster_variety_list": [] + } + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Carol", + "region": "" + } + } + }, + { + "uid": "fiber (Alice → Bob)-", + "type": "Fiber", + "type_variety": "SSMF", + "params": { + "length": 75.0, + "loss_coef": 0.2, + "length_units": "km", + "att_in": 0, + "con_in": 0, + "con_out": 0 + }, + "metadata": { + "location": { + "latitude": 0.0, + "longitude": 0.0, + "city": null, + "region": null + } + } + }, + { + "uid": "fiber (Bob → Carol)-", + "type": "Fiber", + "type_variety": "SSMF", + "params": { + "length": 80.0, + "loss_coef": 0.2, + "length_units": "km", + "att_in": 0, + "con_in": 0, + "con_out": 0 + }, + "metadata": { + "location": { + "latitude": 0.0, + "longitude": 0.0, + "city": null, + "region": null + } + } + }, + { + "uid": "fiber (Carol → Dan)-", + "type": "Fiber", + "type_variety": "SSMF", + "params": { + "length": 83.0, + "loss_coef": 0.2, + "length_units": "km", + "att_in": 0, + "con_in": 0, + "con_out": 0 + }, + "metadata": { + "location": { + "latitude": 0.0, + "longitude": 0.0, + "city": null, + "region": null + } + } + }, + { + "uid": "fiber (Dan → Alice)-", + "type": "Fiber", + "type_variety": "SSMF", + "params": { + "length": 60.0, + "loss_coef": 0.2, + "length_units": "km", + "att_in": 0, + "con_in": 0, + "con_out": 0 + }, + "metadata": { + "location": { + "latitude": 0.0, + "longitude": 0.0, + "city": null, + "region": null + } + } + }, + { + "uid": "fiber (Bob → Alice)-", + "type": "Fiber", + "type_variety": "SSMF", + "params": { + "length": 75.0, + "loss_coef": 0.2, + "length_units": "km", + "att_in": 0, + "con_in": 0, + "con_out": 0 + }, + "metadata": { + "location": { + "latitude": 0.0, + "longitude": 0.0, + "city": null, + "region": null + } + } + }, + { + "uid": "fiber (Carol → Bob)-", + "type": "Fiber", + "type_variety": "SSMF", + "params": { + "length": 80.0, + "loss_coef": 0.2, + "length_units": "km", + "att_in": 0, + "con_in": 0, + "con_out": 0 + }, + "metadata": { + "location": { + "latitude": 0.0, + "longitude": 0.0, + "city": null, + "region": null + } + } + }, + { + "uid": "fiber (Dan → Carol)-", + "type": "Fiber", + "type_variety": "SSMF", + "params": { + "length": 83.0, + "loss_coef": 0.2, + "length_units": "km", + "att_in": 0, + "con_in": 0, + "con_out": 0 + }, + "metadata": { + "location": { + "latitude": 0.0, + "longitude": 0.0, + "city": null, + "region": null + } + } + }, + { + "uid": "fiber (Alice → Dan)-", + "type": "Fiber", + "type_variety": "SSMF", + "params": { + "length": 60.0, + "loss_coef": 0.2, + "length_units": "km", + "att_in": 0, + "con_in": 0, + "con_out": 0 + }, + "metadata": { + "location": { + "latitude": 0.0, + "longitude": 0.0, + "city": null, + "region": null + } + } + }, + { + "uid": "east edfa in Alice to Bob", + "type": "Edfa", + "type_variety": "std_medium_gain", + "operational": { + "gain_target": 18.5, + "delta_p": -1.5, + "tilt_target": 0, + "out_voa": 0 + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Alice", + "region": "" + } + } + }, + { + "uid": "east edfa in Bob to Carol", + "type": "Edfa", + "type_variety": "std_medium_gain", + "operational": { + "gain_target": 19.0, + "delta_p": -1.0, + "tilt_target": 0, + "out_voa": 0 + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Bob", + "region": "" + } + } + }, + { + "uid": "east edfa in Carol to Dan", + "type": "Edfa", + "type_variety": "std_medium_gain", + "operational": { + "gain_target": 19.0, + "delta_p": -1.0, + "tilt_target": 0, + "out_voa": 0 + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Carol", + "region": "" + } + } + }, + { + "uid": "east edfa in Dan to Alice", + "type": "Edfa", + "type_variety": "std_medium_gain", + "operational": { + "gain_target": 15.600000000000001, + "delta_p": -2, + "tilt_target": 0, + "out_voa": 0 + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Dan", + "region": "" + } + } + }, + { + "uid": "east edfa in Bob to Alice", + "type": "Edfa", + "type_variety": "std_medium_gain", + "operational": { + "gain_target": 18.5, + "delta_p": -1.5, + "tilt_target": 0, + "out_voa": 0 + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Bob", + "region": "" + } + } + }, + { + "uid": "east edfa in Alice to Dan", + "type": "Edfa", + "type_variety": "std_medium_gain", + "operational": { + "gain_target": 18, + "delta_p": -2, + "tilt_target": 0, + "out_voa": 0 + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Alice", + "region": "" + } + } + }, + { + "uid": "east edfa in Carol to Bob", + "type": "Edfa", + "type_variety": "std_medium_gain", + "operational": { + "gain_target": 19.0, + "delta_p": -1.0, + "tilt_target": 0, + "out_voa": 0 + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Carol", + "region": "" + } + } + }, + { + "uid": "west edfa in Alice to Bob", + "type": "Edfa", + "type_variety": "std_medium_gain", + "operational": { + "gain_target": 16.5, + "delta_p": 0, + "tilt_target": 0, + "out_voa": 0 + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Alice", + "region": "" + } + } + }, + { + "uid": "west edfa in Bob to Carol", + "type": "Edfa", + "type_variety": "std_medium_gain", + "operational": { + "gain_target": 17.0, + "delta_p": 0, + "tilt_target": 0, + "out_voa": 0 + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Bob", + "region": "" + } + } + }, + { + "uid": "west edfa in Carol to Dan", + "type": "Edfa", + "type_variety": "std_medium_gain", + "operational": { + "gain_target": 17.6, + "delta_p": 0, + "tilt_target": 0, + "out_voa": 0 + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Carol", + "region": "" + } + } + }, + { + "uid": "west edfa in Dan to Alice", + "type": "Edfa", + "type_variety": "std_medium_gain", + "operational": { + "gain_target": 13.0, + "delta_p": -1.0, + "tilt_target": 0, + "out_voa": 0 + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Dan", + "region": "" + } + } + }, + { + "uid": "west edfa in Bob to Alice", + "type": "Edfa", + "type_variety": "std_medium_gain", + "operational": { + "gain_target": 16.5, + "delta_p": 0, + "tilt_target": 0, + "out_voa": 0 + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Bob", + "region": "" + } + } + }, + { + "uid": "west edfa in Alice to Dan", + "type": "Edfa", + "type_variety": "std_medium_gain", + "operational": { + "gain_target": 14.0, + "delta_p": 0, + "tilt_target": 0, + "out_voa": 0 + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Alice", + "region": "" + } + } + }, + { + "uid": "west edfa in Carol to Bob", + "type": "Edfa", + "type_variety": "std_medium_gain", + "operational": { + "gain_target": 17.0, + "delta_p": 0, + "tilt_target": 0, + "out_voa": 0 + }, + "metadata": { + "location": { + "latitude": 0, + "longitude": 0, + "city": "Carol", + "region": "" + } + } + } + ], + "connections": [ + { + "from_node": "trx Alice", + "to_node": "roadm Alice" + }, + { + "from_node": "trx Bob", + "to_node": "roadm Bob" + }, + { + "from_node": "trx Carol", + "to_node": "roadm Carol" + }, + { + "from_node": "roadm Alice", + "to_node": "east edfa in Alice to Bob" + }, + { + "from_node": "roadm Alice", + "to_node": "east edfa in Alice to Dan" + }, + { + "from_node": "roadm Alice", + "to_node": "trx Alice" + }, + { + "from_node": "roadm Bob", + "to_node": "east edfa in Bob to Alice" + }, + { + "from_node": "roadm Bob", + "to_node": "east edfa in Bob to Carol" + }, + { + "from_node": "roadm Bob", + "to_node": "trx Bob" + }, + { + "from_node": "roadm Carol", + "to_node": "east edfa in Carol to Bob" + }, + { + "from_node": "roadm Carol", + "to_node": "east edfa in Carol to Dan" + }, + { + "from_node": "roadm Carol", + "to_node": "trx Carol" + }, + { + "from_node": "fiber (Alice → Bob)-", + "to_node": "west edfa in Bob to Alice" + }, + { + "from_node": "fiber (Bob → Carol)-", + "to_node": "west edfa in Carol to Bob" + }, + { + "from_node": "fiber (Carol → Dan)-", + "to_node": "east edfa in Dan to Alice" + }, + { + "from_node": "fiber (Dan → Alice)-", + "to_node": "west edfa in Alice to Dan" + }, + { + "from_node": "fiber (Bob → Alice)-", + "to_node": "west edfa in Alice to Bob" + }, + { + "from_node": "fiber (Carol → Bob)-", + "to_node": "west edfa in Bob to Carol" + }, + { + "from_node": "fiber (Dan → Carol)-", + "to_node": "west edfa in Carol to Dan" + }, + { + "from_node": "fiber (Alice → Dan)-", + "to_node": "west edfa in Dan to Alice" + }, + { + "from_node": "east edfa in Alice to Bob", + "to_node": "fiber (Alice → Bob)-" + }, + { + "from_node": "east edfa in Bob to Carol", + "to_node": "fiber (Bob → Carol)-" + }, + { + "from_node": "east edfa in Carol to Dan", + "to_node": "fiber (Carol → Dan)-" + }, + { + "from_node": "east edfa in Dan to Alice", + "to_node": "fiber (Dan → Alice)-" + }, + { + "from_node": "east edfa in Bob to Alice", + "to_node": "fiber (Bob → Alice)-" + }, + { + "from_node": "east edfa in Alice to Dan", + "to_node": "fiber (Alice → Dan)-" + }, + { + "from_node": "east edfa in Carol to Bob", + "to_node": "fiber (Carol → Bob)-" + }, + { + "from_node": "west edfa in Alice to Bob", + "to_node": "roadm Alice" + }, + { + "from_node": "west edfa in Bob to Carol", + "to_node": "roadm Bob" + }, + { + "from_node": "west edfa in Carol to Dan", + "to_node": "roadm Carol" + }, + { + "from_node": "west edfa in Dan to Alice", + "to_node": "fiber (Dan → Carol)-" + }, + { + "from_node": "west edfa in Bob to Alice", + "to_node": "roadm Bob" + }, + { + "from_node": "west edfa in Alice to Dan", + "to_node": "roadm Alice" + }, + { + "from_node": "west edfa in Carol to Bob", + "to_node": "roadm Carol" + } + ] + }, +"equipment":{ + "Edfa":[{ + "type_variety": "high_detail_model_example", + "type_def": "advanced_model", + "gain_flatmax": 25, + "gain_min": 15, + "p_max": 21, + "advanced_config_from_json": "std_medium_gain_advanced_config.json", + "out_voa_auto": false, + "allowed_for_design": false + }, { + "type_variety": "Juniper_BoosterHG", + "type_def": "advanced_model", + "gain_flatmax": 25, + "gain_min": 10, + "p_max": 21, + "advanced_config_from_json": "Juniper-BoosterHG.json", + "out_voa_auto": false, + "allowed_for_design": false + }, + { + "type_variety": "operator_model_example", + "type_def": "variable_gain", + "gain_flatmax": 26, + "gain_min": 15, + "p_max": 23, + "nf_min": 6, + "nf_max": 10, + "out_voa_auto": false, + "allowed_for_design": false + }, + { + "type_variety": "low_noise", + "type_def": "openroadm", + "gain_flatmax": 27, + "gain_min": 12, + "p_max": 22, + "nf_coef": [-8.104e-4,-6.221e-2,-5.889e-1,37.62], + "allowed_for_design": false + }, + { + "type_variety": "standard", + "type_def": "openroadm", + "gain_flatmax": 27, + "gain_min": 12, + "p_max": 22, + "nf_coef": [-5.952e-4,-6.250e-2,-1.071,28.99], + "allowed_for_design": false + }, + { + "type_variety": "std_high_gain", + "type_def": "variable_gain", + "gain_flatmax": 35, + "gain_min": 25, + "p_max": 21, + "nf_min": 5.5, + "nf_max": 7, + "out_voa_auto": false, + "allowed_for_design": true + }, + { + "type_variety": "std_medium_gain", + "type_def": "variable_gain", + "gain_flatmax": 26, + "gain_min": 15, + "p_max": 23, + "nf_min": 6, + "nf_max": 10, + "out_voa_auto": false, + "allowed_for_design": true + }, + { + "type_variety": "std_low_gain", + "type_def": "variable_gain", + "gain_flatmax": 16, + "gain_min": 8, + "p_max": 23, + "nf_min": 6.5, + "nf_max": 11, + "out_voa_auto": false, + "allowed_for_design": true + }, + { + "type_variety": "high_power", + "type_def": "variable_gain", + "gain_flatmax": 16, + "gain_min": 8, + "p_max": 25, + "nf_min": 9, + "nf_max": 15, + "out_voa_auto": false, + "allowed_for_design": false + }, + { + "type_variety": "std_fixed_gain", + "type_def": "fixed_gain", + "gain_flatmax": 21, + "gain_min": 20, + "p_max": 21, + "nf0": 5.5, + "allowed_for_design": false + }, + { + "type_variety": "4pumps_raman", + "type_def": "fixed_gain", + "gain_flatmax": 12, + "gain_min": 12, + "p_max": 21, + "nf0": -1, + "allowed_for_design": false + }, + { + "type_variety": "hybrid_4pumps_lowgain", + "type_def": "dual_stage", + "raman": true, + "gain_min": 25, + "preamp_variety": "4pumps_raman", + "booster_variety": "std_low_gain", + "allowed_for_design": true + }, + { + "type_variety": "hybrid_4pumps_mediumgain", + "type_def": "dual_stage", + "raman": true, + "gain_min": 25, + "preamp_variety": "4pumps_raman", + "booster_variety": "std_medium_gain", + "allowed_for_design": true + }, + { + "type_variety": "medium+low_gain", + "type_def": "dual_stage", + "gain_min": 25, + "preamp_variety": "std_medium_gain", + "booster_variety": "std_low_gain", + "allowed_for_design": true + }, + { + "type_variety": "medium+high_power", + "type_def": "dual_stage", + "gain_min": 25, + "preamp_variety": "std_medium_gain", + "booster_variety": "high_power", + "allowed_for_design": false + } + ], + "Fiber":[{ + "type_variety": "SSMF", + "dispersion": 1.67e-05, + "gamma": 0.00127, + "pmd_coef": 1.265e-15 + }, + { + "type_variety": "NZDF", + "dispersion": 0.5e-05, + "gamma": 0.00146, + "pmd_coef": 1.265e-15 + }, + { + "type_variety": "LOF", + "dispersion": 2.2e-05, + "gamma": 0.000843, + "pmd_coef": 1.265e-15 + } + ], + "Span":[{ + "power_mode":true, + "delta_power_range_db": [-2,3,0.5], + "max_fiber_lineic_loss_for_raman": 0.25, + "target_extended_gain": 2.5, + "max_length": 150, + "length_units": "km", + "max_loss": 28, + "padding": 10, + "EOL": 0, + "con_in": 0, + "con_out": 0 + } + ], + "Roadm":[{ + "target_pch_out_db": -20, + "add_drop_osnr": 38, + "pmd": 0, + "restrictions": { + "preamp_variety_list":[], + "booster_variety_list":[] + } + }], + "SI":[{ + "f_min": 191.3e12, + "baud_rate": 32e9, + "f_max":195.1e12, + "spacing": 50e9, + "power_dbm": 0, + "power_range_db": [0,0,1], + "roll_off": 0.15, + "tx_osnr": 40, + "sys_margins": 2 + }], + "Transceiver":[ + { + "type_variety": "vendorA_trx-type1", + "frequency":{ + "min": 191.35e12, + "max": 196.1e12 + }, + "mode":[{ + "format": "mode 1", + "baud_rate": 32e9, + "OSNR": 11, + "bit_rate": 100e9, + "roll_off": 0.15, + "tx_osnr": 40, + "min_spacing": 37.5e9, + "cost":1 + }, + { + "format": "mode 2", + "baud_rate": 66e9, + "OSNR": 15, + "bit_rate": 200e9, + "roll_off": 0.15, + "tx_osnr": 40, + "min_spacing": 75e9, + "cost":1 + } + ] + }, + { + "type_variety": "Voyager", + "frequency":{ + "min": 191.35e12, + "max": 196.1e12 + }, + "mode":[ + { + "format": "mode 1", + "baud_rate": 32e9, + "OSNR": 12, + "bit_rate": 100e9, + "roll_off": 0.15, + "tx_osnr": 40, + "min_spacing": 37.5e9, + "cost":1 + }, + { + "format": "mode 3", + "baud_rate": 44e9, + "OSNR": 18, + "bit_rate": 300e9, + "roll_off": 0.15, + "tx_osnr": 40, + "min_spacing": 62.5e9, + "cost":1 + }, + { + "format": "mode 2", + "baud_rate": 66e9, + "OSNR": 21, + "bit_rate": 400e9, + "roll_off": 0.15, + "tx_osnr": 40, + "min_spacing": 75e9, + "cost":1 + }, + { + "format": "mode 4", + "baud_rate": 66e9, + "OSNR": 16, + "bit_rate": 200e9, + "roll_off": 0.15, + "tx_osnr": 40, + "min_spacing": 75e9, + "cost":1 + } + ] + } + ] +} +} \ No newline at end of file diff --git a/gnpyapi/yang/gnpy-api@2021-01-06.yang b/gnpyapi/yang/gnpy-api@2021-01-06.yang new file mode 100644 index 0000000..e128cd3 --- /dev/null +++ b/gnpyapi/yang/gnpy-api@2021-01-06.yang @@ -0,0 +1,81 @@ +module gnpy-api { + yang-version 1.1; + namespace "gnpy:gnpy-api"; + prefix gnpyapi; + + import gnpy-network-topology { + prefix gnpynt; + revision-date "2025-01-20"; + } + import gnpy-path-computation { + prefix gnpypc; + revision-date "2025-01-21"; + } + import gnpy-eqpt-config { + prefix gnpyeqpt; + revision-date "2025-01-20"; + } + import ietf-yang-types { + prefix ietftypes; + } + + organization + "Telecom Infra Project OOPT PSE Working Group"; + contact + "WG Web: + contact: + contact: + "; + description + "YANG model for gnpy api input for path computation - TransportPCE preversion"; + + revision 2021-01-06 { + description + "draft for experimental/2020-candi. + Add the possibility to use a topology_id or an equipment_id + "; + reference + "YANG model for api input for path computation with gnpy"; + } + + container service { + description + "Describe the service file to connect to gnpy"; + uses gnpypc:service; + } + container response { + uses gnpypc:response; + description + "Describe the response object to gnpy"; + } + choice topo { + case explicit { + container topology { + description + "Describe the topology file to connect to gnpy"; + uses gnpynt:topo; + } + } + case id { + leaf topology_id { + type ietftypes:uuid; + mandatory true; + } + } + } + choice eqpt { + case explicit { + container equipment { + description + "Describe the equipment library to connect to gnpy"; + uses gnpyeqpt:eqpt; + } + } + case id { + leaf equipment_id { + type ietftypes:uuid; + mandatory true; + } + } + } +} diff --git a/gnpyapi/yang/gnpy-eqpt-config@2020-10-22.yang b/gnpyapi/yang/gnpy-eqpt-config@2020-10-22.yang new file mode 100644 index 0000000..fe90f88 --- /dev/null +++ b/gnpyapi/yang/gnpy-eqpt-config@2020-10-22.yang @@ -0,0 +1,442 @@ +module gnpy-eqpt-config { + yang-version 1; + namespace "gnpy:gnpy-eqpt-config"; + + prefix "gnpyeqpt"; + + organization + "Telecom Infra Project OOPT PSE + Working Group"; + + contact + "WG Web: + contact: + contact: + "; + + description "Base YANG model for gnpy equipment library input for path computation - 2020 - candi preversion"; + + revision "2020-10-22" { + description "draft for experimental/2020-candi"; + reference "Base YANG model for equipment library input for path computation with gnpy"; + } + + /* + * Identities + + + identity edfa-type-def { + description "base identity for variable gain and fixed gain"; + } + + identity variable-gain{ + base edfa-type-def ; + description "'variable_gain' is a simplified model simulating a 2-coil + EDFA with internal, input and output VOAs. The NF vs gain response is calculated + accordingly based on the input parameters: nf_min, nf_max, and gain_flatmax. It + is not a simple interpolation but a 2-stage NF calculation."; + } + + identity fixed-gain{ + base edfa-type-def ; + description "'fixed_gain' is a fixed gain model. NF == Cte == nf0 if gain_min < gain < gain_flatmax"; + } + + identity fiber-variety { + description "base identity for fiber variety"; + } + + identity transceiver-variety { + description "base identity for transceiver variety"; + } + + */ + grouping variable-gain { + leaf nf_min { + type decimal64 { + fraction-digits 2; + } + units dB; + } + leaf nf_max { + type decimal64 { + fraction-digits 2; + } + units dB; + } + leaf out_voa_auto{ + type boolean ; + description "auto_design feature to optimize the amplifier output VOA. If true, output VOA is present + and will be used to push amplifier gain to its maximum, within EOL power margins."; + } + } + + grouping fixed-gain{ + leaf nf0 { + type decimal64 { + fraction-digits 2; + } + units dB; + } + } + + grouping no-type-def{ + leaf advanced_config_from_json { + type string ; + description " filename with json edfa"; + + } + } + + + grouping openroadm{ + leaf-list nf_coef { + type decimal64 { + fraction-digits 5; + } + //default [8.1e-4,6.142e-2,1.558,19.97] ; + } + } + + grouping dual-stage { + leaf raman { + type boolean; + } + leaf preamp_variety { + type leafref { + path "../../Edfa/type_variety"; + } + } + leaf booster_variety { + type leafref { + path "../../Edfa/type_variety"; + } + } + } + + grouping edfa-common { + leaf allowed_for_design{ + type boolean ; + description "If false, the amplifier will not be picked by auto-design but it can still be used as a + manual input (from JSON or Excel template topology files.)"; + } + leaf gain_flatmax { + type decimal64 { + fraction-digits 2; + } + units dB; + } + leaf gain_min { + type decimal64 { + fraction-digits 2; + } + units dB; + } + leaf p_max { + type decimal64 { + fraction-digits 2; + } + units dBm; + } + leaf type_def { + type identityref{ + base edfa-type-def ; + } + } + choice type_of_model { + case variable-gain { + when "type_def = 'variable-gain'"; + uses variable-gain ; + } + case fixed-gain{ + when "type_def = 'fixed-gain'"; + uses fixed-gain; + } + case no-type-def{ + when "type_def = 'no-type-def'"; + uses no-type-def; + } + case openroadm{ + when "type_def = 'openroadm'"; + uses openroadm; + } + case dual_stage { + when "type_def = 'dual_stage'"; + uses dual-stage ; + } + } + } + + grouping common-fiber { + description "common parameters for fiber and raman fiber"; + leaf type_variety { + type string ; + } + description "a unique name to ID the fiber in the JSON or Excel template topology input file"; + leaf dispersion{ + type decimal64 { + fraction-digits 8; + } + units s.m-1.m-1; + } + leaf gamma{ + type decimal64 { + fraction-digits 8; + } + units w-1.m-1 ; + description "2pi.n2/(lambda*Aeff) (w-2.m-1)"; + } + leaf pmd_coef{ + type decimal64 { + fraction-digits 16; + } + units s.sqrt(m)-1; + } + } + + grouping eqpt{ + list Edfa { + key type_variety; + leaf type_variety { + type string; + description "a unique name to ID the amplifier in the JSON/Excel template topology input file"; + } + uses edfa-common; + } + + list Fiber { + key type_variety; + uses common-fiber; + } + + list RamanFiber { + uses common-fiber; + container raman_efficiency { + leaf-list cr { + type decimal64 { + fraction-digits 8; + } + } + leaf-list frequency_offset { + type decimal64 { + fraction-digits 8; + } + } + } + } + + list Span { + leaf power_mode { + type boolean ; + } + leaf-list delta_power_range_db { + type decimal64 { + fraction-digits 2; + } + } + leaf max_length { + type decimal64 { + fraction-digits 2; + } + units km; + default 150.0 ; + } + leaf max_loss { + type decimal64 { + fraction-digits 2; + } + units dB; + } + leaf max_fiber_lineic_loss_for_raman { + type decimal64 { + fraction-digits 2; + } + units dB.km-1; + } + leaf target_extended_gain { + type decimal64 { + fraction-digits 2; + } + units dB; + } + leaf length_units{ + type string ; + default "km"; + } + leaf padding{ + type decimal64 { + fraction-digits 2; + } + default 10.0 ; + } + leaf EOL{ + type decimal64 { + fraction-digits 2; + } + default 0.0 ; + } + leaf con_in{ + type decimal64 { + fraction-digits 2; + } + default 0.0 ; + } + leaf con_out{ + type decimal64 { + fraction-digits 2; + } + default 0.0 ; + } + } + + list Roadm { + leaf target_pch_out_db { + type decimal64 { + fraction-digits 2; + } + } + leaf add_drop_osnr { + type decimal64 { + fraction-digits 2; + } + } + leaf pmd { + type decimal64 { + fraction-digits 2; + } + } + container restrictions { + leaf-list preamp_variety_list { + type string; + } + leaf-list booster_variety_list { + type string; + } + } + } + + list SI { + leaf f_min { + type decimal64 { + fraction-digits 2; + } + } + leaf f_max { + type decimal64 { + fraction-digits 2; + } + } + leaf baud_rate { + type decimal64 { + fraction-digits 2; + } + } + leaf spacing { + type decimal64 { + fraction-digits 2; + } + } + leaf power_dbm { + type decimal64 { + fraction-digits 2; + } + } + leaf-list power_range_db { + type decimal64 { + fraction-digits 2; + } + } + leaf roll_off { + type decimal64 { + fraction-digits 2; + } + } + leaf tx_osnr { + type decimal64 { + fraction-digits 2; + } + } + leaf sys_margins { + type decimal64 { + fraction-digits 2; + } + } + } + + list Transceiver { + leaf type_variety { + type string ; + description "a unique name to ID the transceiver in the JSON or Excel template topology input file"; + } + container frequency { + leaf min { + type decimal64 { + fraction-digits 2; + } + units Hz ; + } + leaf max { + type decimal64 { + fraction-digits 2; + } + units Hz ; + } + description "Min/max frequency of transponder eg 191.35e12 and 196.1e12"; + } + list mode { + leaf format { + type string ; + description "unique name of the mode"; + } + leaf baud_rate { + type decimal64 { + fraction-digits 2; + } + units baud ; + description "baud_rate"; + } + leaf OSNR { + type decimal64 { + fraction-digits 2; + } + units dB ; + description "min required OSNR in 0.1nm (dB)"; + } + leaf tx_osnr { + type decimal64 { + fraction-digits 2; + } + units dB ; + description "min required OSNR in 0.1nm (dB)"; + } + leaf min_spacing { + type decimal64 { + fraction-digits 2; + } + units GHz ; + description "..."; + } + leaf bit_rate { + type decimal64 { + fraction-digits 2; + } + units bit/s ; + description "bit rate"; + } + leaf roll_off { + type decimal64 { + fraction-digits 2; + } + description "..."; + } + leaf cost { + type decimal64 { + fraction-digits 2; + } + description "arbitrary unit"; + } + } + } + } +} + diff --git a/gnpyapi/yang/gnpy-eqpt-config@2025-01-20.yang b/gnpyapi/yang/gnpy-eqpt-config@2025-01-20.yang new file mode 100644 index 0000000..3f423ca --- /dev/null +++ b/gnpyapi/yang/gnpy-eqpt-config@2025-01-20.yang @@ -0,0 +1,770 @@ +module gnpy-eqpt-config { + yang-version 1.1; + namespace "urn:ns:gnpy:equipment_library"; + + prefix "gnpyeqpt"; + + import ietf-optical-impairment-topology { + prefix "oit"; + revision-date 2024-05-21; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + import ietf-layer0-types { + prefix "l0-types"; + revision-date 2024-03-04; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + organization + "Telecom Infra Project OOPT PSE + Working Group"; + + contact + "WG Web: + contact: + contact: + "; + + description "Base YANG model for gnpy equipment library input for path computation - 2020 - candi preversion"; + + revision 2025-01-20 { + description + "Add RamanFiber, design bands, tx_power"; + reference + "Base YANG model for equipment library input for detecon, libyang validation, GNPy4Ofr API"; + } + revision "2024-02-21" { + description "add roadm, fix identity-ref, fix leafref"; + reference "Base YANG model for equipment library input for detecon, libyang validatio, GNPy4Ofr API"; + } + + revision "2023-02-04" { + description "fix pdl, pmd fraction-digit, add advanced_model type def, remove no-type-def"; + reference "Base YANG model for equipment library input for detecon - GNPy"; + } + revision "2022-11-21" { + description "draft for toaster detecon - GNPy API"; + reference "Base YANG model for equipment library input for detecon - GNPy"; + } + revision "2020-10-22" { + description "draft for experimental/2020-candi"; + reference "Base YANG model for equipment library input for path computation with gnpy"; + } + + /* + * Identities + */ + + identity edfa-type-def { + description "base identity for variable gain and fixed gain"; + } + + identity variable_gain { + base edfa-type-def; + description "'variable_gain' is a simplified model simulating a 2-coil + EDFA with internal, input and output VOAs. The NF vs gain response is calculated + accordingly based on the input parameters: nf_min, nf_max, and gain_flatmax. It + is not a simple interpolation but a 2-stage NF calculation."; + } + + identity fixed_gain { + base edfa-type-def; + description "'fixed_gain' is a fixed gain model. NF == Cte == nf0 if gain_min < gain < gain_flatmax"; + } + + identity openroadm { + base edfa-type-def; + description "'openroadm' is an openroadm amplifier type."; + } + + identity multi_band { + base edfa-type-def; + description "multi_band has a combination of amp per frequency band defined with their f_min f_max range"; + } + + identity dual_stage { + base edfa-type-def; + description "dual-stage has two amps defined"; + } + + identity advanced_model { + base edfa-type-def; + description "advanced_model has a combination of amp per frequency band defined with their f_min f_max range"; + } + + identity fiber-variety { + description "base identity for fiber variety"; + } + + identity transceiver-variety { + description "base identity for transceiver variety"; + } + + grouping variable_gain { + leaf nf_min { + type decimal64 { + fraction-digits 2; + } + units dB; + } + leaf nf_max { + type decimal64 { + fraction-digits 2; + } + units dB; + } + } + + grouping fixed_gain{ + leaf nf0 { + type decimal64 { + fraction-digits 2; + } + units dB; + } + } + + grouping openroadm{ + leaf-list nf_coef { + type decimal64 { + fraction-digits 8; + } + //default [8.1e-4,6.142e-2,1.558,19.97] ; + } + } + + grouping dual-stage { + leaf preamp_variety { + type union { + type leafref { + path "../../Edfa/type_variety"; + } + type leafref { + path "../../Edfa/other_name"; + } + } + } + leaf booster_variety { + type union { + type leafref { + path "../../Edfa/type_variety"; + } + type leafref { + path "../../Edfa/other_name"; + } + } + } + } + + grouping multi_band { + leaf-list amplifiers { + type string; + description "list of amplifier type-variety picked in other type-def"; + } + } + + grouping advanced_model { + leaf advanced_config_from_json { + type string; + description + "file name where all noise interp coef, gain ripple, dgt, nf_ripple are detailed"; + } + } + + grouping edfa-common { + leaf allowed_for_design{ + type boolean ; + description "If false, the amplifier will not be picked by auto-design but it can still be used as a + manual input (from JSON or Excel template topology files.)"; + } + leaf gain_flatmax { + type decimal64 { + fraction-digits 2; + } + units dB; + } + leaf gain_min { + type decimal64 { + fraction-digits 2; + } + units dB; + } + leaf gain_extended { + type decimal64 { + fraction-digits 2; + } + units dB; + } + leaf p_max { + type decimal64 { + fraction-digits 2; + } + units dBm; + } + leaf type_def { + type identityref{ + base edfa-type-def; + } + } + leaf raman { + type boolean; + } + leaf out_voa_auto{ + type boolean ; + description "auto_design feature to optimize the amplifier output VOA. If true, output VOA is present + and will be used to push amplifier gain to its maximum, within EOL power margins."; + } + leaf in_voa_auto{ + type boolean ; + description "auto_design feature to optimize the amplifier input VOA. If true, input VOA is present. + TODO: code the function in GNPy"; + } + choice type_of_model { + case variable_gain { + when "type_def = 'gnpyeqpt:variable_gain'"; + uses variable_gain ; + } + case fixed_gain{ + when "type_def = 'gnpyeqpt:fixed_gain'"; + uses fixed_gain; + } + case openroadm{ + when "type_def = 'gnpyeqpt:openroadm'"; + uses openroadm; + } + case dual_stage { + when "type_def = 'gnpyeqpt:dual_stage'"; + uses dual-stage ; + } + case multi_band { + when "type_def = 'gnpyeqpt:multi_band'"; + uses multi_band ; + } + case advanced_model { + when "type_def = 'gnpyeqpt:advanced_model'"; + uses advanced_model; + } + } + } + + grouping common-fiber { + description "common parameters for fiber and raman fiber"; + leaf type_variety { + type string ; + description "a unique name to ID the fiber in the JSON or Excel template topology input file"; + } + leaf dispersion{ + type decimal64 { + fraction-digits 8; + } + units s.m-1.m-1; + } + leaf gamma{ + type decimal64 { + fraction-digits 8; + } + units w-1.m-1 ; + description "2pi.n2/(lambda*Aeff) (w-2.m-1)"; + } + leaf pmd_coef{ + type decimal64 { + fraction-digits 18; + } + units s.sqrt(m)-1; + } + leaf effective_area{ + type decimal64 { + fraction-digits 14; + } + units m-2; + } + } + + grouping range { + leaf min_value { + type decimal64 { + fraction-digits 2; + } + } + leaf max_value { + type decimal64 { + fraction-digits 2; + } + } + leaf step { + type decimal64 { + fraction-digits 2; + } + } + } + + grouping eqpt{ + list Edfa { + config false ; + key type_variety; + leaf type_variety { + type string; + description "a unique name to ID the amplifier in the JSON/Excel template topology input file"; + } + leaf-list other_name { + type string; + description "a list of alternative names for the equipment"; + } + leaf f_min { + type decimal64 { + fraction-digits 1; + } + } + leaf f_max { + type decimal64 { + fraction-digits 1; + } } + uses edfa-common; + } + + grouping frequency-range { + description + "This grouping defines the lower and upper bounds of a + frequency range (e.g., a band). + + This grouping SHOULD NOT be used to define a frequency slot, + which SHOULD be defined using the n and m values instead. + copied from ietf-layer0-types except for units which must be Hz"; + leaf lower-frequency { + type union { + type decimal64 { + fraction-digits 2; + range "0..max"; + } + type empty; + } + units Hz; + mandatory true; + description + "The lower frequency boundary of the + frequency range."; + } + leaf upper-frequency { + type union { + type decimal64 { + fraction-digits 2; + range "0..max"; + } + type empty; + } + units Hz; + must '. > ../lower-frequency' { + error-message + "The upper frequency must be greater than the lower + frequency."; + } + mandatory true; + description + "The upper frequency boundary of the + frequency range."; + } + } + + list Fiber { + config false ; + key type_variety; + uses common-fiber; + } + + list RamanFiber { + config false ; + uses common-fiber; + container raman_efficiency { + leaf-list cr { + type decimal64 { + fraction-digits 9; + } + } + leaf-list frequency_offset { + type decimal64 { + fraction-digits 2; + } + } + } + } + + list Span { + config false ; + leaf power_mode { + type boolean ; + } + container delta_power_range_dict_db { + uses range ; + } + leaf max_length { + type decimal64 { + fraction-digits 2; + } + units km; + default 150.0 ; + } + leaf max_loss { + type decimal64 { + fraction-digits 2; + } + units dB; + } + leaf max_fiber_lineic_loss_for_raman { + type decimal64 { + fraction-digits 2; + } + units dB.km-1; + } + leaf target_extended_gain { + type decimal64 { + fraction-digits 2; + } + units dB; + } + leaf length_units{ + type string ; + default "km"; + } + leaf padding{ + type decimal64 { + fraction-digits 2; + } + default 10.0 ; + } + leaf EOL{ + type decimal64 { + fraction-digits 2; + } + default 0.0 ; + } + leaf con_in{ + type decimal64 { + fraction-digits 2; + } + default 0.0 ; + } + leaf con_out{ + type decimal64 { + fraction-digits 2; + } + default 0.0 ; + } + } + + list Roadm { + config false ; + leaf type_variety { + type string; + } + leaf target_pch_out_db { + type decimal64 { + fraction-digits 2; + } + } + leaf target_psd_out_mWperGHz { + type decimal64 { + fraction-digits 2; + } + } + leaf target_out_mWperSlotWidth { + type decimal64 { + fraction-digits 2; + } + } + leaf add_drop_osnr { + type decimal64 { + fraction-digits 2; + } + } + leaf pmd { + type decimal64 { + fraction-digits 15; + } + } + leaf pdl { + type decimal64 { + fraction-digits 2; + } + } + container restrictions { + leaf-list preamp_variety_list { + type string; + } + leaf-list booster_variety_list { + type string; + } + } + + list roadm-path-impairments { + key "roadm-path-impairments-id"; + config false; + description + "The set of optical impairments related to a ROADM path."; + + leaf roadm-path-impairments-id { + type uint32; + description "index of the ROADM path-impairment list"; + } + choice impairment-type { + description "type path impairment"; + case roadm-express-path { + list roadm-express-path { + description + "The list of optical impairments on a ROADM express + path for different frequency ranges. + Two elements in the list must not have the same range + or overlapping ranges."; + container frequency-range { + description + "The frequency range for which these optical + impairments apply."; + uses frequency-range; + } + // todo: augment express to allow transit OSNR// + uses oit:roadm-express-path; + } + } + case roadm-add-path { + list roadm-add-path { + description + "The list of optical impairments on a ROADM add + path for different frequency ranges. + Two elements in the list must not have the same range + or overlapping ranges."; + container frequency-range { + description + "The frequency range for which these optical + impairments apply."; + uses frequency-range; + } + uses oit:roadm-add-path; + } + } + case roadm-drop-path { + list roadm-drop-path { + description + "The list of optical impairments on a ROADM add + path for different frequency ranges. + Two elements in the list must not have the same range + or overlapping ranges."; + container frequency-range { + description + "The frequency range for which these optical + impairments apply."; + uses frequency-range; + } + uses oit:roadm-drop-path; + } + } + } + } // list path impairments + + } + + list SI { + config false ; + leaf f_min { + type decimal64 { + fraction-digits 2; + } + } + leaf f_max { + type decimal64 { + fraction-digits 2; + } + } + leaf baud_rate { + type decimal64 { + fraction-digits 2; + } + } + leaf spacing { + type decimal64 { + fraction-digits 2; + } + } + leaf power_dbm { + type decimal64 { + fraction-digits 2; + } + } + container power_range_dict_db { + uses range; + } + leaf roll_off { + type decimal64 { + fraction-digits 2; + } + } + leaf tx_osnr { + type decimal64 { + fraction-digits 2; + } + } + leaf tx_power_dbm { + type decimal64 { + fraction-digits 2; + } + } + leaf type_variety { + type string ; + description "a unique name to ID the SI band"; + } + leaf sys_margins { + type decimal64 { + fraction-digits 2; + } + } + } + + list Transceiver { + config false ; + leaf type_variety { + type string ; + description "a unique name to ID the transceiver in the JSON or Excel template topology input file"; + } + leaf-list other_name { + type string; + description "a list of alternative names for the equipment"; + } + leaf comment { + type string; + description "free string"; + } + container frequency { + leaf min { + type decimal64 { + fraction-digits 2; + } + units Hz ; + } + leaf max { + type decimal64 { + fraction-digits 2; + } + units Hz ; + } + description "Min/max frequency of transponder eg 191.35e12 and 196.1e12"; + } + list mode { + config false ; + leaf format { + type string ; + description "unique name of the mode"; + } + leaf-list other_name { + type string; + description "a list of alternative names for the mode"; + } + leaf baud_rate { + type decimal64 { + fraction-digits 2; + } + units baud ; + description "baud_rate"; + } + leaf OSNR { + type decimal64 { + fraction-digits 2; + } + units dB ; + description "min required OSNR in 0.1nm (dB)"; + } + leaf tx_osnr { + type decimal64 { + fraction-digits 2; + } + units dB ; + description "min required OSNR in 0.1nm (dB)"; + } + leaf min_spacing { + type decimal64 { + fraction-digits 2; + } + units GHz ; + description "..."; + } + leaf bit_rate { + type decimal64 { + fraction-digits 2; + } + units bit/s ; + description "bit rate"; + } + leaf roll_off { + type union { + type decimal64 { + fraction-digits 2; + } + type empty; + } + description "..."; + } + leaf cost { + type decimal64 { + fraction-digits 2; + } + description "arbitrary unit"; + } + list penalties { + leaf chromatic_dispersion { + type decimal64 { + fraction-digits 2; + } + description "chromatic dispersion"; + } + leaf pmd { + type decimal64 { + fraction-digits 15; + } + description "Polarization mode dispersion"; + } + leaf pdl { + type decimal64 { + fraction-digits 2; + } + description "Polarization dependant loss"; + } + leaf penalty_value { + type decimal64 { + fraction-digits 2; + } + } + } + leaf equalization_offset_db { + type decimal64 { + fraction-digits 4; + } + description "Power offset for equalizing this mode in ROADM compared to reference channel"; + } + leaf equalization_slot_width { + type decimal64 { + fraction-digits 2; + } + description "slot width used for equalization instead of min_spacing in case of + equalization per slot width"; + } + } + } + } + + augment "/gnpyeqpt:equipment/gnpyeqpt:Roadm/gnpyeqpt:roadm-path-impairments/" + + "gnpyeqpt:impairment-type/gnpyeqpt:roadm-express-path/" + + "gnpyeqpt:roadm-express-path" { + leaf roadm-osnr { + type l0-types:snr-or-null; + description + "Optical Signal-to-Noise Ratio (OSNR). + If the express path contains an integrated amplifier, + this reflects its OSNR contribution."; + } + } + + container equipment { + description + "Describe the equipment library of gnpy release 2.6"; + uses eqpt; + } +} + diff --git a/gnpyapi/yang/gnpy-network-topology@2020-10-22.yang b/gnpyapi/yang/gnpy-network-topology@2020-10-22.yang new file mode 100644 index 0000000..2d4b442 --- /dev/null +++ b/gnpyapi/yang/gnpy-network-topology@2020-10-22.yang @@ -0,0 +1,300 @@ +module gnpy-network-topology { + yang-version 1.1; + namespace "gnpy:gnpy-network-topology"; + prefix gnpynt; + + organization + "Telecom Infra Project OOPT PSE Working Group"; + contact + "WG Web: + contact: + contact: + "; + description + "YANG model for gnpy network input for path computation - 2020 - candi preversion"; + + revision 2020-10-22 { + description + "draft for experimental/2020-candi"; + reference + "YANG model for network input for path computation with gnpy"; + } + + identity type-element { + description + "Base identity for element type"; + } + + identity Transceiver { + base type-element; + description + " Transceiver element"; + } + + identity Fiber { + base type-element; + description + "Fiber element (unidirectional)"; + } + + identity Roadm { + base type-element; + description + "Roadm element"; + } + + identity Edfa { + base type-element; + description + "Edfa element"; + } + + identity Fused { + base type-element; + description + "Fused element ; non amplified connection between two fiber spans ; + can be used to model optical distribution frame, or losses due to + connectors or fused in a span"; + } + + identity length-unit { + description + "length unit"; + } + + identity km { + base length-unit; + description + "kilometers"; + } + + identity m { + base length-unit; + description + "meter"; + } + + typedef Coordinate { + type decimal64 { + fraction-digits 6; + } + } + + typedef Coef { + type decimal64 { + fraction-digits 2; + } + } + + grouping location-attributes { + container location { + leaf city { + type string; + mandatory true; + } + leaf region { + type string; + mandatory true; + } + leaf latitude { + type Coordinate; + mandatory true; + } + leaf longitude { + type Coordinate; + mandatory true; + } + } + } + + grouping fiber-params { + description + "....."; + leaf length { + type decimal64 { + fraction-digits 2; + } + mandatory true; + } + leaf loss_coef { + type decimal64 { + fraction-digits 2; + } + mandatory true; + units db/km; + description "Loss coefficient of the fiber span (dB/km)"; + } + leaf length_units { + type identityref { + base length-unit; + } + mandatory true; + } + leaf att_in { + type decimal64 { + fraction-digits 2; + } + units "dB"; + mandatory true; + } + leaf con_in { + type decimal64 { + fraction-digits 2; + } + units "dB"; + mandatory true; + } + leaf con_out { + type decimal64 { + fraction-digits 2; + } + units "dB"; + mandatory true; + } + } + + grouping edfa-params { + container operational { + description + "Operational values for the Edfa "; + leaf gain_target { + type decimal64 { + fraction-digits 2; + } + units "dB"; + mandatory true; + description + "gain target of the amplifier (before VOA and after att_in)"; + } + leaf tilt_target { + type decimal64 { + fraction-digits 2; + } + mandatory true; + description + ".."; + } + leaf out_voa { + type decimal64 { + fraction-digits 2; + } + units "dB"; + mandatory true; + description + ".."; + } + leaf delta_p { + type decimal64 { + fraction-digits 2; + } + units "dB"; + mandatory true; + description + "per channel target output power delta with respect to power setting in SI"; + } + } + } + + grouping roadm-params { + leaf target_pch_out_db { + type decimal64 { + fraction-digits 2; + } + units "dB"; + description + ".."; + } + container restrictions { + leaf-list preamp_variety_list { + type string; + description + "List of authorized preamp type-variety"; + } + leaf-list booster_variety_list { + type string; + description + "List of authorized booster type-variety"; + } + } + } + + grouping transceiver-params; + + grouping fused-params{ + leaf loss { + type decimal64 { + fraction-digits 2; + } + units "dB"; + description + "Concentrated loss of the fused element"; + } + } + + grouping element-type-choice { + choice element-type { + case Edfa { + when "type = 'Edfa'"; + uses edfa-params; + } + case FiberRoadm { + container params { + choice fiberroadmfused { + case Fiber { + when "type = 'Fiber'"; + uses fiber-params; + } + case Roadm { + when "type = 'Roadm'"; + uses roadm-params; + } + case Fused { + when "type = 'Fused'"; + uses fused-params; + } + } + } + } + case Transceiver { + when "type = 'Transceiver'"; + } + } + } + + + grouping topo { + list elements { + key "uid"; + leaf uid { + type string; + } + leaf type { + type identityref { + base type-element; + } + mandatory true; + } + leaf type_variety { + type string; + mandatory false; + } + container metadata { + uses location-attributes; + } + uses element-type-choice; + } + list connections { + config false; + leaf from_node { + type leafref { + path "../../elements/uid"; + } + } + leaf to_node { + type leafref { + path "../../elements/uid"; + } + } + } + } +} diff --git a/gnpyapi/yang/gnpy-network-topology@2025-01-20.yang b/gnpyapi/yang/gnpy-network-topology@2025-01-20.yang new file mode 100644 index 0000000..6682e80 --- /dev/null +++ b/gnpyapi/yang/gnpy-network-topology@2025-01-20.yang @@ -0,0 +1,594 @@ +module gnpy-network-topology { + yang-version 1.1; + namespace "gnpy:gnpy-network-topology"; + prefix gnpynt; + + organization + "Telecom Infra Project OOPT PSE Working Group"; + contact + "WG Web: + contact: + contact: + "; + description + "YANG model for gnpy network input for path computation - 2020 - candi preversion"; + + revision 2025-01-20 { + description + "Add RamanFiber, design bands, impairments"; + reference + "YANG model for network input for path computation with gnpy"; + } + + revision 2024-02-21 { + description + "fix namespaces for identity-ref, + add roadm impairment"; + reference + "YANG model for network input for path computation with gnpy"; + } + revision 2023-02-01 { + description + "change per-degree roadm targets + set 6 digits for fiber length + set 6 digits for loss_coef + add type empty for con_in and con_out"; + reference + "YANG model for network input for path computation with gnpy"; + } + revision 2022-11-21 { + description + "draft for detecon - GNPy API"; + reference + "YANG model for network input for path computation with gnpy"; + } + revision 2020-10-22 { + description + "draft for experimental/2020-candi"; + reference + "YANG model for network input for path computation with gnpy"; + } + + identity type-element { + description + "Base identity for element type"; + } + + identity Transceiver { + base type-element; + description + " Transceiver element"; + } + + identity Fiber { + base type-element; + description + "Fiber element (unidirectional)"; + } + + identity RamanFiber { + base type-element; + description + "RamanFiber element (unidirectional)"; + } + + identity Roadm { + base type-element; + description + "Roadm element"; + } + + identity Edfa { + base type-element; + description + "Edfa element"; + } + + identity Fused { + base type-element; + description + "Fused element ; non amplified connection between two fiber spans ; + can be used to model optical distribution frame, or losses due to + connectors or fused in a span"; + } + + identity Multiband_amplifier { + base type-element; + description + "Multiband_amplifier element"; + } + + identity length-unit { + description + "length unit"; + } + + identity km { + base length-unit; + description + "kilometers"; + } + + identity m { + base length-unit; + description + "meter"; + } + + typedef Coordinate { + type decimal64 { + fraction-digits 6; + } + } + + identity pumping-direction { + description + "Raman pumping direction"; + } + + identity coprop { + base pumping-direction; + description + "forward pumping"; + } + + identity counterprop { + base pumping-direction; + description + "backward pumping"; + } + + typedef Coef { + type decimal64 { + fraction-digits 2; + } + } + + + grouping location-attributes { + container location { + leaf city { + type union { + type string; + type empty; + } + mandatory false; + } + leaf region { + type union { + type string; + type empty; + } + mandatory false; + } + leaf latitude { + type Coordinate; + mandatory false; + } + leaf longitude { + type Coordinate; + mandatory false; + } + } + } + + grouping frequency_band { + description + "Used for amplifiers, for design band"; + leaf f_min { + type decimal64 { + fraction-digits 1; + } + units "Hz"; + } + leaf f_max { + type decimal64 { + fraction-digits 1; + } + units "Hz"; + } + } + + grouping fiber-common-params { + description + "Common attributes to fiber and raman fiber"; + leaf length { + type decimal64 { + fraction-digits 6; + } + mandatory true; + } + leaf loss_coef { + type decimal64 { + fraction-digits 6; + } + mandatory true; + units db/km; + description "Loss coefficient of the fiber span (dB/km)"; + } + /* case when loss_coef is a vector + list loss_coef { + leaf-list frequency { + type decimal64 { + fraction-digits 1; + } + units "Hz"; + } + leaf-list value { + type decimal64 { + fraction-digits 6; + } + units "dB/km"; + } + } + */ + leaf length_units { + type identityref { + base length-unit; + } + mandatory true; + } + leaf att_in { + type decimal64 { + fraction-digits 2; + } + units "dB"; + } + leaf con_in { + type union { + type decimal64 { + fraction-digits 2; + } + type empty; + } + units "dB"; + } + leaf con_out { + type union { + type decimal64 { + fraction-digits 2; + } + type empty; + } + units "dB"; + } + } + + grouping raman-fiber-operational { + leaf temperature { + type decimal64 { + fraction-digits 2; + } + } + list raman_pumps { + key "frequency"; + leaf power { + type decimal64 { + fraction-digits 9; + } + } + leaf frequency { + type decimal64 { + fraction-digits 2; + } + } + leaf propagation_direction { + type identityref { + base pumping-direction; + } + } + } + } + + grouping edfa-params { + leaf gain_target { + type union { + type decimal64 { + fraction-digits 6; + } + type empty; + } + units "dB"; + description + "gain target of the amplifier (before VOA and after att_in)"; + } + leaf tilt_target { + type union { + type decimal64 { + fraction-digits 6; + } + type empty; + } + description + ".."; + } + leaf out_voa { + type union { + type decimal64 { + fraction-digits 2; + } + type empty; + } + units "dB"; + description + ".."; + } + leaf in_voa { + type union { + type decimal64 { + fraction-digits 2; + } + type empty; + } + units "dB"; + description + ".."; + } + leaf delta_p { + type union { + type decimal64 { + fraction-digits 6; + } + type empty; + } + units "dB"; + description + "per channel target output power delta with respect to power setting in SI"; + } + } + + grouping multiband-params{ + list amplifiers { + key "type_variety"; + leaf type_variety { + type string; + } + container operational { + description + "Operational values for the Edfa "; + uses edfa-params; + uses frequency_band; + } + } + } + + grouping roadm-trx-params { + list design_bands { + key "f_min"; + uses frequency_band; + } + list per_degree_design_bands { + key "degree_uid"; + leaf degree_uid { + type leafref { + path "../../../../elements/uid"; + } + } + list per_degree_design_band { + key "f_min"; + uses frequency_band; + } + } + } + + grouping roadm-params { + choice target_type { + case constant_power { + leaf target_pch_out_db { + type decimal64 { + fraction-digits 2; + } + units "dBm"; + description + "Target power applied on all channels out of all degrees of the ROADM"; + } + } + case constant_psd { + leaf target_psd_out_mWperGHz { + type decimal64 { + fraction-digits 10; + } + units "mW/GHz"; + description + "Target power spectral density applied on all channels out of all degrees of the ROADM. + target power is computed for each channel using this value multiplied by the baud_rate of + each channel in Ghz. eg target power = 0.0003125 * 32Gbauds = 0.01 mw ie -20 dBm"; + } + } + case constant_psw { + leaf target_out_mWperSlotWidth { + type decimal64 { + fraction-digits 10; + } + units "mW/GHz"; + description + "Target power spectral density applied on all channels out of all degrees of the ROADM. + target power is computed for each channel using this value multiplied by the slot width of + each channel in Ghz. eg target power = 0.0002 * 50GHz = 0.01 mw ie -20 dBm"; + } + } + } + container restrictions { + leaf-list preamp_variety_list { + type string; + description + "List of authorized preamp type-variety"; + } + leaf-list booster_variety_list { + type string; + description + "List of authorized booster type-variety"; + } + } + list per_degree_power_targets { + key "degree_uid"; + leaf degree_uid { + type leafref { + path "../../../../elements/uid"; + } + } + choice per_degree_target_type { + case constant_power { + leaf per_degree_pch_out_db { + type decimal64 { + fraction-digits 2; + } + units "dBm"; + description + "Equalization applied on all channels on this degree. + This target replaces the one defined for all degrees"; + } + } + case constant_psd { + leaf per_degree_psd_out_mWperGHz { + type decimal64 { + fraction-digits 10; + } + units "mW/GHz"; + description + "Equalization applied on all channels on this degree. + This target replaces the one defined for all degrees"; + } + } + case constant_psw { + leaf per_degree_psd_out_mWperSlotWidth { + type decimal64 { + fraction-digits 10; + } + units "mW/GHz"; + description + "Equalization applied on all channels on this degree. + This target replaces the one defined for all degrees"; + } + } + } + } + list per_degree_impairments { + key "from_degree to_degree"; + leaf from_degree { + type leafref { + path "../../../../elements/uid"; + } + } + leaf to_degree { + type leafref { + path "../../../../elements/uid"; + } + } + leaf impairment_id { + type uint32; + } + } + } + + grouping transceiver-params; + + grouping fused-params{ + leaf loss { + type union { + type decimal64 { + fraction-digits 2; + } + type empty; + } + units "dB"; + description + "Concentrated loss of the fused element"; + } + } + + grouping element-type-choice { + container operational { + when "../type = 'gnpynt:Edfa' or ../type = 'gnpynt:RamanFiber'"; + description + "Operational values for the Edfa and the RamanFiber"; + choice ramanfiber { + case RamanFiber { + when "../type = 'gnpynt:RamanFiber'"; + uses raman-fiber-operational; + } + case Edfa { + when "../type = 'gnpynt:Edfa'"; + uses edfa-params; + uses frequency_band; + } + } + } + choice element-type { + case FiberRoadm { + container params { + choice fiberroadmfused { + case Fiber { + when "../type = 'gnpynt:Fiber' or ../type = 'gnpynt:RamanFiber'"; + uses fiber-common-params; + } + case RoadmTransceiver { + when "../type = 'gnpynt:Roadm' or ../type = 'gnpynt:Transceiver'"; + uses roadm-trx-params; + choice roadm { + case roadm { + when "../type = 'gnpynt:Roadm'"; + uses roadm-params; + } + } + } + case Fused { + when "../type = 'gnpynt:Fused'"; + uses fused-params; + } + } + } + } + case Multiband_amplifier { + when "type = 'gnpynt:Multiband_amplifier'"; + uses multiband-params; + } + } + } + + + grouping topo { + list elements { + key "uid"; + leaf uid { + type string; + } + leaf type { + type identityref { + base type-element; + } + mandatory true; + } + leaf type_variety { + type string; + mandatory false; + } + container metadata { + uses location-attributes; + } + uses element-type-choice; + } + list connections { + key "from_node to_node"; + leaf from_node { + type leafref { + path "../../elements/uid"; + } + } + leaf to_node { + type leafref { + path "../../elements/uid"; + } + } + } + } + container topology { + description + "Describe the topology gnpy-formated for release 2.6 toaster (including mixed rate and multiband)"; + uses topo; + leaf network_name { + type string; + mandatory false; + } + } +} diff --git a/gnpyapi/yang/gnpy-path-computation-simplified@2020-10-22.yang b/gnpyapi/yang/gnpy-path-computation-simplified@2020-10-22.yang new file mode 100644 index 0000000..8d61759 --- /dev/null +++ b/gnpyapi/yang/gnpy-path-computation-simplified@2020-10-22.yang @@ -0,0 +1,559 @@ +module gnpy-path-computation-simplified { + yang-version 1.1; + namespace "gnpy:path"; + + prefix "gnpypc"; + + organization + "Telecom Infra Project OOPT PSE Working Group"; + + contact + "WG Web: + contact: + contact: + "; + + description "YANG model for gnpy path computation simplified for - 2020 - candi preversion"; + + revision "2020-10-22" { + description + "draft for experimental/2020-candi"; + reference + "YANG model for path computation with gnpy inputs"; + } + + grouping effective-freq-slot{ + /* content copied from ietf-flexi-grid-media-channel, because only M and N are needed + from the initial grouping. + */ + description "The effective frequency slot is an attribute + of a media channel and, being a frequency slot, it is + described by its nominal central frequency and slot + width"; + reference "rfc7698"; + leaf N { + type int32; + description + "Is used to determine the Nominal Central + Frequency. The set of nominal central frequencies + can be built using the following expression: + f = 193.1 THz + n x 0.00625 THz, + where 193.1 THz is ITU-T ''anchor frequency'' for + transmission over the C band, n is a positive or + negative integer including 0."; + reference "rfc7698"; + } + leaf M { + type uint32; + description + "Is used to determine the slot width. A slot width + is constrained to be M x SWG (that is, M x 12.5 GHz), + where M is an integer greater than or equal to 1."; + reference "rfc7698"; + } + } + + grouping gnpy-specific-parameters{ + description + "This grouping defines the gnpy specific parameters for requests."; + leaf technology { + type string; + default "flexi-grid"; + description + "Data plane technology type."; + } + leaf trx_type { + type string ; + mandatory true; + description "name of the transponder type (to be read from equipment library"; + + } + leaf trx_mode { + type string; + description "name of the transponder mode (to be read from equipment library"; + + } + list effective-freq-slot { + key "N"; + uses effective-freq-slot ; + } + leaf spacing { + mandatory true; + type decimal64 { + fraction-digits 1; + } + units Hz; + description + "It is the spacing between channels assuming full load with + same channels as the requested one. multiple of 12.5 GHz"; + + } + leaf max-nb-of-channel{ + type int32; + description "Nb of channel to take into account for the full load case. + "; + + } + leaf output-power{ + type decimal64 { + fraction-digits 5; + } + units W; + description "optical power setting to be used for the propagation"; + + } + leaf path_bandwidth{ + type decimal64 { + fraction-digits 5; + } + mandatory true; + units bit/s; + description "Capacity required"; + } + } + + identity SNR-bandwidth { + base path-metric-type; + description + "A metric that records SNR in signal bandwidth"; + } + + identity OSNR-bandwidth { + base path-metric-type; + description + "A metric that records OSNR in signal bandwidth"; + } + + identity SNR-0.1nm { + base path-metric-type; + description + "A metric that records SNR in 0.1nm"; + } + + identity OSNR-0.1nm { + base path-metric-type; + description + "A metric that records OSNR in 0.1nm"; + } + + identity reference_power { + base path-metric-type; + description + "to be revised"; + } + + identity path_bandwidth { + base path-metric-type; + description + "to be revised"; + } + + grouping transponder{ + leaf transponder-type { + type string ; + description + "transponder type."; + } + leaf transponder-mode { + type string ; + description + "transponder mode."; + } + } + + grouping hop-attribute{ + description + "This grouping defines the hop attribute parameters for request or response"; + choice hop-type{ + case tsp { + container transponder{ + uses transponder ; + } + } + case regen { + container regenerator{ + leaf regenerator-id{ + type string ; + } + uses transponder ; + } + } + case pow { + container optical-power{ + leaf optical-power{ + type decimal64 { + fraction-digits 5; + } + units W; + description "not used yet. hop output (input??) power"; + } + } + } + } + + } + + identity path-metric-type { + description + "Base identity for path metric type"; + } + + identity route-usage-type { + description + "Base identity for route usage"; + } + + identity route-include-ero { + base route-usage-type; + description + "Include ERO from route"; + } + + identity route-exclude-ero { + base route-usage-type; + description + "Exclude ERO from route"; + } + + identity route-exclude-srlg { + base route-usage-type; + description + "Exclude SRLG from route"; + } + + typedef te-hop-type { + type enumeration { + enum LOOSE { + description + "loose hop in an explicit path"; + } + enum STRICT { + description + "strict hop in an explicit path"; + } + } + description + "enumerated type for specifying loose or strict + paths"; + reference "RFC3209: section-4.3.2"; + } + + typedef te-path-disjointness { + type bits { + bit node { + position 0; + description "Node disjoint."; + } + bit link { + position 1; + description "Link disjoint."; + } + bit srlg { + position 2; + description "SRLG (Shared Risk Link Group) disjoint."; + } + } + description + "Type of the resource disjointness for a TE tunnel path."; + reference + "RFC4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) + Recovery"; + } // te-path-disjointness + + typedef accumulated-metric-type { + type union { + type uint64; + type decimal64 { + fraction-digits 2; + } + } + description + "type useable for accumulative-value"; + } + + grouping path-route-objects { + description + "List of EROs to be included or excluded when performing + the path computation."; + container explicit-route-objects { + description + "Container for the route object list"; + list route-object-include-exclude { + description + "List of explicit route objects to include or + exclude in path computation"; + leaf explicit-route-usage { + type identityref { + base route-usage-type; + } + description "Explicit-route usage."; + } + key "index"; + uses explicit-route-hop ; + } + } + } + + grouping generic-path-disjointness { + description "Path disjointness grouping"; + leaf disjointness { + type te-path-disjointness; + description + "The type of resource disjointness. + Under primary path, disjointness level applies to + all secondary LSPs. Under secondary, disjointness + level overrides the one under primary"; + } + } + + grouping common-path-constraints-attributes { + description + "Common path constraints configuration grouping"; + uses common-constraints_config; + } + + grouping generic-path-constraints { + description + "Global named path constraints configuration + grouping"; + container path-constraints { + description "TE named path constraints container"; + uses common-path-constraints-attributes; + } + } + + + grouping explicit-route-hop { + description + "The explicit route subobject grouping"; + leaf index { + type uint32; + description "ERO subobject index"; + } + choice type { + description + "The explicit route subobject type"; + case num-unnum-hop { + container num-unnum-hop { + leaf node-id { + //type te-node-id; + type string; + description + "The identifier of a node in the TE topology."; + } + leaf link-tp-id { + //type te-tp-id; + type string; + description + "TE link termination point identifier. The combination + of TE link ID and the TE node ID is used to identify an + unnumbered TE link."; + } + leaf hop-type { + type te-hop-type; + description "strict or loose hop"; + } + description + "Numbered and Unnumbered link/node explicit route + subobject"; + } + } + case label { + container label-hop { + description "Label hop type"; + uses effective-freq-slot; + } + description + "The Label ERO subobject"; + } + case hop-attribute{ + uses gnpypc:hop-attribute ; + } + } + } + + grouping common-constraints_config { + description + "Common constraints grouping that can be set on + a constraint set or directly on the tunnel"; + + container te-bandwidth { + uses gnpy-specific-parameters ; + description + "A requested bandwidth to use for path computation"; + } + } + + grouping end-points { + description + "Common grouping to define the TE tunnel end-points"; + + leaf source { + type string; + description "TE tunnel source address."; + } + leaf destination { + type string; + description "P2P tunnel destination address"; + } + leaf src-tp-id { + type string; + description "TE tunnel source termination point identifier."; + } + leaf dst-tp-id { + type string; + description "TE tunnel destination termination point + identifier."; + } + } + + grouping synchronization-info { + description "Information for sync"; + list synchronization { + key "synchronization-id"; + description "sync list"; + leaf synchronization-id { + type string; + description "index"; + } + container svec { + description + "Synchronization VECtor"; + leaf relaxable { + type boolean; + default true; + description + "If this leaf is true, path computation process is free + to ignore svec content. + otherwise it must take into account this svec."; + } + uses generic-path-disjointness; + leaf-list request-id-number { + type string; + description "This list reports the set of M path computation requests that must be synchronized."; + } + } + } + } + + grouping path-metric { + description "TE path metric type"; + leaf metric-type { + type identityref { + base path-metric-type; + } + description "TE path metric type"; + } + leaf accumulative-value { + type decimal64 { + fraction-digits 2; + } + description "TE path metric accumulative value"; + } + } + grouping generic-path-properties { + description "TE generic path properties grouping"; + container path-properties { + config false; + description "The TE path properties"; + list path-metric { + key metric-type; + uses path-metric; + } + list z-a-path-metric { + key metric-type; + uses path-metric; + } + list path-route-objects { + description + "Container for the list of route objects either returned by + the computation engine or actually used by an LSP"; + container path-route-object { + description + "List of route objects either returned by the computation + engine or actually used by an LSP"; + uses explicit-route-hop; + } + } + } + } + + grouping path-info { + uses generic-path-properties; + description "Path computation output information"; + } + +// adding some blocking reasons and info on path in case of blocking + + grouping no-path-info { + description "no-path-info"; + container no-path { + presence "Response without path information, due to failure + performing the path computation"; + leaf no-path { + type string; + mandatory true ; + description + "returned blocking reasons: + NO_PATH + NO_COMPUTED_SNR + NO_FEASIBLE_BAUDRATE_WITH_SPACING + NO_PATH_WITH_CONSTRAINT + NO_FEASIBLE_MODE + MODE_NOT_FEASIBLE + NO_SPECTRUM + "; + } + uses generic-path-properties ; + description "if path computation cannot identify a path, + rpc returns no path."; + } + } + + grouping service { + list path-request { + key "request-id"; + description "request-list"; + leaf request-id { + type string; + mandatory true; + description "Each path computation request is uniquely identified by the request-id-number."; + } + leaf bidirectional { + type boolean; + mandatory true; + description "Specify the bidirectionality of the path"; + } + + uses end-points; + uses path-route-objects; + uses generic-path-constraints; + } + uses synchronization-info; + } + + grouping result { + list response { + key response-id; + config false; + description "response"; + leaf response-id { + type string; + description + "The list key that has to reuse request-id-number."; + } + choice response-type { + config false; + description "response-type"; + case no-path-case { + uses no-path-info; + } + case path-case { + uses path-info; + description "Path computation service."; + } + } + } + } +} diff --git a/gnpyapi/yang/gnpy-path-computation@2025-01-21.yang b/gnpyapi/yang/gnpy-path-computation@2025-01-21.yang new file mode 100644 index 0000000..486f128 --- /dev/null +++ b/gnpyapi/yang/gnpy-path-computation@2025-01-21.yang @@ -0,0 +1,632 @@ +module gnpy-path-computation { + yang-version 1.1; + namespace "gnpy:gnpy-path-computation"; + + prefix "gnpypc"; + + organization + "Telecom Infra Project OOPT PSE Working Group"; + + contact + "WG Web: + contact: + contact: + "; + + description "YANG model for gnpy path computation simplified for - 2020 - candi preversion"; + + revision "2025-01-20" { + description + "Add tx_power"; + reference + "YANG model for path computation with gnpy inputs"; + } + + revision "2022-12-01" { + description + "draft for detecon - GNPy API"; + reference + "YANG model for path computation with gnpy inputs"; + } + + grouping effective-freq-slot{ + /* content copied from ietf-flexi-grid-media-channel, because only M and N are needed + from the initial grouping. + */ + description "The effective frequency slot is an attribute + of a media channel and, being a frequency slot, it is + described by its nominal central frequency and slot + width"; + reference "rfc7698"; + leaf N { + type union { + type int32; + type empty; + } + description + "Is used to determine the Nominal Central + Frequency. The set of nominal central frequencies + can be built using the following expression: + f = 193.1 THz + n x 0.00625 THz, + where 193.1 THz is ITU-T ''anchor frequency'' for + transmission over the C band, n is a positive or + negative integer including 0."; + reference "rfc7698"; + } + leaf M { + type union { + type uint32; + type empty; + } + description + "Is used to determine the slot width. A slot width + is constrained to be M x SWG (that is, M x 12.5 GHz), + where M is an integer greater than or equal to 1."; + reference "rfc7698"; + } + } + + grouping gnpy-specific-parameters{ + description + "This grouping defines the gnpy specific parameters for requests."; + leaf technology { + type string; + default "flexi-grid"; + description + "Data plane technology type."; + } + leaf trx_type { + type string ; + mandatory true; + description "name of the transceiver type (to be read from equipment library"; + + } + leaf trx_mode { + type union { + type string; + type empty; + } + description "name of the transceiver mode (to be read from equipment library"; + + } + list effective-freq-slot { + key "N"; + uses effective-freq-slot ; + } + leaf spacing { + mandatory true; + type decimal64 { + fraction-digits 1; + } + units Hz; + description + "It is the spacing between channels assuming full load with + same channels as the requested one. multiple of 12.5 GHz"; + + } + leaf max-nb-of-channel{ + type union { + type int32; + type empty; + } + description "Nb of channel to take into account for the full load case. + "; + + } + leaf output-power{ + type union { + type decimal64 { + fraction-digits 5; + } + type empty; + } + units W; + description "optical power setting to be used for the propagation"; + + } + leaf tx_power{ + type union { + type decimal64 { + fraction-digits 5; + } + type empty; + } + units W; + description "optical power out of transceiver"; + + } + leaf path_bandwidth{ + type decimal64 { + fraction-digits 1; + } + mandatory true; + units bit/s; + description "Capacity required"; + } + } + + identity SNR-bandwidth { + base path-metric-type; + description + "A metric that records SNR in signal bandwidth"; + } + + identity OSNR-bandwidth { + base path-metric-type; + description + "A metric that records OSNR in signal bandwidth"; + } + + identity SNR-0.1nm { + base path-metric-type; + description + "A metric that records SNR in 0.1nm"; + } + + identity OSNR-0.1nm { + base path-metric-type; + description + "A metric that records OSNR in 0.1nm"; + } + + identity lowest_SNR-0.1nm { + base path-metric-type; + description + "A metric that records the lowest SNR in 0.1nm in spectrum"; + } + + identity PDL_penalty { + base path-metric-type; + description + "A metric that records the PDL penalty."; + } + + identity PMD_penalty { + base path-metric-type; + description + "A metric that records the PMD penalty."; + } + + identity CD_penalty { + base path-metric-type; + description + "A metric that records the CD penalty."; + } + + identity reference_power { + base path-metric-type; + description + "to be revised"; + } + + identity path_bandwidth { + base path-metric-type; + description + "to be revised"; + } + + grouping transponder{ + leaf transponder-type { + type string ; + description + "transceiver type."; + } + leaf transponder-mode { + type string ; + description + "transceiver mode."; + } + } + + grouping hop-attribute{ + description + "This grouping defines the hop attribute parameters for request or response"; + choice hop-type{ + case tsp { + container transponder { + uses transponder ; + } + } + case regen { + container regenerator{ + leaf regenerator-id{ + type string ; + } + uses transponder ; + } + } + case pow { + container optical-power{ + leaf optical-power{ + type decimal64 { + fraction-digits 5; + } + units W; + description "not used yet. hop output (input??) power"; + } + } + } + } + + } + + identity no-path-type { + description + "base for blocking reasons"; + } + + identity NO_PATH { + base no-path-type; + } + + identity NO_PATH_WITH_CONSTRAINT { + base no-path-type; + } + + identity NO_FEASIBLE_BAUDRATE_WITH_SPACING { + base no-path-type; + } + + identity NO_COMPUTED_SNR { + base no-path-type; + } + + identity MODE_NOT_FEASIBLE { + base no-path-type; + } + + identity NO_FEASIBLE_MODE { + base no-path-type; + } + + identity NO_SPECTRUM { + base no-path-type; + } + + identity NOT_ENOUGH_RESERVED_SPECTRUM { + base no-path-type; + } + + + identity path-metric-type { + description + "Base identity for path metric type"; + } + + identity route-usage-type { + description + "Base identity for route usage"; + } + + identity route-include-ero { + base route-usage-type; + description + "Include ERO from route"; + } + + identity route-exclude-ero { + base route-usage-type; + description + "Exclude ERO from route"; + } + + identity route-exclude-srlg { + base route-usage-type; + description + "Exclude SRLG from route"; + } + + typedef te-hop-type { + type enumeration { + enum LOOSE { + description + "loose hop in an explicit path"; + } + enum STRICT { + description + "strict hop in an explicit path"; + } + } + description + "enumerated type for specifying loose or strict + paths"; + reference "RFC3209: section-4.3.2"; + } + + typedef te-path-disjointness { + type bits { + bit node { + position 0; + description "Node disjoint."; + } + bit link { + position 1; + description "Link disjoint."; + } + bit srlg { + position 2; + description "SRLG (Shared Risk Link Group) disjoint."; + } + } + description + "Type of the resource disjointness for a TE tunnel path."; + reference + "RFC4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) + Recovery"; + } // te-path-disjointness + + typedef accumulated-metric-type { + type union { + type uint64; + type decimal64 { + fraction-digits 2; + } + } + description + "type useable for accumulative-value"; + } + + grouping path-route-objects { + description + "List of EROs to be included or excluded when performing + the path computation."; + container explicit-route-objects { + description + "Container for the route object list"; + list route-object-include-exclude { + description + "List of explicit route objects to include or + exclude in path computation"; + leaf explicit-route-usage { + type identityref { + base route-usage-type; + } + description "Explicit-route usage."; + } + key "index"; + uses explicit-route-hop ; + } + } + } + + grouping generic-path-disjointness { + description "Path disjointness grouping"; + leaf disjointness { + type te-path-disjointness; + description + "The type of resource disjointness. + Under primary path, disjointness level applies to + all secondary LSPs. Under secondary, disjointness + level overrides the one under primary"; + } + } + + grouping common-path-constraints-attributes { + description + "Common path constraints configuration grouping"; + uses common-constraints_config; + } + + grouping generic-path-constraints { + description + "Global named path constraints configuration + grouping"; + container path-constraints { + description "TE named path constraints container"; + uses common-path-constraints-attributes; + } + } + + + grouping explicit-route-hop { + description + "The explicit route subobject grouping"; + leaf index { + type uint32; + description "ERO subobject index"; + } + choice subobject-type { + description + "The explicit route subobject type"; + case num-unnum-hop { + container num-unnum-hop { + leaf node-id { + //type te-node-id; + type string; + description + "The identifier of a node in the TE topology."; + } + leaf link-tp-id { + //type te-tp-id; + type string; + description + "TE link termination point identifier. The combination + of TE link ID and the TE node ID is used to identify an + unnumbered TE link."; + } + leaf hop-type { + type te-hop-type; + description "strict or loose hop"; + } + description + "Numbered and Unnumbered link/node explicit route + subobject"; + } + } + case label { + list label-hop { + description "Label hop type"; + config false; + uses effective-freq-slot; + } + description + "The Label ERO subobject"; + } + case hop-attribute{ + uses gnpypc:hop-attribute ; + } + } + } + + grouping common-constraints_config { + description + "Common constraints grouping that can be set on + a constraint set or directly on the tunnel"; + + container te-bandwidth { + uses gnpy-specific-parameters ; + description + "A requested bandwidth to use for path computation"; + } + } + + grouping end-points { + description + "Common grouping to define the TE tunnel end-points"; + + leaf source { + type string; + description "TE tunnel source address."; + } + leaf destination { + type string; + description "P2P tunnel destination address"; + } + leaf src-tp-id { + type string; + description "TE tunnel source termination point identifier."; + } + leaf dst-tp-id { + type string; + description "TE tunnel destination termination point + identifier."; + } + } + + grouping synchronization-info { + description "Information for sync"; + list synchronization { + key "synchronization-id"; + description "sync list"; + leaf synchronization-id { + type string; + description "index"; + } + container svec { + description + "Synchronization VECtor"; + leaf relaxable { + type boolean; + default true; + description + "If this leaf is true, path computation process is free + to ignore svec content. + otherwise it must take into account this svec."; + } + uses generic-path-disjointness; + leaf-list request-id-number { + type string; + description "This list reports the set of M path computation requests that must be synchronized."; + } + } + } + } + + grouping service { + list path-request { + key "request-id"; + description "request-list"; + leaf request-id { + type string; + mandatory true; + description "Each path computation request is uniquely identified by the request-id-number."; + } + leaf bidirectional { + type boolean; + mandatory true; + description "Specify the bidirectionality of the path"; + } + + uses end-points; + uses path-route-objects; + uses generic-path-constraints; + } + uses synchronization-info; + } + + grouping accumulated-metric-object { + leaf metric-type { + type identityref { + base path-metric-type; + } + } + leaf accumulative-value { + type union { + type decimal64 { + fraction-digits 1; + } + type decimal64 { + fraction-digits 2; + } + type decimal64 { + fraction-digits 6; + } + type string; + } + } + } + + grouping response-path-property { + list path-metric { + uses accumulated-metric-object; + } + list z-a-path-metric { + uses accumulated-metric-object; + } + } + + grouping response-path-route-object { + list path-route-objects { + container path-route-object { + uses explicit-route-hop ; + } + } + } + + + grouping response { + list response { + config false; + key response-id; + leaf response-id { + type string; + mandatory true; + description "Each path computation response is uniquely identified by the response-id number."; + } + container path-properties { + uses response-path-property; + uses response-path-route-object; + } + container no-path { + leaf no-path { + type identityref { + base no-path-type; + } + } + container path-properties { + uses response-path-property; + uses response-path-route-object; + } + } + } + } + + container services { + uses service; + } + + container responses { + uses response; + } +} diff --git a/gnpyapi/yang/ietf-layer0-types@2024-03-04.yang b/gnpyapi/yang/ietf-layer0-types@2024-03-04.yang new file mode 100644 index 0000000..45e937c --- /dev/null +++ b/gnpyapi/yang/ietf-layer0-types@2024-03-04.yang @@ -0,0 +1,2247 @@ +module ietf-layer0-types { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-layer0-types"; + prefix l0-types; + + organization + "IETF CCAMP Working Group"; + contact + "WG Web: + WG List: + + Editor: Dieter Beller + + + Editor: Sergio Belotti + + + Editor: Italo Busi + + + Editor: Haomian Zheng + "; + description + "This module defines Optical Layer 0 types. This module + provides groupings that can be applicable to Layer 0 + Fixed Optical Networks (e.g., CWDM (Coarse Wavelength + Division Multiplexing) and DWDM (Dense Wavelength Division + Multiplexing)) and flexi-grid optical networks. + + Copyright (c) 2024 IETF Trust and the persons identified + as authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with + or without modification, is permitted pursuant to, and + subject to the license terms contained in, the Revised + BSD License set forth in Section 4.c of the IETF Trust's + Legal Provisions Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices. + + The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL + NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', + 'MAY', and 'OPTIONAL' in this document are to be interpreted as + described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, + they appear in all capitals, as shown here."; + +// RFC Ed.: replace XXXX with actual RFC number and remove +// this note + +// replace the revision date with the module publication date +// the format is (year-month-day) + revision 2024-03-04 { + description + "To be updated"; + reference + "RFC XXXX: A YANG Data Model for Layer 0 Types"; + } + + revision 2021-08-13 { + description + "Initial version"; + reference + "RFC 9093: A YANG Data Model for Layer 0 Types"; + } + +/* + * Identities + */ + + identity l0-grid-type { + description + "Layer 0 grid type"; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable + (LSC), Label Switching Routers, + + ITU-T G.694.2 (12/2003): Spectral grids for WDM applications: + CWDM wavelength grid"; + } + + identity wson-grid-cwdm { + base l0-grid-type; + description + "CWDM grid"; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers, + + ITU-T G.694.2 (12/2003): Spectral grids for WDM applications: + CWDM wavelength grid"; + } + + identity wson-grid-dwdm { + base l0-grid-type; + description + "DWDM grid"; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable + (LSC), Label Switching Routers, + + ITU-T G.694.1 (10/2020): Spectral grids for WDM applications: + DWDM frequency grid"; + } + + identity flexi-grid-dwdm { + base l0-grid-type; + description + "Flexi-grid"; + reference + "RFC 7699: Generalized Labels for the Flexi-Grid in Lambda + Switch Capable (LSC) Label Switching Routers, + + ITU-T G.694.1 (10/2020): Spectral grids for WDM applications: + DWDM frequency grid"; + } + + identity cwdm-ch-spc-type { + description + "CWDM channel-spacing type"; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers, + + ITU-T G.694.2 (12/2003): Spectral grids for WDM applications: + CWDM wavelength grid"; + } + + identity cwdm-20nm { + base cwdm-ch-spc-type; + description + "20nm channel spacing"; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers, + + ITU-T G.694.2 (12/2003): Spectral grids for WDM applications: + CWDM wavelength grid"; + } + + identity dwdm-ch-spc-type { + description + "DWDM channel-spacing type"; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers, + + ITU-T G.694.1 (10/2020): Spectral grids for WDM applications: + DWDM frequency grid"; + } + + identity dwdm-100ghz { + base dwdm-ch-spc-type; + description + "100 GHz channel spacing"; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers, + + ITU-T G.694.1 (10/2020): Spectral grids for WDM applications: + DWDM frequency grid"; + } + + identity dwdm-50ghz { + base dwdm-ch-spc-type; + description + "50 GHz channel spacing"; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers, + + ITU-T G.694.1 (10/2020): Spectral grids for WDM applications: + DWDM frequency grid"; + } + + identity dwdm-25ghz { + base dwdm-ch-spc-type; + description + "25 GHz channel spacing"; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers, + + ITU-T G.694.1 (10/2020): Spectral grids for WDM applications: + DWDM frequency grid"; + } + + identity dwdm-12p5ghz { + base dwdm-ch-spc-type; + description + "12.5 GHz channel spacing"; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers, + + ITU-T G.694.1 (10/2020): Spectral grids for WDM applications: + DWDM frequency grid"; + } + + identity flexi-ch-spc-type { + status deprecated; + description + "Flexi-grid channel-spacing type"; + } + + identity flexi-ch-spc-6p25ghz { + base flexi-ch-spc-type; + status deprecated; + description + "6.25 GHz channel spacing"; + } + + identity flexi-ncfg-type { + description + "Flexi-grid Nominal Central Frequency Granularity (NCFG) + type"; + reference + "RFC 7699: Generalized Labels for the Flexi-Grid in Lambda + Switch Capable (LSC) Label Switching Routers, + + ITU-T G.694.1 (10/2020): Spectral grids for WDM applications: + DWDM frequency grid"; + } + + identity flexi-ncfg-6p25ghz { + base flexi-ncfg-type; + description + "6.25 GHz Nominal Central Frequency Granularity (NCFG)"; + reference + "RFC 7699: Generalized Labels for the Flexi-Grid in Lambda + Switch Capable (LSC) Label Switching Routers, + + ITU-T G.694.1 (10/2020): Spectral grids for WDM applications: + DWDM frequency grid"; + } + + identity flexi-slot-width-granularity { + description + "Flexi-grid slot width granularity"; + reference + "RFC 7699: Generalized Labels for the Flexi-Grid in Lambda + Switch Capable (LSC) Label Switching Routers, + + ITU-T G.694.1 (10/2020): Spectral grids for WDM applications: + DWDM frequency grid"; + } + + identity flexi-swg-12p5ghz { + base flexi-slot-width-granularity; + description + "12.5 GHz slot width granularity"; + reference + "RFC 7699: Generalized Labels for the Flexi-Grid in Lambda + Switch Capable (LSC) Label Switching Routers, + + ITU-T G.694.1 (10/2020): Spectral grids for WDM applications: + DWDM frequency grid"; + } + + identity modulation { + description "base identity for modulation type"; + } + + identity DPSK { + base modulation; + description + "DPSK (Differential Phase Shift Keying) modulation"; + } + + identity QPSK { + base modulation; + description + "QPSK (Quadrature Phase Shift Keying) modulation"; + } + + identity DP-QPSK { + base modulation; + description + "DP-QPSK (Dual Polarization Quadrature + Phase Shift Keying) modulation"; + } + + identity QAM8 { + base modulation; + description + "8QAM (8 symbols Quadrature Amplitude Modulation)"; + } + + identity DP-QAM8 { + base modulation; + description + "DP-QAM8 (8 symbols Dual Polarization Quadrature Amplitude + Modulation)"; + } + + identity QAM16 { + base modulation; + description + "QAM16 (16 symbols Quadrature Amplitude Modulation)"; + } + + identity DP-QAM16 { + base modulation; + description + "DP-QAM16 (16 symbols Dual Polarization Quadrature Amplitude + Modulation)"; + } + + identity QAM32 { + base modulation; + description + "QAM32 (32 symbols Quadrature Amplitude Modulation)"; + } + + identity DP-QAM32 { + base modulation; + description + "DP-QAM32 (32 symbols Dual Polarization Quadrature Amplitude + Modulation)"; + } + + identity QAM64 { + base modulation; + description + "QAM64 (64 symbols Quadrature Amplitude Modulation)"; + } + + identity DP-QAM64 { + base modulation; + description + "DP-QAM64 (64 symbols Dual Polarization Quadrature Amplitude + Modulation)"; + } + + identity fec-type { + description + "Base identity from which specific FEC + (Forward Error Correction) type identities are derived."; + } + + identity g-fec { + base fec-type; + description + "Generic Forward Error Correction (G-FEC)."; + reference + "ITU-T G.975 v2.0 (10/2000): Forward error correction for + submarine systems."; + } + + identity super-fec { + base fec-type; + description + "Super Forward Error Correction (S-FEC)."; + reference + "ITU-T G.975.1 v1.2 (07/2013): Forward error correction for + high bit-rate DWDM submarine systems."; + } + + identity no-fec { + base fec-type; + description + "No FEC"; + } + + identity sc-fec { + base fec-type; + description + "Staircase Forward Error Correction (SC-FEC)."; + reference + "Annex A of ITU-T G.709.2 v1.1 (09/2020):OTU4 long-reach + interface."; + } + + identity o-fec { + base fec-type; + description + "Open Forward Error Correction (O-FEC) which reuses the + Bose, Chaudhuri and Hocquenghem (BCH) FEC."; + reference + "Clause 16.4.4 of ITU-T G.709.3 v2.1 (11/2022): Flexible OTN + long-reach interfaces; + + Annex E of ITU-T G.709.3 v2.1 (11/2022): Flexible OTN + long-reach interfaces."; + } + + identity c-fec { + base fec-type; + description + "Concatenated FEC (C-FEC) that combines an outer Staircase + Forward Error Correction (SC-FEC) code and an inner + double-extended SD-FEC (128,119) Hamming code. + + More details are provided in clause 15/G.709.3 where it is + called DSH instead of concatenated FEC."; + reference + "Annex A of ITU-T G.709.2 v1.1 (09/2020):OTU4 long-reach + interface; + + Annex D of ITU-T G.709.3 v2.1 (11/2022): Flexible OTN + long-reach interfaces; + + Clause 15 of ITU-T G.709.3 v2.1 (11/2022): Flexible OTN + long-reach interfaces."; + } + + identity line-coding { + description + "Base identity to defined the bit rate/line coding of optical + tributary signals."; + reference + "Section 7.1.2 of ITU-T G.698.2 v3.0 (11/2018)."; + } + + identity line-coding-NRZ-2p5G { + base line-coding; + description + "The non return to zero (NRZ) bit rate/line coding used by + the optical tributary signal class NRZ 2.5G"; + reference + "Section 3.2.6 of ITU-T G.959.1 v8.0 (07/2018)."; + } + + identity line-coding-NRZ-OTU1 { + base line-coding; + description + "The non return to zero (NRZ) bit rate/line coding used by + the Optical channel Transport Unit order 1 (OTU1) optical + tributary signals"; + reference + "Section 7.2.1.2 of ITU-T G.959.1 v8.0 (07/2018)."; + } + + identity line-coding-NRZ-10G { + description + "The non return to zero (NRZ) bit rate/line coding used by + the optical tributary signal class NRZ 10G"; + reference + "Section 3.2.7 of ITU-T G.959.1 v8.0 (07/2018)."; + } + + identity line-coding-NRZ-OTU2 { + base line-coding; + description + "The non return to zero (NRZ) bit rate/line coding used by + the Optical channel Transport Unit order 2 (OTU2) optical + tributary signals"; + reference + "Section 7.2.1.2 of ITU-T G.959.1 v8.0 (07/2018)."; + } + + identity line-coding-OTL4.4-SC { + base line-coding; + description + "The bit rate/line coding used by optical tributary + signals carrying a 100G Optical Transport Unit order 4 + (OTU4) with Staircase Forward Error Correction (SC FEC) + from a group of four Optical Transport Lanes (OTL)."; + reference + "Section 3.2.1 of ITU-T G.698.2 v3.0 (11/2018)."; + } + + identity line-coding-FOIC1.4-SC { + base line-coding; + description + "The bit rate/line coding used by optical tributary signals + carrying a FlexO Interface of order C1 with 4 lanes + (FOIC1.1) with Staircase Forward Error Correction + (SC FEC)."; + reference + "Section 3.2.1 of ITU-T G.698.2 v3.0 (11/2018)."; + } + + identity wavelength-assignment { + description + "Wavelength selection base"; + reference + "RFC 7689: Signaling Extensions for Wavelength Switched + Optical Networks"; + } + + identity first-fit-wavelength-assignment { + base wavelength-assignment; + description + "All the available wavelengths are numbered, + and this WA (Wavelength Assignment) method chooses + the available wavelength with the lowest index"; + reference + "RFC 7689: Signaling Extensions for Wavelength Switched + Optical Networks"; + } + + identity random-wavelength-assignment { + base wavelength-assignment; + description + "This WA method chooses an available + wavelength randomly"; + reference + "RFC 7689: Signaling Extensions for Wavelength Switched + Optical Networks"; + } + + identity least-loaded-wavelength-assignment { + base wavelength-assignment; + description + "This WA method selects the wavelength that + has the largest residual capacity on the most loaded + link along the route (in multi-fiber networks)"; + reference + "RFC 7689: Signaling Extensions for Wavelength Switched + Optical Networks"; + } + + identity lower-first-wavelength-assignment { + base wavelength-assignment; + description + "Allocate wavelengths in ascending order, beginning from the + lowest frequency and progressing toward the highest frequency + within the permissible frequency range."; + } + + identity upper-first-wavelength-assignment { + base wavelength-assignment; + description + "Allocate wavelengths in decending order, beginning from the + highest frequency and progressing toward the lowest frequency + within the permissible frequency range."; + } + + identity otu-type { + description + "Base identity from which specific OTU identities are derived"; + reference + "ITU-T G.709: Interfaces for the Optical Transport Network"; + } + + identity OTU1 { + base otu-type; + description + "OTU1 (2.66 Gb/s)"; + reference + "ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity OTU2 { + base otu-type; + description + "OTU2 (10.70 Gb/s)"; + reference + "ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity OTU3 { + base otu-type; + description + "OTU3 (43.01 Gb/s)"; + reference + "ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity OTU4 { + base otu-type; + description + "OTU4 (111.80 Gb/s)"; + reference + "ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity OTUCn { + base otu-type; + description + "OTUCn (n x 105.25 Gb/s)"; + reference + "ITU-T G.709 v6.0 (06/2020): Interfaces for the Optical + Transport Network (OTN)"; + } + + identity type-power-mode { + description + "power equalization mode used within the + OMS and its elements"; + } + + identity power-spectral-density { + base type-power-mode; + description + "all elements must use power spectral density (W/Hz)"; + } + + identity carrier-power { + base type-power-mode; + description + "all elements must use power (dBm)"; + } + + identity operational-mode { + description + "Base identity to be used when defining organization/vendor + specific modes. + + The format of the derived identities has to be defined by the + organization which is responsible for defining the + corresponding optical interface specification."; + reference + "Section 2.5.2 of RFC YYYY: A YANG Data Model for Optical + Impairment-aware Topology."; + } +// RFC Ed.: replace YYYY with actual RFC number and remove +// this note after draft-ietf-ccamp-optical-impairment-topology-yang +// is published as an RFC + +/* + * Typedefs + */ + + typedef dwdm-n { + type int16; + description + "The given value 'N' is used to determine the nominal central + frequency. + + The nominal central frequency, 'f', is defined by: + f = 193100.000 GHz + N x channel spacing (measured in GHz), + + where 193100.000 GHz (193.100000 THz) is the ITU-T 'anchor + frequency' for transmission over the DWDM grid, and where + 'channel spacing' is defined by the dwdm-ch-spc-type."; + reference + "RFC6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers, + + ITU-T G.694.1 (10/2020): Spectral grids for WDM applications: + DWDM frequency grid"; + } + + typedef cwdm-n { + type int16; + description + "The given value 'N' is used to determine the nominal central + wavelength. + + The nominal central wavelength is defined by: + Wavelength = 1471 nm + N x channel spacing (measured in nm) + + where 1471 nm is the conventional 'anchor wavelength' for + transmission over the CWDM grid, and where 'channel spacing' + is defined by the cwdm-ch-spc-type."; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers, + + ITU-T G.694.2 (12/2003): Spectral grids for WDM applications: + CWDM wavelength grid"; + } + + typedef flexi-n { + type int16; + description + "The given value 'N' is used to determine the nominal central + frequency. + + The nominal central frequency, 'f', is defined by: + f = 193100.000 GHz + N x NCFG (measured in GHz), + + where 193100.000 GHz (193.100000 THz) is the ITU-T 'anchor + frequency' for transmission over the DWDM grid, and where + NCFG is defined by the flexi-ncfg-type, or by the deprecated + flexi-ch-spc-type."; + reference + "RFC 7699: Generalized Labels for the Flexi-Grid in Lambda + Switch Capable (LSC) Label Switching Routers, + + ITU-T G.694.1 (10/2020): Spectral grids for WDM applications: + DWDM frequency grid"; + } + + typedef flexi-m { + type uint16; + description + "The given value 'M' is used to determine the slot width. + + A slot width is defined by: + slot width = M x SWG (measured in GHz), + + where SWG is defined by the flexi-slot-width-granularity."; + reference + "RFC 7699: Generalized Labels for the Flexi-Grid in Lambda + Switch Capable (LSC) Label Switching Routers, + + ITU-T G.694.1 (10/2020): Spectral grids for WDM applications: + DWDM frequency grid"; + } + + typedef standard-mode { + type string; + description + "Identifies an ITU-T G.698.2 standard application code. + + It MUST be a string with a format that follows the + nomenclature defined in section 5.3 of ITU-T G.698.2."; + reference + "ITU-T G.698.2 (11/2018)"; + } + + typedef organization-identifier { + type string; + description + "vendor/organization identifier that uses a private mode + out of already defined in G.698.2 ITU-T application-code"; + reference + "Section 2.5.2 of RFC YYYY: A YANG Data Model for Optical + Impairment-aware Topology."; + } +// RFC Ed.: replace YYYY with actual RFC number and remove +// this note after draft-ietf-ccamp-optical-impairment-topology-yang +// is published as an RFC + + typedef operational-mode { + type identityref { + base operational-mode; + } + description + "Identifies an organization (e.g., vendor) specific mode. + + The format of these identities has to be defined by the + organization which is responsible for defining the + corresponding optical interface specification."; + reference + "Section 2.5.2 of RFC YYYY: A YANG Data Model for Optical + Impairment-aware Topology."; + } +// RFC Ed.: replace YYYY with actual RFC number and remove +// this note after draft-ietf-ccamp-optical-impairment-topology-yang +// is published as an RFC + + typedef frequency-thz { + type decimal64 { + fraction-digits 9; + } + units "THz"; + description + "The DWDM frequency in THz, e.g., 193.112500000"; + } + + typedef frequency-ghz { + type decimal64 { + fraction-digits 6; + } + units "GHz"; + description + "The DWDM frequency in GHz, e.g., 193112.500000"; + } + + typedef snr { + type decimal64 { + fraction-digits 2; + } + units "dB@0.1nm"; + description + "(Optical) Signal to Noise Ratio measured over 0.1 nm + resolution bandwidth"; + } + + typedef snr-or-null { + type union { + type snr; + type empty; + } + description + "(Optical) Signal to Noise Ratio measured over 0.1 nm + resolution bandwidth, when known, or an empty value when + unknown."; + } + + typedef fiber-type { + type enumeration { + enum G.652 { + description + "G.652 Standard Singlemode Fiber"; + } + enum G.654 { + description + "G.654 Cutoff Shifted Fiber"; + } + enum G.653 { + description "G.653 Dispersion Shifted Fiber"; + } + enum G.655 { + description "G.655 Non-Zero Dispersion Shifted Fiber"; + } + enum G.656 { + description + "G.656 Non-Zero Dispersion for Wideband Optical Transport"; + } + enum G.657 { + description + "G.657 Bend-Insensitive Fiber"; + } + } + description + "ITU-T based fiber-types"; + } + + typedef decimal-2 { + type decimal64 { + fraction-digits 2; + } + description + "A decimal64 value with two digits."; + } + + typedef decimal-2-or-null { + type union { + type decimal-2; + type empty; + } + description + "A decimal64 value with two digits, when the value is known or + an empty value when the value is not known."; + } + + typedef power-gain { + type decimal-2 { + range "0..max"; + } + units "dB"; + description + "The gain in dB."; + } + + typedef power-gain-or-null { + type union { + type power-gain; + type empty; + } + description + "The gain in dB, when it is known or an empty + value when the power gain/loss is not known."; + } + + typedef power-loss { + type decimal-2 { + range "0..max"; + } + units "dB"; + description + "The power attenuation in dB."; + } + + typedef power-loss-or-null { + type union { + type power-loss; + type empty; + } + description + "The power attenuation in dB, when it is known or an empty + value when the loss is not known."; + } + + typedef power-ratio { + type decimal-2; + units "dB"; + description + "The power difference in dB."; + } + + typedef power-ratio-or-null { + type union { + type power-ratio; + type empty; + } + description + "The power difference in dB, when it is known or an empty + value when the difference is not known."; + } + + typedef power-dbm { + type decimal-2; + units "dBm"; + description + "The power in dBm."; + } + + typedef power-dbm-or-null { + type union { + type power-dbm; + type empty; + } + description + "The power in dBm, when it is known or an empty value when the + power is not known."; + } + + typedef decimal-5 { + type decimal64 { + fraction-digits 5; + } + description + "A decimal64 value with five digits."; + } + + typedef decimal-5-or-null { + type union { + type decimal-5; + type empty; + } + description + "A decimal64 value with five digits, when the value is known + or an empty value when the value is not known."; + } + + typedef psd { + type decimal64 { + fraction-digits 16; + } + units "W/Hz"; + description + "The power spectral density (PSD). + + Typical value : 3.9 E-14, resolution 0.1nW/MHz."; + } + + typedef psd-or-null { + type union { + type psd; + type empty; + } + description + "The power spectral density (PSD), when it is known or an + empty value when the PSD is not known."; + } + +/* + * Groupings + */ + + grouping wdm-label-start-end { + description + "The WDM label-start or label-end used to specify DWDM and + CWDM label range."; + + choice grid-type { + description + "Label for fixed & flexi-DWDM or CWDM grid"; + case fixed-dwdm { + leaf dwdm-n { + when "derived-from-or-self(../../../grid-type, + \"wson-grid-dwdm\")" { + description + "Valid only when grid type is DWDM."; + } + type l0-types:dwdm-n; + description + "The given value 'N' is used to determine the + nominal central frequency."; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable + (LSC) Label Switching Routers"; + } + } + case cwdm { + leaf cwdm-n { + when "derived-from-or-self(../../../grid-type, + \"wson-grid-cwdm\")" { + description + "Valid only when grid type is CWDM."; + } + type l0-types:cwdm-n; + description + "The given value 'N' is used to determine the nominal + central wavelength."; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable + (LSC) Label Switching Routers"; + } + } + case flexi-grid { + uses l0-types:flexi-grid-label-start-end; + } + } + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers"; + } + + grouping wdm-label-step { + description + "Label step information for fixed & flexi-DWDM or CWDM grid"; + choice l0-grid-type { + description + "Grid type: DWDM, CWDM, etc."; + case fixed-dwdm { + leaf wson-dwdm-channel-spacing { + when "derived-from-or-self(../../grid-type, + \"wson-grid-dwdm\")" { + description + "Valid only when grid type is DWDM."; + } + type identityref { + base dwdm-ch-spc-type; + } + description + "Label-step is the channel spacing (GHz), e.g., 100.000, + 50.000, 25.000, or 12.500 GHz for DWDM."; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable + (LSC) Label Switching Routers"; + } + } + case cwdm { + leaf wson-cwdm-channel-spacing { + when "derived-from-or-self(../../grid-type, + \"wson-grid-cwdm\")" { + description + "Valid only when grid type is CWDM."; + } + type identityref { + base cwdm-ch-spc-type; + } + description + "Label-step is the channel spacing (nm), i.e., 20 nm + for CWDM, which is the only value defined for CWDM."; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable + (LSC) Label Switching Routers"; + } + } + case flexi-grid { + uses flexi-grid-label-step; + } + } + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers, + ITU-T G.694.2 (12/2003): Spectral grids for WDM applications: + CWDM wavelength grid, + RFC 8363: GMPLS OSPF-TE Extensions in Support of Flexi-Grid + Dense Wavelength Division Multiplexing (DWDM) Networks"; + } + + grouping wdm-label-hop { + description + "Generic label-hop information for fixed & flexi-DWDM or + CWDM grid"; + choice grid-type { + description + "Label for DWDM or CWDM grid"; + case fixed-dwdm { + choice fixed-single-or-super-channel { + description + "single or super channel"; + case single { + leaf dwdm-n { + type l0-types:dwdm-n; + description + "The given value 'N' is used to determine the + nominal central frequency."; + } + } + case multi { + leaf-list subcarrier-dwdm-n { + type l0-types:dwdm-n; + min-elements 2; + description + "The given values 'N' are used to determine the + nominal central frequency for each subcarrier + channel."; + reference + "ITU-T G.694.1 (10/2020): Spectral grids for WDM + applications: DWDM frequency grid"; + } + } + } + } + case cwdm { + leaf cwdm-n { + type l0-types:cwdm-n; + description + "The given value 'N' is used to determine the nominal + central wavelength."; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable + (LSC) Label Switching Routers"; + } + } + case flexi-grid { + uses l0-types:flexi-grid-label-hop; + } + } + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers"; + } + + grouping wdm-label-range-info { + description + "WDM label range related information"; + uses l0-label-range-info; + container flexi-grid { + when "derived-from-or-self(../grid-type, + \"flexi-grid-dwdm\")" { + description + "Applicable only when the grid type is flexi-grid-dwdm."; + } + description + "flexi-grid definition"; + leaf slot-width-granularity { + type identityref { + base flexi-slot-width-granularity; + } + default "flexi-swg-12p5ghz"; + description + "Minimum space between slot widths. Default is 12.500 + GHz."; + reference + "RFC 7698: Framework and Requirements for GMPLS-Based + Control of Flexi-Grid Dense Wavelength Division + Multiplexing (DWDM) Networks"; + } + leaf min-slot-width-factor { + type uint16 { + range "1..max"; + } + default "1"; + description + "A multiplier of the slot width granularity, indicating + the minimum slot width supported by an optical port. + + Minimum slot width is calculated by: + Minimum slot width (GHz) = + min-slot-width-factor * slot-width-granularity."; + reference + "RFC 8363: GMPLS OSPF-TE Extensions in Support of Flexi- + Grid Dense Wavelength Division Multiplexing (DWDM) + Networks"; + } + leaf max-slot-width-factor { + type uint16 { + range "1..max"; + } + must '. >= ../min-slot-width-factor' { + error-message + "Maximum slot width must be greater than or equal to + minimum slot width."; + } + description + "A multiplier of the slot width granularity, indicating + the maximum slot width supported by an optical port. + + Maximum slot width is calculated by: + Maximum slot width (GHz) = + max-slot-width-factor * slot-width-granularity + + If specified, maximum slot width must be greater than or + equal to minimum slot width. If not specified, maximum + slot width is equal to minimum slot width."; + reference + "RFC 8363: GMPLS OSPF-TE Extensions in Support of Flexi- + Grid Dense Wavelength Division Multiplexing (DWDM) + Networks"; + } + } + } + + grouping wson-label-start-end { + description + "The WSON label-start or label-end used to specify WSON label + range."; + choice grid-type { + description + "Label for DWDM or CWDM grid"; + case dwdm { + leaf dwdm-n { + when "derived-from-or-self(../../../grid-type, + \"wson-grid-dwdm\")" { + description + "Valid only when grid type is DWDM."; + } + type l0-types:dwdm-n; + description + "The central frequency of DWDM."; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable + (LSC) Label Switching Routers"; + } + } + case cwdm { + leaf cwdm-n { + when "derived-from-or-self(../../../grid-type, + \"wson-grid-cwdm\")" { + description + "Valid only when grid type is CWDM."; + } + type l0-types:cwdm-n; + description + "Channel wavelength computing input."; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable + (LSC) Label Switching Routers"; + } + } + } + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers"; + } + + grouping wson-label-hop { + description + "Generic label-hop information for WSON"; + choice grid-type { + description + "Label for DWDM or CWDM grid"; + case dwdm { + choice single-or-super-channel { + description + "single or super channel"; + case single { + leaf dwdm-n { + type l0-types:dwdm-n; + description + "The given value 'N' is used to determine the + nominal central frequency."; + } + } + case super { + leaf-list subcarrier-dwdm-n { + type l0-types:dwdm-n; + description + "The given values 'N' are used to determine the + nominal central frequency for each subcarrier + channel."; + reference + "ITU-T G.694.1 (10/2020): Spectral grids for WDM + applications: DWDM frequency grid"; + } + } + } + } + case cwdm { + leaf cwdm-n { + type l0-types:cwdm-n; + description + "The given value 'N' is used to determine the nominal + central wavelength."; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable + (LSC) Label Switching Routers"; + } + } + } + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers"; + } + + grouping l0-label-range-info { + description + "Information about Layer 0 label range."; + leaf grid-type { + type identityref { + base l0-grid-type; + } + description + "Grid type"; + } + leaf priority { + type uint8; + description + "Priority in Interface Switching Capability Descriptor + (ISCD)."; + reference + "RFC 4203: OSPF Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS)"; + } + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers"; + } + + grouping wson-label-step { + description + "Label step information for WSON"; + choice l0-grid-type { + description + "Grid type: DWDM, CWDM, etc."; + case dwdm { + leaf wson-dwdm-channel-spacing { + when "derived-from-or-self(../../grid-type, + \"wson-grid-dwdm\")" { + description + "Valid only when grid type is DWDM."; + } + type identityref { + base dwdm-ch-spc-type; + } + description + "Label-step is the channel spacing (GHz), e.g., 100.000, + 50.000, 25.000, or 12.500 GHz for DWDM."; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable + (LSC) Label Switching Routers"; + } + } + case cwdm { + leaf wson-cwdm-channel-spacing { + when "derived-from-or-self(../../grid-type, + \"wson-grid-cwdm\")" { + description + "Valid only when grid type is CWDM."; + } + type identityref { + base cwdm-ch-spc-type; + } + description + "Label-step is the channel spacing (nm), i.e., 20 nm + for CWDM, which is the only value defined for CWDM."; + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable + (LSC) Label Switching Routers"; + } + } + } + reference + "RFC 6205: Generalized Labels for Lambda-Switch-Capable (LSC) + Label Switching Routers, + + ITU-T G.694.2 (12/2003): Spectral grids for WDM applications: + CWDM wavelength grid"; + } + + grouping flexi-grid-label-start-end { + description + "The flexi-grid label-start or label-end used to specify + flexi-grid label range."; + leaf flexi-n { + type l0-types:flexi-n; + description + "The given value 'N' is used to determine the nominal + central frequency. + + As described in section 3.1 of RFC 8363, the range of + available nominal central frequencies are advertised for + m=1, which means that for an available central frequency n, + the frequency slot from central frequency n-1 to central + frequency n+1 is available."; + } + reference + "RFC 7699: Generalized Labels for the Flexi-Grid in Lambda + Switch Capable (LSC) Label Switching Routers, + + RFC 8363: GMPLS OSPF-TE Extensions in Support of Flexi-Grid + Dense Wavelength Division Multiplexing (DWDM) Networks"; + } + + grouping flexi-grid-frequency-slot { + description + "Flexi-grid frequency slot grouping."; + uses flexi-grid-label-start-end; + leaf flexi-m { + type l0-types:flexi-m; + description + "The given value 'M' is used to determine the slot width."; + } + reference + "RFC 7699: Generalized Labels for the Flexi-Grid in Lambda + Switch Capable (LSC) Label Switching Routers"; + } + + grouping flexi-grid-label-hop { + description + "Generic label-hop information for flexi-grid"; + choice single-or-super-channel { + description + "single or super channel"; + case single { + uses flexi-grid-frequency-slot; + } + case super { + status deprecated; + list subcarrier-flexi-n { + key "flexi-n"; + status deprecated; + uses flexi-grid-frequency-slot { + status deprecated; + } + description + "List of subcarrier channels for flexi-grid super + channel."; + } + } + case multi { + container frequency-slots { + description + "The top level container for the list of frequency + slots used for flexi-grid super channel."; + list frequency-slot { + key "flexi-n"; + min-elements 2; + uses flexi-grid-frequency-slot; + description + "List of frequency slots used for flexi-grid super + channel."; + } + } + } + } + reference + "RFC 8363: GMPLS OSPF-TE Extensions in Support of Flexi-Grid + Dense Wavelength Division Multiplexing (DWDM) Networks"; + } + + grouping flexi-grid-label-range-info { + description + "Flexi-grid-specific label range related information"; + uses l0-label-range-info; + container flexi-grid { + description + "flexi-grid definition"; + leaf slot-width-granularity { + type identityref { + base flexi-slot-width-granularity; + } + default "flexi-swg-12p5ghz"; + description + "Minimum space between slot widths. Default is 12.500 + GHz."; + reference + "RFC 8363: GMPLS OSPF-TE Extensions in Support of + Flexi-Grid Dense Wavelength Division Multiplexing (DWDM) + Networks"; + } + leaf min-slot-width-factor { + type uint16 { + range "1..max"; + } + default "1"; + description + "A multiplier of the slot width granularity, indicating + the minimum slot width supported by an optical port. + + Minimum slot width is calculated by: + Minimum slot width (GHz) = + min-slot-width-factor * slot-width-granularity."; + reference + "RFC 8363: GMPLS OSPF-TE Extensions in Support of Flexi- + Grid Dense Wavelength Division Multiplexing (DWDM) + Networks"; + } + leaf max-slot-width-factor { + type uint16 { + range "1..max"; + } + must '. >= ../min-slot-width-factor' { + error-message + "Maximum slot width must be greater than or equal to + minimum slot width."; + } + description + "A multiplier of the slot width granularity, indicating + the maximum slot width supported by an optical port. + + Maximum slot width is calculated by: + Maximum slot width (GHz) = + max-slot-width-factor * slot-width-granularity + + If specified, maximum slot width must be greater than or + equal to minimum slot width. If not specified, maximum + slot width is equal to minimum slot width."; + reference + "RFC 8363: GMPLS OSPF-TE Extensions in Support of Flexi- + Grid Dense Wavelength Division Multiplexing (DWDM) + Networks"; + } + } + } + + grouping flexi-grid-label-step { + description + "Label step information for flexi-grid"; + leaf flexi-grid-channel-spacing { + type identityref { + base flexi-ch-spc-type; + } + default "flexi-ch-spc-6p25ghz"; + status deprecated; + description + "Label-step is the nominal central frequency granularity + (GHz), e.g., 6.25 GHz."; + reference + "RFC 7699: Generalized Labels for the Flexi-Grid in Lambda + Switch Capable (LSC) Label Switching Routers"; + } + leaf flexi-ncfg { + type identityref { + base flexi-ncfg-type; + } + default "flexi-ncfg-6p25ghz"; + description + "Label-step is the nominal central frequency granularity + (GHz), e.g., 6.25 GHz."; + reference + "RFC 7699: Generalized Labels for the Flexi-Grid in Lambda + Switch Capable (LSC) Label Switching Routers"; + } + leaf flexi-n-step { + type uint8; + description + "This attribute defines the multiplier for the supported + values of 'N'. + + For example, given a grid with a nominal central frequency + granularity of 6.25 GHz, the granularity of the supported + values of the nominal central frequency could be 12.5 GHz. + In this case, the values of flexi-n should be even and this + constraint is reported by setting the flexi-n-step to 2. + + This attribute is also known as central frequency + granularity in RFC 8363."; + reference + "RFC 8363: GMPLS OSPF-TE Extensions in Support of Flexi-Grid + Dense Wavelength Division Multiplexing (DWDM) Networks"; + } + } + + grouping transceiver-mode { + description + "This grouping is intended to be used for reporting the + information of a transceiver's mode. + + The attributes for the explicit mode shall be augmented when + used with either: + - the proper leafrefs, when explicit mode templates are used; + or, + - the explicit-mode grouping, when explicit mode templates + are not used. + + The compatible-modes container shall be augmented with the + proper leafrefs when used: see for example the + transceiver-capabilities grouping below."; + choice mode { + mandatory true; + description + "Indicates whether the transceiver's mode is a standard + mode, an organizational mode or an explicit mode."; + case G.698.2 { + uses standard-mode; + uses common-standard-organizational-mode; + uses common-all-modes; + } + case organizational-mode { + container organizational-mode { + config false; + description + "The set of attributes for an organizational mode"; + uses organizational-mode; + uses common-standard-organizational-mode; + uses common-all-modes; + } // container organizational-mode + } + case explicit-mode { + container explicit-mode { + config false; + description + "The set of attributes for an explicit mode"; + // uses explicit-mode; + uses common-all-modes; + container compatible-modes { + description + "Container for all the standard and organizational + modes supported by the transceiver's explicit + mode."; + } // container compatible-modes + } // container explicit-mode + } // end of case explicit-mode + } // end of choice + } + + grouping transceiver-capabilities { + description + "This grouping is intended to be used for reporting the + capabilities of a transceiver. + + The attributes for the explicit mode shall be augmented when + used with either: + - the proper leafrefs, when explicit mode templates are used; + or, + - the explicit-mode grouping, when explicit mode templates + are not used."; + + container supported-modes { + presence + "When present, it indicates that the modes supported by a + transceiver are reported."; + description + "The top level container for the list supported + transceiver's modes."; + list supported-mode { + key "mode-id"; + config false; + min-elements 1; + description "The list of supported transceiver's modes."; + leaf mode-id { + type string { + length "1..255"; + } + description "ID for the supported transceiver's mode."; + } + uses transceiver-mode { + augment "mode/explicit-mode/explicit-mode/" + + "compatible-modes" { + description + "Augments the compatible modes with the proper + leafrefs."; + leaf-list supported-application-codes { + type leafref { + path "../../../../supported-mode/mode-id"; + } + must "../../../../" + + "supported-mode[mode-id=current()]/" + + "standard-mode" { + description + "The pointer is only for application codes + supported by transceiver."; + } + description + "List of pointers to the application codes + supported by the transceiver's explicit mode."; + } + leaf-list supported-organizational-modes { + type leafref { + path "../../../../supported-mode/mode-id"; + } + must "../../../../" + + "supported-mode[mode-id=current()]/" + + "organizational-mode" { + description + "The pointer is only for organizational modes + supported by transceiver."; + } + description + "List of pointers to the organizational modes + supported by the transceiver's explicit mode."; + } + } + } + } // list supported-modes + } // container supported-modes + } // grouping transceiver-capabilities + + grouping standard-mode { + description + "ITU-T G.698.2 standard mode that guarantees interoperability. + It must be an string with the following format: + B-DScW-ytz(v) where all these attributes are conformant + to the ITU-T recomendation"; + + leaf standard-mode { + type standard-mode; + config false; + description + "G.698.2 standard mode"; + } + } + + grouping organizational-mode { + description + "Transponder operational mode supported by organizations or + vendor"; + + leaf operational-mode { + type operational-mode; + config false; + description + "configured organization- or vendor-specific + application identifiers (AI) supported by the transponder"; + } + leaf organization-identifier { + type organization-identifier; + config false; + description + "organization identifier that uses organizational + mode"; + } + } + + grouping penalty-value { + description + "A common definition of the penalty value used for describing + multiple penalty types (.e.g, CD, PMD, PDL)."; + + leaf penalty-value { + type union { + type decimal64 { + fraction-digits 2; + range "0..max"; + } + type empty; + } + units "dB"; + config false; + mandatory true; + description + "The OSNR penalty associated with the related optical + impairment at the receiver, when the value is known or an + empty value when the value is not known."; + } + } + + grouping explicit-mode { + description + "Attributes capabilities related to explicit transceiver's + mode. + + This grouping also contains the list of attributes related to + optical impairment limits for explicit mode (min OSNR, max PMD, + max CD, max PDL, Q-factor limit, etc.). + + In case of standard and operational mode the attributes are + implicit."; + leaf line-coding-bitrate { + type identityref { + base line-coding; + } + config false; + description + "Bit rate/line coding of the optical tributary signal."; + reference + "ITU-T G.698.2 section 7.1.2"; + } + leaf bitrate { + type uint16; + units "Gbit/sec"; + config false; + description + "The gross bitrate (e.g., 100, 200) of the optical tributary + signal."; + } + leaf max-diff-group-delay { + type decimal-2; + units "ps"; + config false; + description + "Maximum Differential group delay of this mode for this + lane"; + } + leaf max-chromatic-dispersion { + type decimal64 { + fraction-digits 2; + range "0..max"; + } + units "ps/nm"; + config false; + description + "Maximum acceptable accumulated chromatic dispersion (CD) + on the receiver"; + } + list cd-penalty { + config false; + description + "Optional penalty associated with a given accumulated + chromatic dispersion (CD) value. + + This list of pair cd and penalty values can be used to + sample the function penalty = f(CD)."; + leaf cd-value { + type union { + type decimal64 { + fraction-digits 2; + range "0..max"; + } + type empty; + } + units "ps/nm"; + config false; + mandatory true; + description + "The Chromatic Dispersion (CD), when the value is known + or an empty value when the value is not known."; + } + uses penalty-value; + } + leaf max-polarization-mode-dispersion { + type decimal64 { + fraction-digits 2; + range "0..max"; + } + units "ps"; + config false; + description + "Maximum acceptable accumulated polarization mode + dispersion (PMD) on the receiver"; + } + list pmd-penalty { + config false; + description + "Optional penalty associated with a given accumulated + polarization mode dispersion (PMD) value. + + This list of pair pmd and penalty can be used to + sample the function penalty = f(PMD)."; + leaf pmd-value { + type union { + type decimal64 { + fraction-digits 2; + range "0..max"; + } + type empty; + } + units "ps"; + config false; + mandatory true; + description + "The Polarization Mode Dispersion (PMD), when the value + is known or an empty value when the value is not known."; + } + uses penalty-value; + } + leaf max-polarization-dependant-loss { + type power-loss-or-null; + config false; + mandatory true; + description + "Maximum acceptable accumulated accumulated polarization + dependent loss (PDL) on the receiver"; + } + list pdl-penalty { + config false; + description + "Optional penalty associated with a given accumulated + polarization dependent loss (PDL) value. + + This list of pair pdl and penalty values can be used to + sample the function PDL = f(penalty)."; + leaf pdl-value { + type power-loss-or-null; + config false; + mandatory true; + description + "Maximum acceptable accumulated polarization dependent + loss."; + } + uses penalty-value; + } + leaf available-modulation-type { + type identityref { + base modulation; + } + config false; + description + "Modulation type the specific transceiver in the list + can support"; + } + leaf min-OSNR { + type snr; + units "dBm"; + config false; + description + "min OSNR measured over 0.1 nm resolution bandwidth: + if received OSNR at Rx-power reference point + (rx-ref-channel-power) is lower than MIN-OSNR, an increased + level of bit-errors post-FEC needs to be expected"; + } + leaf rx-ref-channel-power { + type power-dbm; + config false; + description + "The channel power used as reference for defining penalties + and min-OSNR"; + } + list rx-channel-power-penalty { + config false; + description + "Optional penalty associated with a received power + lower than rx-ref-channel-power. + This list of pair power and penalty can be used to + sample the function penalty = f(rx-channel-power)."; + leaf rx-channel-power-value { + type power-dbm-or-null; + units "dBm"; + config false; + mandatory true; + description + "The Received Power, when the value is known or an empty + value when the value is not known."; + } + uses penalty-value; + } + leaf min-Q-factor { + type decimal-2; + units "dB"; + config false; + description "min Qfactor at FEC threshold"; + } + leaf available-baud-rate { + type decimal64 { + fraction-digits 1; + } + units "Bd"; + config false; + description + "Baud-rate the specific transceiver in + the list can support. + Baud-rate is the unit for + symbol rate or modulation rate + in symbols per second or + pulses per second. + It is the number of distinct symbol + changes (signal events) made to the + transmission medium + per second in a digitally + modulated signal or a line code"; + } + leaf roll-off { + type decimal64 { + fraction-digits 4; + range "0..1"; + } + config false; + description + "the roll-off factor (beta with values from 0 to 1) + identifies how the real signal shape exceed + the baud rate. If=0 it is exactly matching + the baud rate.If=1 the signal exceeds the + 50% of the baud rate at each side."; + } + leaf min-carrier-spacing { + type frequency-ghz; + config false; + description + "This attribute specifies the minimum nominal difference + between the carrier frequencies of two homogeneous OTSis + (which have the same optical characteristics but the central + frequencies) such that if they are placed next to each other + the interference due to spectrum overlap between them can be + considered negligible. + + In case of heterogeneous OTSi it is up to path computation + engine to determine the minimum distance between the carrier + frequency of the two adjacent OTSi."; + } + leaf available-fec-type { + type identityref { + base fec-type; + } + config false; + description "Available FEC"; + } + leaf fec-code-rate { + type decimal64 { + fraction-digits 8; + range "0..max"; + } + config false; + description "FEC-code-rate"; + } + leaf fec-threshold { + type decimal64 { + fraction-digits 8; + range "0..max"; + } + config false; + description + "Threshold on the BER, for which FEC + is able to correct errors"; + } + leaf in-band-osnr { + type snr; + config false; + description + "The OSNR defined within the bandwidth of the transmit + spectral excursion (i.e., between the nominal central + frequency of the channel and the -3.0dB points of the + transmitter spectrum furthest from the nominal central + frequency) measured at reference point Ss. + + The in-band OSNR is referenced to an optical bandwidth of + 0.1nm @ 193.7 THz or 12.5 GHz."; + reference + "OIF-400ZR-01.0: Implementation Agreement 400ZR"; + } + leaf out-of-band-osnr { + type snr; + config false; + description + "The ratio of the peak transmitter power to the integrated + power outside the transmitter spectral excursion. + + The spectral resolution of the measurement shall be better + than the maximum spectral width of the peak. + + The out-of-band OSNR is referenced to an optical bandwidth + of 0.1nm @ 193.7 THz or 12.5 GHz"; + reference + "OIF-400ZR-01.0: Implementation Agreement 400ZR"; + } + leaf tx-polarization-power-difference { + type power-ratio; + config false; + description + "The transmitter polarization dependent power difference + defined as the power difference between X and Y + polarizations"; + reference + "OIF-400ZR-01.0: Implementation Agreement 400ZR"; + } + leaf polarization-skew { + type decimal64 { + fraction-digits 2; + } + units "ps"; + config false; + description + "The X-Y skew, included as a fixed value in the receiver + polarization mode dispersion (PMD) tolerance limits."; + reference + "OIF-400ZR-01.0: Implementation Agreement 400ZR"; + } + } // grouping explicit-mode + + grouping common-standard-organizational-mode { + description + "Common attributes used by standard and organizational + transceiver's modes."; + + leaf-list line-coding-bitrate { + type identityref { + base line-coding; + } + config false; + description + "The list of the bit rate/line coding of the optical + tributary signal supported by the transceiver. + + Reporting this list is optional when the standard or + organization mode supports only one bit rate/line coding."; + reference + "ITU-T G.698.2 section 7.1.2"; + } + } // grouping common-standard-organizational-mode + + grouping transmitter-tuning-range { + description + "Transmitter tuning range (f_tx-min, f_tx-max)"; + + leaf min-central-frequency { + type frequency-thz; + description + "This parameter indicates the minimum frequency for the + transmitter tuning range."; + } + leaf max-central-frequency { + type frequency-thz; + description + "This parameter indicates the maximum frequency for the + transmitter tuning range."; + } + + leaf transceiver-tunability { + type frequency-ghz; + description + "This parameter indicates the transmitter frequency fine + tuning steps e.g 3.125GHz or 0.001GHz."; + } + } // grouping transmitter-tuning-range + + grouping common-all-modes { + description + "Common attributes used by all transceiver's modes."; + + uses transmitter-tuning-range; + leaf tx-channel-power-min { + type power-dbm; + config false; + description "The minimum output power of this interface"; + } + leaf tx-channel-power-max { + type power-dbm; + config false; + description "The maximum output power of this interface"; + } + leaf rx-channel-power-min { + type power-dbm; + config false; + description "The minimum input power of this interface"; + } + leaf rx-channel-power-max { + type power-dbm; + config false; + description "The maximum input power of this interface"; + } + leaf rx-total-power-max { + type power-dbm; + config false; + description + "Maximum rx optical power for all the channels. + + It is applicable only to multi-channel modes."; + } + } // grouping common-all-modes + + grouping common-transceiver-param { + description + "The common parameters of an optical transceiver, + that supplement the configured mode."; + + uses common-transceiver-configured-param; + uses common-transceiver-readonly-param; + } + + grouping common-transceiver-configured-param { + description + "The configured parameters of an optical transceiver, + that supplement the configured mode."; + + leaf line-coding-bitrate { + type identityref { + base line-coding; + } + description + "Bit rate/line coding of the optical tributary signal. + + Support of this attribute is optional when the configured + mode supports only one bit rate/line coding."; + reference + "ITU-T G.698.2 section 7.1.2"; + } + leaf tx-channel-power { + type power-dbm-or-null; + description + "The current channel transmit power, when the value is + known or an empty value when the value is not known. + + The empty value MUST NOT be used when this attribute is + configured."; + } + } // grouping for configured transceiver attributes out of mode + + grouping common-transceiver-readonly-param { + description + "The common read-only parameters of an optical transceiver, + that supplement the configured mode."; + + leaf rx-channel-power { + type power-dbm-or-null; + config false; + description + "The current channel received power, when the value is + known or an empty value when the value is not known."; + } + leaf rx-total-power { + type power-dbm-or-null; + config false; + description + "The current total received power, when the value is known + or an empty value when the value is not known."; + } + } // grouping for read-only transceiver attributes out of mode + + grouping l0-tunnel-attributes { + description + "Parameters for Layer0 (WSON or Flexi-Grid) Tunnels."; + + leaf wavelength-assignment { + type identityref { + base wavelength-assignment; + } + description "Wavelength Allocation Method"; + } + } + + grouping frequency-range { + description + "This grouping defines the lower and upper bounds of a + frequency range (e.g., a band). + + This grouping SHOULD NOT be used to define a frequency slot, + which SHOULD be defined using the n and m values instead."; + leaf lower-frequency { + type frequency-thz; + mandatory true; + description + "The lower frequency boundary of the + frequency range."; + } + leaf upper-frequency { + type frequency-thz; + must '. > ../lower-frequency' { + error-message + "The upper frequency must be greater than the lower + frequency."; + } + mandatory true; + description + "The upper frequency boundary of the + frequency range."; + } + } + + grouping l0-path-constraints { + description + "Common attribute for Layer 0 path constraints to be used by + Layer 0 computation."; + leaf gsnr-extra-margin { + type snr { + range 0..max; + } + default 0; + description + "An additional margin to be added to the OSNR-min of the + transceiver when checking the estimated received Generalized + SNR (GSNR)."; + } + } + + grouping l0-path-properties { + description + "Common attribute for reporting the Layer 0 computed path + properties."; + leaf estimated-gsnr { + type snr; + config false; + description + "The estimate received GSNR for the computed path."; + } + leaf estimated-eol-gsnr { + type snr; + config false; + description + "The estimate received GSNR for the computed path + degraded at the end of life."; + } + leaf estimated-lowest-gsnr { + type snr; + config false; + description + "The estimate lowest received GSNR for the computed path + among all possible wavelength channels along the same + path."; + } + } +} \ No newline at end of file diff --git a/gnpyapi/yang/ietf-optical-impairment-topology@2024-05-21.yang b/gnpyapi/yang/ietf-optical-impairment-topology@2024-05-21.yang new file mode 100644 index 0000000..3eaf73e --- /dev/null +++ b/gnpyapi/yang/ietf-optical-impairment-topology@2024-05-21.yang @@ -0,0 +1,1776 @@ +module ietf-optical-impairment-topology { + yang-version 1.1; + namespace "urn:ietf:params:xml" + + ":ns:yang:ietf-optical-impairment-topology"; + prefix "oit"; + + import ietf-network { + prefix "nw"; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + import ietf-network-topology { + prefix "nt"; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + import ietf-te-topology { + prefix "tet"; + reference + "RFC 8795: YANG Data Model for Traffic Engineering (TE) + Topologies"; + } + + import ietf-te-types { + prefix "te-types"; + reference + "RFC YYYY: Updated Common YANG Data Types for Traffic + Engineering"; + } + + /* Note: The RFC Editor will replace YYYY with the number assigned + to the RFC once draft-ietf-teas-rfc8776-update becomes an RFC.*/ + + import ietf-layer0-types { + prefix "l0-types"; + reference + "RFC ZZZZ: A YANG Data Model for Layer 0 Types"; + } + + /* Note: The RFC Editor will replace ZZZZ with the number assigned + to the RFC once draft-ietf-ccamp-rfc9093-bis becomes an RFC.*/ + + organization + "IETF CCAMP Working Group"; + + contact + "WG Web: + WG List: + + Editor: Young Lee + Editor: Haomian Zheng + Editor: Nicola Sambo + Editor: Victor Lopez + Editor: Gabriele Galimberti + Editor: Giovanni Martinelli + Editor: Jean-Luc Auge + Editor: Le Rouzic Esther + Editor: Julien Meuric + Editor: Italo Busi + Editor: Dieter Beller + Editor: Sergio Belotti + Editor: Griseri Enrico + Editor: Gert Grammel "; + + description + "This module contains a collection of YANG definitions for + impairment-aware optical networks. + + Copyright (c) 2024 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Revised BSD + License set forth in Section 4.c of the IETF Trust's Legal + Provisions Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC XXXX; see + the RFC itself for full legal notices."; + +// RFC Ed.: replace XXXX with actual RFC number and remove +// this note +// replace the revision date with the module publication date +// the format is (year-month-day) + revision 2024-05-21 { + description + "Initial Version"; + reference + "RFC XXXX: A Yang Data Model for Impairment-aware + Optical Networks"; + } + + /* + * Identities + */ + + identity otsi-protection { + base te-types:lsp-protection-type; + description + "Individual OTSi(G) protection LSP protection type."; + reference + "ITU-T G.873.1 v5.2 (02/2022): Optical transport network: + Linear protection"; + } + + /* + * Groupings + */ + + grouping amplifier-params { + description "describes parameters for an amplifier"; + container amplifier { + description + "amplifier type, operatonal parameters are described."; + leaf type-variety { + type string; + mandatory true ; + description + "String identifier of amplifier type referencing + a specification in a separate equipment catalog"; + } + container operational { + description "amplifier operational parameters"; + list amplifier-element { + key "frequency-range-id stage-order"; + description + "The list of parallel amplifier elements within an + amplifier used to amplify different frequency ranges. + + Two elements in the list must not have the same range + or overlapping ranges."; + leaf frequency-range-id { + type uint16; + description + "The identifier of the frequency range."; + } + leaf stage-order { + type uint8; + description + "It allows defining for each spectrum badwidth the + cascade order of each amplifier-element."; + } + leaf name { + type string; + description + "The name of the amplifier element as specified in + the vendor's specification associated with the + type-variety."; + } + leaf type-variety { + type string; + description + "String identifier of amplifier element type + referencing a specification in a separate equipment + catalog. + + This attributes applies only when the type-variety of + the amplifier is not sufficient to describe the + amplifier element type."; + } + container frequency-range { + description + "The frequency range amplified by the amplifier + element."; + uses l0-types:frequency-range; + } + container power-param { + description + "The optical power after the out-voa of each amplifier + element."; + choice power-param { + mandatory true; + description + "Select the mode: channel power or power spectral + density (PSD)."; + case channel-power { + leaf nominal-carrier-power { + type l0-types:power-dbm-or-null; + mandatory true; + description + "Reference channel power."; + } + } + case power-spectral-density { + leaf nominal-psd { + type l0-types:psd-or-null; + mandatory true; + description + "Reference power spectral density (PSD)."; + } + } + } + } // container power-param + leaf pdl { + type l0-types:power-loss-or-null; + description "Polarization Dependent Loss (PDL)"; + } + choice amplifier-element-type { + mandatory true; + description + "Identifies whether the amplifier element is an + Optical Amplifier (OA) or a Dynamic Gain Equalizer + (DGE)."; + container optical-amplifier { + description + "The attributes applicable only to amplifier + elements"; + leaf actual-gain { + type l0-types:power-gain-or-null; + mandatory true; + description + "The value of the gain provided by the + amplification stage of the optical amplifier."; + } + leaf in-voa { + type l0-types:power-loss-or-null; + description + "Loss introduced by the Variable Optical Attenuator + (VOA) at the input of the amplification stage of + the amplifier, if present"; + } + leaf out-voa { + type l0-types:power-loss-or-null; + description + "Loss introduced by the Variable Optical Attenuator + (VOA) at the output of the amplification stage of + the amplifier, if present."; + } + leaf tilt-target { + type l0-types:decimal-2-or-null; + units "dB"; + mandatory true ; + description + "The tilt target defined between lower and upper + frequency of the amplifier frequency range."; + } + leaf total-output-power { + type l0-types:power-dbm-or-null; + mandatory true; + description + "It represent total output power measured in the + range specified by the frequency-range. + + Optical power is especially needed to + re-compute/check consistency of span + (fiber + concentrated loss) loss value, with + respect to loss/gain information on elements."; + } + leaf raman-direction { + type enumeration { + enum co-propagating { + description + "Co-propagating indicates that optical pump + light is injected in the same direction to the + optical signal that is amplified + (forward pump)."; + } + enum counter-propagating { + description + "Counter-propagating indicates that optical + pump light is injected in opposite direction + to the optical signal that is amplified + (backward pump)."; + } + } + description + "The direction of injection of the raman pump."; + } + list raman-pump { + key pump-id; + description + "The list of pumps for the Raman amplifier."; + leaf pump-id { + type uint16; + description + "The identifier of a pump within an amplifier + element."; + } + leaf frequency { + type l0-types:frequency-thz; + description + "The raman pump central frequency."; + } + leaf power { + type l0-types:decimal-2-or-null; + units "Watts"; + description + "The total pump power considering a depolarized + pump at the raman pump central frequency."; + } + } + } // container optical-amplifier + container dynamic-gain-equalizer { + presence + "When present it indicates that the amplifier element + is a Dynamic Gain Equalizer (DGE)"; + description + "The attributes applicable only to DEG amplifier + elements."; + list media-channel { + key "flexi-n"; + description + "List of media channels represented as (n,m)"; + + uses l0-types:flexi-grid-frequency-slot { + refine flexi-m { + mandatory true; + } + } + + leaf delta-power { + type l0-types:power-ratio-or-null; + description + " Deviation from the reference carrier power + defined for the OMS."; + } + } // media channels list + } // container dynamic-gain-equalizer + } // choice amplifier-element-type + } // list amplifier-element + } // container operational + } // container amplifier + } // grouping amplifier-params + + grouping fiber-params { + description + "String identifier of fiber type referencing a + specification in a separate equipment catalog"; + container fiber { + description "fiber characteristics"; + leaf type-variety { + type string ; + mandatory true ; + description "fiber type"; + } + leaf length { + type l0-types:decimal-2-or-null; + units km; + mandatory true ; + description "length of fiber"; + } + leaf loss-coef { + type l0-types:decimal-2-or-null; + units dB/km; + mandatory true ; + description "loss coefficient of the fiber"; + } + leaf total-loss { + type l0-types:power-loss-or-null; + description + "The measured total loss of the fiber, which includes + all possible losses: fiber loss and conn-in and conn-out + losses. + + This attribute is not present when the total loss cannot + be measured."; + } + leaf pmd { + type l0-types:decimal-2-or-null; + units "ps"; + description "pmd of the fiber"; + } + leaf conn-in{ + type l0-types:power-loss-or-null; + description "connector-in"; + } + leaf conn-out{ + type l0-types:power-loss-or-null; + description "connector-out"; + } + } + } + + grouping roadm-common-path { + description + "The optical impairments of a ROADM which are common to all + its paths (express path, add path or drop path)."; + leaf roadm-pmd { + type union { + type decimal64 { + fraction-digits 8; + range "0..max"; + } + type empty; + } + units "ps"; + description + "Polarization Mode Dispersion (PMD), when known, or an + empty value when unknown."; + } + leaf roadm-cd { + type l0-types:decimal-5-or-null; + units "ps/nm"; + description "Chromatic Dispersion (CD)"; + } + leaf roadm-pdl { + type l0-types:power-loss-or-null; + description "Polarization Dependent Loss (PDL)"; + } + leaf roadm-inband-crosstalk { + type l0-types:decimal-2-or-null; + units "dB"; + description + "In-band crosstalk, or coherent crosstalk, can occur in + components that can have multiple same wavelength inputs + with the inputs either routed to different output ports, + or all but one blocked"; + } + leaf roadm-maxloss { + type l0-types:power-loss-or-null; + description + "This is the maximum expected path loss from the + ROADM ingress to the ROADM egress + assuming no additional path loss is added"; + } + } // grouping roadm-common-path + + grouping roadm-express-path { + description + "The optical impairments of a ROADM express path."; + uses roadm-common-path; + } // grouping roadm-express-path + + grouping roadm-add-path { + description + "The optical impairments of a ROADM add path."; + uses roadm-common-path { + refine roadm-inband-crosstalk { + description + "In-band crosstalk, or coherent crosstalk, + can occur in components that can have multiple same + wavelength inputs,with the inputs either + routed to different output ports, + or all but one blocked. + + In the case of add path it is the total + of the add block + egress WSS crosstalk contributions."; + } + refine roadm-maxloss { + description + "This is the maximum expected add path loss from + the add/drop port input to the ROADM egress, + assuming no additional add path loss is added. + This is used to establish the minimum required + transponder output power required + to hit the ROADM egress target power + levels and preventing + to hit the WSS attenuation limits. + If the add path contains an internal amplifier + this loss value should be based + on worst case expected amplifier gain due to + ripple or gain uncertainty"; + } + } + leaf roadm-pmax { + type l0-types:power-dbm-or-null; + description + "This is the maximum (per carrier) power level + permitted at the add block input ports, + that can be handled by the ROADM node. + This may reflect either add amplifier power + contraints or WSS adjustment limits. + Higher power transponders would need to have + their launch power reduced + to this value or lower"; + } + leaf roadm-osnr { + type l0-types:snr-or-null; + description + "Optical Signal-to-Noise Ratio (OSNR). + If the add path contains the ability to adjust the + carrier power levels into an add path amplifier + (if present) to a target value, + this reflects the OSNR contribution of the + add amplifier assuming this target value is obtained. + The worst case OSNR based on the input power and + NF calculation method, and this value, should be used + (if both are defined)."; + } + leaf roadm-noise-figure { + type l0-types:decimal-5-or-null; + units "dB"; + description + "Noise Figure. If the add path contains an amplifier, + this is the noise figure of that amplifier inferred + to the add port. + This permits add path OSNR calculation based + on the input power levels to the add block + without knowing the ROADM path losses to + the add amplifier."; + } + } // grouping roadm-add-path + + grouping roadm-drop-path { + description + "The optical impairments of a ROADM drop path"; + uses roadm-common-path { + refine roadm-inband-crosstalk { + description + "In-band crosstalk, or coherent crosstalk, can occur in + components that can have multiple same wavelength + inputs,with the inputs either routed to different + output ports,or all but one blocked. + + In the case of drop path it is the total + of the ingress + to drop e.g. WSS and drop block crosstalk + contributions."; + } + refine roadm-maxloss { + description + "The net loss from the ROADM input,to the output + of the drop block. + If ROADM ingress to drop path includes an amplifier, + the amplifier gain reduces the net loss. + This is before any additional drop path attenuation + that may be required + due to drop amplifier power contraints. + The max value correspond to worst case expected loss, + including amplifier gain ripple or uncertainty. + It is the maximum output power of the drop + amplifier."; + } + } + leaf roadm-minloss { + type l0-types:power-loss-or-null; + description + "The net loss from the ROADM input, to the + output of the drop block. + If this ROADM ingress to drop path includes + an amplifier,the amplifier gain reduces the net loss. + This is before any additional drop path attenuation + that may be required due to drop amplifier power + contraints. + The min value correspond to best case expected loss, + including amplifier gain ripple or uncertainty."; + } + leaf roadm-typloss { + type l0-types:power-loss-or-null; + description + "The net loss from the ROADM input, + to the output of the drop block. + If this ROADM ingress to drop path + includes an amplifier, + the amplifier gain reduces the net loss. + This is before any additional drop path + attenuation + that may be required due to drop amplifier + power contraints. + The typ value correspond to typical case + expected loss."; + } + leaf roadm-pmin { + type l0-types:power-dbm-or-null; + description + "If the drop path has additional loss + that is added, for example, + to hit target power levels into a + drop path amplifier, or simply, to reduce the + power of a strong carrier + (due to ripple,for example), + then the use of the ROADM input power levels and + the above drop losses is not appropriate. + This parameter corresponds to the min per + carrier power levels + expected at the output of the drop block. + A detail example of the comparison using + these parameters is + detailed in section xxx of the document yyy."; + } + leaf roadm-pmax { + type l0-types:power-dbm-or-null; + description + "If the drop path has additional loss that is added, + for example, to hit target power levels into a + drop path amplifier,or simply,to reduce the power + of a strong carrier(due to ripple,for example), + then the use of the ROADM input power levels and the + above drop losses is not appropriate. + This parameter corresponds to the best case per + carrier power levels expected at the output of the + drop block. + A detail example of the comparison using + these parameters + is detailed in section xxx of the document yyy"; + } + leaf roadm-ptyp { + type l0-types:power-dbm-or-null; + description + "If the drop path has additional loss that is added, + for example, to hit target power levels into a + drop path amplifier,or simply,to reduce the + power of a strong carrier(due to ripple,for example), + then the use of the ROADM input power levels and + the above drop losses is not appropriate. + This parameter corresponds to the typical case + per carrier power levels expected + at the output of the drop block."; + } + leaf roadm-osnr { + type l0-types:snr-or-null; + description + "Optical Signal-to-Noise Ratio (OSNR). + Expected OSNR contribution of the drop path + amplifier(if present) + for the case of additional drop path loss + (before this amplifier) + in order to hit a target power level (per carrier). + If both, the OSNR based on the ROADM + input power level + (Pcarrier = + Pref+10Log(carrier-baudrate/ref-baud) + delta-power) + and the input inferred NF(NF.drop), + and this OSNR value, are defined, + the minimum value between these two should be used"; + } + leaf roadm-noise-figure { + type l0-types:decimal-5-or-null; + units "dB"; + description + "Drop path Noise Figure. + If the drop path contains an amplifier, + this is the noise figure + of that amplifier, inferred to the + ROADM ingress port. + This permits to determine + amplifier OSNR contribution + without having to specify the + ROADM node's losses to that amplifier. + This applies for the case of no + additional drop path loss, + before the amplifier, in order to reduce the power + of the carriers to a target value"; + } + } // grouping roadm-drop-path + + grouping concentratedloss-params { + description "concentrated loss"; + container concentratedloss{ + description "concentrated loss"; + leaf loss { + type l0-types:power-loss-or-null; + mandatory true; + description + "Loss introduced by the concentrated loss element."; + } + } + } + + grouping oms-general-optical-params { + description "OMS link optical parameters"; + leaf generalized-snr { + type l0-types:snr; + description "generalized snr"; + } + leaf equalization-mode{ + type identityref { + base l0-types:type-power-mode; + } + description + "The equalization mode. + + When not present it indicates that the information about + the equalization mode is not reported. + + Reporting this value is needed to support optical + impairments applications."; + } + container power-param { + description + "Optical channel power or power spectral densitity (PSD) + after the ROADM."; + leaf nominal-carrier-power { + when "derived-from-or-self(../../equalization-mode, " + + "'l0-types:carrier-power')"; + type l0-types:power-dbm-or-null; + description + "Reference channel power."; + } + leaf nominal-psd { + when "derived-from-or-self(../../equalization-mode, " + + "'l0-types:power-spectral-density')"; + type l0-types:psd-or-null; + description + " Reference power spectral density (PSD)."; + } + } // container power-param + } // grouping oms-general-optical-params + + grouping otsi-group { + description "OTSiG definition , representing client + digital information stream supported by one or more OTSi"; + + list otsi { + key "otsi-carrier-id"; + config false; + description + "list of OTSi contained in one OTSiG. + The list could also be of only one element"; + leaf otsi-carrier-id { + type uint16; + description "OTSi carrier-id"; + } + leaf otsi-carrier-frequency { + type union { + type l0-types:frequency-thz; + type empty; + } + description + "OTSi carrier frequency, equivalent to the + actual configured transmitter frequency, when known, or + an empty value when unknown."; + } + leaf-list e2e-mc-path-id { + type uint16; + description + "The list of the possible end-to-end Media Channel + (e2e-MC) paths associated with the OTSi which have + different optical impairments. + + This list is meaningful in case the OTSi can be associated + with multiple end-to-end Media Channel (e2e-MC) paths + (e.g., when OPS protection is configured). + + The list can be empty when the OTSi has only one + e2e-MC path."; + } + } // OTSi list + } // OTSiG grouping + + grouping media-channel-groups { + description + "media channel groups. + + This grouping is not intended to be reused outside of this + module."; + + container media-channel-groups { + presence + "When present, it indicates that the list media channel + groups is reported."; + description + "The top level container for the list of media channel + groups."; + list media-channel-group { + key "otsi-group-ref"; + description + "The list of media channel groups"; + leaf otsi-group-ref { + type leafref { + path "../../../../../../../otsis/" + + "otsi-group/otsi-group-id"; + } + description + "Reference to the OTSiG to which the OTSis carried by + this media channel group belong to."; + } + list media-channel { + // key "flexi-n"; + key "media-channel-id"; + unique "flexi-n"; + description + "list of media channels represented as (n,m)"; + leaf media-channel-id { + type int16; + description + "The identifier of media channel within media channel + group. + + It may be equal to the flexi-n attribute, when the + flexi-n attribute is present."; + } + // this grouping add both n.m values + uses l0-types:flexi-grid-frequency-slot; + + list otsi-ref { + key "otsi-carrier-ref"; + description + "The list of references to the OTSis and their + end-to-end Media Channel (e2e-MC) paths within the + OTSiG carried by this media channel."; + leaf otsi-carrier-ref { + type leafref { + path "../../../../../../../../../otsis/" + + "otsi-group[otsi-group-id=current()" + + "/../../../otsi-group-ref]/" + + "otsi/otsi-carrier-id" ; + } + description + "Reference to the OTSi within the OTSiG carried + by this media channel."; + } + leaf-list e2e-mc-path-ref { + type leafref { + path "../../../../../../../../../otsis/" + + "otsi-group[otsi-group-id=current()" + + "/../../../otsi-group-ref]/" + + "otsi[otsi-carrier-id=current()" + + "/../otsi-carrier-ref]/e2e-mc-path-id"; + } + description + "References to the end-to-end Media Channel (e2e-MC) + paths of this OTSi which are routed through this + media channel."; + } + } + leaf delta-power { + type l0-types:power-ratio-or-null; + description + " Deviation from the reference carrier power defined + for the OMS."; + } + } // media channels list + } // media-channel-groups list + } + } // media media-channel-groups grouping + + grouping oms-element { + description "OMS description"; + container OMS-elements { + presence + "When present, it indicates that the list of OMS elements + is reported."; + description + "The top level container for the list of OMS elements."; + list OMS-element { + key "elt-index"; + description + "defines the spans and the amplifier blocks of + the amplified lines"; + leaf elt-index { + type uint16; + description + "ordered list of Index of OMS element + (whether it's a Fiber, an EDFA or a + Concentratedloss)"; + } + leaf oms-element-uid { + type union { + type string; + type empty; + } + description + "Unique id of the element, if it exists and it is known. + + When unknown, an empty value is reported. + + When it does not exist, the attribute is not present."; + } + container reverse-element-ref { + description + "It contains references to the elements which are + associated with this element in the reverse + direction."; + leaf link-ref { + type leafref { + path "../../../../../../../../nt:link/nt:link-id"; + } + description + "The reference to the OMS link which the OMS elements + belongs to."; + } + leaf-list oms-element-ref { + type leafref { + path "../../../../../../../../nt:link[nt:link-id=" + + "current()/../link-ref]/tet:te/" + + "tet:te-link-attributes/OMS-attributes/" + + "OMS-elements/OMS-element/elt-index"; + } + description + "The references to the OMS elements."; + } + } + choice element { + mandatory true; + description "OMS element type"; + case amplifier { + uses tet:geolocation-container; + uses amplifier-params; + } + case fiber { + uses fiber-params; + } + case concentratedloss { + uses concentratedloss-params ; + } + } + } + } + } + + grouping otsi-ref { + description + "References to an OTSi. + + This grouping is intended to be reused within the + transceiver's list only."; + leaf otsi-group-ref { + type leafref { + path "../../../../../../otsis/otsi-group/" + + "otsi-group-id"; + } + description + "The OTSi generated by the transceiver's transmitter."; + } + leaf otsi-ref { + type leafref { + path "../../../../../../otsis/otsi-group" + + "[otsi-group-id=current()/../otsi-group-ref]/otsi/" + + "otsi-carrier-id"; + } + description + "The OTSi generated by the transceiver's transmitter."; + } + } + +/* + * Data nodes + */ + + augment "/nw:networks/nw:network/nw:network-types" + + "/tet:te-topology" { + description "optical-impairment topology augmented"; + container optical-impairment-topology { + presence + "Indicates an impairment-aware topology of optical networks"; + description + "Container to identify impairment-aware topology type"; + reference + "RFC8345: A YANG Data Model for Network Topologies."; + } + } + + augment "/nw:networks/nw:network" { + when "./nw:network-types/tet:te-topology" + + "/oit:optical-impairment-topology" { + description + "This augment is only valid for Optical Impairment + topology."; + } + description + "Network augmentation for optical impairments data."; + container otsis { + presence + "When present, it indicates that OTSi information is + reported."; + description + "The information about the OTSis configured on the WDM-TE + link."; + list otsi-group { + key "otsi-group-id"; + config false; + description + "the list of possible OTSiG representing client digital + stream"; + leaf otsi-group-id { + type string; + description + "A network-wide unique identifier of otsi-group element. + It could be structured e.g., as an URI or as an UUID."; + } + uses otsi-group; + } // list of OTSiG + } + + container templates { + config false; + description + "Templates for set of parameters which can be common to + multiple elements."; + container roadm-path-impairments { + description + "The top level container for the list of the set of + optical impairments related to ROADM paths."; + list roadm-path-impairment { + key "roadm-path-impairments-id"; + description + "The list of the set of optical impairments related to + ROADM paths."; + + leaf roadm-path-impairments-id { + type string; + description + "The identifier of the set of optical impairments + related to a ROADM path."; + } + choice impairment-type { + description "type path impairment"; + case roadm-express-path { + list roadm-express-path { + key frequency-range-id; + description + "The list of optical impairments on a ROADM express + path for different frequency ranges. + + Two elements in the list must not have the same + range or overlapping ranges."; + leaf frequency-range-id { + type uint16; + description + "The identifier of the frequency range."; + } + container frequency-range { + description + "The frequency range for which these optical + impairments apply."; + uses l0-types:frequency-range; + } + uses roadm-express-path; + } + } + case roadm-add-path { + list roadm-add-path { + key frequency-range-id; + description + "The list of optical impairments on a ROADM add + path for different frequency ranges. + + Two elements in the list must not have the same + range or overlapping ranges."; + leaf frequency-range-id { + type uint16; + description + "The identifier of a frequency range."; + } + container frequency-range { + description + "The frequency range for which these optical + impairments apply."; + uses l0-types:frequency-range; + } + uses roadm-add-path; + } + } + case roadm-drop-path { + list roadm-drop-path { + key frequency-range-id; + description + "The list of optical impairments on a ROADM add + path for different frequency ranges. + + Two elements in the list must not have the same + range or overlapping ranges."; + leaf frequency-range-id { + type uint16; + description + "The identifier of a frequency range."; + } + container frequency-range { + description + "The frequency range for which these optical + impairments apply."; + uses l0-types:frequency-range; + } + uses roadm-drop-path; + } + } + } + } // list roadm-path-impairments + } // container roadm-path-impairments + container explicit-transceiver-modes { + description + "The top level container for the list of the + transceivers' explicit modes."; + list explicit-transceiver-mode { + key explicit-transceiver-mode-id; + description + "The list of the transceivers' explicit modes."; + leaf explicit-transceiver-mode-id { + type string; + description + "The identifier of the transceivers' explicit mode."; + } + uses l0-types:explicit-mode; + } // list explicit-transceiver-mode + } // container explicit-transceiver-modes + } // container templates + } // augment network + + augment "/nw:networks/nw:network/nw:node" { + when "../nw:network-types/tet:te-topology" + + "/oit:optical-impairment-topology" { + description + "This augment is only valid for Optical Impairment."; + } + description + "Node augmentation for optical impairments data."; + container transponders { + presence + "If present, it indicates that the list of transponders is + reported."; + description + "The top level container for the list of transponders."; + list transponder { + key "transponder-id"; + config false; + description "The list of transponders."; + leaf transponder-id { + type uint32; + description "transponder identifier"; + } + leaf termination-type-capabilities { + type enumeration { + enum tunnel-only { + description + "The transponder can only be used in an Optical + Tunnel termination configuration."; + } + enum 3r-only { + description + "The transponder can only be used in a 3R + configuration."; + } + enum 3r-or-tunnel { + description + "The transponder can be configure to be used either + in an Optical Tunnel termination configuration or in + a 3R configuration."; + } + } + description + "Describes whether the transponder can be used in an + Optical Tunnel termination configuration or in a 3R + configuration (or both)."; + } + leaf supported-3r-mode { + when '(../termination-type-capabilities = "3r-only") or + (../termination-type-capabilities = "3r-or-tunnel")' + { + description + "Applies only when the transponder supports 3R + configuration."; + } + type enumeration { + enum unidir { + description + "Unidirectional 3R configuration."; + } + enum bidir { + description + "Bidirectional 3R configuration."; + } + } + description + "Describes the supported 3R configuration type."; + } + list transceiver { + key "transceiver-id"; + config false; + min-elements 1; + description "list of transceiver related to a transponder"; + leaf transceiver-id { + type uint32; + description "transceiver identifier"; + } + uses l0-types:transceiver-capabilities { + augment "supported-modes/supported-mode/mode/" + + "explicit-mode/explicit-mode" { + description + "Augment the explicit-mode container with the + proper leafref."; + leaf explicit-transceiver-mode-ref { + type leafref { + path "../../../../../../../../oit:templates" + + "/oit:explicit-transceiver-modes" + + "/oit:explicit-transceiver-mode" + + "/oit:explicit-transceiver-mode-id"; + } + description + "The refernce to the explicit transceiver + mode template."; + } + } + } + leaf configured-mode { + type union { + type empty; + type leafref { + path "../supported-modes/supported-mode/mode-id"; + } + } + description + "Reference to the configured mode for transceiver + compatibility approach. + + The empty value is used to report that no mode has + been configured and there is no default mode. + + When not present, the configured-mode is not reported + by the server."; + } + uses l0-types:common-transceiver-param; + container outgoing-otsi { + when "../../../../../otsis" { + description + "It applies only when the OTSi information is + reported."; + } + description + "The OTSi generated by the transceiver's transmitter."; + uses otsi-ref; + } + container incoming-otsi { + when "../../../../../otsis" { + description + "It applies only when the OTSi information is + reported."; + } + description + "The OTSi received by the transceiver's received."; + uses otsi-ref; + } + leaf configured-termination-type { + type enumeration { + enum unused-transceiver { + description + "The transcevier is not used."; + } + enum tunnel-termination { + description + "The transceiver is currently used in an Optical + Tunnel termination configuration."; + } + enum 3r-regeneration { + description + "The transceiver is currently used in a 3R + configuration."; + } + } + description + "Describes whether the current configuration of the + transceiver is used in an Optical Tunnel termination + configuration or in a 3R configuration. + + If empty, it means that the information about the + configured-termination-type is not reported."; + } + } // end of list of transceiver + } // end list of transponder + } + container regen-groups { + presence + "When present, it indicates that the list of 3R groups + is reported."; + description + "The top level container for the list of 3R groups."; + list regen-group { + key "group-id"; + config false; + description + "The list of 3R groups. + + Any 3R group represent a group of transponder in which an + a an electrical connectivity is either in place or could + be dynamically provided, to associated transponders used + for 3R regeneration."; + leaf group-id { + type uint32; + description + "Group identifier used an index to access elements in the + list of 3R groups."; + } + leaf regen-metric { + type uint32; + description + "The cost permits choice among different group of + transponders during path computation"; + } + leaf-list transponder-ref { + type leafref { + path "../../../transponders/transponder/transponder-id"; + } + description + "The list of transponder belonging to this 3R group."; + } + } // end 3R-group + } + } + + augment "/nw:networks/nw:network/nt:link/tet:te" + + "/tet:te-link-attributes" { + when "../../../nw:network-types/tet:te-topology/" + + "oit:optical-impairment-topology" { + description + "This augment is only valid for Optical Impairment + topology."; + } + description "Optical Link augmentation for impairment data."; + container OMS-attributes { + config false; + description "OMS attributes"; + uses oms-general-optical-params; + uses media-channel-groups; + uses oms-element; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te" + + "/tet:tunnel-termination-point" { + when "../../../nw:network-types/tet:te-topology/" + + "oit:optical-impairment-topology" { + description + "This augment is only valid for Optical Impairment + topology."; + } + description + "Tunnel termination point augmentation for impairment data."; + + list ttp-transceiver { + when "../../../transponders" { + description + "It applies only when the list of transponders is + reported."; + } + key "transponder-ref transceiver-ref"; + config false; + min-elements 1; + description + "The list of the transceivers used by the TTP."; + leaf transponder-ref { + type leafref { + path "../../../../transponders/transponder/transponder-id"; + } + description + "The reference to the transponder hosting the transceiver + of the TTP."; + } + leaf transceiver-ref { + type leafref { + path "../../../../transponders/transponder" + + "[transponder-id=current()/../transponder-ref]/" + + "transceiver/transceiver-id"; + } + description + "The reference to the transceiver of the TTP."; + } + } // list of transceivers + } // end of augment + + // Should this leaf be moved to te-topology? + augment "/nw:networks/nw:network/nw:node/nt:termination-point" { + when "../../nw:network-types/tet:te-topology/" + + "oit:optical-impairment-topology" { + description + "This augment is only valid for Optical Impairment + topology"; + } + description + "Augment LTP"; + leaf protection-type { + type identityref { + base te-types:lsp-protection-type; + } + description + "The protection type that this LTP is capable of. + + When not present it indicates that the information about + the protection type is not reported."; + } + } + + augment "/nw:networks/nw:network/nw:node/nt:termination-point" + + "/tet:te" { + when "../../../nw:network-types/tet:te-topology/" + + "oit:optical-impairment-topology" { + description + "This augment is only valid for Optical Impairment + topology"; + } + description + "Augment TE attributes of an LTP"; + + leaf inter-layer-sequence-number { + type uint32; + description + "The inter-layer-sequence-number (ILSN) is used to report + additional connectivity constraints between a client layer + Link Termination Point (LTP), such as a muxponder port, and + the server layer Tunnel Termination Point (TTP). + + A client service cannot be setup between two client layer + LTPs which report different values of the ILSN. + + This attribute is not reported when there are no additional + connectivity constraints. + + Therefore, a client service can be setup when at least one + of the two client layer LTPs does not report any ILSN or + both client layer LTPs report the same ILSN value and the + corresponding server layer TTPs have at least one common + server-layer switching capability and at least one common + client-layer switching capability."; + } + } + + augment "/nw:networks/nw:network/nw:node/tet:te" + + "/tet:te-node-attributes" { + when "../../../nw:network-types/tet:te-topology" + + "/oit:optical-impairment-topology" { + description + "This augment is only valid for Optical Impairment + topology"; + } + description + "node attributes augmentantion for optical-impairment ROADM + node"; + + } // augmentation for optical-impairment ROADM + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices"{ + when "../../../../nw:network-types/tet:te-topology/" + + "oit:optical-impairment-topology" { + description + "This augment is only valid for Optical Impairment + topology "; + } + description + "Augment default TE node connectivity matrix information + source."; + + leaf roadm-path-impairments { + type leafref { + path "../../../../../oit:templates" + + "/oit:roadm-path-impairments/oit:roadm-path-impairment" + + "/oit:roadm-path-impairments-id"; + } + config false; + description + "Pointer to the list set of ROADM optical impairments"; + } + } // augmentation connectivity-matrices information-source + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:information-source-entry/tet:connectivity-matrices/" + + "tet:connectivity-matrix" { + when "../../../../../nw:network-types/tet:te-topology/" + + "oit:optical-impairment-topology" { + description + "This augment is only valid for Optical Impairment + topology "; + } + description + "Augment TE node connectivity matrix entry information + source."; + leaf roadm-path-impairments { + type leafref { + path "../../../../../../oit:templates" + + "/oit:roadm-path-impairments/oit:roadm-path-impairment" + + "/oit:roadm-path-impairments-id"; + } + config false; + description + "Pointer to the list set of ROADM optical impairments"; + } + } // augmentation connectivity-matrix information-source + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices" { + when "../../../../nw:network-types/tet:te-topology/" + + "oit:optical-impairment-topology" { + description + "This augment is only valid for Optical Impairment + topology "; + } + description + "Augment default TE node connectivity matrix."; + leaf roadm-path-impairments { + type leafref { + path "../../../../../oit:templates" + + "/oit:roadm-path-impairments/oit:roadm-path-impairment" + + "/oit:roadm-path-impairments-id"; + } + config false; /*the identifier in the list */ + /*"roadm-path-impairments" of ROADM optical impairment*/ + /*is read-only as the rest of attributes*/ + description "pointer to the list set of ROADM optical + impairments"; + } + } // augmentation connectivity-matrices + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/" + + "tet:connectivity-matrices/tet:connectivity-matrix" { + when "../../../../../nw:network-types/tet:te-topology/" + + "oit:optical-impairment-topology" { + description + "This augment is only valid for + Optical Impairment topology "; + } + description + "Augment TE node connectivity matrix entry."; + leaf roadm-path-impairments { + type leafref { + path "../../../../../../oit:templates" + + "/oit:roadm-path-impairments/oit:roadm-path-impairment" + + "/oit:roadm-path-impairments-id"; + } + config false; + description "pointer to the list set of ROADM optical + impairments"; + } + } // augmentation connectivity-matrix + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:from" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "oit:optical-impairment-topology" { + description + "This augment is only valid for + Optical Impairment topology "; + } + description + "Augment the attributes for the 'from' LTP for the TE node + connectivity matrix entry."; + list additional-ltp { + when "derived-from-or-self(../../../../../../" + + "nt:termination-point" + + "[nt:tp-id=current()/../../tet:to/tet:tp-ref]/" + + "oit:protection-type," + + "'oit:otsi-protection')" { + description + "This list applies only when the 'to' LTP for this + connectivity matrix entry supports individual OTSi(G) + protection."; + } + key "ltp-ref"; + config false; + description + "The restricted list of the potential secondary LTPs that + can be selected when the 'from' LTP of this connectivity + matrix entry is selected as a working LTP. + + If this list is empty, all the other LTPs that can reach + the 'to' LTP of this connectivity matrix entry can be + selected as secondary LTPs."; + leaf ltp-ref { + type leafref { + path "../../../../../../../nt:termination-point/nt:tp-id"; + } + description + "The reference to the potential secondary LTP that can be + selected when the 'from' LTP of this connectivity matrix + entry is selected as a working LTP"; + } + leaf roadm-path-impairments { + type leafref { + path "../../../../../../../../oit:templates" + + "/oit:roadm-path-impairments/oit:roadm-path-impairment" + + "/oit:roadm-path-impairments-id"; + } + description + "Pointer to ROADM optical impairments of the ROADM path + between this secondary 'from' LTP and the 'to' LTP of + this connectivity matrix entry."; + } + } + } // augmentation connectivity-matrix from + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:te-node-attributes/tet:connectivity-matrices/" + + "tet:connectivity-matrix/tet:to" { + when "../../../../../../nw:network-types/tet:te-topology/" + + "oit:optical-impairment-topology" { + description + "This augment is only valid for + Optical Impairment topology "; + } + description + "Augment the attributes for the 'to' LTP for the TE node + connectivity matrix entry."; + list additional-ltp { + when "derived-from-or-self(../../../../../../" + + "nt:termination-point" + + "[nt:tp-id=current()/../../tet:from/tet:tp-ref]/" + + "oit:protection-type," + + "'oit:otsi-protection')" { + description + "This list applies only when the 'from' LTP for this + connectivity matrix entry supports individual OTSi(G) + protection."; + } + key "ltp-ref"; + config false; + description + "The restricted list of the potential secondary LTPs that + can be selected when the 'to' LTP of this connectivity + matrix entry is selected as a working LTP. + + If this list is empty, all the other LTPs that can be + reached from the 'from' LTP of this connectivity matrix + entry can be selected as secondary LTPs."; + leaf ltp-ref { + type leafref { + path "../../../../../../../nt:termination-point/nt:tp-id"; + } + description + "The reference to the potential secondary LTP that can be + selected when the 'to' LTP of this connectivity matrix + entry is selected as a working LTP"; + } + leaf roadm-path-impairments { + type leafref { + path "../../../../../../../../oit:templates" + + "/oit:roadm-path-impairments/oit:roadm-path-impairment" + + "/oit:roadm-path-impairments-id"; + } + description + "Pointer to ROADM optical impairments of the ROADM path + between the 'from' LTP of this connectivity matrix entry + and this secondary LTP."; + } + } + } // augmentation connectivity-matrix to + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities" { + when "../../../../nw:network-types/tet:te-topology/" + + "oit:optical-impairment-topology" { + description + "This augment is only valid for Optical Impairment topology "; + } + description + "Augment default TTP LLC."; + leaf add-path-impairments { + type leafref { + path "../../../../../oit:templates" + + "/oit:roadm-path-impairments/oit:roadm-path-impairment" + + "/oit:roadm-path-impairments-id" ; + } + config false; + description "pointer to the list set of ROADM optical + impairments"; + } + leaf drop-path-impairments { + type leafref { + path "../../../../../oit:templates" + + "/oit:roadm-path-impairments/oit:roadm-path-impairment" + + "/oit:roadm-path-impairments-id" ; + } + config false; + description "pointer to the list set of ROADM + optical impairments"; + } + } // augmentation local-link-connectivities + + augment "/nw:networks/nw:network/nw:node/tet:te/" + + "tet:tunnel-termination-point/" + + "tet:local-link-connectivities/" + + "tet:local-link-connectivity" { + when "../../../../../nw:network-types/tet:te-topology/" + + "oit:optical-impairment-topology" { + description + "This augment is only valid for + Optical Impairment topology "; + } + description + "Augment TTP LLC entry."; + leaf add-path-impairments { + type leafref { + path "../../../../../../oit:templates" + + "/oit:roadm-path-impairments/oit:roadm-path-impairment" + + "/oit:roadm-path-impairments-id" ; + } + config false; + description "pointer to the list set of ROADM optical + impairments"; + } + leaf drop-path-impairments { + type leafref { + path "../../../../../../oit:templates" + + "/oit:roadm-path-impairments/oit:roadm-path-impairment" + + "/oit:roadm-path-impairments-id" ; + } + config false; + description "pointer to the list set of ROADM optical + impairments"; + } + list llc-transceiver { + key "ttp-transponder-ref ttp-transceiver-ref"; + config false; + description + "The list of transceivers having a LLC different from the + default LLC."; + leaf ttp-transponder-ref { + type leafref { + path "../../../../ttp-transceiver/transponder-ref"; + } + description + "The reference to the transponder hosting the transceiver + of this LLCL entry."; + } + leaf ttp-transceiver-ref { + type leafref { + path "../../../../ttp-transceiver/transceiver-ref"; + } + description + "The reference to the the transceiver of this LLCL entry."; + } + leaf is-allowed { + type boolean; + description + "'true' - connectivity from this transceiver is allowed; + 'false' - connectivity from this transceiver is + disallowed."; + } + leaf add-path-impairments { + type leafref { + path "../../../../../../../oit:templates" + + "/oit:roadm-path-impairments/oit:roadm-path-impairment" + + "/oit:roadm-path-impairments-id" ; + } + description "pointer to the list set of ROADM optical + impairments"; + } + leaf drop-path-impairments { + type leafref { + path "../../../../../../../oit:templates" + + "/oit:roadm-path-impairments/oit:roadm-path-impairment" + + "/oit:roadm-path-impairments-id" ; + } + description "pointer to the list set of ROADM + optical impairments"; + } + } + list additional-ltp { + when "derived-from-or-self(../../../tet:protection-type," + + "'oit:otsi-protection')" { + description + "This list applies only to TTPs that support individual + OTSi(G) protection."; + } + key "ltp-ref"; + config false; + description + "The restricted list of the potential secondary LTPs that + can be selected when the LTP associated with this LLCP + entry is selected as a working LTP. + + If this list is empty, all the other LTPs that can be + reached by this TTP can be selected as secondary LTPs."; + leaf ltp-ref { + type leafref { + path "../../../../../../nt:termination-point/nt:tp-id"; + } + description + "The reference to potential secondary LTP that can be + selected when the LTP associated with this LLCP entry is + selected as a working LTP"; + } + leaf add-path-impairments { + type leafref { + path "../../../../../../../oit:templates" + + "/oit:roadm-path-impairments/oit:roadm-path-impairment" + + "/oit:roadm-path-impairments-id" ; + } + description "pointer to the list set of ROADM optical + impairments"; + } + leaf drop-path-impairments { + type leafref { + path "../../../../../../../oit:templates" + + "/oit:roadm-path-impairments/oit:roadm-path-impairment" + + "/oit:roadm-path-impairments-id" ; + } + description "pointer to the list set of ROADM + optical impairments"; + } + } + } // augmentation local-link-connectivity +} \ No newline at end of file diff --git a/gnpyapi/yang/ietf-routing-types@2017-12-04.yang b/gnpyapi/yang/ietf-routing-types@2017-12-04.yang new file mode 100755 index 0000000..24319c1 --- /dev/null +++ b/gnpyapi/yang/ietf-routing-types@2017-12-04.yang @@ -0,0 +1,771 @@ +module ietf-routing-types { + namespace "urn:ietf:params:xml:ns:yang:ietf-routing-types"; + prefix rt-types; + + import ietf-yang-types { + prefix yang; + } + import ietf-inet-types { + prefix inet; + } + + organization + "IETF RTGWG - Routing Area Working Group"; + contact + "WG Web: + WG List: + + Editors: Xufeng Liu + + Yingzhen Qu + + Acee Lindem + + Christian Hopps + + Lou Berger + "; + + description + "This module contains a collection of YANG data types + considered generally useful for routing protocols. + + Copyright (c) 2017 IETF Trust and the persons + identified as authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject + to the license terms contained in, the Simplified BSD License + set forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8294; see + the RFC itself for full legal notices."; + revision 2017-12-04 { + description "Initial revision."; + reference + "RFC 8294: Common YANG Data Types for the Routing Area. + Section 3."; + } + + /*** Identities related to MPLS/GMPLS ***/ + + identity mpls-label-special-purpose-value { + description + "Base identity for deriving identities describing + special-purpose Multiprotocol Label Switching (MPLS) label + values."; + reference + "RFC 7274: Allocating and Retiring Special-Purpose MPLS + Labels."; + } + + identity ipv4-explicit-null-label { + base mpls-label-special-purpose-value; + description + "This identity represents the IPv4 Explicit NULL Label."; + reference + "RFC 3032: MPLS Label Stack Encoding. Section 2.1."; + } + + identity router-alert-label { + base mpls-label-special-purpose-value; + description + "This identity represents the Router Alert Label."; + reference + "RFC 3032: MPLS Label Stack Encoding. Section 2.1."; + } + + identity ipv6-explicit-null-label { + base mpls-label-special-purpose-value; + description + "This identity represents the IPv6 Explicit NULL Label."; + reference + "RFC 3032: MPLS Label Stack Encoding. Section 2.1."; + } + + identity implicit-null-label { + base mpls-label-special-purpose-value; + description + "This identity represents the Implicit NULL Label."; + reference + "RFC 3032: MPLS Label Stack Encoding. Section 2.1."; + } + + identity entropy-label-indicator { + base mpls-label-special-purpose-value; + description + "This identity represents the Entropy Label Indicator."; + reference + "RFC 6790: The Use of Entropy Labels in MPLS Forwarding. + Sections 3 and 10.1."; + } + + identity gal-label { + base mpls-label-special-purpose-value; + description + "This identity represents the Generic Associated Channel + (G-ACh) Label (GAL)."; + reference + "RFC 5586: MPLS Generic Associated Channel. + Sections 4 and 10."; + } + + identity oam-alert-label { + base mpls-label-special-purpose-value; + description + "This identity represents the OAM Alert Label."; + reference + "RFC 3429: Assignment of the 'OAM Alert Label' for + Multiprotocol Label Switching Architecture (MPLS) + Operation and Maintenance (OAM) Functions. + Sections 3 and 6."; + } + + identity extension-label { + base mpls-label-special-purpose-value; + description + "This identity represents the Extension Label."; + reference + "RFC 7274: Allocating and Retiring Special-Purpose MPLS + Labels. Sections 3.1 and 5."; + } + + /*** Collection of types related to routing ***/ + + typedef router-id { + type yang:dotted-quad; + description + "A 32-bit number in the dotted-quad format assigned to each + router. This number uniquely identifies the router within + an Autonomous System."; + } + + /*** Collection of types related to VPNs ***/ + + typedef route-target { + type string { + pattern + '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|' + + '42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|' + + '42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|' + + '42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|' + + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|' + + '25[0-5])\.){3}([0-9]|[1-9][0-9]|' + + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|' + + '655[0-2][0-9]|' + + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(2:(429496729[0-5]|42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|' + + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(6(:[a-fA-F0-9]{2}){6})|' + + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):' + + '[0-9a-fA-F]{1,12})'; + } + + description + "A Route Target is an 8-octet BGP extended community + initially identifying a set of sites in a BGP VPN + (RFC 4364). However, it has since taken on a more general + role in BGP route filtering. A Route Target consists of two + or three fields: a 2-octet Type field, an administrator + field, and, optionally, an assigned number field. + + According to the data formats for types 0, 1, 2, and 6 as + defined in RFC 4360, RFC 5668, and RFC 7432, the encoding + pattern is defined as: + + 0:2-octet-asn:4-octet-number + 1:4-octet-ipv4addr:2-octet-number + 2:4-octet-asn:2-octet-number + 6:6-octet-mac-address + + Additionally, a generic pattern is defined for future + Route Target types: + + 2-octet-other-hex-number:6-octet-hex-number + + Some valid examples are 0:100:100, 1:1.1.1.1:100, + 2:1234567890:203, and 6:26:00:08:92:78:00."; + reference + "RFC 4360: BGP Extended Communities Attribute. + RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs). + RFC 5668: 4-Octet AS Specific BGP Extended Community. + RFC 7432: BGP MPLS-Based Ethernet VPN."; + } + + typedef ipv6-route-target { + type string { + pattern + '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}' + + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|' + + '(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}' + + '(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])))' + + ':' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)'; + pattern '((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))' + + ':' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)'; + } + description + "An IPv6 Route Target is a 20-octet BGP IPv6 Address + Specific Extended Community serving the same function + as a standard 8-octet Route Target, except that it only + allows an IPv6 address as the global administrator. + The format is . + + Two valid examples are 2001:db8::1:6544 and + 2001:db8::5eb1:791:6b37:17958."; + reference + "RFC 5701: IPv6 Address Specific BGP Extended Community + Attribute."; + } + + typedef route-target-type { + type enumeration { + enum import { + value 0; + description + "The Route Target applies to route import."; + } + enum export { + value 1; + description + "The Route Target applies to route export."; + } + + enum both { + value 2; + description + "The Route Target applies to both route import and + route export."; + } + } + description + "Indicates the role a Route Target takes in route filtering."; + reference + "RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs)."; + } + + typedef route-distinguisher { + type string { + pattern + '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|' + + '42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|' + + '42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|' + + '42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|' + + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|' + + '25[0-5])\.){3}([0-9]|[1-9][0-9]|' + + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|' + + '655[0-2][0-9]|' + + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(2:(429496729[0-5]|42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|' + + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(6(:[a-fA-F0-9]{2}){6})|' + + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):' + + '[0-9a-fA-F]{1,12})'; + } + + description + "A Route Distinguisher is an 8-octet value used to + distinguish routes from different BGP VPNs (RFC 4364). + A Route Distinguisher will have the same format as a + Route Target as per RFC 4360 and will consist of + two or three fields: a 2-octet Type field, an administrator + field, and, optionally, an assigned number field. + + According to the data formats for types 0, 1, 2, and 6 as + defined in RFC 4360, RFC 5668, and RFC 7432, the encoding + pattern is defined as: + + 0:2-octet-asn:4-octet-number + 1:4-octet-ipv4addr:2-octet-number + 2:4-octet-asn:2-octet-number + 6:6-octet-mac-address + + Additionally, a generic pattern is defined for future + route discriminator types: + + 2-octet-other-hex-number:6-octet-hex-number + + Some valid examples are 0:100:100, 1:1.1.1.1:100, + 2:1234567890:203, and 6:26:00:08:92:78:00."; + reference + "RFC 4360: BGP Extended Communities Attribute. + RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs). + RFC 5668: 4-Octet AS Specific BGP Extended Community. + RFC 7432: BGP MPLS-Based Ethernet VPN."; + } + + typedef route-origin { + type string { + pattern + '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|' + + '42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|' + + '42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|' + + '42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|' + + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|' + + '25[0-5])\.){3}([0-9]|[1-9][0-9]|' + + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|' + + '655[0-2][0-9]|' + + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(2:(429496729[0-5]|42949672[0-8][0-9]|' + + '4294967[01][0-9]{2}|' + + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|' + + '4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|' + + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|' + + '(6(:[a-fA-F0-9]{2}){6})|' + + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):' + + '[0-9a-fA-F]{1,12})'; + } + description + "A Route Origin is an 8-octet BGP extended community + identifying the set of sites where the BGP route + originated (RFC 4364). A Route Origin will have the same + format as a Route Target as per RFC 4360 and will consist + of two or three fields: a 2-octet Type field, an + administrator field, and, optionally, an assigned number + field. + + According to the data formats for types 0, 1, 2, and 6 as + defined in RFC 4360, RFC 5668, and RFC 7432, the encoding + pattern is defined as: + + 0:2-octet-asn:4-octet-number + 1:4-octet-ipv4addr:2-octet-number + 2:4-octet-asn:2-octet-number + 6:6-octet-mac-address + Additionally, a generic pattern is defined for future + Route Origin types: + + 2-octet-other-hex-number:6-octet-hex-number + + Some valid examples are 0:100:100, 1:1.1.1.1:100, + 2:1234567890:203, and 6:26:00:08:92:78:00."; + reference + "RFC 4360: BGP Extended Communities Attribute. + RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs). + RFC 5668: 4-Octet AS Specific BGP Extended Community. + RFC 7432: BGP MPLS-Based Ethernet VPN."; + } + + typedef ipv6-route-origin { + type string { + pattern + '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}' + + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|' + + '(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}' + + '(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])))' + + ':' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)'; + pattern '((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|' + + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))' + + ':' + + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|' + + '6[0-4][0-9]{3}|' + + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)'; + } + description + "An IPv6 Route Origin is a 20-octet BGP IPv6 Address + Specific Extended Community serving the same function + as a standard 8-octet route, except that it only allows + an IPv6 address as the global administrator. The format + is . + + Two valid examples are 2001:db8::1:6544 and + 2001:db8::5eb1:791:6b37:17958."; + reference + "RFC 5701: IPv6 Address Specific BGP Extended Community + Attribute."; + } + + /*** Collection of types common to multicast ***/ + + typedef ipv4-multicast-group-address { + type inet:ipv4-address { + pattern '(2((2[4-9])|(3[0-9]))\.).*'; + } + description + "This type represents an IPv4 multicast group address, + which is in the range of 224.0.0.0 to 239.255.255.255."; + reference + "RFC 1112: Host Extensions for IP Multicasting."; + } + + typedef ipv6-multicast-group-address { + type inet:ipv6-address { + pattern '(([fF]{2}[0-9a-fA-F]{2}):).*'; + } + description + "This type represents an IPv6 multicast group address, + which is in the range of ff00::/8."; + reference + "RFC 4291: IP Version 6 Addressing Architecture. Section 2.7. + RFC 7346: IPv6 Multicast Address Scopes."; + } + + typedef ip-multicast-group-address { + type union { + type ipv4-multicast-group-address; + type ipv6-multicast-group-address; + } + description + "This type represents a version-neutral IP multicast group + address. The format of the textual representation implies + the IP version."; + } + + typedef ipv4-multicast-source-address { + type union { + type enumeration { + enum * { + description + "Any source address."; + } + } + type inet:ipv4-address; + } + description + "Multicast source IPv4 address type."; + } + + typedef ipv6-multicast-source-address { + type union { + type enumeration { + enum * { + description + "Any source address."; + } + } + type inet:ipv6-address; + } + description + "Multicast source IPv6 address type."; + } + + /*** Collection of types common to protocols ***/ + + typedef bandwidth-ieee-float32 { + type string { + pattern + '0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|' + + '1(\.([0-9a-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\+)?(12[0-7]|' + + '1[01][0-9]|0?[0-9]?[0-9])?)'; + } + description + "Bandwidth in IEEE 754 floating-point 32-bit binary format: + (-1)**(S) * 2**(Exponent-127) * (1 + Fraction), + where Exponent uses 8 bits and Fraction uses 23 bits. + The units are octets per second. + The encoding format is the external hexadecimal-significant + character sequences specified in IEEE 754 and ISO/IEC C99. + The format is restricted to be normalized, non-negative, and + non-fraction: 0x1.hhhhhhp{+}d, 0X1.HHHHHHP{+}D, or 0x0p0, + where 'h' and 'H' are hexadecimal digits and 'd' and 'D' are + integers in the range of [0..127]. + When six hexadecimal digits are used for 'hhhhhh' or + 'HHHHHH', the least significant digit must be an even + number. 'x' and 'X' indicate hexadecimal; 'p' and 'P' + indicate a power of two. Some examples are 0x0p0, 0x1p10, + and 0x1.abcde2p+20."; + reference + "IEEE Std 754-2008: IEEE Standard for Floating-Point + Arithmetic. + ISO/IEC C99: Information technology - Programming + Languages - C."; + } + + typedef link-access-type { + type enumeration { + enum broadcast { + description + "Specify broadcast multi-access network."; + } + enum non-broadcast-multiaccess { + description + "Specify Non-Broadcast Multi-Access (NBMA) network."; + } + enum point-to-multipoint { + description + "Specify point-to-multipoint network."; + } + enum point-to-point { + description + "Specify point-to-point network."; + } + } + description + "Link access type."; + } + + typedef timer-multiplier { + type uint8; + description + "The number of timer value intervals that should be + interpreted as a failure."; + } + + typedef timer-value-seconds16 { + type union { + type uint16 { + range "1..65535"; + } + type enumeration { + enum infinity { + description + "The timer is set to infinity."; + } + enum not-set { + description + "The timer is not set."; + } + } + } + units "seconds"; + description + "Timer value type, in seconds (16-bit range)."; + } + + typedef timer-value-seconds32 { + type union { + type uint32 { + range "1..4294967295"; + } + type enumeration { + enum infinity { + description + "The timer is set to infinity."; + } + enum not-set { + description + "The timer is not set."; + } + } + } + units "seconds"; + description + "Timer value type, in seconds (32-bit range)."; + } + + typedef timer-value-milliseconds { + type union { + type uint32 { + range "1..4294967295"; + } + type enumeration { + enum infinity { + description + "The timer is set to infinity."; + } + enum not-set { + description + "The timer is not set."; + } + } + } + units "milliseconds"; + description + "Timer value type, in milliseconds."; + } + + typedef percentage { + type uint8 { + range "0..100"; + } + description + "Integer indicating a percentage value."; + } + + typedef timeticks64 { + type uint64; + description + "This type is based on the timeticks type defined in + RFC 6991, but with 64-bit width. It represents the time, + modulo 2^64, in hundredths of a second between two epochs."; + reference + "RFC 6991: Common YANG Data Types."; + } + + typedef uint24 { + type uint32 { + range "0..16777215"; + } + description + "24-bit unsigned integer."; + } + + /*** Collection of types related to MPLS/GMPLS ***/ + + typedef generalized-label { + type binary; + description + "Generalized Label. Nodes sending and receiving the + Generalized Label are aware of the link-specific + label context and type."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description. Section 3.2."; + } + + typedef mpls-label-special-purpose { + type identityref { + base mpls-label-special-purpose-value; + } + description + "This type represents the special-purpose MPLS label values."; + reference + "RFC 3032: MPLS Label Stack Encoding. + RFC 7274: Allocating and Retiring Special-Purpose MPLS + Labels."; + } + + typedef mpls-label-general-use { + type uint32 { + range "16..1048575"; + } + description + "The 20-bit label value in an MPLS label stack as specified + in RFC 3032. This label value does not include the + encodings of Traffic Class and TTL (Time to Live). + The label range specified by this type is for general use, + with special-purpose MPLS label values excluded."; + reference + "RFC 3032: MPLS Label Stack Encoding."; + } + + typedef mpls-label { + type union { + type mpls-label-special-purpose; + type mpls-label-general-use; + } + description + "The 20-bit label value in an MPLS label stack as specified + in RFC 3032. This label value does not include the + encodings of Traffic Class and TTL."; + reference + "RFC 3032: MPLS Label Stack Encoding."; + } + + /*** Groupings **/ + + grouping mpls-label-stack { + description + "This grouping specifies an MPLS label stack. The label + stack is encoded as a list of label stack entries. The + list key is an identifier that indicates the relative + ordering of each entry, with the lowest-value identifier + corresponding to the top of the label stack."; + container mpls-label-stack { + description + "Container for a list of MPLS label stack entries."; + list entry { + key "id"; + description + "List of MPLS label stack entries."; + leaf id { + type uint8; + description + "Identifies the entry in a sequence of MPLS label + stack entries. An entry with a smaller identifier + value precedes an entry with a larger identifier + value in the label stack. The value of this ID has + no semantic meaning other than relative ordering + and referencing the entry."; + } + leaf label { + type rt-types:mpls-label; + description + "Label value."; + } + + leaf ttl { + type uint8; + description + "Time to Live (TTL)."; + reference + "RFC 3032: MPLS Label Stack Encoding."; + } + leaf traffic-class { + type uint8 { + range "0..7"; + } + description + "Traffic Class (TC)."; + reference + "RFC 5462: Multiprotocol Label Switching (MPLS) Label + Stack Entry: 'EXP' Field Renamed to 'Traffic Class' + Field."; + } + } + } + } + + grouping vpn-route-targets { + description + "A grouping that specifies Route Target import-export rules + used in BGP-enabled VPNs."; + reference + "RFC 4364: BGP/MPLS IP Virtual Private Networks (VPNs). + RFC 4664: Framework for Layer 2 Virtual Private Networks + (L2VPNs)."; + list vpn-target { + key "route-target"; + description + "List of Route Targets."; + leaf route-target { + type rt-types:route-target; + description + "Route Target value."; + } + leaf route-target-type { + type rt-types:route-target-type; + mandatory true; + description + "Import/export type of the Route Target."; + } + } + } +} diff --git a/gnpyapi/yang/ietf-te-topology@2020-08-06.yang b/gnpyapi/yang/ietf-te-topology@2020-08-06.yang new file mode 100755 index 0000000..6d76a77 --- /dev/null +++ b/gnpyapi/yang/ietf-te-topology@2020-08-06.yang @@ -0,0 +1,1952 @@ +module ietf-te-topology { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-te-topology"; + prefix tet; + + import ietf-yang-types { + prefix yang; + reference + "RFC 6991: Common YANG Data Types"; + } + import ietf-inet-types { + prefix inet; + reference + "RFC 6991: Common YANG Data Types"; + } + import ietf-te-types { + prefix te-types; + reference + "RFC 8776: Common YANG Data Types for Traffic Engineering"; + } + import ietf-network { + prefix nw; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + import ietf-network-topology { + prefix nt; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + organization + "IETF Traffic Engineering Architecture and Signaling (TEAS) + Working Group"; + contact + "WG Web: + WG List: + + Editor: Xufeng Liu + + + Editor: Igor Bryskin + + + Editor: Vishnu Pavan Beeram + + + Editor: Tarek Saad + + + Editor: Himanshu Shah + + + Editor: Oscar Gonzalez de Dios + "; + description + "This YANG module defines a TE topology model for representing, + retrieving, and manipulating technology-agnostic TE topologies. + + Copyright (c) 2020 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject to + the license terms contained in, the Simplified BSD License set + forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8795; see the + RFC itself for full legal notices."; + + revision 2020-08-06 { + description + "Initial revision."; + reference + "RFC 8795: YANG Data Model for Traffic Engineering (TE) + Topologies"; + } + + /* + * Features + */ + + feature nsrlg { + description + "This feature indicates that the system supports NSRLGs + (Non-Shared Risk Link Groups)."; + } + + feature te-topology-hierarchy { + description + "This feature indicates that the system allows an underlay + and/or overlay TE topology hierarchy."; + } + + feature template { + description + "This feature indicates that the system supports + template configuration."; + } + + /* + * Typedefs + */ + + typedef geographic-coordinate-degree { + type decimal64 { + fraction-digits 8; + } + description + "Decimal degree (DD) used to express latitude and longitude + geographic coordinates."; + } + // geographic-coordinate-degree + + typedef te-info-source { + type enumeration { + enum unknown { + description + "The source is unknown."; + } + enum locally-configured { + description + "Configured entity."; + } + enum ospfv2 { + description + "OSPFv2."; + } + enum ospfv3 { + description + "OSPFv3."; + } + enum isis { + description + "IS-IS."; + } + enum bgp-ls { + description + "BGP-LS."; + reference + "RFC 7752: North-Bound Distribution of Link-State and + Traffic Engineering (TE) Information Using BGP"; + } + enum system-processed { + description + "System-processed entity."; + } + enum other { + description + "Other source."; + } + } + description + "Describes the type of source that has provided the + related information, and the source's credibility."; + } + // te-info-source + + /* + * Groupings + */ + + grouping connectivity-matrix-entry-path-attributes { + description + "Attributes of a connectivity matrix entry."; + leaf is-allowed { + type boolean; + description + "'true' - switching is allowed; + 'false' - switching is disallowed."; + } + container underlay { + if-feature "te-topology-hierarchy"; + description + "Attributes of the TE link underlay."; + reference + "RFC 4206: Label Switched Paths (LSP) Hierarchy with + Generalized Multi-Protocol Label Switching (GMPLS) + Traffic Engineering (TE)"; + uses te-link-underlay-attributes; + } + uses te-types:generic-path-constraints; + uses te-types:generic-path-optimization; + uses te-types:generic-path-properties; + } + // connectivity-matrix-entry-path-attributes + + grouping geolocation-container { + description + "Contains a GPS location."; + container geolocation { + config false; + description + "Contains a GPS location."; + leaf altitude { + type int64; + units "millimeters"; + description + "Distance above sea level."; + } + leaf latitude { + type geographic-coordinate-degree { + range "-90..90"; + } + description + "Relative position north or south on the Earth's surface."; + } + leaf longitude { + type geographic-coordinate-degree { + range "-180..180"; + } + description + "Angular distance east or west on the Earth's surface."; + } + } + // geolocation + } + // geolocation-container + + grouping information-source-state-attributes { + description + "The attributes identifying the source that has provided the + related information, and the source's credibility."; + leaf credibility-preference { + type uint16; + description + "The preference value for calculating the Traffic + Engineering database credibility value used for + tie-break selection between different information-source + values. A higher value is preferable."; + } + leaf logical-network-element { + type string; + description + "When applicable, this is the name of a logical network + element from which the information is learned."; + } + leaf network-instance { + type string; + description + "When applicable, this is the name of a network instance + from which the information is learned."; + } + } + // information-source-state-attributes + + grouping information-source-per-link-attributes { + description + "Per-node container of the attributes identifying the source + that has provided the related information, and the source's + credibility."; + leaf information-source { + type te-info-source; + config false; + description + "Indicates the type of information source."; + } + leaf information-source-instance { + type string; + config false; + description + "The name indicating the instance of the information + source."; + } + container information-source-state { + config false; + description + "Contains state attributes related to the information + source."; + uses information-source-state-attributes; + container topology { + description + "When the information is processed by the system, + the attributes in this container indicate which topology + is used to generate the result information."; + uses nt:link-ref; + } + } + } + // information-source-per-link-attributes + + grouping information-source-per-node-attributes { + description + "Per-node container of the attributes identifying the source + that has provided the related information, and the source's + credibility."; + leaf information-source { + type te-info-source; + config false; + description + "Indicates the type of information source."; + } + leaf information-source-instance { + type string; + config false; + description + "The name indicating the instance of the information + source."; + } + container information-source-state { + config false; + description + "Contains state attributes related to the information + source."; + uses information-source-state-attributes; + container topology { + description + "When the information is processed by the system, + the attributes in this container indicate which topology + is used to generate the result information."; + uses nw:node-ref; + } + } + } + // information-source-per-node-attributes + + grouping interface-switching-capability-list { + description + "List of Interface Switching Capability Descriptors (ISCDs)."; + list interface-switching-capability { + key "switching-capability encoding"; + description + "List of ISCDs for this link."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description + RFC 4203: OSPF Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS)"; + leaf switching-capability { + type identityref { + base te-types:switching-capabilities; + } + description + "Switching capability for this interface."; + } + leaf encoding { + type identityref { + base te-types:lsp-encoding-types; + } + description + "Encoding supported by this interface."; + } + uses te-link-iscd-attributes; + } + // interface-switching-capability + } + // interface-switching-capability-list + + grouping statistics-per-link { + description + "Statistics attributes per TE link."; + leaf discontinuity-time { + type yang:date-and-time; + description + "The time of the most recent occasion at which any one or + more of this interface's counters suffered a + discontinuity. If no such discontinuities have occurred + since the last re-initialization of the local management + subsystem, then this node contains the time the local + management subsystem re-initialized itself."; + } + /* Administrative attributes */ + leaf disables { + type yang:counter32; + description + "Number of times that a link was disabled."; + } + leaf enables { + type yang:counter32; + description + "Number of times that a link was enabled."; + } + leaf maintenance-clears { + type yang:counter32; + description + "Number of times that a link was taken out of maintenance."; + } + leaf maintenance-sets { + type yang:counter32; + description + "Number of times that a link was put in maintenance."; + } + leaf modifies { + type yang:counter32; + description + "Number of times that a link was modified."; + } + /* Operational attributes */ + leaf downs { + type yang:counter32; + description + "Number of times that a link was set to an operational state + of 'down'."; + } + leaf ups { + type yang:counter32; + description + "Number of times that a link was set to an operational state + of 'up'."; + } + /* Recovery attributes */ + leaf fault-clears { + type yang:counter32; + description + "Number of times that a link experienced a fault-clear + event."; + } + leaf fault-detects { + type yang:counter32; + description + "Number of times that a link experienced fault detection."; + } + leaf protection-switches { + type yang:counter32; + description + "Number of times that a link experienced protection + switchover."; + } + leaf protection-reverts { + type yang:counter32; + description + "Number of times that a link experienced protection + reversion."; + } + leaf restoration-failures { + type yang:counter32; + description + "Number of times that a link experienced restoration + failure."; + } + leaf restoration-starts { + type yang:counter32; + description + "Number of times that a link experienced restoration + start."; + } + leaf restoration-successes { + type yang:counter32; + description + "Number of times that a link experienced restoration + success."; + } + leaf restoration-reversion-failures { + type yang:counter32; + description + "Number of times that a link experienced restoration + reversion failure."; + } + leaf restoration-reversion-starts { + type yang:counter32; + description + "Number of times that a link experienced restoration + reversion start."; + } + leaf restoration-reversion-successes { + type yang:counter32; + description + "Number of times that a link experienced restoration + reversion success."; + } + } + // statistics-per-link + + grouping statistics-per-node { + description + "Statistics attributes per TE node."; + leaf discontinuity-time { + type yang:date-and-time; + description + "The time of the most recent occasion at which any one or + more of this interface's counters suffered a + discontinuity. If no such discontinuities have occurred + since the last re-initialization of the local management + subsystem, then this node contains the time the local + management subsystem re-initialized itself."; + } + container node { + description + "Contains statistics attributes at the TE node level."; + leaf disables { + type yang:counter32; + description + "Number of times that a node was disabled."; + } + leaf enables { + type yang:counter32; + description + "Number of times that a node was enabled."; + } + leaf maintenance-sets { + type yang:counter32; + description + "Number of times that a node was put in maintenance."; + } + leaf maintenance-clears { + type yang:counter32; + description + "Number of times that a node was taken out of + maintenance."; + } + leaf modifies { + type yang:counter32; + description + "Number of times that a node was modified."; + } + } + // node + container connectivity-matrix-entry { + description + "Contains statistics attributes at the level of a + connectivity matrix entry."; + leaf creates { + type yang:counter32; + description + "Number of times that a connectivity matrix entry was + created."; + reference + "RFC 6241: Network Configuration Protocol (NETCONF), + Section 7.2, 'create' operation"; + } + leaf deletes { + type yang:counter32; + description + "Number of times that a connectivity matrix entry was + deleted."; + reference + "RFC 6241: Network Configuration Protocol (NETCONF), + Section 7.2, 'delete' operation"; + } + leaf disables { + type yang:counter32; + description + "Number of times that a connectivity matrix entry was + disabled."; + } + leaf enables { + type yang:counter32; + description + "Number of times that a connectivity matrix entry was + enabled."; + } + leaf modifies { + type yang:counter32; + description + "Number of times that a connectivity matrix entry was + modified."; + } + } + // connectivity-matrix-entry + } + // statistics-per-node + + grouping statistics-per-ttp { + description + "Statistics attributes per TE TTP (Tunnel Termination Point)."; + leaf discontinuity-time { + type yang:date-and-time; + description + "The time of the most recent occasion at which any one or + more of this interface's counters suffered a + discontinuity. If no such discontinuities have occurred + since the last re-initialization of the local management + subsystem, then this node contains the time the local + management subsystem re-initialized itself."; + } + container tunnel-termination-point { + description + "Contains statistics attributes at the TE TTP level."; + /* Administrative attributes */ + leaf disables { + type yang:counter32; + description + "Number of times that a TTP was disabled."; + } + leaf enables { + type yang:counter32; + description + "Number of times that a TTP was enabled."; + } + leaf maintenance-clears { + type yang:counter32; + description + "Number of times that a TTP was taken out of maintenance."; + } + leaf maintenance-sets { + type yang:counter32; + description + "Number of times that a TTP was put in maintenance."; + } + leaf modifies { + type yang:counter32; + description + "Number of times that a TTP was modified."; + } + /* Operational attributes */ + leaf downs { + type yang:counter32; + description + "Number of times that a TTP was set to an operational state + of 'down'."; + } + leaf ups { + type yang:counter32; + description + "Number of times that a TTP was set to an operational state + of 'up'."; + } + leaf in-service-clears { + type yang:counter32; + description + "Number of times that a TTP was taken out of service + (TE tunnel was released)."; + } + leaf in-service-sets { + type yang:counter32; + description + "Number of times that a TTP was put in service by a TE + tunnel (TE tunnel was set up)."; + } + } + // tunnel-termination-point + container local-link-connectivity { + description + "Contains statistics attributes at the TE LLCL (Local Link + Connectivity List) level."; + leaf creates { + type yang:counter32; + description + "Number of times that an LLCL entry was created."; + reference + "RFC 6241: Network Configuration Protocol (NETCONF), + Section 7.2, 'create' operation"; + } + leaf deletes { + type yang:counter32; + description + "Number of times that an LLCL entry was deleted."; + reference + "RFC 6241: Network Configuration Protocol (NETCONF), + Section 7.2, 'delete' operation"; + } + leaf disables { + type yang:counter32; + description + "Number of times that an LLCL entry was disabled."; + } + leaf enables { + type yang:counter32; + description + "Number of times that an LLCL entry was enabled."; + } + leaf modifies { + type yang:counter32; + description + "Number of times that an LLCL entry was modified."; + } + } + // local-link-connectivity + } + // statistics-per-ttp + + grouping te-link-augment { + description + "Augmentation for a TE link."; + uses te-link-config; + uses te-link-state-derived; + container statistics { + config false; + description + "Statistics data."; + uses statistics-per-link; + } + } + // te-link-augment + + grouping te-link-config { + description + "TE link configuration grouping."; + choice bundle-stack-level { + description + "The TE link can be partitioned into bundled links or + component links."; + case bundle { + container bundled-links { + description + "A set of bundled links."; + reference + "RFC 4201: Link Bundling in MPLS Traffic + Engineering (TE)"; + list bundled-link { + key "sequence"; + description + "Specifies a bundled interface that is + further partitioned."; + leaf sequence { + type uint32; + description + "Identifies the sequence in the bundle."; + } + } + } + } + case component { + container component-links { + description + "A set of component links."; + list component-link { + key "sequence"; + description + "Specifies a component interface that is + sufficient to unambiguously identify the + appropriate resources."; + leaf sequence { + type uint32; + description + "Identifies the sequence in the bundle."; + } + leaf src-interface-ref { + type string; + description + "Reference to a component link interface on the + source node."; + } + leaf des-interface-ref { + type string; + description + "Reference to a component link interface on the + destination node."; + } + } + } + } + } + // bundle-stack-level + leaf-list te-link-template { + if-feature "template"; + type leafref { + path "../../../../te/templates/link-template/name"; + } + description + "The reference to a TE link template."; + } + uses te-link-config-attributes; + } + // te-link-config + + grouping te-link-config-attributes { + description + "Link configuration attributes in a TE topology."; + container te-link-attributes { + description + "Link attributes in a TE topology."; + leaf access-type { + type te-types:te-link-access-type; + description + "Link access type, which can be point-to-point or + multi-access."; + } + container external-domain { + description + "For an inter-domain link, specifies the attributes of + the remote end of the link, to facilitate the signaling at + the local end."; + uses nw:network-ref; + leaf remote-te-node-id { + type te-types:te-node-id; + description + "Remote TE node identifier, used together with + 'remote-te-link-tp-id' to identify the remote Link + Termination Point (LTP) in a different domain."; + } + leaf remote-te-link-tp-id { + type te-types:te-tp-id; + description + "Remote TE LTP identifier, used together with + 'remote-te-node-id' to identify the remote LTP in a + different domain."; + } + } + leaf is-abstract { + type empty; + description + "Present if the link is abstract."; + } + leaf name { + type string; + description + "Link name."; + } + container underlay { + if-feature "te-topology-hierarchy"; + description + "Attributes of the TE link underlay."; + reference + "RFC 4206: Label Switched Paths (LSP) Hierarchy with + Generalized Multi-Protocol Label Switching (GMPLS) + Traffic Engineering (TE)"; + uses te-link-underlay-attributes; + } + leaf admin-status { + type te-types:te-admin-status; + description + "The administrative state of the link."; + } + uses te-link-info-attributes; + } + // te-link-attributes + } + // te-link-config-attributes + + grouping te-link-info-attributes { + description + "Advertised TE information attributes."; + leaf link-index { + type uint64; + description + "The link identifier. If OSPF is used, this object + represents an ospfLsdbID. If IS-IS is used, this object + represents an isisLSPID. If a locally configured link is + used, this object represents a unique value, which is + locally defined in a router."; + } + leaf administrative-group { + type te-types:admin-groups; + description + "Administrative group or color of the link. + This attribute covers both administrative groups (defined + in RFCs 3630 and 5305) and Extended Administrative Groups + (defined in RFC 7308)."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering + RFC 7308: Extended Administrative Groups in MPLS Traffic + Engineering (MPLS-TE)"; + } + uses interface-switching-capability-list; + uses te-types:label-set-info; + leaf link-protection-type { + type identityref { + base te-types:link-protection-type; + } + description + "Link Protection Type desired for this link."; + reference + "RFC 4202: Routing Extensions in Support of + Generalized Multi-Protocol Label Switching (GMPLS)"; + } + container max-link-bandwidth { + uses te-types:te-bandwidth; + description + "Maximum bandwidth that can be seen on this link in this + direction. Units are in bytes per second."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering"; + } + container max-resv-link-bandwidth { + uses te-types:te-bandwidth; + description + "Maximum amount of bandwidth that can be reserved in this + direction in this link. Units are in bytes per second."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering"; + } + list unreserved-bandwidth { + key "priority"; + max-elements 8; + description + "Unreserved bandwidth for priority levels 0-7. Units are in + bytes per second."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering"; + leaf priority { + type uint8 { + range "0..7"; + } + description + "Priority."; + } + uses te-types:te-bandwidth; + } + leaf te-default-metric { + type uint32; + description + "Traffic Engineering metric."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering"; + } + leaf te-delay-metric { + type uint32; + description + "Traffic Engineering delay metric."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions"; + } + leaf te-igp-metric { + type uint32; + description + "IGP metric used for Traffic Engineering."; + reference + "RFC 3785: Use of Interior Gateway Protocol (IGP) Metric as a + second MPLS Traffic Engineering (TE) Metric"; + } + container te-srlgs { + description + "Contains a list of SRLGs."; + leaf-list value { + type te-types:srlg; + description + "SRLG value."; + reference + "RFC 4202: Routing Extensions in Support of + Generalized Multi-Protocol Label Switching (GMPLS)"; + } + } + container te-nsrlgs { + if-feature "nsrlg"; + description + "Contains a list of NSRLGs (Non-Shared Risk Link Groups). + When an abstract TE link is configured, this list specifies + the request that underlay TE paths need to be mutually + disjoint with other TE links in the same groups."; + leaf-list id { + type uint32; + description + "NSRLG ID, uniquely configured within a topology."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) + Recovery"; + } + } + } + // te-link-info-attributes + + grouping te-link-iscd-attributes { + description + "TE link ISCD attributes."; + reference + "RFC 4203: OSPF Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS), Section 1.4"; + list max-lsp-bandwidth { + key "priority"; + max-elements 8; + description + "Maximum Label Switched Path (LSP) bandwidth at + priorities 0-7."; + leaf priority { + type uint8 { + range "0..7"; + } + description + "Priority."; + } + uses te-types:te-bandwidth; + } + } + // te-link-iscd-attributes + + grouping te-link-state-derived { + description + "Link state attributes in a TE topology."; + leaf oper-status { + type te-types:te-oper-status; + config false; + description + "The current operational state of the link."; + } + leaf is-transitional { + type empty; + config false; + description + "Present if the link is transitional; used as an + alternative approach in lieu of 'inter-layer-lock-id' + for path computation in a TE topology covering multiple + layers or multiple regions."; + reference + "RFC 5212: Requirements for GMPLS-Based Multi-Region and + Multi-Layer Networks (MRN/MLN) + RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions + for Multi-Layer and Multi-Region Networks (MLN/MRN)"; + } + uses information-source-per-link-attributes; + list information-source-entry { + key "information-source information-source-instance"; + config false; + description + "A list of information sources learned, including the source + that is used."; + uses information-source-per-link-attributes; + uses te-link-info-attributes; + } + container recovery { + config false; + description + "Status of the recovery process."; + leaf restoration-status { + type te-types:te-recovery-status; + description + "Restoration status."; + } + leaf protection-status { + type te-types:te-recovery-status; + description + "Protection status."; + } + } + container underlay { + if-feature "te-topology-hierarchy"; + config false; + description + "State attributes for the TE link underlay."; + leaf dynamic { + type boolean; + description + "'true' if the underlay is dynamically created."; + } + leaf committed { + type boolean; + description + "'true' if the underlay is committed."; + } + } + } + // te-link-state-derived + + grouping te-link-underlay-attributes { + description + "Attributes for the TE link underlay."; + reference + "RFC 4206: Label Switched Paths (LSP) Hierarchy with + Generalized Multi-Protocol Label Switching (GMPLS) + Traffic Engineering (TE)"; + leaf enabled { + type boolean; + description + "'true' if the underlay is enabled. + 'false' if the underlay is disabled."; + } + container primary-path { + description + "The service path on the underlay topology that + supports this link."; + uses nw:network-ref; + list path-element { + key "path-element-id"; + description + "A list of path elements describing the service path."; + leaf path-element-id { + type uint32; + description + "To identify the element in a path."; + } + uses te-path-element; + } + } + // primary-path + list backup-path { + key "index"; + description + "A list of backup service paths on the underlay topology that + protect the underlay primary path. If the primary path is + not protected, the list contains zero elements. If the + primary path is protected, the list contains one or more + elements."; + leaf index { + type uint32; + description + "A sequence number to identify a backup path."; + } + uses nw:network-ref; + list path-element { + key "path-element-id"; + description + "A list of path elements describing the backup service + path."; + leaf path-element-id { + type uint32; + description + "To identify the element in a path."; + } + uses te-path-element; + } + } + // backup-path + leaf protection-type { + type identityref { + base te-types:lsp-protection-type; + } + description + "Underlay protection type desired for this link."; + } + container tunnel-termination-points { + description + "Underlay TTPs desired for this link."; + leaf source { + type binary; + description + "Source TTP identifier."; + } + leaf destination { + type binary; + description + "Destination TTP identifier."; + } + } + container tunnels { + description + "Underlay TE tunnels supporting this TE link."; + leaf sharing { + type boolean; + default "true"; + description + "'true' if the underlay tunnel can be shared with other + TE links; + 'false' if the underlay tunnel is dedicated to this + TE link. + This leaf is the default option for all TE tunnels + and may be overridden by the per-TE-tunnel value."; + } + list tunnel { + key "tunnel-name"; + description + "Zero, one, or more underlay TE tunnels that support this + TE link."; + leaf tunnel-name { + type string; + description + "A tunnel name uniquely identifies an underlay TE tunnel, + used together with the 'source-node' value for this + link."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + leaf sharing { + type boolean; + description + "'true' if the underlay tunnel can be shared with other + TE links; + 'false' if the underlay tunnel is dedicated to this + TE link."; + } + } + // tunnel + } + // tunnels + } + // te-link-underlay-attributes + + grouping te-node-augment { + description + "Augmentation for a TE node."; + uses te-node-config; + uses te-node-state-derived; + container statistics { + config false; + description + "Statistics data."; + uses statistics-per-node; + } + list tunnel-termination-point { + key "tunnel-tp-id"; + description + "A termination point can terminate a tunnel."; + leaf tunnel-tp-id { + type binary; + description + "TTP identifier."; + } + uses te-node-tunnel-termination-point-config; + leaf oper-status { + type te-types:te-oper-status; + config false; + description + "The current operational state of the TTP."; + } + uses geolocation-container; + container statistics { + config false; + description + "Statistics data."; + uses statistics-per-ttp; + } + // Relationship to other TTPs + list supporting-tunnel-termination-point { + key "node-ref tunnel-tp-ref"; + description + "Identifies the TTPs on which this TTP depends."; + leaf node-ref { + type inet:uri; + description + "This leaf identifies the node in which the supporting + TTP is present. + This node is either the supporting node or a node in + an underlay topology."; + } + leaf tunnel-tp-ref { + type binary; + description + "Reference to a TTP that is in either the supporting node + or a node in an underlay topology."; + } + } + // supporting-tunnel-termination-point + } + // tunnel-termination-point + } + // te-node-augment + + grouping te-node-config { + description + "TE node configuration grouping."; + leaf-list te-node-template { + if-feature "template"; + type leafref { + path "../../../../te/templates/node-template/name"; + } + description + "The reference to a TE node template."; + } + uses te-node-config-attributes; + } + // te-node-config + + grouping te-node-config-attributes { + description + "Configuration node attributes in a TE topology."; + container te-node-attributes { + description + "Contains node attributes in a TE topology."; + leaf admin-status { + type te-types:te-admin-status; + description + "The administrative state of the link."; + } + uses te-node-connectivity-matrices; + uses te-node-info-attributes; + } + } + // te-node-config-attributes + + grouping te-node-config-attributes-template { + description + "Configuration node attributes for a template in a TE + topology."; + container te-node-attributes { + description + "Contains node attributes in a TE topology."; + leaf admin-status { + type te-types:te-admin-status; + description + "The administrative state of the link."; + } + uses te-node-info-attributes; + } + } + // te-node-config-attributes-template + + grouping te-node-connectivity-matrices { + description + "Connectivity matrix on a TE node."; + container connectivity-matrices { + description + "Contains a connectivity matrix on a TE node."; + leaf number-of-entries { + type uint16; + description + "The number of connectivity matrix entries. + If this number is specified in the configuration request, + the number is the requested number of entries, which may + not all be listed in the list; + if this number is reported in the state data, + the number is the current number of operational entries."; + } + uses te-types:label-set-info; + uses connectivity-matrix-entry-path-attributes; + list connectivity-matrix { + key "id"; + description + "Represents a node's switching limitations, i.e., + limitations in the interconnecting network TE links + across the node."; + reference + "RFC 7579: General Network Element Constraint Encoding + for GMPLS-Controlled Networks"; + leaf id { + type uint32; + description + "Identifies the connectivity matrix entry."; + } + } + // connectivity-matrix + } + // connectivity-matrices + } + // te-node-connectivity-matrices + + grouping te-node-connectivity-matrix-attributes { + description + "Termination point references of a connectivity matrix entry."; + container from { + description + "Reference to a source LTP."; + leaf tp-ref { + type leafref { + path "../../../../../../nt:termination-point/nt:tp-id"; + } + description + "Relative reference to a termination point."; + } + uses te-types:label-set-info; + } + container to { + description + "Reference to a destination LTP."; + leaf tp-ref { + type leafref { + path "../../../../../../nt:termination-point/nt:tp-id"; + } + description + "Relative reference to a termination point."; + } + uses te-types:label-set-info; + } + uses connectivity-matrix-entry-path-attributes; + } + // te-node-connectivity-matrix-attributes + + grouping te-node-info-attributes { + description + "Advertised TE information attributes."; + leaf domain-id { + type uint32; + description + "Identifies the domain to which this node belongs. + This attribute is used to support inter-domain links."; + reference + "RFC 5152: A Per-Domain Path Computation Method for + Establishing Inter-Domain Traffic Engineering (TE) + Label Switched Paths (LSPs) + RFC 5316: ISIS Extensions in Support of Inter-Autonomous + System (AS) MPLS and GMPLS Traffic Engineering + RFC 5392: OSPF Extensions in Support of Inter-Autonomous + System (AS) MPLS and GMPLS Traffic Engineering"; + } + leaf is-abstract { + type empty; + description + "Present if the node is abstract; not present if the node + is actual."; + } + leaf name { + type string; + description + "Node name."; + } + leaf-list signaling-address { + type inet:ip-address; + description + "The node's signaling address."; + } + container underlay-topology { + if-feature "te-topology-hierarchy"; + description + "When an abstract node encapsulates a topology, the + attributes in this container point to said topology."; + uses nw:network-ref; + } + } + // te-node-info-attributes + + grouping te-node-state-derived { + description + "Node state attributes in a TE topology."; + leaf oper-status { + type te-types:te-oper-status; + config false; + description + "The current operational state of the node."; + } + uses geolocation-container; + leaf is-multi-access-dr { + type empty; + config false; + description + "The presence of this attribute indicates that this TE node + is a pseudonode elected as a designated router."; + reference + "RFC 1195: Use of OSI IS-IS for Routing in TCP/IP and Dual + Environments + RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2"; + } + uses information-source-per-node-attributes; + list information-source-entry { + key "information-source information-source-instance"; + config false; + description + "A list of information sources learned, including the source + that is used."; + uses information-source-per-node-attributes; + uses te-node-connectivity-matrices; + uses te-node-info-attributes; + } + } + // te-node-state-derived + + grouping te-node-tunnel-termination-point-config { + description + "Termination capability of a TTP on a TE node."; + uses te-node-tunnel-termination-point-config-attributes; + container local-link-connectivities { + description + "Contains an LLCL for a TTP on a TE node."; + leaf number-of-entries { + type uint16; + description + "The number of LLCL entries. + If this number is specified in the configuration request, + the number is the requested number of entries, which may + not all be listed in the list; + if this number is reported in the state data, + the number is the current number of operational entries."; + } + uses te-types:label-set-info; + uses connectivity-matrix-entry-path-attributes; + } + } + // te-node-tunnel-termination-point-config + + grouping te-node-tunnel-termination-point-config-attributes { + description + "Configuration attributes of a TTP on a TE node."; + leaf admin-status { + type te-types:te-admin-status; + description + "The administrative state of the TTP."; + } + leaf name { + type string; + description + "A descriptive name for the TTP."; + } + leaf switching-capability { + type identityref { + base te-types:switching-capabilities; + } + description + "Switching capability for this interface."; + } + leaf encoding { + type identityref { + base te-types:lsp-encoding-types; + } + description + "Encoding supported by this interface."; + } + leaf-list inter-layer-lock-id { + type uint32; + description + "Inter-layer lock ID, used for path computation in a TE + topology covering multiple layers or multiple regions."; + reference + "RFC 5212: Requirements for GMPLS-Based Multi-Region and + Multi-Layer Networks (MRN/MLN) + RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions + for Multi-Layer and Multi-Region Networks (MLN/MRN)"; + } + leaf protection-type { + type identityref { + base te-types:lsp-protection-type; + } + description + "The protection type that this TTP is capable of."; + } + container client-layer-adaptation { + description + "Contains capability information to support a client-layer + adaptation in a multi-layer topology."; + list switching-capability { + key "switching-capability encoding"; + description + "List of supported switching capabilities."; + reference + "RFC 4202: Routing Extensions in Support of + Generalized Multi-Protocol Label Switching (GMPLS) + RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions + for Multi-Layer and Multi-Region Networks (MLN/MRN)"; + leaf switching-capability { + type identityref { + base te-types:switching-capabilities; + } + description + "Switching capability for the client-layer adaptation."; + } + leaf encoding { + type identityref { + base te-types:lsp-encoding-types; + } + description + "Encoding supported by the client-layer adaptation."; + } + uses te-types:te-bandwidth; + } + } + } + // te-node-tunnel-termination-point-config-attributes + + grouping te-node-tunnel-termination-point-llc-list { + description + "LLCL of a TTP on a TE node."; + list local-link-connectivity { + key "link-tp-ref"; + description + "The termination capabilities between the TTP and the LTP. + This capability information can be used to compute + the tunnel path. + The Interface Adjustment Capability Descriptors (IACDs) + (defined in RFC 6001) on each LTP can be derived from + this list."; + reference + "RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions + for Multi-Layer and Multi-Region Networks (MLN/MRN)"; + leaf link-tp-ref { + type leafref { + path "../../../../../nt:termination-point/nt:tp-id"; + } + description + "LTP."; + } + uses te-types:label-set-info; + uses connectivity-matrix-entry-path-attributes; + } + } + // te-node-tunnel-termination-point-llc-list + + grouping te-path-element { + description + "A group of attributes defining an element in a TE path, + such as a TE node, TE link, TE atomic resource, or label."; + uses te-types:explicit-route-hop; + } + // te-path-element + + grouping te-termination-point-augment { + description + "Augmentation for a TE termination point."; + leaf te-tp-id { + type te-types:te-tp-id; + description + "An identifier that uniquely identifies a TE termination + point."; + } + container te { + must '../te-tp-id'; + presence "TE support"; + description + "Indicates TE support."; + uses te-termination-point-config; + leaf oper-status { + type te-types:te-oper-status; + config false; + description + "The current operational state of the LTP."; + } + uses geolocation-container; + } + } + // te-termination-point-augment + + grouping te-termination-point-config { + description + "TE termination point configuration grouping."; + leaf admin-status { + type te-types:te-admin-status; + description + "The administrative state of the LTP."; + } + leaf name { + type string; + description + "A descriptive name for the LTP."; + } + uses interface-switching-capability-list; + leaf inter-domain-plug-id { + type binary; + description + "A network-wide unique number that identifies on the + network a connection that supports a given inter-domain + TE link. This is a more flexible alternative to specifying + 'remote-te-node-id' and 'remote-te-link-tp-id' on a TE link + when the provider either does not know 'remote-te-node-id' + and 'remote-te-link-tp-id' or needs to give the client the + flexibility to mix and match multiple topologies."; + } + leaf-list inter-layer-lock-id { + type uint32; + description + "Inter-layer lock ID, used for path computation in a TE + topology covering multiple layers or multiple regions."; + reference + "RFC 5212: Requirements for GMPLS-Based Multi-Region and + Multi-Layer Networks (MRN/MLN) + RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions + for Multi-Layer and Multi-Region Networks (MLN/MRN)"; + } + } + // te-termination-point-config + + grouping te-topologies-augment { + description + "Augmentation for TE topologies."; + container te { + presence "TE support"; + description + "Indicates TE support."; + container templates { + description + "Configuration parameters for templates used for a TE + topology."; + list node-template { + if-feature "template"; + key "name"; + leaf name { + type te-types:te-template-name; + description + "The name to identify a TE node template."; + } + description + "The list of TE node templates used to define sharable + and reusable TE node attributes."; + uses template-attributes; + uses te-node-config-attributes-template; + } + // node-template + list link-template { + if-feature "template"; + key "name"; + leaf name { + type te-types:te-template-name; + description + "The name to identify a TE link template."; + } + description + "The list of TE link templates used to define sharable + and reusable TE link attributes."; + uses template-attributes; + uses te-link-config-attributes; + } + // link-template + } + // templates + } + // te + } + // te-topologies-augment + + grouping te-topology-augment { + description + "Augmentation for a TE topology."; + uses te-types:te-topology-identifier; + container te { + must '../te-topology-identifier/provider-id' + + ' and ../te-topology-identifier/client-id' + + ' and ../te-topology-identifier/topology-id'; + presence "TE support"; + description + "Indicates TE support."; + uses te-topology-config; + uses geolocation-container; + } + } + // te-topology-augment + + grouping te-topology-config { + description + "TE topology configuration grouping."; + leaf name { + type string; + description + "Name of the TE topology. This attribute is optional and can + be specified by the operator to describe the TE topology, + which can be useful when 'network-id' (RFC 8345) is not + descriptive and not modifiable because of being generated + by the system."; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + leaf preference { + type uint8 { + range "1..255"; + } + description + "Specifies a preference for this topology. A lower number + indicates a higher preference."; + } + leaf optimization-criterion { + type identityref { + base te-types:objective-function-type; + } + description + "Optimization criterion applied to this topology."; + reference + "RFC 3272: Overview and Principles of Internet Traffic + Engineering"; + } + list nsrlg { + if-feature "nsrlg"; + key "id"; + description + "List of NSRLGs (Non-Shared Risk Link Groups)."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) + Recovery"; + leaf id { + type uint32; + description + "Identifies the NSRLG entry."; + } + leaf disjointness { + type te-types:te-path-disjointness; + description + "The type of resource disjointness."; + } + } + // nsrlg + } + // te-topology-config + + grouping template-attributes { + description + "Common attributes for all templates."; + leaf priority { + type uint16; + description + "The preference value for resolving conflicts between + different templates. When two or more templates specify + values for one configuration attribute, the value from the + template with the highest priority is used. + A lower number indicates a higher priority. The highest + priority is 0."; + } + leaf reference-change-policy { + type enumeration { + enum no-action { + description + "When an attribute changes in this template, the + configuration node referring to this template does + not take any action."; + } + enum not-allowed { + description + "When any configuration object has a reference to this + template, changing this template is not allowed."; + } + enum cascade { + description + "When an attribute changes in this template, the + configuration object referring to this template applies + the new attribute value to the corresponding + configuration."; + } + } + description + "This attribute specifies the action taken for a + configuration node that has a reference to this template."; + } + } + // template-attributes + + /* + * Data nodes + */ + + augment "/nw:networks/nw:network/nw:network-types" { + description + "Introduces a new network type for a TE topology."; + container te-topology { + presence "Indicates a TE topology"; + description + "Its presence identifies the TE topology type."; + } + } + + augment "/nw:networks" { + description + "Augmentation parameters for TE topologies."; + uses te-topologies-augment; + } + + augment "/nw:networks/nw:network" { + when 'nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Configuration parameters for a TE topology."; + uses te-topology-augment; + } + + augment "/nw:networks/nw:network/nw:node" { + when '../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Configuration parameters for TE at the node level."; + leaf te-node-id { + type te-types:te-node-id; + description + "The identifier of a node in the TE topology. + A node is specific to a topology to which it belongs."; + } + container te { + must '../te-node-id' { + description + "'te-node-id' is mandatory."; + } + must 'count(../nw:supporting-node)<=1' { + description + "For a node in a TE topology, there cannot be more + than one supporting node. If multiple nodes are + abstracted, the 'underlay-topology' field is used."; + } + presence "TE support"; + description + "Indicates TE support."; + uses te-node-augment; + } + } + + augment "/nw:networks/nw:network/nt:link" { + when '../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Configuration parameters for TE at the link level."; + container te { + must 'count(../nt:supporting-link)<=1' { + description + "For a link in a TE topology, there cannot be more + than one supporting link. If one or more link paths are + abstracted, the underlay is used."; + } + presence "TE support"; + description + "Indicates TE support."; + uses te-link-augment; + } + } + + augment "/nw:networks/nw:network/nw:node/" + + "nt:termination-point" { + when '../../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Configuration parameters for TE at the termination point + level."; + uses te-termination-point-augment; + } + + augment "/nw:networks/nw:network/nt:link/te/bundle-stack-level/" + + "bundle/bundled-links/bundled-link" { + when '../../../../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Augmentation for a TE bundled link."; + leaf src-tp-ref { + type leafref { + path "../../../../../nw:node[nw:node-id = " + + "current()/../../../../nt:source/" + + "nt:source-node]/" + + "nt:termination-point/nt:tp-id"; + require-instance true; + } + description + "Reference to another TE termination point on the + same source node."; + } + leaf des-tp-ref { + type leafref { + path "../../../../../nw:node[nw:node-id = " + + "current()/../../../../nt:destination/" + + "nt:dest-node]/" + + "nt:termination-point/nt:tp-id"; + require-instance true; + } + description + "Reference to another TE termination point on the + same destination node."; + } + } + + augment "/nw:networks/nw:network/nw:node/te/" + + "information-source-entry/connectivity-matrices/" + + "connectivity-matrix" { + when '../../../../../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Augmentation for the TE node connectivity matrix."; + uses te-node-connectivity-matrix-attributes; + } + + augment "/nw:networks/nw:network/nw:node/te/te-node-attributes/" + + "connectivity-matrices/connectivity-matrix" { + when '../../../../../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Augmentation for the TE node connectivity matrix."; + uses te-node-connectivity-matrix-attributes; + } + + augment "/nw:networks/nw:network/nw:node/te/" + + "tunnel-termination-point/local-link-connectivities" { + when '../../../../nw:network-types/tet:te-topology' { + description + "Augmentation parameters apply only for networks with a + TE topology type."; + } + description + "Augmentation for TE node TTP LLCs (Local Link + Connectivities)."; + uses te-node-tunnel-termination-point-llc-list; + } +} diff --git a/gnpyapi/yang/ietf-te-types@2022-10-21.yang b/gnpyapi/yang/ietf-te-types@2022-10-21.yang new file mode 100755 index 0000000..0252a9b --- /dev/null +++ b/gnpyapi/yang/ietf-te-types@2022-10-21.yang @@ -0,0 +1,3458 @@ +module ietf-te-types { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-te-types"; + prefix te-types; + + import ietf-inet-types { + prefix inet; + reference + "RFC 6991: Common YANG Data Types"; + } + import ietf-yang-types { + prefix yang; + reference + "RFC 6991: Common YANG Data Types"; + } + import ietf-routing-types { + prefix rt-types; + reference + "RFC 8294: Common YANG Data Types for the Routing Area"; + } + + organization + "IETF Traffic Engineering Architecture and Signaling (TEAS) + Working Group"; + contact + "WG Web: + WG List: + + Editor: Tarek Saad + + + Editor: Rakesh Gandhi + + + Editor: Vishnu Pavan Beeram + + + Editor: Xufeng Liu + + + Editor: Igor Bryskin + "; + description + "This YANG module contains a collection of generally useful + YANG data type definitions specific to TE. The model fully + conforms to the Network Management Datastore Architecture + (NMDA). + + The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL + NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', + 'MAY', and 'OPTIONAL' in this document are to be interpreted as + described in BCP 14 (RFC 2119) (RFC 8174) when, and only when, + they appear in all capitals, as shown here. + + Copyright (c) 2020 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject to + the license terms contained in, the Simplified BSD License set + forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8776; see the + RFC itself for full legal notices."; + + revision 2022-10-21 { + description + "te-tp-id: add inet:uri for consistency with tp-id in ietf-network-topology@2018-02-26.yang"; + } + + revision 2021-02-13 { + description + "te-topology-id: invert order of params in union for typedef te-topology-id because of mdsal bug "; + } + + revision 2020-11-26 { + description + "te-topology-id: workaround for typedef from another typedef which is of type enum because of mdsal bug "; + } + + revision 2020-06-10 { + description + "Latest revision of TE types."; + reference + "RFC 8776: Common YANG Data Types for Traffic Engineering"; + } + + /** + * Typedefs + */ + + typedef admin-group { + type yang:hex-string { + /* 01:02:03:04 */ + length "1..11"; + } + description + "Administrative group / resource class / color representation + in 'hex-string' type. + The most significant byte in the hex-string is the farthest + to the left in the byte sequence. Leading zero bytes in the + configured value may be omitted for brevity."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering + RFC 7308: Extended Administrative Groups in MPLS Traffic + Engineering (MPLS-TE)"; + } + + typedef admin-groups { + type union { + type admin-group; + type extended-admin-group; + } + description + "Derived types for TE administrative groups."; + } + + typedef extended-admin-group { + type yang:hex-string; + description + "Extended administrative group / resource class / color + representation in 'hex-string' type. + The most significant byte in the hex-string is the farthest + to the left in the byte sequence. Leading zero bytes in the + configured value may be omitted for brevity."; + reference + "RFC 7308: Extended Administrative Groups in MPLS Traffic + Engineering (MPLS-TE)"; + } + + typedef path-attribute-flags { + type union { + type identityref { + base session-attributes-flags; + } + type identityref { + base lsp-attributes-flags; + } + } + description + "Path attributes flags type."; + } + + typedef performance-metrics-normality { + type enumeration { + enum unknown { + value 0; + description + "Unknown."; + } + enum normal { + value 1; + description + "Normal. Indicates that the anomalous bit is not set."; + } + enum abnormal { + value 2; + description + "Abnormal. Indicates that the anomalous bit is set."; + } + } + description + "Indicates whether a performance metric is normal (anomalous + bit not set), abnormal (anomalous bit set), or unknown."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + } + + typedef srlg { + type uint32; + description + "SRLG type."; + reference + "RFC 4203: OSPF Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS) + RFC 5307: IS-IS Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS)"; + } + + typedef te-common-status { + type enumeration { + enum up { + description + "Enabled."; + } + enum down { + description + "Disabled."; + } + enum testing { + description + "In some test mode."; + } + enum preparing-maintenance { + description + "The resource is disabled in the control plane to prepare + for a graceful shutdown for maintenance purposes."; + reference + "RFC 5817: Graceful Shutdown in MPLS and Generalized MPLS + Traffic Engineering Networks"; + } + enum maintenance { + description + "The resource is disabled in the data plane for maintenance + purposes."; + } + enum unknown { + description + "Status is unknown."; + } + } + description + "Defines a type representing the common states of a TE + resource."; + } + + typedef te-bandwidth { + type string { + pattern '0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|' + + '1(\.([\da-fA-F]{0,5}[02468aAcCeE]?)?)?' + + '[pP](\+)?(12[0-7]|' + + '1[01]\d|0?\d?\d)?)|0[xX][\da-fA-F]{1,8}|\d+' + + '(,(0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|' + + '1(\.([\da-fA-F]{0,5}[02468aAcCeE]?)?)?' + + '[pP](\+)?(12[0-7]|' + + '1[01]\d|0?\d?\d)?)|0[xX][\da-fA-F]{1,8}|\d+))*'; + } + description + "This is the generic bandwidth type. It is a string containing + a list of numbers separated by commas, where each of these + numbers can be non-negative decimal, hex integer, or + hex float: + + (dec | hex | float)[*(','(dec | hex | float))] + + For the packet-switching type, the string encoding follows + the type 'bandwidth-ieee-float32' as defined in RFC 8294 + (e.g., 0x1p10), where the units are in bytes per second. + + For the Optical Transport Network (OTN) switching type, + a list of integers can be used, such as '0,2,3,1', indicating + two ODU0s and one ODU3. ('ODU' stands for 'Optical Data + Unit'.) For Dense Wavelength Division Multiplexing (DWDM), + a list of pairs of slot numbers and widths can be used, + such as '0,2,3,3', indicating a frequency slot 0 with + slot width 2 and a frequency slot 3 with slot width 3. + Canonically, the string is represented as all lowercase and in + hex, where the prefix '0x' precedes the hex number."; + reference + "RFC 8294: Common YANG Data Types for the Routing Area + ITU-T Recommendation G.709: Interfaces for the + optical transport network"; + } + + typedef te-ds-class { + type uint8 { + range "0..7"; + } + description + "The Differentiated Services Class-Type of traffic."; + reference + "RFC 4124: Protocol Extensions for Support of Diffserv-aware + MPLS Traffic Engineering, Section 4.3.1"; + } + + typedef te-global-id { + type uint32; + description + "An identifier to uniquely identify an operator, which can be + either a provider or a client. + The definition of this type is taken from RFCs 6370 and 5003. + This attribute type is used solely to provide a globally + unique context for TE topologies."; + reference + "RFC 5003: Attachment Individual Identifier (AII) Types for + Aggregation + RFC 6370: MPLS Transport Profile (MPLS-TP) Identifiers"; + } + + typedef te-hop-type { + type enumeration { + enum loose { + description + "A loose hop in an explicit path."; + } + enum strict { + description + "A strict hop in an explicit path."; + } + } + description + "Enumerated type for specifying loose or strict paths."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.3.3"; + } + + typedef te-link-access-type { + type enumeration { + enum point-to-point { + description + "The link is point-to-point."; + } + enum multi-access { + description + "The link is multi-access, including broadcast and NBMA."; + } + } + description + "Defines a type representing the access type of a TE link."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2"; + } + + typedef te-label-direction { + type enumeration { + enum forward { + description + "Label allocated for the forward LSP direction."; + } + enum reverse { + description + "Label allocated for the reverse LSP direction."; + } + } + description + "Enumerated type for specifying the forward or reverse + label."; + } + + typedef te-link-direction { + type enumeration { + enum incoming { + description + "The explicit route represents an incoming link on + a node."; + } + enum outgoing { + description + "The explicit route represents an outgoing link on + a node."; + } + } + description + "Enumerated type for specifying the direction of a link on + a node."; + } + + typedef te-metric { + type uint32; + description + "TE metric."; + reference + "RFC 3785: Use of Interior Gateway Protocol (IGP) Metric as a + second MPLS Traffic Engineering (TE) Metric"; + } + + typedef te-node-id { + type yang:dotted-quad; + description + "A type representing the identifier for a node in a TE + topology. + The identifier is represented as 4 octets in dotted-quad + notation. + This attribute MAY be mapped to the Router Address TLV + described in Section 2.4.1 of RFC 3630, the TE Router ID + described in Section 3 of RFC 6827, the Traffic Engineering + Router ID TLV described in Section 4.3 of RFC 5305, or the + TE Router ID TLV described in Section 3.2.1 of RFC 6119. + The reachability of such a TE node MAY be achieved by a + mechanism such as that described in Section 6.2 of RFC 6827."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2, Section 2.4.1 + RFC 5305: IS-IS Extensions for Traffic Engineering, + Section 4.3 + RFC 6119: IPv6 Traffic Engineering in IS-IS, Section 3.2.1 + RFC 6827: Automatically Switched Optical Network (ASON) + Routing for OSPFv2 Protocols, Section 3"; + } + + typedef te-oper-status { + type enumeration { + enum up { + description + "Enabled."; + } + enum down { + description + "Disabled."; + } + enum testing { + description + "In some test mode."; + } + enum preparing-maintenance { + description + "The resource is disabled in the control plane to prepare + for a graceful shutdown for maintenance purposes."; + reference + "RFC 5817: Graceful Shutdown in MPLS and Generalized MPLS + Traffic Engineering Networks"; + } + enum maintenance { + description + "The resource is disabled in the data plane for maintenance + purposes."; + } + enum unknown { + description + "Status is unknown."; + } + } + description + "Defines a type representing the operational status of + a TE resource."; + } + + typedef te-admin-status { + type enumeration { + enum up { + description + "Enabled."; + } + enum down { + description + "Disabled."; + } + enum testing { + description + "In some test mode."; + } + enum preparing-maintenance { + description + "The resource is disabled in the control plane to prepare + for a graceful shutdown for maintenance purposes."; + reference + "RFC 5817: Graceful Shutdown in MPLS and Generalized MPLS + Traffic Engineering Networks"; + } + enum maintenance { + description + "The resource is disabled in the data plane for maintenance + purposes."; + } + enum unknown { + description + "Status is unknown."; + } + } + description + "Defines a type representing the administrative status of + a TE resource."; + } + + typedef te-path-disjointness { + type bits { + bit node { + position 0; + description + "Node disjoint."; + } + bit link { + position 1; + description + "Link disjoint."; + } + bit srlg { + position 2; + description + "SRLG (Shared Risk Link Group) disjoint."; + } + } + description + "Type of the resource disjointness for a TE tunnel path."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + typedef te-recovery-status { + type enumeration { + enum normal { + description + "Both the recovery span and the working span are fully + allocated and active, data traffic is being + transported over (or selected from) the working + span, and no trigger events are reported."; + } + enum recovery-started { + description + "The recovery action has been started but not completed."; + } + enum recovery-succeeded { + description + "The recovery action has succeeded. The working span has + reported a failure/degrade condition, and the user traffic + is being transported (or selected) on the recovery span."; + } + enum recovery-failed { + description + "The recovery action has failed."; + } + enum reversion-started { + description + "The reversion has started."; + } + enum reversion-succeeded { + description + "The reversion action has succeeded."; + } + enum reversion-failed { + description + "The reversion has failed."; + } + enum recovery-unavailable { + description + "The recovery is unavailable, as a result of either an + operator's lockout command or a failure condition + detected on the recovery span."; + } + enum recovery-admin { + description + "The operator has issued a command to switch the user + traffic to the recovery span."; + } + enum wait-to-restore { + description + "The recovery domain is recovering from a failure/degrade + condition on the working span that is being controlled by + the Wait-to-Restore (WTR) timer."; + } + } + description + "Defines the status of a recovery action."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS) + RFC 6378: MPLS Transport Profile (MPLS-TP) Linear Protection"; + } + + typedef te-template-name { + type string { + pattern '/?([a-zA-Z0-9\-_.]+)(/[a-zA-Z0-9\-_.]+)*'; + } + description + "A type for the name of a TE node template or TE link + template."; + } + + typedef te-topology-event-type { + type enumeration { + enum add { + value 0; + description + "A TE node or TE link has been added."; + } + enum remove { + value 1; + description + "A TE node or TE link has been removed."; + } + enum update { + value 2; + description + "A TE node or TE link has been updated."; + } + } + description + "TE event type for notifications."; + } + + typedef te-topology-id { + type union { + type string { + pattern '([a-zA-Z0-9\-_.]+:)*' + + '/?([a-zA-Z0-9\-_.]+)(/[a-zA-Z0-9\-_.]+)*'; + } + type string { + length "0"; + // empty string + } + } + + description + "An identifier for a topology. + It is optional to have one or more prefixes at the beginning, + separated by colons. The prefixes can be 'network-types' as + defined in the 'ietf-network' module in RFC 8345, to help the + user better understand the topology before further inquiry + is made."; + reference + "RFC 8345: A YANG Data Model for Network Topologies"; + } + + typedef te-tp-id { + type union { + type inet:uri; + // Added for consistency with tp-id in ietf-network-topology@2018-02-26.yang + type uint32; + // Unnumbered + type inet:ip-address; + // IPv4 or IPv6 address + } + + description + "An identifier for a TE link endpoint on a node. + This attribute is mapped to a local or remote link identifier + as defined in RFCs 3630 and 5305."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 5305: IS-IS Extensions for Traffic Engineering"; + } + + /* TE features */ + + feature p2mp-te { + description + "Indicates support for Point-to-Multipoint TE (P2MP-TE)."; + reference + "RFC 4875: Extensions to Resource Reservation Protocol - + Traffic Engineering (RSVP-TE) for Point-to-Multipoint TE + Label Switched Paths (LSPs)"; + } + + feature frr-te { + description + "Indicates support for TE Fast Reroute (FRR)."; + reference + "RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP Tunnels"; + } + + feature extended-admin-groups { + description + "Indicates support for TE link extended administrative + groups."; + reference + "RFC 7308: Extended Administrative Groups in MPLS Traffic + Engineering (MPLS-TE)"; + } + + feature named-path-affinities { + description + "Indicates support for named path affinities."; + } + + feature named-extended-admin-groups { + description + "Indicates support for named extended administrative groups."; + } + + feature named-srlg-groups { + description + "Indicates support for named SRLG groups."; + } + + feature named-path-constraints { + description + "Indicates support for named path constraints."; + } + + feature path-optimization-metric { + description + "Indicates support for path optimization metrics."; + } + + feature path-optimization-objective-function { + description + "Indicates support for path optimization objective functions."; + } + + /* + * Identities + */ + + identity session-attributes-flags { + description + "Base identity for the RSVP-TE session attributes flags."; + } + + identity local-protection-desired { + base session-attributes-flags; + description + "Local protection is desired."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.7.1"; + } + + identity se-style-desired { + base session-attributes-flags; + description + "Shared explicit style, to allow the LSP to be established + and share resources with the old LSP."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity local-recording-desired { + base session-attributes-flags; + description + "Label recording is desired."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.7.1"; + } + + identity bandwidth-protection-desired { + base session-attributes-flags; + description + "Requests FRR bandwidth protection on LSRs, if present."; + reference + "RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP Tunnels"; + } + + identity node-protection-desired { + base session-attributes-flags; + description + "Requests FRR node protection on LSRs, if present."; + reference + "RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP Tunnels"; + } + + identity path-reevaluation-request { + base session-attributes-flags; + description + "This flag indicates that a path re-evaluation (of the + current path in use) is requested. Note that this does + not trigger any LSP reroutes but instead just signals a + request to evaluate whether a preferable path exists."; + reference + "RFC 4736: Reoptimization of Multiprotocol Label Switching + (MPLS) Traffic Engineering (TE) Loosely Routed Label Switched + Path (LSP)"; + } + + identity soft-preemption-desired { + base session-attributes-flags; + description + "Soft preemption of LSP resources is desired."; + reference + "RFC 5712: MPLS Traffic Engineering Soft Preemption"; + } + + identity lsp-attributes-flags { + description + "Base identity for LSP attributes flags."; + } + + identity end-to-end-rerouting-desired { + base lsp-attributes-flags; + description + "Indicates end-to-end rerouting behavior for an LSP + undergoing establishment. This MAY also be used to + specify the behavior of end-to-end LSP recovery for + established LSPs."; + reference + "RFC 4920: Crankback Signaling Extensions for MPLS and GMPLS + RSVP-TE + RFC 5420: Encoding of Attributes for MPLS LSP Establishment + Using Resource Reservation Protocol Traffic Engineering + (RSVP-TE) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity boundary-rerouting-desired { + base lsp-attributes-flags; + description + "Indicates boundary rerouting behavior for an LSP undergoing + establishment. This MAY also be used to specify + segment-based LSP recovery through nested crankback for + established LSPs. The boundary Area Border Router (ABR) / + Autonomous System Border Router (ASBR) can decide to forward + the PathErr message upstream to either an upstream boundary + ABR/ASBR or the ingress LSR. Alternatively, it can try to + select another egress boundary LSR."; + reference + "RFC 4920: Crankback Signaling Extensions for MPLS and GMPLS + RSVP-TE + RFC 5420: Encoding of Attributes for MPLS LSP Establishment + Using Resource Reservation Protocol Traffic Engineering + (RSVP-TE) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity segment-based-rerouting-desired { + base lsp-attributes-flags; + description + "Indicates segment-based rerouting behavior for an LSP + undergoing establishment. This MAY also be used to specify + segment-based LSP recovery for established LSPs."; + reference + "RFC 4920: Crankback Signaling Extensions for MPLS and GMPLS + RSVP-TE + RFC 5420: Encoding of Attributes for MPLS LSP Establishment + Using Resource Reservation Protocol Traffic Engineering + (RSVP-TE) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity lsp-integrity-required { + base lsp-attributes-flags; + description + "Indicates that LSP integrity is required."; + reference + "RFC 4875: Extensions to Resource Reservation Protocol - + Traffic Engineering (RSVP-TE) for Point-to-Multipoint TE + Label Switched Paths (LSPs) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity contiguous-lsp-desired { + base lsp-attributes-flags; + description + "Indicates that a contiguous LSP is desired."; + reference + "RFC 5151: Inter-Domain MPLS and GMPLS Traffic Engineering -- + Resource Reservation Protocol-Traffic Engineering (RSVP-TE) + Extensions + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity lsp-stitching-desired { + base lsp-attributes-flags; + description + "Indicates that LSP stitching is desired."; + reference + "RFC 5150: Label Switched Path Stitching with Generalized + Multiprotocol Label Switching Traffic Engineering (GMPLS TE) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity pre-planned-lsp-flag { + base lsp-attributes-flags; + description + "Indicates that the LSP MUST be provisioned in the + control plane only."; + reference + "RFC 6001: Generalized MPLS (GMPLS) Protocol Extensions for + Multi-Layer and Multi-Region Networks (MLN/MRN) + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity non-php-behavior-flag { + base lsp-attributes-flags; + description + "Indicates that non-PHP (non-Penultimate Hop Popping) behavior + for the LSP is desired."; + reference + "RFC 6511: Non-Penultimate Hop Popping Behavior and Out-of-Band + Mapping for RSVP-TE Label Switched Paths + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity oob-mapping-flag { + base lsp-attributes-flags; + description + "Indicates that signaling of the egress binding information is + out of band (e.g., via the Border Gateway Protocol (BGP))."; + reference + "RFC 6511: Non-Penultimate Hop Popping Behavior and Out-of-Band + Mapping for RSVP-TE Label Switched Paths + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity entropy-label-capability { + base lsp-attributes-flags; + description + "Indicates entropy label capability."; + reference + "RFC 6790: The Use of Entropy Labels in MPLS Forwarding + RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO)"; + } + + identity oam-mep-entity-desired { + base lsp-attributes-flags; + description + "OAM Maintenance Entity Group End Point (MEP) entities + desired."; + reference + "RFC 7260: GMPLS RSVP-TE Extensions for Operations, + Administration, and Maintenance (OAM) Configuration"; + } + + identity oam-mip-entity-desired { + base lsp-attributes-flags; + description + "OAM Maintenance Entity Group Intermediate Points (MIP) + entities desired."; + reference + "RFC 7260: GMPLS RSVP-TE Extensions for Operations, + Administration, and Maintenance (OAM) Configuration"; + } + + identity srlg-collection-desired { + base lsp-attributes-flags; + description + "SRLG collection desired."; + reference + "RFC 7570: Label Switched Path (LSP) Attribute in the Explicit + Route Object (ERO) + RFC 8001: RSVP-TE Extensions for Collecting Shared Risk + Link Group (SRLG) Information"; + } + + identity loopback-desired { + base lsp-attributes-flags; + description + "This flag indicates that a particular node on the LSP is + required to enter loopback mode. This can also be + used to specify the loopback state of the node."; + reference + "RFC 7571: GMPLS RSVP-TE Extensions for Lock Instruct and + Loopback"; + } + + identity p2mp-te-tree-eval-request { + base lsp-attributes-flags; + description + "P2MP-TE tree re-evaluation request."; + reference + "RFC 8149: RSVP Extensions for Reoptimization of Loosely Routed + Point-to-Multipoint Traffic Engineering Label Switched Paths + (LSPs)"; + } + + identity rtm-set-desired { + base lsp-attributes-flags; + description + "Residence Time Measurement (RTM) attribute flag requested."; + reference + "RFC 8169: Residence Time Measurement in MPLS Networks"; + } + + identity link-protection-type { + description + "Base identity for the link protection type."; + } + + identity link-protection-unprotected { + base link-protection-type; + description + "Unprotected link type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity link-protection-extra-traffic { + base link-protection-type; + description + "Extra-Traffic protected link type."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity link-protection-shared { + base link-protection-type; + description + "Shared protected link type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity link-protection-1-for-1 { + base link-protection-type; + description + "One-for-one (1:1) protected link type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity link-protection-1-plus-1 { + base link-protection-type; + description + "One-plus-one (1+1) protected link type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity link-protection-enhanced { + base link-protection-type; + description + "A compound link protection type derived from the underlay + TE tunnel protection configuration supporting the TE link."; + } + + identity association-type { + description + "Base identity for the tunnel association."; + } + + identity association-type-recovery { + base association-type; + description + "Association type for recovery, used to associate LSPs of the + same tunnel for recovery."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery + RFC 6780: RSVP ASSOCIATION Object Extensions"; + } + + identity association-type-resource-sharing { + base association-type; + description + "Association type for resource sharing, used to enable + resource sharing during make-before-break."; + reference + "RFC 4873: GMPLS Segment Recovery + RFC 6780: RSVP ASSOCIATION Object Extensions"; + } + + identity association-type-double-sided-bidir { + base association-type; + description + "Association type for double-sided bidirectional LSPs, + used to associate two LSPs of two tunnels that are + independently configured on either endpoint."; + reference + "RFC 7551: RSVP-TE Extensions for Associated Bidirectional + Label Switched Paths (LSPs)"; + } + + identity association-type-single-sided-bidir { + base association-type; + description + "Association type for single-sided bidirectional LSPs, + used to associate two LSPs of two tunnels, where one + tunnel is configured on one side/endpoint and the other + tunnel is dynamically created on the other endpoint."; + reference + "RFC 6780: RSVP ASSOCIATION Object Extensions + RFC 7551: RSVP-TE Extensions for Associated Bidirectional + Label Switched Paths (LSPs)"; + } + + identity objective-function-type { + description + "Base objective function type."; + } + + identity of-minimize-cost-path { + base objective-function-type; + description + "Objective function for minimizing path cost."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity of-minimize-load-path { + base objective-function-type; + description + "Objective function for minimizing the load on one or more + paths."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity of-maximize-residual-bandwidth { + base objective-function-type; + description + "Objective function for maximizing residual bandwidth."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity of-minimize-agg-bandwidth-consumption { + base objective-function-type; + description + "Objective function for minimizing aggregate bandwidth + consumption."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity of-minimize-load-most-loaded-link { + base objective-function-type; + description + "Objective function for minimizing the load on the link that + is carrying the highest load."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity of-minimize-cost-path-set { + base objective-function-type; + description + "Objective function for minimizing the cost on a path set."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity path-computation-method { + description + "Base identity for supported path computation mechanisms."; + } + + identity path-locally-computed { + base path-computation-method; + description + "Indicates a constrained-path LSP in which the + path is computed by the local LER."; + reference + "RFC 3272: Overview and Principles of Internet Traffic + Engineering, Section 5.4"; + } + + identity path-externally-queried { + base path-computation-method; + description + "Constrained-path LSP in which the path is obtained by + querying an external source, such as a PCE server. + In the case that an LSP is defined to be externally queried, + it may also have associated explicit definitions (provided + to the external source to aid computation). The path that is + returned by the external source may require further local + computation on the device."; + reference + "RFC 3272: Overview and Principles of Internet Traffic + Engineering + RFC 4657: Path Computation Element (PCE) Communication + Protocol Generic Requirements"; + } + + identity path-explicitly-defined { + base path-computation-method; + description + "Constrained-path LSP in which the path is + explicitly specified as a collection of strict and/or loose + hops."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels + RFC 3272: Overview and Principles of Internet Traffic + Engineering"; + } + + identity lsp-metric-type { + description + "Base identity for the LSP metric specification types."; + } + + identity lsp-metric-relative { + base lsp-metric-type; + description + "The metric specified for the LSPs to which this identity + refers is specified as a value relative to the IGP metric + cost to the LSP's tail end."; + reference + "RFC 4657: Path Computation Element (PCE) Communication + Protocol Generic Requirements"; + } + + identity lsp-metric-absolute { + base lsp-metric-type; + description + "The metric specified for the LSPs to which this identity + refers is specified as an absolute value."; + reference + "RFC 4657: Path Computation Element (PCE) Communication + Protocol Generic Requirements"; + } + + identity lsp-metric-inherited { + base lsp-metric-type; + description + "The metric for the LSPs to which this identity refers is + not specified explicitly; rather, it is directly inherited + from the IGP cost."; + reference + "RFC 4657: Path Computation Element (PCE) Communication + Protocol Generic Requirements"; + } + + identity te-tunnel-type { + description + "Base identity from which specific tunnel types are derived."; + } + + identity te-tunnel-p2p { + base te-tunnel-type; + description + "TE Point-to-Point (P2P) tunnel type."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity te-tunnel-p2mp { + base te-tunnel-type; + description + "TE P2MP tunnel type."; + reference + "RFC 4875: Extensions to Resource Reservation Protocol - + Traffic Engineering (RSVP-TE) for Point-to-Multipoint TE + Label Switched Paths (LSPs)"; + } + + identity tunnel-action-type { + description + "Base identity from which specific tunnel action types + are derived."; + } + + identity tunnel-action-resetup { + base tunnel-action-type; + description + "TE tunnel action that tears down the tunnel's current LSP + (if any) and attempts to re-establish a new LSP."; + } + + identity tunnel-action-reoptimize { + base tunnel-action-type; + description + "TE tunnel action that reoptimizes the placement of the + tunnel LSP(s)."; + } + + identity tunnel-action-switchpath { + base tunnel-action-type; + description + "TE tunnel action that switches the tunnel's LSP to use the + specified path."; + } + + identity te-action-result { + description + "Base identity from which specific TE action results + are derived."; + } + + identity te-action-success { + base te-action-result; + description + "TE action was successful."; + } + + identity te-action-fail { + base te-action-result; + description + "TE action failed."; + } + + identity tunnel-action-inprogress { + base te-action-result; + description + "TE action is in progress."; + } + + identity tunnel-admin-state-type { + description + "Base identity for TE tunnel administrative states."; + } + + identity tunnel-admin-state-up { + base tunnel-admin-state-type; + description + "Tunnel's administrative state is up."; + } + + identity tunnel-admin-state-down { + base tunnel-admin-state-type; + description + "Tunnel's administrative state is down."; + } + + identity tunnel-state-type { + description + "Base identity for TE tunnel states."; + } + + identity tunnel-state-up { + base tunnel-state-type; + description + "Tunnel's state is up."; + } + + identity tunnel-state-down { + base tunnel-state-type; + description + "Tunnel's state is down."; + } + + identity lsp-state-type { + description + "Base identity for TE LSP states."; + } + + identity lsp-path-computing { + base lsp-state-type; + description + "State path computation is in progress."; + } + + identity lsp-path-computation-ok { + base lsp-state-type; + description + "State path computation was successful."; + } + + identity lsp-path-computation-failed { + base lsp-state-type; + description + "State path computation failed."; + } + + identity lsp-state-setting-up { + base lsp-state-type; + description + "State is being set up."; + } + + identity lsp-state-setup-ok { + base lsp-state-type; + description + "State setup was successful."; + } + + identity lsp-state-setup-failed { + base lsp-state-type; + description + "State setup failed."; + } + + identity lsp-state-up { + base lsp-state-type; + description + "State is up."; + } + + identity lsp-state-tearing-down { + base lsp-state-type; + description + "State is being torn down."; + } + + identity lsp-state-down { + base lsp-state-type; + description + "State is down."; + } + + identity path-invalidation-action-type { + description + "Base identity for TE path invalidation action types."; + } + + identity path-invalidation-action-drop { + base path-invalidation-action-type; + description + "Upon invalidation of the TE tunnel path, the tunnel remains + valid, but any packet mapped over the tunnel is dropped."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 2.5"; + } + + identity path-invalidation-action-teardown { + base path-invalidation-action-type; + description + "TE path invalidation action teardown."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 2.5"; + } + + identity lsp-restoration-type { + description + "Base identity from which LSP restoration types are derived."; + } + + identity lsp-restoration-restore-any { + base lsp-restoration-type; + description + "Any LSP affected by a failure is restored."; + } + + identity lsp-restoration-restore-all { + base lsp-restoration-type; + description + "Affected LSPs are restored after all LSPs of the tunnel are + broken."; + } + + identity restoration-scheme-type { + description + "Base identity for LSP restoration schemes."; + } + + identity restoration-scheme-preconfigured { + base restoration-scheme-type; + description + "Restoration LSP is preconfigured prior to the failure."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity restoration-scheme-precomputed { + base restoration-scheme-type; + description + "Restoration LSP is precomputed prior to the failure."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity restoration-scheme-presignaled { + base restoration-scheme-type; + description + "Restoration LSP is presignaled prior to the failure."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity lsp-protection-type { + description + "Base identity from which LSP protection types are derived."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-unprotected { + base lsp-protection-type; + description + "'Unprotected' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-reroute-extra { + base lsp-protection-type; + description + "'(Full) Rerouting' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-reroute { + base lsp-protection-type; + description + "'Rerouting without Extra-Traffic' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-1-for-n { + base lsp-protection-type; + description + "'1:N Protection with Extra-Traffic' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-1-for-1 { + base lsp-protection-type; + description + "LSP protection '1:1 Protection Type'."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-unidir-1-plus-1 { + base lsp-protection-type; + description + "'1+1 Unidirectional Protection' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-bidir-1-plus-1 { + base lsp-protection-type; + description + "'1+1 Bidirectional Protection' LSP protection type."; + reference + "RFC 4872: RSVP-TE Extensions in Support of End-to-End + Generalized Multi-Protocol Label Switching (GMPLS) Recovery"; + } + + identity lsp-protection-extra-traffic { + base lsp-protection-type; + description + "Extra-Traffic LSP protection type."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity lsp-protection-state { + description + "Base identity of protection states for reporting purposes."; + } + + identity normal { + base lsp-protection-state; + description + "Normal state."; + } + + identity signal-fail-of-protection { + base lsp-protection-state; + description + "The protection transport entity has a signal fail condition + that is of higher priority than the forced switchover + command."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity lockout-of-protection { + base lsp-protection-state; + description + "A Loss of Protection (LoP) command is active."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity forced-switch { + base lsp-protection-state; + description + "A forced switchover command is active."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity signal-fail { + base lsp-protection-state; + description + "There is a signal fail condition on either the working path + or the protection path."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity signal-degrade { + base lsp-protection-state; + description + "There is a signal degrade condition on either the working + path or the protection path."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity manual-switch { + base lsp-protection-state; + description + "A manual switchover command is active."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity wait-to-restore { + base lsp-protection-state; + description + "A WTR timer is running."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity do-not-revert { + base lsp-protection-state; + description + "A Do Not Revert (DNR) condition is active because of + non-revertive behavior."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity failure-of-protocol { + base lsp-protection-state; + description + "LSP protection is not working because of a protocol failure + condition."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity protection-external-commands { + description + "Base identity from which protection-related external commands + used for troubleshooting purposes are derived."; + } + + identity action-freeze { + base protection-external-commands; + description + "A temporary configuration action initiated by an operator + command that prevents any switchover action from being taken + and, as such, freezes the current state."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity clear-freeze { + base protection-external-commands; + description + "An action that clears the active freeze state."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity action-lockout-of-normal { + base protection-external-commands; + description + "A temporary configuration action initiated by an operator + command to ensure that the normal traffic is not allowed + to use the protection transport entity."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity clear-lockout-of-normal { + base protection-external-commands; + description + "An action that clears the active lockout of the + normal state."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity action-lockout-of-protection { + base protection-external-commands; + description + "A temporary configuration action initiated by an operator + command to ensure that the protection transport entity is + temporarily not available to transport a traffic signal + (either normal or Extra-Traffic)."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity action-forced-switch { + base protection-external-commands; + description + "A switchover action initiated by an operator command to switch + the Extra-Traffic signal, the normal traffic signal, or the + null signal to the protection transport entity, unless a + switchover command of equal or higher priority is in effect."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity action-manual-switch { + base protection-external-commands; + description + "A switchover action initiated by an operator command to switch + the Extra-Traffic signal, the normal traffic signal, or + the null signal to the protection transport entity, unless + a fault condition exists on other transport entities or a + switchover command of equal or higher priority is in effect."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity action-exercise { + base protection-external-commands; + description + "An action that starts testing whether or not APS communication + is operating correctly. It is of lower priority than any + other state or command."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity clear { + base protection-external-commands; + description + "An action that clears the active near-end lockout of a + protection, forced switchover, manual switchover, WTR state, + or exercise command."; + reference + "RFC 4427: Recovery (Protection and Restoration) Terminology + for Generalized Multi-Protocol Label Switching (GMPLS)"; + } + + identity switching-capabilities { + description + "Base identity for interface switching capabilities."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity switching-psc1 { + base switching-capabilities; + description + "Packet-Switch Capable-1 (PSC-1)."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity switching-evpl { + base switching-capabilities; + description + "Ethernet Virtual Private Line (EVPL)."; + reference + "RFC 6004: Generalized MPLS (GMPLS) Support for Metro Ethernet + Forum and G.8011 Ethernet Service Switching"; + } + + identity switching-l2sc { + base switching-capabilities; + description + "Layer-2 Switch Capable (L2SC)."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity switching-tdm { + base switching-capabilities; + description + "Time-Division-Multiplex Capable (TDM)."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity switching-otn { + base switching-capabilities; + description + "OTN-TDM capable."; + reference + "RFC 7138: Traffic Engineering Extensions to OSPF for GMPLS + Control of Evolving G.709 Optical Transport Networks"; + } + + identity switching-dcsc { + base switching-capabilities; + description + "Data Channel Switching Capable (DCSC)."; + reference + "RFC 6002: Generalized MPLS (GMPLS) Data Channel + Switching Capable (DCSC) and Channel Set Label Extensions"; + } + + identity switching-lsc { + base switching-capabilities; + description + "Lambda-Switch Capable (LSC)."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity switching-fsc { + base switching-capabilities; + description + "Fiber-Switch Capable (FSC)."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-types { + description + "Base identity for encoding types."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-packet { + base lsp-encoding-types; + description + "Packet LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-ethernet { + base lsp-encoding-types; + description + "Ethernet LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-pdh { + base lsp-encoding-types; + description + "ANSI/ETSI PDH LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-sdh { + base lsp-encoding-types; + description + "SDH ITU-T G.707 / SONET ANSI T1.105 LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-digital-wrapper { + base lsp-encoding-types; + description + "Digital Wrapper LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-lambda { + base lsp-encoding-types; + description + "Lambda (photonic) LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-fiber { + base lsp-encoding-types; + description + "Fiber LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-fiber-channel { + base lsp-encoding-types; + description + "FiberChannel LSP encoding."; + reference + "RFC 3471: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Functional Description"; + } + + identity lsp-encoding-oduk { + base lsp-encoding-types; + description + "G.709 ODUk (Digital Path) LSP encoding."; + reference + "RFC 4328: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Extensions for G.709 Optical Transport Networks + Control"; + } + + identity lsp-encoding-optical-channel { + base lsp-encoding-types; + description + "G.709 Optical Channel LSP encoding."; + reference + "RFC 4328: Generalized Multi-Protocol Label Switching (GMPLS) + Signaling Extensions for G.709 Optical Transport Networks + Control"; + } + + identity lsp-encoding-line { + base lsp-encoding-types; + description + "Line (e.g., 8B/10B) LSP encoding."; + reference + "RFC 6004: Generalized MPLS (GMPLS) Support for Metro + Ethernet Forum and G.8011 Ethernet Service Switching"; + } + + identity path-signaling-type { + description + "Base identity from which specific LSP path setup types + are derived."; + } + + identity path-setup-static { + base path-signaling-type; + description + "Static LSP provisioning path setup."; + } + + identity path-setup-rsvp { + base path-signaling-type; + description + "RSVP-TE signaling path setup."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity path-setup-sr { + base path-signaling-type; + description + "Segment-routing path setup."; + } + + identity path-scope-type { + description + "Base identity from which specific path scope types are + derived."; + } + + identity path-scope-segment { + base path-scope-type; + description + "Path scope segment."; + reference + "RFC 4873: GMPLS Segment Recovery"; + } + + identity path-scope-end-to-end { + base path-scope-type; + description + "Path scope end to end."; + reference + "RFC 4873: GMPLS Segment Recovery"; + } + + identity route-usage-type { + description + "Base identity for route usage."; + } + + identity route-include-object { + base route-usage-type; + description + "'Include route' object."; + } + + identity route-exclude-object { + base route-usage-type; + description + "'Exclude route' object."; + reference + "RFC 4874: Exclude Routes - Extension to Resource ReserVation + Protocol-Traffic Engineering (RSVP-TE)"; + } + + identity route-exclude-srlg { + base route-usage-type; + description + "Excludes SRLGs."; + reference + "RFC 4874: Exclude Routes - Extension to Resource ReserVation + Protocol-Traffic Engineering (RSVP-TE)"; + } + + identity path-metric-type { + description + "Base identity for the path metric type."; + } + + identity path-metric-te { + base path-metric-type; + description + "TE path metric."; + reference + "RFC 3785: Use of Interior Gateway Protocol (IGP) Metric as a + second MPLS Traffic Engineering (TE) Metric"; + } + + identity path-metric-igp { + base path-metric-type; + description + "IGP path metric."; + reference + "RFC 3785: Use of Interior Gateway Protocol (IGP) Metric as a + second MPLS Traffic Engineering (TE) Metric"; + } + + identity path-metric-hop { + base path-metric-type; + description + "Hop path metric."; + } + + identity path-metric-delay-average { + base path-metric-type; + description + "Average unidirectional link delay."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions"; + } + + identity path-metric-delay-minimum { + base path-metric-type; + description + "Minimum unidirectional link delay."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions"; + } + + identity path-metric-residual-bandwidth { + base path-metric-type; + description + "Unidirectional Residual Bandwidth, which is defined to be + Maximum Bandwidth (RFC 3630) minus the bandwidth currently + allocated to LSPs."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2 + RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions"; + } + + identity path-metric-optimize-includes { + base path-metric-type; + description + "A metric that optimizes the number of included resources + specified in a set."; + } + + identity path-metric-optimize-excludes { + base path-metric-type; + description + "A metric that optimizes to a maximum the number of excluded + resources specified in a set."; + } + + identity path-tiebreaker-type { + description + "Base identity for the path tiebreaker type."; + } + + identity path-tiebreaker-minfill { + base path-tiebreaker-type; + description + "Min-Fill LSP path placement."; + } + + identity path-tiebreaker-maxfill { + base path-tiebreaker-type; + description + "Max-Fill LSP path placement."; + } + + identity path-tiebreaker-random { + base path-tiebreaker-type; + description + "Random LSP path placement."; + } + + identity resource-affinities-type { + description + "Base identity for resource class affinities."; + reference + "RFC 2702: Requirements for Traffic Engineering Over MPLS"; + } + + identity resource-aff-include-all { + base resource-affinities-type; + description + "The set of attribute filters associated with a + tunnel, all of which must be present for a link + to be acceptable."; + reference + "RFC 2702: Requirements for Traffic Engineering Over MPLS + RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity resource-aff-include-any { + base resource-affinities-type; + description + "The set of attribute filters associated with a + tunnel, any of which must be present for a link + to be acceptable."; + reference + "RFC 2702: Requirements for Traffic Engineering Over MPLS + RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity resource-aff-exclude-any { + base resource-affinities-type; + description + "The set of attribute filters associated with a + tunnel, any of which renders a link unacceptable."; + reference + "RFC 2702: Requirements for Traffic Engineering Over MPLS + RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + + identity te-optimization-criterion { + description + "Base identity for the TE optimization criteria."; + reference + "RFC 3272: Overview and Principles of Internet Traffic + Engineering"; + } + + identity not-optimized { + base te-optimization-criterion; + description + "Optimization is not applied."; + } + + identity cost { + base te-optimization-criterion; + description + "Optimized on cost."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity delay { + base te-optimization-criterion; + description + "Optimized on delay."; + reference + "RFC 5541: Encoding of Objective Functions in the Path + Computation Element Communication Protocol (PCEP)"; + } + + identity path-computation-srlg-type { + description + "Base identity for SRLG path computation."; + } + + identity srlg-ignore { + base path-computation-srlg-type; + description + "Ignores SRLGs in the path computation."; + } + + identity srlg-strict { + base path-computation-srlg-type; + description + "Includes a strict SRLG check in the path computation."; + } + + identity srlg-preferred { + base path-computation-srlg-type; + description + "Includes a preferred SRLG check in the path computation."; + } + + identity srlg-weighted { + base path-computation-srlg-type; + description + "Includes a weighted SRLG check in the path computation."; + } + + /** + * TE bandwidth groupings + **/ + + grouping te-bandwidth { + description + "This grouping defines the generic TE bandwidth. + For some known data-plane technologies, specific modeling + structures are specified. The string-encoded 'te-bandwidth' + type is used for unspecified technologies. + The modeling structure can be augmented later for other + technologies."; + container te-bandwidth { + description + "Container that specifies TE bandwidth. The choices + can be augmented for specific data-plane technologies."; + choice technology { + default "generic"; + description + "Data-plane technology type."; + case generic { + leaf generic { + type te-bandwidth; + description + "Bandwidth specified in a generic format."; + } + } + } + } + } + + /** + * TE label groupings + **/ + + grouping te-label { + description + "This grouping defines the generic TE label. + The modeling structure can be augmented for each technology. + For unspecified technologies, 'rt-types:generalized-label' + is used."; + container te-label { + description + "Container that specifies the TE label. The choices can + be augmented for specific data-plane technologies."; + choice technology { + default "generic"; + description + "Data-plane technology type."; + case generic { + leaf generic { + type rt-types:generalized-label; + description + "TE label specified in a generic format."; + } + } + } + leaf direction { + type te-label-direction; + default "forward"; + description + "Label direction."; + } + } + } + + grouping te-topology-identifier { + description + "Augmentation for a TE topology."; + container te-topology-identifier { + description + "TE topology identifier container."; + leaf provider-id { + type te-global-id; + default "0"; + description + "An identifier to uniquely identify a provider. + If omitted, it assumes that the topology provider ID + value = 0 (the default)."; + } + leaf client-id { + type te-global-id; + default "0"; + description + "An identifier to uniquely identify a client. + If omitted, it assumes that the topology client ID + value = 0 (the default)."; + } + leaf topology-id { + type te-topology-id; + default ""; + description + "When the datastore contains several topologies, + 'topology-id' distinguishes between them. If omitted, + the default (empty) string for this leaf is assumed."; + } + } + } + + /** + * TE performance metrics groupings + **/ + + grouping performance-metrics-one-way-delay-loss { + description + "Performance Metrics (PM) information in real time that can + be applicable to links or connections. PM defined in this + grouping are applicable to generic TE PM as well as packet TE + PM."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + leaf one-way-delay { + type uint32 { + range "0..16777215"; + } + description + "One-way delay or latency in microseconds."; + } + leaf one-way-delay-normality { + type te-types:performance-metrics-normality; + description + "One-way delay normality."; + } + } + + grouping performance-metrics-two-way-delay-loss { + description + "PM information in real time that can be applicable to links or + connections. PM defined in this grouping are applicable to + generic TE PM as well as packet TE PM."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + leaf two-way-delay { + type uint32 { + range "0..16777215"; + } + description + "Two-way delay or latency in microseconds."; + } + leaf two-way-delay-normality { + type te-types:performance-metrics-normality; + description + "Two-way delay normality."; + } + } + + grouping performance-metrics-one-way-bandwidth { + description + "PM information in real time that can be applicable to links. + PM defined in this grouping are applicable to generic TE PM + as well as packet TE PM."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + leaf one-way-residual-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Residual bandwidth that subtracts tunnel reservations from + Maximum Bandwidth (or link capacity) (RFC 3630) and + provides an aggregated remainder across QoS classes."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2"; + } + leaf one-way-residual-bandwidth-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Residual bandwidth normality."; + } + leaf one-way-available-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Available bandwidth that is defined to be residual + bandwidth minus the measured bandwidth used for the + actual forwarding of non-RSVP-TE LSP packets. For a + bundled link, available bandwidth is defined to be the + sum of the component link available bandwidths."; + } + leaf one-way-available-bandwidth-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Available bandwidth normality."; + } + leaf one-way-utilized-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Bandwidth utilization that represents the actual + utilization of the link (i.e., as measured in the router). + For a bundled link, bandwidth utilization is defined to + be the sum of the component link bandwidth utilizations."; + } + leaf one-way-utilized-bandwidth-normality { + type te-types:performance-metrics-normality; + default "normal"; + description + "Bandwidth utilization normality."; + } + } + + grouping one-way-performance-metrics { + description + "One-way PM throttle grouping."; + leaf one-way-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "One-way delay or latency in microseconds."; + } + leaf one-way-residual-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Residual bandwidth that subtracts tunnel reservations from + Maximum Bandwidth (or link capacity) (RFC 3630) and + provides an aggregated remainder across QoS classes."; + reference + "RFC 3630: Traffic Engineering (TE) Extensions to OSPF + Version 2"; + } + leaf one-way-available-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Available bandwidth that is defined to be residual + bandwidth minus the measured bandwidth used for the + actual forwarding of non-RSVP-TE LSP packets. For a + bundled link, available bandwidth is defined to be the + sum of the component link available bandwidths."; + } + leaf one-way-utilized-bandwidth { + type rt-types:bandwidth-ieee-float32; + units "bytes per second"; + default "0x0p0"; + description + "Bandwidth utilization that represents the actual + utilization of the link (i.e., as measured in the router). + For a bundled link, bandwidth utilization is defined to + be the sum of the component link bandwidth utilizations."; + } + } + + grouping two-way-performance-metrics { + description + "Two-way PM throttle grouping."; + leaf two-way-delay { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Two-way delay or latency in microseconds."; + } + } + + grouping performance-metrics-thresholds { + description + "Grouping for configurable thresholds for measured + attributes."; + uses one-way-performance-metrics; + uses two-way-performance-metrics; + } + + grouping performance-metrics-attributes { + description + "Contains PM attributes."; + container performance-metrics-one-way { + description + "One-way link performance information in real time."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + uses performance-metrics-one-way-delay-loss; + uses performance-metrics-one-way-bandwidth; + } + container performance-metrics-two-way { + description + "Two-way link performance information in real time."; + reference + "RFC 6374: Packet Loss and Delay Measurement for MPLS + Networks"; + uses performance-metrics-two-way-delay-loss; + } + } + + grouping performance-metrics-throttle-container { + description + "Controls PM throttling."; + container throttle { + must 'suppression-interval >= measure-interval' { + error-message "'suppression-interval' cannot be less than " + + "'measure-interval'."; + description + "Constraint on 'suppression-interval' and + 'measure-interval'."; + } + description + "Link performance information in real time."; + reference + "RFC 7471: OSPF Traffic Engineering (TE) Metric Extensions + RFC 7823: Performance-Based Path Selection for Explicitly + Routed Label Switched Paths (LSPs) Using TE Metric + Extensions + RFC 8570: IS-IS Traffic Engineering (TE) Metric Extensions"; + leaf one-way-delay-offset { + type uint32 { + range "0..16777215"; + } + default "0"; + description + "Offset value to be added to the measured delay value."; + } + leaf measure-interval { + type uint32; + default "30"; + description + "Interval, in seconds, to measure the extended metric + values."; + } + leaf advertisement-interval { + type uint32; + default "0"; + description + "Interval, in seconds, to advertise the extended metric + values."; + } + leaf suppression-interval { + type uint32 { + range "1..max"; + } + default "120"; + description + "Interval, in seconds, to suppress advertisement of the + extended metric values."; + reference + "RFC 8570: IS-IS Traffic Engineering (TE) Metric + Extensions, Section 6"; + } + container threshold-out { + uses performance-metrics-thresholds; + description + "If the measured parameter falls outside an upper bound + for all but the minimum-delay metric (or a lower bound + for the minimum-delay metric only) and the advertised + value is not already outside that bound, an 'anomalous' + announcement (anomalous bit set) will be triggered."; + } + container threshold-in { + uses performance-metrics-thresholds; + description + "If the measured parameter falls inside an upper bound + for all but the minimum-delay metric (or a lower bound + for the minimum-delay metric only) and the advertised + value is not already inside that bound, a 'normal' + announcement (anomalous bit cleared) will be triggered."; + } + container threshold-accelerated-advertisement { + description + "When the difference between the last advertised value and + the current measured value exceeds this threshold, an + 'anomalous' announcement (anomalous bit set) will be + triggered."; + uses performance-metrics-thresholds; + } + } + } + + /** + * TE tunnel generic groupings + **/ + + grouping explicit-route-hop { + description + "The explicit route entry grouping."; + choice type { + description + "The explicit route entry type."; + case numbered-node-hop { + container numbered-node-hop { + leaf node-id { + type te-node-id; + mandatory true; + description + "The identifier of a node in the TE topology."; + } + leaf hop-type { + type te-hop-type; + default "strict"; + description + "Strict or loose hop."; + } + description + "Numbered node route hop."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.3, EXPLICIT_ROUTE in RSVP-TE + RFC 3477: Signalling Unnumbered Links in Resource + ReSerVation Protocol - Traffic Engineering (RSVP-TE)"; + } + } + case numbered-link-hop { + container numbered-link-hop { + leaf link-tp-id { + type te-tp-id; + mandatory true; + description + "TE Link Termination Point (LTP) identifier."; + } + leaf hop-type { + type te-hop-type; + default "strict"; + description + "Strict or loose hop."; + } + leaf direction { + type te-link-direction; + default "outgoing"; + description + "Link route object direction."; + } + description + "Numbered link explicit route hop."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.3, EXPLICIT_ROUTE in RSVP-TE + RFC 3477: Signalling Unnumbered Links in Resource + ReSerVation Protocol - Traffic Engineering (RSVP-TE)"; + } + } + case unnumbered-link-hop { + container unnumbered-link-hop { + leaf link-tp-id { + type te-tp-id; + mandatory true; + description + "TE LTP identifier. The combination of the TE link ID + and the TE node ID is used to identify an unnumbered + TE link."; + } + leaf node-id { + type te-node-id; + mandatory true; + description + "The identifier of a node in the TE topology."; + } + leaf hop-type { + type te-hop-type; + default "strict"; + description + "Strict or loose hop."; + } + leaf direction { + type te-link-direction; + default "outgoing"; + description + "Link route object direction."; + } + description + "Unnumbered link explicit route hop."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels, + Section 4.3, EXPLICIT_ROUTE in RSVP-TE + RFC 3477: Signalling Unnumbered Links in Resource + ReSerVation Protocol - Traffic Engineering (RSVP-TE)"; + } + } + case as-number { + container as-number-hop { + leaf as-number { + type inet:as-number; + mandatory true; + description + "The Autonomous System (AS) number."; + } + leaf hop-type { + type te-hop-type; + default "strict"; + description + "Strict or loose hop."; + } + description + "AS explicit route hop."; + } + } + case label { + container label-hop { + description + "Label hop type."; + uses te-label; + } + description + "The label explicit route hop type."; + } + } + } + + grouping record-route-state { + description + "The Record Route grouping."; + leaf index { + type uint32; + description + "Record Route hop index. The index is used to + identify an entry in the list. The order of entries + is defined by the user without relying on key values."; + } + choice type { + description + "The Record Route entry type."; + case numbered-node-hop { + container numbered-node-hop { + description + "Numbered node route hop container."; + leaf node-id { + type te-node-id; + mandatory true; + description + "The identifier of a node in the TE topology."; + } + leaf-list flags { + type path-attribute-flags; + description + "Path attributes flags."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels + RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP + Tunnels + RFC 4561: Definition of a Record Route Object (RRO) + Node-Id Sub-Object"; + } + } + description + "Numbered node route hop."; + } + case numbered-link-hop { + container numbered-link-hop { + description + "Numbered link route hop container."; + leaf link-tp-id { + type te-tp-id; + mandatory true; + description + "Numbered TE LTP identifier."; + } + leaf-list flags { + type path-attribute-flags; + description + "Path attributes flags."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels + RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP + Tunnels + RFC 4561: Definition of a Record Route Object (RRO) + Node-Id Sub-Object"; + } + } + description + "Numbered link route hop."; + } + case unnumbered-link-hop { + container unnumbered-link-hop { + leaf link-tp-id { + type te-tp-id; + mandatory true; + description + "TE LTP identifier. The combination of the TE link ID + and the TE node ID is used to identify an unnumbered + TE link."; + } + leaf node-id { + type te-node-id; + description + "The identifier of a node in the TE topology."; + } + leaf-list flags { + type path-attribute-flags; + description + "Path attributes flags."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels + RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP + Tunnels + RFC 4561: Definition of a Record Route Object (RRO) + Node-Id Sub-Object"; + } + description + "Unnumbered link Record Route hop."; + reference + "RFC 3477: Signalling Unnumbered Links in Resource + ReSerVation Protocol - Traffic Engineering (RSVP-TE)"; + } + description + "Unnumbered link route hop."; + } + case label { + container label-hop { + description + "Label route hop type."; + uses te-label; + leaf-list flags { + type path-attribute-flags; + description + "Path attributes flags."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels + RFC 4090: Fast Reroute Extensions to RSVP-TE for LSP + Tunnels + RFC 4561: Definition of a Record Route Object (RRO) + Node-Id Sub-Object"; + } + } + description + "The label Record Route entry types."; + } + } + } + + grouping label-restriction-info { + description + "Label set item information."; + leaf restriction { + type enumeration { + enum inclusive { + description + "The label or label range is inclusive."; + } + enum exclusive { + description + "The label or label range is exclusive."; + } + } + default "inclusive"; + description + "Indicates whether the list item is inclusive or exclusive."; + } + leaf index { + type uint32; + description + "The index of the label restriction list entry."; + } + container label-start { + must "(not(../label-end/te-label/direction) and" + + " not(te-label/direction))" + + " or " + + "(../label-end/te-label/direction = te-label/direction)" + + " or " + + "(not(te-label/direction) and" + + " (../label-end/te-label/direction = 'forward'))" + + " or " + + "(not(../label-end/te-label/direction) and" + + " (te-label/direction = 'forward'))" { + error-message "'label-start' and 'label-end' must have the " + + "same direction."; + } + description + "This is the starting label if a label range is specified. + This is the label value if a single label is specified, + in which case the 'label-end' attribute is not set."; + uses te-label; + } + container label-end { + must "(not(../label-start/te-label/direction) and" + + " not(te-label/direction))" + + " or " + + "(../label-start/te-label/direction = te-label/direction)" + + " or " + + "(not(te-label/direction) and" + + " (../label-start/te-label/direction = 'forward'))" + + " or " + + "(not(../label-start/te-label/direction) and" + + " (te-label/direction = 'forward'))" { + error-message "'label-start' and 'label-end' must have the " + + "same direction."; + } + description + "This is the ending label if a label range is specified. + This attribute is not set if a single label is specified."; + uses te-label; + } + container label-step { + description + "The step increment between labels in the label range. + The label start/end values will have to be consistent + with the sign of label step. For example, + 'label-start' < 'label-end' enforces 'label-step' > 0 + 'label-start' > 'label-end' enforces 'label-step' < 0."; + choice technology { + default "generic"; + description + "Data-plane technology type."; + case generic { + leaf generic { + type int32; + default "1"; + description + "Label range step."; + } + } + } + } + leaf range-bitmap { + type yang:hex-string; + description + "When there are gaps between 'label-start' and 'label-end', + this attribute is used to specify the positions + of the used labels. This is represented in big endian as + 'hex-string'. + The most significant byte in the hex-string is the farthest + to the left in the byte sequence. Leading zero bytes in the + configured value may be omitted for brevity. + Each bit position in the 'range-bitmap' 'hex-string' maps + to a label in the range derived from 'label-start'. + + For example, assuming that 'label-start' = 16000 and + 'range-bitmap' = 0x01000001, then: + + - bit position (0) is set, and the corresponding mapped + label from the range is 16000 + (0 * 'label-step') or + 16000 for default 'label-step' = 1. + - bit position (24) is set, and the corresponding mapped + label from the range is 16000 + (24 * 'label-step') or + 16024 for default 'label-step' = 1."; + } + } + + grouping label-set-info { + description + "Grouping for the list of label restrictions specifying what + labels may or may not be used."; + container label-restrictions { + description + "The label restrictions container."; + list label-restriction { + key "index"; + description + "The absence of the label restrictions container implies + that all labels are acceptable; otherwise, only restricted + labels are available."; + reference + "RFC 7579: General Network Element Constraint Encoding + for GMPLS-Controlled Networks"; + uses label-restriction-info; + } + } + } + + grouping optimization-metric-entry { + description + "Optimization metrics configuration grouping."; + leaf metric-type { + type identityref { + base path-metric-type; + } + description + "Identifies the 'metric-type' that the path computation + process uses for optimization."; + } + leaf weight { + type uint8; + default "1"; + description + "TE path metric normalization weight."; + } + container explicit-route-exclude-objects { + when "../metric-type = " + + "'te-types:path-metric-optimize-excludes'"; + description + "Container for the 'exclude route' object list."; + uses path-route-exclude-objects; + } + container explicit-route-include-objects { + when "../metric-type = " + + "'te-types:path-metric-optimize-includes'"; + description + "Container for the 'include route' object list."; + uses path-route-include-objects; + } + } + + grouping common-constraints { + description + "Common constraints grouping that can be set on + a constraint set or directly on the tunnel."; + uses te-bandwidth { + description + "A requested bandwidth to use for path computation."; + } + leaf link-protection { + type identityref { + base link-protection-type; + } + default "te-types:link-protection-unprotected"; + description + "Link protection type required for the links included + in the computed path."; + reference + "RFC 4202: Routing Extensions in Support of + Generalized Multi-Protocol Label Switching (GMPLS)"; + } + leaf setup-priority { + type uint8 { + range "0..7"; + } + default "7"; + description + "TE LSP requested setup priority."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + leaf hold-priority { + type uint8 { + range "0..7"; + } + default "7"; + description + "TE LSP requested hold priority."; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels"; + } + leaf signaling-type { + type identityref { + base path-signaling-type; + } + default "te-types:path-setup-rsvp"; + description + "TE tunnel path signaling type."; + } + } + + grouping tunnel-constraints { + description + "Tunnel constraints grouping that can be set on + a constraint set or directly on the tunnel."; + uses te-topology-identifier; + uses common-constraints; + } + + grouping path-constraints-route-objects { + description + "List of route entries to be included or excluded when + performing the path computation."; + container explicit-route-objects-always { + description + "Container for the 'exclude route' object list."; + list route-object-exclude-always { + key "index"; + ordered-by user; + description + "List of route objects to always exclude from the path + computation."; + leaf index { + type uint32; + description + "Explicit Route Object index. The index is used to + identify an entry in the list. The order of entries + is defined by the user without relying on key values."; + } + uses explicit-route-hop; + } + list route-object-include-exclude { + key "index"; + ordered-by user; + description + "List of route objects to include or exclude in the path + computation."; + leaf explicit-route-usage { + type identityref { + base route-usage-type; + } + default "te-types:route-include-object"; + description + "Indicates whether to include or exclude the + route object. The default is to include it."; + } + leaf index { + type uint32; + description + "Route object include-exclude index. The index is used + to identify an entry in the list. The order of entries + is defined by the user without relying on key values."; + } + uses explicit-route-hop { + augment "type" { + case srlg { + container srlg { + description + "SRLG container."; + leaf srlg { + type uint32; + description + "SRLG value."; + } + } + description + "An SRLG value to be included or excluded."; + } + description + "Augmentation for a generic explicit route for SRLG + exclusion."; + } + } + } + } + } + + grouping path-route-include-objects { + description + "List of route objects to be included when performing + the path computation."; + list route-object-include-object { + key "index"; + ordered-by user; + description + "List of Explicit Route Objects to be included in the + path computation."; + leaf index { + type uint32; + description + "Route object entry index. The index is used to + identify an entry in the list. The order of entries + is defined by the user without relying on key values."; + } + uses explicit-route-hop; + } + } + + grouping path-route-exclude-objects { + description + "List of route objects to be excluded when performing + the path computation."; + list route-object-exclude-object { + key "index"; + ordered-by user; + description + "List of Explicit Route Objects to be excluded in the + path computation."; + leaf index { + type uint32; + description + "Route object entry index. The index is used to + identify an entry in the list. The order of entries + is defined by the user without relying on key values."; + } + uses explicit-route-hop { + augment "type" { + case srlg { + container srlg { + description + "SRLG container."; + leaf srlg { + type uint32; + description + "SRLG value."; + } + } + description + "An SRLG value to be included or excluded."; + } + description + "Augmentation for a generic explicit route for SRLG + exclusion."; + } + } + } + } + + grouping generic-path-metric-bounds { + description + "TE path metric bounds grouping."; + container path-metric-bounds { + description + "TE path metric bounds container."; + list path-metric-bound { + key "metric-type"; + description + "List of TE path metric bounds."; + leaf metric-type { + type identityref { + base path-metric-type; + } + description + "Identifies an entry in the list of 'metric-type' items + bound for the TE path."; + } + leaf upper-bound { + type uint64; + default "0"; + description + "Upper bound on the end-to-end TE path metric. A zero + indicates an unbounded upper limit for the specific + 'metric-type'."; + } + } + } + } + + grouping generic-path-optimization { + description + "TE generic path optimization grouping."; + container optimizations { + description + "The objective function container that includes + attributes to impose when computing a TE path."; + choice algorithm { + description + "Optimizations algorithm."; + case metric { + if-feature "path-optimization-metric"; + /* Optimize by metric */ + list optimization-metric { + key "metric-type"; + description + "TE path metric type."; + uses optimization-metric-entry; + } + /* Tiebreakers */ + container tiebreakers { + description + "Container for the list of tiebreakers."; + list tiebreaker { + key "tiebreaker-type"; + description + "The list of tiebreaker criteria to apply on an + equally favored set of paths, in order to pick + the best."; + leaf tiebreaker-type { + type identityref { + base path-metric-type; + } + description + "Identifies an entry in the list of tiebreakers."; + } + } + } + } + case objective-function { + if-feature "path-optimization-objective-function"; + /* Objective functions */ + container objective-function { + description + "The objective function container that includes + attributes to impose when computing a TE path."; + leaf objective-function-type { + type identityref { + base objective-function-type; + } + default "te-types:of-minimize-cost-path"; + description + "Objective function entry."; + } + } + } + } + } + } + + grouping generic-path-affinities { + description + "Path affinities grouping."; + container path-affinities-values { + description + "Path affinities represented as values."; + list path-affinities-value { + key "usage"; + description + "List of named affinity constraints."; + leaf usage { + type identityref { + base resource-affinities-type; + } + description + "Identifies an entry in the list of value affinity + constraints."; + } + leaf value { + type admin-groups; + default ""; + description + "The affinity value. The default is empty."; + } + } + } + container path-affinity-names { + description + "Path affinities represented as names."; + list path-affinity-name { + key "usage"; + description + "List of named affinity constraints."; + leaf usage { + type identityref { + base resource-affinities-type; + } + description + "Identifies an entry in the list of named affinity + constraints."; + } + list affinity-name { + key "name"; + leaf name { + type string; + description + "Identifies a named affinity entry."; + } + description + "List of named affinities."; + } + } + } + } + + grouping generic-path-srlgs { + description + "Path SRLG grouping."; + container path-srlgs-lists { + description + "Path SRLG properties container."; + list path-srlgs-list { + key "usage"; + description + "List of SRLG values to be included or excluded."; + leaf usage { + type identityref { + base route-usage-type; + } + description + "Identifies an entry in a list of SRLGs to either + include or exclude."; + } + leaf-list values { + type srlg; + description + "List of SRLG values."; + } + } + } + container path-srlgs-names { + description + "Container for the list of named SRLGs."; + list path-srlgs-name { + key "usage"; + description + "List of named SRLGs to be included or excluded."; + leaf usage { + type identityref { + base route-usage-type; + } + description + "Identifies an entry in a list of named SRLGs to either + include or exclude."; + } + leaf-list names { + type string; + description + "List of named SRLGs."; + } + } + } + } + + grouping generic-path-disjointness { + description + "Path disjointness grouping."; + leaf disjointness { + type te-path-disjointness; + description + "The type of resource disjointness. + When configured for a primary path, the disjointness level + applies to all secondary LSPs. When configured for a + secondary path, the disjointness level overrides the level + configured for the primary path."; + } + } + + grouping common-path-constraints-attributes { + description + "Common path constraints configuration grouping."; + uses common-constraints; + uses generic-path-metric-bounds; + uses generic-path-affinities; + uses generic-path-srlgs; + } + + grouping generic-path-constraints { + description + "Global named path constraints configuration grouping."; + container path-constraints { + description + "TE named path constraints container."; + uses common-path-constraints-attributes; + uses generic-path-disjointness; + } + } + + grouping generic-path-properties { + description + "TE generic path properties grouping."; + container path-properties { + config false; + description + "The TE path properties."; + list path-metric { + key "metric-type"; + description + "TE path metric type."; + leaf metric-type { + type identityref { + base path-metric-type; + } + description + "TE path metric type."; + } + leaf accumulative-value { + type uint64; + description + "TE path metric accumulative value."; + } + } + uses generic-path-affinities; + uses generic-path-srlgs; + container path-route-objects { + description + "Container for the list of route objects either returned by + the computation engine or actually used by an LSP."; + list path-route-object { + key "index"; + ordered-by user; + description + "List of route objects either returned by the computation + engine or actually used by an LSP."; + leaf index { + type uint32; + description + "Route object entry index. The index is used to + identify an entry in the list. The order of entries + is defined by the user without relying on key + values."; + } + uses explicit-route-hop; + } + } + } + } +} diff --git a/samples/fake_sample.py b/samples/fake_sample.py new file mode 100644 index 0000000..5887d6a --- /dev/null +++ b/samples/fake_sample.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +"""Examples of api calls +""" + +# for the moment just launch gnpy to check everything is OK + +from gnpy.tools.cli_examples import transmission_main_example + +transmission_main_example() diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..a7556a5 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,68 @@ +[metadata] +name = gnpyapi +description-file = README.md +description-content-type = text/markdown; variant=GFM +author = Telecom Infra Project +author-email = tbd +license = BSD-3-Clause +home-page = https://github.com/Telecominfraproject/oopt-gnpy-api +project_urls = + Bug Tracker = https://github.com/Telecominfraproject/oopt-gnpy-api/issues + Documentation = https://gnpyapi.readthedocs.io/ +python-requires = >=3.8 +classifier = + Development Status :: 5 - Production/Stable + 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.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 + Programming Language :: Python :: Implementation :: CPython + Topic :: Scientific/Engineering + Topic :: Scientific/Engineering :: Physics + Topic :: System :: Networking +keywords = + optics + network + fiber + communication + route + planning + optimization + api + +[pbr] +warnerrors = True + +[files] +packages = gnpyapi + + +[options] +install_requires = + setuptools + gnpy==2.12.0 + flask>=1.1.2 + Flask-Injector + +[options.extras_require] +tests = + build>=1.0.3,<2 + pytest>=7.4.3,<8 + pyang>=2.6.1,<3 + +docs = + alabaster>=0.7.12,<1 + docutils>=0.17.1,<1 + myst-parser>=0.16.1,<1 + Pygments>=2.11.2,<3 + rstcheck + Sphinx>=5.3.0,<6 + sphinxcontrib-bibtex>=2.4.1,<3 diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..e480b87 --- /dev/null +++ b/setup.py @@ -0,0 +1,5 @@ +#!/usr/bin/python3 + +import setuptools + +setuptools.setup(setup_requires=['pbr'], pbr=True) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100755 index 0000000..4265cc3 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +#!/usr/bin/env python diff --git a/tests/test_api.py b/tests/test_api.py new file mode 100644 index 0000000..3ec86de --- /dev/null +++ b/tests/test_api.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# @Author: Esther Le Rouzic +# @Date: 2025-02-03 + +from pathlib import Path +import subprocess +import pytest # noqa: F401 + + +YANG_DIR = Path(__file__).parent.parent / 'gnpyapi' / 'yang' +SAMPLE_DIR = Path(__file__).parent.parent / 'samples' + + +def test_sample(): + """Just for the ci + """ + res = subprocess.run(['python', SAMPLE_DIR / 'fake_sample.py'], + stdout=subprocess.PIPE, check=True) + if res.returncode != 0: + assert False, f'gnpy call failed: exit code {res.returncode}' + + +def test_pyang(): + """Verify that yang models pss pyang + """ + res = subprocess.run(['pyang', '-f', 'tree', '--tree-line-length', '69', + '-p', YANG_DIR, YANG_DIR / 'gnpy-api@2021-01-06.yang'], + stdout=subprocess.PIPE, check=True) + if res.returncode != 0: + assert False, f'pyang failed: exit code {res.returncode}' diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..ad4a014 --- /dev/null +++ b/tox.ini @@ -0,0 +1,44 @@ +[tox] +skipsdist = True + +[testenv] +extras = tests +deps = + cover: pytest-cov + linters: flake8 + linters: pep8-naming + linters: mccabe + linters: flake8-noqa + linters-diff-ci: flake8-html +changedir = {toxinidir} +usedevelop = True +setenv = + cover: CI_COVERAGE_OPTS=--cov=gnpyapi --cov=tests --cov-report= +commands = + pytest {env:CI_COVERAGE_OPTS:} -vv {posargs} + cover: coverage html -d cover + cover: coverage xml -o cover/coverage.xml + python -m build + +[testenv:docs] +extras = docs +allowlist_externals = + /bin/sh +commands = + sphinx-build -E -W --keep-going -q -b html docs/ doc/build/html + /bin/sh -c "rstcheck --ignore-roles cite *.rst" + +[testenv:linters] +commands = + flake8 {posargs} + +[testenv:linters-diff-ci] +allowlist_externals = bash +commands = + flake8 {posargs} --format html --htmldir linters --exit-zero + bash -c "git diff -U0 origin/$(git rev-parse --abbrev-ref HEAD) | flake8 --diff {posargs}" + +[flake8] +max-line-length = 120 +max-complexity = 15 +ignore = N806 W503