Re: [Lsr] Yangdoctors last call review of draft-ietf-isis-sr-yang-13

Yingzhen Qu <yingzhen.ietf@gmail.com> Thu, 18 August 2022 17:45 UTC

Return-Path: <yingzhen.ietf@gmail.com>
X-Original-To: lsr@ietfa.amsl.com
Delivered-To: lsr@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 73813C14F74A; Thu, 18 Aug 2022 10:45:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.104
X-Spam-Level:
X-Spam-Status: No, score=-2.104 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W0ZE9QJ91xhR; Thu, 18 Aug 2022 10:45:15 -0700 (PDT)
Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id F3C27C1522B1; Thu, 18 Aug 2022 10:45:11 -0700 (PDT)
Received: by mail-pj1-x1029.google.com with SMTP id e19so1188352pju.1; Thu, 18 Aug 2022 10:45:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc; bh=DuPvUArvNVXictlCjx/2NyMBpdp4XanMhGGEB6J1b38=; b=lDGIMnWytmab7EMXwTSfKC8XB41Dtfm/mqDS9VGAqcc919yMMcUKgle++NMsfbkz6P RhOePRE1kvzdDTeyKTtrtNLBowZMMru/cl/Dlrg6a5NvW1Eml8fGscWMcpQfGIkA4hON fEbpmcOyQpEct7gub8Nk3Yxf3ad4PFtKYkrrstWbaoqjkq/7paxRYu6dv5n1vMQvdp4A QK4/d+2dK5G8ynvFCl2w/6DzFK8WulLrKrT/6biUJAfcQErnBgEg28LerqCoousm/8sb jNA8PWo9m1GjJEAkSjSB0IHR4+rtlE+G1IPO0yPt05vQsG6DUr/FkqNGZsH2u+ikH464 IkOw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc; bh=DuPvUArvNVXictlCjx/2NyMBpdp4XanMhGGEB6J1b38=; b=TTCxZvy1+e13Kbyy+DwaBLLUxGSA79BaYPDOsSS+Zbi60+rZP9LBymqHWv+LJF+pQa k+3VwU17P4bNlAZAogwj+z6I5FIsRRwFUs2p0yyknRkvkzj0NHw4FrMre/gtghqdY5c4 hYdmGGTfxy3F4vuq5Bq4cq2Svxj/E0a/yH0R27gXDArnzluG0iqzGgziN0Q+Zi1Zu/60 LEayVSzgDMBi1c1Gsz0JlUI5sHHYYIWtN9g8KIT+It6SL5TJVvK821g55Q28WkZQADUO maSmcnxO13O7PlFr6d8URmVVciuVJZuRKxjgOvz1IQKpTBeXMYKboQfgwCXQ4/L8FA8A UWlg==
X-Gm-Message-State: ACgBeo2qIPQxQvUeL1W8SNVYKcr0Hxbct6fTe3+BnRgx+phRERQpj7Ja PJUUcCEWH7NDmazAW0WKwgChOZzEsrv4
X-Google-Smtp-Source: AA6agR6VBIXfiXGmFB8RlvQtxJLA2QKqpUSeNOiZOrGqTcMdJ2G1CZ+tr+bT2fPKIZdwgdvsxf65/A==
X-Received: by 2002:a17:90a:4887:b0:1f7:7676:e46e with SMTP id b7-20020a17090a488700b001f77676e46emr9660244pjh.107.1660844711076; Thu, 18 Aug 2022 10:45:11 -0700 (PDT)
Received: from smtpclient.apple ([2601:646:9702:c61:1ccc:f204:43a9:293b]) by smtp.gmail.com with ESMTPSA id i8-20020a056a00224800b0053554e0e950sm1942135pfu.147.2022.08.18.10.45.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Aug 2022 10:45:10 -0700 (PDT)
From: Yingzhen Qu <yingzhen.ietf@gmail.com>
Message-Id: <0569E8EA-357B-43E0-8EFA-AD61476BB160@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_EF79C1F5-DD47-45CC-B4F7-BEDE88669DCE"
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
Date: Thu, 18 Aug 2022 10:45:05 -0700
In-Reply-To: <166075135339.5351.4264345611711314030@ietfa.amsl.com>
Cc: yang-doctors@ietf.org, draft-ietf-isis-sr-yang.all@ietf.org, last-call@ietf.org, lsr@ietf.org
To: Jan Lindblad <janl@tail-f.com>
References: <166075135339.5351.4264345611711314030@ietfa.amsl.com>
X-Mailer: Apple Mail (2.3654.120.0.1.13)
Archived-At: <https://mailarchive.ietf.org/arch/msg/lsr/Lt1P-SG12LmltzmIPHe4djfXEC0>
Subject: Re: [Lsr] Yangdoctors last call review of draft-ietf-isis-sr-yang-13
X-BeenThere: lsr@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Link State Routing Working Group <lsr.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/lsr>, <mailto:lsr-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/lsr/>
List-Post: <mailto:lsr@ietf.org>
List-Help: <mailto:lsr-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/lsr>, <mailto:lsr-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 18 Aug 2022 17:45:19 -0000

