wiki:NetconfHackathon

Kea with NETCONF/YANG hackathon

This page has been created to help organize the upcoming IETF 101 Hackathon in London (17-18 March 2018).

ISC did a similar experiment 2 years ago. We managed to get a very basic configuration (one subnet with one pool) configured over netconf. Back then Kea API was pretty basic, so the only thing we could do was to push whole configuration if anything changed. It was rather cumbersome, but worked.

There were significant issues (iirc it failed if second reconfiguration was attempted, no logging configured, no way to configure control channel, so after reconfig Kea was cutting itself off from future updates, etc.) Nevertheless, we managed to provision configuration to Kea using netconf interface.

  1. Hackathon page. Make sure you register! http://ietf.org/how/runningcode/hackathons/101-hackathon/
  2. Summary of the experiment we did 2 years ago: https://www.isc.org/blogs/ietf-hackathon-in-berlin-kea-and-yangnetconf/
  3. The code from that hackathon is here: https://github.com/isc-projects/kea-yang
  4. There is a draft that defines YANG models for DHCP: draft here: https://tools.ietf.org/html/draft-ietf-dhc-dhcpv6-yang-06
  5. That draft has a github page here: https://github.com/dhcwg/yang. Issues may be reported there or send to the DHC mailing list: https://datatracker.ietf.org/wg/dhc/archives/

Hackathon plan

The overall goal is to make Kea configuration changes possible via netconf. We want to at least be able to configure:

  • subnets
  • pools
  • lw4over6 options
  • control channel
  • logging

This is just initial sketch, expect changes!

  1. Review the current state of available tools: netopeer, sysrepo.
  2. Review the current state of the DHCP model.
  3. Review the NETCONF code for Kea. It's 2 years old. A LOT has changed.
  4. Discuss available approaches (plugin, integration with Kea, a separate daemon, etc.)
  5. Architectural discussion, come up with a block design.
  6. Bring up old Kea code to latest version if we decide to reuse it.
  7. Extract the YANG model from the draft and try to load it into netopeer/sysrepo repository.
  8. Start hacking the code!

Initial preparation

  1. Register to hackathon.
  2. Make sure you have as much of the environment set up as possible.
  3. Make sure you have write access to kea-yang repo. Send your github login to Tomek Mrugalski, if needed.
  4. ...

Docker/sysrepo install instructions (thanks to Mislav Novakovic)

# Docker

So for development we use docker (https://www.docker.com/), you can get the official docker images from docker hub with the command:

docker pull sysrepo/sysrepo-netopeer2:latest
docker pull sysrepo/sysrepo-netopeer2:devel

The latest tag is based on the master branche of Sysrepo and it's
dependencies while the devel tag is based on the devel branch.

You can also build them locally with:

wget https://raw.githubusercontent.com/sysrepo/sysrepo/master/deploy/docker/sysrepo-netopeer2/Dockerfile
docker build -t sysrepo/sysrepo-netopeer2:latest -f Dockerfile .

wget https://raw.githubusercontent.com/sysrepo/sysrepo/master/deploy/docker/sysrepo-netopeer2/Dockerfile.devel
docker build -t sysrepo/sysrepo-netopeer2:devel -f Dockerfile.devel .

I would recommend using the latest tag/master branch.

The dockerfiles can be used as instructions for installing Sysrepo on
a host machine.

You have dockerfiles for other platforms also:
https://github.com/sysrepo/sysrepo/tree/master/deploy/docker/sysrepo-netopeer2/platforms



# Documentation
The official Sysrepo documentation is at:
http://www.sysrepo.org/static/doc/html/xp_page.html

The most important part is the path addressing (XPath), it's explained
at: http://www.sysrepo.org/static/doc/html/xp_page.html

A good start would be to read:
http://www.sysrepo.org/static/doc/html/start_page.html



# Examples
A good start are the official Sysrepo examples:
https://github.com/sysrepo/sysrepo/tree/master/examples

There are two plugin examples at:
https://github.com/sysrepo/sysrepo/tree/master/examples/plugins

For configuration data parsing you can take a look at:
https://github.com/sysrepo/sysrepo/blob/master/examples/application_changes_example.c

And for operational data handling:
https://github.com/sysrepo/sysrepo/blob/master/examples/oper_data_example.c



# C++ bindings
The C++ bindings require C++11, an example can be found at:
https://github.com/sysrepo/sysrepo/blob/master/swig/cpp/examples/cpp_application_changes_example.cpp

The C++ bindings are primarily used for other SWIG bindings so that
constrained some design choices but they handle the Sysrepo cleanup
behind the scenes.

For building Sysrepo C++ bindings use the cmake command "cmake
-DGEN_LANGUAGE_BINDINGS=ON -DGEN_CPP_BINDINGS=ON
-DGEN_PYTHON_BINDINGS=OFF ..".
Last modified 4 months ago Last modified on Mar 17, 2018, 9:40:59 AM