NETCONF vs RESTCONF
NETCONF vs RESTCONF
NETCONF vs RESTCONF
NETCONF is a protocol that was developed to provide a standardized interface to Network Element(NE)/Device to retrieve and manipulate configuration data.
Till now, CLI is the standard interface to interact with NE. but this is mainly for human. On the other hand, the NETCONF is mainly used for network automation.
CLI normally defined for human in user friendly way.
Content | Config, Oper Data |
---|---|
Operations | <get-config>, <edit-config>, <copy-config>, <delete-config>, <lock>, <unlock>, <close-session>, <kill-session> |
Messages | <rpc>, <rpc-reply>, <notification> |
Secure Transport | SSH, TLS |
RESTCONF is an HTTP-based protocol that provides a programmatic interface for accessing data defined in YANG, using the datastore concepts defined in NETCONF.
Content: {+restconf}/data | Config, Oper Data; Data-combined configuration and state data resources |
Operations: {+restconf}/operations | operations-container that provides access to the data-model- specific RPC operations supported by the server |
Secure Transport | HTTPS |
Why do we need RESTCONF when we already have NETCONF?
First of all, we need to think about the trends of the tech industry. It’s no secret that businesses all around the world are digitizing themselves through automation. And what is the most popular protocol used in the modern era for automation?
The answer to that is HTTP-based REST APIs.
Imagine a company invested a huge sum of money on automating it’s business processes through REST APIs. And once that work was complete, they decided to automate their network configuration management. They could easily hit a roadblock at this point. The software they use for automation would need to support the NETCONF protocol. Also, their software developers would need to be skilled up to learn this protocol.
You can see the dilemma here. Businesses want to keep their solutions as simple as possible. Ideally, they would use common applications and protocols across their organization.
This is where RESTCONF comes to the rescue. It allows users to automate their network infrastructure using familiar RESTful API patterns.
Operations Similarities:
Now that we understand the need for RESTCONF, let’s do a side-by-side comparison of some of the key lower-level differences between the protocols.
HOW ARE CRUD (CREATE, READ, UPDATE, DELETE) OPERATIONS DIFFERENTIATED IN A REQUEST?
RESTCONF | NETCONF |
---|---|
OPTIONS | None |
HEAD | <get-config>, <get> |
GET | <get-config>, <get> |
POST | <edit-config> (nc:operation=“create”) |
POST | Invoke an RPC operation |
PUT | <copy-config> (PUT on datastore) |
PUT | <edit-config> (nc:operation=“create/replace”) |
PATCH | <edit-config> (nc:operation depends on patch content) |
DELETE | <edit-config> (nc:operation=“delete”) |
WHAT FORMAT DOES DATA ENCODING USE?
The NETCONF protocol requires RPC messages to always be encoded with XML. The RESTCONF protocol allows data to be encoded with either XML or JSON.
HOW IS CONFIGURATION DATA AND STATE DATA EXPOSED TO CLIENTS?
A NETCONF client will use multiple levels of depth in an XML message to specify the location of data. A RESTCONF client with use the resource path in the URL of the request to specify the location of data.
RESTCONF is Less
- No locking
- No notion of transaction
- No candidate config
- No two-phase commit
- No Copy-config
References
- NETCONF and YANG Tutorial part 1a: NETCONF and YANG Overview
- NETCONF - rfc6241
- RESTCONF – rfc8040
- Link to IETF 94 Recording: NETCONF, YANG, pyang
- Link to slides at IETF 94: NETCONF Slides, YANG Slides
LEAVE A REPLY