Wire Protocol Specification
This document specifies the wire protocol used for communication between Geode clients and servers. The protocol uses length-prefixed Protobuf messages over QUIC (default) or gRPC.
Overview
Protocol Characteristics
| Property | Value |
|---|---|
| Transport | QUIC (RFC 9000), optional gRPC (HTTP/2) |
| Encryption | TLS 1.3 (mandatory for QUIC) |
| Message Format | Protobuf (length-prefixed) |
| Default Port | 3141 (standard), 8443 (alternative) |
| Protocol Version | 1 |
Key Features
- Mandatory Encryption: QUIC always uses TLS 1.3
- Multiplexed Streams: Multiple queries over a single connection
- Streaming Results: Paginated result sets with flow control
- 0-RTT Resumption: Fast QUIC connection establishment
- Connection Migration: Seamless network changes
Transport Layer
QUIC Connection
Geode uses QUIC by default (with optional gRPC). There is no TCP fallback for the QUIC transport. QUIC provides:
- Built-in encryption (TLS 1.3)
- Connection multiplexing
- Stream-level flow control
- Connection migration
- Reduced latency (0-RTT)
ALPN: QUIC uses geode/1 as the negotiated ALPN protocol.
Connection Establishment
Client Server
| |
|-------- QUIC Handshake ---------->|
|<------- TLS 1.3 Negotiation ------|
| |
|-------- HELLO Message ----------->|
|<------- HELLO_ACK ----------------|
| |
| Connection Ready |
Message Format
Protobuf Framing
All client/server messages are Protobuf messages defined in src/proto/geode.proto. Over QUIC, messages are length-prefixed to support streaming and multiplexed message boundaries. Over gRPC, the same Protobuf schema is used via standard gRPC framing.
Top-level wrappers:
ClientPacket→QuicClientMessageServerPacket→QuicServerMessage
Client Messages
HELLO (HelloRequest)
Initiates connection handshake and authentication.
Key fields:
username,passwordtenant_id(optional)client_name,client_versionwanted_conformance
RUN_GQL (ExecuteRequest)
Executes a GQL query or statement.
Key fields:
session_idqueryparams(repeatedParam { name, value })
PULL (PullRequest)
Requests the next page of results.
Key fields:
request_idpage_sizesession_id(required for gRPC; ignored for QUIC)
Transaction Control
BeginRequestCommitRequestRollbackRequestSavepointRequestRollbackToRequest
Server Responses
All responses are encoded in ExecutionResponse with a status object and a typed payload:
SchemaDefinition(column names/types)DataPage(rows + ordering metadata)Error(code/message)ExplainPayloadProfilePayloadExecutionMetrics(parse/plan/execute timings)
Status and Diagnostics
Every response carries a Status object:
status_class(ISO/IEC 39075 codes; e.g.,00000success)status_subclass(optional)additional_statuses(e.g.,US001,ExecutionGuardTrip)flagger_findings(implementation-defined or dependent behaviors)
Pagination
Results are paginated via PULL requests and DataPage payloads.
page_size=0defaults to 1000final=truemarks the last page- A
PULLafterfinal=truereturnsNoResult orderedandorder_keysindicate ordering guarantees
Policy: LIMIT/OFFSET without ORDER BY is rejected with diagnostic US001.
Explain & Profile
ExplainPayload and ProfilePayload are delivered via ExecutionResponse and are additive across releases. Clients should ignore unknown fields for forward compatibility.
Stability & Compatibility
- Wire changes are additive within a major version
- Removals or incompatible renames require a major bump
- Clients should be tolerant of unknown fields