Skip to Content
CAN · Fundamentals

The CAN message format: an overview

Structure of a CAN frame

CAN distinguishes four message formats: data frame, remote frame, error frame and overload frame. Together they provide data transmission, data requests, error detection and overload management.

The data frame

This is the most frequently used format on the network. It carries user data from a producer to one or more consumers. A typical data frame consists of several fields:

  • Start of frame (SOF): a dominant bit;
  • Arbitration field: the identifier and the RTR bit (remote transmission request);
  • Control field: the IDE bit (dominant for a standard 11-bit identifier), a reserved bit and the data length code;
  • Data field;
  • Cyclic redundancy check (CRC);
  • Acknowledgment slot (ACK);
  • End of frame: all bits recessive.

The arbitration field determines the priority of the message: the lower the value, the higher the priority. The data field contains between 0 and 8 bytes, which allows for flexible transmission.

11-bit or 29-bit identifier

The classic CAN specification defines two mutually compatible formats: the standard format, with an 11-bit identifier, and the extended format, with a 29-bit identifier.

Use in commercial vehicles has shown that the large number of messages to be mapped required a much longer identifier. With 29 bits, up to 512 million messages can be distinguished.

The two formats can coexist on the same network; they are distinguished by the identifier extension bit (IDE bit). In the extended format, the 29-bit identifier is divided into an 11-bit base identifier and an 18-bit extended identifier.

CAN message with a standard 11-bit identifier
Figure 1: CAN message in standard format, 11-bit identifier.
CAN message with an extended 29-bit identifier
Figure 2: CAN message in extended format, 29-bit identifier.

The remote frame

Any node can use a remote frame to request that another node send a given message. The requested message is specified by the identifier carried in the frame. While it is possible to request a message from all receiving nodes, only a single sending node may be responsible for the requested message.

The format of a remote frame is the same as that of the data frame, except that the RTR bit is recessive whereas it is dominant for a data frame. A remote frame arbitrating at the same time as a data frame with the same identifier therefore loses the arbitration, since the requested message is already being sent. The data field is also empty, and the length code must correspond to that of the expected data frame.

The error frame

Every node that detects an error while sending or receiving a data frame or remote frame immediately signals this to the whole network by sending an error frame. Since it contains a sequence of six bits of the same polarity (the error flag), it intentionally violates the bit stuffing rule and prompts the producer to resend the erroneous frame.

The error frame consists of two fields: the first results from the superposition of the error flags sent by one or more nodes; the second, a sequence of eight recessive bits, marks the end of the frame, as for data and remote frames.

Bit stuffing ensures that the transmission remains synchronous and error-free: after five identical bits in a row, a bit of opposite polarity is inserted automatically. This prevents long sequences of identical bits from disrupting the synchronization of the participants, and facilitates error detection.
Timing diagram of a CAN error frame
Figure 3: timing diagram of an error frame — superposition of the flags (6 to 12 bits) then an 8-bit delimiter.

The overload frame

The overload frame indicates that a node is not ready to receive a message, for example because of internal delays or a buffer overflow. It gives the node time to prepare for the next reception. It can be considered a special error frame: like it, it consists of a flag and a delimiter.

Unlike the error frame, sending it depends on very specific conditions related to the intermission field, and it does not cause the retransmission of the previous frame.

In summary

The four formats — data frame, remote frame, error frame and overload frame — are decisive for the functionality and reliability of CAN networks. Each has its specific application areas and structure, which make it possible to transmit data efficiently, send requests, identify errors and manage overload situations.

Neutralized