Re: [Netconf] [yang-doctors] YANG Doctor question: empty mandatory choice? (was RE: YangPush now)

"Eric Voit (evoit)" <> Fri, 27 July 2018 20:27 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id EFD0A130DF5; Fri, 27 Jul 2018 13:27:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -14.511
X-Spam-Status: No, score=-14.511 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id tQ_ZrJleh8eV; Fri, 27 Jul 2018 13:27:30 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 5DCD2129385; Fri, 27 Jul 2018 13:27:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;;; l=3896; q=dns/txt; s=iport; t=1532723250; x=1533932850; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=zEIONhHP2H7JPuk99fnp+LRpz6WSUYYYBJMXpk1sTjQ=; b=GUwNWTvwYvdEaB2KNQR7jCLLhsY9FiECF0o0S/Bq16mzMHVNNkxcxJRP MmOQyvKzMWRK85OjZ2Rc+mOLYuPYz5kIbYHugm2JKGs0cSNXhgFD6HCQJ PR5sR3iFDKRzeNU0yvhNgPzzB3TMJMrf1gdx7NCEDtiP2b+MR+JrveWGZ w=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DzBAAtf1tb/49dJa1SCRkBAQEBAQE?= =?us-ascii?q?BAQEBAQEHAQEBAQGDToFiMoN0lEKCDIM7lBALhGwCF4JkITgUAQIBAQIBAQJ?= =?us-ascii?q?tKIU2AQEBAQIBIxFFBQsCAQYCDgcFAgkdAgICMBUQAgQBDQ2FEAiSBptHgS6?= =?us-ascii?q?KT4ELh3cXgUE/gRGDEoRTBBCDF4I1IAKMaI0jCQKPLI4Okg0CERSBJDQhgVJ?= =?us-ascii?q?wFTuCaoIkFxGOBo1+gS2BGwEB?=
X-IronPort-AV: E=Sophos;i="5.51,411,1526342400"; d="scan'208";a="419605532"
Received: from ([]) by with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jul 2018 20:27:29 +0000
Received: from ( []) by (8.15.2/8.15.2) with ESMTPS id w6RKRTJQ019099 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Fri, 27 Jul 2018 20:27:29 GMT
Received: from ( by ( with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 27 Jul 2018 16:27:28 -0400
Received: from ([]) by ([]) with mapi id 15.00.1320.000; Fri, 27 Jul 2018 16:27:28 -0400
From: "Eric Voit (evoit)" <>
To: Kent Watsen <>, "Andy Bierman (" <>
CC: "" <>, "" <>
Thread-Topic: [Netconf] [yang-doctors] YANG Doctor question: empty mandatory choice? (was RE: YangPush now)
Date: Fri, 27 Jul 2018 20:27:28 +0000
Message-ID: <>
References: <> <> <> <> <> <> <> <> <> <>
In-Reply-To: <>
Accept-Language: en-US
Content-Language: en-US
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: []
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Archived-At: <>
Subject: Re: [Netconf] [yang-doctors] YANG Doctor question: empty mandatory choice? (was RE: YangPush now)
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: Network Configuration WG mailing list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 27 Jul 2018 20:27:32 -0000

> From: Kent Watsen, Friday, July 27, 2018 2:03 PM
> > I would prefer to not add empty mandatory choices to any YANG module.
> > An empty choice is bad enough. In 2119 terms, using this container is
> > a SHOULD, not a MUST.
> Moving past the syntax-level discussion:
> 1) do you agree that a transport MUST be configured?
>        - if not, then how is this a configuration model when half the config is
>          hidden behind vendor magic?  In my view, this pushes the limit of
>          reasonableness.

I think transport MUST be configured.   

But as today's transport configuration is vendor specific, I am not sure as to whether this is a requirement which the SN YANG model structure itself enforces.  (See next comment.)

>   2) do you agree that at most only one transport can be configured per
> "receiver"?


There are alternative ways to do this.  For example we could assert that when a "-notif" draft designer does a augmentation of transport specific objects, those augmentations MUST include XPATH constraint from those objects to a specific instance of "transport" under the subscription.   (E.g., you can only augment leafref instances pointing to ietf-netconf-server if the subscription's transport is "NETCONF".)  For example:

module ietf-netconf-subscribed-notifications {
  prefix nsn;
  import ietf-netconf-client { prefix ncc; }
  import ietf-subscribed-notifications { prefix sn; }

  identity netconf {
    base sn:transport;
    base sn:inline-address;
      "NETCONF is used as a transport for notification messages and
       state change notifications.";

  augment "/sn:subscriptions/sn:subscription/sn:receivers/sn:receiver" {
   when 'derived-from(../../../transport, "nsn:netconf")';   
      "This augmentation allows NETCONF specific parameters to be exposed for a receiver.";
    leaf netconf-endpoint {
      type leafref {
        path "/ncc:netconf-client/ncc:initiate/ncc:netconf-server/ncc:endpoints/ncc:endpoint/ncc:name";
        "Remote client which need to initiate the NETCONF transport if an existing NETCONF session from that client is not available.";

With such models, one transport per receiver should result.


>         - this is perhaps arguable but, if needed, then I'd push for a list with
>           min-elements 1.   That said, why support multiple transports under
>           a single "receiver", when multiple "receiver" instances can be created,
>           one for each?   Additionally, it muddies what the text means by
>           "receiver state", as then there would have to be state per transport.
> Kent // contributor