Home /Modules/http-2.0/FLOW.md

FLOW.md

http-2.0/FLOW.md · 108 line(s) · markdown

HTTP 2.1 Data Flow — Sketch

This is a sketch of the SLeeLa HTTP 2.1 application protocol, a sibling to ../http-3.0/. HTTP 2.1 shares HTTP 3.0's basic design goals but is an earlier generation: it carries the clean core only and omits the 3.0-era per-packet integrity substrate.

Same design goals as HTTP 3.0

GoalHTTP 2.1HTTP 3.0
Compact application envelope✅ core fields✅ core + integrity fields
Fast service/operation naming✅✅
Response model (transport ≠ application)✅✅
Retry classes✅ (READ/IDEMPOTENT/MUTATING)✅ (+ STREAM)
Traceable processing pipeline✅✅

What HTTP 2.1 deliberately omits (3.0-era additions)

So a 2.1 packet is just: VERSION | FLAGS | SERVICE-ID | OP-ID | REQUEST-ID | PAYLOAD.

The data, and where it lives

ConceptType / symbolFile
Compact envelopeh21_envelope_th21_envelope.h
Textual/binary pack/unpackh21_envelope_pack_text / _binary (+ unpack)h21_envelope.c
Fast-naming dictionaryh21_naming_th21_naming.h
Response modelh21_response_t / h21_status_th21_envelope.h
Retry classesh21_retry_class_th21_pipeline.h
Processing pipelineh21_pipeline_dispatch / _handle_wireh21_pipeline.c
Python parityh21_flow.pyh21_flow.py

Wire forms

envelope (textual):  H21 <ver> <flags> <service_id> <op_id> <request_id> <len>:<payload>\n
response (textual):  H21R <status> <request_id> <len>:<result>\n
envelope (binary) :  [ver:1][flags:1][service_id:4][op_id:4][request_id:8][payload_len:4][payload:N]

Hot path (no integrity gate)

   receive -> minimal parse (auto-detect textual "H21 " vs binary)
           -> service-id lookup -> operation-id lookup
           -> dispatch -> business logic -> pack response

Unlike HTTP 3.0, there is no integrity gate between parse and dispatch: 2.1 has no per-packet MAC, host-identity, replay, or basket checks.

Implementation status

Build

cd http-2.0
make proto     # compiles the protocol-core objects (compile check)
make syntax    # syntax-only check of all C sources

Port and Stream Multiplexing

The logical-port model can sit above an HTTP/2 stream layer in a future transport implementation. The current server does not implement that layer.

one transport connection
        |
        +-- HTTP/2 stream 1 -- logical port -- service/op -- payload
        +-- HTTP/2 stream 2 -- logical port -- service/op -- payload
        +-- HTTP/2 stream N -- logical port -- service/op -- payload

The important separation is:

A logical port therefore does not require one operating-system socket per service. Multiple logical ports can share the same HTTP/2 connection and its stream pool.

HTTP/2 stream identifiers and SLeeLa logical ports are different namespaces and must not be conflated. The stream provides transport multiplexing; the logical port provides application routing.

Download Mode for Files > 50 MB

The design proposes HTTP/2 streams for multiplexing, while SLeeLa DOWNLOAD metadata describes resumable transfers for files larger than 50 MB. The current server does not implement an HTTP/2 stream engine or filesystem-backed transfer manager. A stream carries FILE-ID and transfer index; resume state survives stream completion.

SESSION-ID | DATETIME | FILE-ID | FILE-NAME | INDEX | OFFSET | TOTAL-SIZE

The client resumes from FILE-ID + INDEX/OFFSET and does not depend on the original HTTP/2 stream remaining available.