OcNOS NetConf User Gde
OcNOS NetConf User Gde
Open Compute
Network Operating System
for Service Providers
Version 4.0
This documentation is subject to change without notice. The software described in this document and this documentation
are furnished under a license agreement or nondisclosure agreement. The software and documentation may be used or
copied only in accordance with the terms of the applicable agreement. No part of this publication may be reproduced, stored
in a retrieval system, or transmitted in any form or any means electronic or mechanical, including photocopying and
recording for any purpose other than the purchaser's internal use without the written permission of IP Infusion Inc.
IP Infusion Inc.
3965 Freedom Circle, Suite 200
Santa Clara, CA 95054
+1 408-400-1900
http://www.ipinfusion.com/
Trademarks:
IP Infusion, OcNOS, VirNOS, ZebM, ZebOS, and ZebOS-XP are trademarks or registered trademarks of IP Infusion. All
other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective
owners.
Use of certain software included in this equipment is subject to the IP Infusion, Inc. End User License Agreement at http://
www.ipinfusion.com/license. By using the equipment, you accept the terms of the End User License Agreement.
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Related Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
CHAPTER 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
CHAPTER 2 NetConf Quick Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
NetConf Clients. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9
Install Yangcli . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9
Download Yang files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10
CHAPTER 4 Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Discard Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21
Commit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22
Transaction Limit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23
CHAPTER 5 NetConf Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Retrieve YANG Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25
Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25
Retrieving Schema List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26
Audience
This guide is intended for network administrators and other engineering professionals who configure NetConf.
Conventions
Table P-1 shows the conventions used in this guide.
Convention Description
monospaced type Code elements such as commands, functions, parameters, files, and directories
Related Documents
The following guides are related to this document:
• NetConf Command Reference
Support
For support-related questions, contact [email protected].
Comments
If you have comments, or need to report a problem with the content, contact [email protected].
The NetConf protocol defines a simple mechanism through which a network device can be managed, configuration
data information can be retrieved, and new configuration data can be uploaded.
NetConf uses a simple RPC-based mechanism to communicate between a client and a server. The client can be a
script or application typically running as part of a network manager. The server is usually a network device.
A NetConf session is the logical connection between a network administrator or network configuration application and
a network device. A device must support at least one NetConf session and can support multiple sessions. Global
configuration attributes can be changed during any session and the effects are visible in all sessions. The candidate
and running and startup configuration are shared across all the sessions.
Note: A detailed list of protocol modules supported through NetConf is in the NetConf command reference.
NetConf Clients
The OcNOS NetConf solution is tested using the OpenYuma Yangcli and netopeer CLI applications. In this document,
the OpenYuma Yangcli application is used to demonstrate NetConf operations.
Refer to the standard Yangcli operations at:
https://github.com/OpenClovis/OpenYuma/blob/master/netconf/doc/yuma_docs/openyuma-yangcli- manual.odt
Yang modules for NetConf clients can be downloaded from:
https://github.com/IPInfusion/OcNOS/tree/OcNOS-SP-3.0/yang-files/qumran
Note: The following points are to be considered while using NetConf get-config and get operations.
• To improve the readability of the output, the subtree filter based sget-config and sget operations are used
in this document
• Yangcli's get and get-config operation time out while retrieving large amount of data, To handle this, either
increase the timeout option of Yangcli, or use subtree filters used to limit the data.
• A Yangcli operation can end abruptly while fetching large amount of data. This is purely Yangcli's own
system resource limitation check. To overcome this, use subtree filters or the simple SSH client.
• Yangcli is not parsing float value correctly when the value range is in between 0 to -1.
SSH client usage is explained in Chapter 10, SSH Client.
Install Yangcli
1. Check out the git repository, using the commit e8a7bf3f2b09946880ce014fd756bcd945b0c713.
3. Compile and install Open Yuma components. Refer to the README for more details.
Establish Connection
These are the steps to establish a connection between the NetConf client and the server that is running on the device.
# yangcli server=<ip_address> user=<user_name> password=<password>
ip_address: Address of the device to be managed
user_name & password: User account detail for authentication
The interactive version of this command is shown below:
# yangcli yangcli> connect
grouping bgp-grouping {
list bgp {
description "bgp";
config true; key "bgpAs"; leaf vrId {
mandatory false;
type leafref {
path "/vr/vrId";
}
}
}// END of vrId definition.
…
leaf keepAlive{
mandatory false;
type cml_data_types:CML_UINT16_T {
range "0..65535";
}
default "30";
config true;
} // END of keepAlive definition.
leaf holdTime{
mandatory false;
type cml_data_types:CML_UINT16_T {
range "0..65535";
...
}
default "90";
config true;
} // END of holdTime definition.
OcNOS supports hitless NETCONF merge operation. The hitless feature blocks southbound calls to configure the
provisioned configuration if it was already configured. Because of this feature, errors like “QOS already enabled” are
not reported when you try to enable QoS again/repeatedly. Also, southbound calls are blocked when you try to delete/
unset a non-existing configuration.
Configuration objects are merged while provisioning configuration incrementally (different/same attributes) for the
same object. However this cannot be done for attributes or objects having RANGE (such as VLAN range) and
MULTIPLE values (such as OSPF passive interface address) type attributes, therefore they are treated as different
objects and southbound calls are allowed for every individual object. As per hitless functionality, all these objects are
supposed to be merged, and a single object is expected to be sent southbound to do the configuration/un-
configuration. But there will be duplicate calls southbound as was present in earlier releases. This limitation is planned
to be addressed in upcoming releases.
Note: List of payloads required to configure the switch is documented in NetConf Command Reference guide.
To disable QoS, use edit-config's MERGE operation (default-operation=merge) with the below payload:
<qos>
<qosGlobal>
<state>disable</state>
</qos>
</qosGlobal>
Limitations to Default-operations
1. Only “merge” is supported as default-operation (<default-operation>merge</default-operation).
rpc-reply {
data {
vr {
bgp 100 {
bgpAs 100
holdTime 180
keepAlive 60
}
}
}
}
rpc-reply {
data {
vr {
bgp 100 {
bgpAs 100
holdTime 180
keepAlive 60
}
}
}
}
bgp 100 {
bgpAs 100
holdTime 180
keepAlive 60
routerRunIpAddr 10.12.7.141
ntwkPrefixCount 0
bgpTableVersion 1
}
}
}
}
Error Messages
NetConf operations return protocol, management layer, and protocol module errors. The example below depicts an
error returned by a protocol module.
Copy the content below into bgp_err.xml.
<vr xmlns="http://www.ipinfusion.com/CMLSchema/zebos">
<vrId>0</vrId>
<bgp>
<bgpAs>1</bgpAs>
<keepAlive>300</keepAlive>
<holdTime>200</holdTime>
</bgp>
</vr>
Execute the following command and commit the changes:
yangcli [email protected]> edit-config config=@/root/bgp_err.xml
mgr_rpc: got invalid reply on session 1 (invalid XPath expression syntax) RPC
Error
Reply 13 for session 1:
rpc-reply {
rpc-error {
error-type application
error-tag operation-failed
error-severity error
error-app-tag general-error
error-message '%% BGP is already running, AS is 100'
error-info {
error-number 4294930313
}
}
Warning Messages
NetConf operations return protocol module warnings. The example below depicts a warning returned by a protocol
module.
Copy the content below into bgp_warn.xml
<vr xmlns="http://www.ipinfusion.com/CMLSchema/zebos">
<vrId>0</vrId>
<bgp>
<bgpAs>100</bgpAs>
<bgpPeer>
<peerAddr>5.5.5.5</peerAddr>
<peerKeepAlive>4</peerKeepAlive>
<peerHoldTime>5</peerHoldTime>
<peerAs>300</peerAs>
</bgpPeer>
</bgp>
</vr>
To receive warnings, NetConf client must subscribe to receive notifications.
yangcli [email protected]> create-subscription
Incoming notification:
notification {
eventTime 2017-09-20T14:06:13Z
warning-notification {
warningMsg '% The configured holdtime should be at least 3 times the
keepalive time'
}
}
Note: RFC 6241 is not detail enough on how a NETCONF server can report warnings. Hence ZebM is following this
warning reporting method.
rpc-reply {
rpc-error {
error-type application
error-tag in-use
error-severity error
error-app-tag no-access
error-path /nc:rpc/nc:edit-config/nc:config
error-message 'config locked'
error-info {
error-number 301
}
}
}
NetConf client 1 releases the lock
yangcli [email protected]> unlock target=candidate
RPC OK Reply 2 for session 4:
NetConf client 2 can acquire the lock now, since no other client is holding the lock.
yangcli [email protected]> lock target=candidate
RPC OK Reply 2 for session 5:
rpc-reply {
rpc-error {
error-type protocol
error-tag in-use
error-severity error
error-app-tag no-access
error-message 'config locked'
error-info {
error-number 301
}
}
}
Force unlock
Admin user has provision to forcibly release the lock held by other users on running configuration store. This command
is not supported for candidate and startup configuration stores.
NetConf client 1 locks the running configuration store
yangcli [email protected]> lock target=running
RPC OK Reply 6 for session 6:
Netconf client 2 tries to acquire running configuration store leads to an error.
yangcli [email protected]> lock target=running
RPC Error Reply 21 for session 4:
rpc-reply {
rpc-error {
error-type protocol
error-tag lock-denied
error-severity error
error-app-tag no-access
error-message 'lock denied'
error-info {
session-id 6
error-number 268
}
}
}
NetConf client 2 (network-admin) decides to acquire the lock forcibly.
yangcli [email protected]> force-unlock target=running
Sys-reload
Use this RPC to cold restart the device.
Example:
yangcli [email protected]> sys-reload
Enter boolean value for leaf <save-config>
yangcli [email protected]:sys-reload>
false true
yangcli [email protected]:sys-reload> true
RPC OK Reply 1 for session 4:
Sys-shutdown
Use this RPC to shut down the device.
Example:
OcNOS supports transaction-oriented configuration management. Transactions are created implicitly by edit-
config operations; commit and discard-changes operations close or terminate the transactions. Successive
edit-config operations are placed in the same transaction.
Discard Changes
Discard the transaction or candidate configuration changes.
yangcli [email protected]> sget-config /vr/ospf source=candidate
rpc-reply {
data {
vr 0 {
vrId 0
ospf 20 {
ospfProcessId 20
}
}
}
}
yangcli [email protected]>
yangcli [email protected]>
edit-config config=@/home/ospf_payload.xml
yangcli [email protected]>
rpc-reply {
data {
vr 0 {
vrId 0
ospf 20 {
ospfProcessId 20
}
ospf 25 {
ospfProcessId 25
}
}
}
}
yangcli [email protected]>
yangcli [email protected]>
rpc-reply {
data {
vr 0 {
vrId 0
ospf 20 {
ospfProcessId 20
}
}
}
}
yangcli [email protected]>
Commit
Commit the transaction or candidate configuration changes.
edit-config config=@/home/ospf_payload.xml
rpc-reply {
data {
vr {
ospf 0 {
ospfProcessId 0
ospfShutDown true
}
ospf 500 {
ospfProcessId 500
}
}
}
Transaction Limit
There is a default transaction limit 5000; however user can increase this value.
rpc-reply {
transaction-limit 'Max-Transaction Limit is 6500'
}
OcNOS supports NetConf monitoring to retrieve a schema, which includes module/sub-module and it returns the
requested schema. This can be achieved by <get-schema> operation.
rpc-reply {
data '/*
….
<displays module schema here in this field>
…. '
}
rpc-reply {
data '/*
….
<displays sub-module schema here in this field>
…. '
}
Error Messages
Error is reported, when the requested schema does not exists.
<yangcli [email protected]> get-schema identifier=zeb
rpc-reply {
rpc-error {
error-type protocol
error-tag operation-failed
error-severity error
error-app-tag no-matches
error-path /nc:rpc/ncm:get-schema/ncm:identifier
error-message 'no matches found'
error-info {
error-number 365
}
}
}
rpc-reply {
data {
netconf-state {
schemas {
schema cml_data_types 2017-10-03 ncm:yang {
identifier cml_data_types
version 2017-10-03
format ncm:yang
namespace http://www.ipinfusion.com/CMLSchema/cml_data_types
location NETCONF
}
schema feature_list 2015-10-15 ncm:yang {
identifier feature_list
version 2015-10-15
format ncm:yang
namespace http://ipinfusion.com/ns/feature_list
location NETCONF
}
...
...
OcNOS supports: url capability. The URL capability is identified by the following capability string:
"urn:ietf:params:netconf:capability:url:1.0?scheme=http,ftp,file"
OcNOS supports HTTP, FTP and file schemes under this capability, accordingly following operations are enhanced.
• copy-config
• edit-config
• delete-config
Limitations:
• Copy-config operation with source as URL and target as startup is not supported.
• Operation copy-config with source and target with different URL is not supported.
• Operation copy-config with source as URL and target as running is not supported.
• Operation copy-config with source and target with same URL is not a valid operation.
<copy-config>
Create or replace an entire configuration datastore with the contents of another complete configuration datastore. The
:url capability modifies the <copy-config> operation to accept the <url> element as the value of the <source>
and the <target> parameters. The file that the URL refers to contains the complete datastore, encoded in XML under
the element <config> in the namespace below:
"urn:ietf:params:xml:ns:netconf:base:1.0"
yangcli [email protected]:copy-config> 4
Enter string value for leaf <url>
yangcli [email protected]:copy-config> file://zebConf.xml
RPC OK Reply 9 for session 1:
1: case candidate:
leaf candidate
2: case startup:
leaf startup
3: case url:
leaf url
1: case candidate:
leaf candidate
2: case running:
leaf running
3: case startup:
leaf startup
4: case url:
leaf url
5: case config:
container config
rpc-reply {
rpc-error {
error-type rpc
error-tag operation-failed
error-severity error
error-app-tag libxml2-error
error-path /copy-config
error-message 'xml reader start failed'
error-info {
error-number 212
}
}
}
<edit-config>
The <url> element can appear instead of the <config> parameter, The file that the URL refers to contains the
configuration data hierarchy to be modified, encoded in XML under the element <config> in the namespace below:
"urn:ietf:params:xml:ns:netconf:base:1.0"
rpc-reply {
data {
vr 0 {
vrId 0
ospf 60 {
ospfProcessId 60
}
}
}
}
Here is the example URL with basic authentication.
rpc-reply {
data {
vr 0 {
vrId 0
ospf 60 {
ospfProcessId 60
}
}
}
}
Here is the example URL with basic authentication.
ftp://username:[email protected]/config_file/zebConf.xml
rpc-reply {
data {
vr 0 {
vrId 0
ospf 60 {
ospfProcessId 60
}
}
}
}
rpc-reply {
rpc-error {
error-type rpc
error-tag operation-failed
error-severity error
error-app-tag libxml2-error
error-path /edit-config
error-message 'xml reader start failed'
error-info {
error-number 212
}
}
}
<delete-config>
Delete a configuration store. The <url> element can appear as the <target> parameter.
1: case startup:
leaf startup
2: case url:
leaf url
1: case startup:
leaf startup
2: case url:
leaf url
1: case startup:
leaf startup
2: case url:
leaf url
rpc-reply {
rpc-error {
error-type protocol
error-tag operation-failed
error-severity error
error-app-tag general-error
error-path /nc:rpc/nc:delete-config/nc:target
error-message 'operation failed'
error-info {
bad-value ftp://admin:@10.12.12.91/config_file/zebConf.xml
error-number 274
}
}
}
NETCONF client registers to receiving event notifications from a NETCONF server by creating a subscription. The
NETCONF server begins notifications as events occur within the system if the subscription is successful. These event
notifications will continue to be sent until either the NETCONF session is terminated or the subscription terminates for
some other reason.
There are four types of events supported in NETCONF:
1. netconf-config-change:
2. netconf-capability-change:
3. netconf-session-start:
4. netconf-session-end:
By default the notification will not be received by the client unless the client is not subscribed.
netconf-config-change
This notification is generated when the NETCONF server detects that the <running> or <startup> configuration data
store has been changed by a management session. The notification summarizes the edits performed on the above
mentioned data stores.
Note: Currently this kind of event notification is not supported.
netconf-capability-change
This notification is generated when the NETCONF server detects that the <running> or <startup> configuration data
store has been changed by a management session. The notification summarizes the edits performed on the above
mentioned data stores.
Note: Currently this kind of event notification is not supported.
notification {
eventTime 2017-10-24T12:23:42Z
sysCapabilityChange {
changed-by {
userName root
sessionId 1
remoteHost 127.0.0.1
}
added-capability http://netconfcentral.org/ns/
toaster?module=toaster&revision=2009-11-20
}
}
netconf-session-start
This notification is generated when a NETCONF server detects client session start. Information present in this
notification indicates the identity of the user.
notification {
eventTime 2017-10-24T12:21:37Z
sysSessionStart {
userName root
sessionId 2
remoteHost 127.0.0.1
}
}
netconf-session-end
This notification is generated when a NETCONF server detects client session termination. Information present in this
notification indicates the identity of the user that owned the session, and why the session was terminated.
notification {
eventTime 2017-10-24T12:22:01Z
sysSessionEnd {
userName root
sessionId 2
remoteHost 127.0.0.1
terminationReason closed
}
}
notification {
eventTime 2017-10-24T12:22:23Z
sysSessionEnd {
userName root
sessionId 3
remoteHost 127.0.0.1
killedBy 1
terminationReason killed
}
}
Validate operation is supported only on the candidate configuration. You get a “feature not supported” error for other
scenarios.
Here is the example of successful validation.
yangcli [email protected]> edit-config config=@/root/config.xml default-
operation=merge
Filling container /edit-config/input/target:
RPC OK Reply 3 for session 2:
yangcli [email protected]>
yangcli [email protected]> validate source=candidate
RPC OK Reply 4 for session 2:
All NetConf operations are captured based on the capability. Hence, any operation falling in multiple capabilities are
documented separately.
Note: Capability “base:1.0” supports candidate and running configuration store.
Supported
Capability Operation User Role (Yes/No) Comments
Supported
Capability Operation User Role (Yes/No) Comments
:Startup:1.0 copy-config <target=startup> Engineer, Admin Partial Running to startup copy is supported;
copying from candidate to startup is not
supported.
:url:1.0 URL capability User, Operator, Yes URL to startup is not supported.
Engineer, Admin
A simple SSH connection can also be used as a client application to interact with the NetConf server. Here are the
steps to establish a connection and perform a get operation.
Establish a Connection
ssh -s [email protected] -p 830 netconf
<ospfProcessId>5</ospfProcessId>
<vrfName>default</vrfName>
</ospf>
</vr>
</config>
</edit-config>
</rpc>]]>]]>
- if (obj_is_mandatory(testobj)) {
+ if (testobj->tkerr.mod->langver == NCX_YANG_VERSION10 &&
obj_is_mandatory(testobj)) {
if (augextern) {
log_error("\nError: Mandatory object '%s' not allowed "
"in external augment statement",
diff --git a/netconf/src/ncx/yang_parse.c b/netconf/src/ncx/yang_parse.c
index 3ff2443..d685e18 100644
--- a/netconf/src/ncx/yang_parse.c
+++ b/netconf/src/ncx/yang_parse.c
@@ -236,11 +236,13 @@ static status_t
if (res != NO_ERR) {
retres = res;
} else {
- if (xml_strcmp(TK_CUR_VAL(tkc), YANG_VERSION_STR)) {
+ if(0==xml_strcmp(TK_CUR_VAL(tkc), YANG_VERSION10_STR)) {
+ mod->langver = NCX_YANG_VERSION10;
+ } else if(0==xml_strcmp(TK_CUR_VAL(tkc), YANG_VERSION11_STR)) {
+ mod->langver = NCX_YANG_VERSION11;
+ } else {
retres = ERR_NCX_WRONG_VERSION;
ncx_print_errormsg(tkc, mod, retres);
- } else if (!mod->langver) {
- mod->langver = YANG_VERSION_NUM;
}
}
if (str) {
@@ -1164,6 +1166,7 @@ static status_t
const xmlChar *val;
const char *expstr;
tk_type_t tktyp;
+ xmlChar *str;
status_t res, retres;
boolean done, ver;