cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2090
Views
35
Helpful
14
Replies

Adding capability "with-defaults" in Netconf NED ?

erox
Level 1
Level 1

Hi everyone,

 

I generated a Netconf NED for Nokia SR-OS device but when doing a sync-from I met some issues with default values. I would like to understand how can I add the capability "with-defaults" to the Netconf request from the NED ?

I understood in the documentation that I should add these lines in the java code:

 

NedCapability capas[] = new NedCapability[2];
capas[0] = new NedCapability(
"",
"urn:ios",
"tailf-ned-cisco-ios",
"",
"2015-01-01",
"");
capas[1] = new NedCapability(
"urn:ietf:params:netconf:capability:" +
"with-defaults:1.0?basic-mode=trim", // Set mode to trim
"urn:ietf:params:netconf:capability:" +
"with-defaults:1.0",
"",
"",
"",
"");

 

But I have to admit that I do not understand where should I add these lines as there is no java code in the netconf NED generated...

 

Anyone knows how to indicate to the Netconf NED to ask for default-values ?

 

Thank you for your help

1 Accepted Solution

Accepted Solutions

Hi @erox 

NSO communicates with NETCONF devices using the configured basic mode of the device's with-defaults capability.  There is no option to specify a different basic mode for the sync-from operation.  Using the output from a previous posting in this thread on the 21.10.r4 SROS device as an example:

urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=explicit&also-supported=report-all 

NSO will perform a sync-from with this device using the basic-mode of explicit.  If you would like to change to use the report-all mode instead that is also supported by the device, you will need to configure the device to use report-all as the basic mode.  NSO will then learn of the change of basic mode on the device through the capability exchange during the sync-from operation.

 

View solution in original post

14 Replies 14

Alexander Stevenson
Cisco Employee
Cisco Employee

 

Hi @erox,

 

For more info, please see:

 

With-defaults capability for NETCONF draft-ietf-netconf-with-defaults-14 document, section YANG Module for the <with-defaults> Parameter, beginning on page 13.

 

Hope this helps!

 

 

Hi Alexstev,

 

I know this RFC is supported both by Nokia SR-OS and NSO. My question is how to tell the Netconf NED to ask for the configuration with the parameter with-defaults. It seems to be not documented so I opened a case on this topic. I will update the post with the answer when I will receive one.

RedLineUA
Level 1
Level 1

Hi @erox ,

We are facing the same issue.. Wondering if you had any headway with this?

Thanks,
Alex

Hi RedLineUA,

Are you facing the same issue with Nokia SR-OS or another vendor ?

What I can share is that our ticket is still open and the BU was contacted for a feature request in order to be able to request a get-config with default parameter set to report-all.

With Nokia, the behaviour depends on the mode you have set: mixed mode, md-cli ou classic cli. You will find the behaviour in the documentation (but mixed mode is not the correct mode to work with if you want to interact with NSO).

Hello,

I had face similar issue with Huawei and BU developed a generic NED that's able to handle the with-defaults and some other behaviours with device that had some strange behaviour.

RedLineUA
Level 1
Level 1

Hi @erox 

Appreciate your reply!!

Geeze, so NED can not be "configured" to use this capability? This is a new feature? Wow...

Yes, we face issues with Nokia SROS as well.

We are running NSO 5.7.5 with in-house compiled NED for 21.10.r4 SROS. All devices are actually in mixed mode. I have not had a change to dig deep into the issue yet, but it looks like "with-defaults" capability is advertised correctly from SROS device since NED is registering it:

alex@ncs# devices device nokia_1 capability ?
Possible completions:
  :candidate:1.0                                                                                      
  :confirmed-commit:1.1                                                                               
  :rollback-on-error:1.0                                                                              
  :startup:1.0                                                                                        
  :url:1.0                                                                                            
  :validate:1.0                                                                                       
  :validate:1.1                                                                                       
  urn:ietf:params:netconf:capability:interleave:1.0                                                   
  urn:ietf:params:netconf:capability:notification:1.0                                                 
  urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=explicit&also-supported=report-all  
  urn:ietf:params:netconf:capability:yang-library:1.0?revision=2016-06-21&module-set-id=21.10.R4      
  urn:ietf:params:xml:ns:netconf:base:1.0


