THE LATEST IN ELECTRIC MOBILITYIndependent EV news, explainers & guides
Technology

How EV Controllers Detect Old and Duplicate Messages

EV controllers use counters, freshness checks and timeouts to spot repeated or outdated messages before accepting them as current control instructions.

How EV Controllers Detect Old and Duplicate Messages
Photo: Kiwiev / CC0

The short answer: EV controllers check message counters, sequence information and arrival timing to decide whether a control message is new and timely. Repeated or unexpected values can trigger rejection, while timeouts detect when usable updates have stopped arriving.

EV computers detect stale or repeated control messages by checking whether each update advances the expected sequence and arrives within an acceptable time. A counter helps distinguish successive messages; a freshness check evaluates whether an update is current enough to use; and a timeout detects when usable updates stop arriving. These checks address different problems, so a controller may combine them before accepting a command.

The distinction matters because an intact message can still be unsuitable for control. A torque request might retain its original contents yet arrive after the conditions that prompted it have changed. A repeated message might look like continuing communication even though the sending controller has stopped producing new instructions. Reliable communication requires checking both the contents and their place in an ongoing exchange.

Why a correct message can still be outdated

Vehicle controllers exchange requests, measurements and operating states over communication networks. The receiving controller needs to know more than whether a message can be decoded. It must also determine whether the message belongs to the current conversation and remains suitable for the function it supports.

Consider a controller receiving a request to produce motor torque. The request represents a decision made under particular operating conditions. If communication stalls, repeatedly applying the last request could preserve a decision after those conditions have changed. The message need not be corrupted for its continued use to become inappropriate.

This is why message integrity and message freshness are separate properties. An error-detection check can help identify altered contents, but an unchanged copy of an earlier message can still pass that check. Establishing freshness requires additional information or receiver state, such as a sequence counter, an elapsed-time measurement or a protected freshness value.

How message counters reveal repeated updates

A message counter changes as the sender generates successive updates. The receiver remembers the counter associated with an accepted message and compares it with the counter in the next candidate. The meaning of that comparison depends on the communication design.

If the counter advances as expected, the message is consistent with a new update. If it repeats, the receiver has evidence that the message may be a duplicate. If it moves unexpectedly, the receiver may be seeing missing messages, delayed traffic, a restarted sender or another communication fault.

A counter does not need to increase forever. Counters have a finite range and eventually wrap back to their starting value. Receiver logic must recognize the valid transition across that boundary. Treating every numerically smaller value as old would incorrectly reject legitimate traffic when the counter wraps.

Nor does every application require the next counter to be the immediately adjacent value. A receiver may allow a defined forward jump to tolerate missed updates. That allowance creates an acceptance window: enough flexibility for expected communication behavior, with limits on how far the sequence can move before additional handling is required.

A sequence check is not an age measurement

A counter shows relative progression, but it does not necessarily reveal how much time has passed. A delayed message can carry a counter the receiver has never seen. If that counter falls within the accepted sequence window, the sequence check alone may offer no reason to reject it.

The opposite distinction also matters. Successive messages can contain exactly the same requested torque or operating state while carrying different counters. Identical command contents do not automatically mean a duplicate: the sender may be deliberately reaffirming the same request as conditions remain steady.

Freshness checking therefore concerns the message's history and timing, rather than whether its main value has changed. A receiver may combine sequence progression with local timing rules. Where timestamps are used, their interpretation also depends on an established relationship between clocks and a defined allowance for communication delay.

How timeouts detect missing usable messages

A timeout measures how long the receiver can go without an acceptable update. When that interval expires, the controller treats the communication as unavailable or no longer current enough for the relevant function. It does not need to receive an obviously bad message to recognize a problem.

The event that restarts the timer is crucial. If any arriving frame resets it, repeated or invalid traffic could make a failed exchange appear active. For a freshness-sensitive function, the relevant timer must reflect the arrival of messages that satisfy its acceptance rules.

A timeout detects an absence of timely updates; it does not explain the underlying cause. The sender might have stopped transmitting, the network might be disrupted, or incoming messages might be failing validation. Diagnostic logic can distinguish those conditions, but the immediate control decision concerns whether a usable update remains available.

