Re: [netmod] compact versus iterative representation of the overall schema

Ladislav Lhotka <lhotka@nic.cz> Tue, 24 May 2016 13:57 UTC

Return-Path: <lhotka@nic.cz>
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 BBBEF12D7E3 for <netmod@ietfa.amsl.com>; Tue, 24 May 2016 06:57:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8.426
X-Spam-Level:
X-Spam-Status: No, score=-8.426 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-1.426] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
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 gOmY1aWHotZH for <netmod@ietfa.amsl.com>; Tue, 24 May 2016 06:57:41 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6430312D7DD for <netmod@ietf.org>; Tue, 24 May 2016 06:57:41 -0700 (PDT)
Received: from [IPv6:2001:718:1a02:1:19a:9961:8dbe:3869] (unknown [IPv6:2001:718:1a02:1:19a:9961:8dbe:3869]) by mail.nic.cz (Postfix) with ESMTPSA id 03F78600CC; Tue, 24 May 2016 15:57:40 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1464098260; bh=7IY0vydDGDqpUPfW50cBSf0lycPhsJQm9twbNKtNITQ=; h=From:Date:To; b=guvvK0MV0J3r7q3PvVs0fISOyaZYigC+fpJ+8xobRcjhPTcmlEu5tNLh9/ri/QyCt CBkj0Bf+5ToS96fBgwCwzgI89eBVjk8eQluGTU33VHHA1wPyn/Ph9BhqD7hK/AfE/8 Gk/rg8LHD+r0lcM+h+jln53xbcjN+zKw4nPY0JUQ=
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Ladislav Lhotka <lhotka@nic.cz>
In-Reply-To: <20160524.152039.845759926197525067.mbj@tail-f.com>
Date: Tue, 24 May 2016 15:57:45 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <A0574ACC-D64E-45D7-8DD6-D366163A6552@nic.cz>
References: <m260u3mxrx.fsf@birdie.labs.nic.cz> <20160524.145225.1049539486912684674.mbj@tail-f.com> <C30718F5-511E-4715-943E-B7BD13AF69E5@nic.cz> <20160524.152039.845759926197525067.mbj@tail-f.com>
To: Martin Björklund <mbj@tail-f.com>
X-Mailer: Apple Mail (2.3124)
X-Virus-Scanned: clamav-milter 0.98.7 at mail
X-Virus-Status: Clean
Archived-At: <http://mailarchive.ietf.org/arch/msg/netmod/HNvoto3tbAVp6_irtwa6PC6D7Lo>
Cc: netmod@ietf.org
Subject: Re: [netmod] compact versus iterative representation of the overall schema
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
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: Tue, 24 May 2016 13:57:48 -0000

> On 24 May 2016, at 15:20, Martin Bjorklund <mbj@tail-f.com> wrote:
> 
> Ladislav Lhotka <lhotka@nic.cz> wrote:
>> 
>>> On 24 May 2016, at 14:52, Martin Bjorklund <mbj@tail-f.com> wrote:
>>> 
>>> Ladislav Lhotka <lhotka@nic.cz> wrote:
>>>> Martin Bjorklund <mbj@tail-f.com> writes:
>>>> 
>>>>> Ladislav Lhotka <lhotka@nic.cz> wrote:
>>>>>> 
>>>>>>> On 23 May 2016, at 14:30, Lou Berger <lberger@labn.net> wrote:
>>>>>>> 
>>>>>>> Hi Lada,
>>>>>>>  I looks like no one really jumped on this one -- so better late than
>>>>>>> never ...
>>>>>>> 
>>>>>>> When looking at the question below, we should consider the uses cases.
>>>>>>> I'm particularity interested (as a contributor) in the use case of
>>>>>>> nested mounts (NIs mounted within LNEs), as well as the case if models
>>>>>>> that will only permit mounting of specific other models vs generically
>>>>>>> mounting any model.
>>>>>>> 
>>>>>>> On 4/6/2016 10:07 AM, Ladislav Lhotka wrote:
>>>>>>>> Hi,
>>>>>>>> 
>>>>>>>> with a schema mount mechanism in place, there are two different
>>>>>>>> options
>>>>>>>> for constructing the overall schema (their combinations are possible,
>>>>>>>> too):
>>>>>>>> 
>>>>>>>> 1. Define schema mount as an extension of YANG library so that it
>>>>>>>> defines YANG modules, revisions, features and deviations as before but
>>>>>>>> also the way how they are combined into a hierarchical structure of
>>>>>>>> schemas.
>>>>>>> 
>>>>>>> I think this only makes sense if this is scoped in some way.  For
>>>>>>> example, with LNEs, the parent/host server may not have visibility
>>>>>>> into
>>>>>>> the mounted models, (see draft-rtgyangdt-rtgwg-lne-model).  And even
>>>>>>> if
>>>>>> 
>>>>>> As I understand it, schema-mount is about accessing the LNE models
>>>>>> from the parent/host management interface. I believe the real question
>>>>>> is whether we want to allow the schema to dynamically change at run
>>>>>> time and possibly throw in new modules that the client never heard
>>>>>> of. #2 can do it while #1 can't. I am not sure though whether the LNE
>>>>>> model really requires something like this.
>>>>>> 
>>>>>>> does, you have to consider the cases of mounted models contained
>>>>>>> within
>>>>>>> mounted models.
>>>>>> 
>>>>>> This is possible either way, provided that the complete schema is
>>>>>> known upfront.
>>>>> 
>>>>> I don't think I have seen a concrete proposal for such a compact
>>>> 
>>>> YSDL was such a proposal.
>>>> 
>>>>> format that can handle the case where different instances of a list
>>>>> with a mount point have different modules mounted, and some of them
>>>>> have mounted models within the mounted models.
>>>>> 
>>>>> As a concrete example, suppose we have the model
>>>>> example-network-manager from Appendix B in
>>>>> draft-ietf-netmod-schema-mount-01:
>>>>> 
>>>>>  +--rw managed-devices
>>>>>     +--rw device* [name]
>>>>>        +--rw name         string
>>>>>        +--rw transport
>>>>>        +--rw root      yangmnt:mount-point managed-device
>>>>> 
>>>>> Now, let's assume that two devices exist, A and B:
>>>>> 
>>>>> A  implements:  ietf-interfaces, example-netowrk-manager
>>>>> B  implements:  ietf-system
>>>>> 
>>>>> In A, there is a managed-device C which implements ietf-interfaces and
>>>>> ietf-ip.
>>>>> 
>>>>> What would this look like in the compact form?
>>>> 
>>>> The module "example-network-manager" would be modified as follows:
>>>> 
>>>>  +--rw managed-devices
>>>>     +--rw device* [name]
>>>>        +--rw name         string
>>>>        +--rw transport
>>>>        +--rw (root)
>>>>           +--:(A)
>>>>           +--:(B)
>>>>           +--:(C)
>>> 
>>> But A, B and C are device names (instances).
>> 
>> So what? A, B and C can be the values of the "name" key, too.
>> 
>>> 
>>> Also, C would be:
>>> 
>>> /managed-devices/device[name="A"]/root/managed-devices/device[name="C"]
>> 
>> Yes.
>> 
>>> 
>>> 
>>>> And then:
>>>> 
>>>>  {
>>>>    "ietf-ysdl:schemas": {
>>>>      "top-schema": "host",
>>>>      "schema": [
>>>>        {
>>>>          "name": "host",
>>>>          "yang-modules": [ "example-logical-devices" ],
>>>>          "subschema": [
>>>>            {
>>>>              "root":
>>>>                "/example-network-manager:managed-devices/device/root/A",
>>> 
>>> Can the root contain instance information?
>> 
>> No, it is a schema-node-path, that's why it can contain "choice" and
>> "case" nodes. It should be possible to construct the complete schema
>> without looking into any instances.
> 
> So this approach doesn't work when the instances have different
> mounted models?

It works in the same way as for interfaces in ietf-interfaces, or routing-protocols in ietf-routing, where different entries arguably have different models. 

> 
> It is not realistic to change the data model as you did above, since
> we'd have to invent a separate container per combination of modules
> that possibly could be mounted!

As a server implementor, I could augment the example-network-manager with as many case nodes as needed. Alternatively, we could introduce some kind of "dynamic choice" similar to "when". Then the "example-network-manager" could be:

   +--rw managed-devices
      +--rw device* [name]
         +--rw name         string
         +--rw type?        type-enums
         +--rw transport

and the subschema specification would become, e.g.:

"subschema": [
  {
    "root": "/example-network-manager:managed-devices/device",
    "when": "type = 'device-type-A'",
    "schemas": [ "schema-A" ]
  },
  {
    "root": "/example-network-manager:managed-devices/device/",
    "when": "type = 'device-type-B'",
    "schemas": [ "schema-B" ]
  }
]

Lada

> 
> 
> /martin
> 
> 
>> 
>> Lada
>> 
>>> 
>>> 
>>> /martin
>>> 
>>> 
>>>>              "schemas": [ "schema-A" ]
>>>>            }
>>>>            {
>>>>              "root":
>>>>                "/example-network-manager:managed-devices/device/root/B",
>>>>              "schemas": [ "schema-B" ]
>>>>            }
>>>>          ]
>>>>        },
>>>>        {
>>>>          "name": "schema-A",
>>>>          "yang-modules": [
>>>>            "ietf-interfaces",
>>>>            "example-network-manager"
>>>>          ],
>>>>          "subschema": [
>>>>            {
>>>>              "root":
>>>>                "/example-network-manager:managed-devices/device/root/C",
>>>>              "schemas": [ "schema-C" ]
>>>>            }
>>>>          ]
>>>>        },
>>>>        {
>>>>          "name": "schema-B",
>>>>          "yang-modules": [ "ietf-system" ]
>>>>        },
>>>>        {
>>>>          "name": "schema-C",
>>>>          "yang-modules": [
>>>>            "ietf-interfaces",
>>>>            "ietf-ip"
>>>>          ]
>>>>        }
>>>>      ]
>>>>    }
>>>>  }
>>>> 
>>>> As long as all modules comprising the schema and their possible
>>>> arrangement is known in advance, it should flexible enough. And as I
>>>> said, I'd prefer to address this case in schema-mount because the model
>>>> of trust between the server and client isn't changed in any way.
>>>> 
>>>>> 
>>>>> BTW, in this case, it is not obvious that the top-level server knows
>>>>> anything about the data models mounted by C...
>>>> 
>>>> But then the top-level server cannot possibly serve data for C.
>>>> 
>>>> Lada
>>>> 
>>>>> 
>>>>> 
>>>>> /martin
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>>> 
>>>>>>> 
>>>>>>>> 
>>>>>>>> 2. Apart from YANG Library data, the server just specifies the mount
>>>>>>>> points. A client of an NM protocol is expected to fetch a new instance
>>>>>>>> of YANG library and/or subordinate mount points as state data from a
>>>>>>>> well-known location under each mount point.
>>>>>>> 
>>>>>>> I think this depends on the use case.  For LNEs, I think this is
>>>>>>> right.
>>>>>>> For some of the other possible use cases being discussed only a
>>>>>>> specific
>>>>>>> model can be mounted.
>>>>>> 
>>>>>> I guess I need some example scenarios demonstrating that #1 cannot be
>>>>>> used for LNE.
>>>>> 
>>>> 
>>>> -- 
>>>> Ladislav Lhotka, CZ.NIC Labs
>>>> PGP Key ID: E74E8C0C
>>>> 
>> 
>> --
>> Ladislav Lhotka, CZ.NIC Labs
>> PGP Key ID: E74E8C0C

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C