A Simple Guide to Understand Network Management in SAE J1939

SAE J1939 specifiction defines decentralized network management which means each control unit must implement minimum set of functions. The network management functions are described in the document SAE J1939/81. SAE J1939 network management is mainly concerned about management of source addresses and the association of those addresses with function. It also takes care of reporting network related errors. It also specifies address claiming process.

Address and NAME

Some software application is running in each electronic control unit (ECU); such application is called Controller Application or CA. There can be multiple CAs running in one physical ECU. As per SAE J1939 specifications the CA must have an unique address and asociated device NAME in order to communicate over J1939 network.

Address

Each messages that is sent by this CA contains this source address. There are 255 possible addresses. 0-253 are valid addresses. The network address 255, also known as the Global address, is only permitted in the Destination Address field of the J1939 message identifier but never in the Source Address field and used for broadcasting messages. The network address 254, also known as the NULL address, is only permitted in the Source Address field of the J1939 message identifier and is intended for use only within Network Management communications.

Different CA use different methods to determine source address. For purpose of address claim, the CAs are classified in two categories; Single address capable and Arbitrary address capable.

Single Address Capable CA

These CAs cannot alter their source address without intervention of external process. The arbitrary address capable field is zero in the NAME of these CAs. Based on what method is used to alter the source address, these CAs can be further divided in to 4 subcategories.

Non-Configurable Address CA

In these CAs , source address is provided by manufacturer. The address can not be changed in field by any means. Only way to change source address is replace the software.

Service Configurable Address CA

In these CAs, the address may be changed in field by a service technician. The address may be altered by using any proprietary method while in “service’ mode.

Command Configurable Address CA

In these CAs, source address can be changed using Commanded Address Message.

Self Configurable Address CA

This is special case where the CA determines which one of the limited set of addresses it will use based on information it obtains from the vehicle configuration. One example could be location of trailers connected to a traction unit, which determine its source address based on the electrical connections on address pins. CA first learns the address based on trailers position and and then create the new NAME using that information.

Arbitrary Address Capable CA

Arbitrary address capable CA can select its source address from any appropriate source address based on internal algorithms and then claim that address. In case of conflict, this CA is able to re-calculate its address and reclaim . If all the allowed addresses are already claimed by other CAs, this CA will lose arbitration and send “Cannot Claim(PGN 60928)” message. The value in Arbitrary Address Capable field in NAME indicate whether or not a CA has this capability.

Arbitrary address capable CA have a preferred address. Before using the preferred address CA must register itself on the bus by using address claiming process. If the CA loses arbitration of preferred address during address claim procedure, it selects another address using internal algorithm and initiate address claim procedure again. We will see address claim  procedure in next section.

NAME

Each CA must be capable of providing its unique 64-bit NAME. Address claim message contain source address and a NAME. This message is used to associate a NAME with a particular source address on the network.

The NAME serves two purposes, first to provide functional description and second, to provide numerical value which may be used in arbitration for addresses.

The NAME is composed of 10 fields

  1. Arbitrary address bit
  2. Industry group, length 3 bits
  3. Vehicle system instance, length 4 bits
  4. Vehicle system, length 7 bits
  5. Reserved bit
  6. Function, length 8 bits
  7. Function instance, length 5 bits
  8. ECU instance, length 3 bits
  9. Manufacturer code, length 11 bits
  10. Identity number, length 21 bits

The structure of NAME is shown in below Address Claim message

J1939 NM Address Claim Message

NAME Fields

Arbitrary Address Capable

This 1 bit field indicate whether the CA is arbitrary field capable or not. It is used to resolve address claim conflict. If this bit is set to 1, this CA will resolve the address conflict with the one whose NAME have higher priority (lower numeric value) by selecting address from range 128 to 247.

Industry Group

Industry Group is a 3-bit field defined and assigned by the committee. The Industry Group field identifies NAMEs associated with a particular industry that uses SAE J1939, for example: On-Highway Equipment, or Agricultural Equipment.

Vehicle System Instance

Vehicle System Instance is a 4-bit field that is used to identify a particular occurrence of a particular Vehicle System within a connected network.

Vehicle System Field

Vehicle System is a 7-bit field defined and assigned by the committee, which when combined with the Industry Group can be correlated to a common name.

Reserved Field

Reserved for future definition by SAE. The reserved bit should be set to zero.

Function Field

Function is an 8-bit field defined and assigned by the committee. The lower function values from 0 to 127, are pre-assigned by the SAE J1939 standard. When function values are from 0 to 127 then its definition is not dependent on any other field. Function values greater than 127, are dependent on industry group and Vehicle System. Function, when combined with the Industry Group and the Vehicle System fields identifies a common name for a specific controller.

Function Instance Field

