Re: [Netconf] mbj's WGLC review of subscribed-notifications-16

Martin Bjorklund <mbj@tail-f.com> Thu, 13 September 2018 14:21 UTC

Return-Path: <mbj@tail-f.com>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B17451252B7 for <netconf@ietfa.amsl.com>; Thu, 13 Sep 2018 07:21:20 -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 H2uSVJ6UdM07 for <netconf@ietfa.amsl.com>; Thu, 13 Sep 2018 07:21:18 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 7EA08124D68 for <netconf@ietf.org>; Thu, 13 Sep 2018 07:21:18 -0700 (PDT)
Received: from localhost (h-80-27.A165.priv.bahnhof.se [212.85.80.27]) by mail.tail-f.com (Postfix) with ESMTPSA id 6A4F41AE018A; Thu, 13 Sep 2018 16:21:17 +0200 (CEST)
Date: Thu, 13 Sep 2018 16:21:17 +0200
Message-Id: <20180913.162117.1031242545011500593.mbj@tail-f.com>
To: evoit@cisco.com
Cc: netconf@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <20180913.092134.395462318086733174.mbj@tail-f.com>
References: <20180912.113446.2017030234338816835.mbj@tail-f.com> <013a970e210d4b9693116818f3d5688e@XCH-RTP-013.cisco.com> <20180913.092134.395462318086733174.mbj@tail-f.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/netconf/6cqyEdj8g6ykWWR0wOySoKZ6h4c>
Subject: Re: [Netconf] mbj's WGLC review of subscribed-notifications-16
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Network Configuration WG mailing list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 13 Sep 2018 14:21:21 -0000

Hi,

One problematic thing below.

Martin Bjorklund <mbj@tail-f.com> wrote:
> Hi,
> 
> Thank you for addressing my comments.  More inline.
> 
> 
> "Eric Voit (evoit)" <evoit@cisco.com> wrote:
> > Hi Martin,
> > 
> > Much incorporated.  Latest is at:
> > https://github.com/netconf-wg/rfc5277bis/blob/master/draft-ietf-netconf-subscribed-notifications-17.txt
> > 
> > Specific responses in-line...
> > 
> > > From: Martin Bjorklund, September 12, 2018 5:35 AM
> > > 
> > > "Eric Voit (evoit)" <evoit@cisco.com> wrote:
> > > > Thanks for the comments Martin,  thoughts in-line...
> > > >
> > > > > From: Martin Bjorklund, September 10, 2018 1:42 PM
> > > 
> > > [...]
> > > 
> > > > > o  Section 2.1
> > > > >
> > > > >   The text says:
> > > > >
> > > > >     It is out of the scope of this document
> > > > >     to identify [...] b) how event records are defined
> > > > >
> > > > >   Is this really what we want?  Shouldn't this document specify that
> > > > >   an event record is an instance of a YANG "notification" statement?
> > > > >   Do we want to support event records that are not defined in YANG?
> > > > >
> > > > >   This was discussed in the thread "comments on
> > > > >   draft-ietf-netconf-subscribed-notifications-12", and it seems that
> > > > >   noone really have any use case for non-YANG-defined event records,
> > > > >   accessed with YANG-defined operations.
> > > >
> > > > Yes this was discussed previously.  My reading was that others wanted
> > > > to support subscription to non-YANG events.
> > > > E.g., see Andy & Tianran's thoughts in
> > > > https://www.ietf.org/mail-archive/web/netconf/current/msg14764.html
> > > 
> > > Yes, but read on in that thread, see
> > > https://www.ietf.org/mail-archive/web/netconf/current/msg14766.html
> > > for a clarification.
> > > 
> > > AFAIK, noone has presented a use case for sending non-YANG-defined
> > > data
> > > here.
> > 
> > As anything can be YANG wrapped, per the thread above.  I am fine with
> > this.
> > 
> > > > >   I think that this document should state that an event record is an
> > > > >   instance of a YANG "notification" statement.  If not, it is unclear
> > > > >   both how subtree/xpath filters and xml/json/... encodings would work.
> > > >
> > > > Applying xpath filters against XML based event records seems viable to
> > > > me.
> > > 
> > > Where does it say that it has to be XML?  Whatabout mixed-content?
> > > What if such a notification is sent when the encoding is JSON?
> > > 
> > > If you want to make this specification open for other data modeling
> > > languages,
> > > I think you need to carefully define how that is supposed to work;
> > > essentially
> > > similar to how we handle transports; we have a set of requirement on
> > > what a
> > > transport document must define.  IMO this is super complicated and
> > > overkill.
> > > This draft is complex enough.
> > > Don't add even more complexity.
> > 
> > If you are just saying that we can put everything into a YANG wrapper,
> > that is fine with me.  To clarify this, I have tweaked the first
> > sentence of Section 2.1 to:
> > "An event stream is a named entity on a publisher which exposes a
> > continuously updating set of YANG encoded event records."
> 
> Howabout:
> 
> OLD:
> 
>    An event stream is a named entity on a publisher which exposes a
>    continuously updating set of event records.  Each event stream is
>    available for subscription.  It is out of the scope of this document
>    to identify a) how streams are defined (other than the NETCONF
>    stream), b) how event records are defined/generated, and c) how event
>    records are assigned to streams.
> 
> NEW:
> 
>    An event stream is a named entity on a publisher which exposes a
>    continuously updating set of event records.  An event record is
>    defined with the "notification" YANG statement.  Each event stream is
>    available for subscription.  It is out of the scope of this document
>    to identify a) how streams are defined (other than the NETCONF
>    stream), b) how event records are generated, and c) how event
>    records are assigned to streams.
> 
> > And I have tweaked the first sentence of the third paragraph to:
> > "As YANG encoded event records are created by a system,..."
> 
> I think the original sentence is better.
> 
> Also, some tweaks are needed to the filter leafs in the YANG module:
> 
> OLD:
> 
>           The subtree filter is applied to the representation of
>           individual, delineated event records as contained within the
>           event stream.  For example, if the notification message
>           contains an instance of a notification defined in YANG, then
>           the top-level element is the name of the YANG notification.
> 
> NEW:
> 
>           The subtree filter is applied to the representation of
>           individual, delineated event records as contained within the
>           event stream.  The top-level element in the event record is
>           the name of the YANG notification.
> 
> and
> 
> OLD:
> 
>            The XPath expression is evaluated on the representation of
>            individual, delineated event records as contained within
>            the event stream.  For example, if the notification message
>            contains an instance of a notification defined in YANG,
>            then the top-level element is the name of the YANG
>            notification, and the root node has this top-level element
>            as the only child.
> 
> NEW:
> 
> 
>            The XPath expression is evaluated on the representation of
>            individual, delineated event records as contained within
>            the event stream.  The top-level element in the event
>            record is the name of the YANG notification, and the root
>            node has this top-level element as the only child.


