Ray's Knowledge Base
Unlock

Swap the roles of two nodes to split a clock bias from a role asymmetry

RecipeVerified 30 Sep 2026Holds anywhere
Recipe. When to use it, the steps, and what showed that they work.

When to use#

A two-node measurement, such as a one-way latency or a clock offset from (forward - reverse) / 2, shows a steady offset. It could be a bias between the two nodes' clocks or a real asymmetry between the two roles (a server that turns a message around slower than the client, say). One run cannot tell them apart.

Steps#

  1. Run the measurement as usual: node X is the server, node Y the client. Record the offset E1.
  2. Run it again with the roles swapped, same cells, same number of reps, close in time. Record E2, with the sign convention kept per role (server minus client).
  3. A clock bias between the nodes follows the node, so it flips sign between the runs. A role asymmetry follows the role, so it keeps its sign.
  4. Node bias = (E1 - E2) / 2. Role asymmetry = (E1 + E2) / 2.
  5. Compare a per-node quantity that uses only one node's clock (for example the time from a receive completion to the reply submit, on the server alone) between the two runs. If it matches, the nodes run the program at the same speed, and what flips is the clock.

Evidence#

dpucrumbs E2 on 2026-09-30: arm C read +2.56 us with the server on one DPU and -1.15 us swapped, a node bias of 1.86 us and a role asymmetry of 0.71 us. The NIC-side server turnaround differed by 0.15 us between the nodes, so the bias was in the clock mapping. It led to the fix of a drifting CLOCK_MONOTONIC-to-PHC offset.

Also found by searching

  • a steady offset between two nodes that might be clock or program
  • clock bias or role asymmetry in a two-node measurement
  • how do I separate a clock offset from a server client asymmetry
  • swap server and client to split the error
  • clock offset (fwd - rev)/2 shows steady +2.56 us between server and client DPU nodes, bias or asymmetry?
  • my one-way latency measurement between two nodes has a constant offset and I cannot tell if it is the clocks
  • how do I separate a clock offset between two machines from a server-versus-client processing asymmetry?
  • PTP PHC clock skew vs role asymmetry in ping-pong latency benchmark, swap server and client to tell apart