Mikael Gueck
Mikael Gueck

Reputation: 5591

What's a good machine-readable formal way of describing telecom protocols such as SMPP or CIMD2?

I've implemented several telecom protocols from human-readable specs in various languages during my career, and frankly, I'm not enjoying it very much anymore.

Instead, I'd like to translate the human-readable protocol specs into machine-readable protocol specs, and automatically generate protocol handlers in various languages.

I'm specifically interested in doing this to SMPP/CIMD2/EMI protocols, and autogenerating protocol data unit serializers/deserializers, as well as state machines, test cases, and other infrastructure.

Has someone done this already?

If not, which languages, libraries, and notations would you recommend for such a task?

Upvotes: 1

Views: 283

Answers (2)

Jarek Przygódzki
Jarek Przygódzki

Reputation: 4412

There's ABNF, though it's not widely used. Here's CIMD PDU for example

 cimd-frame     = start-of-text op-code COLON packet-number TAB parameter-list end-of-text
 parameter-list = *(parameter)
 parameter      = code COLON value TAB
 start-of-text  = %x02
 end-of-text    = %x03
 TAB            = %x09
 COLON          = %x3A
 …

There are parser generators out there that can read ABNF grammar and produce parser.

Upvotes: 1

Kirsten
Kirsten

Reputation: 131

Do you mean something like what protocol analyzers do? They take a stream of data and parse it out into the correct fields and display each field to a user. It sounds like you'd want to do something different with the parsed data. You'd still have to write the protocol decodes but after that you could do whatever you wanted with the data.

Wireshark is open-source and free and has lots of protocol decodes already, including SMPP. There are commercial options also.

Upvotes: 0

Related Questions