Protocol Versioning Summary
Last updated
Was this helpful?
Last updated
Was this helpful?
This chapter summarizes all version related aspects of the protocol definition.
The protocol definition has the version , that specifies numeric version of the protocol.
If protocol reports its version via transport or via some special "connection" , and the protocol version must influence how some messages are deserialized / handled, then there is a need for definition, which must contain version field, marked as such using semanticType="version" property.
sinceVersion - Version when the message / field has been introduced.
deprecated - Version when the message / field has been deprecated.
removed - Indication that deprecated message / field must be removed from
serialization and code generation.
If none of the interfaces has such field, then the generated code cannot be version dependent and all the version related properties become for documentation purposes only and cannot influence the presence of the messages / fields. In such cases the code generator is expected to receive required protocol version in its command line parameters and generate code for requested protocol version.
In case CommsDSL is used to define new protocol developed from scratch and backward / forward compatibility of the protocol is a desired feature, then there are few simple rules below, following of which can insure such compatibility.
message that is sent to establish connection and report protocol version
version using sinceVersion property.
Add element serialization length report before every
elemLengthPrefix property).
redundant report of the same element length before every element), never
In addition to the containing version information, the transport is also expected to contain layer, which will reassign the received version information to the message object (via ).
Every and support the following properties, wich can be used to supply version related information.
The generated code is expected to be version dependent (i.e. presence of some messages / fields is determined by the reported version value), if at least one of the defined -es contains version field (marked by semanticType="version").
Use layer in the transport
to report remaining length of the message.
Use layer to report protocol version
in the transport or define special "connect"
(mark the layer to be pseudo).
Always add new at the end of the
. Don't forget to specify their
Don't remove deprecated .
Always add new at the bottom of the
element.
element of the field (done using
In case elemFixedLength is
assigned for the (to avoid
add variable length to the element of the list.