Subject: Rare project developers
List archive
- From: David Schmitz <>
- To:
- Subject: Re: [rare-dev] netconf
- Date: Fri, 10 Feb 2023 09:55:26 +0100 (CET)
- Authentication-results: postout.lrz.de (amavisd-new); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=lrz.de
Hi,
On Fri, 10 Feb 2023, mc36 wrote:
Date: Fri, 10 Feb 2023 08:02:17 +0100I started a testing branch https://github.com/GEANT/FOD/tree/testing/freertr1
From: mc36 <>
Reply-To:
To: , David Schmitz <>
Subject: Re: [rare-dev] netconf
and well, we arrived to a territory i'm completely unfamiliar with...
tbh i was pretty unsure on what to do here so apologies if it's still not what you need...
so i came up with this: https://github.com/rare-freertr/freeRtr/commit/b4119ef04dd2ab7ef5b6b56ae6a31e371741e9af
now i see the proper (?) namespace in the rpc-reply...
debug userNetconf.doSend:userNetconf.java:439 tx: <?xml version="1.0" encoding="UTF-8"?>
debug userNetconf.doSend:userNetconf.java:439 tx: <rpc-reply message-id="1"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
debug userNetconf.doSend:userNetconf.java:439 tx: <data><config><hostname><sid>
debug userNetconf.doSend:userNetconf.java:439 tx: </sid></hostname>
debug userNetconf.doSend:userNetconf.java:439 tx: <buggy>
debug userNetconf.doSend:userNetconf.java:439 tx: </buggy>
debug userNetconf.doSend:userNetconf.java:439 tx: <no><locale>
debug userNetconf.doSend:userNetconf.java:439 tx: </locale></no>
btw how you start the ncclient library inside fod? just in case, imho it's a thing i need to know for furher testing...:)
for this.
Very rudimentary yet.
Find a)
./vnet_router/rtr/init_env (to be run from top level directory of the
checkout)
for a rudimentary initialization of python packages (in ./venv/)
and basic FoD configuration
+
b)
./vnet_router/rtr/fodtest_netconf_get a script for standalone testing of the get-config query with FoD's code.
Usage of the latter:
./vnet_router/rtr/fodtest_netconf_get NETCONF_HOST NETCONF_PORT NETCONF_USER
NETCONF_PASS
(these command line parameters override the respective values set in FoD config file flowspy/settings.py to allow for more flexible testing)
I still need a bit of time to provide you with my little debug additions to ./venv/lib/python3.8/site-packages/ncclient/transport/session.py etc.
to easier see and understand what is going on.
Best Regards
David
thanks,
cs
On 2/9/23 17:09, David Schmitz wrote:
Hi,
as yangcli now basically is able to understand the get-config results from freertr's
netconf sensor stuff,
I am now trying to test the basic netconf communication (only the RPC communication itself, not the YANG level yet)
with FoD, i.e., actually with the python ncclient library used by FoD.
It seems that ncclient library is a bit strict about xml namespace stuff, specifically regarding the namespace of the <rpc-reply> XML element in the get-config response from freertr:
# request from ncclient/FoD:
<nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:bacdc701-c3f8-422e-93a8-1bf906cad31f"><nc:close-session/></nc:rpc>
# response from freertr:
<rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:bacdc701-c3f8-422e-93a8-1bf906cad31f"><ok></ok></rpc-reply>
On receiving that response, ncclient library's rpc reponse handler is ignoring it,
bause in the python code:
...
if tag != qualify("rpc-reply"):
return
...
the condition matches and aborts from the handler function.
I think that ncclient library expects a response like this:
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:bacdc701-c3f8-422e-93a8-1bf906cad31f"><ok></ok></rpc-reply>
or simply
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:bacdc701-c3f8-422e-93a8-1bf906cad31f"><ok></ok></rpc-reply> .
I.e. the namespace declaration for the "rpc-reply" element is missing.
Best Regards
David
On Mon, 6 Feb 2023, David Schmitz wrote:
Date: Mon, 6 Feb 2023 16:27:56 +0100 (CET)
From: David Schmitz <>
Reply-To:
To:
Subject: Re: [rare-dev] netconf
Hi,
On Sat, 4 Feb 2023, mc36 wrote:
Date: Sat, 4 Feb 2023 10:55:07 +0100Great!
From: mc36 <>
Reply-To:
To: , David Schmitz <>
Subject: Re: [rare-dev] netconf
some more hacking, now it seems better indented in firefox... :)
https://github.com/rare-freertr/freeRtr/commit/db7b32db4c01b76507b16f28590562ce34dbb40d
sid#show running-config interface loopback0 | xml
<config><interface><loopback0>
</loopback0></interface>
<interface><loopback0><description><management>
</management></description>
<vrf><forwarding><v1>
</v1></forwarding></vrf>
<ipv4><address><identifier-value>10.10.10.227
<identifier-value>255.255.255.255
</identifier-value></identifier-value></address></ipv4>
<ipv6><address><identifier-value>2001:db8:1101::227:227
<ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff>
</ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff></identifier-value></address></ipv6>
<template><template1>
</template1></template>
<no><shutdown>
</shutdown></no>
</loopback0></interface></config>
Best Regards
David
sid#
On 2/4/23 09:50, mc36 wrote:
hi,
to ease debugging this, https://github.com/rare-freertr/freeRtr/commit/4d5c20e2bad3f91c119603ae2783942b84d11830 added a new filter to xml-ize the show outputs... :)
br,
cs
sid#show running-config interface loopback0 | xml
<config><interface><loopback0>
</loopback0></interface>
<description><management>
</management></description>
<vrf><forwarding><v1>
</v1></forwarding></vrf>
<ipv4><address><identifier-value>10.10.10.227
<identifier-value>255.255.255.255
</identifier-value></identifier-value></address></ipv4>
<ipv6><address><identifier-value>2001:db8:1101::227:227
<ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff>
</ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff></identifier-value></address></ipv6>
<template><template1>
</template1></template>
<no><shutdown>
</shutdown></no>
<identifier-value>!
</identifier-value>
</config>
sid#show running-config interface loopback0 | setdel
set interface loopback0
set interface loopback0 description management
set interface loopback0 vrf forwarding v1
set interface loopback0 ipv4 address 10.10.10.227 255.255.255.255
set interface loopback0 ipv6 address 2001:db8:1101::227:227 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
set interface loopback0 template template1
delete interface loopback0 shutdown
set interface loopback0 exit
set !
sid#show running-config interface loopback0
interface loopback0
description management
vrf forwarding v1
ipv4 address 10.10.10.227 255.255.255.255
ipv6 address 2001:db8:1101::227:227 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
template template1
no shutdown
exit
!
sid#
On 2/4/23 08:49, mc36 wrote:
hi,
with https://github.com/rare-freertr/freeRtr/commit/aa0bb8a11a6bc4d5bd3f2c228ae36e5f926214f2
now yangcli accepts the config, at least partially... see attached the document i sent it...
br,
cs
yangcli > get-config source=running
Warning: 'data' has no child node 'config'. Using anyxml
Warning: 'data' has no child node 'rpc-reply'. Using anyxml
Warning: 'rpc-reply' has no child node 'rpc-reply'. Using anyxml
mgr_rpc: got invalid reply on session 1 (wrong node depth)
RPC Data Reply 1 for session 399134541:
rpc-reply {
data {
config {
hostname {
netconf
}
buggy
no {
password-encrypt
}
no {
enable
}
banner {
encoded
}
identifier-value !
client {
label-range {
identifier-value 32
}
}
}
rpc-reply
}
rpc-reply
}
yangcli >
On 2/3/23 16:56, mc36 wrote:
hi,
with this https://github.com/rare-freertr/freeRtr/commit/b604046291beb58d3f04079364f859edd2f57fec
i get now a different error message... maybe it's just my config, could you please give it a try?
yangcli > get-config source=running
mgr_top: get node failed (xml reader EOF); session dropped
yangcli>
the latest jar is at src.freertr.org/src/rtr.jar
thx,
cs
On 2/3/23 16:21, David Schmitz wrote:
Hi,
On Fri, 3 Feb 2023, mc36 wrote:
Date: Fri, 3 Feb 2023 16:18:45 +0100"get-config source=running" would be enough.
From: mc36 <>
Reply-To:
To: David Schmitz <>
Cc: "" <>
Subject: [rare-dev] netconf
hi,
i tried to bring up your environment but i found too many missing parts from freerouter netconf...
right now, only these are implemented: https://github.com/rare-freertr/freeRtr/blob/master/src/net/freertr/user/userNetconf.java#L29
this is all what i needed to bring up https://github.com/CiscoDevNet/yang-explorer in a vm and query/configure...
but when you issue sget-config / source=running in yangcli see that it tries to access the /?xml/rpc/get-config/source/running
which is not there yet... so the question is, how you spawn your yangcli and what command do you try to execute there?
"sget-config source=running" is not needed.
Best Regards
David
thx,
cs
--
David Schmitz
Boltzmannstrasse 1, 85748 Garching
Telefon: +49 89 35831-8765
Leibniz-Rechenzentrum, Germany
Mail:
- Re: [rare-dev] netconf, (continued)
- Re: [rare-dev] netconf, mc36, 02/03/2023
- Re: [rare-dev] netconf, mc36, 02/04/2023
- Re: [rare-dev] netconf, mc36, 02/04/2023
- Re: [rare-dev] netconf, mc36, 02/04/2023
- Re: [rare-dev] netconf, David Schmitz, 02/06/2023
- Re: [rare-dev] netconf, Frédéric LOUI, 02/06/2023
- Re: [rare-dev] netconf, David Schmitz, 02/07/2023
- Re: [rare-dev] netconf, mc36, 02/07/2023
- Re: [rare-dev] netconf, David Schmitz, 02/06/2023
- Re: [rare-dev] netconf, David Schmitz, 02/09/2023
- Re: [rare-dev] netconf, mc36, 02/10/2023
- Re: [rare-dev] netconf, David Schmitz, 02/10/2023
- Re: [rare-dev] netconf, mc36, 02/11/2023
- Re: [rare-dev] netconf, David Schmitz, 02/13/2023
- Re: [rare-dev] netconf, mc36, 02/13/2023
- Re: [rare-dev] netconf, mc36, 02/13/2023
- Re: [rare-dev] netconf, David Schmitz, 02/13/2023
- Re: [rare-dev] netconf, mc36, 02/14/2023
- Re: [rare-dev] netconf, David Schmitz, 02/14/2023
- Re: [rare-dev] netconf, mc36, 02/14/2023
- Re: [rare-dev] netconf, David Schmitz, 02/14/2023
- Re: [rare-dev] netconf, mc36, 02/14/2023
- Re: [rare-dev] netconf, mc36, 02/04/2023
- Re: [rare-dev] netconf, mc36, 02/04/2023
- Re: [rare-dev] netconf, mc36, 02/04/2023
- Re: [rare-dev] netconf, mc36, 02/03/2023
Archive powered by MHonArc 2.6.19.