The Function Instance is a 5-bit field that identifies the particular occurrence of a Function on the same Vehicle System on a given network.

ECU Instance Field

The ECU Instance is a 3-bit field that indicates which one of a group of electronic control modules associated with a given Function is being referenced.

Manufacturer Code

The Manufacturer Code is an 11-bit field that indicates which company was responsible for the production of the electronic control module for which this NAME is being referenced. Manufacturer codes are assigned by committee and may be found in the SAE J1939 base document.

Identity Number Field

The Identity Number is a 21-bit field in the name assigned by the ECU manufacturer. The Identity Number is necessary in circumstances where it is possible that the NAME would not otherwise be unique. This field should be unique and non-varying with removal of power.

Address Claim Procedure

Address claim procedure or network management procedure is the exchange of messages between CAs and actions taken by individual CAs to collectively manage the network. Network management messages have same structure as other SAE J1939 messages. The null-address is allowed in the source address field of a network management message only if the message is a request for Address Claimed or a Cannot Claim Address message. A request directed to the null address (254) yields no responses.

Below table shows list of messages used in network management.

Request Message (PGN 59904) for Address Claimed (PGN 60928)

The request PGN 59904 can be used by any CA to request NAME and addresses of CAs on the network. Upon receipt of request for address claim message each CA on the network must respond by sending address claimed message (PGN 60928) containing its address and NAME. If the sender have not calaimed address yet then the source address of the request for address claim message must be set ot null address 254. The CAs that have not claimed addresses yet shall also send address claimed message and attempt address claiming now. If a CA is unable to claim address then it shall send Cannot Claim Source Address message (PGN 60928).

The request messages for address claim can be sent to particular destination address or to global address 255. If the request is sent to global address 255, then the sender must respond to its own message by sending address claimed message. A CA want to use particular address can send request for address claim to that address and check if the same address is used by someone else on the network.

Address Claimed / Cannot Claim (PGN 60928)

PGN 60928 is used for address claimed messaged and Cannot claim address message. Address claimed message is used by any CA to respond to request for Address Claimed message or to simply claim an address on a network. This message must be sent during initialization of the network or  when any CA is connected on the live network.

If any CA receives address claimed message with the same source address of its own, then the CA must compare the NAME of the received address claimed message with its own NAME. If the receiving CA NAME have higher priority, then it must send Address Claimed message or it shall attempt to claim another address. If the CA is not arbitrary address capable then it must send a cannot claim address message. Once a CA has successfully claimed an address, it may begin transmitting other messages on the network and respond to any further Requests for Address Claim.

No valid claim may be made for Address 254, the null address. An Address Claimed message sent with address 254 as the source address is a Cannot Claim Address message The Address Claimed message should always be sent to the global address (255) to provide all ECUs on the network the information to maintain a current address to NAME correspondence. The Address Claimed message should be sent to the global address (255) even when requested in a destination specific message.

The Cannot Claim Address message may be sent as a response to a Request for Address Claim message. A pseudo-random delay of between 0 and 153 ms should be inserted between the reception of a message triggering the response and the Cannot Claim Address response. The delay is intended to minimize the potential that two Cannot Claim Address messages will cause bus errors.

Commanded Address (PGN 65240)

A network interconnection CA, a bridge for example, or a diagnostic or scan tool may command another CA (Commanded CA) to use a given source address with the Commanded Address Message. The Commanded Address message may be used to instruct a CA with a specific NAME to use a specific source address. When a CA receives Commanded Address messages containing its own NAME, it may respond in one of the two ways. First it can accept the new address and initiate address claim procedure. Second it may ignore the command by sending no response.

The Commanded Address message contains 9 bytes of data and should be sent using the Broadcast Announce Mode (BAM) of the transport protocol. and should be sent to the global address (255). CAs designed to support the Commanded Address message must also support the BAM form of the Transport Protocol.

Address Claim and CA initialization

Every CA after power on self test must send Address Claimed message and acquire unique address before starting any communication on the network. When a CA sends Address Claimed message and no other contending Address Claimed message is received then it is called successful address claim.

Single address CA having address from 0 to 127 and 248 to 253 can start communicating on network immediately after sending Address Claimed message. Other CAs are required to wait for 250 ms after sending Address Claimed message so that CAs on the network get enough time to send contending Address Claimed message.

Priority of Address

When more than one CA contending for same address, the priority shall be given to CA with lowest numerical value of NAME. the name shall be treated as single 64 bit number. If a CA receives Address Claimed message which contains source address of its own, then it must compare the NAME field. If its own NAME field numeric value is lower (higher priority) then it must send Address Claimed message. If its own NAME field numeric value is greater than received NAME, then the CA should not continue to use that address.

Initialization Message Sequence

