Re: [yang-doctors] Advise

Andy Bierman <andy@yumaworks.com> Sun, 28 February 2021 16:05 UTC

Return-Path: <andy@yumaworks.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 072163A1879 for <yang-doctors@ietfa.amsl.com>; Sun, 28 Feb 2021 08:05:54 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.013
X-Spam-Level:
X-Spam-Status: No, score=0.013 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, T_SPF_PERMERROR=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.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 EiH7mYe3s8aR for <yang-doctors@ietfa.amsl.com>; Sun, 28 Feb 2021 08:05:52 -0800 (PST)
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A94D73A1877 for <yang-doctors@ietf.org>; Sun, 28 Feb 2021 08:05:51 -0800 (PST)
Received: by mail-lf1-x132.google.com with SMTP id d3so21438026lfg.10 for <yang-doctors@ietf.org>; Sun, 28 Feb 2021 08:05:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=27ztkjHPD/6nfnnnPi0918K2mn531WiONeqSOFdTPGA=; b=nN7nywcvQ3KCtctSQVGZqvgJneK6O5WT52Zvx97LFJfterx5RMqJgif1yBrK3S4TpY G/OpQzxt/TvpyJiwN4lAV377Mp6zvY6VfOHaSbIZpiciawH+Q3sc1PtcDjzDZHVfhH8u ZXXNBQu1KdKCh503GFh6mpQRJZCUSNEDiEJbMQlMpxnQBaKbtJQfw8PzLHFU15p5U2s2 kny52ugSOU1BQiXXkq4maL5BcOu1/Scq7eoANrrA1lC0HqfofbJ/t9Qy86rfPlPjZgko JGRz8Yo3I1nNRLBRhDU5A43QIUnVQ0iZAxAS1/FWt4vqNcJn+DPScBbNCLt50hT3g26z MB7Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=27ztkjHPD/6nfnnnPi0918K2mn531WiONeqSOFdTPGA=; b=jGljKJq60Xzf3lKX6NKUv4ATN3YrGg1cqpRBxMr/fpV0lfMsQI6E6R8jUbB8gtD2lG bj6WzoHxQwXEKoVbB5VfiGzuQ9LTUQ4hkQn7xRejMeZDSobBzIbANzzgeZqlWltvOWU+ me/kl+4Xmzd3T7o5lpCsl4lb0yVyFRQae6RNiEjXOK5Tv0bdhvbHe+54QXnr2g1aDboE FYOxlDNAlC2fHQYWcjzznrWTe4TVrG7+axFWOeWZvk/LRrzI+n/Gy+0i2J0l+rlRghN0 UyqMz0NSH50yR+3VAGmNaMSTn6WiZdHBxZECINBoxZQYet/OYRysTBzasMApi2sIaPFh m4hw==
X-Gm-Message-State: AOAM533QVLrlVxhH6tJ1pTI6f/U7KYJUs0uf870WJMEzu7Gx6/izz8M/ exgf6xrebCKkN72ZhcLMyyDmZCoKp42Ru19REyKQ/Q==
X-Google-Smtp-Source: ABdhPJzNA1SzPvoB5sTSPH4FfN+lTHFThpjqeyjemG7x3yy3Wwav3xrqbH9rPo+dr4AIGgTPZm9knH8wBJc4blEBDEA=
X-Received: by 2002:a05:6512:39c5:: with SMTP id k5mr6969997lfu.478.1614528344591; Sun, 28 Feb 2021 08:05:44 -0800 (PST)
MIME-Version: 1.0
References: <FFD5660B-5696-4713-A694-3B1B4E807E29@gmail.com>
In-Reply-To: <FFD5660B-5696-4713-A694-3B1B4E807E29@gmail.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Sun, 28 Feb 2021 08:05:33 -0800
Message-ID: <CABCOCHRNA6=9obLekxRh3BVRJLkQdPjhW6SvDWguJtGu31MGZw@mail.gmail.com>
To: Mahesh Jethanandani <mjethanandani@gmail.com>
Cc: YANG Doctors <yang-doctors@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000075ab8705bc67acf6"
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/DQxHGknTtA3ZDc7ZAv06QmVHfNs>
Subject: Re: [yang-doctors] Advise
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: Sun, 28 Feb 2021 16:05:54 -0000

