cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1401
Views
0
Helpful
9
Replies

Issue during notification subscription with filters and dynamic subscription through <establish-subscription>

ratnamis
Cisco Employee
Cisco Employee

Hi Team,

Hope you are doing well.

We are facing issue during notification subscription with filters.We are not able to apply filters during subscription.Our requirement is to apply multiple filters using Xpath/subtree into the subscription script.

Also we are able to apply subscription through <create-subscription> only instead of <establish-subscription>.Our requirement is to modify the filters runtime because of that we think that <establish-subscription> provides run time modification in subscription.

Kindly help us in order to resolve both the issues. We are using CISCO devices that supports ietf Netconf notifications standards and YANG based data modeling.

 

Regards

Ratna Shanker Mishra

 

9 Replies 9

perander
Cisco Employee
Cisco Employee

We are facing issue during notification subscription with filters.We are not able to apply filters during subscription.

Are you not able to apply filters at all?

 

Our requirement is to apply multiple filters using Xpath/subtree into the subscription script.

This is not possible, through various groupings the establish-subscription RPC ends up in e.g. the stream-xpath-filter which is of type yang:xpath1.0, hence it only supports one such filter. This works the same for stream-subtree-filter, which is of type anydata.

However it should be possible to write one xpath filter for different sets of nodes, e.g. "/some/nodes | /other/nodes". It should also be possible to concoct a subtree filter in a similar fashion.

 

Also we are able to apply subscription through <create-subscription> only instead of <establish-subscription>.Our requirement is to modify the filters runtime because of that we think that <establish-subscription> provides run time modification in subscription

What error do you get when you establish-subscription fails?

Thanks Perander for the response. Kindly response the following queries:

1. Are you saying that multi filter support is not applicable during netconf subscription?

2.We have tried to apply single filter through XPath but it was not working. I am attaching one of my sample notification response file.Kindly suggest us the filters for config_change event and Alarm event using Subtree and Xpath. Is it possible to apply subtree filter based on yang path mentioned <target> tag? like Example :

<filter type="subtree">

<xyz xmlns="http://sample.com/yang/xyz">
<interface>
<admin-state/>
</interface>
</xyz>

</filter>

3.We are not getting any notification from the device, if we do the subscription through <establish-subscription> tag.Following is the script:

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1001">
<establish-subscription xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
<stream>stream_name</stream>
</establish-subscription>
</rpc>

We are able receive the notification only through <create-subscription>.Following is the script:

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1001">

<create-subscription xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
<stream>stream_name</stream>
</create-subscription>
</rpc>

 

Kindly suggest a some sample filter using xpath/subtree based on attached notification response and also correct us, what is wrong with the <establish-subscription> script.

 

Regards

Ratna Shanker Mishra

 


1. Are you saying that multi filter support is not applicable during netconf subscription?

Only one filter is supported yes. See RFC 8639 Subscription to YANG Notifications,
Section 4 Event Notification Subscription YANG Module [0]. This also is similar to
NETCONF get-config, see RFC 6241 NETCONF, Appendix C YANG Module for
NETCONF Protocol Operations [1]

[0] https://tools.ietf.org/html/rfc8639#section-4
[1] https://tools.ietf.org/html/rfc6241#appendix-C

 

2.We have tried to apply single filter through XPath but it was not working. I am attaching one of my sample notification response file.Kindly suggest us the filters for config_change event and Alarm event using Subtree and Xpath. Is it possible to apply subtree filter based on yang path mentioned <target> tag? like Example :

<filter type="subtree">

<xyz xmlns="http://sample.com/yang/xyz">
<interface>
<admin-state/>
</interface>
</xyz>

</filter>

This filter seems to be correct.

 

3.We are not getting any notification from the device, if we do the subscription through <establish-subscription> tag.Following is the script:

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1001">
<establish-subscription xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
<stream>stream_name</stream>
</establish-subscription>
</rpc>

We are able receive the notification only through <create-subscription>.Following is the script:

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1001">

<create-subscription xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
<stream>stream_name</stream>
</create-subscription>
</rpc>

 

Kindly suggest a some sample filter using xpath/subtree based on attached notification response and also correct us, what is wrong with the <establish-subscription> script.


It might be that you've found a bug or that there is something that's missing
for the establish-supscription RPC.

Please reach out to TAC so we can take a closer look and help you further.

Thanks Perander.

Sure We will contact to TAC team for the establish-subscription issue.

 

One more point i want to check with you that as per our finding, we can pass only a single stream name during subscription.

If anyone wants to pass another stream along with the current stream then he need to create a new subscription with that new stream.

 

I just want to check with you that Is it possible to pass multiple streams with a single subscription?

 

Example:

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1001">

<create-subscription xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
<stream>stream_name1</stream>

<stream>stream_name2</stream>
</create-subscription>
</rpc>

 

Any other way if you can suggest for passing multiple streams with single subscription.

 

Regards

Ratna Shanker Mishra

 

It is not possible to supply more than one stream, i.e. several subscriptions are needed
if that is needed.

That said, the NETCONF stream sends notifications for all events. See
RFC 5277 NETCONF Event Notifications, Section 3.2.3. Default Event Stream. [0]

[0] https://tools.ietf.org/html/rfc5277#section-3.2.3

I suggest that you either use a filter for a stream which contains all required notifs,
or create a new stream which will send them (requires more work).

Thanks Perander for the clarification.

 

Regards

Ratna Shanker Mishra

Hi Perander,

Regarding the <establish-subscription>,We investigated the problem and come to know that we are using NCS 5.2.2 release which does not support <establish-subscription> dynamic subscription.

 

We got information that <establish-subscription>(RFC 8640) is added in NCS 5.4 release.

 

Can you please confirm at your end that <establish-subscription> support has been added in NCS 5.4 release so that we can plan to integrate that release ?

 

Regards

Ratna Shanker Mishra

 

 

In NCS 5.3 Subscribed Notifications for NETCONF (RFC 8639 and RFC 8640) was added,
this is amongst other things the establish-subscription RPC.

In NCS 5.4 YANG-Push (RFC 8641) was added, this enables subsciption to arbitrary
datastore changes. The model ietf-yang-push.yang augments
ietf-subscribed-notifications.yang defined in RFC 8639.

Thanks Perander for the confirmation.

 

Regards

Ratna Shanker Mishra

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: