Re: [Netconf] Issue #2 for binary encoding: Should the new encoding include the Message layer?

Mahesh Jethanandani <mjethanandani@gmail.com> Fri, 29 June 2018 03:48 UTC

Return-Path: <mjethanandani@gmail.com>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 38819130E53; Thu, 28 Jun 2018 20:48:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gKAj6sa_WICi; Thu, 28 Jun 2018 20:48:53 -0700 (PDT)
Received: from mail-pl0-x232.google.com (mail-pl0-x232.google.com [IPv6:2607:f8b0:400e:c01::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5AD00130E61; Thu, 28 Jun 2018 20:48:53 -0700 (PDT)
Received: by mail-pl0-x232.google.com with SMTP id k1-v6so3785387plt.2; Thu, 28 Jun 2018 20:48:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=Yo3Ac+58DlTkZdkL9maaDsrbVashqsdjItTIHmajxGY=; b=eQ5FZUGyvexuQaUUID3GaYF/s5VLtDkbnp7l8c+tth++Mp3HCTx+tzQYRd0pNe+BV8 UYBiQFbUmx0gxZ0jGzJouFO7rZfiiJRZ//5gS5LyDRNfO5ew7GKLdf9gCK3E6twb3s6N FD6T4NAW9qQ1J7Pht4SFMGQSNPOodMvAyGLYSxe+4+t5RAdeiJ6dpwJw1tV8xa7uv4Q6 guQWQ15HjEsZXsXSdETkfntqRs3vScYN+nNzt880iJz6mnUhSwBq0hnZtIy4CfG+n5aF 4fPt/4Xyfmdv0b8QokQgiqLVnmKUAZIhZY5qA48B2eUXoeD20nHobipTmE1enNK8w9bN jqaQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=Yo3Ac+58DlTkZdkL9maaDsrbVashqsdjItTIHmajxGY=; b=ErtOW1U12s67nsMgotwsPCHCW+Ck7ACMLvq7/yQV0i6H+YoR5npSXAKltnAQUm4aev tfzKWti5gtID+0j2Yf7nwPwyN34R2e1CL0b0FQPZRw8mZbSEKfyURqsB//KK58Y5h+UT ge+jGEVkgbRz22FE+cZGt72SQThkW5OBGLGOfitZvKDaIG+HNx1cUh7hZ0KoFGlcL4MY iZw/MwpCbtBsunRY8G0oFy/dCtCJsJN8JrfYjPLihWqEj6RYQcy+rlItCdxrx8PpllBU bRG5mXvUZ2ersOImdPCsxdSvRErWIACIllOiy1yIZR3eJ/XCefCZJ/A3vNkPIAeGNFEF h05A==
X-Gm-Message-State: APt69E1qgHMIhuuXMN8KZX4e70cj5qD06ZE6Lq/einWGVdzLq7GI621X madw4YJ1kQgjMjm6SDFGEAvkBiIu
X-Google-Smtp-Source: ADUXVKLalwAeoqjIHoNEckFMKYFCerpudJfiCBix/VWKS/veo0m7yE8NeI9V/ZpFSFJpJrkJR0V8XQ==
X-Received: by 2002:a17:902:3181:: with SMTP id x1-v6mr13064596plb.198.1530244132479; Thu, 28 Jun 2018 20:48:52 -0700 (PDT)
Received: from ?IPv6:2601:647:4700:1280:4864:3c90:f62b:b005? ([2601:647:4700:1280:4864:3c90:f62b:b005]) by smtp.gmail.com with ESMTPSA id y2-v6sm19712005pfk.82.2018.06.28.20.48.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 20:48:51 -0700 (PDT)
From: Mahesh Jethanandani <mjethanandani@gmail.com>
Message-Id: <C95C8811-3797-4C1D-B279-565B3CEA92B6@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_5BC36A38-8EAC-40EC-AF54-040109914EDE"
Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\))
Date: Thu, 28 Jun 2018 20:48:50 -0700
In-Reply-To: <CABCOCHQUDEiNAEj-NfBbpu8_RHuLk6U0HUNVFsTpHXBTuaDrgg@mail.gmail.com>
Cc: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, draft-mahesh-netconf-binary-encoding@ietf.org, Andy Bierman <andy@yumaworks.com>
To: Netconf <netconf@ietf.org>
References: <48161AFC-484C-4803-AFFF-4E9C0369A008@gmail.com> <20180321082546.pbsja53shgwlu6gv@elstar.local> <CABCOCHTZo-2=NSoHV+xNcmsOR1Ch+e-26pFz=oyMmGTS4C5QYw@mail.gmail.com> <E7646ADC-1F35-4CD9-8D32-E543AD5FCFE0@gmail.com> <CABCOCHQUDEiNAEj-NfBbpu8_RHuLk6U0HUNVFsTpHXBTuaDrgg@mail.gmail.com>
X-Mailer: Apple Mail (2.3445.8.2)
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/oHcyDYi8ROWUAnupTdi2UJnoXDk>
Subject: Re: [Netconf] Issue #2 for binary encoding: Should the new encoding include the Message layer?
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.26
Precedence: list
List-Id: Network Configuration WG mailing list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Jun 2018 03:48:57 -0000


