Re: [netmod] YANG doctor review of draft-ietf-netmod-intf-ext-yang-04

Ladislav Lhotka <lhotka@nic.cz> Tue, 11 April 2017 11:56 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 BBCE112946E for <netmod@ietfa.amsl.com>; Tue, 11 Apr 2017 04:56:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7
X-Spam-Level:
X-Spam-Status: No, score=-7 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=-0.001, URIBL_BLOCKED=0.001] 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 ikmk-hqD7mxQ for <netmod@ietfa.amsl.com>; Tue, 11 Apr 2017 04:56:07 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [217.31.204.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4C0C612945B for <netmod@ietf.org>; Tue, 11 Apr 2017 04:56:06 -0700 (PDT)
Received: from [IPv6:2001:718:1a02:1:f47a:c5ea:506a:7ed0] (unknown [IPv6:2001:718:1a02:1:f47a:c5ea:506a:7ed0]) by mail.nic.cz (Postfix) with ESMTPSA id 955AF608A7; Tue, 11 Apr 2017 13:56:04 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1491911764; bh=Aghcn6YdJ7IoYPkvaVaNgCkLxrEN4eBAldKwSdN8L8o=; h=From:Date:To; b=BaOOxYJTLi3ueov8DdoGBBQt6xdvcsJ8t0I9MqK/KI3VjZlaXMv+SBOz1SQ89O8Hw sazBhSSKt8gd6ZVhUaDhKmHcuHe0WeESioV0WgcxSMQGZ4DsBidGMJtZDPKtQ/PwWl irNGjxNcSNoEM/NmkQoJXs5ZhZS7C+grpuDquGdg=
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\))
From: Ladislav Lhotka <lhotka@nic.cz>
In-Reply-To: <20170411.133133.535844576323902109.mbj@tail-f.com>
Date: Tue, 11 Apr 2017 13:56:03 +0200
Cc: Robert Wilton <rwilton@cisco.com>, netmod@ietf.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <D1EA74C4-209C-4DEF-AF29-40F6AB6DBE7D@nic.cz>
References: <773bc744-f147-f854-87c1-cad0d61d1ab8@cisco.com> <20170411.121313.282585946337498966.mbj@tail-f.com> <m2mvbnw5fz.fsf@birdie.labs.nic.cz> <20170411.133133.535844576323902109.mbj@tail-f.com>
To: Martin Björklund <mbj@tail-f.com>
X-Mailer: Apple Mail (2.3259)
X-Virus-Scanned: clamav-milter 0.99.2 at mail
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/xKouwpbhMYN0x5poN_bdRgHgZcg>
Subject: Re: [netmod] YANG doctor review of draft-ietf-netmod-intf-ext-yang-04
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
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, 11 Apr 2017 11:56:10 -0000

