Visualization of Network Device connections with Python

In many occasions during network design, network administration or troubleshooting of the network we are dealing with the issues: – How to visualize our network?. Reasons for this can be many, starting from different operating systems of devices, different vendors etc. And because of these and many other reasons that might be obstracles, we can’t represent our network topology using network software.

To avoid manual drawing of the network topology we are showing you example how to use power of Python coding to achieve this goal.

In this Lab example we are providing option to use Excel template file ( 1. Template of devices Next Hopes) where we may populate data needed to visualize our network. This file can be shared between the collegues in the enterprise or telco companies and data can be recorded.

Using those data we are able to implement intermediate Python coding to read those data from excel document, which is created in a format as template and if you follow instruction how to use this format it doesn’t matter how much network devices you enter or how many Next Hopes are per specific device. Code is designed to accept data and translate them in a form of dictionary.

Data in this dictionary data format later might be changed in other formats like List, or to represent their Key data separately and Value data separately as well. In our case we use {Key1:[Value11, Value12, …], Key2:[Value21, Value22, …], …} dictionary form.

What is next used, is Graph representation – connection between devices (called ‘edges’ in the Graph theory). Of course, network devices are ‘vertices’ (nodes or points) regarding Graph theory.

To be able to Visualize network connections between devices we use NetworkX Python package.

Lab code and details can be found in the following document: 1. Visualization of Network Device connections with Python.

Leave a Reply

Your email address will not be published. Required fields are marked *