Subject: [Netconf] Advertisement of imported features

From: Muly Ilan <[email-masked]>
Date: Tue, 8 Jan 2019 20:01:59 +0000

Hi,

Not sure whether import of features from one module to the other is fully supported by YANG and NETCONF.

For example, with these modules:

module alpha {
  namespace "http://example.com/alpha";
  prefix "a";

  feature a-feature;

  leaf aoo {
    if-feature a-feature;
    type string;
  }

  leaf a2 {
    type string;
  }

}

module beta {
  namespace "http://example.com/beta";
  prefix "b";

  import alpha {
    prefix a;
  }

  leaf boo {
    if-feature a:a-feature;
    type string;
  }

  leaf b2 {
    type string;
  }

}

The intension is re-use of the feature "a-feature" in the importing module "beta".

Now, how should a server advertise the support of "a-feature" in module "beta"?

1.      YANG 1.0
According to section 5.6.4 of RFC6020 the NETCONF <hello> message is used.
So, I assume the <hello> should contain the following:
<capability>
  http://example.com/beta?module=beta&amp;features=a:a-feature
</capability>

Is the above a valid capability?

2.      YANG 1.1
According to section 5.6.4 of RFC7950 the "ietf-yang-library" defined in RFC7895 must be implemented.

The relevant node definition from RFC7895:

       leaf-list feature {
         type yang:yang-identifier;
         description
           "List of all YANG feature names from this module that are
            supported by the server, regardless whether they are defined
            in the module or any included submodule.";
       }

But the pattern of the typedef "yang:yang-identifier" does not permit a prefix.

Can this be fixed in draft-ietf-netconf-rfc7895bis ?

Regards,

Muly

Muly Ilan
Senior System Architect
M: +972-54-470-1004 | [email-masked]<mailto:[email-masked]>
T:  +972-3-765-7035   | F: +972-3-644-0898

www.rad.com<http://www.rad.com>  |  Follow RAD on LinkedIn<http://www.linkedin.com/company/7369/>  |  Facebook<http://www.facebook.com/pages/RAD-Data-Communications/72479223117>  |  Twitter<http://twitter.com/raddatacomms>  |  YouTube<http://www.youtube.com/user/radwebmaster#g/u>

---

From: Martin Bjorklund <[email-masked]>
Date: Tue, 08 Jan 2019 21:17:44 +0100 (CET)

Hi,

> The intension is re-use of the feature "a-feature" in the importing

The statement

  if-feature a:a-feature;

means that the boo leaf if valid if the "a-feature" in module "a" is
supported in the server.

> Now, how should a server advertise the support of "a-feature" in

It doesnt; it should advertise module "alpha" with "a-feature", and
"beta" w/o any features.

> Is the above a valid capability?

No.  It should be:

 <capability>
   http://example.com/alhpa?module=alpha&amp;features=a:a-feature
 </capability>
 <capability>
   http://example.com/beta?module=beta
 </capability>

> Can this be fixed in draft-ietf-netconf-rfc7895bis ?

As per above, this is not needed.

/martin

> www.rad.com<http://www.rad.com> | Follow RAD on
> LinkedIn<http://www.linkedin.com/company/7369/> |
> Facebook<http://www.facebook.com/pages/RAD-Data-Communications/72479223117>
> | Twitter<http://twitter.com/raddatacomms> |
> YouTube<http://www.youtube.com/user/radwebmaster#g/u>
> 
> 
> 
> 
> 
> 
>

---

From: Muly Ilan <[email-masked]>
Date: Tue, 8 Jan 2019 20:39:37 +0000

Hi Martin,

-----Original Message-----
From: Martin Bjorklund [mailto:[email-masked]] 
Sent: 08/01/2019 22:18
To: Muly Ilan
Cc: [email-masked]
Subject: Re: [Netconf] Advertisement of imported features

Hi,

Muly Ilan <[email-masked]> wrote:
>   namespace "https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fexample.com%2Falpha&amp;data=01%7C01%7Cmuly_i%40rad.com%7C5b4c4319f5f2434a332408d675a6599c%7Cf9047108cc2c4e4897a343fad1b3bf9d%7C1&amp;sdata=QEesCuMPU6YgQYnpuhAidhLe7nq2ywAV2BjKPn%2BHcV8%3D&amp;reserved=0";
>   prefix "a";
> 
>   feature a-feature;
> 
>   leaf aoo {
>     if-feature a-feature;
>     type string;
>   }
> 
>   leaf a2 {
>     type string;
>   }
> 
> }
> 
> 
> module beta {
>   namespace "https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fexample.com%2Fbeta&amp;data=01%7C01%7Cmuly_i%40rad.com%7C5b4c4319f5f2434a332408d675a6599c%7Cf9047108cc2c4e4897a343fad1b3bf9d%7C1&amp;sdata=8GyM2bkXE0E0YbSfFWYgxRZUsiRFnN%2BPEzpaKX0fX8M%3D&amp;reserved=0";
>   prefix "b";
> 
>   import alpha {
>     prefix a;
>   }
> 
>   leaf boo {
>     if-feature a:a-feature;
>     type string;
>   }
> 
>   leaf b2 {
>     type string;
>   }
> 
> }
> 

The statement

  if-feature a:a-feature;

[Muly Ilan]
This was what I initially thought.
But it didn't work with NSO version 4.7 (the leaf "boo" in module "beta" was not available).

Then I carefully read, again, section 5.6.4.2 of RFC 6020:

"
Servers indicate the names of supported features via the <hello>
message. In <hello> messages, the features are encoded in the
"features" parameter within the URI. The value of this parameter is
a comma-separated list of feature names that the device supports for
the specific module.
"

My understanding of the last sentence is that per module, feature support should be declared.
In this example "a-feature" is supported by both modules.

>   https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fexample.com%2Fbeta%3Fmodule%3Dbeta%26features%3Da%3Aa-feature&amp;data=01%7C01%7Cmuly_i%40rad.com%7C5b4c4319f5f2434a332408d675a6599c%7Cf9047108cc2c4e4897a343fad1b3bf9d%7C1&amp;sdata=rDlo2oLhLyQGP6rihXuPCWCXbMHFPiL74ULx9X6401E%3D&amp;reserved=0
> </capability>
> 

No.  It should be:

 <capability>
   https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fexample.com%2Falhpa%3Fmodule%3Dalpha%26features%3Da%3Aa-feature&amp;data=01%7C01%7Cmuly_i%40rad.com%7C5b4c4319f5f2434a332408d675a6599c%7Cf9047108cc2c4e4897a343fad1b3bf9d%7C1&amp;sdata=AXq7oIC7VNUlUtAAGQdAI%2B3%2FpKpQqUF03Y9r2mCTGlg%3D&amp;reserved=0
 </capability>
 <capability>
   https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fexample.com%2Fbeta%3Fmodule%3Dbeta&amp;data=01%7C01%7Cmuly_i%40rad.com%7C5b4c4319f5f2434a332408d675a6599c%7Cf9047108cc2c4e4897a343fad1b3bf9d%7C1&amp;sdata=PrczrfDxzOypK5VASbbDtrJrdYLYlg5pCfgprSRuIBw%3D&amp;reserved=0
 </capability>

/martin

> Muly

[Muly Ilan] 
Best,

Muly