Definition
Useful goodput is the rate, in bits per second, at which a receiver obtains the bytes the application needs. A frame is one unit of data as sent and received, and useful goodput leaves out frame headers, measurement fields such as a sequence number, duplicate frames and rejected frames. The first-frame correction applies when that rate is timed from the arrival of the first counted frame to the arrival of the last. The first frame’s bytes are then left out, because that frame had finished arriving when the timing began.
The idea
A receiver records the time at which each frame arrives. Three frames of 100 bytes arrive at 0, 10 and 20 milliseconds (ms). The obvious calculation divides all 300 bytes by the 20 ms between the first and the last arrival. But the timing started when the first frame had already arrived, so the time the link spent carrying that frame lies before the window. Inside the window are two gaps, and each gap ends with the arrival of one frame. The 20 ms paid for 2 frames, not 3.
This is the fencepost count: a straight fence with 3 posts has 2 spans between them. A window that starts and ends on an arrival contains one fewer gap than it contains arrivals. The picture treats each gap as the time the link spent on one frame. If the sender pauses, a gap also holds idle time, and the rate then includes that idle time, as a delivery rate should.
A second correction concerns the bytes themselves. Experiments often start each frame with a measurement header, such as a sequence number that lets the receiver detect lost frames. The application never asked for those bytes, so useful goodput leaves them out. All data in this entry’s examples are invented.
How it works
The computation has four steps.
Decide what earns credit. State which frames count, usually those the receiver accepts, each counted the first time it arrives, and how many useful bytes each carries. For a frame of bytes that includes bytes of measurement header, the useful length is .
Fix the window. Let be the number of counted frames. The window starts at the arrival of the first counted frame, at time , and ends at the arrival of the last, at time , both read from one clock and measured in seconds.
Credit the frames that arrive inside the window. When the clock distinguishes the first arrival from the second, frames 2 to arrive after and no later than . Frame 1 arrives exactly at the start and is not credited. If other frames share the first timestamp, exclude all of them as well. The next formula assumes the first frame alone has that timestamp.
Divide, and convert bytes to bits. If the frames differ in size, replace by the sum of the useful bytes of the frames stamped strictly after , including the right endpoint .
The correction belongs to this window, not to goodput §7.39 in general. The rule behind it is to credit exactly the bytes whose recorded delivery falls inside the window. Suppose the window instead starts at an earlier event, read on the same clock at time , that comes before the link begins carrying the first frame, such as a start signal that the receiver timestamps. Then all frames are carried inside the window, and the rate is . The finite-window rate §11.41 entry states the rule for any window.
Worked example
Three frames of bytes arrive at , and seconds. Each frame begins with bytes of measurement header, so useful bytes. The window is seconds long and contains credited frames:
Using , every frame at its full length, gives bits per second. That is times the correct value. The factor has two parts: from crediting three frames to two gaps, and from counting header bytes as useful; .
The two errors behave differently as the run grows. With frames at the same spacing of 0.01 seconds, the window is seconds. The correct rate is bits per second, as before. Crediting all 1001 frames gives bits per second, only times, or 0.1%, too high. Counting header bytes as useful still makes the rate times, about 4.2%, too high, however long the run.
Stated precisely
Number the counted frames in order of arrival, with arrival times in seconds, read from one clock. Let be the number of useful bytes in frame . Write for the half-open interval §14.12 of times after and up to and including . The window is , and it credits every frame with a recorded time strictly greater than . For three 100-byte useful frames stamped 0, 0 and 1 second, only the last earns credit, giving 800 bits per second. When all timestamps tie, the duration is zero and the rate is undefined. For with ,
If the frames arrive with a constant spacing of seconds and each carries useful bytes, the window is long and exactly, which is the long-run rate of the stream. The estimate exceeds that rate by the factor .
is the delivered useful goodput only if four conditions hold.
One clock. Both times come from the receiver’s clock, or from two clocks whose offset and rate are known.
One arrival point. Each arrival time is taken at the same point in the receiving software, for example when the application receives the frame.
Distinct, accepted frames. Each counted frame was accepted and is counted once; a duplicate copy adds no useful bytes.
A stated useful length. The useful bytes exclude every header and measurement field, and the report says which fields were excluded.
Limits and common mistakes
One frame gives no rate. With the window has length 0 and no frame is credited.
A short window is dominated by its edges. Suppose frames arrive in bursts of 4 frames, 1 ms apart, and each burst starts 10 ms after the previous one. The long-run rate is 4 frames per 10 ms, or 0.4 frames per ms. A window that covers one burst credits 3 frames to 3 ms, 1 frame per ms, which is times the long-run rate. A window should cover many bursts, or start and end at the same point of the burst cycle, such as the first frame of a burst.
Frames that are lost and never delivered earn no credit, which is correct for a delivery rate, but the number lost belongs beside the rate. A rate computed at the receiver describes delivery. The rate at which the sender submits bytes can be higher for a while, as long as a queue between them is filling.
Averaging the rates of several trials gives every trial equal weight. Dividing the total credited bytes by the total window time weights each trial by its duration. The two answers can differ when trials differ in length; the entry on the ratio of aggregates versus aggregate of ratios §11.40 explains which question each answers.
The correction is not universal. For a window that includes the transfer of the first frame, crediting all frames is correct, and leaving one out would understate the rate.
Questions answered
Why not use ?
, the number of frames times the full frame length in bytes, should not be used because it makes two counting errors when the time is measured from the arrival of the first frame to the arrival of the last. First, the time window credits arrivals strictly after its opening timestamp. That leaves frames when only the first frame has that timestamp. If two frames tie there, both are excluded. Second, includes bytes of measurement header, such as a sequence number and a timestamp, which are not useful data; the useful length is .
With one frame at the opening timestamp and equal useful lengths, goodput is bits per second, where and are the first and last arrival times in seconds and the factor 8 converts bytes to bits. For three 100-byte frames with 4-byte headers arriving at 0, 0.01 and 0.02 seconds, this gives bits per second, while gives bits per second, 1.5625 times too high. All useful payloads earn credit when their delivery timestamps lie strictly after the opening time and at or before the closing time.
Related entries: Finite-window rate (§11.41), Ratio of aggregates versus aggregate of ratios (§11.40), Length-prefix framing (§4.30), Throughput versus goodput (§7.39), Figure 11: BLE airtime, event capacity, and a goodput ceiling (§18.2.19), Timing endpoints and inclusive versus exclusive windows (§18.1.6).