> On Jun 25, 2018, at 6:46 PM, Andy Bierman <andy@yumaworks.com> wrote:
> 
> 
> 
> On Mon, Jun 25, 2018 at 5:14 PM, Mahesh Jethanandani <mjethanandani@gmail.com <mailto:mjethanandani@gmail.com>> wrote:
> Picking up on this thread ...
> 
>> On Mar 23, 2018, at 4:30 PM, Andy Bierman <andy@yumaworks.com <mailto:andy@yumaworks.com>> wrote:
>> 
>> 
>> 
>> On Wed, Mar 21, 2018 at 1:25 AM, Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de <mailto:j.schoenwaelder@jacobs-university.de>> wrote:
>> There is encoding of YANG defined data and there is the encoding of
>> protocol messages. Lets not confuse the two.
>> 
>> 
>> 
>> good point.
> 
> Agree.
> 
>> We have usually left out YANG for protocol messages, but now we have YANG
>> Data Extensions so the complete message can be defined in YANG (sort of)
> 
> The preference, at least on part of the authors, is to NOT change protocol message formats, at least for now. In addition, as Juergen states, changing the message layer would involve opening up RFC 6241 and splitting the message layer from other parts of NETCONF, work I am not sure the WG is ready to adopt.
> 
> 
> 
> I am not sure how this would be implemented.
> You seem to be proposing a hybrid parser:
> 
>    <rpc> ... binary data ... </rpc>
> 
>    <rpc-reply> ... binary data ... </rpc-reply>
> 
>    <notification> ... binary data ... </notification> 
> 
> I do not know of any XML tools that let you switch to a different (binary) parser
> for the start-tag of a complex element, then switch back for the end-tag.
> 
> I suggest assigning SID values for these nodes and encoding the entire message
> in CBOR.

In talking to Andy and getting clarification from him, here is my understanding of what he is proposing.

First of all he is suggesting that the entire message, message header and yang-data be encoded using the agreed upon form of encoding. While the clear favorite is cbor/sid, the exchange does allow for other forms of encoding to be negotiated. For the message header, and in case of cbor/sid encoding, the SID values will have to come from a new range TBA.

The initial exchange, session setup would look as follows:

- <hello> exchange between client and server happens as before
- client sends an ordered list of encodings it supports.
- server sends an unordered list of encodings it supports
- both client and server check capabilities and decide to switch to base:1.1 framing
- the first match is picked. If no match is found the session is dropped
- if match is found, both client and server switch to the matched encoding even before the first rpc is sent.

If the match found is cbor/sid, the data exchange consists of message header encoded using cbor/sid and yang-data attributes encoded in cbor/sid as child nodes.

This approach has the advantage that all RPC operations and notifications are supported with the new encoding format.

Cheers.

