[CONTROLLER-1219] OpenDaylight cannot read NETCONF messages that do not contain a xmlns attribute Created: 20/Mar/15 Updated: 25/Jul/23 Resolved: 30/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 |
||
| Attachments: |
|
| External issue ID: | 2877 |
| Description |
|
When OpenDaylight tries to open a NETCONF session with a Cisco router, OpenDaylight generates an error during the reception of the <hello> message coming from the router: io.netty.handler.codec.DecoderException: java.lang.IllegalStateException: Hello message not received, instead received: <hello> Consequently, the NETCONF session fails to open. This has been observed with the follwoing Cisco equipments and IOS versions:
Attached is a test program that can be used to reproduce the problem with a Cisco router. Some investigations in OpenDaylight NETCONF code show that the failure is due to the lack of xmlns attribute in the <hello> message sent by the router. OpenDaylight expects something like: <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> Whether the NETCONF RFC mandates the presence of the xmlns attribute is unclear to me. So I don't know if this is a bug in OpenDaylight or a bug in Cisco routers. Anyway, it can be fixed (or worked around depending on the point of view) in OpenDaylight, and I will propose a patch to do this. |
| Comments |
| Comment by Gwenael Lambrouin [ 20/Mar/15 ] |
|
Attachment hostname-cisco--2015-03-20.zip has been added with description: Test program to reproduce the problem |
| Comment by Maros Marsalek [ 20/Mar/15 ] |
|
This was discussed in https://ask.opendaylight.org/question/1206/illegalstateexception-on-netconf-hello-message/ There is a pointer to a class in ODL where the hello validation is performed. Reading RFC 6241: Hello message example contains the namespace declaration and the xsd schema for netconf base elements contains the hello element. So Id say hello should contain the namespace, but it would do no harm making the validation less strict in ODL. |
| Comment by Gwenael Lambrouin [ 20/Mar/15 ] |
|
Actually, just removing the namespace test in the method isHelloMessage(Document) of the class https://github.com/opendaylight/controller/blob/master/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/messages/NetconfHelloMessage.java is not enough. If we do this, ODL fails later in the method extractSessionId() of the class https://github.com/opendaylight/controller/blob/master/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiator.java. I found a solution, but it is a bit heavy: add the namespace to hello messages when it is missing. I submitted my patch for review here: |
| 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 |