Home /Modules/http-4.0/README.md

README.md

http-4.0/README.md · 212 line(s) · markdown

<img align="right" src="https://github.com/mearvk/SLeeLa/blob/master/images/debian/debian-logo.png" width="75" height="75" alt="SLeeLa">

<img src="https://github.com/mearvk/SLeeLa/blob/master/images/sleela/sleela-logo-004.jpg" alt="SLeeLa">

SLeeLa HTTP 4.0

Status: Experimental SLeeLa frame-based protocol foundation. Not production-ready; see STATUS.md and CAPABILITY-MATRIX.md.

Platforms: Linux · macOS · Windows 10+

HTTP 4.0 moves the SLeeLa model toward an explicit message and frame lifecycle. It is not an IETF HTTP/4 standard — it is a SLeeLa experimental protocol layer that can be carried by HTTP/3 or another supported transport.

Build and test

make            # build selftests + server
make test       # run protocol, segmentation, session-state, and server self-tests
make session-test # run bounded per-stream state self-test
make resume-test  # run authenticated-resume policy gate self-test
make fuzz        # optional Clang libFuzzer + ASan/UBSan parser harness
make server     # build just the portable server
make server-test# run the server self-test
make protocol-test     # run the frame protocol self-test
make segmentation-test # run the segmentation/reassembly self-test
make clean

Platform notes

PlatformSocket layerCompilerLink flags
LinuxPOSIX sockets via sleela_netcc / gcc(none)
macOSPOSIX sockets via sleela_netcc / clang(none)
Windows 10+Winsock2 via sleela_netMSVC / MinGW-lws2_32

No external dependencies. Pure C11 with libc only.

Running the server

./http4_server_bin --port 8083
# To listen on another IPv4 interface, explicitly opt in:
./http4_server_bin --bind-address 192.0.2.10 --port 8083

Options:

Architecture

Application
    |
SLeeLa HTTP 4.0 semantic API
    |
HTTP 4.0 frame model                ← OPEN/DATA/END/RESET/WINDOW/PING/PONG/RESUME/CAPSULE
    |
Capability + session control
    |
Segmentation / reassembly           ← large payloads split across MTU-sized frames
    |
Packet context (education + basket)
    |
Carrier adapter                     ← sleela_net portable sockets (Linux/macOS/Windows)
    +-- HTTP/3 / QUIC
    +-- Future native carrier
    +-- Test / in-memory carrier

Engineering specification and verification\n\n- Normative core specification\n- Conformance and adversarial test plan

Fixed-width 32-byte header, big-endian:

VERSION | TYPE | FLAGS | STREAM-ID | REQUEST-ID | SEQUENCE | PAYLOAD-LENGTH | PAYLOAD
  1B      1B     2B       8B          8B           8B          4B             N bytes

Frame types:

TypeCodeDescription
OPEN1Establish a logical request or stream
DATA2Carry application payload
END3Complete a request or stream
RESET4Terminate a stream with error
WINDOW5Advertise receive capacity
PING6Liveness probe
PONG7Liveness response
RESUME8Continue an interrupted transfer
CAPSULE9Carry negotiated/session metadata

Flags: FIN (0x01), ACK (0x02), URGENT (0x04), INCREMENTAL (0x08), RESUMABLE (0x10).

Built-in endpoints

PathMethodDescription
/__sleela/healthGETReturns SLeeLa HTTP/4.0 OK
/__sleela/statusGETJSON: server, generation, VM, platform, frame types, capabilities
/__sleela/negotiateGETVersion negotiation result (JSON)
/__sleela/h4POSTH4 frame endpoint — accepts binary frames (32-byte header + payload), dispatches to frame handler, returns response frame or JSON metadata

SLeeLa application headers

Every response includes:

X-SLeeLa-Version: 4.0
X-SLeeLa-Accept: 4.0, 3.0, 2.1, 1.1, 1.0

Core capabilities

CapabilityStatusNotes
Fixed-width frame headerImplemented32 bytes, big-endian
9 frame typesImplementedOPEN through CAPSULE
Stream/request/sequence IDsImplementedExplicit protocol fields
Deterministic encode/decodeImplementedRound-trip tested
SegmentationImplementedLarge payloads → MTU-sized frames
ReassemblyImplementedBitmap-tracked, out-of-order tolerant
Packet contextImplementedEducation token + basket
Payload wrappingImplementedContext-prefixed wire payloads
Resumable deliveryImplementedRESUME frame type
Incremental deliveryImplementedINCREMENTAL flag
Flow controlFrame-levelWINDOW frame type
Capability negotiationFrame-levelCAPSULE frame type

HTTP 3.0 → HTTP 4.0

ConcernHTTP 3.0HTTP 4.0
Application envelopeCentralRetained as semantic payload
Stream identityCarrier-orientedExplicit protocol field
Sequence handlingRequest/integrity layerAuthenticated frame sequence
ResumeApplication conventionExplicit RESUME frame
Flow controlAdvisory/applicationExplicit WINDOW frames
Incremental deliveryApplication/carrierExplicit DATA lifecycle
Capability negotiationHandshakeSession capability model
CarrierPrimarily HTTP/3Pluggable carrier
MigrationCarrier-dependentProtocol session model
ErrorsResponse/pipelineTyped stream/session RESET

Large-file download mode

Files larger than 50 MB use the shared SLeeLa DOWNLOAD resume contract:

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

Security boundary

HTTP 4.0 does not replace TLS or invent a substitute for authenticated transport. Frame validation and sequence checks are deterministic. Cryptographic key management remains a separate concern.

File inventory (server additions)

FileDescription
http4_server.hServer API, HTTP types, frame handler, download state
http4_server.cFull server: parse, route, H4 frame endpoint, self-test
http4_main.cCLI entry point with echo frame handler
http_negotiation.hC negotiation API (reformatted)
http_negotiation.cVersion negotiation (reformatted)
http_negotiation.hppC++ negotiation wrapper (reformatted)
http_negotiation.cppC++ wrapper implementation (reformatted)

The existing protocol core (http4_protocol), packet context, packet payload, segmentation, reassembly, and their self-tests are unchanged.

Hardening additions

The stream and resume policy modules are currently testable reference components, not yet connected to the server dispatch path. The resume test uses fake verifier callbacks; production must supply cryptographic verification and durable atomic storage.

Dependencies

ModulePathRole
sleela_netimpl/core/sleela_net.{c,h}Portable TCP sockets
preferred_routerpreferred-routers/Routing-tier policy
resolverresolver/DNS / path / event policy

Unified route data

This server consumes the SLeeLa unified route-data contract in route/ROUTE.DATA.json and route/ROUTE.DATA.md. VM identity: /impl Core, /1 Foundation, /2 Operator, /3 Specialist, /4 Supervisor, /5 Manager, /6 Director, /7 Administrator, /8 Executive, /9 Authority, /10 Principal, /11 Sovereign.


SLeeLa

<p align="center"><img src="images/sleela/sleela-wordmark.svg" alt="SLeeLa — The Now. The Ingredient." width="560"></p> <p align="center"><img src="https://github.com/mearvk/SLeeLa/blob/master/images/sleela-programming-language-002.jpg" alt="SLeeLa Marketing Logo" width="560"></p>