Make Model Driven Network Automation Pythonic

Walther, Dominic and Jovicic, Dejan (2023) Make Model Driven Network Automation Pythonic. Other thesis, OST Ostschweizer Fachhochschule.

[thumbnail of HS 2022 2023-SA-EP-Walther-Jovicic-Make Model-Driven Network Automation Pythonic.pdf] Text
HS 2022 2023-SA-EP-Walther-Jovicic-Make Model-Driven Network Automation Pythonic.pdf - Supplemental Material

Download (1MB)

Abstract

YANG is a data modelling language used to define data structures transmitted over either the NETCONF or RESTCONF protocol. Such models can be used to perform so-called Model Driven Network Automation.

The goal of this project is to create a proof-of-concept to show how YANG models could be translated to Python data-structures based on pydantic. These data-structures can in turn be initialized with configuration values, serialized into a RESTCONF payload and sent to a network device, applying the configuration. If successful, this would facilitate configuring network devices through Python code, without requiring the user to have prior knowledge of YANG.

We started by analysing the Python ecosystem surrounding YANG, including projects such as Pyang, pyangbind, yangson and Pyang-Pydantic, as well as pydantic and datamodel-code-generator. Our analysis revealed that most of the projects in the ecosystem have either been abandoned for years or are nowhere near robust or reliable enough to be used in a productive environment.

After some consideration, we settled on Pyang as our YANG parser and used the Pyang-Pydantic plugin as a starting point for our project. We then proceeded to gradually add features designed to make the generated Python models as intuitive and convenient to work with as possible.

This resulted in the creation of Pydantify, a tool for translating YANG models into executable Python code which can in turn generate valid RESTCONF payloads. On top of validating the concept as feasible, we successfully managed to implement a large section of the YANG specification, enabling some real-world models to be converted without issue.

Item Type: Thesis (Other)
Subjects: Technologies > Programming Languages > Python
Technologies > Network
Metatags > INS (Institute for Networked Solutions)
Divisions: Bachelor of Science FHO in Informatik > Student Research Project
Depositing User: OST Deposit User
Contributors:
Contribution
Name
Email
Thesis advisor
Baumann, Urs
UNSPECIFIED
Date Deposited: 22 Feb 2023 08:33
Last Modified: 22 Feb 2023 08:33
URI: https://eprints.ost.ch/id/eprint/1089

Actions (login required)

View Item
View Item