Hi Jan,

Thank you for the review, really appreciate. Please see my answers below inline.

Version -14 has been submitted including all the suggested changes.

Thanks,
Yingzhen

> On Aug 17, 2022, at 8:49 AM, Jan Lindblad via Datatracker <noreply@ietf.org> wrote:
> 
> Reviewer: Jan Lindblad
> Review result: Ready with Issues
> 
> This is the YANG Doctor last call review of draft-ietf-isis-sr-yang-13. I think
> this module is written in a nice, straight forward way. There are a few things
> that have to be fixed before this can be published, however, so I will call it
> ready with issues.
> 
> #1: Dependency on unpublished module
> 
> The ietf-isis-sr module under discussion here imports module ietf-isis. That
> module is still not published as an RFC. For the review here I used the
> ietf-isis.yang as defined in draft-ietf-isis-yang-isis-cfg-42. If the
> ietf-isis.yang module changes before it is published, that could potentially
> affect ietf-isis-sr.
> 
> A closely related observation is that the import statement lacks an import
> reference. Maybe you could add a placeholder reference until you know what RFC
> number to reference?
> 
>  import ietf-isis {
>    prefix "isis";
>  }
[Yingzhen]: You’re right about the dependency here. We’ve been waiting for the publication
of the base ISIS model, which has a dependency of https://datatracker.ietf.org/doc/draft-ietf-bfd-rfc9127-bis/ <https://datatracker.ietf.org/doc/draft-ietf-bfd-rfc9127-bis/>.
Now they’re close to be published, so we requested the review of this document to get it ready.
I added a place holder for the reference as you suggested.