On Thu, Feb 25, 2021 at 3:32 PM Mahesh Jethanandani <mjethanandani@gmail.com>
wrote:

> Hi Fellow YANG experts,
>
> I am reviewing the YANG model being published as part of
> draft-ietf-ccamp-flexigrid-yang
> <https://datatracker.ietf.org/doc/html/draft-ietf-ccamp-flexigrid-yang-09#section-6>
> which is tightly tied to the YANG model in draft-ietf-ccamp-wson-yang
> draft, that Acee is reviewing.
>
> I find the approach that this models and the approach other models have
> taken from the same WG as unusual, and I was wondering if there was any
> advise one could give on the design of the model. Maybe it is just me but
> when I see 80 augment statements in a model, something looks unusual.
>
>

It is not unusual for the design patterns that are being used in the IETF.
Operators like the hierarchical design of YANG (and before that CLI).
There are lots of empty containers and choices that are meant to be the root
of augmentations from other modules.

RFC 8345:

   A network has a certain type, such as L2, L3, OSPF, or IS-IS.  A
   network can even have multiple types simultaneously.  The type or
   types are captured underneath the container "network-types".  In this
   model, it serves merely as an augmentation target; network-specific
   modules will later introduce new data nodes to represent new network
   types below this target, i.e., will insert them below "network-types"
   via YANG augmentation.


The first thing that stood out for me was a presence container that was
> used to identify the type of topology the model supports, with nothing else
> in the container.
>
>      augment "/nw:networks/nw:network/nw:network-types"
>            + "/tet:te-topology" {
>        description
>          "Augment network types to define flexi-grid topology type.";
>        container flexi-grid-topology {
>          presence
>            "Its presence identifies the flexi-grid topology type.";
>          description
>            "Introduce new network type for flexi-grid topology.";
>        }
>      }
>
> That presence container is then used all over the model to support a
> ‘when’ statement:
>
>        when "/nw:networks/nw:network/nw:network-types"
>           + "/tet:te-topology/tet-flexig:flexi-grid-topology" {
>          description
>          "Augmentation parameters apply only for networks with
>           flexi-grid topology type.";
>        }
>
> Could a simple ’type’ node have achieved the same purpose? Or maybe a
> ‘feature’ statement??
>
>

The P-container is serving as both the instance-enabled flag and the
augment root

A feature applies to all instances, but a when-stmt can be per-instance.
However in this case the
XPath does not do that (and probably not what the authors think they wrote).
Then when-stmt is true if ANY network list entry has the P-container
instance.

Since when-stmt applies to instances, not the schema, it is probably
pointless to add a
when-stmt to check if the /foo/bar instance exists before augmenting
/foo/bar, IFF bar is a list or a P-container.
If the when /foo/bar is used to test augment /another/subtree then maybe a
feature would work better.



The rest of the model is a set of 80 augment statement, each augmenting a
> particular node in the topology defined by the ietf-te-topology model to
> add a few nodes to that branch of the topology, most of that being one node.
>
>      augment /nw:networks/nw:network/nt:link/tet:te
>                /tet:information-source-entry/tet:label-restrictions
>                /tet:label-restriction/tet:label-end/tet:te-label
>                /tet:technology:
>        +--:(flexi-grid)
>           +--ro flexi-n?   l0-types:flexi-n
>
> Could this be better designed? As an operator, I would find configuration
> using this model to be very tedious. Not being an expert of Traffic
> Engineering (TE), I am not able to comment if this is how TE expects the
> configuration to happen, or if it this design that is flawed. Any advise?
>
>

I don't know in this case without reading the draft and related RFCs.
At some point it is better to gather the augmenting (flexi-grid)
parameters together and
use leafrefs to link these data structures to the ietf-network framework,
so there are a limited number of augmentations that point back to the
flexi-grid parameters.


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


>
>
> _______________________________________________
> yang-doctors mailing list
> yang-doctors@ietf.org
> https://www.ietf.org/mailman/listinfo/yang-doctors
>