Selecting your Management Protocol: RESTCONF vs JSON-RPC vs NETCONF
7 Slides2.88 MB
Selecting your Management Protocol: RESTCONF vs JSON-RPC vs NETCONF Imran Baig, Syed ZiaUllah & Jan Lindblad Solution Architects
NETCONF, Standard RESTCONF Standard & JSON-RPC Tailored to our needs 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 2
Selecting Northbound Protocol to Use NETCONF RESTCONF NSO JSON-RPC Standard RFC 6241/ RFC 8040/ Only RPC layer standard Available since 2006 2017 2015 Functionality NETCONF Less than NETCONF More than NETCONF Sweet spot Manage many network devices Manage NSO or single device Build WebUI or script towards NSO Message encoding XML XML or JSON JSON RESTCONF is modeled after NETCONF. The goal with RESTCONF is to make a simplified version of NETCONF, so RESTCONF functionality is a subset of NETCONF. One of the fundamental reasons for this is that the REST architecture, by definition, does not have a session concept. The lack of sessions rule out certain types of NETCONF operations, like network-wide transactions. RESTCONF will therefore never have all the functionality of NETCONF. The RESTCONF functionality may well be sufficient for many use cases. Using RESTCONF, however, you will always run the risk that in a future use case, you might need some NETCONF feature that isn't available in RESTCONF. 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 3
RESTCONF Pros: Stateless communication – doesn’t maintain state Use standard HTTP methods. i.e. GET, POST, PUT, PATCH, DELETE, OPTIONS & HEAD. The REST API is always independent of the type of platform or languages. Resources with multiple representations. Can receive request and send response in XML and JSON format. Industry standard for years so easy for programmers to implement. Cons: No security in protocol if over HTTP, so run near NSO or through secure tunnel RESTCONF specification still young, so implementations and interoperability are still in build-up phase. PATCH operation very limited when compared to edit-config in NETCONF, so a new media type has been invented to handle edits which address more than one location in the data tree. This media type may not be well supported by many of the traditional REST toolchains. RESTful system is tied to uniform interface of the supporting protocol HTTP. Need to perform multiple http requests for batch processing under different transactions. Certain operations not possible due to this, or will be difficult to roll back, or will have undesired effects on the network. Each resource will have an different URI. Cannot attach labels to transactions, hence transactions cannot be easily tracked. 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 4
JSON RPC Pros: JSON-RPC is quick and easy to consume. JSON-RPC has 1 end-point URL for all requests. In JSON-RPC, any request is sent the same way (i.e. via HTTP POST) with the method and parameters in it. The JSON-RPC session ties the client and the server via an HTTP cookie. Can handle batch requests so northbound system has more flexibility to implement workflows. As state is maintained hence support is available for operations like “Commit DryRun” and attaching labels to each transaction. Response for each request in a batch can be easily consumed, making it easier to find issues in batch. Cons: JSON-RPC is a standard, but the operations on top are not standardized, but proprietary to Tail-f products. No security in protocol, so run near NSO or through secure tunnel JSON RPC Clients are required to know procedure names. Procedure parameters order, types and count matters. Number of calls made via JSON RPC are more than REST as it has to maintain session. 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 5
NETCONF Pros: Cons: The Network Configuration Protocol (NETCONF) is a network management protocol developed and standardized by IETF. NETCONF protocol consistently carries a higher amount of bytes in the protocol payload and thus has higher bandwidth utilization requirements. Support for robust configuration change using transactions involving a number of devices. NETCONF is a session based protocol. NETCONF is a session-based protocol, This adds additional overhead for the connection handshaking. Distinction between configuration and state data Configuration testing and validation support Selective data retrieval with filtering Extensible procedure call NETCONF is running over SSH and therefore has security built into the transport. No built-in support for attaching labels to transactions, hence transactions cannot be easily tracked for Rollback 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 6
RESTCONF vs NETCONF Operations RESTCONF NETCONF GET (single location in tree) get-config , get POST (single location in tree) edit-config (operation "create") PUT (single location in tree) edit-config (operation "replace") PATCH (single location in tree) edit-config (operation "merge") PATCH (multiple locations using yang-patch media type) edit-config (operation "merge") DELETE (single location in tree) edit-config (operation "delete") OPTIONS Not needed HEAD Not needed 2017 Cisco and/or its affiliates. All rights reserved. Cisco Public 7