J1939 Transport Protocol – Embedded Flakes

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.

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.

  • 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
  • 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.

Time in ms PGN Destination Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
0 60416 255 32 18 0 3 255 236 (0xEC) 254 (0xFE) 0
Time in ms PGN Destination Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
50 60160 255 1 Data byte 1 Data byte 2 Data byte 3 Data byte 4 Data byte 5 Data byte 6 Data byte 7
Time in ms PGN Destination Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
100 60160 255 2 Data byte 8 Data byte 9 Data byte 10 Data byte 11 Data byte 12 Data byte 13 Data byte 14
Time in ms PGN Destination Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
150 60160 255 3 Data byte 15 Data byte 16 Data byte 17 255 255 255 255

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.

  • 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
  • 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
  • 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
  • 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.

PGN Destination Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
60416 255 16 17 0 3 255 236 (0xEC) 254 (0xFE) 0
PGN Destination Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
60416 255 17 2 1 255 255 236 (0xEC) 254 (0xFE) 0
PGN Destination Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
60160 255 1 Data byte 1 Data byte 2 Data byte 3 Data byte 4 Data byte 5 Data byte 6 Data byte 7
PGN Destination Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
60160 255 2 Data byte 8 Data byte 9 Data byte 10 Data byte 11 Data byte 12 Data byte 13 Data byte 14
PGN Destination Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
60416 255 17 0 255 255 255 236 (0xEC) 254 (0xFE) 0
PGN Destination Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
60416 255 17 1 3 255 255 236 (0xEC) 254 (0xFE) 0
PGN Destination Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
60160 255 3 Data byte 15 Data byte 16 Data byte 17 255 255 255 255
PGN Destination Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
60416 255 19 17 0 3 255 236 (0xEC) 254 (0xFE) 0