J1939 Address Claiming: Keep a Device Name Distinct from Its Current Source Address
Track a J1939 ECU by its protocol NAME within a bus context, and treat its current source address as a changeable mapping with a validity state. Reusing an address does not prove that the same ECU is still there. Seeing a NAME in a claim also does not authenticate a physical device cryptographically.
This guide pins Linux v6.12’s J1939 documentation and address-claim implementation. It is an integration method for a known J1939 network, not an interpretation of every extended CAN frame or a claim of SAE conformance testing. No address claims or diagnostic commands were transmitted.
1. Store identity and location separately
Use separate fields for bus instance, 64-bit NAME, observed source address, claim status, observation time and mapping generation. Keep product inventory identity outside that record unless an approved process establishes the relationship.
The Linux J1939 guide distinguishes static addressing from dynamic NAME/address tracking. For a nonzero NAME, the kernel resolves the corresponding address; with no NAME, the supplied address is used directly.
A static-address configuration therefore does not acquire dynamic conflict management merely because the same application also knows a device label. Decide which addressing mode each endpoint uses and document the assumptions supplied by the system integrator.

2. Separate using a claim from making one
Binding a socket to a NAME is not itself a completed address-claim exchange. The kernel module tracks claims and resolves mappings but leaves originating management responses to userspace.
Assign one appropriate claim-management owner for each local ECU identity. Other cooperating applications should use the established mapping instead of each improvising its own claims. Check for independent raw-socket stacks that might compete for the same address.
Keep claim-manager availability visible. A service that can read application data while its claim-management component is unavailable may still lack the required behavior for startup, conflict handling or a request for its claim.
3. Represent claim validity explicitly
The dynamic-addressing documentation describes the initial 250 ms claim interval before a valid mapping permits ordinary NAME-bound sends. Claim loss and a new address require renewed state handling, not an unconditional update of a cached number.
| Mapping state | Gateway treatment | Evidence still needed |
|---|---|---|
| No established mapping | Do not guess an address from previous telemetry | Current claim evidence in this bus instance |
| Claim pending | Keep dependent operations pending or reject under policy | Successful claim validity transition |
| Valid mapping | Use the current mapping with its generation | Application-specific freshness and authorization |
| Claim lost or cannot-claim state | Invalidate address-dependent work | A new valid claim or approved service disposition |
| Observer reset or incomplete history | Mark confidence incomplete | Reconciliation rather than blind restoration |
These are proposed gateway states, not new kernel enum names. They make the information available to a consumer explicit without claiming that a locally stored mapping is always current.
4. Respect the exact contention and repetition behavior
In the tagged receive path, contention favors the lower numeric NAME. An idle-address claim unmaps the ECU. A repeated claim for the same NAME/address pair does not restart its timer.
Therefore “any claim restarts 250 ms” is an incorrect model of this implementation. Keep initial claim, repeated same-pair announcement, address change and competing claim as separate fixtures.
The outgoing fixup path rejects ordinary named traffic when no usable mapping exists. Do not respond by silently switching to an old numeric destination and declaring the send recovered; that changes the addressing contract and can reach a different ECU.
5. Invalidate work tied to an old address
Attach mapping generation and intended NAME to queued operations, cached values and pending responses. Before dispatch, revalidate that the selected address still represents the intended protocol identity on that bus.
If a response arrives after reassignment, do not associate it with a newer operation solely because the source address matches. Apply the actual application protocol’s correlation and freshness rules, and preserve uncertainty when it supplies insufficient evidence.
For passive telemetry, consider whether old samples remain historically valid while current state becomes stale. Address movement should not rewrite the historical source context of already captured records.
6. Qualify transitions with an isolated peer model
| Proposed fixture | Required observation |
|---|---|
| One uncontested initial claim | Pending-to-valid transition before ordinary use |
| Same NAME/address announced again | No invented fresh waiting period in the scoped model |
| Two distinct NAMEs contend for one address | Correct mapping outcome and invalidation of losing work |
| Same NAME claims a different usable address | New mapping generation; no dispatch through stale address |
| Cannot-claim/idle transition | Unavailable mapping remains visible |
| Collector restart with incomplete history | Reconciliation required before confident identity association |
These tests were not executed. Use synthetic NAMEs and inert payloads on an isolated simulator or approved bench. Do not resolve an unknown production identity by sending unsolicited address-management traffic to an operating machine.
Hypothetical address reuse
A fictional logger indexes all samples by source address 0x80. After contention, a different NAME owns that address. The logger appends new measurements to the earlier ECU’s history and makes an apparently continuous trend from two identities.
The corrected record retains bus, NAME, address and mapping generation. Historical samples stay associated with their original evidence, while current-state consumers wait for the new association to become valid.
7. State the trust and observation limits
Protocol NAME is useful for J1939 identity management, but it is not a certificate, authorization decision or proof against an impersonating participant. Any requirement for authenticated identity needs an independently specified security mechanism.
Likewise, a disconnected observer can miss claims. Save subscription configuration, capture completeness and restart events with the mapping ledger. The result should explain why the gateway currently associates a NAME with an address and what evidence would invalidate that association.