OpenClovis / OpenYuma

Fork of the defacto standard Yuma project since it went proprietary. Netconf is a management protocol (similar to SNMP) defined in RFC4741.
68 stars 52 forks source link

netconfd returns "invalid protocol framing characters received" for get-config request #28

Open anukulverma opened 8 years ago

anukulverma commented 8 years ago

Hi,

I m trying to use openssh commands to get device configuration.

hello message sent : <?xml version="1.0" encoding="UTF-8"?>

urn:ietf:params:netconf:base:1.1

]]>]]>

get-config payload:

239

<?xml version="1.0" encoding="UTF-8"?> <rpc message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">

Netconfd server (Openyuma) returns following error:

581

<?xml version="1.0" encoding="UTF-8"?> <rpc-reply xmlns:ncx="http://netconfcentral.org/ns/yuma-ncx" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">

transport malformed-message error data-invalid invalid protocol framing characters received 378

hoangle commented 8 years ago
  1. Please make sure netconf-subsytem running over SSH and sshd is listening to port 830: netstat -tulpn | grep :830
  2. Switch to use ncclient to get device running config $pip install ncclient or download from https://github.com/ncclient/ncclient
anukulverma commented 8 years ago

1) With base 1.0 everything works. <?xml version="1.0" encoding="UTF-8"?>

urn:ietf:params:netconf:base:1.0

]]>]]>

<?xml version="1.0" encoding="UTF-8"?> <rpc message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">

]]>]]>

So , not issue with connection or port.

  1. I m using yangcli, ncclient, netopeer -> these r working fine for me. I m trying to develop my own client app for that i m trying with ssh commands.
hoangle commented 8 years ago

Yes, netconf server (OpenYuma) is currently support base:1.0 and cause conflict with your client base:1.1. So, you should get capabilities from server and switch to use appropriate version as same as ncclient.

anukulverma commented 8 years ago

Netconf server is sending both 1.1 & 1.0 to client in hello message,

<?xml version="1.0" encoding="UTF-8"?> <hello xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">

urn:ietf:params:netconf:base:1.0 urn:ietf:params:netconf:base:1.1
hoangle commented 8 years ago

Please turn on debug log (i.e debug4) at netconf server to see a root cause

anukulverma commented 8 years ago

Server debug log:

ses_accept_input on session 5 ses read OK (173) on session 5 ses: accept base:1.1 buffer (173):

166

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

ses: invalid base:1;1 framing (inbetween: expect newline) agt_ncxserver: input failed for session 5 (invalid protocol framing characters received) ses_msg send 1.1 buff:591 lity

581

<?xml version="1.0" encoding="UTF-8"?> <rpc-reply xmlns:ncx="http://netconfcentral.org/ns/yuma-ncx" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">

transport malformed-message error data-invalid invalid protocol framing characters received 378

agt_sys: generating notification Queing notification to send (id: 11) Event Payload: sys:userName root sys:sessionId 5 sys:remoteHost 10.12.23.28 sys:terminationReason other Session 5 closed

hoangle commented 8 years ago

ses: invalid base:1;1 framing (inbetween: expect newline) agt_ncxserver: input failed for session 5 (invalid protocol framing characters received) ses_msg send 1.1 buff:591 Does LF encode as '\n' (wiki: https://tools.ietf.org/html/rfc6242#section-4.2)

anukulverma commented 8 years ago

I saw this and copied payload from RFC only. Can u please send me the payload, if i m doing something wrong, i will compare and correct.

hoangle commented 8 years ago

I think you have to follow an payload format: \n#\n ...\n ...\n ...\n \n##\n

anukulverma commented 8 years ago

I have tried this also.

agt_hello: set protocol to base:1.1 Session 11 for root@10.12.23.28 now active (base:1.1) ses_accept_input on session 11 ses read OK (132) on session 11 ses: accept base:1.1 buffer (132): \n#4\n <rpc \n#18\n message-id="102"\n \n#79\n xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">\n \n

ses: invalid base:1;1 framing (inbetween: expect newline) agt_ncxserver: input failed for session 11 (invalid protocol framing characters received) ses_msg send 1.1 buff:591 lity

581

<?xml version="1.0" encoding="UTF-8"?> <rpc-reply xmlns:ncx="http://netconfcentral.org/ns/yuma-ncx" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">

transport malformed-message error data-invalid invalid protocol framing characters received 378

agt_sys: generating notification Queing notification to send (id: 23) Event Payload: sys:userName root sys:sessionId 11 sys:remoteHost 10.12.23.28 sys:terminationReason other Session 11 closed

anukulverma commented 8 years ago

Is it possible for you to help me, to get it working?

hoangle commented 8 years ago

Sorry, what am I suggest is to read carefully at https://tools.ietf.org/html/rfc6242#section-4.2 since I never try this before. Try your best!

hoangle commented 8 years ago

Try this: \n#4\n <rpc \n#18\n message-id="102"\n \n#79\n xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">\n <close-session/>\n </rpc> \n##\n

anukulverma commented 8 years ago

same error

vlutsenko commented 8 months ago

Hello @anukulverma, I understand that issue happened while ago, but would much appreciate if can you share the root cause and how to overcome.