yotei/notes/UwUsched/Protocol.md

124 lines
2.4 KiB
Markdown
Raw Normal View History

2024-09-03 21:54:06 +02:00
- UUID-identifier with data
- Data binary- or hex-encoded
- Client <-> Host negotiating what to do => Task queue synchronization
=> Two seperate ways of communicating: One for neogtioating task queue stuff and one for data (Linked with UUID)
2024-09-03 23:21:23 +02:00
## Conn-Status
### Login
*Request:*
```json
{
"protocol_id":<protocol_id>,
"node_id":<node_id>,
"transaction_uuid":<transaction_uuid>,
"specs": {
"threads":<threads:u64>,
"clock":<clock:f64>,
"mem":<mem:u64>,
"net_speed_kib":<net_speed:f64>
}
}
```
*Response:*
```json
{
"protocol_id":<protocol_id>,
"node_id":<node_id>,
"transaction_uuid":<transaction_uuid>,
"status":<ACCEPTED|REJECTED>,
}
```
### Uptime Polling
*Request/Response:*
```json
{
"protocol_id":<protocol_id>,
"node_id":<node_id>,
"transaction_uuid":<transaction_uuid>
}
```
### Logout
*Request:*
```json
{
"protocol_id":<protocol_id>,
"node_id":<node_id>,
"transaction_uuid":<transaction_uuid>,
}
```
*Response:*
```json
{
"protocol_id":<protocol_id>,
"node_id":<node_id>,
"transaction_uuid":<transaction_uuid>,
"status":<ACK|OK|ERR>
}
```
>If the re-scheduling fails trigger the worker-node to give all HashMap-data to the head-node
2024-09-03 21:54:06 +02:00
## Pull
```json
{
2024-09-03 22:42:13 +02:00
"protocol_id":<protocol_id>,
2024-09-03 23:21:23 +02:00
"node_id":<node_id>,
2024-09-03 21:54:06 +02:00
"uuid":<uuid>,
"hashmap_id":<hashmap_id>,
}
```
## Response
```json
{
2024-09-03 22:42:13 +02:00
"protocol_id":<protocol_id>,
2024-09-03 23:21:23 +02:00
"node_id":<node_id>,
"uuid":<uuid>,
2024-09-03 21:54:06 +02:00
"status":<OK|HASH_ERR|TIMEOUT_ERR>,
"uuid":<uuid>,
"hashmap_id":<hashmap_id>
}
```
## Push
```json
{
2024-09-03 22:42:13 +02:00
"protocol_id":<protocol_id>,
2024-09-03 23:21:23 +02:00
"node_id":<node_id>,
"uuid":<uuid>,
2024-09-03 21:54:06 +02:00
"uuid":<uuid>,
"hashmap_id":<hashmap_id>,
"length_decomp": <length_decomp>,
"length_comp": <length_comp>,
"comp_format":<comp_format>,
"attributes":{go wild :3}
"data":<data>
}
```
> **Possible Traffic-Sequences**
> `PULL -> PUSH -> RESPONSE`
> `PUSH -> RESPONSE`
----
2024-09-03 22:42:13 +02:00
## JSON-Field Descriptions
2024-09-03 21:54:06 +02:00
**Data-Related**
`uuid`: sha-256 of decompressed data
`hashmap_identifier`: identifier of associated HashMap
`length_comp`: length of compressed data
`length_decomp`: length of decompressed data
`comp_format`: compression algorithm used
`data`: compressed data
`data_type`: either `permutation` or `state` (complete tree)
`attributes`: Implementation specific *EXTRAWURST*
**Control Flow**
2024-09-03 22:42:13 +02:00
`protocol_id`: `data_push | data_pull | data_response | hash_push | hash_pull | hash_response`
2024-09-03 23:21:23 +02:00
`node_id`:unique identifier of nodes. (Hostnames)
2024-09-03 21:54:06 +02:00
`status`: error codes indicating success of transmission