Subject: [Netconf] Netconf, none operation and non-presence containers

From: "Maros Marsalek -X (mmarsale - PANTHEON TECHNOLOGIES at Cisco)" <[email-masked]>
Date: Tue, 1 Mar 2016 15:33:50 +0000

Hello netconf group,

We've run into following situation with NETCONF and we would like to know your opinion on what's the correct behavior here:

Model (root non-presence container with nested list) :

container mapping-nodes {
    list mapping-node{
        key "id";
        leaf id {
            type string;
        }
    }
}

Netconf edit-config RPC (replacing mapping-node entry with none operation for mapping-nodes container, in an empty data store):

    <edit-config>
        ...
        <default-operation>none</default-operation>
        <config>
            <mapping-nodes xmlns="urn:opendaylight:mdsal:mapping:test">
                <mapping-node xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0" a:operation="replace">
                    <id>node1-put</id>
                </mapping-node>
            </mapping-nodes>
        </config>
    </edit-config>

And the question here is: Whether the edit should fail or not ?
The problem is that mapping-nodes container does not exist and in edit-config rpc, there's "none" operation associated to it.
Our first assumption was that the resulting data structure should be invalid due to missing root container and rpc should fail.
However, the container is non-presence (exists only for organizing the hierarchy of data nodes), which means that it may be created/deleted as child nodes appear/disappear.
In which case, the operation doesn't have to fail and can create mapping-nodes container even if "none" operation is associated with it.

Regards,
Maros

---

From: Andy Bierman <[email-masked]>
Date: Tue, 1 Mar 2016 08:28:40 -0800

On Tue, Mar 1, 2016 at 7:33 AM, Maros Marsalek -X (mmarsale - PANTHEON
TECHNOLOGIES at Cisco) <[email-masked]> wrote:

> Hello netconf group,
>
>
>
> We’ve run into following situation with NETCONF and we would like to know
> your opinion on what’s the correct behavior here:
>
>
>
> Netconf edit-config RPC (replacing mapping-node entry with none operation
> for mapping-nodes container, in an empty data store):
>
>
>
>     <edit-config>
>
>         …
>
>                 <mapping-node
> xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0" a:operation="replace">
>
>                     <id>node1-put</id>
>
>                 </mapping-node>
>
>             </mapping-nodes>
>
>         </config>
>
>     </edit-config>
>
>
>
> The problem is that mapping-nodes container does not exist and in
> edit-config rpc, there’s “none” operation associated to it.
>
> Our first assumption was that the resulting data structure should be
> invalid due to missing root container and rpc should fail.
>
> However, the container is non-presence (exists only for organizing the
> hierarchy of data nodes), which means that it may be created/deleted as
> child nodes appear/disappear.
>
> In which case, the operation doesn’t have to fail and can create
> mapping-nodes container even if “none” operation is associated with it.
>

The edit should fail.

NETCONF has no requirement that operation=none will create missing
NP-containers.
I can only find text that says operation=none means the server will not
alter these nodes.

> Maros
Andy

> _______________________________________________
> Netconf mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netconf
>
>

---

From: "Maros Marsalek -X (mmarsale - PANTHEON TECHNOLOGIES at Cisco)" <[email-masked]>
Date: Thu, 3 Mar 2016 15:13:34 +0000

Hey Andy,

This note at https://tools.ietf.org/html/rfc6020#section-7.5.8 is interesting:

“If a container does not have a "presence" statement and the last
   child node is deleted, the NETCONF server MAY delete the container.”

Meaning that the NETCONF server may control lifecycle of non-presence containers (in terms of delete at least).

But on the other hand, NETCONF RFC http://tools.ietf.org/html/rfc6241#section-7.2 is saying:

“If the configuration in the <config> parameter contains data for which there is not a
            corresponding level in the target datastore, an <rpc-error> is returned…”