> 
> 
>> 
>> I have concerns about encoding of metadata.
>> This is critical for real-world NM tools.
>> IMO XML designers really got this right.
>> JSON and everything else - not so much.
>> 
>> The practice of stuffing JSON objects into XML string nodes seems like
>> the worst of both worlds.  NETCONF relies on metadata in the content
>> layer, so encoding <rpc> in XML does not even help a little.
>> Switching parsers from XML to something else in mid-message is a non-starter.
> 
> Agreed. Our proposal is to keep XML parsing, and encode only YANG data. BTW, the idea was to encode YANG data into CBOR+SID, not the XML version of the YANG data, in case there was any confusion. 
> 
> 
> I do not see what benefits exist from keeping XML parsing
> (besides the <hello> that has to stay the same: XML + base:1.0 framing).
> I am not sure how that even works since attributes are in the YANG data.
> 
> CBOR does not support metadata at all.
> NETCONF <edit-config> does not really work without it.
> There are also retrieved attributes (with-defaults, with-origin) that cannot be supported.
> There is also the "message-id" attribute in NETCONF that cannot be supported.
> 
>> 
>> 
>> - RESTCONF: Protocol encoding is handled by HTTP. HTTP/1.1 uses a
>>   textual format, HTTP/2 uses a binary format. HTTP was designed to
>>   handle arbitrary content formats. Hence, using RESTCONF with XML,
>>   JSON, CBOR, ... just works (but note that the HTTP protocol layer
>>   does not use XML, nor JSON nor CBOR encoding).
>> 
>> 
>> 
>> We should use IANA media types and the Accept header, as designed,
>> to add support for new message formats.
>> 
>>  
>> - NETCONF: NETCONF does not have the capability to support different
>>   content formats. We can (a) retrofit this onto the existing protocol
>>   format (allowing other content encoding on top of the XML encoded
>>   protocol format) or (b) we create a new protocol encoding that can
>>   handle different content formats more efficiently than (a) would do.
>>   But this largely boils down to a new protocol version, stripped down
>>   to the messaging layer.
>> 
>>   I do not think it is desirable to have N different message layer
>>   encodings for N different content layer encodings since you need at
>>   least something common to negotiate the encodings. That said, one
>>   could define the messaging layer using the yang-data extension and
>>   then the rpc message formats translate to XML, JSON, CBOR, ... but
>>   we would still have to have something common that initially
>>   negatiates the encodings.
>> 
>> 
>> I prefer the switch-over after the <hello> exchange.
>> This would be NETCONF's version of the Accept header.
> 
> The draft will be updated to reflect this.
> 
>> 
>>    
>> 
>> Anyway, to do all this properly, we would have to open up RFC 6241 and
>> to split it into pieces, separating the messaging layer cleanly from
>> the well-known NETCONF operations and their semantics.
>> 
>> 
>> Properly for documentation and standards track purposes,
>> but not really for interoperability.
>> 
>>  
>> This of course raises the question whether this work is useful to
>> entertain given that we already have RESTCONF that happily supports
>> different content encoding formats and which can be used with both a
>> textual encoding and a binary encoding of the messaging layer. (And
>> outside the IETF we have protocols that use entirely different RPC
>> layers.) Perhaps the simpler answer is that if you really need
>> something more efficient than NETCONF, use RESTCONF. Available today.
>> 
>> 
>> 
>> It is true that NMDA RESTCONF exposes many details that were intentionally left
>> of RFC 8040.  IMO we should support both protocols for the foreseeable future.
>> 
>> My wishlist for NETCONF binary data:
>>   - keep NETCONF 1.1 message framing
> 
> Agree.
> 
>>   - define protocol mapping to use CBOR + SID message encoding
> 
> Agree.
> 
>>   - define extension to encode metadata in CBOR + SID using the annotation-stmt in RFC 7952
> 
> Ok.
> 
>>   - define some binary data types for IP addresses etc. so they are not encoded as CBOR strings
> 
> Would this be for this draft or something like CBOR+SID to define this?
> 
> Thanks.
> 
>> 
>> 
>> /js
>> 
>> Andy
> 
> 
> 
> Andy
> 
> 
>  
>>  
>> 
>> On Wed, Mar 21, 2018 at 08:02:11AM +0000, Mahesh Jethanandani wrote:
>> > Added another issue to GitHub here - https://github.com/netconf-wg/binary-encoding/issues/2 <https://github.com/netconf-wg/binary-encoding/issues/2><https://github.com/netconf-wg/binary-encoding/issues/2 <https://github.com/netconf-wg/binary-encoding/issues/2>> that reads:
>> >
>> > The -00 version of the draft is silent about which layer the alternate form of encoding impacts. After some discussion, the authors clarified on the mailing list, that the draft was going to propose that encoding of alternate forms of encoding will impact layers above the Message layer per Figure 1 of RFC 6241.
>> >
>> > An alternate proposal is for the Message layer to be binary encoded also. That means that whatever form of encoding is agreed upon has to provide a way to encode Message layer RPCs, such as <rpc>, <rpc-reply>, <rpc-error> and <ok>.
>> >
>> > The pro of not encoding the Message layer is that alternate form of encoding does not have to define encoding for that layer. For example, CBOR defines a way to encode YANG. It does not define how to encode RPCs, at least currently. BTW, that draft is in LC, if not past it.
>> >
>> > The con is that one would lose 25% efficiency in doing a base64 encoding, not to include the fact that one would have to deal with two forms of encoding.
>> >
>> > If we do agree that the Messaging layer should be binary encoded, (a separate) draft would have to define a way to encode the Message layer. And, this would have to be done for each form of encoding.
>> >
>> > Question for the WG, should the new encoding include the Message layer?
>> >
>> > Mahesh Jethanandani
>> > mjethanandani@gmail.com <mailto:mjethanandani@gmail.com>
>> >
>> 
>> > _______________________________________________
>> > Netconf mailing list
>> > Netconf@ietf.org <mailto:Netconf@ietf.org>
>> > https://www.ietf.org/mailman/listinfo/netconf <https://www.ietf.org/mailman/listinfo/netconf>
>> 
>> 
>> --
>> Juergen Schoenwaelder           Jacobs University Bremen gGmbH
>> Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany <https://maps.google.com/?q=Campus+Ring+1+%7C+28759+Bremen+%7C+Germany&entry=gmail&source=g>
>> Fax:   +49 421 200 3103         <https://www.jacobs-university.de/ <https://www.jacobs-university.de/>>
>> 
>> _______________________________________________
>> Netconf mailing list
>> Netconf@ietf.org <mailto:Netconf@ietf.org>
>> https://www.ietf.org/mailman/listinfo/netconf <https://www.ietf.org/mailman/listinfo/netconf>
> Mahesh Jethanandani
> mjethanandani@gmail.com <mailto:mjethanandani@gmail.com>
> 

Mahesh Jethanandani
mjethanandani@gmail.com