Abstract Configuration
with NETCONF/YANG
Rabu, 25 April 2018
Lab Telematika
Sekolah Teknik Elektro dan Informatika
Institut Teknologi Bandung
Labtek 8 Lantai 4
4/25/2018
SDN Types
4/25/2018
Hybrid SDN
• NETCONF.
• Abstract the configuration of devices.
• Using YANG Data Model.
4/25/2018
NETCONF
NETCONF is a IETF network management protocol designed specifically for
configuration management
• Makes a distinction between configuration and state data.
• Utilized multiple configuration data stores (candidate, running, startup).
• Configuration change transcations.
• Provides client side configuration validation.
• Uses a client-server model and SSH as transport protocol
4/25/2018
NETCONF
4/25/2018
YANG
4/25/2018
• YANG is a modeling language defined
in RFC 6020.
• Models files are self-documented and
ship with devices
• The goal is to be able to formally model
any network device configuration.
• YANG data models is create by IETF or
OpenConfig and mapped to native
models in each vendors.
YANG
4/25/2018
Main node types :
• Leaf – node with name and value of
certain type (no children)
• Leaf list – sequence of leafs
• Container – groups nodes and has no
value
• List – Sequence of records with key leafs
NETCONF & YANG
DEMO on CSR1000V
4/25/2018
Demo Topology
4/25/2018
Step Demo
4/25/2018
• Enable NETCONF/YANG in CSR1000v
• Get YANG capabilities from CSR1000v
• Get YANG data model from CSR1000v
• Convert YANG data model to python modules
• Create python program to generate JSON files
configuration from modules
• Convert JSON to XML
• Send XML to CSR1000v
• Python Script : http://bit.ly/NETCONF-YANG
Client
# sudo apt install python-pip
# sudo pip install ncclient pyang pyangbind ipython
4/25/2018
Enable NETCONF/YANG
router(config)# username btech
privilege 15 password btech
router(config)# netconf-yang
4/25/2018
Get YANG capabilities
#ptyhon 1.get_capabilities.py {ip-address} {netconf-port}
{username} {password}
4/25/2018
Get YANG models
#ptyhon 2.get_yang.py {ip-address} {netconf-port} {username}
{password} {yang-model}
4/25/2018
4/25/2018
Convert YANG to Python Modules
# export PYBINDPLUGIN=`/usr/bin/env python -c 'import pyangbind; import os; print "%s/plugin" %os.path.dirname(pyangbind.__file__)'`
# echo $PYBINDPLUGIN
# pyang --plugindir $PYBINDPLUGIN -f pybind -o ietf_ip_binding.py ietf-ip.yang ietf-interfaces.yang ietf-inet-types.yang ietf-inet-types.yang
4/25/2018
Create python program
4/25/2018
4/25/2018
Convert JSON to XML
# pyang -f jtox -o interface.jtox ietf-ip.yang ietf-interfaces.yang ietf-inet-types.yang ietf-yang-types.yang
# json2xml -t config -o interface.xml interface.jtox new_interface.json
4/25/2018
Send XML to Device
4/25/2018
t.me/zufardhiyaulhaq
zufar@btech.co.id
4/25/2018

Netconf yang

  • 1.
    Abstract Configuration with NETCONF/YANG Rabu,25 April 2018 Lab Telematika Sekolah Teknik Elektro dan Informatika Institut Teknologi Bandung Labtek 8 Lantai 4 4/25/2018
  • 2.
  • 3.
    Hybrid SDN • NETCONF. •Abstract the configuration of devices. • Using YANG Data Model. 4/25/2018
  • 4.
    NETCONF NETCONF is aIETF network management protocol designed specifically for configuration management • Makes a distinction between configuration and state data. • Utilized multiple configuration data stores (candidate, running, startup). • Configuration change transcations. • Provides client side configuration validation. • Uses a client-server model and SSH as transport protocol 4/25/2018
  • 5.
  • 6.
    YANG 4/25/2018 • YANG isa modeling language defined in RFC 6020. • Models files are self-documented and ship with devices • The goal is to be able to formally model any network device configuration. • YANG data models is create by IETF or OpenConfig and mapped to native models in each vendors.
  • 7.
    YANG 4/25/2018 Main node types: • Leaf – node with name and value of certain type (no children) • Leaf list – sequence of leafs • Container – groups nodes and has no value • List – Sequence of records with key leafs
  • 8.
    NETCONF & YANG DEMOon CSR1000V 4/25/2018
  • 9.
  • 10.
    Step Demo 4/25/2018 • EnableNETCONF/YANG in CSR1000v • Get YANG capabilities from CSR1000v • Get YANG data model from CSR1000v • Convert YANG data model to python modules • Create python program to generate JSON files configuration from modules • Convert JSON to XML • Send XML to CSR1000v • Python Script : http://bit.ly/NETCONF-YANG
  • 11.
    Client # sudo aptinstall python-pip # sudo pip install ncclient pyang pyangbind ipython 4/25/2018
  • 12.
    Enable NETCONF/YANG router(config)# usernamebtech privilege 15 password btech router(config)# netconf-yang 4/25/2018
  • 13.
    Get YANG capabilities #ptyhon1.get_capabilities.py {ip-address} {netconf-port} {username} {password} 4/25/2018
  • 14.
    Get YANG models #ptyhon2.get_yang.py {ip-address} {netconf-port} {username} {password} {yang-model} 4/25/2018
  • 15.
  • 16.
    Convert YANG toPython Modules # export PYBINDPLUGIN=`/usr/bin/env python -c 'import pyangbind; import os; print "%s/plugin" %os.path.dirname(pyangbind.__file__)'` # echo $PYBINDPLUGIN # pyang --plugindir $PYBINDPLUGIN -f pybind -o ietf_ip_binding.py ietf-ip.yang ietf-interfaces.yang ietf-inet-types.yang ietf-inet-types.yang 4/25/2018
  • 17.
  • 18.
  • 19.
    Convert JSON toXML # pyang -f jtox -o interface.jtox ietf-ip.yang ietf-interfaces.yang ietf-inet-types.yang ietf-yang-types.yang # json2xml -t config -o interface.xml interface.jtox new_interface.json 4/25/2018
  • 20.
    Send XML toDevice 4/25/2018
  • 21.