The active notification capability enables a NETCONF server to periodically send keepalive messages to a NETCONF client when processing a time-consuming operation, so that the client does not time out when it receives no response from the server. When a NETCONF server processes a time-consuming RPC request such as a <commit> or <copy-config> operation, it periodically (every 20 seconds) sends <netconf-rpc-keepalive> messages to a client to ensure that the connection is active.
The YANG model defines the capability in the huawei-ietf-netconf-ext.yang file.
A client needs to subscribe to keepalive notification so that it can receive keepalive messages when it sends a time-consuming RPC request.
<netconf:rpc netconf:message-id="101" xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0"> <create-subscription xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> <filter netconf:type="subtree"> <nc-ext:netconf-rpc-keepalive xmlns:nc-ext="urn:huawei:yang:huawei-ietf-netconf-ext"/> </filter> </create-subscription> </netconf:rpc>
<netconf:rpc netconf:message-id="101" xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0"> <create-subscription xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> <filter netconf:type="subtree"> <nc-ext:netconf-rpc-keepalive xmlns:nc-ext="urn:huawei:yang:huawei-ietf-netconf-ext"/> </filter> </create-subscription> </netconf:rpc>