Skip to main content

Overview

IPRoute2-Sysrepo is a Sysrepo plugin designed to configure Linux networking using NETCONF/YANG. It offers the following advantages:

  • Transactional Configuration: Configuration changes are executed as a bulk sequence of generated iproute2 commands. In the event that one command fails, an automatic rollback process is triggered to revert all previously executed commands.
  • Dependency Resolution: Commands are sorted before execution to ensure that all dependencies are met. For instance, if you create a dummy link and a bridge, and then assign the link to the bridge, IPRoute2-Sysrepo will create the bridge first and delete it last to maintain consistency.
  • Configuration persistence for linux networking using sysrepo data stores.
  • Operational data load and streaming for linux networking.

IPRoute2-sysrepo code is designed as a wrapper around the original IPRoute2 code, with very minimal changes, ensuring compatibility with all versions of IPRoute2. It is committed to staying current with the newest releases of IPRoute2.

Architecture

IPRoute2-Sysrepo consits of the following components:

  • IPRoute2 YANG Modules:
    a YANG representation of IPRoute2 configuration syntax and operational data.

  • cmdgen:
    Responsible applying config changes on IPRoute2 YANG modules as IPRoute2 commands, does following actions:
    1- Subscribes to the YANG modules config change events.
    2- Transalates sysrepo config changes transaction to a set of iproute2 config commands and a set of rollback commands.
    4- Feeds the commands config change command set to IPRoute2 to applied on the linux Kernel and waits for the response.
    5- If one or more config change commands fails, the rollback command set are applied.
    6- Final config transation result is generated and return to sysrepo subscbribers.

  • oper-data:
    Responsible for loading linux IPRoute2 configuraiotn at startup and providing operational data on demand: 1- On application startup, it generates a set of show commands to populate linux sysem running configuration to sysrepo IPRoute2 YANG modules.
    2- Subscribes to the YANG modules operational data pull requests.
    3- Transalates sysrepo operational data pull requests to a set of IPRoute2 show commands.
    4- Feeds the show commands to IPRoute2 and retrives their outputs in JSON format.
    5- Maps the JSON outputs of IPRoute2 to the corresponding IPRoute2 YANG modules and updates sysrepo operational data store with the mapped data.

Below digram illustrates this architecture:

IPRoute2-Sysrepo Architecture