Could you please elaborate a bit on why mixed is not good for this? It is not meant to support "report-all"?

According to the documentation:

https://documentation.nokia.com/cgi-bin/dbaccessfilename.cgi/3HE15829AAADTQZZA01_V1_7450%20ESS%207750%20SR%207950%20XRS%20and%20VSR%20System%20Management%20Guide%2020.10.R1.pdf  (page 114)

 

In model-driven configuration mode, SR OS operates with 'explicit' default handling. Users can set a leaf to the same value as the default and SR OS remembers that it was explicitly set and displays it as part of the configuration. This is similar to what RFC 6243 refers to as 'explicit' mode.

 

In the classic configuration mode, the default handling is similar to RFC 6243 'trim' mode. Configuration values are not reported if they are equal to the default value, even if the user explicitly configured the value.

 

In mixed configuration mode, the system uses 'explicit' default handling but it is not persistent. Explicitly configured default values are lost or forgotten at a Highavailability CPM switchover or a reboot. Nokia does not recommend setting any leaf explicitly to its default value in mixed configuration mode (the leaf should be deleted instead).

As it is stated mixed mode makes the default value non persistent... Therefore it is not usable. The only way to use it would be to make a report-all but I have some doubt on the performance if you need to do a get-config report-all (the configuration received is a full config with info-detail, there is a lot of lines to process...)

Thank you @erox for taking time to explain this. I guess we will have to stick to not referring to default values/objects in our configs for now, as we are not ready for just model-driven configuration mode. Will chat with Nokia as well and see if this can behavior might be adjusted.

waitai@cisco.com
Cisco Employee
Cisco Employee

Hi @erox 

When you build a NETCONF NED, such as using NSO's NETCONF NED Builder, the support of the "with-defaults" capability is automatically enabled in NSO.  NSO will discover the configured basic mode of the with-defaults capability as advertised by the NETCONF server device during the hello message exchange and behave accordingly.  The Java code fragments that you have referenced only applies to generic NEDs.  With standard NETCONF NEDs, no Java coding is involved.

After the sync-from operation is performed by NSO, you can check the with-defaults capability on the NETCONF device as follows:

admin@ncs# devices device test1a capability [tab]
Possible completions:
:candidate:1.0
:confirmed-commit:1.0
:confirmed-commit:1.1
:rollback-on-error:1.0
:validate:1.0
:validate:1.1
:xpath:1.0
...
 urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=trim&also-supported=report-all-tagged,report-all
...

Hey waitai@cisco.com while we can see this capability advertised from the device in NSO, how to issue a sync-from that requests `with-defaults` from the device?

Hi @RedLineUA 

To issue a sync-from through ncs_cli, you can do the following:

admin@ncs# devices device [device-name] sync-from

Hi waitai@cisco.com 

Thank you for your answer. I can see the capability is supported but what I want to achieve is to make a sync-from with the 'with-default' parameter. I did not find any answer in the documentation or anywhere else.

When I do a sync-from, it will just do a <get-config> request without any additionnal parameter and I don't find the way to force the get-config request to be done with the 'with-default' parameter.


I think @RedLineUA have the same question

Hi @erox 

NSO communicates with NETCONF devices using the configured basic mode of the device's with-defaults capability.  There is no option to specify a different basic mode for the sync-from operation.  Using the output from a previous posting in this thread on the 21.10.r4 SROS device as an example:

urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=explicit&also-supported=report-all 

NSO will perform a sync-from with this device using the basic-mode of explicit.  If you would like to change to use the report-all mode instead that is also supported by the device, you will need to configure the device to use report-all as the basic mode.  NSO will then learn of the change of basic mode on the device through the capability exchange during the sync-from operation.

 

Thank you waitai@cisco.com. Your answer is clear.

It confirms that we need to ask for a feature request to the BU if we want to do this.