Git Product home page Git Product logo

Comments (6)

michalvasko avatar michalvasko commented on July 19, 2024 1

Is it expected to change sid everytime or is there a problem with implementation or our coding?

SID changes because callbacks get temporary sessions existing only for the duration of the callback.

How can a subscription be uniquely identifiable among several sessions and connections?

Every subscription has a unique sub_id, which is also passed to the callbacks.

Is the nc_session ID and sid refer to the same data or nc_session is just for the server-client connection?

Every NETCONF session has a dedicated sysrepo session but that is an internal implementation detail that can change (it was not always like this). You cannot get to the sysrepo session anyway.

If the entire server-client connection closes and a new session opens for each rpc by netopeer2-cli. How can we identify the connection from a given user?

If the connection is terminated and restored, it is a new connection (session) and is not related to the previous one in any way so you cannot really match them. Or did I misunderstand your question?

from sysrepo.

mustafatayf avatar mustafatayf commented on July 19, 2024

Thank you Michal,

To be more clear, we have a development environment on local computer, which includes;

  • All required libraries installed (sysrepo "7.19.3", libyang "2.38.14", libnetconf2 "3.6.1", netopeer2 "2.1.71")
  • A netopeer2-server running on console
  • A netopeer2-cli running on console
  • Developing sysrepo-plugin application on the C development IDE*

*sub_id values are observed from the IDE.

When we try to use sub_id as an identifier for o-ran-supervision subscription on the supervision-notification by using;
subscribe --stream o-ran-supervision
Client subscription request get sub_id of 61. After a while, from the same client session on netopeer2-cli, following RPC is send;
user-rpc --rpc-timeout 9999
and callback function on the netopeer2-server side get sub_id of 62.
resim

Similarly, first client command (subscribe) has session ID of sid=81 and the second command (user-rpc) has a session ID of sid=83. So that each rpc has own session ID and sub_id, which are sequentially incremented by 1 or more if any further session or subscription appeared in the background.

We are expecting each unique subscription to have the same sub_id, but what we see sub_id is changing for the same subscription.

We are trying to distinguish user-rpcs from each other so that we can manage counters for watchdog-reset timers belonging to different subscriptions.

Given identifiers (session ID, sid and sub_id) are changing, is there any other way to match incoming user-rpcs with their subscriptions on the netopeer2-server side?

Thank you,
mustafa

from sysrepo.

michalvasko avatar michalvasko commented on July 19, 2024

We are expecting each unique subscription to have the same sub_id, but what we see sub_id is changing for the same subscription.

What is a subscription? You are using it in a really confusing way and I have no idea what you mean. What I assumed is that a subscription is a notification subscription created by a client, using subscribe command in the CLI, for example. If you then send a user-rpc, it has nothing to do with any subscription, you have simply sent another RPC on the NETCONF session. So you may want to clarify what you are trying to do, match all the RPCs of a NETCONF session?

from sysrepo.

mustafatayf avatar mustafatayf commented on July 19, 2024

What I assumed is that a subscription is a notification subscription created by a client, using subscribe command in the CLI

We are exactly doing this.

If you then send a user-rpc, it has nothing to do with any subscription, you have simply sent another RPC on the NETCONF session

We assumed that for a given NETCONF connection, which are created by;

$ netopeer2-cli
> connect 
> status

has an unique identifier in order to be used on the netopeer2-server side.
resim

Now it is clear that each rpc has its own session and sub_id values. We need to distinguish multiple client and their user rpcs on the netopeer2-server side.

Each client has its own watchdog timers on the netopeer2-server side. Depending on the user rpcs coming from the clients, only the corresponding timers should be set/reset on the netopeer2-server.

Therefore, is there a way to identify the owner (client) of the user-rpcs on the netopeer2-server side?

from sysrepo.

michalvasko avatar michalvasko commented on July 19, 2024

Okay, I think I understand now although you are still using some ambiguous terms. Every NETCONF client has its own NETCONF session ID, you can read it in every callback using sr_session_get_orig_data().

from sysrepo.

mustafatayf avatar mustafatayf commented on July 19, 2024

Thank you Michal, sr_session_get_orig_data() is worked for me.

from sysrepo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.