J1939 Transport Protocol

CAN protocol supports transfer of 8 bytes of data in one frame. What if you want to transfer large data? SAE J1939/21 specifications defines fragmented transmission of large data known as transport protocol (TP). TP sends message of more than 8  bytes of data in multiple packets. SAE J1939/21 specifications defines various network services, message requests and acknowledgment. it defines format of frames, sending, handshaking and reassembling of packets.

SAE J1939 TP supports sending data to global destination address (BAM) and sending data to specific  destination (CM). Data transfer part is similar in both the ways, they differ in how they start and how fast data is transferred.

SAE J1939 TP use two specific parameter groups for fragmented transmission of large data. First is transport protocol connection management message (TP.CM); it contains connection command, PGN identifier of the TP message and information about how to reconstruct the message. Second is transport protocol data transfer message (TP.DT); it contains sequence number in first byte and 7 bytes of data. A maximum of 1785 bytes can be transferred using transport protocol.

Broadcast Announce Message Transport Protocol (BAM TP)

BAM TP messages are intended for complete network, so there is no handshake messages required. The sender starts with sending TP.CM message with command BAM (32) and then sender send all the data through TP.DT messages untill all data is sent. The transmitter sends all data TP.DT messages at a minimum interval of 50 ms.

BAM TP.CM Message

  • PGN: 60416 (0xEC00)
  • Priority: 7
  • Length: 8 bytes
  • Destination: Global (255)
  • Byte 1: BAM (32)
  • Byte 2 and 3: Message size in bytes
  • Byte 4: Number of packets
  • Byte 5: Reserved (0xff)
  • Byte 6 to 8: PGN

BAM TP.DT Message

  • PGN: 60160 (0xEB00)
  • Priority: 7
  • Length: 8 bytes
  • Destination: Global (255)
  • Byte 1: Sequence number (1 to 255)
  • Byte 2 to 8: Data

Below example shows transmission of BAM TP messages for PGN 65260 (0xFEEC) with 17 bytes of data.

  • TP.CM message
Time in msPGNDestinationByte 0Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7
060416255321803255236 (0xEC)254 (0xFE)0
  • TP.DT message 1
Time in msPGNDestinationByte 0Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7
50601602551Data byte 1Data byte 2Data byte 3Data byte 4Data byte 5Data byte 6Data byte 7
  • TP.DT message 2
Time in msPGNDestinationByte 0Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7
100601602552Data byte 8Data byte 9Data byte 10Data byte 11Data byte 12Data byte 13Data byte 14
  • TP.DT message 3
Time in msPGNDestinationByte 0Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7
150601602553Data byte 15Data byte 16Data byte 17255255255255

 

Destination Specific Transport Protocol (CM TP)

Peer to peer or CM TP contains handshaking to guarantee successful data transfer. The sender starts with a “request to send” (RTS) message. The receiver then controls the TP communication with “clear to send” (CTS) messages and finally ends TP session with “end of message acknowledge”. The data of the TP.CM Clear to Send message contains the current sequence number to transfer as well as the number of TP.DT packets allowed.  The originator then sends TP.DT messages starting at the sequence requested and stops after reaching the number of TP.DT messages allowed.  This process continues until all the data is transferred. The receiving device then has to send a TP.CM message with command byte EndofMsgACK confirming that all the data was successfully received.

RTS TP.CM Message

  • PGN: 60416 (0xEC00)
  • Priority: 7
  • Length: 8 bytes
  • Destination: Specific
  • Byte 1: RTS (16)
  • Byte 2 and 3: Message size in bytes
  • Byte 4: Number of packets
  • Byte 5: Total number of packet sent in response to CTS.
  • Byte 6 to 8: PGN

CTS TP.CM Message

  • PGN: 60416 (0xEC00)
  • Priority: 7
  • Length: 8 bytes
  • Destination: Specific
  • Byte 1: CTS (17)
  • Byte 2: Max number of packets that can be sent at once. (Not larger than byte 5 of RTS)
  • Byte 3: Next sequence number to start with
  • Byte 4 and 5: Reserved (0xff)
  • Byte 6 to 8: PGN

End of Message Acknowledge TP.CM Message

  • PGN: 60416 (0xEC00)
  • Priority: 7
  • Length: 8 bytes
  • Destination: Specific
  • Byte 1: EndofMsgACK (19)
  • Byte 2 and 3: Total message size in bytes
  • Byte 4: Total number of packets
  • Byte 5: Reserved (0xff)
  • Byte 6 to 8: PGN

Connection Abort  Message TP.CM Message

  • PGN: 60416 (0xEC00)
  • Priority: 7
  • Length: 8 bytes
  • Destination: Specific
  • Byte 1: Connection abort (255)
  • Byte 2 and 3: Connection abort reason
  • Byte 3 to 5: Reserved (0xff)
  • Byte 6 to 8: PGN

Below example shows transmission of CM TP messages for PGN 65260 (0xFEEC) with 17 bytes of data.

  • RTS Message
PGNDestinationByte 0Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7
60416255161703255236 (0xEC)254 (0xFE)0
  • CTS Messasge
PGNDestinationByte 0Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7
604162551721255255236 (0xEC)254 (0xFE)0
  • TP.DT message
PGNDestinationByte 0Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7
601602551Data byte 1Data byte 2Data byte 3Data byte 4Data byte 5Data byte 6Data byte 7
  • TP.DT Message
PGNDestinationByte 0Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7
601602552Data byte 8Data byte 9Data byte 10Data byte 11Data byte 12Data byte 13Data byte 14
  • CTS Message
PGNDestinationByte 0Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7
60416255170255255255236 (0xEC)254 (0xFE)0
  • CTS Message
PGNDestinationByte 0Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7
604162551713255255236 (0xEC)254 (0xFE)0
  • TP.DT Message
PGNDestinationByte 0Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7
601602553Data byte 15Data byte 16Data byte 17255255255255
  • EndofMsgAck Message
PGNDestinationByte 0Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7
60416255191703255236 (0xEC)254 (0xFE)0

 

 

Mohan Vadnere

Mohan is an embedded system engineer by profession. He started his career designing and writing code for consumer electronics, industrial automation and automotive systems. Mohan is working in automotive electronics since last 15 years. He loves working at the hardware software interfaces.Mohan has Master of Science in Instrumentation from University of Pune and Masters of Technology in embedded systems from Birla Institute of Technology and Science, Pilani, India.

This Post Has 2 Comments

  1. Suraj Patil

    Thanks for information.How I can implement it in MATLAB Simulink.I have to transmit more than 8 bytes of data through one CAN ID.As I tried to use J1939 communication blocks,I can’t use one identifer for different PGNs.Please give me suggestion

    1. Mohan

      hi Suraj,
      I never implemented J1939 in MATLAB Simulink. We are using custom developed CAN J1939 driver.
      You can not use the same identifier for different PGNs. Basically your PGN is translated into identifier, means every PGN represent different identifier.
      I hope this helps.

Leave a Reply