Skip to content

Bootstrap control lane

Before two kernel endpoints exchange a single call, each has to know who is on the other end of the socket. The bootstrap control lane establishes that. It authenticates the connecting process through the operating system's peer credentials, receives one registration frame, and checks both against the endpoint the nucleus host expected. Its result is an authenticated endpoint bound to one cell id, one cell epoch and one role. This page covers the checks the lane performs and the conditions that refuse a connection.

Establishing an endpoint

flowchart TB
  CONN["Unix stream connection"]
  subgraph LANE["BOOTSTRAP CONTROL LANE"]
    direction TB
    PC{{"Peer credentials<br/>uid, process id"}}
    RF["Registration frame<br/>process id, cell id, cell epoch, role"]
    ID{{"Registration matches<br/>the expected endpoint"}}
    PC --> RF --> ID
  end
  EXP[("Expected endpoint<br/>from the nucleus host")]
  OK(["Authenticated endpoint"])
  CONN --> PC
  EXP -.-> PC
  EXP -.-> ID
  ID --> OK

The expected endpoint names the user id, the process id when known, the cell id, the cell epoch and the role. Roles are a closed set: nucleus host, caller monitor, owner monitor and runtime provider.

The lane checks, in order:

  1. the peer's user id, read from the socket, equals the expected user id;
  2. the peer's process id, read from the socket, equals the expected process id when one is expected;
  3. the first frame on the connection is a registration frame;
  4. the registration's process id equals the peer process id the socket reported;
  5. the registration's cell id, cell epoch and role equal the expected ones.

Checks 1, 2 and 4 use credentials the operating system supplies, so the identity a process registers under is the one the operating system reports for it.

Refusals

Condition Message
Peer user id differs peer uid <n> does not match admitted uid <m>
Peer process id differs peer process id <n> does not match admitted process id <m>
First frame is another frame type first control-channel frame must be registration
Registration names another cell id, epoch or role registration does not match the admitted cell identity, epoch and role
Frame exceeds the size limit control channel frame has <n> bytes; limit is <m>

A registration whose process id differs from the peer process id the socket reported is refused the same way.

A refused connection produces no authenticated endpoint, so no receipt and no lifecycle transition follow from it.

After bootstrap

Registration happens once per connection. The authenticated endpoint is handed to the reference call lane, which carries every later frame. A registration frame arriving on an established session is refused. See Reference call lane and Cell control channel.