> On 11 Apr 2017, at 13:31, Martin Bjorklund <mbj@tail-f.com> wrote:
> 
> Ladislav Lhotka <lhotka@nic.cz> wrote:
>> Martin Bjorklund <mbj@tail-f.com> writes:
>> 
>>> Robert Wilton <rwilton@cisco.com> wrote:
>>>> Hi Vladimir, all,
>>>> 
>>>> 
>>>> On 10/04/2017 17:19, Vladimir Vassilev wrote:
>>>>> Hello,
>>>>> 
>>>>> On 04/06/2017 07:43 PM, Andy Bierman wrote:
>>>>>> 
>>>>>> 3) identity ethSubInterface
>>>>>> 
>>>>>> This identity is used in the encapsulation container when-stmt.
>>>>>> It is not clear if this is intended as a base identity (like identity
>>>>>> sub-interface)
>>>>>> An example for the encapsulation container would help clarify the
>>>>>> expected usage
>>>>>> 
>>>>>> This also has 2 bases (sub-interface and l2vlan).
>>>>>> Some explanation in the identity-stmt would be helpful
>>>>>> (since this is a new YANG 1.1 construct)
>>>>> It seems the intentended result was identity similar to
>>>>> ianaift:atmSubInterface (thus the naming convention change
>>>>> ethSubInterface instead of eth-sub-interface). I think it is less
>>>>> confusing to name the identity with the same naming convention used
>>>>> for the rest of the identities introduced e.g. sub-interface,
>>>>> loopback-internal etc. and if needed define new atm-sub-interface
>>>>> based on sub-interface. I am not sure even atm users would like a
>>>>> model where atmSubInterface will be the only identity of all future
>>>>> sub interface based identities not being derived from sub-interface
>>>>> because of this precedent:
>>>>> 
>>>>>     augment "/if:interfaces/if:interface" {
>>>>>       when "derived-from(if:type,
>>>>>                          'ietf-if-cmn',
>>>>>                          'sub-interface') or
>>>>>             if:type = 'ianaift:atmSubInterface' or
>>>>>             if:type = 'ianaift:frameRelay'"  {
>>>> 
>>>> My idea was that all sub-interfaces could inherit from a common
>>>> identity.  I don't think that this idea just applies to
>>>> sub-interfaces, but other interface properties as well.  E.g.
>>>> sub-interface (i.e. any interface that is logically a child interface
>>>> of some parent interface, e.g. Ethernet/VLAN sub-interface, ATM
>>>> sub-interface, FR sub-interface)
>>>> ethernet-like (i.e. does the interface use ethernet framing).
>>>> E.g. this would apply to physical Ethernet, LAG, IRB interfaces.
>>>> physical (i.e. an interface that is generally instantiated due to some
>>>> physical hardware)
>>>> logical? (This is harder to define, but roughly an interface that is a
>>>> software construct).
>>>> there must be other generic properties as well.
>>>> 
>>>> My main aim is for future flexibility.  I.e. so that if need interface
>>>> types get defined in the future they can share existing interface
>>>> related configuration and state without having to redefine it.
>>>> Similarly, if there are vendor specific variants of interfaces then
>>>> they could also reuse the existing interface related configuration and
>>>> state without having to define vendor specific MTU leaves, etc for the
>>>> new interface type.
>>>> 
>>>> My refinement of this idea, is still to define these generic
>>>> properties, but then revise iana-if-type.yang to add these common
>>>> interface properties as additional base identities.
>>>> 
>>>> E.g.
>>>> 
>>>>     identity interface-property-type {
>>>>       description
>>>>         "Base identity from which all interface properties are
>>>>          derived.";
>>>>     }
>>>> 
>>>> 
>>>>     identity sub-interface-like {
>>>>       description
>>>>         "The interface has sub-interface properties";
>>>>       base interface-property-type;
>>>>     }
>>>> 
>>>>     identity ethernet-like {
>>>>       description
>>>>         "The interface uses ethernet framing, e.g. has a MAC address
>>>>         associated with it.";
>>>>       base interface-property-type;
>>>>     }
>>>> 
>>>>     ...
>>>> 
>>>> 
>>>> Then, for example, the IANA type for atm & l2vlan (if this is the IANA
>>>> type for an Ethernet sub-interface) would change from:
>>>> 
>>>> 
>>>>  identity atmSubInterface {
>>>>    base iana-interface-type;
>>>>    description
>>>>      "ATM Sub Interface.";
>>>>  }
>>>> 
>>>>  identity l2vlan {
>>>>    base iana-interface-type;
>>>>    description
>>>>      "Layer 2 Virtual LAN using 802.1Q.";
>>>>  }
>>>> 
>>>> to:
>>>> 
>>>>  identity atmSubInterface {
>>>>    base iana-interface-type;
>>>>    base sub-interface-like;
>>>>    description
>>>>      "ATM Sub Interface.";
>>>>  }
>>>> 
>>>>  identity l2vlan {
>>>>    base iana-interface-type;
>>>>    base sub-interface-like;
>>>>    description
>>>>      "Layer 2 Virtual LAN using 802.1Q.";
>>>>  }
>>>> 
>>>> and hence the augment can just become:
>>>> 
>>>>     augment "/if:interfaces/if:interface" {
>>>>       when "derived-from(if:type, 'ietf-if', 'sub-interface')"  {
>>>>          ...
>>>>     }
>>>> 
>>>> If someone wants to define a new type of sub-interface in the future
>>>> they can.  They just need to ensure that when they define the type in
>>>> iana-if-types it also derives from the sub-interface property, and
>>>> then they would automatically pick up the generic sub-interface
>>>> configuration leaf.  This would fix this issue that having when
>>>> statements on IANA defined interface types isn't really robust or
>>>> flexible.
>>>> 
>>>> Finally, adding these properties to iana-if-types.yang would be a
>>>> backwards compatible change.
>>>> 
>>>> What are other peoples opinion's on this idea?
>>> 
>>> I think that this is good idea.  We have discussed adding properties
>> 
>> Yes. Such use cases were actually the motivation for introducing
>> multiple inheritance of identities in the first place. 
>> 
>>> as identities before.  Having them in the iana-if-types would make
>>> these types more useful.
>>> 
>>> But this would require a non-signinficant change to
>>> draft-ietf-netmod-intf-ext-yang, right?  We would need an update to
>>> iana-if-types and move the identities there.
>> 
>> But then iana-if-type would diverge from the underlying IANA
>> registry, which would be confusing. It is IMO better to start a new
>> module (or a few of them) with a sound structure of interface types and
>> no reference to the IANA interface registry.
> 
> I don't think it would diverge - all interface types would be there,
> but some have additional properies (which are not visible in the
> MIB).  But the underlying registry somehow needs to be extended.

The IANA registry is mostly rubbish - quite fundamental interface types are missing but, on the other hand, obsolete/experimental/humorous types are there. The plethora of Ethernet types is represented by a single entry (moreover with a totally impossible name).

Lada

> 
> 
> /martin

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