RESTCONF

restconfprotocol-operation how restconf works

RESTCONF Protocol

In this lesson, we will talk about RESTCONF Protocol. We will focus on what is RESTCONF, how does it work, what is the relationship between RESTCONF and NETCONF. Now, let’s start with the first part.

 


What is RESTCONF?

RESTCONF is the abbreviation of Representational State Transfer Configuration Protocol. It is a YANG-based standard network configuration protocol defined in RFC 8040. RESTCONF has some of the NETCONF functionality which is implemented on HTTP or HTTPS.

 

REESCONF uses an interface similar to REST and with this interface it performs Create, Read, Update and Delete operations. It uses HTTP methods familiar to REST operations like GET, POST, DELETE etc. for this purpose.

 

RESTCONF Protocol uses YANG as data modeling language. This model describes the data structure of RESTCONF messages. YANG (Yet Another Next Generation) is similar to XML (Extensible Markup Language). Beside, Representational State Transfer Configuration Protocol support both XML and JSON data formats to exchange data.

 

RESTCONF operates on port 443 and it uses HTTPS for transport.

 

restconfprotocol-operation how restconf works

RESTCONF Operation

 


How Does RESTCONF Work?

Like NETCONF, Representational State Transfer Configuration Protocol is also a server-client based protocol. Again, RESTCONF Server is in a passive role for this operation and RESTCONF Client initiates the sessions. So, how does RESTCONF work?

  • Firstly, clients start the HTTPS connection to the server which is the managed device.

 

  • After a successful connection, this time client requests the route of the RESTCONF API by getting URI (Uniform Resource Identifier) to identify and access network device resources. Here, URI consist of a Base URI and an API Path. Below, you can find the example of this representation:

 

Base URI -> https:// example.com/restconf/

API Path -> /data/ietf-interfaces:interfaces/interface=eth0

 

  • After that, the client requests supported YANG models by the server. It does this by accessing the data stored in ietf-yang-library.

 

  • Now, it is time for the client to make calls for the configuration Client does this by using HTTP methods like GET, DELETE, HEAD, POST etc.

 

  • Lastly, the client closes HTTPS session and terminates the RESTCONF session.

 

 


Used HTTP Methods

RESTCONF Protocol uses below HTTP methods. You can find the method and its role below:

 

GET Retrieve running configuration and device state information.
DELETE Delete a target resource specified by the supplied path.
HEAD Retrieve just the header fields.
OPTIONS Retrieve the list of supported methods on the server.
PATCH Merge the contents of the message-body with the target resource.
POST Create a data resource.
PUT Create or replace a target data resource

 

 


RESTCONF vs NETCONF

RESTCONF and NETCONF are both network automation and programmability protocols. They are used to configure and manage network devices automatically with the help of programming.  Beside these common parts, they have some common differences too. What are the differences between NETCONF vs RESTCONF? Below, we compare RESTCONF vs NETCONF and we will explain each of these differences.

 

The first difference of NETCONF vs RESTCONF is about transport protocol. NETCONF uses SSH as transport protocol while RESCONF uses HTTP/HTTPS as transport protocol. This makes NETCONF more secure and reliable. But RESCONF is easier and widely used one.

 

The second difference is about used data format. NETCONF uses XML (Extensible Markup Language) as the data format while RESCONF support both XML and JSON. Here, XML is more structured but JSON is more human friendly.

 

NETCONF and RESCONF both use YANG (Yet Another Next Generation) as data modeling language.

 

Another difference is about performing operations. NETCONF uses RPC (Remote Procedure Call) to perform operations. RESTCONF uses REST-like URIs to access network device resources. Here, RPCs are flexible but expensive while REST-like URIs are more intuitive and consistent

 

NETCONF needs more expertise because of YANG model, XML and SSH. On the other hand, RESCONF easier than NETCONF. Especially experts who has experience on web-based technologies and REST APIs can easily use Representational State Transfer Configuration Protocol.

 

NETCONF is good for complex and large-scale networks while RESCONF is better choice for network integrated with web-based services.

 


FAQ About RESTCONF

What is the default port used by RESTCONF?

RESTCONF uses port 443 by default. It uses HTTPS for transport.

 

What does RESTCONF uses as data format?

RESTCONF Protocol uses YANG as data modeling language. Beside Representational State Transfer Configuration Protocol support both XML and JSON data formats to exchange data.

 

Lesson tags: network automation, network programmability
Back to: CCNP Enterprise 350-401 ENCOR v1.1 > Network Assurance

Leave a Reply

Your email address will not be published. Required fields are marked *

CCNP Enterprise 350-401 ENCOR v1.1

Collapse
Expand