You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by Christofer Dutz <ch...@c-ware.de> on 2019/01/28 14:07:11 UTC

Defining Protocol State-Machines

Hi all,

so now I seem to have managed describing the format of the messages of an industry protocol.

Still I have to manually implement the protocol itself. I have to construct messages in a pre-defined format, send that to a remote station, wait for a response, extract data from that.
Depending on the returned data, I construct other messages and send them again …

I would think that it should be possible to sort of describe this in a universal way too.

I’m sort of thinking of something like this:


  *   I have some format (Preferably XML) where I define a state-machine for every protocol.
  *   In this state machine I can attach message templates to the transitional-edges (similar to the XMl representation in the TDML)
  *   In the states I define the options of what next edge I should take:
     *   Sort of:
        *   If “initial State” -> Send “COTP Connect” message -> Wait for Response -> if response/returnCode = 0xFF (all ok) -> Send “S7SetupConnectionRequest” message -> Wait For Response -> If …
        *   If /S7Response/Parameter/ReturnCode == 0xFF -> Go to the “Initialized” state
        *   If != 0xFF -> Go to some “Error handling” state

So now my question:

  *   Does Something like this already exist?
  *   Would it make sense to define something here in the Daffodil project, or should I do that in PLC4X?

Chris

Re: Defining Protocol State-Machines

Posted by "Beckerle, Mike" <mb...@tresys.com>.
Christofer,


Your idea here sounds to me like a toolkit using on an XML-based language, for describing communicating state machines, or protocol handshakes.


This is a good idea. From a systems-security perspective, creating these by starting with a Turing-complete programming language is unwise. See langsec.org for why etc.


I don't know of such a kit, but I have not looked for one.


if you search and find something that actually works when you try it out, please post back here or  better,... on users list because many users of DFDL/Daffodil have this same issue.


I think this does go outside the scope of the Daffodil project, which we need to keep narrowly focused on implementing DFDL, but I for one would be really interested in this.


-Mike Beckerle

Tresys

________________________________
From: Christofer Dutz <ch...@c-ware.de>
Sent: Monday, January 28, 2019 9:07:11 AM
To: dev@daffodil.apache.org
Subject: Defining Protocol State-Machines

Hi all,

so now I seem to have managed describing the format of the messages of an industry protocol.

Still I have to manually implement the protocol itself. I have to construct messages in a pre-defined format, send that to a remote station, wait for a response, extract data from that.
Depending on the returned data, I construct other messages and send them again …

I would think that it should be possible to sort of describe this in a universal way too.

I’m sort of thinking of something like this:


  *   I have some format (Preferably XML) where I define a state-machine for every protocol.
  *   In this state machine I can attach message templates to the transitional-edges (similar to the XMl representation in the TDML)
  *   In the states I define the options of what next edge I should take:
     *   Sort of:
        *   If “initial State” -> Send “COTP Connect” message -> Wait for Response -> if response/returnCode = 0xFF (all ok) -> Send “S7SetupConnectionRequest” message -> Wait For Response -> If …
        *   If /S7Response/Parameter/ReturnCode == 0xFF -> Go to the “Initialized” state
        *   If != 0xFF -> Go to some “Error handling” state

So now my question:

  *   Does Something like this already exist?
  *   Would it make sense to define something here in the Daffodil project, or should I do that in PLC4X?

Chris