netopeer2 icon indicating copy to clipboard operation
netopeer2 copied to clipboard

After giving close-session RPC showing as Already connected when trying to connect again.

Open sowmi18 opened this issue 3 years ago • 6 comments

Hi @michalvasko,

I connected to a netconf session and when i gave close-session RPC, i got (netconf-session-end) in the server side. But when i try to connect to the server again it shows ** Already connected to 192.168.1.10]**. If i give disconnect command, i can able to connect again without any problem. Also what is the difference between close-session RPC and disconnect cli command.

connect --ssh --host 192.168.1.10 --login operator

Interactive SSH Authentication
Type your password:
Password: 
> subscribe
OK
> user-rpc
<close-session` xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"></close-session>

OK
> 
nc ERROR: SSH channel unexpected EOF.
> 
> connect --ssh --host 192.168.1.10 --login operator
cmd_connect: Already connected to 192.168.1.10.`

sowmi18 avatar Jul 23 '22 08:07 sowmi18

Of course, if you are sending close-session by the user-rpc command, the CLI will not detect it and think that you are still connected. The only difference to using disconnect is that this command is known to CLI and it knows it terminates the NETCONF session so just use that. The CLI is far from perfect and is generally meant for testing purposes.

michalvasko avatar Jul 25 '22 08:07 michalvasko

got it.Thank you for clarifying!

sowmi18 avatar Jul 25 '22 08:07 sowmi18

Hi @michalvasko,

If i give subscribe command in CLI, notifications are coming. But if i give the RPC for subscribe, notifications are not coming. Is this the expected one? Like the issue i already asked above.

  1. using subscribe CLI command, getting notification
> subscribe --filter-xpath /o-ran-supervision:*
OK
notification (2027-04-14T04:09:52Z)
<supervision-notification xmlns="urn:o-ran:supervision:1.0"/>
  1. Using subscribe RPC not getting notification
<create-subscription xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
    <filter type="subtree">
            <supervision-notification xmlns="urn:o-ran:supervision:1.0"/>
    </filter>
</create-subscription>

sowmi18 avatar Aug 06 '22 09:08 sowmi18

Is this the expected one?

Yes, this is expected. The RPC itself only tells the server to send notifications but the client must be able to asynchronously read them. The CLI is not able to recognize this from your custom RPC so the notifications are coming but the CLI is not reading and printing them.

michalvasko avatar Aug 08 '22 07:08 michalvasko

okay. Is there any way to get the notification in the client side with the Custom RPC?

sowmi18 avatar Aug 09 '22 11:08 sowmi18

Naturally, in a generic libnetconf2-based NETCONF client. But not in netopeer2-cli.

michalvasko avatar Aug 09 '22 11:08 michalvasko