How the DNP3 Need Time Bit Keeps Your Event Timestamps Honest
Why outstations stamp their own events, how the Need Time (IIN1.4) bit and delay-corrected clock writes work, and how bad sync turns an SOE log to fiction.
Why DNP3 cares about time at all
Most protocols hand you a value and let the master stamp the time on arrival. DNP3 does something different: the outstation timestamps its own events, at the moment they happen, and buffers them until the master collects them. That is the whole point of the class-based event model — a breaker trip that occurred while the radio was down still arrives with the time it actually tripped, not the time the poll finally got through.
That design only works if the outstation's clock is right. If the outstation is thirty seconds off, every event it reports is thirty seconds off, and no amount of master-side cleverness fixes it. So DNP3 has a built-in mechanism for the master to set the outstation's clock, and a flag the outstation raises when it thinks its clock has drifted. Get that mechanism wrong and your sequence-of-events data becomes fiction that looks precise.
This article is the time-sync layer beneath the class poll and unsolicited response notes: same event model, but focused on the clock the timestamps depend on.
The Need Time bit
Inside every DNP3 response is a two-byte field called the Internal Indications, or IIN — defined in IEEE 1815, the DNP3 standard. One bit in it, IIN1.4, is the "Need Time" bit. The outstation raises it to tell the master: my clock needs setting, please sync me.
An outstation sets Need Time in a few situations:
- On startup, before it has ever been synced. A freshly booted outstation does not know what time it is.
- After a configured interval, because its internal oscillator drifts and it wants a fresh sync before the drift matters.
- After certain events that may have disturbed its timekeeping.
The master watches for this bit in every response. When it sees Need Time set, it is supposed to run a time-sync procedure and write the current time to the outstation, which clears the bit. The loop is simple: outstation asks, master answers, bit clears.
The classic field failure is a master that never answers. If the master is not configured to service the Need Time bit — or an operator disabled time sync to "reduce traffic" — the outstation raises the flag forever, its clock free-runs, and event timestamps drift further every day. Nothing alarms, because the link is healthy and data is flowing. The times are just quietly wrong.
Absolute time versus record-current-time
There are two ways a DNP3 master can set an outstation's clock, and they exist because the network path itself takes time.
Write absolute time (LAN procedure). The master measures the round-trip delay to the outstation first, then writes a timestamp with the delay already added in, so the value lands correctly. This is the procedure to use on any link where the transit delay is significant or variable.
Record-current-time (serial / non-LAN procedure). The master sends a Record Current Time function, the outstation notes the exact instant that message arrives, and the master then reads back and corrects. It is the simpler procedure for direct serial links where delay is small and stable.
The reason this matters: if a master naively writes "it is 12:00:00.000 now" and the message takes 400 ms to cross a radio path, the outstation sets its clock 400 ms slow the instant it arrives. On a network where you are trying to resolve which of two events happened first, 400 ms is the difference between a correct and a backwards sequence of events. The delay-measurement step is not optional ceremony; it is the correction that makes the timestamp true.
Measuring the link delay
The LAN time-sync procedure has an explicit delay-measurement step. The master sends a delay-measurement request, the outstation replies immediately, and the master halves the round-trip to estimate one-way transit. That figure is then folded into the time it writes.
Two things go wrong here:
- Asymmetric or jittery paths. Halving the round-trip assumes the trip out and the trip back take the same time. On a store-and-forward radio or a congested network, they do not, and the estimate carries that error. You cannot fix asymmetry from one endpoint; you can only keep the path as clean as possible and accept a floor on accuracy.
- Outstation processing delay. If the outstation is slow to turn the delay-measurement request around, the master over-estimates transit time. A well-behaved outstation replies to delay measurement with minimal, predictable latency for exactly this reason.
If your sequence-of-events accuracy requirement is tighter than the link delay you can measure, DNP3 time sync alone will not get you there — that is when outstations are given an independent time source such as GPS or IRIG-B, and the master's clock write becomes a fallback rather than the primary reference.
Sync interval: too often and too rarely
The outstation decides how often it raises Need Time, usually via a configurable interval. Both extremes cause trouble.
- Too rarely, and the clock drifts far between syncs. A cheap oscillator can drift seconds per day. If you sync once a week, by day six your timestamps are meaningfully wrong right before the next correction snaps them back — and that snap itself is visible as a discontinuity in event times.
- Too often, and you spend link bandwidth on time writes that a slow radio can ill afford, for accuracy you do not need.
Set the interval from the outstation's actual drift rate and your timestamp-accuracy requirement, not from a default. An outstation that must resolve events to 10 ms and drifts 1 ms per minute needs syncing on a very different schedule than one reporting hourly totals. Measure the drift by letting the outstation free-run and comparing its timestamps to a known reference; that number tells you the interval.
How wrong time hides in the historian
The damage from bad DNP3 time sync rarely shows up at the outstation. It shows up downstream, in the historian and the sequence-of-events log, and it is hard to trace back.
Symptoms worth recognizing:
- Events that appear out of order. Two outstations with clocks a few seconds apart report a cause and its effect, and the effect timestamps before the cause. Operators lose trust in the SOE log entirely once this happens once.
- A step in event times after a sync. If an outstation free-ran for a week and then got synced, every event before the sync is offset and everything after is correct, with a visible jump at the sync moment.
- Timestamps that cluster at poll boundaries. If events are being stamped on master arrival rather than at the outstation, you have lost the whole benefit of the DNP3 event model, and fast events all pile up at the scan time instead of their true time.
A historian clock-drift discipline catches some of this, but the fix belongs upstream: the outstation clock has to be right before the event is stamped, because nothing downstream can un-drift a timestamp after the fact.
Commissioning checklist
Verify time sync before you trust a single event timestamp.
- Confirm the master is actually configured to service the Need Time (IIN1.4) bit, not just connected. Watch a response and confirm the bit clears after a sync.
- Choose the LAN (write absolute time with delay measurement) procedure for network and radio links, and record-current-time only for short, stable serial links.
- Confirm the delay-measurement step runs on LAN links and that the measured delay is sane for the physical path, not zero.
- Set the outstation's sync interval from its measured drift rate and your timestamp-accuracy requirement, not a default.
- For tight sequence-of-events requirements, give outstations an independent time source (GPS / IRIG-B) and treat the master write as a fallback.
- Let an outstation free-run briefly and compare its event timestamps to a known reference to measure real drift.
- Trend or expose the Need Time bit so a master that has quietly stopped syncing becomes visible instead of silent.
- Spot-check the historian for out-of-order events and post-sync time steps as an end-to-end confirmation that timestamps are true.
- Record the sync procedure, interval, measured link delay, and any external time source alongside the point map.
The goal is timestamps you can build a sequence of events on. When a breaker trips and a downstream relay follows, the log has to show them in the order they truly happened — and that order is only as good as the outstation clock that stamped them.