Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Must NBIRTH sequence number always be '0'? #57

Closed
buentead opened this issue Nov 27, 2023 · 4 comments
Closed

Must NBIRTH sequence number always be '0'? #57

buentead opened this issue Nov 27, 2023 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@buentead
Copy link

First I'd like to thank all contributors for this helpful library. Great job.

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 may question: what is the correct behavior of NBIRTH sequence number from your point of view? Thank you very much for any thoughts.

@SeppPenner SeppPenner self-assigned this Nov 27, 2023
@SeppPenner SeppPenner added the question Further information is requested label Nov 28, 2023
@jeff-pf
Copy link

jeff-pf commented Nov 28, 2023

Also seems to contradict section 5.4 - NBIRTH must have a seq number that is between 0 and 255 (inclusive). The next paragraph says - This will become the starting sequence number which all following messages will include a sequence number that is one or more than the previous up to 255 where it wraps back to zero.

@jeff-pf
Copy link

jeff-pf commented Nov 28, 2023

In your example are you saying that NDATA is not valid because the rebirth NBIRTH could contain newer data and then the NDATA would overwrite that?

@buentead
Copy link
Author

buentead commented Dec 6, 2023

Yes. When looking at the sequence number only, the (old) NDATA would be correct. And if a new NDATA will be sent, it would have the sequence number '1'. So the application will ignore it as the 'old' NDATA with sequence '1' was processed.

@SeppPenner
Copy link
Owner

I'm not sure either. Please follow eclipse-tahu/tahu#373 as the team (hopefully) might be able to answer this finally...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants