What protocol definition do you recommend? I evaluated Google's protocol buffers, but it does not allow me to control the placement of fields in the packet being built. I assume the same is true for Thrift. My requirements are:
Thank you.
("Flavor" on SourceForge, used for defining MPEG-4 might be a candidate, but I am looking for something that seems to have more of a community and preferably works in a .NET environment.)
Plural. protocols. (countable) A protocol is a rule, guideline, or document about how certain activities are done.
Protocols: It is a set of rules that need to be followed by the communicating parties in order to have successful and reliable data communication. For example - Ethernet and HTTP.
Some of the examples of Standard Protocols are FTP, DNS, DHCP, SMTP, TELNET, TFTP, etc. Proprietary protocols are developed by an individual organization for their specific devices.
/ˈprəʊtəkɒl/ /ˈprəʊtəkɑːl/ [uncountable] a system of fixed rules and formal behaviour used at official meetings, usually between governments.
Have a look to ASN.1 http://es.wikipedia.org/wiki/ASN.1
FooProtocol DEFINITIONS ::= BEGIN
FooQuestion ::= SEQUENCE {
trackingNumber INTEGER,
question IA5String
}
FooAnswer ::= SEQUENCE {
questionNumber INTEGER,
answer BOOLEAN
}
END
It seems to cover your main requirements:
- Bit detail
- ordered content
- type references
- not sure, about conditions
Is widely used, and you can find some implementations on java and python
I'd be interested in the reasons for your requirements. Why do you need to control the position of the fields? Why are bitfields important? Conditionals?
It sounds like you have a (more or less) fixed wire format for which you need to write a parser for, and in that case none of the existing popular protocol/serialization formats (Protobufs, Thrift, JSON, Yaml, etc.) will work for you.
A somewhat unorthodox approach is to use Erlang or Haskell, both of which have good support for parsing binary protocols.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With