| Internet-Draft | Shim Pipeline Specification for the Unhe | March 2026 |
| Bellis | Expires 20 September 2026 | [Page] |
This document specifies the Shim pipeline for the Unheaded Protocol Computer (UPC). The Shim translates MBC (Monad Bytecode) programs into eBPF execution contexts, defines the per-hop processing model, and specifies the tick packet protocol that drives distributed computation across IPv6 network hops. The pipeline implements a four-stage architecture: Assembly, Verification, Loading, and Execution, with integrated support for memory-mapped I/O, framebuffer rendering, and CRC validation.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them except as reference to a "work in progress."¶
This Internet-Draft will expire on September 18, 2026.¶
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info/) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 20 September 2026.¶
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document.¶
The Shim is the execution engine of the Unheaded Protocol Computer (UPC), responsible for translating and executing Monad Bytecode (MBC) programs within eBPF runtime contexts. It forms the critical bridge between the declarative instruction set defined by the MBC ISA and the native eBPF verifier and execution model of the Linux kernel.¶
The Shim operates within a four-stage pipeline:¶
This specification defines:¶
The Shim pipeline operates in conjunction with several related specifications in accordance with [RFC8126]:¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
The Shim pipeline transforms MBC source code into executable packet processing logic through four sequential stages:¶
┌─────────────────────────────────────────────────────┐
│ MBC Source Code (Text) │
└──────────────────┬──────────────────────────────────┘
│
▼
╔════════════════════════════╗
║ Stage 1: Assembly ║
║ • Label resolution ║
║ • Instruction encoding ║
║ • Binary image output ║
╚════════════┬═══════════════╝
│
▼
┌─────────────────────────────────────────────────────┐
│ Binary Program Image (32-bit words, little-endian) │
└──────────────────┬──────────────────────────────────┘
│
▼
╔════════════════════════════╗
║ Stage 2: Verification ║
║ • Opcode whitelist ║
║ • Register range check ║
║ • Immediate range check ║
║ • Branch target check ║
╚════════════┬═══════════════╝
│
▼
┌─────────────────────────────────────────────────────┐
│ Verified Program Image │
└──────────────────┬──────────────────────────────────┘
│
▼
╔════════════════════════════╗
║ Stage 3: Loading ║
║ • Create BPF maps ║
║ • Populate ROM_MAP ║
║ • Initialize CPU state ║
║ • Attach XDP program ║
╚════════════┬═══════════════╝
│
▼
┌─────────────────────────────────────────────────────┐
│ Loaded Program in BPF Runtime │
└──────────────────┬──────────────────────────────────┘
│
▼
╔════════════════════════════╗
║ Stage 4: Execution ║
║ • Fetch-decode-execute ║
║ • XDP invocation loop ║
║ • Tick packet processing ║
║ • State persistence ║
╚════════════┬═══════════════╝
│
▼
┌─────────────────────────────────────────────────────┐
│ Output: Monad state via XDP_TX │
└─────────────────────────────────────────────────────┘
¶
Each stage is atomic and idempotent. Programs rejected at Verification are never loaded. Programs that fail CRC validation during Execution emit an Anomaly event but do not execute MBC.¶
Assembly translates MBC instruction mnemonics into a binary program image.¶
MBC assembly is plain text, one instruction per line. Comments begin with '#' and extend to end of line. Blank lines are ignored. Labels are declared with a trailing colon and must appear alone on a line.¶
# FizzBuzz example MOVI r0, 1 # Initialize r0 = 1 loop: ADDI r0, r0, 1 # Increment r0 JNE r0, 100, loop # Jump if not equal MOV r1, r0 # Move result to r1 HALT # Stop execution¶
The output is a sequence of 32-bit words in little-endian byte order. Each instruction encodes to one word with format:¶
Bits 31-26 25-20 19-14 13-8 7-2 1-0 ┌──────────┬──────┬──────┬──────┬────┬──┐ │ Opcode │ Dest │ Src1 │ Src2 │Imm │Rsvd│ │ (6 bits) │(6b) │(6b) │(6b) │(4b)│(2b)│ └──────────┴──────┴──────┴──────┴────┴──┘¶
Example encoding of MOVI r0, 42:¶
Instruction: MOVI r0, 42 Opcode: 0x0F (MOVI) Destination: r0 (0) Immediate: 42 (0x2A) Binary: 0x0F00002A (little-endian) Bytes: 2A 00 00 0F¶
The assembler performs two passes:¶
Label references are resolved as relative word offsets from the branch instruction's position. A label at word address N referenced from instruction at word address M becomes offset (N - M).¶
Verification enforces security and correctness constraints before a program is loaded. Programs MUST pass verification or be rejected entirely.¶
Only 48 opcodes are valid. The verifier MUST reject any program containing an opcode not in the following list:¶
Valid opcodes: 0x00 HALT 0x01 NOP 0x02 MOV 0x03 MOVI 0x04 ADD 0x05 ADDI 0x06 SUB 0x07 SUBI 0x08 MUL 0x09 MULI 0x0A DIV 0x0B DIVI 0x0C MOD 0x0D MODI 0x0E AND 0x0F OR 0x10 XOR 0x11 NOT 0x12 SHL 0x13 SHR 0x14 LD 0x15 LDI 0x16 ST 0x17 STI 0x18 JMP 0x19 JEQ 0x1A JNE 0x1B JLT 0x1C JGT 0x1D CALL 0x1E RET 0x1F PUSH 0x20 POP 0x21 PUSHI 0x22 SYSCALL 0x23 LDMAP 0x24 STMAP 0x25 DICTLOOKUP 0x26 CRC16 0x27 FLAG 0x28 RFLAG 0x29 RESERVED 0x2A RESERVED 0x2B RESERVED 0x2C RESERVED 0x2D RESERVED ...¶
All register references MUST be in range [0, 15]. The verifier MUST reject programs with register fields containing values greater than 15.¶
Immediate values occupy 4 bits in the instruction encoding. MOVI and ADDI instructions with immediate values larger than 15 MUST be rejected at verification time. Programs requiring larger immediates MUST use multi-instruction sequences or load from ROM_MAP.¶
Branch instructions (JMP, JEQ, JNE, JLT, JGT) MUST have target offsets that:¶
Loading creates the runtime BPF map structures and initializes program state. All maps MUST be created before the program begins execution.¶
ROM_MAP stores the immutable program image and constant data.¶
Verified program image is populated into ROM_MAP starting at index 0. Unused entries are zero-filled.¶
RAM_MAP provides the flat address space for data memory and dynamic state.¶
RAM_MAP is initialized to zero. Memory layout is defined in Section 7 (Memory-Mapped I/O).¶
CPU_MAP maintains per-flow CPU state across distributed hops.¶
MbcCpuState structure contains:¶
SCREEN_MAP provides memory-mapped framebuffer access.¶
KBD_MAP provides memory-mapped keyboard input.¶
The following maps support extended functionality:¶
Execution implements the fetch-decode-execute cycle within XDP context, processing one instruction per invocation up to a 256-instruction limit.¶
Loop: 1. Fetch: Read instruction from ROM[pc] 2. Decode: Parse opcode and operand fields 3. Execute: Perform operation, update registers/memory 4. Increment: pc += 1 5. Check limit: if ticks >= 256 or HALT, exit loop 6. Else: goto Loop¶
Each XDP invocation MUST execute at most 256 instructions. This limit:¶
If an instruction limit is reached without HALT, the program suspends and resumes at the next tick packet. PC and register state persist via CPU_MAP across ticks.¶
Program state persists across tick packets via BPF maps:¶
State is keyed by flow tuple (source IP, destination IP, flow label). Different flows maintain independent execution contexts.¶
Tick packets are IPv6 packets [RFC8200] carrying Monad state and driving distributed computation across hops, with Shim programs verified against the BPF instruction set defined in [RFC9669].¶
A tick packet consists of:¶
┌─────────────────────────────────┐
│ IPv6 Fixed Header (40 B) │
│ • Version (4b) │
│ • Traffic Class (8b) │
│ • Flow Label (20b) │
│ • Payload Length (16b) │
│ • Next Header (8b) = 0 (HbH) │
│ • Hop Limit (8b) │
│ • Source Address (128b) │
│ • Destination Address (128b) │
└─────────────────────────────────┘
│
▼
┌─────────────────────────────────┐
│ Hop-by-Hop Options (24 B) │
│ • Next Header (8b) │
│ • Hdr Ext Len (8b) = 2 │
│ • Padding (16b) │
│ • Option Type: 0x3E (Monad) │
│ • Option Data Len (8b) = 20 │
│ • Monad Register File (20 B) │
│ (per draft-bellis-foundation) │
└─────────────────────────────────┘
│
▼
┌─────────────────────────────────┐
│ Payload (variable) │
│ Application-specific data │
└─────────────────────────────────┘
¶
Tick packet generation rates vary by operational mode:¶
Tick rate is controlled by application logic, not the Shim itself. The Shim simply processes each arriving tick packet up to its 256-instruction limit.¶
The Shim provides a unified 32-bit flat address space with reserved regions for memory-mapped I/O.¶
Address Range Size Device Access ───────────────────────────────────────────────────────────── 0x0000_0000-0x0003_FFFF 256 KB ROM R 0x0004_0000-0x0006_7FFF 160 KB Reserved - 0x0006_8000-0x0006_8FFF 4 KB Keyboard (KBD_MAP) R 0x0006_9000-0x0006_FFFF 28 KB Reserved - 0x0007_0000-0x0007_FFFF 64 KB Framebuffer R/W 0x0008_0000-0xFFFF_FFFF 4GB - RAM (RAM_MAP) R/W¶
Keyboard state is exposed as an 8-entry array of 32-bit values, where each bit represents one key state (1 = pressed, 0 = released). Total of 256 keys supported.¶
LD r0, 0x68000 # Load keyboard state word 0 LDI r1, 1 # Shift amount for key 1 (ESC) SHR r0, r0, r1 # Shift right by 1 AND r0, r0, 1 # Mask for single bit # r0 now contains ESC key state (1 if pressed, 0 if not)¶
The framebuffer is a 320x200 pixel display with 8-bit palette indices. Pixel (x, y) is stored at byte address 0x70000 + (y * 320) + x.¶
# Write color 42 to pixel (x=100, y=50) MOVI r0, 100 # x coordinate MOVI r1, 50 # y coordinate # Calculate offset: y * 320 + x MULI r2, r1, 320 # r2 = y * 320 ADD r2, r2, r0 # r2 += x # Add base address ADDI r2, r2, 0x70000 # Write color value MOVI r3, 42 # Color index ST r2, r3 # Store at calculated address¶
Ring buffer for terminal output. Write operations enqueue characters; read operations drain the queue.¶
The framebuffer is a 320x200 pixel display with scanline-major layout.¶
To write a pixel at coordinate (x, y):¶
address = 0x70000 + (y * 320) + x¶
Constraints:¶
The Shim defines conformance levels that implementations must support, organized as a stratified ladder.¶
Foundation layer providing:¶
Conformance: All implementations MUST support Level 0.¶
Instruction execution layer providing:¶
Conformance: All implementations MUST support Level 1.¶
Memory operations layer providing:¶
Conformance: All implementations MUST support Level 2.¶
Memory-mapped I/O layer providing:¶
Conformance: Implementations SHOULD support Level 2a. Level 2a enables interactive applications (games, demos, interactive programs).¶
Advanced features for future extension:¶
Conformance: Level 3 is OPTIONAL. Implementations may define their own Level 3 features.¶
Process and thread management:¶
Conformance: Level 4 is OPTIONAL.¶
Reserved for future extension. Currently not defined.¶
Implementations MUST declare which levels they support. A conforming implementation MUST support a contiguous range of levels starting from Level 0. For example:¶
An implementation claiming Level N support MUST also support all levels 0 through N-1.¶
CRC-16/CCITT validation ensures that register state has not been corrupted during network transmission.¶
When a tick packet arrives, the Shim MUST:¶
This ensures corrupted state never affects program execution.¶
After MBC execution completes (whether via HALT or 256-instruction limit), the Shim MUST:¶
This ensures correct state propagates to the next hop.¶
When CRC validation fails, an Anomaly event is written to COMPUTE_EVENTS with structure:¶
This specification requests creation of three IANA registries to support interoperability and future standardization.¶
Registry Name: Unheaded Shim Pipeline Stages¶
Range: 0-255¶
Initial assignments:¶
Registry Name: Unheaded BPF Map Types¶
Range: 0-255¶
Initial assignments:¶
Registry Name: Unheaded Dream Ladder Levels¶
Range: 0-7¶
Initial assignments:¶
The eBPF verifier is the primary security boundary. All MBC execution occurs within eBPF context, subject to kernel verification rules following principles established in [RFC9000] for transport reliability:¶
The 256-instruction limit per tick prevents malicious programs from consuming excessive CPU resources. Programs exceeding this limit are suspended and resume at the next tick. Over a period of N ticks, the maximum total instructions executed is 256 * N, providing predictable resource consumption.¶
BPF maps provide bounds checking:¶
The kernel enforces all bounds checks; the Shim does not need to replicate this.¶
All Shim processing returns XDP_TX (bounce packet to sender or next hop). Return codes XDP_DROP and XDP_PASS are never used, preventing accidental packet leakage into the host stack or transmission to unintended recipients.¶
Any node on the network path can inject tick packets. The Shim does not authenticate the origin of tick packets. This is an architectural assumption: use network ACLs and IPSec if authentication is required. The Shim's responsibility is to:¶
Monad register contents are visible in plaintext at each hop (in the IPv6 HbH option). There is no confidentiality for register state. If confidentiality is required, apply TLS or IPSec encryption at a layer above the Shim.¶
The Verification stage MUST reject programs with:¶
Programs that fail verification MUST NEVER be loaded. No exceptions.¶