Skip to content

GaspardNET

A TCP-based protocol for exchanging files or messages over Ethernet.

This protocol aims to recreate an “internet” for old machines without the overhead of HTTP.

I want it to focus on resource retrieval rather than being general-purpose or tied to a particular rendering engine.

Structure

global uint8_t OPCODE;

Description

The structure supports several scenarios:

  • A client registering itself with a GaspardNET directory
  • A client connecting to another client
  • Two clients exchanging data

Illustration

Startup

I want to register myself. I send a hello request to a GaspardNET directory server.

For example:

hello request = OPCODE = 1 sent to gaspardnet.gaspardos.com

If the directory accepts it, it can return:

OPCODE = 2 = OK

or:

OPCODE = 0 = FAILED

If the request failed, the client must not send another request for ten minutes.

Request

The client can request a list of clients from the directory.

OPCODE = 3 = client request

The directory sends clients in the following format.

The response looks like this:

OPCODE = 2 = OK

The response size, encoded on 2 bytes

Then the response itself (IPv4 or IPv6 addresses—we will see).

Communication request between clients

The identity of a client must first be requested: