Re: [netmod] instance file parsing

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Mon, 03 December 2018 11:36 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 58C9412D7F8 for <netmod@ietfa.amsl.com>; Mon, 3 Dec 2018 03:36:40 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham autolearn_force=no
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 zf0wdu7nO2oA for <netmod@ietfa.amsl.com>; Mon, 3 Dec 2018 03:36:38 -0800 (PST)
Received: from atlas5.jacobs-university.de (atlas5.jacobs-university.de [212.201.44.20]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1F9AE129C6B for <netmod@ietf.org>; Mon, 3 Dec 2018 03:36:38 -0800 (PST)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas5.jacobs-university.de (Postfix) with ESMTP id D162ADAE; Mon, 3 Dec 2018 12:36:36 +0100 (CET)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas5.jacobs-university.de ([10.70.0.217]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10032) with ESMTP id wVAuKddUCfdK; Mon, 3 Dec 2018 12:36:36 +0100 (CET)
Received: from hermes.jacobs-university.de (hermes.jacobs-university.de [212.201.44.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hermes.jacobs-university.de", Issuer "Jacobs University CA - G01" (verified OK)) by atlas5.jacobs-university.de (Postfix) with ESMTPS; Mon, 3 Dec 2018 12:36:36 +0100 (CET)
Received: from localhost (demetrius3.jacobs-university.de [212.201.44.48]) by hermes.jacobs-university.de (Postfix) with ESMTP id 8F4DF20044; Mon, 3 Dec 2018 12:36:36 +0100 (CET)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius3.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id ncwuYj6rqvGS; Mon, 3 Dec 2018 12:36:36 +0100 (CET)
Received: from exchange.jacobs-university.de (sxchmb03.jacobs.jacobs-university.de [10.70.0.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "exchange.jacobs-university.de", Issuer "DFN-Verein Global Issuing CA" (verified OK)) by hermes.jacobs-university.de (Postfix) with ESMTPS id EFADA20043; Mon, 3 Dec 2018 12:36:35 +0100 (CET)
Received: from anna.localdomain (10.50.218.117) by sxchmb03.jacobs.jacobs-university.de (10.70.0.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1591.10; Mon, 3 Dec 2018 12:36:34 +0100
Received: by anna.localdomain (Postfix, from userid 501) id 24A1C30048D98F; Mon, 3 Dec 2018 12:36:33 +0100 (CET)
Date: Mon, 3 Dec 2018 12:36:33 +0100
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Robert Wilton <rwilton@cisco.com>
CC: Andy Bierman <andy@yumaworks.com>, NetMod WG <netmod@ietf.org>
Message-ID: <20181203113633.v3nfuen66ngjjp6l@anna.jacobs.jacobs-university.de>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Robert Wilton <rwilton@cisco.com>, Andy Bierman <andy@yumaworks.com>, NetMod WG <netmod@ietf.org>
References: <CABCOCHQYR_iY7Lp=0m8D-GQ8+Rzuijaa8_41bJw6ZvWPc+Cw_w@mail.gmail.com> <b2ee0537-465a-fbc0-1b94-000da5993b05@cisco.com> <20181130192830.g2622izshwn4f55z@anna.jacobs.jacobs-university.de> <6281fd79-2284-46c0-350c-770dcdade29d@cisco.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
X-Clacks-Overhead: GNU Terry Pratchett
Content-Transfer-Encoding: 8bit
In-Reply-To: <6281fd79-2284-46c0-350c-770dcdade29d@cisco.com>
User-Agent: NeoMutt/20180716
X-ClientProxiedBy: SXCHMB03.jacobs.jacobs-university.de (10.70.0.155) To sxchmb03.jacobs.jacobs-university.de (10.70.0.155)
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/UHJnMnDMZ2n5l-YW7MeclC3e3hU>
Subject: Re: [netmod] instance file parsing
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 03 Dec 2018 11:36:40 -0000

On Mon, Dec 03, 2018 at 10:21:20AM +0000, Robert Wilton wrote:
> 
> On 30/11/2018 19:28, Juergen Schoenwaelder wrote:
> > I doubt it makes sense to carry an entire yang library schema with the
> > instance data. The modules are actually known via the namespaces.
> 
> Knowing the module name or namespace isn't sufficient to be able to parse
> the data:
>  - E.g. if the contents are in the format of RFC7895bis, but the client
> tries to parse it using the schema from RFC7895, then it will fail.
>  - Once NBC changes are allowed via YANG versioning it will become more
> necessary to know the revision or version of the modules to be able to parse
> the data.  E.g. not even just the latest module revision will necessarily
> work.   It is entirely plausible that different server revisions may be
> generating instance data using slightly different schema.

Perhaps this is a problem of the versioning solution then. ;-)
 
> If the server has deviations then the client may also need to know those
> deviations to correctly parse the file.
>
> So, I think that it is pretty clear that knowing the right schema is
> required to be able to correctly parse and interpret the instance data.
> 
> I think that there are 4 ways that this can be achieved:
>  1) embedded the necessary schema information into the YANG instance data.
>  2) put the necessary schema information online somewhere and have a URI
> reference to it.
>  3) some combination of (1) and (2), e.g. packages defined centrally, with
> deviations listed in the file.
>  4) the schema is determined using some out of bound mechanism, or possibly
> it is hard coded.

Perhaps we need to define first what "parse" means. I am not sure
parsing requires to know all schema details. Anyway, if all schema
details are needed, then the simplest solution seems to be to read the
schema from another instance file. This then only requires to
bootstrap the schema model version.

> I don't think that there is a one size fits all answer here.  I think that
> that it depends on the use case.  Certainly, I think that facilitating 1 -3
> is useful, but they should be optional rather than mandatory.  I.e. defining
> nodes for these doesn't seem to cost much if a server isn't obliged to
> populate them.
> 
> I do think that YANG packages (themselves defined in instance data
> documents) could be very helpful here.  I.e. rather than listing all the
> modules, instead list the packages + any deviations from that.  I'm
> presuming here that the definitions of the packages are available via a URI.
 
> >   If
> > you want to capture the schema, dump the relevant yang library into
> > another instance file.
> 
> That just means another file to carry around and manage.

Yes, but compared to solutions that require new and/or much more
elaborate data formats, this is very cheap and efficient, in
particular for systems where the schema itself is relatively
static. Also in terms of engineering time this is a rather cheap
solution since you do not need to invent a new way to document and
communicate a schema.

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>