tahu icon indicating copy to clipboard operation
tahu copied to clipboard

Must NBIRTH sequence number always be '0'?

Open SeppPenner opened this issue 1 year ago • 1 comments

A question from my community under https://github.com/SeppPenner/SparkplugNet/issues/57:

For me it is not quite clear, if the NBIRTH sequence number must always be '0' as it is currently implemented. The SparkplugB 3.0.0 documentation is ambiguous. In chapter 6.4.19 the sequence number "MUST have a value between 0 and 255". But in chapter 12.13. it is written "The NBIRTH MUST include a sequence number in the payload and it MUST have a value of 0."

The following theoretical example shows wrong data if the NBIRTH sequence number is always '0': Let's assume, the 'bdseq' remains the same. The following messages are sent: -> NBIRTH (seq=0) -> NDATA (seq=1) <- receiving NCMD "Node Control/Rebirth" -> NBIRTH (seq=0) Now let's assume the host application receives the 2nd NBIRTH message before the NDATA message. As a result, the host application would process the NDATA message as the sequence number is higher than the sequence number of the 2nd NBIRTH. This may result in wrong data. Unless the timestamp is taken into account as well.

Hence my question: what is the correct behavior of NBIRTH sequence number from your point of view? Thank you very much for any thoughts.

So: How should the sequence number behave?

SeppPenner avatar Mar 22 '24 16:03 SeppPenner

NBIRTH sequence number must always be 0

ghocev1 avatar Mar 27 '24 09:03 ghocev1