Re: [yang-doctors] Yangdoctors early review of draft-ietf-babel-yang-model-03

Martin Bjorklund <mbj@tail-f.com> Fri, 18 October 2019 06:51 UTC

Return-Path: <mbj@tail-f.com>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EBBF91200D8; Thu, 17 Oct 2019 23:51:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, 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 GixEGBHrrOov; Thu, 17 Oct 2019 23:50:59 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id B2CCC120098; Thu, 17 Oct 2019 23:50:59 -0700 (PDT)
Received: from localhost (h-4-44.A165.priv.bahnhof.se [158.174.4.44]) by mail.tail-f.com (Postfix) with ESMTPSA id 2DE561AE02BD; Fri, 18 Oct 2019 08:50:58 +0200 (CEST)
Date: Fri, 18 Oct 2019 08:50:54 +0200 (CEST)
Message-Id: <20191018.085054.642478611184152689.mbj@tail-f.com>
To: mjethanandani@gmail.com
Cc: rkrejci@cesnet.cz, yang-doctors@ietf.org, draft-ietf-babel-yang-model.all@ietf.org, babel@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <4FF6E800-5D47-491E-9D7C-906951F6C19B@gmail.com>
References: <1D84A1F2-973D-4FF4-B9DE-BC36AECB2069@gmail.com> <eaff5648-33aa-c0c7-0b49-6bee275944c7@cesnet.cz> <4FF6E800-5D47-491E-9D7C-906951F6C19B@gmail.com>
X-Mailer: Mew version 6.8 on Emacs 25.2
Mime-Version: 1.0
Content-Type: Text/Plain; charset=utf-8
Content-Transfer-Encoding: base64
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/QQfB8K88kQXDhfOjSuHSvU2ZOyI>
Subject: Re: [yang-doctors] Yangdoctors early review of draft-ietf-babel-yang-model-03
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 18 Oct 2019 06:51:02 -0000

Mahesh Jethanandani <mjethanandani@gmail.com>; wrote:
> [Trimming the list further down]
> 
> > On Oct 17, 2019, at 1:06 AM, Radek Krejčí <rkrejci@cesnet.cz>; wrote:
> > 
> > Dne 16. 10. 19 v 20:30 Mahesh Jethanandani napsal(a):
> >> [Trimming it down to open issues]
> >> 
> >>>>> - the text "The value MUST be one of those listed in
> >>>>> 'metric-comp-algorithm'." in description just duplicates the type's
> >>>>> information (identityref with metric-comp-algorithms base).
> >>>> How about if it says “The value MUST be one of those listed in ‘metric-comp-algorithm’ typedef.”?
> >>> I see no such typedef in the module (neither in the information model). This is probably again a confusion between information model and yang model. If it refers to information model, I don't think it is a good idea, but it should be at least explicitly stated. If it refers to the leaf's base identity, I don't think that it is necessary to duplicate this information (but I'm not strongly against it, it just make me believe that actually it is some additional restriction to the type itself), because there is already:
> >>> 
> >>> type identityref {
> >>>  base metric-comp-algorithms;
> >>> }
> >>> 
> >>> which also says that the value MUST be one of the identities based on metric-comp-algorithms. And technically, such identities can be added so the possible values do not need to be listed in some text/list/typedef. If you really want to limit the values to some static list, the type should be actually enumeration.
> >> How about we say just that, i.e. “The value MUST be one of the identities based on metric-comp-algorithm”?
> > 
> > my point from the beginning is that it is actually duplicated information. The leaf specification can be read as:
> > 
> > leaf metric-algorithm {
> >   type:  “The value MUST be one of the identities based on metric-comp-algorithms”;
> >   it is mandatory;
> >   description:  “... The value MUST be one of the identities based on metric-comp-algorithms”;
> > }
> > 
> > So I don't think that it is necessary to have that sentence in the description text at all.
> > 
> > I've looked at the model again and I've realized, that there is actually babel/metric-comp-algorithms leaf-list. So despite the model defines set of identities, the server is actually allowed to implement just a subset of them, right? Maybe the intention of the description was to require the value to be one of the values of the leaf-list. Confusion is caused by naming - identity as well as the leaf-list have the same name and it is referenced in the text as metric-comp-algorithm. I see that you cannot use leafref from configuration to state data. So, I see 2 options. First, the sentence in the description should be:
> > 
> > "The value MUST be one of those listed by server as babel/metric-comp-algorithms leaf-list."
> > 
> > or, and I think this is the right solution, remove the babel/metric-comp-algorithms leaf-list and create features for each (there are 2) metric-comp-algorithms identity (add if-feature into them) so the server can say via YANG features mechanism which identities are actually implemented. Then the value of the metric-algorithm leaf will be limited to the metric-comp-algorithms identities with the feature enabled by the server.
> 
> I am ok with the second option. 
> 
> Except I do not know why pyang complains about this.
> 
>   identity two-out-of-three {
>     if-feature two-out-of-three-supported;
>     base "metric-comp-algorithms";
>     description
>       "2-out-of-3 algorithm.";
>   }
> 
>   identity etx {
>     if-feature etx-supported;
>     base "metric-comp-algorithms";
>     description
>       "Expected Transmission Count.";
>   }
> 
> yang/ietf-babel@2019-10-17.yang:88: error: keyword "base" not in canonical order (see RFC 6020, Section 12)
> yang/ietf-babel@2019-10-17.yang:95: error: keyword "base" not in canonical order (see RFC 6020, Section 12)
> 
> Where the ABNF grammar says:
> 
>    identity-stmt       = identity-keyword sep identifier-arg-str optsep
>                          (";" /
>                           "{" stmtsep
>                               ;; these stmts can appear in any order
>                               *if-feature-stmt
>                               *base-stmt
>                               [status-stmt]
>                               [description-stmt]
>                               [reference-stmt]
>                           "}") stmtsep
> 

You are right, this is a bug in pyang, now fixed.


/martin



> 
> Mahesh Jethanandani
> mjethanandani@gmail.com
> 
> 
>