Closed abligh closed 9 years ago
With this patch:
diff --git a/jnc/src/com/tailf/jnc/NetconfSession.java b/jnc/src/com/tailf/jnc/NetconfSession.java
index 0d25abe..60a4124 100644
--- a/jnc/src/com/tailf/jnc/NetconfSession.java
+++ b/jnc/src/com/tailf/jnc/NetconfSession.java
@@ -1559,6 +1559,7 @@ public class NetconfSession {
* side are the base NETCONF capability.
*/
void encode_hello(Transport out) {
+ out.print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
out.print("<hello xmlns=\"" + Capabilities.NS_NETCONF + "\">");
out.print("<capabilities>");
out.println("<capability>" + Capabilities.NETCONF_BASE_CAPABILITY
It will negotiate a hello
.
However, it then dies as follows:
*NetconfSession: reply=
<?xml version="1.0" encoding="UTF-8"?><rpc-reply xmlns="urn:ietf:params:netconf:base:1.0"><rpc-error><error-type>rpc</error-type><error-tag>missing-element</error-tag><error-severity>error</error-severity><error-info><bad-element>xml</bad-element></error-info></rpc-error></rpc-reply>
[Fatal Error] :2:6: The processing instruction target matching "[xX][mM][lL]" is not allowed.
Exception in thread "main" Parse error: parse error: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.tailf.jnc.XMLParser.parse(XMLParser.java:139)
at com.tailf.jnc.XMLParser.parse(XMLParser.java:154)
at com.tailf.jnc.NetconfSession.recv_rpc_reply(NetconfSession.java:1483)
at com.tailf.jnc.NetconfSession.recv_rpc_reply_data(NetconfSession.java:1460)
at com.tailf.jnc.NetconfSession.getConfig(NetconfSession.java:443)
at com.tailf.jnc.NetconfSession.getConfig(NetconfSession.java:433)
at testnetconf.TestNetconf.main(TestNetconf.java:46)
It looks like JNC really neither wants to send or receive <?xml ... ?>
but the Cisco insists on it. Who is right here?
Apparently both JNC and the Cisco are broken.
From RFC 6241 section 3:
A NETCONF message MAY begin with an XML declaration (see Section 2.8 of [W3C.REC-xml-20001006]).
MAY
in RFC terms means this is optional. The Cisco is therefore at fault for requiring it on Netconf commands received. JNC is also at fault in refusing to accept responses containing it.
The Cisco CSR1000v doesn't have a working netconf impl. that can be used. No need to pursue that ...
/klacke
On 16/11/14 23:00, Alex Bligh wrote:
Apparently both JNC and the Cisco are broken.
From RFC 6241 section 3:
A NETCONF message MAY begin with an XML declaration (see Section 2.8 of [W3C.REC-xml-20001006]).
|MAY| in RFC terms means this is optional. The Cisco is therefore at fault for requiring it on Netconf commands received. JNC is also at fault in refusing to accept responses containing it.
— Reply to this email directly or view it on GitHub https://github.com/tail-f-systems/JNC/issues/38#issuecomment-63241659.
Dear @klacke
can you give me the document which describe "The Cisco CSR1000v doesn't have a working netconf impl." Thanks
Don't have such a doc, I just know this. XR has working netconf by now, not IOS.
They have something, but it's not NETCONF, just NETCONFish.
/klacke
On 03/12/14 01:09, t-anh wrote:
Dear @klacke https://github.com/klacke
can you give me the document which describe "The Cisco CSR1000v doesn't have a working netconf impl." Thanks
— Reply to this email directly or view it on GitHub https://github.com/tail-f-systems/JNC/issues/38#issuecomment-65375535.
Now I'm using Cisco CSR 1000v 3.11s, and it support NETCONF.
Hello ,
Can i have the whole list on devices that support NETCONF ?
thank you
2014-12-04 11:10 GMT+01:00 t-anh notifications@github.com:
Now I'm using Cisco CSR 1000v 3.11s, and it support NETCONF.
— Reply to this email directly or view it on GitHub https://github.com/tail-f-systems/JNC/issues/38#issuecomment-65606574.
[image: UBIqube Solutions] http://www.ubiqube.com
Said MALAH / R&D Apprentice Enginner +33 (0)7 53 65 01 75/ sma@ubiqube.com
UBIqube Solutions Office: +33 438 498 364 / Fax: +33 438 498 361 Parc Sud Galaxie 5, rue des Tropiques 38130 Échirolles France www.ubiqube.com
[image: Facebook] http://www.facebook.com/saiid.junior [image: Twitter] http://www.twitter.com/Saiid.juni0r [image: Instagram] http://instagram.com/Said_Malah [image: Skype] http://skype.com/SAID+MALAH
t-anh: I opened this issue precisely because neither Cisco CSR 1000v (3.12) nor JNC appear to follow the Netconf standard:
Apparently both JNC and the Cisco are broken.
From RFC 6241 section 3:
A NETCONF message MAY begin with an XML declaration (see Section 2.8 of [W3C.REC-xml-20001006]).
MAY in RFC terms means this is optional. The Cisco is therefore at fault for requiring it on Netconf commands received. JNC is also at fault in refusing to accept responses containing it.
I agree that the <?xml header should be both sent and received by JNC. Needs to be fixed.
As for the NETCONF impl on CSR 1000v , maybe you know more than me here, but last time I looked it was completely worthless. You're stumbling on the <?xml header, if you were to get pass that, the list of anomalies continues forever. Furthermore, the payload was just CLI commands wrapped in garbled XML. The CSR 1000v NETCONF is probably just there to fill a tickmark in some RFQ.
I'm trying to negotiate a trivial hello with a Cisco CSR1000V. I can do this by manually pasting things to the SSH command line, so I know the router is working.
The cisco is running:
Here's my program:
Debug output looks like this:
What I see on the Cisco with all debugging turned on is:
The line starting:
is the
hello
JNC is sending to the Cisco. It doesn't like it for some reason. Formatted, thehello
that JNC is sending (retrieved from the debug logs and formatted) looks like:If I send the above
hello
(manually via command line ssh usingssh -s 10.10.10.10 netconf
), I get the same error.If, however, I send the following
hello
manually (with an additionalxml version
statement), it appears to connect and I can do other things like list the config.It would thus appear the Cisco is expecting, but not receiving, the
xml version
line.Any ideas?