Introduction
Following on from our previous article around NETCONF and YANG, we will look at the RESTCONF protocol.
As per RFC 8040 (RESTCONF Protocol), the IETF describes RESTCONF as,
“an HTTP-based protocol that provides a programmatic interface for accessing data defined in YANG, using the datastore concepts defined in the Network Configuration Protocol (NETCONF).”
Protocol Stack
First lets look at the protocol stack. Compared to NETCONF, the RESTCONF protocol stack it is far simpler, in many ways. Lets step through the layers,
- Content – Unlike NETCONF where we much use XML. RESTCONF allows for either JSON or XML to be used.
- Operations – Each of the operations are aligned to the various HTTP methods, providing the required suite of CRUD based operations (Create, Replace, Update and Delete).
- Transport – The transport protocol is HTTP, allowing us to use HTTPS. Providing the security benefits that TLS has to offer.
Figure 1 – RESTCONF Protocol Stack.
Operational/Configuration
RESTCONF provides the ability to query and perform operations upon either the configuration or operational state. This is achieved by RESTCONF splitting the datastore into config and operational. Both of which are accessed via the URI`s:
- /restconf/config
- /restconf/operational
Operations
Let’s look at the RESTCONF operations to that of NETCONF,
RESTCONF | NETCONF Operation | Media Type |
---|---|---|
GET | <get>, <get-config> | application/yang.data |
GET | <create-subscription> | text/event-stream |
POST | any <rpc> operation | application/yang.operation |
PUT | replace | application/yang.data |
PATCH | any edit operation | application/yang.patch |
PATCH | merge | application/yang.data |
DELETE | delete | application/yang.data |
Communication
The first thing to mention is that RESTCONF listens on port 8080 for HTTP requests. Furthermore the HTTP headers Content-Type and Accept are used (by the client) to instruct the server of the data type (i.e XML or JSON).
For further details on how the URI is constructed check out Cisco Live – DEVNET-1721 – Introduction to NETCONF, RESTCONF and YANG (2017 Las Vegas).
Further Reading
http://sdntutorials.com/what-is-restconf/
https://www.ietf.org/proceedings/88/slides/slides-88-netconf-3.pdf
- How to Configure a BIND Server on Ubuntu - March 15, 2018
- What is a BGP Confederation? - March 6, 2018
- Cisco – What is BGP ORF (Outbound Route Filtering)? - March 5, 2018
Want to become a networking expert?
Here is our hand-picked selection of the best courses you can find online:
Cisco CCNA 200-301 Certification Gold Bootcamp
Complete Cyber Security Course – Network Security
Internet Security Deep Dive course
Python Pro Bootcamp
and our recommended certification practice exams:
AlphaPrep Practice Tests - Free Trial