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

Document how to extend protocol #3

Open
ejeffrey opened this issue Jul 21, 2014 · 1 comment
Open

Document how to extend protocol #3

ejeffrey opened this issue Jul 21, 2014 · 1 comment

Comments

@ejeffrey
Copy link
Owner

The current (v2.0) labrad [[Login Protocol]] leaves little room for negotiating protocol version. The login sequence is exactly scripted, and any deviation from it on either side causes the connection to be dropped. The I can see options are:

  1. Use magic values for things like the context, message ID, or pw challenge which are technically valid in the old protocol, but never used. New implementations would detect these magic values and react accordingly, while old versions would continue unaware. In principle this works fine, although it could be a bit brittle if an old client accidentally used the magic values and then got confused.

  2. Login as the current version, then use a manager setting to "upgrade" to a higher protocol version. This is completely backwards compatible, but probably harder to implement the conversion to the new protocol after login. It also prevents modifying the login protocol itself.

  3. Extended the protocol in a non-compatible way by having the client send an unexpected message. Old managers will disconnect, and the new client simply needs to know to reconnect with the old protocol.

I think option 3 is the best. It allows maximum flexibility and future forward compatibility with only requiring slightly more intelligence in the client connect() method of new clients to be backwards compatible, and it doesn't expose us to weird transient bugs related to magic values.

@ejeffrey
Copy link
Owner Author

Note: The LabRAD login negotiation does provide a version number field (2), which the client sends to the server after authentication. However, there is no documented way to actually negotiate the protocol. That is, the client and server should choose the highest protocol version they both support.

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

No branches or pull requests

1 participant