Following timing diagram shows address claim procedure for a scenario where CA transmit Address Claim and no contention sent by any other CA on the network.

J1939 Address Claim procedure

Following diagram shows two Single Address CAs Attempt to claim the same address but not simultaneously.

J1939 Address Claim procedure 2

Following diagram shows initialization of arbitrary address capable CA.

initialization of arbitrary address capable CA

Following diagram shows message flow when CA A can not claim address

J1939 Address Claim procedure 3

The following timing diagrams shows message flow during initialization of arbitrary address capable CA

J1939 Address Claim procedure 3
J1939 Address Claim procedure 5

Potential identical messages and bus collision handling in Initialization

There is possibility of same identifier generated by multiple CAs.

If two CAs send Request for Address Claim message simultaneously and both are sending with null address 254, then it is not a problem because the data field is same for both messages.

If two CAs sending Address Claimed messages simultaneously having same address but different NAME then it will cause bus collision.

If two CAs sending Cannot Claim Address message simultaneously, it will cause bus collision because of different NAME data in the message.

To minimize the probability of bus collision in above mentioned scenario following special processing should be used.

  • After transmitting any claim message, the transmitting CA should monitor error code information. If the error code indicates that a bus error has occurred, any automatic retransmission attempts by the CAN peripheral should be canceled if possible.
  • The re-transmission of the Address Claimed message should be re-scheduled after end of frame plus a transmit delay. The transmit delay shall be calculated by a pseudo-random value between 0 and 255. The NAME, Serial number or any other unique information can be used as seed for calculation of random number. The transmit delay shall be added to the initial idle period before the next Address Claimed message is transmitted. The delay is calculated by multiplying the random number generated by above process by 0.6 ms. The delay range produced will be of 0-153 ms. If the error occurs again in second Address Claimed message transmission, the CA shall repeat the same procedure with new pseudo-random number.
  • If there is collision of Cannot Claim Address message then the CA should respond to Address Claimed message with a Cannot Claim Address message after a transmit delay.

Requests for Address Claimed for Self-Configurable Addressing CAs

An arbitrary address capable or self configurable addressing CA may try to claim address several times until it obtains an unused address. As mentioned earlier the CA will try to claim preferred address first and if it is already claimed by other CA on the network then this CA shall use internal algorithm and try to claim one of the allowed address. In such cases the CA shall send Request for Address Claim to specific destination in order to find unclaimed address. Request for Address Claim to global address shall be used with care because it generates response from every CA on the network.

Minimum Network Management Functionality in J1939

Network Management specifications defines procedures and standards to uniquely identify CAs on Network, manage assignment of addresses and manage network errors.

  • Each CA must have its unique 64 bit NAME. Each device on the network will be associated with at least one Name and one address. However, multiple device Names and multiple addresses may coexist within a single ECU.
  • CAs must successfully claim address according to address claim procedure prior to sending any message on the network.
  • If a CA can not successfully claim an address, them it must be reported to the network using standard “Cannot Claim(PGN 60928)” message.

Following paragraphs gives minimum required network management functionality in SAE J1939 protocol.

Reaction to Power Supply and Other Related ECU Disturbances

Due to unstable nature of power supplies on toed vehicles and implements, it may create disturbances in the ECU power supply. To avoid re-initialization of network and re-arbitration process, it is specified that the ECU should retain its NAME, address and any NAME/address tables used by that CA in case of momentary power loss. The time specified for power loss is minimum 2 ms and recommended time is 10 ms.  For disturbances of longer duration or higher frequency, network re-initialization may be performed and is required if the disturbance is longer than 1 second. The required re-initialization after 1 second is needed to force towed vehicle systems to re-initialize after re-connection to the towing vehicle.

Request for Address Claimed Message

A CA must transmit Address Claimed message upon receipt of Request for Address Claim message. This message shall contain current address if already claimed successfully or null address if it can not claim address. If a CA have not attempted to claim address yet, it should not participate in network communication until it claim address successfully.

Address Claimed Message before Claiming a Source Address

A CA shall not participate in any network communication before claiming a source address except following

  • A CA may transmit Request for Address Claim using null address 254
  • CA must respond to a Request for Address Claim directed to global address 255
  • A network interconnection device acting entirely as a repeater may pass messages bearing the source address of the originator before claiming its own address

Once a CA successfully claims address, it may respond to a Request for Address Claimed and immediately resume transmitting other messages on the network.

If the source NAME or address is changed, the CA must reissue an Address Claim before originating transmissions on the network.

Continuity of Addresses Across Power-down and Power-up Cycles

CAs should be able to maintain their source address and any addresses for CAs that are communicated with so that the CA can attempt to use the same addresses at the next power-up. This should be done except in cases where special requirements override this recommendation.