Deep Dive into the Controller Area Network (CAN) Protocol

Modern vehicles, industrial machinery, and even medical equipment rely heavily on real-time communication between multiple electronic control units (ECUs). The Controller Area Network (CAN) protocol, developed by Bosch in 1986, provides a robust and efficient method for such communication. Designed to enable reliable message exchange in noisy environments, CAN is widely used in automotive, industrial automation, and aerospace applications.

In this blog, we’ll take an in-depth look at:

  • The technical specifications and architecture of CAN
  • How data transmission and frame structure work
  • Error detection mechanisms and fault confinement strategies

1. Technical Specifications and Architecture of CAN

1.1 Overview of CAN Architecture

CAN is a multi-master, message-based protocol that allows multiple nodes (ECUs) to communicate over a single twisted-pair bus. Unlike traditional communication systems that follow a master-slave approach, CAN enables any node to transmit data whenever the bus is free.

🔹 Key Features of CAN:

  • Bitwise arbitration ensures that high-priority messages get transmitted first.
  • Error detection and correction mechanisms improve reliability.
  • Multi-master capability allows any node to initiate communication.
  • Data rates up to 1 Mbps (Classical CAN) and 5 Mbps (CAN FD).
  • Standardized message formats for interoperability.

1.2 Physical and Data Link Layers

The CAN protocol follows the OSI model, mainly defining the Physical Layer and Data Link Layer.

📌 Physical Layer (ISO 11898 Standard)

The physical layer defines how data is transmitted electrically over the CAN bus.

  • Uses two differential signal lines: CAN_H (high) and CAN_L (low).
  • A dominant bit (0) occurs when CAN_H > CAN_L, while a recessive bit (1) happens when CAN_H < CAN_L.
  • Twisted-pair wiring reduces electromagnetic interference (EMI).
  • Bus termination at both ends (typically 120Ω resistors) prevents signal reflections.

📌 Data Link Layer

The Data Link Layer is responsible for message framing, addressing, error handling, and arbitration.


2. Data Transmission Methods and Frame Structure

CAN transmits data using four types of frames, each with a specific purpose:

  1. Data Frame – Contains the actual message data.
  2. Remote Frame – Requests data from another node.
  3. Error Frame – Signals an error on the network.
  4. Overload Frame – Delays the next message transmission.

2.1 CAN Frame Structure (Classical CAN)

A CAN Data Frame is the most important and frequently used type of message. It consists of the following fields:

FieldBitsDescription
Start of Frame (SOF)1Signals the beginning of a frame.
Identifier11 (Standard) or 29 (Extended)Determines message priority.
Control Field6Contains Data Length Code (DLC).
Data Field0-8 bytesCarries the actual data payload.
CRC Field15Cyclic Redundancy Check for error detection.
ACK Field2Acknowledgment from receiving nodes.
End of Frame (EOF)7Marks the end of a valid frame.

🛠 CAN FD (Flexible Data-Rate):

  • CAN FD extends the Data Field from 8 bytes to 64 bytes.
  • Allows faster bit rates (up to 5 Mbps) during data transmission.
  • Improves efficiency in high-speed applications like ADAS (Advanced Driver Assistance Systems).

2.2 Message Transmission and Arbitration

CAN follows CSMA/CR (Carrier Sense Multiple Access with Collision Resolution) to manage multiple nodes transmitting on the same bus.

🔹 Arbitration Process:

  • Each message has an 11-bit or 29-bit identifier (lower ID = higher priority).
  • If two nodes start transmitting simultaneously, the node with the lower ID continues while the other stops.
  • This ensures that critical messages (e.g., braking system data) always get transmitted first.

💡 Example:

  • Node A (ID = 0x100) and Node B (ID = 0x200) start sending messages simultaneously.
  • Since 0x100 has a lower binary value than 0x200, Node A wins arbitration and continues sending, while Node B retries later.

3. Error Detection and Fault Confinement Strategies

3.1 Error Detection Mechanisms

To ensure data integrity, CAN implements five error detection mechanisms:

Error TypeDetection Method
Bit ErrorA transmitter reads a different bit than what it sent.
Stuff ErrorIf more than five consecutive bits of the same value are detected, an error is flagged.
CRC ErrorThe receiver verifies the CRC field for integrity.
Form ErrorEnsures frame format correctness (e.g., EOF must be exactly 7 recessive bits).
ACK ErrorIf no receiver acknowledges a valid frame, an error is flagged.

3.2 Fault Confinement Strategies

CAN employs automatic fault handling to prevent failed nodes from disrupting the network.

  • Each node has three states: Error Active, Error Passive, and Bus Off.
  • If a node repeatedly causes errors, it transitions to Bus Off, preventing it from transmitting until it is reset.

📌 Example of Fault Handling:
If a malfunctioning ECU keeps sending corrupt messages, CAN will isolate the faulty ECU to prevent further disruption while allowing other nodes to continue operating.


Conclusion

The Controller Area Network (CAN) protocol is a highly efficient and reliable method for communication in automotive and industrial systems. Its robust arbitration mechanism, error detection capabilities, and fault confinement strategies make it ideal for real-time, safety-critical applications.


Leave a comment