NNRP/1 Session and Operation Model
The current public version explicitly separates connection, session, and operation so each layer has a clear responsibility.
Connection
The connection is the transport-level container. It handles message framing (packing, unpacking, byte-stream I/O) and hosts multiple sessions simultaneously. Connection-level FLOW_UPDATE applies to all sessions on that connection.
Session
The session is the default-context container. It is responsible for:
- Holding default profile, schema, budget window, priority class, and cache requirements.
- Letting multiple operations share the same default interpretation context.
- Serving as the unit for session-scope credit and state changes.
SESSION_OPEN is currently frozen to 48 bytes of fixed metadata, while SESSION_OPEN_ACK is 56 bytes. Their job is to establish default context, not to hide the first operation payload.
Operation
The operation is the actual execution unit. It is responsible for:
- Carrying the payload, schema override, or profile-local hint for one submission.
- Owning its result stream, terminal semantics, and operation-scope
FLOW_UPDATE. - Mapping cleanly to cancel, pause, resume, and completion state.
If you need the simplest host-side mapping:
- One connection maps to one I/O loop.
- One session maps to one set of default parameters and credit windows.
- One operation maps to one user task, one inference, or one frame-level unit of work.