Re: [netmod] draft-ietf-tictoc-1588v2-yang-05: port-number

Martin Bjorklund <mbj@tail-f.com> Mon, 02 October 2017 18:14 UTC

Return-Path: <mbj@tail-f.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 41370132FA7; Mon, 2 Oct 2017 11:14:33 -0700 (PDT)
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, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] 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 8xJtkhJ5NMGR; Mon, 2 Oct 2017 11:14:31 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 6F03113469D; Mon, 2 Oct 2017 11:14:31 -0700 (PDT)
Received: from localhost (h-40-225.A165.priv.bahnhof.se [94.254.40.225]) by mail.tail-f.com (Postfix) with ESMTPSA id 547CD1AE018C; Mon, 2 Oct 2017 20:14:30 +0200 (CEST)
Date: Mon, 02 Oct 2017 20:14:30 +0200 (CEST)
Message-Id: <20171002.201430.1078877259363120382.mbj@tail-f.com>
To: rodney.cummings@ni.com
Cc: tictoc@ietf.org, netmod@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <DM2PR0401MB13896A98E4D5799F369EB71C927D0@DM2PR0401MB1389.namprd04.prod.outlook.com>
References: <DM2PR0401MB13896A98E4D5799F369EB71C927D0@DM2PR0401MB1389.namprd04.prod.outlook.com>
X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/u3GTVkeLoyYybr3q54iBP8oy_xg>
Subject: Re: [netmod] draft-ietf-tictoc-1588v2-yang-05: port-number
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, 02 Oct 2017 18:14:33 -0000

Rodney Cummings <rodney.cummings@ni.com> wrote:
> Hi folks,
> 
> One of the last topics that we need to resolve for WG Last Call of
> draft-ietf-tictoc-1588v2-yang-05 is the representation of port-number,
> which serves as the key to the list of 1588 port data sets
> (i.e. port-list). I've had some offline discussion with IEEE 1588 WG
> members, and I'm copying NETMOD members for YANG expertise.
> 
> I think we can narrow the possible options to two, so I'm starting a
> new thread to focus on those.
> 
> IEEE Std 1588-2008 is the time sync standard that specifies the
> information model on which draft-ietf-tictoc-1588v2-yang-05 is
> based. In IEEE Std 1588-2008, subclause 5.3.5 specifies the following
> data type to identify each logical port in the 1588 product:
>    struct PortIdentity {
>       ClockIdentity clockIdentity;
>       Uinteger16 portNumber;
>    };
> IEEE Std 1588-2008 uses this data type as the "portIdentity" of the
> port in its on-the-wire protocol, state machines, and so on. In other
> words, in the 1588 standard itself, portIdentity is a "real thing"
> with real implementation.
>  
> IEEE Std 1588-2008 also specifies a list of logical ports in each
> "clock", and portIdentity.portNumber is used as the key to that list
> of ports.
> 
> In the YANG of draft-ietf-tictoc-1588v2-yang-05, we use YANG-style
> names (e.g. port-list, port-number), but otherwise we've tried to keep
> consistent to the IEEE Std 1588-2008 information model.
> 
> We have a challenge with port-number. If YANG represents port-identity
> as a container within port-list, YANG does not allow a key to be a
> leaf within a container, so we cannot use port-identity/port-number as
> the key to port-list.
> 
> It seems that we have two options:
> 
> Option 1: Use a leafref
> ---
> 
> YANG summary:
> 
>         list port-ds-list {
>           key "port-number";
>           leaf port-number {
>             type uint16;
>           }
>           container port-identity {
>              leaf clock-identity {
>                 type clock-identity-type;
>                 config false;
>              }
>              leaf port-number {
>                 type leafref{
>                    path "../../port-number";
>                 }
>                 config false;
>              }
>           }
>         }
> 
> This has disadvantages from the YANG perspective, in that port-number
> is duplicated. The "config false" is intended to mitigate YANG
> implementation challenges, such that only one value of port-number is
> provided for configuration.
> 
> Option 2: Use a grouping
> ---
> 
> YANG summary:
> 
>      grouping port-identity-grouping {
>        leaf clock-identity {
>          type clock-identity-type;
>        }
>        leaf port-number {
>          type uint16;
>        }
>      }
>      list port-ds-list {
>        key "port-number";
>        uses port-identity-grouping;
>      }
> 
> This has disadvantages from the 1588 perspective, in that it is not
> possible for a 1588-aware management client to "get" portIdentity. We
> are removing a 1588 "real thing" from the data model in order to
> accommodate a syntax limitation of YANG.

I think that in general when you go from an information model to a
concrete data model, you need to adapt to the data modelling language
you are using, and this will in most cases mean that there will be
some differences; in some cases the data model structure is different,
and in some cases the data model will result in a more detailed
model.  How keys are specified is one such example.  If you were to
use SMIv2, you'd have to change the names (so that they are unique),
and you'd have to map the structures to conceptual tables.

Clients need to understand the data model in use (not just the
information model behid it).

> Question for NETMOD experts
> ---
> 
> My personal preference is Option 1 (leafref). Nevertheless, if the
> "config false" does not provide sufficient mitigation for today's YANG
> implementations, we can go with Option 2.

I don't think any implementation would have any problem supporting
option 1, but it does look a bit odd.  Also, it only "helps" if the
client is getting the data using <get>, but it will not help if it is
using <get-config>.


I think that the cleanest solution is to not try to completely mimic
the structure from the information model, but make sure that the
text in the description statements make it clear that the data model
looks different compared to the information model, in order to help
the readers.



/martin



> 
> Feedback is very much appreciated.
> 
> Thanks folks,
> Rodney Cummings
> Co-author draft-ietf-tictoc-1588v2-yang-05
> 
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>