[CONTROLLER-1220] NETCONF messages sent by OpenDaylight cannot be parsed by Cisco routers Created: 20/Mar/15  Updated: 25/Jul/23  Resolved: 23/Mar/15

Status: Resolved
Project: controller
Component/s: netconf
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Gwenael Lambrouin Assignee: Gwenael Lambrouin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 2878

 Description   

Cisco routers expect that NETCONF messages are prefixed by the XML declaration:

<?xml version="1.0" encoding="UTF-8"?>

Else, they close the NETCONF/SSH connection and log an error such as:

NETCONF-ERROR: parse error before hello seen

NETCONF messages sent by the OpenDaylight controller (eg the <hello> message) are not prefixed with that XML declaration. Consequently, Cisco routers reject them and close the NETCONF/SSH connection.

This has been observed with the follwoing Cisco equipments and IOS versions:

  • CSR1000V (virtual routeur) with IOS 15.4(1)S
  • ASR1001-X with IOS 15.4(2)S0a
  • ISR2900 with IOS 15.1(4)M1

A test program that can be used to reproduce the problem with a Cisco router can be found in the related bug report: https://bugs.opendaylight.org/show_bug.cgi?id=2877.

Whether the NETCONF RFC mandates the presence of the XML declaration is unclear to me. So I don't know if this is a bug in OpenDaylight or a bug in Cisco routers.

I will propose a patch to fix/workaround the problem in OpenDaylight.



 Comments   
Comment by Maros Marsalek [ 20/Mar/15 ]

This could be easily changed in ThreadLocalTransformers class setting the OMIT_XML_DECLARATION attribute to no. However, we need to be sure this will not break compatibility with other Netconf devices after the xml declaration is added.

Looking into RFC 6241:

A NETCONF message MAY begin with an XML declaration (see Section 2.8
of [W3C.REC-xml-20001006]).

Id say that the xml declaration should not be required.

Comment by Gwenael Lambrouin [ 20/Mar/15 ]

Thanks for your clarification with your pointer to RFC 6241.

The code modification you suggest effectively fixes this particular issue with Cisco routers.

I submitted a patch for review here:
https://git.opendaylight.org/gerrit/#/c/16919/

Comment by Maros Marsalek [ 20/Mar/15 ]

Changed stat to waiting for review since the patch is available.

I will try to just manually test(next week) this just to make sure we do not break inter-operability with something else with this.

Comment by Maros Marsalek [ 23/Mar/15 ]

Please take bugs if you work on them (so we can keep track of the bugs). I assigned it to you for you this time. Thanks

Comment by Maros Marsalek [ 23/Mar/15 ]

Change has been merged into master.

Generated at Wed Feb 07 19:54:59 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.