Engineering Notes Project
A Reply That Arrived in the Same Instant as the Request
Ethernet models completed a received frame the instant it arrived, so IRIX lost the first ping reply. A 200 microsecond floor cut IOC3 loss from 18 in 100 to none.
IRIX regularly lost the first echo reply after network bring-up, on three of the four Ethernet adapters we model. On the IOC3 a loop of pings lost 18 of 100 with the emulator as it stood. The fix is a 200 microsecond delay, an approximation that we measured and could not derive.
What the trace showed
A traced IRIX boot on the IOC3 lost 16 of 50 pings. The trace classified the receive cycles by how long the reply took to complete after the guest rang the transmit doorbell. Of the 27 classified cycles whose replies completed within 74 microseconds of the doorbell, 13 were lost, and 10 of the 17 within 24 microseconds. Of the 14 that took 75 microseconds or more, none was lost. On the Xframe, which runs under instruction counting, a successful reply completed at the same virtual-clock instant as the doorbell.
That observation points at the cause. The device models carried no wire time, no peer time, no transceiver time and no DMA time. When the emulator’s network backend handed over a frame, the model wrote the frame into the guest’s buffer and published the completion in the same virtual instant. No physical link does that. Two minimum-size frames at 100 Mbit/s take 6.72 microseconds each on the wire once preamble and interframe gap are counted, before the peer has done anything with the request. The loss correlates with the reply arriving early. Exactly what IRIX does with a completion that early, and why it drops the reply, was not traced to a cause. What the data supports is the correlation and the fact that removing the zero-time arrival removes the loss.
The fix, and why it is shaped the way it is
The four SGI Ethernet models, the IOC3, Tigon, BCM570x and Xframe, share one delay line. The frame data is written into the buffer the guest posted as soon as the frame arrives, the way a real part’s DMA lands before its status write. Only the half the driver can see, the completion, waits for a deadline on the virtual clock. Several completions can be in flight at once, each with its own deadline, so the delay adds latency without capping the frame rate.
The delay-line depth was a measured decision too: at a depth of 16, a 16 MB UDP transfer at 100 Mbit/s lost 49,152 bytes where the undelayed path lost none. A line too shallow stops being a delay and becomes a rate limit.
The Tigon never needed it. Its firmware finds completions by reading ring indices, not by waiting for a raised interrupt, so it had no race to lose.
Why 200 microseconds and not 20
The reasoning the number started from was a real round trip of about 20 microseconds. That bound comes from 802.3 framing at the slowest link rate any of these adapters presents, plus a peer answering from its own interrupt handler (the peer’s share is inferred), and it is the smallest delay that could be physically plausible. The series of floors on the IOC3 under IRIX 6.5.30:
| Floor | Pings lost |
|---|---|
| none | 18 of 100 |
| 20 µs | 3 of 150 |
| 50 µs | 2 of 150 |
| 100 µs | 2 of 150 |
| 200 µs | 0 of 150 |
Any floor removes most of the loss. Only 200 microseconds removed all of it. The reason a bound of about 20 microseconds is not enough is that the emulator does not run the guest at hardware speed against the virtual clock. In the traced IOC3 boot, the guest’s own receive service, from interrupt entry to the receive ring being refilled, took 68 to 480 microseconds of virtual time across 61 receive cycles. The modelled processor would need something on the order of 10 microseconds, an estimate and not a measurement. The stretch is seven to forty-eight times. Twenty microseconds scaled by the low end of that is about 140.
So the floor is a physical bound multiplied by how much slower the emulated guest is than the clock it is measured against. That is a property of the emulator, not of any one adapter, which is why the same default serves all four.
What it does not establish
The 200 microsecond figure is not a hardware latency. It was chosen from how an emulated IRIX responds. A real adapter’s arrival-to-interrupt time varies with frame size, link rate, bus occupancy and driver interrupt coalescing, and none of that is modelled: every frame gets the same minimum.
200 is not shown to be the optimum. Against the pooled 20 to 100 microsecond points our design note calls the difference “suggestive rather than proven”. No shorter floor has been shown to do the job, so the default stayed.
The floor series covers two adapters. It was measured on the IOC3 and the Xframe. The Tigon and BCM570x are not in it. The Xframe’s loss without a floor was too rare for 50 pings a boot to separate the floors, so the IOC3 decided the figure.
Not every ping was recovered. Twelve interleaved boots of 50 single pings each on the merged
build lost none, but nine of those 600 replies were not reported by the ping utility, scattered
across all four adapters. The guest kernel counted every one of them, and the captures pair every
request with a reply within half a millisecond. Each of the nine was a ping that took over five seconds
against a norm of 1.1. The ping utility’s own wait running out accounts for what it reported. Why it
waited is not known, and we claim no cause.
A saturated transfer still loses data. Seven of eight 128 MB transfers at 100 Mbit/s arrived short, at the default floor and at zero alike, on a loaded host, so those runs do not isolate a cost of the floor. In one traced Xframe transfer the model took every frame and the guest still dropped 76 datagrams. Why is not known.
An earlier table of the floor’s cost rested on runs that had actually failed but were reported as complete by a bug in the script that summarised them. We discarded it and redid the runs with each run’s state confirmed; the numbers here come from the redone measurements and the original series.
Where the numbers live
The design note docs/designs/receive-arrival-latency.md holds the derivation, the floor series and its limitations, and
docs/NOW.md holds the 600-ping result and the unreported nine.