Subject: [Netconf] edit-config bahavior with replace set as default-operation

From: Radek Krejčí <[email-masked]>
Date: Fri, 24 Feb 2012 14:26:29 +0100

Hi all,
I'm implementing NETCONF protocol according to RFC 6241 and I'd like to
ask you for clarifying behavior of edit-config combining replace as a
default operation with other operations used via "operation" attribute.
According to RFC, default-operation "replace" _completely_ replaces
target configuration data. Does this mean, that any other operation will
be ignored, including e.g. check for (non)existence of corresponding
data in case of delete and create operations?

Here is an example. Datastore contains:

<interfaces>
  <interface>
    <name>lo</name>
  </interface>
  <interface>
    <name>eth0</name>
  </interface>
</interfaces>

and edit-config's <config> element contain (together with replace set as
default-operation):

<interfaces xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
  <interface>
    <name>ppp0</name>
  </interface>
  <interface nc:operation="delete">
    <name>wlan0</name>
  </interface>
</interfaces>

Is the expected result this?

<interfaces>
  <interface>
    <name>ppp0</name>
  </interface>
  <interface>
    <name>wlan0</name>
  </interface>
</interfaces>

without any error announcing data-missing?

Best regards,
Radek Krejci

---

From: Martin Bjorklund <[email-masked]>
Date: Fri, 24 Feb 2012 14:41:31 +0100 (CET)

Hi,

> data in case of delete and create operations?

It is not specified if another operation within "replace" should be
treated as an error or simply ignored.  The same is true for operation
"delete" and "create".  So I suspect different implementations behave
differently in this case.

In my implementation, I think I treate "delete" under "replace" or
"create" as an error, but silently ignore nested "replace" or
"create".   And similar for the other cases.

> Is the expected result this?

No, the "delete" operation would never create the wlan0 interface.

/martin

---

From: Andy Bierman <[email-masked]>
Date: Fri, 24 Feb 2012 07:29:31 -0800

On 02/24/2012 05:26 AM, Radek Krejčí wrote:
> and edit-config's<config>  element contain (together with replace set as
> default-operation):
>

no.

Each operation requested (either explicitly with the nc:operation attribute
or implicitly through the operation inherited from the parent node) must
be valid against the specified target.

Since there is no 'wlan0' interface in the target, the delete must fail.
However, a 'remove' would work, and the result would be:

<interfaces>
    <interface>
      <name>ppp0</name>
    </interface>
</interfaces>

To see what yuma does for all possible combinations, look at the
agt_check_editop function in agt/agt_util.c

> Radek Krejci

Andy