With this combination we might end up in a situation where server deletes an empty, non-presence, parent container at one point and user tries to create one of its child nodes with “none” operation assigned to the parent, non-presence container. Request would fail because the non-presence container was deleted silently in the background, but the user has no way of knowing. Meaning that the behavior for non-presence containers might be asymmetric and confusing in terms of auto create/delete. That’s why we think NETCONF server should be able to auto-create non-presence containers even with “none” operation assigned to it, however the specs are not clear in this case.

Regards,
Maros

From: Andy Bierman [mailto:[email-masked]]
Sent: Tuesday, March 01, 2016 5:29 PM
To: Maros Marsalek -X (mmarsale - PANTHEON TECHNOLOGIES at Cisco) <[email-masked]>
Cc: [email-masked]; Tony Tkacik -X (ttkacik - PANTHEON TECHNOLOGIES at Cisco) <[email-masked]>
Subject: Re: [Netconf] Netconf, none operation and non-presence containers

On Tue, Mar 1, 2016 at 7:33 AM, Maros Marsalek -X (mmarsale - PANTHEON TECHNOLOGIES at Cisco) <[email-masked]<mailto:[email-masked]>> wrote:
Hello netconf group,

We’ve run into following situation with NETCONF and we would like to know your opinion on what’s the correct behavior here:

    <edit-config>
        …

And the question here is: Whether the edit should fail or not ?
The problem is that mapping-nodes container does not exist and in edit-config rpc, there’s “none” operation associated to it.
Our first assumption was that the resulting data structure should be invalid due to missing root container and rpc should fail.
However, the container is non-presence (exists only for organizing the hierarchy of data nodes), which means that it may be created/deleted as child nodes appear/disappear.
In which case, the operation doesn’t have to fail and can create mapping-nodes container even if “none” operation is associated with it.

The edit should fail.

NETCONF has no requirement that operation=none will create missing NP-containers.
I can only find text that says operation=none means the server will not alter these nodes.

Regards,
Maros

Andy

_______________________________________________
Netconf mailing list
[email-masked]<mailto:[email-masked]>
https://www.ietf.org/mailman/listinfo/netconf

---

From: Andy Bierman <[email-masked]>
Date: Thu, 3 Mar 2016 18:02:05 -0800

On Thu, Mar 3, 2016 at 7:13 AM, Maros Marsalek -X (mmarsale - PANTHEON
TECHNOLOGIES at Cisco) <[email-masked]> wrote:

> Meaning that the NETCONF server may control lifecycle of non-presence
> containers (in terms of delete at least).
>
>
>
> But on the other hand, NETCONF RFC
> http://tools.ietf.org/html/rfc6241#section-7.2 is saying:
>
>
>
> With this combination we might end up in a situation where server deletes
> an empty, non-presence, parent container at one point and user tries to
> create one of its child nodes with “none” operation assigned to the parent,
> non-presence container. Request would fail because the non-presence
> container was deleted silently in the background, but the user has no way
> of knowing. Meaning that the behavior for non-presence containers might be
> asymmetric and confusing in terms of auto create/delete. That’s why we
> think NETCONF server should be able to auto-create non-presence containers
> even with “none” operation assigned to it, however the specs are not clear
> in this case.
>
>
>

I never said the server cannot add data nodes to a datastore.
The server is not required to do that, meaning the client cannot count on
it.

YANG 1.1 fixes the XPath inconsistencies.  I suggest using "merge"
instead of "create".

Andy

>
>
> *From:* Andy Bierman [mailto:[email-masked]]
> *Sent:* Tuesday, March 01, 2016 5:29 PM
> *To:* Maros Marsalek -X (mmarsale - PANTHEON TECHNOLOGIES at Cisco) <
> [email-masked]>
> *Cc:* [email-masked]; Tony Tkacik -X (ttkacik - PANTHEON TECHNOLOGIES
> at Cisco) <[email-masked]>
> *Subject:* Re: [Netconf] Netconf, none operation and non-presence
> containers
>
>
>
>
>
>
>