Skip to content

Network protocol

Diego Rodríguez Riera edited this page Apr 5, 2020 · 4 revisions

TCP message structure definition

Here are some examples of messages:

A vector addition of 2 vectors of dimension 2 with a password

+all ok:secret password<[vector|add|2,2]{1,2,3,4}>

A response to a public key petition

+:secret password<encryption key>

A server timeout with a user message as payload

-server timeout:<the server esp.xxx.yyy has timed out>

The message is composed of a series of elements:

Control character [+/-]

The + control character indicates that there are no errors The - control characters indicates that there is an error in the control code field

Control code

A control code

If the control character is + there is no need for this field, the receiver does not expect a control code, but if it is present it is ok, used mostly for debugging.

If the control character is -, an error code at the control code is expected to handle the error.

Password

If the network is password protected, a password must be used here, otherwise leave blank.

Payload

The message payload, it can be an encryption key, or a computation load for a container.

Encryption key

The plain encryption key is send in the payload field.

Computation load

The computational load is subdivided in 2 main parts:

operation

The full operation, divided in two parts

operation code

The operation code, for example, matrix, image, or weather.

sub operation code

The specific sub operation of the main operation, for example, multiplication in the matrix operation.

metadata

The metadata that supports the operation, for example, in the matrix multiplication, the metadata will be the size of the tow matrix.

data

The raw data of the operation, normally comma separated values.

Encryption

All connections must be encrypted by the receiving side public key, so the communication is secure.

The key should be generated at the application or call at the client if none is specified.


[Next: Developer's introduction to the system] -#------ [Next: Libraries]