ISO 15765-2 (ISO-TP)

CAN is limited to just 8 bytes of payload. Diagnostic exchanges with an ECU often need to send more than 8 bytes of data. ISO-TP is a standard for sending larger amounts of data over CAN. It's defined in ISO 15765-2 and covers layer 3 (network) and layer 4 (transport) of the OSI model. ISO-TP is used in OBD and in UDS.

Message Structure

Every ISO-TP message consists of a header followed by the payload. If the payload is 7 bytes or less, the data fits into a single CAN frame. If the payload is larger, it needs to be broken up into multiple frames. The first nibble of the frame specifies the type of message — Single, First, Consecutive, or Flow. After the first nibble comes a length or index, followed by the actual payload.

If the CAN frame is less than 8 bytes in length, it can either be padded or sent with a shorter DLC. The ISO spec calls for padding with 0xCC, but 0xAA or 0x55 is more common in practice.

Single Frame

If the payload is 7 bytes or smaller, it fits in a single CAN frame. The first nibble is set to 0 to indicate a Single Frame. The next nibble is the length of the payload. The payload follows the length byte.

SingleFrame — 7-byte payload
0722F190314A3447
FieldMnemonicValueDescription
N_PCIPCI07
High
Frame type (0 = SingleFrame)
Low
SF_DL — payload length (7)
payloadDATA22 F1 90 31 4A 34 47Up to 7 bytes of service data.

First Frame and Consecutive Frame

If the payload is too large to fit in a single frame, it needs to be broken up into multiple messages. The first nibble of the first message is set to 1 to indicate a First Frame, followed by 12 bits indicating the length of the payload and 6 bytes of payload. The other side will then respond with a flow control message. This flow control message tells the sender whether it can continue sending, how long it needs to wait between frames, and how often it should wait for a new flow control message.

FirstFrame — start of a multi-frame message
101462F190314A34
FieldMnemonicValueDescription
N_PCI byte 1PCI110
High
Frame type (1 = FirstFrame)
Low
FF_DL — high nibble of total length (0)
N_PCI byte 2PCI214FF_DL — low byte of total length. 0x014 = 20 bytes total.
payloadDATA62 F1 90 31 4A 34First 6 bytes of the message.

After the flow control, the sender can send the rest of the payload using Consecutive Frames. These start with a 2 for the first nibble, followed by a 4-bit index to make sure the messages arrive in the correct order. When the index reaches 15 it wraps back to 0.

ConsecutiveFrame
2147583438533831
FieldMnemonicValueDescription
N_PCIPCI21
High
Frame type (2 = ConsecutiveFrame)
Low
SequenceNumber (1, increments per CF, wraps at 0xF → 0x0)
payloadDATA47 58 34 38 53 38 31Up to 7 more bytes of the message. The last CF may be shorter (and padded).

Flow Control

The flow control message is used to control the rate at which the rest of the data is sent. The first nibble of the flow control message is set to 3. The next nibble is the status of the flow control. The status can be either Continue (0), Wait (1), or Overflow (2).

Continue

Part of the continue message is the Block Size and Separation Time. The Block Size is the number of consecutive frames the sender is allowed to send before waiting for a new flow control message, and can be between 1 and 255. A Block Size of 0 indicates that the sender can send all consecutive frames without stopping.

The Separation Time is the time the sender should wait between sending consecutive frames. If the separation time is between 0 and 127, the unit is milliseconds; if the time is between 241 and 249, the unit is multiples of 100 µs (where 241 represents 100 µs).

FlowControl — ContinueToSend
30080A
FieldMnemonicValueDescription
N_PCIPCI30
High
Frame type (3 = FlowControl)
Low
FlowStatus (0 = ContinueToSend, 1 = Wait, 2 = Overflow)
BlockSizeBS08Number of CFs the sender may transmit before the next FC. 0 = no further FCs.
SeparationTimeSTmin0AMinimum gap between CFs. 0x00–0x7F = 0–127 ms. 0xF1–0xF9 = 100–900 µs.

Wait

When the sender is instructed to wait, it will wait for a second flow control message of the continue type before sending any more messages. A typical timeout is 1000 ms, so if a longer wait is needed the sender will need to send multiple wait messages.

Overflow

When the receiver indicates an overflow the transmission is aborted. The overflow flow control can only be sent as a reply to a first frame and should be used when the requested payload is too large to fit in the receiver's buffer.

Full transfer

The transfer below is generated from the payload you choose. The tester sends data and the ECU sends flow-control frames; expand the advanced controls to change the ECU's BS and STmin.

Try a transfer

4 CAN frames — 3 from tester, 1 from ECU
  1. TesterECUFFFirst Frame · total length 20 (0x14)
    101462F190314A34
  2. ECUTesterFCFlow Control · ContinueToSend, BS=8, STmin=10 ms
    30080AAAAAAAAAAA
  3. TesterECUCFConsecutive Frame · SN=1
    2147583438533831
  4. TesterECUCFConsecutive Frame · SN=2
    2246313233343536