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.
Table of Contents
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.
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?
Base URI -> https:// example.com/restconf/
API Path -> /data/ietf-interfaces:interfaces/interface=eth0
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 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.
RESTCONF uses port 443 by default. It uses HTTPS for transport.
RESTCONF Protocol uses YANG as data modeling language. Beside Representational State Transfer Configuration Protocol support both XML and JSON data formats to exchange data.
Leave a Reply