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

Robert Wilton <rwilton@cisco.com> Mon, 10 April 2017 17:16 UTC

Return-Path: <rwilton@cisco.com>
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 E3D601294EF for <netmod@ietfa.amsl.com>; Mon, 10 Apr 2017 10:16:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.522
X-Spam-Level:
X-Spam-Status: No, score=-14.522 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.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 7nBTMBETHwPQ for <netmod@ietfa.amsl.com>; Mon, 10 Apr 2017 10:16:57 -0700 (PDT)
Received: from aer-iport-2.cisco.com (aer-iport-2.cisco.com [173.38.203.52]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E82E41277BB for <netmod@ietf.org>; Mon, 10 Apr 2017 10:16:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=13669; q=dns/txt; s=iport; t=1491844616; x=1493054216; h=subject:to:references:from:message-id:date:mime-version: in-reply-to; bh=YVifpz5yhcYT17FRTI1N9rSSlSPYTF2dK9dgPUxuZW4=; b=hRpihimvh5epeUk00DsvDHXv9au8wrXxWJdZVSNq5Dgo/m6PDo6G7aya bXih4IGD15p3RrpVui8KcoEyHP/3RxHNQOp9G4KPE1occ8qQMWseBfwRC YFX48s3S2X3eok8Z6Gdthm35sB5Fw9xbjSEkY3eMTcnKpM9rh4kzPEXuo w=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0ACAQAavetY/xbLJq1TCRkBAQEBAQEBAQEBAQcBAQEBAYJuOoEMgQuNeXOQVZAjhTSCDyEBCoJCgmxKAoQlGAECAQEBAQEBAWsohRUBAQEBAgEBAWwbCxguJzAGAQwGAgEBigMIDqsoK4pSAQEBAQEBAQEBAQEBAQEBAQEBAQEBGAWGUIIFgmuEL4VtHwWJLIY+jRGSWYNfhwWGXYtkiBwfOIEFJRYIGBVBhls/NYlfAQEB
X-IronPort-AV: E=Sophos;i="5.37,182,1488844800"; d="scan'208,217";a="651035671"
Received: from aer-iport-nat.cisco.com (HELO aer-core-4.cisco.com) ([173.38.203.22]) by aer-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2017 17:16:52 +0000
Received: from [10.63.23.150] (dhcp-ensft1-uk-vla370-10-63-23-150.cisco.com [10.63.23.150]) by aer-core-4.cisco.com (8.14.5/8.14.5) with ESMTP id v3AHGq7C014701; Mon, 10 Apr 2017 17:16:52 GMT
To: Vladimir Vassilev <vladimir@transpacket.com>, "netmod@ietf.org" <netmod@ietf.org>
References: <CABCOCHTtihJuFauSW4KmaoCHJSFYgNCR200MWsLQ_7456HsO0w@mail.gmail.com> <589a9020-b987-dbe5-d704-cf981de33b51@transpacket.com>
From: Robert Wilton <rwilton@cisco.com>
Message-ID: <773bc744-f147-f854-87c1-cad0d61d1ab8@cisco.com>
Date: Mon, 10 Apr 2017 18:16:52 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <589a9020-b987-dbe5-d704-cf981de33b51@transpacket.com>
Content-Type: multipart/alternative; boundary="------------CB0BB9A47E8825983BB5C043"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/OtXxwiBlLPWuEdh_uubQBVcZSM0>
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: Mon, 10 Apr 2017 17:17:00 -0000

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?

Thanks,
Rob


>
> Vladimir
>>
>>
>> Andy
>>
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
> .
>