Network Automation and Abstraction Using Python PR
Network Automation and Abstraction Using Python PR
Network Automation and Abstraction Using Python PR
1. Introduction
The number of devices in a network and their heterogeneous nature is
steadily increasing. The traditional methods used for network equipment
configuration are time consuming, taking into consideration also the vendor
specific know-how needed. The Software Defined Networks (SDN) [1] concept
tries to eliminate the vendor dependency via standard protocols, like OpenFlow
[2]. However, the “traditional” non-SDN legacy networks need to keep the pace
and respond to dynamic network changes. Network automation is a solution for
Operational Expenses OPEX saving, improving not only the time spent for
configuring the network devices, but also the efficiency of network maintenance
through procedures that are easier to follow and implement at large scale.
95 10.1515/macro-2017-0011
Unauthenticated
Download Date | 12/23/17 1:59 AM
96 P. Mihăilă, T. Bălan, R. Curpen, F. Sandu
Unauthenticated
Download Date | 12/23/17 1:59 AM
Network Automation and Abstraction using Python Programming Methods 97
A. Network setup
Unauthenticated
Download Date | 12/23/17 1:59 AM
98 P. Mihăilă, T. Bălan, R. Curpen, F. Sandu
With the help of Netmiko and Paramiko, we have written a script that creates
simultaneously VLANs on those three Layer 3 Switches.
In Figure 3 we can see the script used to create multiple VLANs on a single
switch. We have to specify the IP address configured on the switch, the
username and the password configured for VTY lines and afterwards the
connection via SSH could be done by transmitting those parameters to the
switch using Paramiko library.
When connection is successful, we have to specify the invoke_shell so we
can directly configure the switch via SSH. Afterwards we have created a loop
that creates VLANs from 2 to 10 (VLAN 1 is configured implicitly on every
switch). At the end, we have close SSH connection via ssh_client.close call.
Unauthenticated
Download Date | 12/23/17 1:59 AM
Network Automation and Abstraction using Python Programming Methods 99
Below we present another script using Netmiko that can create VLANs on
a number of switches, available in the topology.
Unauthenticated
Download Date | 12/23/17 1:59 AM
100 P. Mihăilă, T. Bălan, R. Curpen, F. Sandu
The first set of specifications that we have also implemented were addressing
the “Tool Registration, Discovery and Activation” and “Tool Automation
Harness”.
Previously successfully used for chat rooms, XMPP (Extensible Messaging and
Presence Protocol) was proposed by NTAF for network automation, reusing
social networking concepts.
In our implementation, we have used NTAF used OpenFire as XMPP
Server, and Spark as XMPP Client. The network elements were thus
aggregated in a ”social network”, having all the integrated equipment listed in
the Contact List displayed by Spark (see Figure 6). Network elements are
publishing state/availability and capabilities using XMPP.
Furthermore, we are able to send commands to an equipment from a chat
window based on the XMPP-to-SNMP parser that we have implemented.
Unauthenticated
Download Date | 12/23/17 1:59 AM
Network Automation and Abstraction using Python Programming Methods 101
Using NTAF standard via XMPP protocol we have automated different real,
emulated (Cisco Dynapims images) and virtualized resources (Juniper Olive
virtual images). However, the communication method to each device was
unitary and vendor independent, as we are also counting on drivers (plug-ins).
Based on the same driver concept (the concept that was so successful
implemented in the case of Virtual Instrumentation and IVI Standardization –
Interchangeable Virtual Interfaces) there are also programmable methods for
network abstraction using Python.
For our future work we plan to automate the network elements using the
generic driver concept, based on NAPALM. Network Automation and
Programmability Abstraction Layer with Multivendor support [9] is a Python
library that implements a set of functions to interact with different router vendor
devices using a unified API. The heterogeneous vendors are integrated via
drivers, and NAPALM offers support for most of the important vendors.
5. Conclusions
Software controllability is a concept that is spreading also in the area of
networking, driven by the Software Defined Networks innovative
implementations. Configuring and monitoring any device via automation,
independent of vendors is a goal implementable not only on SDN devices, but
also on other networking solutions. In this paper, we have demonstrated the
Unauthenticated
Download Date | 12/23/17 1:59 AM
102 P. Mihăilă, T. Bălan, R. Curpen, F. Sandu
References
1. Software-Defined Networking: The New Norm for Networks. ONF White Paper. April
13, 2012
2. D. F. Macedo, D. Guedes, L. F. M. Vieira, M. A. M. Vieira and M. Nogueira,
"Programmable Networks—From Software-Defined Radio to Software-Defined
Networking," in IEEE Communications Surveys & Tutorials, vol. 17, no. 2, pp. 1102-1125
3. P. Chaignon, K. Lazri, J. Francois and O. Festor, "Understanding disruptive monitoring
capabilities of programmable networks," 2017 IEEE Conference on Network Softwarization
(NetSoft), Bologna, 2017, pp. 1-6.
4. Tischer R., Gooley J.: Programming and Automating Cisco Networks, Cisco Press,
September 9th 2016
5. Cisco ”DevNet” Open Source Dev Center - https://developer.cisco.com/site/opensource/
6. Netmiko, https://pynet.twb-tech.com/blog/automation/netmiko.html
7. Paramiko, http://www.paramiko.org/
8. Network Test Automation Forum, NTAF White Paper. [online] Available: http://
www.ntaforum.org
9. XMPP - Extensible Messaging and Presence Protocol – https://xmpp.org
10. NAPALM (Network Automation and Programmability Abstraction Layer with
Multivendor support) https://napalm.readthedocs.io/en/latest/
11. Edelman J., Lowe S., Oswalt M.: Network Programmability and Automation, O’Reilly
Media, Inc., 2017
12. GNS3 emulator, https://www.gns3.com/
Unauthenticated
Download Date | 12/23/17 1:59 AM
Network Automation and Abstraction using Python Programming Methods 103
Unauthenticated
Download Date | 12/23/17 1:59 AM