Timeout settings also involve a tradeoff. A tight limit recognizes interrupted communication quickly but leaves less tolerance for expected timing variation. A looser limit tolerates more delay but allows an older accepted value to remain in use longer. The appropriate choice depends on the control function and its safety requirements.

How the checks work together

Conceptually, accepting a control update involves several questions. The exact processing order depends on the implementation, but the checks serve distinct purposes:

  • Does the message pass its integrity checks? The receiver checks for the kinds of corruption its protection scheme can detect.
  • Does it belong to the expected exchange? Message identity and communication context help prevent an update from being interpreted in the wrong place.
  • Does its sequence or freshness value make sense? The receiver evaluates progression, duplicates and any allowed acceptance window.
  • Is it timely enough? Timing rules determine whether the update remains suitable for use.

These checks complement checks on the command itself. A message can be new and intact yet request a value outside permitted operating limits. Conversely, a plausible command value can arrive in an unacceptable sequence. Passing one category of validation does not establish that the others have passed.

Restarts and counter wrap need explicit handling

A sender restart complicates sequence tracking because its counter may return to an initial value while the receiver still remembers the previous exchange. A receiver restart presents the reverse problem: the sender may continue normally while the receiver has lost its sequence history.

The communication design needs a defined way to establish or recover that shared context. Depending on the protocol, this can involve synchronization, session state or controlled initialization. Simply accepting any counter after an unexpected change would weaken the protection against repeated messages.

Counter wrap creates a related limitation: a counter value is not permanently unique. The same value will recur during normal operation. Its meaning comes from the surrounding sequence and timing context. Secure designs must also account for that recurrence when deciding whether an earlier message could become acceptable again.

A plain counter can help detect accidental repetition, but it does not authenticate the sender. An attacker able to create messages may also be able to choose a counter that looks plausible. Likewise, an error-detection checksum is not a substitute for cryptographic authentication.

Protection against deliberate replay can bind a freshness value to the message through an authentication mechanism. The receiver then checks both that the message is authentic and that its freshness value is acceptable. Authentication alone does not establish recency: a valid older message can retain a valid authentication result.

The strength of replay protection therefore depends on the complete design, including freshness tracking and recovery after interruptions. Adding a counter field by itself does not establish that the communication resists deliberate manipulation.

What happens when a message is rejected

Rejecting an update and choosing the resulting vehicle behavior are separate decisions. The response may include briefly retaining the last accepted value, restricting a function or moving to a defined fallback state. The appropriate response depends on what the message controls and how long its previous value remains usable.

A rejected duplicate need not produce the same response as a prolonged loss of communication. A controller can track individual reception errors while using its timeout to determine when the ongoing exchange has become unavailable. Recovery also needs defined acceptance rules so that one arriving message does not automatically erase every fault condition.

The central principle is that arrival does not establish validity. Counters establish progression, timing checks limit age, and timeouts expose missing usable updates. Together, they give an EV controller a basis for deciding whether a received instruction still belongs to the current control process.

Frequently asked questions

Can an unchanged command still be a fresh message?

Yes. A sender can issue successive updates with the same command value while advancing its message counter. Freshness depends on sequence and timing context, not simply on whether the command value changes.

Does a message counter prove that a command arrived on time?

No. A delayed message can carry an unseen counter that passes a sequence check. Timing rules or other freshness mechanisms are needed to determine whether it is still timely enough to use.

Why should repeated messages not keep a timeout from expiring?

Repeated messages can make communication appear active even when no new usable instructions are arriving. A freshness-sensitive timeout needs to track acceptable updates rather than every arriving frame.

Does a checksum prevent replayed control messages?

An unchanged older message can still pass an error-detection checksum. Protection against deliberate replay requires freshness validation together with appropriate authentication.

What happens when a message counter wraps around?

The receiver must recognize the valid transition back to the beginning of the counter's range. It interprets the value using sequence and timing context rather than treating every lower number as an old message.

Related stories

☰ Contents