MPLS in SDN Era: прикручивание vMX (16.1r3.10) и Cisco XRv (5.3.0) к Opendaylight (0.5.2-Boron-SR2) , часть 1: Netconf

Part 1: Netconf




I have had install (probably this module is not istalled by default) odl-netconf-topology (in karaf shell: feature:install odl-netconf-topology ) and after restarting of ODL I can see PE-2 adn xrv-P1 nodes at operational datastore too. Also, I`am able to get config portions of these nodes over REST (Postman). I will try again later with latest version of Junos yang from github (for 16.1 junos release).

opendaylight-user@root>feature:list | grep odl-netconf
odl-netconf-all                                  | 1.1.2-Boron-SR2  |                           
odl-netconf-api                                 | 1.1.2-Boron-SR2  | x              
odl-netconf-mapping-api                  | 1.1.2-Boron-SR2  | x               
odl-netconf-util                                 | 1.1.2-Boron-SR2  | x               
odl-netconf-impl                               | 1.1.2-Boron-SR2  | x               
odl-config-netconf-connector           | 1.1.2-Boron-SR2  | x                 
odl-netconf-netty-util                        | 1.1.2-Boron-SR2  | x        
odl-netconf-client                              | 1.1.2-Boron-SR2  | x        
odl-netconf-monitoring                     | 1.1.2-Boron-SR2  | x        
odl-netconf-notifications-api            | 1.1.2-Boron-SR2  | x          
odl-netconf-notifications-impl          | 1.1.2-Boron-SR2  | x        
odl-netconf-ssh                                  | 1.1.2-Boron-SR2  | x        
odl-netconf-tcp                                  | 1.1.2-Boron-SR2  | x        
odl-netconf-mdsal                              | 1.4.2-Boron-SR2  |           
odl-aaa-netconf-plugin                       | 1.1.2-Boron-SR2  | x        
odl-aaa-netconf-plugin-no-cluster      | 1.1.2-Boron-SR2  |           
odl-netconf-connector-all                   | 1.1.2-Boron-SR2  | x        
odl-netconf-connector                        | 1.1.2-Boron-SR2  | x        
odl-netconf-connector-ssh                  | 1.1.2-Boron-SR2  | x        
odl-netconf-topology                          | 1.1.2-Boron-SR2  | x         
odl-netconf-clustered-topology          | 1.1.2-Boron-SR2  |           
odl-netconf-console                            | 1.1.2-Boron-SR2  |           
opendaylight-user@root>


2. Put it to cache/schema as configuration@2014-11-13.yang

3. Restart ODL

4. Use POSTMAN to add NetconfDevice via REST:

Junos does not list his capabilities in hello message, so add it manually:
Put node to config datastore: 

<node xmlns="urn:TBD:params:xml:ns:yang:network-topology">
   <node-id>PE-2</node-id>
   <host xmlns="urn:opendaylight:netconf-node-topology">172.16.16.2</host>
   <port xmlns="urn:opendaylight:netconf-node-topology">830</port>
   <username xmlns="urn:opendaylight:netconf-node-topology">root</username>
   <password xmlns="urn:opendaylight:netconf-node-topology">passw0rd</password>
   <tcp-only xmlns="urn:opendaylight:netconf-node-topology">false</tcp-only>
   <keepalive-delay xmlns="urn:opendaylight:netconf-node-topology">0</keepalive-delay>
   <yang-module-capabilities xmlns="urn:opendaylight:netconf-node-topology">
    <capability>http://xml.juniper.net/xnm/1.1/xnm?module=configuration&amp;revision=2014-11-13</capability>
   </yang-module-capabilities>
</node>

XRv lists capabilities in hello, so nothing need:
PUT http://192.168.5.199:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/xrv-P1

<node xmlns="urn:TBD:params:xml:ns:yang:network-topology">
   <node-id>xrv-P4</node-id>
   <host xmlns="urn:opendaylight:netconf-node-topology">172.16.17.4</host>
   <port xmlns="urn:opendaylight:netconf-node-topology">830</port>
   <username xmlns="urn:opendaylight:netconf-node-topology">rmavrichev</username>
   <password xmlns="urn:opendaylight:netconf-node-topology">passw0rd</password>
   <tcp-only xmlns="urn:opendaylight:netconf-node-topology">false</tcp-only>
   <keepalive-delay xmlns="urn:opendaylight:netconf-node-topology">0</keepalive-delay>
</node>



Show config datastore: 

{
  "topology": [
    {
      "topology-id": "topology-netconf",
      "node": [
        {
          "node-id": "xrv-P1",
          "netconf-node-topology:host": "172.16.17.1",
          "netconf-node-topology:password": "passw0rd",
          "netconf-node-topology:username": "rmavrichev",
          "netconf-node-topology:port": 830,
          "netconf-node-topology:tcp-only": false,
          "netconf-node-topology:keepalive-delay": 0
        },
        {
          "node-id": "PE-2",
          "netconf-node-topology:pass-through": {},
          "netconf-node-topology:keepalive-delay": 0,
          "netconf-node-topology:host": "172.16.16.2",
          "netconf-node-topology:password": "passw0rd",
          "netconf-node-topology:username": "root",
          "netconf-node-topology:yang-module-capabilities": {
            "override": false,
            "capability": [
            ]
          },
          "netconf-node-topology:port": 830,
          "netconf-node-topology:tcp-only": false
        }
      ],
      "topology-types": {
        "l3-unicast-igp-topology:l3-unicast-igp-topology": {
          "ospf-topology:ospf": {},
          "isis-topology:isis": {}
        },
        "odl-bgp-topology-types:bgp-linkstate-topology": {},
        "odl-bgp-topology-types:bgp-ipv6-reachability-topology": {},
        "odl-bgp-topology-types:bgp-ipv4-reachability-topology": {},
        "network-topology-pcep:topology-pcep": {},
        "netconf-node-topology:topology-netconf": {},
        "topology-tunnel-pcep:topology-tunnel-pcep": {},
        "topology-tunnel:topology-tunnel": {}
      }
    }
  ]
}

Operational datastore, node PE-2: 

{
  "node": [
    {
      "node-id": "PE-2",
      "netconf-node-topology:available-capabilities": {
        "available-capability": [
          "urn:ietf:params:netconf:capability:confirmed-commit:1.0",
          "urn:ietf:params:netconf:capability:candidate:1.0",
          "urn:ietf:params:xml:ns:netconf:capability:confirmed-commit:1.0",
          "urn:ietf:params:netconf:capability:validate:1.0",
          "urn:ietf:params:xml:ns:netconf:base:1.0",
          "urn:ietf:params:xml:ns:netconf:capability:url:1.0?protocol=http,ftp,file",
          "urn:ietf:params:netconf:base:1.0",
          "urn:ietf:params:xml:ns:netconf:capability:validate:1.0",
          "urn:ietf:params:xml:ns:netconf:capability:candidate:1.0",
          "urn:ietf:params:netconf:capability:url:1.0?scheme=http,ftp,file"
        ]
      },
      "netconf-node-topology:host": "172.16.16.2",
      "netconf-node-topology:unavailable-capabilities": {},
      "netconf-node-topology:connection-status": "connected",
      "netconf-node-topology:port": 830
    }
  ]
}

Operational datastore, node xrv-P1: 
GET http://192.168.5.199:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/xrv-P1

{
  "node": [
    {
      "node-id": "xrv-P1",
      "netconf-node-topology:available-capabilities": {
        "available-capability": [
          "urn:ietf:params:netconf:capability:candidate:1.0",
          "(http://cisco.com/ns/yang/Cisco-IOS-XR-lib-keychain-cfg?revision=2013-07-22)Cisco-IOS-XR-lib-keychain-cfg",
          "(http://cisco.com/ns/yang/Cisco-IOS-XR-rgmgr-oper?revision=2013-07-22)Cisco-IOS-XR-rgmgr-oper-sub1",
-------- cut -------
          "(http://cisco.com/ns/yang/Cisco-IOS-XR-tty-server-oper?revision=2013-07-22)Cisco-IOS-XR-tty-server-oper-sub5"
        ]
      },
      "netconf-node-topology:host": "172.16.17.1",
      "netconf-node-topology:unavailable-capabilities": {},
      "netconf-node-topology:connection-status": "connected",
      "netconf-node-topology:port": 830
    }
  ]
}

Get config portion of PE-2: 


{
  "services": {
    "ssh": {
      "protocol-version": [
        "v2"
      ]
    },
    "netconf": {
      "ssh": {
        "port": 830
      }
    }
  }
}

Get config portion of  xrv-P1
GET http://192.168.5.199:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/xrv-P1/yang-ext:mount/Cisco-IOS-XR-ifmgr-cfg:interface-configurations/interface-configuration/act/Loopback0/ 

{
  "interface-configuration": [
    {
      "interface-name": "Loopback0",
      "active": "act",
      "interface-virtual": [
        null
      ],
      "Cisco-IOS-XR-ipv4-io-cfg:ipv4-network": {
        "addresses": {
          "primary": {
            "address": "172.16.17.1",
            "netmask": "255.255.255.255"
          }
        }
      },
      "description": "GRT-loopback"
    }
  ]
}