> 
> #2: Inappropriate when expressions
> 
> The following when expression appears 13 times in the module. There are two
> problems with it.
> 
>    when "/rt:routing/rt:control-plane-protocols/"+
>         "rt:control-plane-protocol/rt:type = 'isis:isis'" {
> 
> Direct equality comparison with identities is generally not recommended, as
> that removes the possibility to "subclass" isis:isis into variants in the
> future. The recommended approach is to use the XPath function
> derived-from-or-self() instead. See below.
> 
> The other problem with this when expression is worse. Since an unqualified
> absolute path is used, the expression becomes true for all
> routing-plane-protocol instances as soon as there is at least one of isis type.
> This enables the isis-sr extensions inside all routing-plane-protocol instances
> as soon as there is at least one isis instance in the system. I don't believe
> this was what the authors intended.
> 
> There are several possible ways to remedy the situation. The one I would
> recommend is to use relative paths in the when expression so that the path
> never leaves the current control-plane instance. Since the relative path is a
> little different depending on where it is used, I'll provide two examples. Just
> let me know once you've updated all 13 of them, and I'll review.
> 
> // Line 503
>  augment "/rt:routing/" +
>          "rt:control-plane-protocols/rt:control-plane-protocol"+
>          "/isis:isis" {
> //OLD    when "/rt:routing/rt:control-plane-protocols/"+
> //OLD         "rt:control-plane-protocol/rt:type = 'isis:isis'" {
>    when "derived-from-or-self(../rt:type, 'isis:isis')" {
> 
> // Line 587
>  augment "/rt:routing/" +
>          "rt:control-plane-protocols/rt:control-plane-protocol"+
>          "/isis:isis/isis:interfaces/isis:interface" +
>          "/isis:adjacencies/isis:adjacency" {
> //OLD    when "/rt:routing/rt:control-plane-protocols/"+
> //OLD         "rt:control-plane-protocol/rt:type = 'isis:isis'" {
>    when "derived-from-or-self(../../../../../rt:type, 'isis:isis')" {
> 
> Basically, you add one ../ for each name in the augment path, starting at the
> tail end working towards the beginning, until you hit the name
> rt:control-plane-protocol (because it is the parent node of rt:type).
> 
> If you prefer, there are solutions using absolute paths too. In that case you
> need to add filters ("predicates") for the control-plane-protocol keys to the
> when expression path. But IMO the method I explained above is probably easier
> to follow.
[Yingzhen]: Thanks for pointing this out. I’ve changed the model to use relative path.
Please kindly let me know if you see any issues.
> 
> #3: No mandatory, no default, no description
> 
> Some leafs in the module are not mandatory, have no default and no text in the
> description that would explain how to interpret this ambiguous situation.
> 
>    container ti-lfa {
>      if-feature ti-lfa;
>      leaf enable {
>        type boolean;
>        description
>          "Enables TI-LFA computation.";
>      }
> ...
>    leaf use-segment-routing-path {
>      if-feature remote-lfa-sr;
>      type boolean;
>      description
>        "force remote LFA to use segment routing
>         path instead of LDP path.";
>    }
> 
> The client may configure leaf enable to 'true' or 'false', in which case the
> meaning of the configuration is clear. The client may also omit giving these
> leafs any value. What happens then? You could explain what happens in the
> description, e.g. "When left without a value, the system will bla bla...". Or
> you could add a default statement, resolving any ambiguity, e.g. default false.
> Or you could declare the leaf mandatory, in which case the client would be
> forced to make a choice, i.e., mandatory true;
> 
> There are also many operational leafs that have this property, which makes it
> easier for server implementors to get away with implementations that omit
> returning some of these leafs. So if you think some of them are particularly
> important for clients, consider marking them mandatory, so that servers
> understand it's not ok to omit them.
> 
[Yingzhen]: I added default value for these two leaves. 

> #4: Indentation
> 
> The indentation of the module is apparently done by hand and a tad sloppy. By
> running the following pyang command, you get a file with the indentation
> cleaned up. It also removes unnecessary quotes and a few other things. In case
> you want full control over your own module, you can just diff the two to find
> places where the indentation might not be done properly.
> 
> pyang -f yang ietf-isis-sr\@2022-08-09.yang >
> ietf-isis-sr\@2022-08-09-indented.yang
> 
[Yingzhen]: fixed.

> #5: List keys not going first
> 
> The module contains four lists with keys. In three of them, the definitions of
> the key element does not go first in the list. Here, for example, there is a
> leaf af before leaf value (the key). This is perfectly valid YANG, but server
> implementors MUST return the key first in the NETCONF payload. Therefore it is
> customary to define the key(s) first inside the list (in the same order as in
> the key statement), to adhere to the principle of least surprise.
> 
>    list adjacency-sid {
>      key value;
>      config false;
>      leaf af {
>        type iana-rt-types:address-family;
>        description
>          "Address-family associated with the
>           segment ID";
>      }
>      leaf value {
>        …
[Yingzhen]: fixed as suggested.

> #6: Keyless lists
> 
> There are two keyless lists in the module. Keyless lists are allowed in YANG
> for operational data. But that they are allowed does not necessarily mean they
> are a good idea.
> 
>        list global-block {
>          description "Segment Routing Global Block.";
>          leaf range-size {
>            type uint32;
>            description "The SID range.";
>          }
>          uses sid-sub-tlv;
>        }
> ...
>      list local-block {
>        description "Segment Routing Local Block.";
>        leaf range-size {
>          type uint32;
>          description "The SID range.";
>        }
>        uses sid-sub-tlv;
>      }
> 
> If there is no natural key for these lists and there aren't too many elements
> in them in a typical system, then maybe leaving the list as keyless may be
> fine. But if you can have hundreds or thousands of these list elements, keyless
> lists are problematic. It's basically impossible for interested clients to read
> anything else than the entire list every time when there is no key. There is no
> way to identify list entries that have been added, removed or changed, so all
> this data has to be read every time. If the data might be large, adding a key
> (natural or synthetic) would improve performance.
> 
[Yingzhen]: Thanks for the suggestion. However for these two specific lists, the number
of elements are expected to be a few, or only one or two, so I suppose keyless is ok.

> #7: Unclear+open ended string format
> 
> The leaf fec has a string type and a pretty vague description. What is the
> valid format for this leaf? Different implementors will probably allow
> different formats here, rendering the module non-interoperable, despite efforts
> to standardize.
> 
>      leaf fec {
>        type string;
>        description
>        "IP (v4 or v6) range to be bound to SIDs.";
>      }
> 
> Worse, since this is a key, a client might specify multiple list entries with
> different strings that map to the same underlaying range. For example, the YANG
> model currently allows a client to configure all of these as distinct list
> entries:
> 
> "2001:0000::47/50"
> "2001:0::47/50"
> "2001::47/50"
> "::1.2.3.4"
> "::1:2:3:4"
> "0::1:2:3:4"
> 
> Sorry if I got the format wrong, I have to guess here :-) Hopefully you get my
> point anyway. Changing to a more precise type would certainly be a good idea,
> and particularly so for a key leaf.
> 
[Yingzhen]: I looked at RFC 8667 and changed this to ip-prefix. Thanks for catching this.
> ##
> 
> 
>