Networkforyou
Welcome
To
Network for you
NETCONF & RESTCONF
Email us: 1 of 9 WhatsApp Us : +918143809578
networkforyou4@[Link]
Networkforyou
NETCONF:
• NETCONF (Network Configuration Protocol) is a protocol developed by IETF
(The Internet Engineering Task Force) to “install, manipulate, and delete the
configuration of network devices”.
• NETCONF developed to manage network devices.
• The goal of Network Configuration Protocol is to make network automation
easier.
• NETCONF uses XML for data encoding & Remote Procedure Call (RPC) for
messages.
• Simple Network Management Protocol was also developed by IETF for same
purpose.
• NETCONF & SNMP have many similarities & people referring to NETCONF as
SNMPv4.
• It provides mechanisms to install, manipulate & delete configuration of
network devices.
• YANG describes the data structures exchanged in NETCONF message like
SNMP MIBs.
• NETCONF is based on XML messages exchanged via SSH protocol using TCP
port 830.
• NETCONF is one of key APIs used by SDN Controller on Southbound to control
devices.
• Uses XML-based data encoding for configuration data & protocol messages
with YANG.
• It uses simple RPC-based mechanism to facilitate communication between
client/server.
• RESTCONF provides subset of NETCONF functionality implemented on top of
HTTP/HTTPS.
• Both NETCONF and RESTCONF were developed to manages devices in a
standard way.
Email us: 2 of 9 WhatsApp Us : +918143809578
networkforyou4@[Link]
Networkforyou
• Network devices running a NETCONF agent can be managed through
following list of operations:
Operation Description
<get> Retrieve running configuration and
device state information.
<get-config> Retrieve all or part of a specified
configuration datastore.
<edit-config> The <edit-config> operation loads all
or part of a specified configuration to
the specified target configuration
datastore.
<copy-config> Create or replace an entire
configuration datastore with the
contents of another complete
configuration datastore.
<delete-config> Delete a configuration datastore. The
<running> configuration datastore
cannot be deleted.
<commit> The <commit> operation instructs the
device to implement the configuration
data contained in the candidate
configuration.
<lock> The <lock> operation allows the client
to lock the entire configuration
datastore system of a device.
<unlock> The <unlock> operation is used to
release a configuration lock, previously
obtained with the <lock> operation.
<close-session> Request graceful termination of a
NETCONF session.
Email us: 3 of 9 WhatsApp Us : +918143809578
networkforyou4@[Link]
Networkforyou
<kill-session> Force the termination of a NETCONF
session.
NETCONF Lab:
Email us: 4 of 9 WhatsApp Us : +918143809578
networkforyou4@[Link]
Networkforyou
CSR Router Configuration
Router(config)#hostname CSR
CSR(config)#interface gigabitEthernet 1
CSR(config)#ip address dhcp
CSR(config-if)#no shutdown
CSR(config)#username admin privilege 15 password 123
CSR# clock set [Link] 1 Jan 2019
CSR(config)#netconf-yang
Show Command:
CSR#show platform software yang-management process
CSR#show netconf session
Email us: 5 of 9 WhatsApp Us : +918143809578
networkforyou4@[Link]
Networkforyou
RESTCONF:
• Both NETCONF and RESTCONF were developed to manages devices in a
standard way.
• RESTCONF is another IETF standard implementing some NETCONF
functionality on top.
• RESTCONF is just like a NETCONF which is via HTTP/HTTPS using XML or
JSON messages.
• The RESTCONF API on IOS XE is built from the same models the NETCONF is
using.
• RESTCONF is a protocol that provides RESTful APIs over HTTP to access
configure.
• It maps YANG specification to RESTful interface & uses HTTPS protocol for
transport.
• You can use JSON or XML as data formats & it is protocol which works
similar to REST API.
• RESTCONF is newer than NETCONF but not replacement & It’s more of
lightweight option.
• Network devices running RESTCONF agent can be managed through five
HTTP operations:
RESTCONF NETCONF
GET <get>, <get-config>
POST <edit-config> (operation=”create”)
PUT <edit-config>(operation=”create/replace”)
PATCH <edit-config> (operation=”merge”)
DELETE <edit-config> (operation=”delete”)
Email us: 6 of 9 WhatsApp Us : +918143809578
networkforyou4@[Link]
Networkforyou
Operation Description
GET This method retrieves data and
metadata for a resource. It is
supported for all resource types,
except operation resources.
POST This method creates a data resource or
invokes an operations resource.
PUT This method creates or replaces the
target resource.
PATCH This method partially modifies a
resource (the equivalent of the
NETCONF merge operation).
DELETE This method deletes the target
resource.
Email us: 7 of 9 WhatsApp Us : +918143809578
networkforyou4@[Link]
Networkforyou
RESTCONF Lab:
CSR Router Configuration
Router(config)#hostname CSR
CSR(config)#interface gigabitEthernet 1
CSR(config)#ip address dhcp
CSR(config-if)#no shutdown
CSR(config)#username admin privilege 15 password 123
CSR# clock set [Link] 1 Jan 2019
CSR(config)#ip http server
CSR(config)#ip http secure-server
CSR(config)#ip http authentication local
CSR(config)#restconf
Email us: 8 of 9 WhatsApp Us : +918143809578
networkforyou4@[Link]
Networkforyou
Show Command:
CSR#show platform software yang-management process
Email us: 9 of 9 WhatsApp Us : +918143809578
networkforyou4@[Link]