我一直在尝试使用 Opendaylight Oxigen 的 Restconf 北向接口和 Netconf 南向接口来管理一个设备,该设备连接到一个运行具有多个 yang 数据模型的 Netopeer 的设备。
基本上,我正在关注本教程:
问题是 hello 消息的 yang 功能与使用 Opendaylight 方法获得的功能之间存在差异。
使用 hello 消息(ssh 到运行 netconf 进程的端口):
<hello
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.0</capability>
<capability>urn:ietf:params:netconf:base:1.1</capability>
<capability>urn:ietf:params:netconf:capability:writable-running:1.0</capability>
<capability>urn:ietf:params:netconf:capability:candidate:1.0</capability>
<capability>urn:ietf:params:netconf:capability:rollback-on-error:1.0</capability>
<capability>urn:ietf:params:netconf:capability:validate:1.1</capability>
<capability>urn:ietf:params:netconf:capability:startup:1.0</capability>
<capability>urn:ietf:params:netconf:capability:xpath:1.0</capability>
<capability>urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=explicit&also-supported=report-all,report-all-tagged,trim,explicit</capability>
<capability>urn:ietf:params:netconf:capability:notification:1.0</capability>
<capability>urn:ietf:params:netconf:capability:interleave:1.0</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-yang-metadata?module=ietf-yang-metadata&revision=2016-08-05</capability>
<capability>urn:ietf:params:xml:ns:yang:1?module=yang&revision=2017-02-20</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-inet-types?module=ietf-inet-types&revision=2013-07-15</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-yang-types?module=ietf-yang-types&revision=2013-07-15</capability>
<capability>urn:ietf:params:netconf:capability:yang-library:1.0?revision=2018-01-17&module-set-id=28</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-netconf-acm?module=ietf-netconf-acm&revision=2018-02-14</capability>
<capability>urn:ietf:params:xml:ns:netconf:base:1.0?module=ietf-netconf&revision=2011-06-01&features=writable-running,candidate,rollback-on-error,validate,startup,xpath</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-netconf-notifications?module=ietf-netconf-notifications&revision=2012-02-06</capability>
<capability>urn:ietf:params:xml:ns:netconf:notification:1.0?module=notifications&revision=2008-07-14</capability>
<capability>urn:ietf:params:xml:ns:netmod:notification?module=nc-notifications&revision=2008-07-14</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-x509-cert-to-name?module=ietf-x509-cert-to-name&revision=2014-12-10</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults?module=ietf-netconf-with-defaults&revision=2011-06-01</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?module=ietf-netconf-monitoring&revision=2010-10-04</capability>
<capability>urn:ietf:params:xml:ns:yang:iana-crypt-hash?module=iana-crypt-hash&revision=2014-08-06</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-system?module=ietf-system&revision=2014-08-06&features=authentication,local-users</capability>
<capability>urn:ietf:params:xml:ns:yang:iana-if-type?module=iana-if-type&revision=2014-05-08</capability>
<capability>urn:ieee:std:802.1Q:yang:ieee802-dot1q-types?module=ieee802-dot1q-types&revision=2018-03-07</capability>
<capability>urn:ieee:std:802.1Q:yang:ieee802-dot1q-preemption?module=ieee802-dot1q-preemption&revision=2018-09-10</capability>
<capability>urn:ieee:std:802.1Q:yang:ieee802-dot1q-sched?module=ieee802-dot1q-sched&revision=2018-09-10&features=scheduled-traffic</capability>
<capability>urn:ieee:std:802.1Q:yang:ieee802-types?module=ieee802-types&revision=2018-03-07</capability>
<capability>urn:ieee:std:802.1Q:yang:ieee802-dot1q-bridge?module=ieee802-dot1q-bridge&revision=2018-03-07</capability>
</capabilities>
<session-id>4</session-id></hello>]]>]]>
使用 opendaylight restconf 北向消息:
获取 http://device-ip:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/TSN-Switch/yang-ext:mount/
{
"ietf-netconf-server:netconf-server": {
"listen": {
"endpoint": [
{
"name": "all-interfaces",
"ssh": {
"address": "0.0.0.0",
"port": 830,
"host-keys": {
"host-key": [
{
"name": "imported SSH key",
"public-key": "ssh_host_rsa_key"
}
]
}
}
},
{
"name": "test_tls_listen_endpt",
"tls": {
"address": "0.0.0.0",
"port": 6513,
"client-auth": {
"trusted-ca-certs": "test_trusted_ca_list",
"cert-maps": {
"cert-to-name": [
{
"id": 1,
"map-type": "ietf-x509-cert-to-name:specified",
"name": "test",
"fingerprint": ""
}
]
}
},
"certificates": {
"certificate": [
{
"name": "test_server_cert"
}
]
}
}
}
]
}
},
"ietf-keystore:keystore": {
"private-keys": {
"private-key": [
{
"name": "test_server_key",
"certificate-chains": {
"certificate-chain": [
{
"name": "test_server_cert",
"certificate": [
""
]
}
]
}
},
{
"name": "ssh_host_rsa_key"
}
]
},
"trusted-certificates": [
{
"name": "test_trusted_ca_list",
"trusted-certificate": [
{
"name": "test_ca",
"certificate": ""
}
]
}
]
}
}
如您所见,hello 消息中的功能更多,不包括在 opendaylight 中获得的消息中出现的功能。
此外,我检查了设备的 yang 数据模型存储库,发现以下内容:
- iana-crypt-hash@2014-08-06.yang ieee802-types@2018-03-07.yang
ietf-netconf-monitoring@2010-10-04.yang
ietf-tls-server@2016-11-02.yang iana-if-type@2014-05-08.yang
ietf-datastores@2017-08-17.yang
ietf-netconf-notifications@2012-02-06.yang
ietf-x509-cert-to-name@2014-12 -10.yang ieee802-dot1q-bridge@2018-03-07.yang
ietf-interfaces@2018-02-20.yang
ietf-netconf-server@2016-11-02.yang
ietf-yang-library@2018-01 -17.yang ieee802-dot1q-preemption@2018-09-10.yang
ietf-keystore@2016-10-31.yang
ietf-netconf-with-defaults@2011-06-01.yang 内部 ieee802-dot1q-sched@ 2018-09-10.yang
ietf-netconf@2011-06-01.yang ietf-ssh-server@2016-11-02.yang
nc-notifications@2008-07-14.yang ieee802-dot1q-types@2018-03-07.yang ietf-netconf-acm@2018-02-14.yang ietf-system@2014-08-06.yang
notifications@ 2008-07-14.杨
出现了 hello 消息的模型和 Opendaylight RESTCONF 过程中列出的模型。
ODL的日志是:
2020-11-25T12:42:33,770 | WARN | remote-connector-processing-executor-28 | NetconfDeviceCommunicator | 384 - org.opendaylight.netconf.sal-netconf-connector - 1.7.4 | RemoteDevice{TSN-Switch}: Session terminated Session closed
2020-11-25T12:42:33,774 | WARN | opendaylight-cluster-data-notification-dispatcher-9799 | CallhomeStatusReporter | 400 - org.opendaylight.netconf.callhome-provider - 1.4.4 | No corresponding callhome device found - exiting.
2020-11-25T12:42:33,774 | WARN | opendaylight-cluster-data-notification-dispatcher-9795 | CallhomeStatusReporter | 400 - org.opendaylight.netconf.callhome-provider - 1.4.4 | No corresponding callhome device found - exiting.
2020-11-25T12:42:33,774 | WARN | opendaylight-cluster-data-notification-dispatcher-9794 | CallhomeStatusReporter | 400 - org.opendaylight.netconf.callhome-provider - 1.4.4 | No corresponding callhome device found - exiting.
2020-11-25T12:42:33,776 | WARN | opendaylight-cluster-data-notification-dispatcher-9795 | CallhomeStatusReporter | 400 - org.opendaylight.netconf.callhome-provider - 1.4.4 | No corresponding callhome device found - exiting.
2020-11-25T12:42:33,776 | WARN | opendaylight-cluster-data-notification-dispatcher-9792 | CallhomeStatusReporter | 400 - org.opendaylight.netconf.callhome-provider - 1.4.4 | No corresponding callhome device found - exiting.
2020-11-25T12:42:33,776 | WARN | opendaylight-cluster-data-notification-dispatcher-9796 | CallhomeStatusReporter | 400 - org.opendaylight.netconf.callhome-provider - 1.4.4 | No corresponding callhome device found - exiting.