Ask Your Question
0

Could not connect physical network device by NETCONF

asked 2016-12-26 23:12:59 -0700

wataru.n gravatar image

updated 2017-01-10 22:08:12 -0700

Hi all,

I want to connect physical network device by NETCONF in OpenDaylight. The physical network device is mx5, and I use the Boron. I refer this URL. http://docs.opendaylight.org/en/stable-boron/user-guide/netconf-user-guide.html

I issued the following API to establish NETCONF connection, and no errors outputed.

curl --user "admin":"admin" -H "Accept: application/xml" -H "Content-type: application/xml" -X POST http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules -d '
<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
  <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">prefix:sal-netconf-connector</type>
  <name>mx5-1</name>
  <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">device address</address>
  <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">22</port>
  <username xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">admin</username>
  <password xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">password</password>
  <yang-module-capabilities xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
    <capability xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">
      urn:ietf:params:xml:ns:yang:ietf-inet-types?module=ietf-inet-types&revision=2010-09-24
    </capability>
  </yang-module-capabilities>
  ...

As long as watching network topology, it seemd to succeed in connection.

curl -u admin:admin -H "Content-Type: application/json" -X GET http://172.26.201.109:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/mx5-1/ -s | python -m json.tool
{
    "node": [
        {
            "netconf-node-topology:available-capabilities": {
                "available-capability": [
                    "http://xml.juniper.net/netconf/junos/1.0",
                    "urn:ietf:params:xml:ns:netconf:capability:candidate:1.0",
                    "urn:ietf:params:netconf:capability:confirmed-commit:1.0",
                    "http://xml.juniper.net/dmi/system/1.0",
                    "urn:ietf:params:netconf:capability:url:1.0?scheme=http,ftp,file",
                    "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:xml:ns:yang:ietf-inet-types?revision=2010-09-24)ietf-inet-types",
                    "urn:ietf:params:xml:ns:netconf:capability:validate:1.0",
                    "urn:ietf:params:netconf:base:1.0"
                ]
            },
            "netconf-node-topology:connection-status": "connected",
            "netconf-node-topology:host": "172.26.218.237",
            "netconf-node-topology:port": 830,
            "netconf-node-topology:unavailable-capabilities": {},
            "node-id": "mx5-1"
        }
    ]
}

But, when I issued the API to get the configulation of the physical network device, an error occuered.

curl -u admin:admin -H "Content-Type: application/json" -X GET http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/mx5-1/yang-ext:mount -s | python -m json.tool
{
    "errors": {
        "error": [
            {
                "error-message": "Request could not be completed because the relevant data model content does not exist ",
                "error-tag": "data-missing",
                "error-type": "application"
            }
        ]
    }
}

Warnings were outputed in log of the OpenDaylight.

2016-12-27 15:18:58,842 | WARN  | oupCloseable-3-2 | NetconfDeviceCommunicator        | 302 - org.opendaylight.netconf.sal-netconf-connector - 1.4.1.Boron-SR1 | RemoteDevice{mx5-1}: Session terminated Session closed
2016-12-27 15:18:58,859 | WARN  | oupCloseable-3-2 | ReadOnlyTx                       | 302 ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-01-10 09:02:21 -0700

giles gravatar image

what capabilities does the device support - i.e. what does it report in its hello? you're side-loading ietf-inet-types there, but that seems to be the only model the device supports (in that there don't seem to be any available or unavailable capabilities).

edit flag offensive delete publish link more

Comments

The device supports 12 capabilities. (For example, urn:ietf:params:netconf:base:1.0 and urn:ietf:params:netconf:capability:candidate:1.0 ...) These capabilities matches the output of network-topology after issuing API to establish netconf connection.

wataru.n ( 2017-01-10 22:11:12 -0700 )edit
Login/Signup to Answer

Stats

Asked: 2016-12-26 23:12:59 -0700

Seen: 117 times

Last updated: Jan 10