This text is problematic b/c it doesn't work well with inline
notifications.

Consider the example in section 7.16.3 in RFC 7950:

       container interfaces {
         list interface {
           key "name";
           leaf name {
             type string;
           }
           notification interface-enabled {
             leaf by-user {
               type string;
             }
           }
         }
       }
       
and corresponding XML example:

     <notification
       xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
       <eventTime>2008-07-08T00:01:00Z</eventTime>
       <interfaces xmlns="urn:example:interface-module">
         <interface>
           <name>eth1</name>
           <interface-enabled>
             <by-user>fred</by-user>
           </interface-enabled>
         </interface>
       </interfaces>
     </notification>

What, in this example, is the "event record"?  I assume it is this
part:

       <interfaces xmlns="urn:example:interface-module">
         <interface>
           <name>eth1</name>
           <interface-enabled>
             <by-user>fred</by-user>
           </interface-enabled>
         </interface>
       </interfaces>

But the element that is the name of the YANG notification is this:

           <interface-enabled>
             <by-user>fred</by-user>
           </interface-enabled>


(With draft-ietf-netconf-notification-message, the "event record"
would be placed in the <notification-contents> anydata)


A problem is that the containment hierarchy is defined in RFC 7950 in
the XML encoding text.  There is no text in RFC 7951 or RFC 8040 for
how to do this in JSON for RESTCONF.  It is natural to do a pure
JSON-translation of the XML example, but this isn't specified
anywhere.


So I propose the following tweaked changes:


OLD:

   An event stream is a named entity on a publisher which exposes a
   continuously updating set of event records.  Each event stream is
   available for subscription.  It is out of the scope of this document
   to identify a) how streams are defined (other than the NETCONF
   stream), b) how event records are defined/generated, and c) how event
   records are assigned to streams.

NEW:

   An event stream is a named entity on a publisher which exposes a
   continuously updating set of event records.  An event record is an
   intantiation of a "notification" YANG statement.  If the
   "notification" is defined as a child to a data node, the
   intantiation includes the hierarchy of nodes that identifies the
   data node in the datastore (see Section 7.16.2 of RFC 7950).  Each
   event stream is available for subscription.  It is out of the scope
   of this document to identify a) how streams are defined (other than
   the NETCONF stream), b) how event records are generated, and c) how
   event records are assigned to streams.


and in the YANG module:

OLD:

          The subtree filter is applied to the representation of
          individual, delineated event records as contained within the
          event stream.  For example, if the notification message
          contains an instance of a notification defined in YANG, then
          the top-level element is the name of the YANG notification.

NEW:

          The subtree filter is applied to the representation of
          individual, delineated event records as contained within the
          event stream.

and

OLD:

           The XPath expression is evaluated on the representation of
           individual, delineated event records as contained within
           the event stream.  For example, if the notification message
           contains an instance of a notification defined in YANG,
           then the top-level element is the name of the YANG
           notification, and the root node has this top-level element
           as the only child.

NEW:


           The XPath expression is evaluated on the representation of
           individual, delineated event records as contained within
           the event stream.

> (I think it would be useful with some filtering examples, like in
> section 5 of RFC 5277, but I think you have all examples in
> netconf-notif, so they would go into that draft.  (re-reading an old
> thread I found that examples for filters were requested before)).

And I strongly think that we should add examples in an appendix, even
though this is a protocol and encoding neutral document.  Maybe one
example with NETCONF XML and one with RESTCONF JSON.  One example can
show a subtree filter and a top-level notif, and the other an XPath
filter with an inline notif.



/martin