NETCONFish: Speaking the network language Leonidas Poulopoulos GRNET NOC TNC2013 Maastricht, Netherlands, 3-6 June 2013 config = “ ” presentation = Presentation(config) presentation.present()
Structure snmpget SNMP.management NETCONF from ncclient import * nxpy=Developing.onTopOf.NETCONF def examples(*args, **kwargs) class Use_Cases(object) return
SNMP.oid Since 1999 v1,v2,v3 Wide deployment Perfect for get, walk BUT snmp-set v1,v2 no security MIB bindings – SNMPv2- SMI::enterprises
SNMP complimentary XML messages SSH v2 Close to device configuration Big “players” support it
ncclient
NETCONF in action HANDSHAKE Get Config Req RESPONSE Connect
ncclient get_config() ncclient – Python NETCONF client Connect RESPONSE Get Config Req
NETCONF
ncclient edit_config()
Was that XML??? NETCONF – XML knowledge – Careful very be syntax errors with GET – XML parsing EDIT/SET – XML building Often, no reusable source code Susceptible to errors TIME TIME TIME
From “Other issues I faced appear to be due to my lack of understanding of the Python XML library I was using. Handling of namespaces in tags was the problem.”
That’s what we want Python ONLY! Reusable Open Source Extendable Focus on app dev Ultimate goal: Translate from XML to Python and vice-versa NO XML
Network XML Python Proxy nxpy Open source Used in: – Firewall on Demand ( – GRNET pilot AutoBAHN TP
nxpy Developer’s Shelter
Features Juniper configuration parts – Interfaces Units – Vlans – Routing Options Flow XML, JSON export Reconciliation made easy Extends easily
App Info Flow
Under the hood Getters Setters XML – Parsing – Building Write ONCE Use FOREVER
Source code snapshot
Diff
AddSomeComplexity.now() FlowSpec rule Block Attack
Isn’t that FoD??
AutoBAHN TP
from future import features Parse device configuration schema – Juniper 12.1R5.5 ~ 18MB Generate Python Proxy classes on the fly BGP reconciliation tool – Apply once/day – Check – Alert
All in one place nxpy: ncclient: FoD: Where to find us: GRNET NOC: GRNET:
Questions ?
THANK YOU Leonidas Poulopoulos GRNET NOC