Skip to content

sim(network): TCP fidelity non-goals — congestion control, retransmission, segment boundaries #206

Closed

Description

@PierreZ

Tracking issue recording what the simulated TCP model deliberately does not do after #202, so the scope decision has a home and can be revisited against a concrete need rather than re-argued.

What the model is

A reliable, ordered byte stream per direction with:

  • a bounded end-to-end byte window (tcp_send_window_bytes, acquired at poll_write, released only by the peer's poll_read);
  • real async backpressure (Poll::Pending on a full window, woken by the peer's read or the connection failing);
  • faults that reach queued and in-flight bytes (partition freezes the flight and thaws it on heal, black hole swallows at landing, abort discards);
  • latency sampled per chunk from write_latency plus a fixed per-pair extra.

What it is not, on purpose

Not modelled Why it is out of scope
Congestion control (Reno, CUBIC, slow start) Throughput shaping is already available through latency distributions, clogs and pair latency; a cwnd would add state whose only observable effect is a different latency curve, and it would need randomness that shifts every seed.
Retransmission timers / loss Moonpool is a TCP-level simulator (see AGENTS.md, "TCP-level, not packet-level"). Loss is expressed as a stall the heal resolves, never as a dropped byte in an established stream, which is what keeps the "no interior hole" guarantee.
Segment boundaries / MSS / sequence numbers Chunks follow poll_write calls plus the partial-write fault; the receiver already sees arbitrary splits through partial reads. Real segmentation would change no application-visible property.
A separate receive buffer with its own size One window per direction covers queued + in flight + unread; splitting it in two would double the knobs without adding a distinguishable failure mode.
ACK packets, RTT estimation, keep-alive probes Nothing in the system under test can observe them.

When to reopen any row

If a workload shows a bug class that only appears with one of these (for example an application whose correctness depends on the exact pacing of a congestion-limited stream), file it against this issue with the workload and the property, and the row moves from "non-goal" to a design. Until then, any PR that adds one of these should link here and explain which row it invalidates.

Activity

  1. PierreZ commented on Nov 16, 2026

    @PierreZ
    OwnerAuthor

    Closing: the book now records these non-goals. book/src/part4-networking/01-simulating-network.md ("TCP, Not Packets" and the list of what the model does not simulate) names congestion windows and slow start, MTU and fragmentation, packet routing, Nagle and delayed ACKs. If a workload shows a bug class that needs one of these, open a new issue with the workload and the property. Pierre approved the close in the moonpool issue triage of 2026-11-16.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions