Preferred mechanism to select node ids for session? #26
-
Since NORM_NODE_ANY doesn't work for receivers (even the examples have a hardcoded receiver node id) What mechanism should users use to create node ids for joining a session? It seems like users need to write their own negotiation protocol to decide on node ids before they are even able to join the NORM session? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
In the absence of any other obvious choice, rather than negotiating a node id, I've personally decided to use the hash of (unique pointer address, PID, hostname) as the node id. This should hopefully be sufficiently unique, assuming there are no hash collisions.... It would still be good to understand why this is left up to the caller, and what the authors consider to be a good mechanism for choosing the node id, though... |
Beta Was this translation helpful? Give feedback.
-
Hi @twhittock - Sorry for the slow response here; my work schedule has been a bit consuming. What NormNodeId assignment are you seeing when you call NormCreateSession() with NORM_NODE_ANY and then call NormGetLocalNodeId() to see what was assigned? Passing in the NORM_NODE_ANY (NORM_NODE_NONE) value should cause the NORM code to get a local IP address and use that as the NormNodeId as a form of automatically picking a unique node id. However, there cases where this doesn't work correctly (e.g., some VM environments or testing multiple processes on the same machine). In that case, I usually manually assign node ids for testing purposes. In some of our deployed systems that use NORM, they have other unique identifiers that are used as NormNormIds. One of the improvements I would like to eventually make with the NORM protocol specification is to have some other options for NORM node identification (e.g., address/port binding by itself) instead of the administratively configured NormNodeId. The rationale for use of a separate identifier was "inspired" by some of the RTP (realtime protocol) use cases where, due to bridging through various telecon systems etc, it was deemed necessary to have SSRC ID as an identifier distinct from IP addressing for multicast purposes. However, this is certainly inconvenient and I think there are many uses cases that would be well-served to use the socket address binding info as the needed unique identifier. Meanwhile, your approach to pick a random number will small collision probability isn't horrible, but I'm never fond of having to do that. Would the approach that is supposed to work, auto NormNodeId assignment based on IP address, work for your use case? |
Beta Was this translation helpful? Give feedback.
Hi @twhittock - Sorry for the slow response here; my work schedule has been a bit consuming.
What NormNodeId assignment are you seeing when you call NormCreateSession() with NORM_NODE_ANY and then call NormGetLocalNodeId() to see what was assigned? Passing in the NORM_NODE_ANY (NORM_NODE_NONE) value should cause the NORM code to get a local IP address and use that as the NormNodeId as a form of automatically picking a unique node id. However, there cases where this doesn't work correctly (e.g., some VM environments or testing multiple processes on the same machine). In that case, I usually manually assign node ids for testing purposes. In some of our deployed systems that use NORM, they h…