Skip to content

Latest commit

 

History

History
113 lines (97 loc) · 2.93 KB

PROTOCOL.md

File metadata and controls

113 lines (97 loc) · 2.93 KB

Network Speed Test Suite (NSTS) Protocol v1.0

  1. Description ============================================================================= The protocol that NSTS server and client follow to organize and execute tests. NSTS protocol is a message-based plain-text protocol with dependency on python pickle dump format.

  2. Messages =================================

All informations are exchanged in the form of messages. Each message is separated by the next message by using the LF (LineFeed) character.

Each message has the following format:

<TYPE> <PARAMS>

TYPE:
    Is a sequence of \[A-Z0-9\] characters that define the type of message.
PARAMS:
    Is a base64 encoded of the payload that is generated by python pickle text
    format.

2.1 "HELLO"

PARAMS = {
    "version"       // (tuple) sender's protocol version
    "remote_addr"   // (string) receiver's public address 
}

The first message to be sent and expected by both endpoints. This will be always forward compatible.

2.2 "OK"

PARAMS = {
}

A reply that last message was received and executed successfully.

2.3 "ERROR"

PARAMS = {
    "reason"        // (string) A reason why it was failed
}

A reply that last message was received but there was an error executing.

2.4 "CHECKPROFILE"

PARAMS = {
    "profile_id"    // (string) unique identifier of the profile
}

Asks the other peer to check for a profile. Checking involves if it is installed and supported execution on the other end.

A "PROFILEINFO" response is expected.

2.5 "PROFILEINFO"

PARAMS = {
    "profile_id" 	// (string) unique identifier of the profile
    "installed"     // (bool) Flag if the test is known
    "supported"     // (bool) Flag if the test can be run
    "error"         // (string) Any error message why is not supported 
}

A message containing information about the status of a profile.

2.6 "INSTANTIATEPROFILE"

PARAMS = {
    "profile_id"    // (string) unique identifier of the profile
    "direction"     // (enum) = { "receive", "send" }
    "options"       // (object) profile parameters
    "execution_id"  // (string) unique id of execution context
}

Requests the other end to prepare a profile for execution.

An OK/ERROR reply is expected.

2.7 "EXECUTIONFINISHED"

PARAMS = {
    "execution_id"  // (string) unique id of execution context
}

Announce that profile execution has finished.

2.7 "__XXXXX_YYYYY"

Profiles can intracommunicate with custom messagse. The type of the message must be in the form of:

__XXXX_YYYYY where 
XXXX:
    The unique identifier of the profile
YYYY:
    Profile's internal identifier to distinguish messages