Add keep-alive option for Restconf stream: Requirement is coming from an issue observed at a customer POC.At CNC, one of the NSO notifications mechanism used is Restconf service-state-changes stream:/restconf/streams/service-state-changes/jsonAs the request expected to remain open for a long time, it is hard to detect connections and networking interruptions, which sometime cause the request to remain open, where the actual connection to NSO stream is not connected, and not receiving NSO notifications.The request from NSO is to add optional request parameter to Restconf stream SSE (server sent events): keep-alive, with value of interval in seconds, for example:/restconf/streams/service-state-changes/json?keep-alive=30This is expected to send comment :keepalive message to the client every 30 seconds, or by the interval parameter.This is per commonly recommended mechanism to keep the request alive:This way, the client can read the keep-alive messages, and detect whether connection is alive.Similarly it is used by PCE for SSE, which is parsed at topo-svc at Cisco COE.Request is to add this option by NSO.
Hello Liran,Will discuss with team.ThanksHello Liran,This enhancement request seems to be a NSO platform related request. As such, I will raise an NSO platform RT.Thanks,Isaac KimHello , would you be able to share which NSO version you observed this behavior on?Need NSO version to create NSO platform RTThank you. At customer POC, it was NSO 5.5.2. It is observed sometimes in several NSO versions, current NSO version is 5.5.2.9. For the NSO platform RT - the request is to support it in the upcoming CNC 4.0 NSO version, currently 5.5.2.12 - or the expected NSO version for CNC 4.0.Thank you for the information, will raise the request shortly. I believe we are moving to NSO 5.7 starting TSDN 4.0 M2, so I will put the requested fix build version to that.Hi Liran, I have posted the NSO RT enhancement request, and I received the following reply:Hi!Since you use 5.5.2 let me begin with pointing to this CDETS ticket - We have released the following patches for NSO containing LOG4j 2.155.3.5.1, 5.4.5.2, 5.5.4.1, 5.6.3.1.Quoting the changes note regarding keepalive:<ul class="alternate" type="square">"In rare cases RESTCONF subscriptions, where the subscriber terminates without tearing down the connection correctly, could lead to ports and internal processes not closing/terminating as they should. The two config settings '/ncs-config/webui/transport/keepalive' and '/ncs-config/webui/transport/keepalive-timeout' have been added to handle this. Setting keepalive to true will ask the host OS to detect future lingering ports and instruct the server to periodically send comment messages (":keepalive test") over the subscription channels. The 'keepaliveTimeout' can be used to specify the frequency of the messages. Note that subscribers must be able to handled these new messages!"Available in 5.3.5, 5.4.5, 5.5.3, 5.6 and later versions./NickAs we will be moving to NSO 5.7 starting TSDN 4.0 M2, I assume jthat the fix for this keepalive will be implemented for next milestone release.For now, I will close this ticket as the solution is expected to arrive in next milestone release.If you face this issue again with next milestone release, please feel free to reopen this ticket and I will follow up on the NSO Platform RT enhancement request.Thanks,Isaac KimHi,I tested it with NSO CNC 4.0 M2, and it is working.Solution is being adopted by CNC client.Since this configuration is not listed in NSO Core Function Pack - TSDN 4.0.0 - M2 Release, , the request here is to add these configuration at the official installation instructions.Requesting to add it to installation instructions of CNC 4.0 M3 and higher, and if possible to CNC 4.0 M2 as well.Enable keepalive, and set it to 30 seconds for tcp and ssl:<webui><enabled>true</enabled><transport><tcp><enabled>true</enabled><ip>0.0.0.0</ip><port>8080</port><keepalive>true</keepalive><keepalive-timeout>30</keepalive-timeout></tcp><ssl><enabled>true</enabled><ip>0.0.0.0</ip><port>8888</port><key-file>${NCS_DIR}/var/ncs/webui/cert/host.key</key-file><cert-file>${NCS_DIR}/var/ncs/webui/cert/host.cert</cert-file><keepalive>true</keepalive><keepalive-timeout>30</keepalive-timeout></ssl></transport>And on the same subject if you can review additional additions to installation instructions:<ul class="alternate" type="square">Enable SSL:<ssl>    <enabled>true</enabled>Disable xpath-trace-log (cause performance degradation in high scale):<xpath-trace-log>   <enabled>false</enabled>Install DLM package. For this, as it is needed for CNC, if you found it ok, can refer to its wiki page / documentation:DLM NSO Service Pack - ThanksHello Liran,After discussing with team, it has been concluded that keepalive can help in certain edge cases, but is not a required configuration for T-SDN. keepalive can be added as optional config as stated in NSO documentation "nso_man-5.7.pdf" (page 477) to help cover such scenarios. We do not add optional ncs.conf configuration to our install guide and only include required changes to allow T-SDN functionality. But we do recognize that it can be hard to find ncs.conf parameters in NSO docs, so we will add a reference to NSO docs ncs.conf man page in the install wiki for optional configuration.This will apply to ssl ncs.conf enable flag as well. We do not enable by default, but user can define if they would like. For xpath-trace-log, this is disabled by default for system-install but enabled by default for local-install. As local-install is typically used for testing and demos, xpath-trace-log is enabled to assist with debugging. For scale we always recommend to disable xpath-trace-log. There has been request from team to not include this in our install procedure. DLM is not a dependency for T-SDN core solution. So we will not be adding it to our wikis.I hope this helps clarify the decision that the team has made. If you have any questions or comments about this decision, please feel free to reply to this thread.Thanks,Isaac Kim