The LoconetOverTcp protocol

 SourceForge   Overview   Protocols   

Contents


Protocol overview

A small summary of design goals:


Version history


Syntax of the protocol lines

All transmitted data must be readable ASCII format. Binary data is coded in hex or decimal ASCII representations. The data stream in the TCP connection is split into lines. A line ends with either a cr (13dec=0Dhex) or lf (10dec=0Ahex). Receivers must accept any combination and have to discard empty lines, senders may send any combination. Each line starts with a token. A token is a sequence of uppercase ASCII characters. After the token may optionally follow a parameter which is separated by one space (32dec=20hex) from the token. The syntax of the parameter is described below with the token.


Messages from client to server

1. SEND

Parameter Hex dump of LocoNet message
Description This message is a request to the server to send the LocoNet message passed as parameter to the net.
Example SEND A0 2F 00 70


Messages from server to client

1. VERSION

Parameter Arbitrary sequence of ASCII characters that identify the server and its version
Description This messages may be sent from the server to any newly connected client to inform the (user of the) client about the server version.
Example VERSION LbServer version 0.1a built May 30 2002

2. RECEIVE

Parameter Hex dump of LocoNet message
Description Every message that is received by the server from LocoNet is distributed to every client with this line.
Example RECEIVE 83 7C

2. SENT

Parameter two possibilities:
  • OK _comment_
  • ERROR _comment_
"_comment_" is an arbitrary sequence of character that explain the reason for the success (in case of "OK") or failure (in case of "ERROR") in English natural language.
Description This message is always sent as response to a "SEND" message. Proper timeouts still have to be invented.
Example SENT ERROR Did not receive echo from LocoBuffer


Sequence diagrams

To relate the sequence of messages and events on the net and on the TCP connection, I drew some sequence diagrams. I guess they are not strictly UML, but I am willing to learn :-)
Available diagrams: No link means, the diagram is still under construction

 SourceForge   Overview   Protocols   
Author of this page: Stefan Bormann. Site hosted by: SourceForge Logo