Download Game! Currently 77 players and visitors. Last logged in:AnkasSerkeiiBrundirMalos

Blitzer's Blog >> 71361

Back to blogs index
Posted: 10 Jul 2026 17:59 [ permalink ]
Absolutely. Building a working prototype is the best way to battle-test the
architectural divide between the Control Plane and Data Plane. It will allow
us to validate the packet-routing speed and the handshake logic before
integrating it back into the actual QEMU/bare-metal environment.

Here is a blueprint for the Minimal Viable Prototype (MVP):

### 1. The Control Plane (FastAPI Matchmaker)

We will create a lightweight FastAPI service that handles the registration and
matchmaking. To keep the MVP simple, we will store the ledger in a standard
Python dictionary in memory (we can easily swap this out for Redis or SQLite
in WAL mode when we need to scale).

* **Endpoints:**
* `POST /register/provider`: Returns an assigned 4-byte Stream ID (e.g.,
`0x0A`) and the Data Plane's UDP ingress port.
* `POST /subscribe/consumer`: Registers a consumer IP/Port and their target
Stream ID.
* `GET /streams`: Lists active streams and connected peers for
statistical/admin viewing.



### 2. The Data Plane (UDP Multiplexer)

This will be a standalone Python script running on a designated port (e.g.,
`15000`). It needs to be a ruthless, high-performance packet router.

* **The Architecture:** We will bypass Python's Global Interpreter Lock (GIL)
and multithreading overhead entirely. A raw Python UDP multiplexer using
non-blocking sockets and the `select` module avoids the complexity and
performance hits of multithreading.
* **The Loop:** The worker will sit in a tight `select()` loop. When a packet
arrives on the ingress socket, it reads the 4-byte Stream ID header, looks up
the associated list of Consumer (Sink) IPs, and instantly forwards the payload
using `sendto()`.

### 3. The Test Harness (Mock Endpoints)

* **Mock Provider:** A tiny script that grabs a Stream ID from FastAPI, then
blasts a simulated binary payload (e.g., `[StreamID][X][Y][Color]`) at 60 FPS
to port `15000`.
* **Mock Consumer (The Hauki OS Stand-in):** A script that hits FastAPI to
subscribe, then binds to a local UDP port, printing the decoded $X, Y$
coordinates as they arrive.

---

This three-part MVP isolates the control logic from the firehose and will
definitively prove that we can push high-frequency updates without ever
choking the REST API.

Do you want to start by drafting the FastAPI Control Plane, or should we
tackle the raw UDP multiplexer worker first?