NETCONF WG M. Jethanandani
Internet-Draft
Intended status: Standards Track J. Lam
Expires: August 27, 2018 A. Leung
Cisco Systems, Inc.
February 23, 2018

Binary Encoding for NETCONF
draft-mahesh-netconf-binary-encoding-00

Abstract

This document describes a method by which a NETCONF [RFC6241] client and server can negotiate an alternate form of encoding.

This document updates RFC 6241.

Status of This Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on August 27, 2018.

Copyright Notice

Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.


Table of Contents

1. Introduction

NETCONF, by default, supports XML encoding for its payload. However, XML can be very verbose, specially for operational data. That combined with parsing of tags leads to slow processing of the data. This document proposes a mechanism by which clients and servers can negotiate an alternate form of encoding, e.g. binary encoding, and use that to exchange data. Binary encoding can reduce the physical size of the data exchanged, in some cases by as much as 66%, and improve the time that is required to process the data, while preserving the original data.

Several binary encoding mechanisms have been proposed, including CBOR. This document does not advocate any particular binary encoding format. Instead, it leaves it up to the negotiation between client and server to decide the form of encoding. For an example of how to encode YANG in CBOR format, see CBOR Encoding of Data Modeled with YANG.

1.1. Definitions and Acronyms

2. Protocol Negotiation

NETCONF clients and servers exchange a hello as part of establishing a connection. As part of the hello exchange, each of them advertises their set of capabilities. This draft suggests advertisement of the following additional capability.

2.1. Encoding

2.1.1. Overview

The :encoding capability indicates what encoding format each side is willing to support. If the client and server are capable of supporting multiple forms of encoding, they can list each of them. There is no need to include xml in the list, as that is supported by default.

2.1.2. Dependencies

When using this capability, any binardy encoding needs the underlying transport to be 8-bit clean, and which preserves message boundaries when dealing with arbitrary binary data. This requires use of Chunked Framing mechanism as described in NETCONF over SSH.

2.1.3. Capability Identifier

The :encoding capability is identfied by the following capability string:

urn:ietf:params:netconf:capability:encoding:1.0?format={name, ...}

The :encoding capability URI MUST contain a "format" argument assigned a comma-separated list of formats supported by the device. For example:

urn:ietf:params:netconf:capability:encoding:1.0?format=cbor,gpb,thrift

2.1.4. New Operation

2.1.4.1. <activate>

Description:

After each side has exchanged capabilities, a client can initiate a request to switch to a new encoding format using the <activate> operation.

Parameters:

encoding:

The <activate> operation instructs the server to switch to the new binary format. If the server does not support the new binary format or is unable to switch to the new binary format for any reason, it MUST fail with the <error-tag> value of "not-supported" and keep the existing encoding format it is using.

If the system does not have the :encoding capability, the <activate> operation is not available. If there is a desire to fall back to default encoding of XML, the client needs to terminate the existing connection and establish a new connection.

Positive Response:

If the device is able to satisfy the requests, an <rpc-reply> is sent that contains an <ok> element.

Negative Response:

An <rpc-error> element is included in the <rpc-reply> with the <type> element set to "not-supported". The <error-tag> element must be set to "server-error".

Example:

<rpc message-id="101"
    xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <activate>
    <encoding>cbor</encoding>
  </activate>
</rpc>

<rpc-reply message-id="101"
    xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <ok/>
</rpc-reply>

3. Security Considerations

4. IANA Considerations

This document registers a URI in the IETF XML registry. Following the format in RFC 3688, the following registration is requested to be made:

4.1. NETCONF Capability URNs

IANA registry "Network Configuration Protocol (NETCONF) Capability URNs" needs to be updated to include the following capability.

Index
    Capability Identifier
-------------------------
:encoding
    urn:ietf:params:netconf:capability:encoding:1.0

5. Acknowledgements

6. References

6.1. Normative References

[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, DOI 10.17487/RFC3688, January 2004.
[RFC6241] Enns, R., Bjorklund, M., Schoenwaelder, J. and A. Bierman, "Network Configuration Protocol (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011.
[RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011.
[RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, October 2013.

6.2. Informative References

[I-D.ietf-core-yang-cbor] Veillette, M., Pelov, A., Somaraju, A., Turner, R. and A. Minaburo, "CBOR Encoding of Data Modeled with YANG", Internet-Draft draft-ietf-core-yang-cbor-06, February 2018.

Authors' Addresses

Mahesh Jethanandani EMail: mjethanandani@gmail.com
Jason Lam Cisco Systems, Inc. EMail: lamj@cisco.com
Alfred Leung Cisco Systems, Inc. EMail: alfleung@cisco.com