Hubbry Logo
CAN busCAN busMain
Open search
CAN bus
Community hub
CAN bus
logo
8 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
CAN bus
CAN bus
from Wikipedia

Controller Area Network
Type Serial communication bus
Production history
Designer Bosch GmbH
Designed 1983; 42 years ago (1983)
External No
Electrical
Signal Differential
Max. voltage 16V DC
Data
Data signal Transceiver driven
Width 1 bit (bidirectional)
Bitrate CAN 2.0 up to 1 Mbit/s,
CAN FD up to 8 Mbit/s,
CAN XL up to 20 Mbit/s
Max. devices 32, 64 or 127 (depending on standard)
Protocol Serial, half-duplex, Asynchronous
Pinout
CAN-H CAN High (Yellow)
CAN-L CAN Low (Green)

A controller area network bus (CAN bus) is a vehicle bus standard designed to enable efficient communication primarily between electronic control units (ECUs). Originally developed to reduce the complexity and cost of electrical wiring in automobiles through multiplexing,[1] the CAN bus protocol has since been adopted in various other contexts. This broadcast-based, message-oriented protocol ensures data integrity and prioritization through a process called arbitration, allowing the highest priority device to continue transmitting if multiple devices attempt to send data simultaneously, while others back off. Its reliability is enhanced by differential signaling, which mitigates electrical noise. Common versions of the CAN protocol include CAN 2.0, CAN FD, and CAN XL which vary in their data rate capabilities and maximum data payload sizes.

History

[edit]

Development of the CAN bus started in 1983 at Robert Bosch GmbH.[1] The protocol was officially released in 1986 at the Society of Automotive Engineers (SAE) conference in Detroit, Michigan. The first CAN controller chips were introduced by Intel in 1987, and shortly thereafter by Philips.[1] Released in 1991, the Mercedes-Benz W140 was the first production vehicle to feature a CAN-based multiplex wiring system.[2][3]

Bosch published several versions of the CAN specification. The latest is CAN 2.0, published in 1991. This specification has two parts. Part A is for the standard format with an 11-bit identifier, and part B is for the extended format with a 29-bit identifier. A CAN device that uses 11-bit identifiers is commonly called CAN 2.0A, and a CAN device that uses 29-bit identifiers is commonly called CAN 2.0B. These standards are freely available from Bosch along with other specifications and white papers.[4]

In 1993, the International Organization for Standardization (ISO) released CAN standard ISO 11898, which was later restructured into two parts: ISO 11898-1 which covers the data link layer, and ISO 11898-2 which covers the CAN physical layer for high-speed CAN. ISO 11898-3 was released later and covers the CAN physical layer for low-speed, fault-tolerant CAN. The physical layer standards ISO 11898-2 and ISO 11898-3 are not part of the Bosch CAN 2.0 specification.

In 2012, Bosch released CAN FD 1.0, or CAN with Flexible Data-Rate. This specification uses a different frame format that allows a different data length as well as optionally switching to a faster bit rate after the arbitration is decided. CAN FD is compatible with existing CAN 2.0 networks so new CAN FD devices can coexist on the same network with existing CAN devices, using the same CAN 2.0 communication parameters. As of 2018, Bosch was active in extending CAN standards.

The CAN bus is one of five protocols used in the on-board diagnostics (OBD)-II vehicle diagnostics standard. The OBD-II standard has been mandatory for all cars and light trucks sold in the United States since model year 1996. The EOBD standard has been mandatory for all petrol vehicles sold in the European Union since 2001 and all diesel vehicles since 2004.[5]

Applications

[edit]
  • Passenger vehicles, motorcycles, trucks, buses (combustion vehicles and electric vehicles)
  • Agricultural equipment
  • Electronic equipment for aviation and navigation
  • Electric generators
  • Industrial automation and mechanical control
  • Elevators, escalators
  • Building automation
  • Medical instruments and equipment
  • Pedelecs
  • Model railways/railroads
  • Ships and other maritime applications
  • Lighting control systems
  • 3D printers
  • Robotics/Automation
  • Satellites

Automotive

[edit]

The modern automobile may have as many as 70 electronic control units (ECUs) for various subsystems.[6] Usually the biggest processor is the engine control unit. Others are used for autonomous driving, advanced driver assistance system (ADAS), transmission, airbags, antilock braking/ABS, cruise control, electric power steering, audio systems, power windows, doors, mirror adjustment, battery and recharging systems for hybrid/electric cars, etc. Some of these form independent subsystems, but communication among others is essential. A subsystem may need to control actuators or receive feedback from sensors. The CAN standard was devised to fill this need. One key advantage is that interconnection between different vehicle systems can allow a wide range of safety, economy and convenience features to be implemented using software alone - functionality which would add cost and complexity if such features were hard wired using traditional automotive electrics. Examples include:

  • Auto start/stop: Various sensor inputs from around the vehicle (speed sensors, steering angle, air conditioning on/off, engine temperature) are collated via the CAN bus to determine whether the engine can be shut down when stationary for improved fuel economy and emissions.
  • Electric park brakes: The hill hold functionality takes input from the vehicle's tilt sensor (also used by the burglar alarm) and the road speed sensors (also used by the ABS, engine control and traction control) via the CAN bus to determine if the vehicle is stopped on an incline. Similarly, inputs from seat belt sensors (part of the airbag controls) are fed from the CAN bus to determine if the seat belts are fastened, so that the parking brake will automatically release upon moving off.
  • Parking assist systems: when the driver engages reverse gear, the transmission control unit can send a signal via the CAN bus to activate both the parking sensor system and the door control module for the passenger side door mirror to tilt downward to show the position of the curb. The CAN bus also takes inputs from the rain sensor to trigger the rear windscreen wiper when reversing.
  • Auto lane assist/collision avoidance systems: The inputs from the parking sensors are also used by the CAN bus to feed outside proximity data to driver assist systems such as Lane Departure warning, and more recently, these signals travel through the CAN bus to actuate brake by wire in active collision avoidance systems.
  • Auto brake wiping: Input is taken from the rain sensor (used primarily for the automatic windscreen wipers) via the CAN bus to the ABS module to initiate an imperceptible application of the brakes while driving to clear moisture from the brake rotors. Some high-performance Audi and BMW models incorporate this feature.
  • Sensors can be placed at the most suitable place, and their data used by several ECUs. For example, outdoor temperature sensors (conventionally placed in the front) can be placed in the outside mirrors, avoiding heating by the engine, and data used by the engine, the climate control, and the driver display.

In recent years, the LIN bus (Local Interconnect Network) standard has been introduced to complement CAN for non-critical subsystems such as air-conditioning and infotainment, where data transmission speed and reliability are less critical.

Other

[edit]
  • The CAN bus protocol has been used on the Shimano DI2 electronic gear shift system for road bicycles since 2009, and is also used by the Ansmann and BionX systems in their direct drive motor.
  • The CAN bus is also used as a fieldbus in general automation environments, primarily due to the low cost of some CAN controllers and processors.
  • Manufacturers including NISMO aim to use CAN bus data to recreate real-life racing laps in the videogame Gran Turismo 6 using the game's GPS Data Logger function, which would then allow players to race against real laps.[7]
  • Johns Hopkins University's Applied Physics Laboratory's Modular Prosthetic Limb (MPL) uses a local CAN bus to facilitate communication between servos and microcontrollers in the prosthetic arm.
  • Teams in the FIRST Robotics Competition widely use CAN bus to communicate between the roboRIO and other robot control modules.
  • The CueScript teleprompter range uses CAN bus protocol over coaxial cable, to connect its CSSC – Desktop Scroll Control to the main unit
  • The CAN bus protocol is widely implemented due to its fault tolerance in electrically noisy environments such as model railroad sensor feedback systems by major commercial Digital Command Control system manufacturers and various open-source digital model railroad control projects.
  • Shearwater Research have implemented the protocol as DiveCAN[8] to use integrating their dive computers into diving rebreathers from various manufacturers.

Versions

[edit]

CAN 2.0 (Classical CAN)

[edit]

Due to its legacy, CAN 2.0 is the most widely used protocol with a maximum payload size of eight bytes and a typical baud rate of 500 kbit/s. Classical CAN, which includes CAN 2.0A (Standard CAN) and CAN 2.0B (Extended CAN), primarily differs in identifier field lengths: CAN 2.0A uses an 11-bit identifier, while CAN 2.0B employs a 29-bit identifier. The longer identifier in CAN 2.0B allows for a greater number of unique message identifiers, which is beneficial in complex systems with many nodes and data types. However, this increase in unique message identifiers also increases frame length, which in turn reduces the maximum data rate. Additionally, the extended identifier provides finer control over message prioritization due to more available identifier values. This, however, may introduce compatibility issues; CAN 2.0A devices can generally communicate with CAN 2.0B devices, but not vice versa, due to potential errors in handling longer identifiers. High-speed CAN 2.0 supports bit rates from 40 kbit/s to 1 Mbit/s and is the basis for higher-layer protocols. In contrast, low-speed CAN 2.0 supports bit rates from 40 kbit/s to 125 kbit/s and offers fault tolerance by allowing communication to continue despite a fault in one of the two wires, with each node maintaining its own termination.[4][9][10][11]

CAN FD (Flexible Data-Rate), standardized as ISO 11898-1, was developed by Bosch and released in 2012 to meet the need for increased data transfer in modern high-performance vehicles. It offers variable data rates during the transmission of a single frame, allowing the arbitration phase to occur at a lower data rate for robust communication, while the data payload is transmitted at a higher data rate to improve throughput, which is particularly useful in electrically noisy environments for better noise immunity. CAN FD also introduces a flexible data field size, increasing the maximum size from 8 bytes to 64 bytes. This flexibility allows for more efficient data transmission by reducing the number of frames needed for large data transfers, which is beneficial for applications like high-resolution sensor data or software updates.

CAN FD maintains backward compatibility with CAN 2.0 devices by using the same frame format as CAN 2.0B, with the addition of a new control field to indicate whether the frame is a CAN FD frame or a standard CAN 2.0 frame. This allows CAN FD devices to coexist with CAN 2.0 devices on the same bus, while higher data rates and larger data payloads are available only when communicating with other CAN FD devices.[11][10][12]

CAN XL

[edit]

CAN XL, specified by CiA 610-1 and standardized as part of ISO11898-1, supports up to 2,048-byte payloads and data rates up to 20 Mbit/s. It bridges the gap between CAN FD and Ethernet (100BASE-T1) while maintaining CAN's collision-resolution benefits. CAN XL controllers can also handle Classical CAN and CAN FD communication, ensuring compatibility in mixed networks. Its large data fields allow for higher layer protocols like IP (Internet Protocol) and the tunneling of Ethernet frames.[4][13][14]

Architecture

[edit]

Layers

[edit]

The CAN protocol, like many networking protocols, can be decomposed into the following abstraction layers:

Application layer
  • Application-specific logic
Object layer
  • Message filtering (mailboxes)
  • Message and status handling
Transfer layer

Most of the CAN standard applies to the transfer layer. The transfer layer receives messages from the physical layer and transmits those messages to the object layer. The transfer layer is responsible for bit timing and synchronization, message framing, arbitration, acknowledgment, error detection and signaling, and fault confinement. It performs:

  • Fault confinement
  • Error detection
  • Message validation
  • Acknowledgement
  • Arbitration
  • Message framing
  • Transfer rate and timing
  • Information routing
Physical layer
CAN bus electrical sample topology with terminator resistors

CAN bus (ISO 11898-1:2003) originally specified the link layer protocol with only abstract requirements for the physical layer, e.g., asserting the use of a medium with multiple-access at the bit level through the use of dominant and recessive states. The electrical aspects of the physical layer (voltage, current, number of conductors) were specified in ISO 11898-2:2003, which is now widely accepted. However, the mechanical aspects of the physical layer (connector type and number, colors, labels, pin-outs) have yet to be formally specified. As a result, an automotive ECU will typically have a particular—often custom—connector with various sorts of cables, of which two are the CAN bus lines. Nonetheless, several de facto standards for mechanical implementation have emerged, the most common being the 9-pin D-sub type male connector with the following pin-out:

  • pin 2: CAN-Low (CAN−)
  • pin 3: GND (ground)
  • pin 7: CAN-High (CAN+)
  • pin 9: CAN V+ (power)
A male DE-9 connector (plug)

This de facto mechanical standard for CAN could be implemented with the node having both male and female 9-pin D-sub connectors electrically wired to each other in parallel within the node. Bus power is fed to a node's male connector and the bus draws power from the node's female connector. This follows the electrical engineering convention that power sources are terminated at female connectors. Adoption of this standard avoids the need to fabricate custom splitters to connect two sets of bus wires to a single D connector at each node. Such nonstandard (custom) wire harnesses (splitters) that join conductors outside the node reduce bus reliability, eliminate cable interchangeability, reduce compatibility of wiring harnesses, and increase cost.

The absence of a complete physical layer specification (mechanical in addition to electrical) freed the CAN bus specification from the constraints and complexity of physical implementation. However, it left CAN bus implementations open to interoperability issues due to mechanical incompatibility. In order to improve interoperability, many vehicle makers have generated specifications describing a set of allowed CAN transceivers in combination with requirements on the parasitic capacitance on the line. The allowed parasitic capacitance includes both capacitors as well as ESD protection (ESD[15] against ISO 7637-3). In addition to parasitic capacitance, 12V and 24V systems do not have the same requirements in terms of line maximum voltage. Indeed, during jump start events light vehicle lines can go up to 24V while truck systems can go as high as 36V. New solutions are emerging, allowing the same component to be used for CAN as well as CAN FD (see [16]).

Noise immunity on ISO 11898-2:2003 is achieved by maintaining the differential impedance of the bus at a low level with low-value resistors (120 ohms) at each end of the bus. However, when dormant, a low-impedance bus such as CAN draws more current (and power) than other voltage-based signaling buses. On CAN bus systems, balanced line operation, where current in one signal line is exactly balanced by current in the opposite direction in the other signal provides an independent, stable 0 V reference for the receivers. Best practice determines that CAN bus balanced pair signals be carried in twisted pair wires in a shielded cable to minimize RF emission and reduce interference susceptibility in the already noisy RF environment of an automobile.

ISO 11898-2 provides some immunity to common mode voltage between transmitter and receiver by having a 0 V rail running along the bus to maintain a high degree of voltage association between the nodes. Also, in the de facto mechanical configuration mentioned above, a supply rail is included to distribute power to each of the transceiver nodes. The design provides a common supply for all the transceivers. The actual voltage to be applied by the bus and which nodes apply to it are application-specific and not formally specified. Common practice node design provides each node with transceivers that are optically isolated from their node host and derive a 5 V linearly regulated supply voltage for the transceivers from the universal supply rail provided by the bus. This usually allows operating margin on the supply rail sufficient to allow interoperability across many node types. Typical values of supply voltage on such networks are 7 to 30 V. However, the lack of a formal standard means that system designers are responsible for supply rail compatibility.

ISO 11898-2 describes the electrical implementation formed from a multi-dropped single-ended balanced line configuration with resistor termination at each end of the bus. In this configuration a dominant state is asserted by one or more transmitters switching the CAN− to supply 0 V and (simultaneously) switching CAN+ to the +5 V bus voltage thereby forming a current path through the resistors that terminate the bus. As such the terminating resistors form an essential component of the signaling system, and are included, not just to limit wave reflection at high frequency.

During a recessive state, the signal lines and resistor(s) remain in a high-impedance state with respect to both rails. Voltages on both CAN+ and CAN− tend (weakly) towards a voltage midway between the rails. A recessive state is present on the bus only when none of the transmitters on the bus is asserting a dominant state.

During a dominant state, the signal lines and resistor(s) move to a low-impedance state with respect to the rails so that current flows through the resistor. CAN+ voltage tends to +5 V and CAN− tends to 0 V.

Irrespective of signal state the signal lines are always in a low-impedance state with respect to one another by virtue of the terminating resistors at the end of the bus.

This signaling strategy differs significantly from other balanced line transmission technologies such as RS-422/3, RS-485, etc. which employ differential line drivers/ receivers and use a signaling system based on the differential mode voltage of the balanced line crossing a notional 0 V. Multiple access on such systems normally relies on the media supporting three states (active high, active low and inactive tri-state) and is dealt with in the time domain. Multiple access on CAN bus is achieved by the electrical logic of the system supporting just two states that are conceptually analogous to a ‘wired AND’ network.

Physical organization

[edit]

CAN is a multi-master serial bus standard for connecting electronic control units (ECUs) also known as nodes (automotive electronics is a major application domain). Two or more nodes are required on the CAN bus to communicate. A node may interface to devices from simple digital logic e.g. PLD, via FPGA up to an embedded computer running extensive software. Such a computer may also be a gateway allowing a general-purpose computer (like a laptop) to communicate over a USB or Ethernet port to the devices on a CAN bus.

All nodes are connected to each other through a physically conventional two-wire bus. The wires are a twisted pair with a 120 Ω (nominal) characteristic impedance.

This bus uses differential wired-AND signals. Two signals, CAN high (CANH) and CAN low (CANL) are either driven to a "dominant" state with CANH > CANL, or not driven and pulled by passive resistors to a "recessive" state with CANH ≤ CANL. A 0 data bit encodes a dominant state, while a 1 data bit encodes a recessive state, supporting a wired-AND convention, which gives nodes with lower ID numbers priority on the bus.

High-speed CAN bus. ISO 11898-2.

ISO 11898-2, also called high-speed CAN (bit speeds up to 1 Mbit/s on CAN, 5 Mbit/s on CAN-FD), uses a linear bus terminated at each end with a 120 Ω resistor.

High-speed CAN signaling. ISO 11898-2.

High-speed CAN signaling drives the CANH wire towards 3.5 V and the CANL wire towards 1.5 V when any device is transmitting a dominant (0), while if no device is transmitting a dominant, the terminating resistors passively return the two wires to the recessive (1) state with a nominal differential voltage of 0 V. (Receivers consider any differential voltage of less than 0.5 V to be recessive.) The dominant differential voltage is a nominal 2 V. The dominant common mode voltage (CANH+CANL)/2 must be within 1.5 to 3.5 V of common, while the recessive common mode voltage must be within ±12  of common.

Low-speed fault-tolerant CAN bus. ISO 11898-3.

ISO 11898-3, also called low-speed or fault-tolerant CAN (up to 125 kbit/s), uses a linear bus, star bus or multiple star buses connected by a linear bus and is terminated at each node by a fraction of the overall termination resistance. The overall termination resistance should be close to, but not less than, 100 Ω.

Low-speed CAN signaling. ISO 11898-3.

Low-speed fault-tolerant CAN signaling operates similarly to high-speed CAN, but with larger voltage swings. The dominant state is transmitted by driving CANH towards the device power supply voltage (5 V or 3.3 V), and CANL towards 0 V when transmitting a dominant (0), while the termination resistors pull the bus to a recessive state with CANH at 0 V and CANL at 5 V. This allows a simpler receiver that just considers the sign of CANH−CANL. Both wires must be able to handle −27 to +40 V without damage.

Electrical properties

[edit]

With both high-speed and low-speed CAN, the speed of the transition is faster when a recessive-to-dominant transition occurs since the CAN wires are being actively driven. The speed of the dominant-to-recessive transition depends primarily on the length of the CAN network and the capacitance of the wire used.

High-speed CAN is usually used in automotive and industrial applications where the bus runs from one end of the environment to the other. Fault-tolerant CAN is often used where groups of nodes need to be connected together.

The specifications require the bus be kept within a minimum and maximum common mode bus voltage but do not define how to keep the bus within this range.

The CAN bus must be terminated. The termination resistors are needed to suppress reflections as well as return the bus to its recessive or idle state.

High-speed CAN uses a 120 Ω resistor at each end of a linear bus. Low-speed CAN uses resistors at each node. Other types of terminations may be used such as the Terminating Bias Circuit defined in ISO11783.[9]

A terminating bias circuit provides power and ground in addition to the CAN signaling on a four-wire cable. This provides automatic electrical bias and termination at each end of each bus segment. An ISO11783 network is designed for hot plug-in and removal of bus segments and ECUs.

Nodes

[edit]
CAN bus node

Each node requires a

  • Central processing unit, microprocessor, or host processor
    • The host processor decides what the received messages mean and what messages it wants to transmit.
    • Sensors, actuators and control devices can be connected to the host processor.
  • CAN controller- often an integral part of the microcontroller
    • Receiving: the CAN controller stores the received serial bits from the bus until an entire message is available, which can then be fetched by the host processor (usually by the CAN controller triggering an interrupt).
    • Sending: the host processor sends the transmit message(s) to a CAN controller, which transmits the bits serially onto the bus when the bus is free.
  • Transceiver Defined by ISO 11898-2/3 Medium Access Unit [MAU] standards
    • Receiving: it converts the data stream from CAN bus levels to levels that the CAN controller uses. It usually has protective circuitry to protect the CAN controller.
    • Transmitting: it converts the data stream from the CAN controller to CAN bus levels.

Each node is able to send and receive messages, but not simultaneously. A message or Frame consists primarily of the ID (identifier), which represents the priority of the message, and up to eight data bytes. A CRC, acknowledge slot [ACK] and other overhead are also part of the message. The improved CAN FD extends the length of the data section to up to 64 bytes per frame. The message is transmitted serially onto the bus using a non-return-to-zero (NRZ) format and may be received by all nodes.

The devices that are connected by a CAN network are typically sensors, actuators, and other control devices. These devices are connected to the bus through a host processor, a CAN controller, and a CAN transceiver.

Data transmission and arbitration

[edit]

CAN data transmission uses a lossless bitwise arbitration method of contention resolution. This arbitration method requires all nodes on the CAN network to be synchronized to sample every bit on the CAN network at the same time. This is why some call CAN synchronous. Unfortunately the term synchronous is imprecise since the data is transmitted in an asynchronous format, namely without a clock signal.

The CAN specifications use the terms dominant bits and recessive bits, where dominant is a logical 0 (actively driven to a voltage by the transmitter) and recessive is a logical 1 (passively returned to a voltage by a resistor). The idle state is represented by the recessive level (Logical 1). If one node transmits a dominant bit and another node transmits a recessive bit then there is a collision and the dominant bit wins. This means there is no delay to the higher-priority message, and the node transmitting the lower-priority message automatically attempts to re-transmit six-bit clocks after the end of the dominant message. This makes CAN very suitable as a real-time prioritized communications system.

The exact voltages for a logical 0 or 1 depend on the physical layer used, but the basic principle of CAN requires that each node listen to the data on the CAN network including the transmitting node(s) itself (themselves). If a logical 1 is transmitted by all transmitting nodes at the same time, then a logical 1 is seen by all of the nodes, including both the transmitting node(s) and receiving node(s). If a logical 0 is transmitted by all transmitting node(s) at the same time, then a logical 0 is seen by all nodes. If a logical 0 is being transmitted by one or more nodes, and a logical 1 is being transmitted by one or more nodes, then a logical 0 is seen by all nodes including the node(s) transmitting the logical 1. When a node transmits a logical 1 but sees a logical 0, it realizes that there is a contention and it quits transmitting. By using this process, any node that transmits a logical 1, when another node transmits a logical 0, loses the arbitration and drops out. A node that loses arbitration re-queues its message for later transmission and the CAN frame bit-stream continues without error until only one node is left transmitting. This means that the node that transmits the first 1 loses arbitration. Since the 11 (or 29 for CAN 2.0B) bit identifier is transmitted by all nodes at the start of the CAN frame, the node with the lowest identifier transmits more zeros at the start of the frame, and that is the node that wins the arbitration or has the highest priority.

For example, consider an 11-bit ID CAN network, with two nodes with IDs of 15 (binary representation, 00000001111) and 16 (binary representation, 00000010000). If these two nodes transmit at the same time, each will first transmit the start bit then transmit the first six zeros of their ID with no arbitration decision being made.

Start
bit
ID bits The rest of the frame
10 9 8 7 6 5 4 3 2 1 0
Node 15 0 0 0 0 0 0 0 0 1 1 1 1
Node 16 0 0 0 0 0 0 0 1 Stopped Transmitting
CAN data 0 0 0 0 0 0 0 0 1 1 1 1

When ID bit 4 is transmitted, the node with the ID of 16 transmits a 1 (recessive) for its ID, and the node with the ID of 15 transmits a 0 (dominant) for its ID. When this happens, the node with the ID of 16 knows it transmitted a 1, but sees a 0 and realizes that there is a collision and it lost arbitration. Node 16 stops transmitting which allows the node with ID of 15 to continue its transmission without any loss of data. The node with the lowest ID will always win the arbitration and therefore has the highest priority.

Bit rates up to 1 Mbit/s are possible at network lengths below 40 m. Decreasing the bit rate allows longer network distances (e.g. 500 m at 125 kbit/s). The improved CAN FD standard allows increasing the bit rate after arbitration and can increase the speed of the data section by a factor of up to ten or more of the arbitration bit rate.

Bit timing

[edit]

All nodes on the CAN network must operate at the same nominal bit rate, but noise, phase shifts, oscillator tolerance and oscillator drift mean that the actual bit rate might not be the nominal bit rate.[17] Since a separate clock signal is not used, a means of synchronizing the nodes is necessary. Synchronization is important during arbitration since the nodes in arbitration must be able to see both their transmitted data and the other nodes' transmitted data at the same time. Synchronization is also important to ensure that variations in oscillator timing between nodes do not cause errors.

Synchronization starts with a hard synchronization on the first recessive to dominant transition after a period of bus idle (the start bit). Resynchronization occurs on every recessive to dominant transition during the frame. The CAN controller expects the transition to occur at a multiple of the nominal bit time. If the transition does not occur at the exact time the controller expects it, the controller adjusts the nominal bit time accordingly.

The adjustment is accomplished by dividing each bit into a number of time slices called quanta, and assigning some number of quanta to each of the four segments within the bit: synchronization, propagation, phase segment 1 and phase segment 2.

An example CAN bit timing with 10 time quanta per bit

The number of quanta the bit is divided into can vary by controller, and the number of quanta assigned to each segment can be varied depending on bit rate and network conditions.

A transition that occurs before or after it is expected causes the controller to calculate the time difference and lengthen phase segment 1 or shorten phase segment 2 by this time. This effectively adjusts the timing of the receiver to the transmitter to synchronize them. This resynchronization process is done continuously at every recessive to dominant transition to ensure the transmitter and receiver stay in sync. Continuously resynchronizing reduces errors induced by noise, and allows a receiving node that was synchronized to a node that lost arbitration to resynchronize to the node which won arbitration.

ID allocation

[edit]

Message IDs must be unique[10] on a single CAN bus, otherwise two nodes would continue transmission beyond the end of the arbitration field (ID) causing an error.

In the early 1990s, the choice of IDs for messages was done simply on the basis of identifying the type of data and the sending node; however, as the ID is also used as the message priority, this led to poor real-time performance. In those scenarios, a low CAN bus use of around 30% was commonly required to ensure that all messages would meet their deadlines. However, if IDs are instead determined based on the deadline of the message, the lower the numerical ID and hence the higher the message priority, then bus use of 70 to 80% can typically be achieved before any message deadlines are missed.[18]

Interframe spacing

[edit]

Data frames and remote frames are separated from preceding frames by a bit field called interframe space. Interframe space consists of at least three consecutive recessive (1) bits. Following that, if a dominant bit is detected, it will be regarded as the Start of frame bit of the next frame. Overload frames and error frames are not preceded by an interframe space and multiple overload frames are not separated by an interframe space. Interframe space contains the bit fields intermission and bus idle, and suspend transmission for error passive stations, which have been transmitter of the previous message.[19]

Frames & message structure

[edit]

Frame Types

[edit]

A CAN network can be configured to work with two different message (or frame) formats: the standard or base frame format (described in CAN 2.0 A and CAN 2.0 B), and the extended frame format (described only by CAN 2.0 B). The only difference between the two formats is that the CAN base frame supports a length of 11 bits for the identifier, and the CAN extended frame supports a length of 29 bits for the identifier, made up of the 11-bit identifier (base identifier) and an 18-bit extension (identifier extension). The distinction between CAN base frame format and CAN extended frame format is made by using the IDE bit, which is transmitted as dominant in case of an 11-bit frame, and transmitted as recessive in case of a 29-bit frame. CAN controllers that support extended frame format messages are also able to send and receive messages in CAN base frame format. All frames begin with a start-of-frame (SOF) bit that denotes the start of the frame transmission.

CAN has four frame types:

  • Data frame: a frame containing node data for transmission
  • Remote frame: a frame requesting the transmission of a specific identifier
  • Error frame: a frame transmitted by any node detecting an error
  • Overload frame: a frame to inject a delay between data or remote frame

Data frame

[edit]

The data frame is the only frame for actual data transmission. There are two message formats:

  • Base frame format: with 11 identifier bits
  • Extended frame format: with 29 identifier bits

The CAN standard requires that the implementation must accept the base frame format and may accept the extended frame format, but must tolerate the extended frame format.

Base frame format
[edit]
A complete CAN bus frame, including stuff bits, a correct CRC, and inter-frame spacing

The frame format is as follows: The bit values are described for CAN-LO signal.

Field name Length (bits) Purpose
Start-of-frame 1 Denotes the start of frame transmission
Identifier (green) 11 A (unique) identifier which also represents the message priority
Remote transmission request (RTR) (blue) 1 Must be dominant (0) for data frames and recessive (1) for remote request frames (see Remote Frame, below)
Identifier extension bit (IDE) 1 Must be dominant (0) for base frame format with 11-bit identifiers
Reserved bit (r0) 1 Reserved bit. Must be dominant (0), but accepted as either dominant or recessive.
Data length code (DLC) (yellow) 4 Number of bytes of data (0–8 bytes)[a]
Data field (red) 0–64 (0-8 bytes) Data to be transmitted (length in bytes dictated by DLC field)
CRC 15 Cyclic redundancy check
CRC delimiter 1 Must be recessive (1)
ACK slot 1 Transmitter sends recessive (1) and any receiver can assert a dominant (0)
ACK delimiter 1 Must be recessive (1)
End-of-frame (EOF) 7 Must be recessive (1)
Inter-frame spacing (IFS) 3 Must be recessive (1)
  1. ^ It is physically possible for a value between 9–15 to be transmitted in the 4-bit DLC, although the data is still limited to eight bytes. Certain controllers allow the transmission or reception of a DLC greater than eight, but the actual data length is always limited to eight bytes.
A CAN bus frame transmitted with a 1 Mbit/s bitrate spans 47 μsec between the SOF and ACK bits, as captured by a digital oscilloscope with a CAN serial decoding functionality.
Extended frame format
[edit]

The frame format is as follows on from here in the table below:

Field name Length (bits) Purpose
Start-of-frame 1 Denotes the start of frame transmission
Identifier A (green) 11 First part of the (unique) identifier which also represents the message priority
Substitute remote request (SRR) 1 Must be recessive (1)
Identifier extension bit (IDE) 1 Must be recessive (1) for extended frame format with 29-bit identifiers
Identifier B (green) 18 Second part of the (unique) identifier which also represents the message priority
Remote transmission request (RTR) (blue) 1 Must be dominant (0) for data frames and recessive (1) for remote request frames (see Remote Frame, below)
Reserved bits (r1, r0) 2 Reserved bits which must be set dominant (0), but accepted as either dominant or recessive
Data length code (DLC) (yellow) 4 Number of bytes of data (0–8 bytes)[a]
Data field (red) 0–64 (0-8 bytes) Data to be transmitted (length dictated by DLC field)
CRC 15 Cyclic redundancy check
CRC delimiter 1 Must be recessive (1)
ACK slot 1 Transmitter sends recessive (1) and any receiver can assert a dominant (0)
ACK delimiter 1 Must be recessive (1)
End-of-frame (EOF) 7 Must be recessive (1)
Inter-frame spacing (IFS) 3 Must be recessive (1)
  1. ^ It is physically possible for a value between 9–15 to be transmitted in the 4-bit DLC, although the data is still limited to eight bytes. Certain controllers allow the transmission or reception of a DLC greater than eight, but the actual data length is always limited to eight bytes.

The two identifier fields (A & B) combine to form a 29-bit identifier.

Remote frame

[edit]
  • Generally data transmission is performed on an autonomous basis with the data source node (e.g., a sensor) sending out a data frame. It is also possible, however, for a destination node to request the data from the source by sending a remote frame.
  • There are two differences between a data frame and a remote frame. Firstly the RTR-bit is transmitted as a dominant bit in the data frame and secondly in the remote frame there is no data field. The DLC field indicates the data length of the requested message (not the transmitted one).
    I.e.,
RTR = 0 ; DOMINANT in data frame
RTR = 1 ; RECESSIVE in remote frame

In the event of a data frame and a remote frame with the same identifier being transmitted at the same time, the data frame wins arbitration due to the dominant RTR bit following the identifier.

Error frame

[edit]

The error frame consists of two different fields:

  • The first field is given by the superposition of ERROR FLAGS (6–12 dominant/recessive bits) contributed from different stations.
  • The following second field is the ERROR DELIMITER (8 recessive bits).

There are two types of error flags:

Active Error Flag
six dominant bits – Transmitted by a node detecting an error on the network that is in error state error active.
Passive Error Flag
six recessive bits – Transmitted by a node detecting an active error frame on the network that is in error state error passive.

There are two error counters in CAN:

  1. Transmit error counter (TEC)
  2. Receive error counter (REC)
  • When TEC or REC is greater than 127 and less than 255, a Passive Error frame will be transmitted on the bus.
  • When TEC and REC is less than 128, an Active Error frame will be transmitted on the bus.
  • When TEC is greater than 255, then the node enters into Bus Off state, where no frames will be transmitted.

Overload frame

[edit]

The overload frame contains the two bit fields: Overload Flag and Overload Delimiter. There are two kinds of overload conditions that can lead to the transmission of an overload flag:

  1. The internal conditions of a receiver, which requires a delay of the next data frame or remote frame.
  2. Detection of a dominant bit during intermission.

The start of an overload frame due to case 1 is only allowed to be started at the first bit time of an expected intermission, whereas overload frames due to case 2 start one bit after detecting the dominant bit. Overload Flag consists of six dominant bits. The overall form corresponds to that of the active error flag. The overload flag's form destroys the fixed form of the intermission field. As a consequence, all other stations also detect an overload condition and on their part start transmission of an overload flag. Overload Delimiter consists of eight recessive bits. The overload delimiter is of the same form as the error delimiter.

ACK slot

[edit]

The acknowledge slot is used to acknowledge the receipt of a valid CAN frame. Each node that receives the frame, without finding an error, transmits a dominant level in the ACK slot and thus overrides the recessive level of the transmitter. If a transmitter detects a recessive level in the ACK slot, it knows that no receiver found a valid frame. A receiving node may transmit a recessive to indicate that it did not receive a valid frame, but another node that did receive a valid frame may override this with a dominant. The transmitting node cannot know that the message has been received by all of the nodes on the CAN network.

Often, the mode of operation of the device is to re-transmit unacknowledged frames over and over. This may lead to eventually entering the error passive state.

Bit stuffing

[edit]
CAN frame before and after the addition of stuff bits (in purple). An incorrect CRC is used for bit stuffing illustration purposes.

To ensure enough transitions to maintain synchronization, a bit of opposite polarity is inserted after five consecutive bits of the same polarity. This practice is called bit stuffing, and is necessary due to the non-return-to-zero (NRZ) coding used with CAN. The stuffed data frames are destuffed by the receiver.

All fields in the frame are stuffed with the exception of the CRC delimiter, ACK field and end of frame which are a fixed size and are not stuffed. In the fields where bit stuffing is used, six consecutive bits of the same polarity (111111 or 000000) are considered an error. An active error flag can be transmitted by a node when an error has been detected. The active error flag consists of six consecutive dominant bits and violates the rule of bit stuffing.

Bit stuffing means that data frames may be larger than one would expect by simply enumerating the bits shown in the tables above. The maximum increase in size of a CAN frame (base format) after bit stuffing is in the case

11111000011110000...

which is stuffed as (stuffing bits in bold):

111110000011111000001...

The stuffing bit itself may be the first of the five consecutive identical bits, so in the worst case there is one stuffing bit per four original bits.

The size of a base frame is bounded by

where n is the number of data bytes, a maximum of 8.

Since is the size of the frame before stuffing, in the worst case one bit will be added every four original bits after the first one (hence the −1 at the numerator) and, because of the layout of the bits of the header, only 34 out of 44 of them can be subject to bit stuffing.

frame type before stuffing after stuffing stuffing bits total frame length
base frame
extended frame

An undesirable side effect of the bit stuffing scheme is that a small number of bit errors in a received message may corrupt the destuffing process, causing a larger number of errors to propagate through the destuffed message. This reduces the level of protection that would otherwise be offered by the CRC against the original errors. This deficiency of the protocol has been addressed in CAN FD frames by the use of a combination of fixed stuff bits and a counter that records the number of stuff bits inserted.

Standardization and protocols

[edit]

CAN lower-layer standards

[edit]

ISO 11898 series specifies physical and data link layer (levels 1 and 2 of the ISO/OSI model) of serial communication category called controller area network that supports distributed real-time control and multiplexing for use within road vehicles.[20]

There are several CAN physical layer and other standards:

ISO 11898-1:2015 specifies the data link layer (DLL) and physical signalling of the controller area network (CAN).[13] This document describes the general architecture of CAN in terms of hierarchical layers according to the ISO reference model for open systems interconnection (OSI) established in ISO/IEC 7498-1 and provides the characteristics for setting up an interchange of digital information between modules implementing the CAN DLL with detailed specification of the logical link control (LLC) sublayer and medium access control (MAC) sublayer.

ISO 11898-2:2016 specifies the high-speed (transmission rates of up to 1 Mbit/s) medium access unit (MAU), and some medium-dependent interface (MDI) features (according to ISO 8802-3), which comprise the physical layer of the controller area network. ISO 11898-2 uses a two-wire balanced signaling scheme. It is the most used physical layer in vehicle powertrain applications and industrial control networks.

ISO 11898-3:2006 specifies low-speed, fault-tolerant, medium-dependent interface for setting up an interchange of digital information between electronic control units of road vehicles equipped with the CAN at transmission rates above 40 kbit/s up to 125 kbit/s.

ISO 11898-4:2004 specifies time-triggered communication in the CAN (TTCAN). It is applicable to setting up a time-triggered interchange of digital information between electronic control units (ECU) of road vehicles equipped with CAN, and specifies the frame synchronization entity that coordinates the operation of both logical link and media access controls in accordance with ISO 11898-1, to provide the time-triggered communication schedule.

ISO 11898-5:2007 specifies the CAN physical layer for transmission rates up to 1 Mbit/s for use within road vehicles. It describes the medium access unit functions as well as some medium-dependent interface features according to ISO 8802-2. This represents an extension of ISO 11898-2, dealing with new functionality for systems requiring low-power consumption features while there is no active bus communication.

ISO 11898-6:2013 specifies the CAN physical layer for transmission rates up to 1 Mbit/s for use within road vehicles. It describes the medium access unit functions as well as some medium-dependent interface features according to ISO 8802-2. This represents an extension of ISO 11898-2 and ISO 11898-5, specifying a selective wake-up mechanism using configurable CAN frames.

ISO 16845-1:2016 provides the methodology and abstract test suite necessary for checking the conformance of any CAN implementation of the CAN specified in ISO 11898-1.

ISO 16845-2:2018 establishes test cases and test requirements to realize a test plan verifying if the CAN transceiver with implemented selective wake-up functions conform to the specified functionalities. The kind of testing defined in ISO 16845-2:2018 is named as conformance testing.

CAN-based higher-layer protocols

[edit]

As the CAN standard does not include common communication features, such as flow control, device addressing, and transportation of data blocks larger than one message, and above all, application data, many implementations of higher layer protocols were created. Several are standardized for a business area, although all can be extended by each manufacturer. For passenger cars, each manufacturer has its own standard.

CAN in Automation (CiA) is the international users' and manufacturers' organization that develops and supports CAN-based higher-layer protocols and their international standardization.[12] Among these specifications are:

List of standardized approaches

[edit]

List of other approaches

[edit]
  • CANaerospace - Stock (for the aviation industry)
  • CAN Kingdom - Kvaser (embedded control system)
  • CCP/XCP (automotive ECU calibration)
  • GMLAN - General Motors (for General Motors)
  • RV-C - RVIA (used for recreational vehicles)
  • SafetyBUS p - Pilz (used for industrial automation)
  • UAVCAN (aerospace and robotics)
  • CSP (CubeSat Space Protocol)
  • VSCP (Very Simple Control Protocol) a free automation protocol suitable for all sorts of automation tasks

CANopen Lift

[edit]

The CANopen Special Interest Group (SIG) "Lift Control", which was founded in 2001, develops the CANopen application profile CiA 417 for lift control systems. It works on extending the features, improves technical content and ensures that the current legal standards for lift control systems are met. The first version of CiA 417 was published (available for CiA members) in summer 2003, version 2.0 in February 2010, version 2.1.0 in July 2012, version 2.2.0 in December 2015, and version 2.3.1 in February 2020.

Jörg Hellmich (ELFIN GmbH) is the chairman of this SIG and manages a wiki of the CANopen lift community with content about CANopen lift.

DBC (CAN Database Files)

[edit]

CAN DBC files are standardized ASCII files used to define messages sent over a CAN bus. They define the format and purpose of each type of message, including the message IDs, signal names, scaling, offsets, and data types, and provide an interoperable aid to developing CAN bus applications.

Security

[edit]

Technical vulnerabilities

[edit]

The CAN protocol does not include encryption, authentication, or access control mechanisms, leaving it susceptible to multiple attack vectors:

  • Message Injection: Attackers can introduce malicious messages into the network, potentially affecting vehicle operations.
  • Replay Attacks: Since CAN messages lack timestamps or unique identifiers, previously recorded messages can be resent to manipulate system behavior.
  • Eavesdropping: The broadcast nature of CAN allows any node to receive and interpret messages, enabling unauthorized data collection.
  • Denial-of-Service (DoS) Attacks: An attacker can flood the bus with high-priority messages, preventing legitimate communication.

Real-world exploits

[edit]

Several high-profile incidents have demonstrated the security weaknesses of CAN:

  • 2015 Jeep Cherokee Hack: Researchers Charlie Miller and Chris Valasek exploited a vulnerability in the vehicle’s telematics unit, gaining remote control over steering, braking, and acceleration. This research led to a recall affecting 1.4 million vehicles.[21]
  • Phreaked Out Demonstration: In a publicized test, security researcher Mathew Solnik used off-the-shelf hardware and a GSM-based wireless system to send commands to a vehicle's CAN bus, illustrating the ease of unauthorized remote access.[22]
  • CAN Injection Vehicle Thefts: Attackers have used CAN injection techniques to steal push-to-start vehicles by accessing the CAN bus through exposed wiring, such as headlights or diagnostic ports, allowing them to spoof key fob signals and start the engine.[23]

Higher-layer security measures

[edit]

By deploying these higher-layer security measures, designers can substantially enhance the resilience of CAN-based networks in vehicles and industrial systems. Here are some common solutions:

  • Hardware Security Modules (HSMs) and Secure Elements: Modern ECUs increasingly integrate HSMs to securely store cryptographic keys and perform digital signing. This ensures message authenticity and integrity without exposing sensitive information.[24]
  • Message Authentication and Integrity: Lightweight cryptographic techniques, including message authentication codes (MACs) and digital signatures, are being used to verify that messages originate from trusted sources. Although full encryption on CAN is challenging due to its real-time constraints, these measures help prevent unauthorized message injection.[25]
  • Lightweight Encryption: Ongoing research is exploring low-overhead encryption schemes that protect sensitive data on the CAN bus while preserving bandwidth and real-time performance.[25]
  • Intrusion Detection Systems (IDS): Advanced IDS and anomaly detection algorithms—often incorporating machine learning—monitor CAN traffic for unusual patterns or replay attacks, providing early warning of potential security breaches.[26][27]
  • Standardization and Cybersecurity Guidelines: Efforts such as SAE J3061[28] and ISO/SAE 21434[29] offer guidelines for integrating security into automotive networks, helping to standardize best practices for mitigating vulnerabilities in CAN systems.

Applying Zero-Trust Architecture (ZTA) to Automotive Security

[edit]

Zero-Trust Architecture (ZTA), based on the principle of "never trust, always verify," is being adapted from enterprise networks to automotive cybersecurity. By enforcing strict authentication, segmentation, and monitoring, ZTA enhances vehicle network resilience against cyber threats while balancing performance, cost, and system complexity.

Key Components of Automotive ZTA

  • Secure Onboard Communication (SecOC): Ensures authentication and verification of network communication between Electronic Control Units (ECUs) using cryptographic methods to prevent spoofing attacks.
  • ECU Authentication and Key Management: Enforces strict identity verification for each ECU before allowing communication within the vehicle network, utilizing cryptographic key creation and distribution.
  • Network Segmentation and Policy Enforcement: The vehicle gateway ECU acts as a policy enforcement point to regulate data flow between subsystems and limit lateral movement of attackers.
  • Secure Boot and Firmware Integrity: Ensures that ECUs only run authentic software by validating firmware signatures at startup, preventing unauthorized code execution.
  • Intrusion Detection and Monitoring: Implements real-time monitoring and AI-driven analytics to detect anomalies in CAN traffic, identifying cybersecurity threats early.

While ZTA enhances vehicle security, implementing efficient cryptographic methods and integrating with complex automotive systems remain challenges. Research suggests ZTA provides strong security with minimal impact on performance and cost.[30]

Development tools

[edit]

Understanding CAN Bus Tools and Microcontrollers

[edit]

When developing or troubleshooting a CAN bus system, examining hardware signals is crucial. Tools like logic analyzers and bus analyzers capture, decode, and store signals, enabling users to view high-speed waveforms for detailed analysis. In addition to these, CAN bus monitors are specialized tools that combines hardware and software to listen to and display CAN traffic in a user interface. It often includes the ability to simulate CAN bus activity by sending CAN frames to the bus. This feature is useful for validating expected CAN traffic or testing the reaction of a device to simulated traffic.

When selecting a development tool or microcontroller for working with the CAN bus, it's important to understand the distinction between CAN controllers integrated into microcontrollers and CAN transceivers added externally on circuit board:

  • CAN Controller (Integrated into Microcontroller): Refers to the built-in peripheral within a microcontroller or processor that manages CAN protocol functions, including message framing, identifier filtering, error detection, and buffering. Typically, this internal controller requires an external CAN transceiver to physically connect to the CAN bus.
  • CAN Transceiver (Independent IC, separate from processor): Refers to a dedicated hardware component found on a development board or system that converts logic-level signals from the microcontroller’s CAN controller into differential voltage physical-layer signals.

CAN bit-banging

[edit]

When working with CAN communication, CAN transceivers are typically used to handle the physical layer and some aspects of the data link layer. However, they do not give you full control over the data link layer itself. The transceiver automatically handles the framing, timing, and other elements of communication, which can be limiting if you need to manipulate the CAN protocol at a finer level or perform custom tasks that require low-level control. For example, when using a transceiver, you cannot easily modify how data frames are structured or manipulate certain aspects of the protocol without additional hardware or complex configurations.

CAN bit-banging offers a solution to this limitation by providing direct control over the data link layer. In this approach, you use general-purpose I/O pins on a microcontroller to manually implement the CAN signal protocol. This gives you the ability to customize and adjust the framing, timing, and message handling as needed, which can be particularly useful in low-level debugging, implementing specific CAN features, or experimenting with the protocol.

While bit-banging allows for greater control, it comes with trade-offs. It is slower and less efficient than using a dedicated CAN controller and transceiver, as the timing and transmission are all managed in software. Still, if fine-grained control over the communication process is required, bit-banging is a powerful option.

An open-source solution to facilitate CAN bit-banging is the CANT GitHub Repository . This library provides a software implementation of the CAN protocol, enabling developers to implement CAN communication while having complete control over the data link layer, even on microcontrollers that lack native CAN hardware support.

List of development tools

[edit]
CAN analysis tools & interfaces
Name Manufacturer Price Interface Notes Cell Last Updated
CANable USB to CAN adapters Openlight Labs $29 - $60 USB (PC-Based) The CANable Series consists of low-cost, open-source USB to CAN adapters. The CANable 2.0 supports CAN 2.0A/B and CAN FD. The CANable Pro and CANable Pro 1.1 add isolation and ESD protection. The original CANable supports CAN 2.0A/B and integrates with Linux via SocketCAN and slcand. All models feature open-source firmware, ideal for OEM integration. March 2025
Logic Series Saleae Logic Analyzers $500 - $1,500 USB (PC-Based) A general-purpose logic analyzer designed for capturing and analyzing digital signals such as CAN, I2C, SPI, and UART. It is useful for data-link layer analysis but lacks advanced CAN-specific diagnostic features. March 2025
CANalyzer Vector $2,000 - $4,500 USB (PC-Based) A professional CAN analysis and simulation tool used for debugging and monitoring CAN, LIN, FlexRay, and Ethernet communication in automotive and industrial applications. Supports real-time network analysis and diagnostics. March 2025
VividCAN Intrepid Control Systems Varies USB, CAN FD A CAN diagnostic tool with a full-color capacitive touchscreen, designed for field service, driver assistance, or creating custom user interfaces for engineers and hobbyists. March 2025
ValueCAN 4 Series Intrepid Control Systems Varies USB, CAN FD, Ethernet (varies by model) A cost-effective CAN interface for vehicle and industrial network analysis. Available in multiple configurations, including versions with DIN Rail mounting and LED indicators for industrial environments. March 2025
neoVI PI Intrepid Control Systems Varies USB, Ethernet, Wi-Fi A multi-protocol CAN FD interface with an integrated Raspberry Pi 4 Compute Module for standalone operation, logging, and real-time processing. Supports automotive and industrial network development. March 2025
neoVI RED 2 Intrepid Control Systems Varies USB, Ethernet, Wi-Fi A portable CAN and Ethernet interface supporting up to 8 dual-wire CAN FD channels, 2 LIN channels, and 2 Gigabit Ethernet channels. Designed for automotive data logging and protocol testing. March 2025
neoVI FIRE 3 Intrepid Control Systems Varies USB, Ethernet A high-end CAN FD interface and data logger supporting 16 CAN FD networks, up to 8 LIN networks, and multiple Ethernet connections for real-time communication analysis. March 2025
neoVI FIRE 3 FlexRay Intrepid Control Systems Varies USB, Ethernet A version of the neoVI FIRE 3 designed for applications requiring FlexRay, CAN FD, LIN, and 100BASE-TX Ethernet support. March 2025
RAD-Gigastar Intrepid Control Systems Varies Ethernet (100BASE-T1, 1000BASE-T1), SFP A high-speed automotive Ethernet gateway that supports CAN-Ethernet bridging and monitoring of 100/1000BASE-T1 connections. Can operate as a programmable gateway for network communication testing. March 2025

Licensing

[edit]

Bosch holds patents on the technology, though those related to the original protocol have now expired. Manufacturers of CAN-compatible microprocessors pay license fees to Bosch for use of the CAN trademark and any of the newer patents related to CAN FD, and these are normally passed on to the customer in the price of the chip. Manufacturers of products with custom ASICs or FPGAs containing CAN-compatible modules need to pay a fee for the CAN Protocol License if they wish to use the CAN trademark or CAN FD capabilities.[31]

See also

[edit]
  • CANopen – Computer network protocol
  • Automotive EtherLoop – Telecommunications hybrid technology
  • FlexRay – Computer network protocol
  • List of network buses – List of single collision domain electronic communication bus systems
  • Modbus – Serial communications protocol
  • MOST bus – High-speed multimedia network technology used in the automotive industry

References

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
The Controller Area Network (CAN) is a robust, protocol designed for real-time, multi-master data exchange between electronic control units (ECUs), sensors, and actuators in embedded systems, particularly , using a two-wire differential bus to ensure high noise immunity and . Developed by GmbH in the mid-1980s to address escalating wiring complexity in automobiles, CAN enables efficient message broadcasting with priority-based arbitration and comprehensive error detection mechanisms, supporting data rates up to 1 Mbps in its classic form. Standardized by the (ISO) as ISO 11898 in 1993, it has evolved into variants like (Flexible Data-rate) for higher throughput and CAN XL, standardized in 2024 and supporting up to 20 Mbps, remaining integral to modern applications beyond automotive use. CAN's development originated in 1983 under Bosch engineers Uwe Kiencke and Siegfried Dais, with the protocol first publicly introduced at the Society of Automotive Engineers (SAE) congress in February 1986, emphasizing non-destructive message arbitration and low error rates to support coordinated vehicle functions. The first commercial implementation appeared in the 1991 S-Class, marking its transition from concept to widespread adoption, where it reduced cabling needs dramatically while enhancing system reliability for features like engine control and antilock braking. By the early , semiconductor firms such as and produced affordable CAN controllers, accelerating its widespread adoption, with CAN integrated into virtually all modern vehicles and the global automotive fleet exceeding 1.5 billion as of the . Key features of CAN include its carrier-sense multiple access with collision detection and arbitration on message priority (CSMA/CD+AMP) protocol, which operates at the OSI model's physical and data-link layers, using 11-bit or 29-bit identifiers for frame prioritization and cyclic redundancy checks (CRC) for integrity. These attributes provide deterministic communication, hot-plug capability, and fault confinement, making it suitable for harsh environments with up to 30 nodes on a single bus segment of 40 meters at maximum speed. Beyond vehicles, CAN underpins industrial automation (e.g., machinery control), railway systems (e.g., brake signaling), (e.g., avionics), medical devices (e.g., diagnostic equipment), and , with ongoing extensions like CAN XL targeting up to 20 Mbps for emerging needs in electric and autonomous vehicles.

Introduction

Definition and Purpose

The Controller Area Network (CAN) is a robust serial bus standard designed to interconnect electronic control units (ECUs) for efficient, exchange in distributed systems, primarily originating from automotive applications. Developed by Robert Bosch GmbH starting in 1983 to simplify complex wiring harnesses amid increasing vehicle electronics, CAN was publicly introduced in February 1986 at the Society of Automotive Engineers (SAE) congress as a multi-master broadcast protocol. It was subsequently standardized under ISO 11898 in 1993, defining its protocol for bit rates up to 1 Mbit/s and establishing it as a foundational technology for networked control. The primary purpose of CAN is to facilitate reliable, fault-tolerant communication among multiple nodes in electrically noisy environments, eliminating the need for a central host computer through its decentralized multi-master . This design supports distributed real-time control and , allowing ECUs to exchange messages asynchronously while maintaining data consistency across the network. By messages to all connected devices on a shared bus, CAN ensures that critical information propagates efficiently without dedicated point-to-point connections, enhancing system scalability and resilience. Key advantages of CAN include its low implementation cost due to minimal wiring and integrated transceivers, comprehensive error detection mechanisms such as cyclic redundancy checks (CRC), acknowledgments, and bit monitoring, and built-in message prioritization via identifier-based . In classical implementations, it supports data rates from 125 kbps up to 1 Mbps, balancing speed with robustness for time-sensitive operations. The protocol's basic operational principle involves all nodes listening to the bus and transmitting messages that are resolved through non-destructive, bitwise , where lower identifier values grant higher priority without interrupting ongoing transmissions. Over time, CAN has evolved into higher-speed variants like and CAN XL to meet demands for greater bandwidth.

Development History

The development of the Controller Area Network (CAN) bus began in 1983 at in , driven by the need to reduce the complexity and cost of in automobiles through , which allowed multiple electronic control units to communicate over a single network rather than dedicated point-to-point connections. Bosch researchers, led by engineers Siegfried Dais and Uwe Kiencke, filed the initial in 1985, and the protocol was officially introduced by Uwe Kiencke, Siegfried Dais, and Martin Litschel in February 1986 at the Society of Automotive Engineers (SAE) congress in , marking the first public presentation of the technology. Early adoption accelerated in the automotive sector, with integrating CAN into its upper-class passenger cars starting in 1991, beginning with the W140 S-Class model where it networked engine management and other control units. That same year, Bosch released the CAN 2.0 specification, which included variants 2.0A (11-bit identifiers) and 2.0B (29-bit extended identifiers) to support broader addressing needs. Standardization followed in November 1993 with the publication of ISO 11898, which defined the high-speed CAN protocol for bit rates up to 1 Mbit/s, including architecture, physical, and data link layers for road vehicles. To promote CAN beyond automotive applications, the nonprofit CAN in Automation (CiA) association was founded in March 1992, providing a platform for specifications, standards, and marketing to facilitate its expansion into industrial automation. Subsequent advancements addressed growing data demands. In 2012, Bosch introduced (Flexible Data-rate) to overcome the 1 Mbit/s speed limit of classical CAN while maintaining , with features like dual bit rates and larger payloads up to 64 bytes. This was standardized as ISO 11898-1:2015, incorporating refinements for enhanced reliability and interoperability. Building on this, CAN XL was proposed in December 2018 by the CiA Special Interest Group, aiming for even higher speeds up to 20 Mbit/s and payloads up to 2,048 bytes to support advanced applications. It achieved full ratification in ISO 11898-1:2024 and ISO 11898-2:2024, specifying the , physical coding, and high-speed transceivers. By 2025, CAN technology has seen widespread adoption in electric vehicles (EVs) for battery management and control, as well as in (IoT) devices for reliable, low-cost networking in industrial and embedded systems. Annual global production exceeds two billion CAN nodes, with the majority in automotive applications but growing in non-automotive sectors like and medical equipment.

Applications

Automotive Use Cases

The Controller Area Network (CAN) bus serves as the primary communication backbone in modern vehicles, interconnecting electronic control units (ECUs) for critical subsystems such as engine management, transmission control, anti-lock braking systems (ABS), , and . In engine control, CAN enables real-time data exchange between the engine control module and sensors for , , and emissions monitoring, ensuring precise operation under varying conditions. Similarly, transmission systems use CAN to coordinate gear shifts and , while ABS modules rely on it to integrate wheel speed data for rapid brake modulation and stability enhancement. leverage CAN for millisecond-level synchronization of crash sensors and deployment actuators, and employ it to share with and without dedicated wiring. Key benefits of CAN in automotive applications include substantial reductions in wiring harness complexity and weight, often by up to 20 kilograms per vehicle, which lowers manufacturing costs and improves fuel efficiency. This multiplexing approach replaces point-to-point wiring with a shared bus, minimizing electromagnetic interference and enhancing reliability in harsh environments. CAN also facilitates standardized diagnostics through the On-Board Diagnostics II (OBD-II) port, where it transmits fault codes, sensor readings, and performance metrics to service tools. Basic physical integrity checks can be performed using a multimeter at the OBD-II port: with ignition off, measure resistance between pins 6 (CAN-H) and 14 (CAN-L), expecting approximately 60 Ω due to parallel 120 Ω terminators; with ignition on, measure DC voltages to ground, expecting CAN-H at 2.5-3.5 V and CAN-L at 1.5-2.5 V with fluctuations during bus activity. Deviations such as 120 Ω or infinite resistance may indicate open circuits or module faults. These tests complement software-based diagnostics, enabling efficient troubleshooting and compliance with emissions regulations like those from the EPA and EU. Furthermore, its deterministic arbitration and error-detection mechanisms support real-time control loops essential for safety-critical functions, such as coordinating ABS with electronic stability control during emergency maneuvers. In practice, automotive CAN networks are segmented by function and speed requirements, with high-speed CAN (up to 1 Mbps) dedicated to applications for rapid and transmission data exchange, such as position and RPM signals in performance vehicles. Low-speed CAN (up to 125 kbps), often fault-tolerant, handles body electronics like door locks, window controls, and interior lighting, prioritizing availability over velocity in non-critical domains. Gateways play a pivotal role in integrating these buses, especially in electric vehicles (EVs), where domain controllers consolidate (battery and ), , and body data through CAN routing to central compute units, optimizing energy distribution and reducing latency in zonal architectures. The evolution of CAN in vehicles traces back to the , when early implementations featured single-bus setups with fewer than 10 ECUs, primarily for and basic safety in models like the 1991 W140. By the mid-, adoption expanded to multi-bus architectures in luxury vehicles, such as BMW's 7 Series with five ECUs in a star topology for enhanced diagnostics. Entering the 2000s, CAN became integral to OBD-II mandates, supporting 20-50 ECUs per vehicle for emissions and safety monitoring. By 2025, contemporary automobiles integrate over 100 ECUs across domain-specific buses, incorporating advanced driver-assistance systems (ADAS) where CAN links , , and camera sensors for features like and lane-keeping assistance. As of 2025, CAN remains ubiquitous, equipping nearly all new passenger cars manufactured in and widely adopted globally due to its robustness and cost-effectiveness, with expanded roles in autonomous driving to ensure reliable, low-latency data sharing among perception and actuation modules. This high adoption rate underscores CAN's transition from basic networking to a foundational element in software-defined vehicles, bridging legacy systems with emerging electrification and autonomy trends.

Industrial and Embedded Systems

In industrial , the CAN bus serves as a robust for factory settings, enabling seamless integration among programmable logic controllers (PLCs), sensors, actuators, and robotic systems. Protocols such as and facilitate this connectivity, allowing for standardized data exchange in applications like assembly lines and process control. For instance, supports device profiles for drives, I/O modules, and encoders, promoting in environments. Beyond manufacturing, CAN bus finds extensive use in embedded systems across diverse sectors. In avionics, the ARINC 825 standard adapts CAN for airborne applications, ensuring reliable communication between flight control units, sensors, and navigation systems in aircraft. Medical equipment, such as patient monitors and infusion pumps, leverages CAN for real-time data transmission, enabling synchronized operation of vital sign tracking devices and diagnostic tools. In maritime navigation, the NMEA 2000 protocol, built on CAN, interconnects onboard electronics like GPS, radar, and engine controls for enhanced vessel monitoring and safety. The protocol's key advantages in these harsh and safety-critical domains include high resistance to (EMI) and deterministic real-time performance, which ensure reliable operation amid electrical noise and timing constraints. Specific examples include railway signaling systems under IEC 61375-3-3, where networks manage train consist communications for braking and diagnostics, and controls via the CANopen Lift profile (CiA 417), which coordinates doors, drives, and safety interlocks. In smart factories, CAN bus integrates with IoT gateways to bridge legacy equipment with cloud analytics, supporting Industry 4.0 initiatives for and efficiency gains. The industrial CAN market continues to expand, driven by demands, with projections indicating sustained growth through 2028.

Protocol Versions

Classical CAN (2.0)

Classical CAN 2.0, released by Bosch in September 1991, defines the foundational protocol for the Controller Area Network, supporting data transmission rates up to 1 Mbit/s with a maximum of 8 bytes per frame. It enables robust communication in multi-node environments through its core specifications, which prioritize reliability in harsh conditions like those in automotive and industrial settings. The protocol includes two variants: CAN 2.0A, which uses an 11-bit identifier for standard message addressing, and CAN 2.0B, which extends this to a 29-bit identifier to accommodate a larger number of unique message priorities and identifiers in . Implementations must be compatible with either Part A or Part B to ensure , allowing systems to handle both formats without conflict. Key features of Classical CAN 2.0 include multi-master operation, where any node can initiate transmission without a central controller, and broadcast communication that supports reception for efficient data dissemination across the bus. Built-in handling is provided through mechanisms such as (CRC) for , bit monitoring to detect transmission discrepancies, bit stuffing to maintain , and acknowledgment checks to confirm receipt. These elements ensure and automatic recovery, making the protocol suitable for real-time applications. Despite its strengths, Classical CAN 2.0 has limitations, including a fixed field length of 0 to 8 bytes, which can be inefficient for applications requiring larger payloads and often necessitates message fragmentation. Additionally, it lacks support for selective wake-up, requiring all nodes to remain active or respond to global wake-up signals, which increases power consumption in low-power scenarios. As of 2025, Classical CAN 2.0 remains dominant in legacy automotive electronic control units and basic industrial systems, accounting for a significant portion of communications, while overall CAN deployments exceed two billion nodes annually worldwide.

CAN FD

CAN Flexible Data-rate (CAN FD) is an extension of the Classical CAN protocol, standardized in ISO 11898-1:2015, which enables higher data throughput while maintaining compatibility with existing networks. Introduced by Bosch in 2012, it supports payloads of up to 64 bytes per frame, compared to the 8-byte limit in Classical CAN, and employs dual bit rates: the arbitration phase remains at up to 1 Mbps for compatibility, while the data phase can reach up to 8 Mbps. This design addresses the bandwidth constraints of Classical CAN in data-intensive applications, such as in vehicles. Key enhancements in CAN FD include a flexible data phase that allows bit rate switching after arbitration, enabling efficient transmission when a single node dominates the bus. To support higher speeds, it incorporates improved clock tolerance through re-synchronization before the acknowledgment slot and transceiver delay compensation (TDC), which mitigates propagation delays and allows shorter bit times in the data phase without increasing error risks. Backward compatibility is ensured as CAN FD controllers can operate in Classical CAN mode, and Classical CAN nodes ignore the additional FD-specific bits, treating FD frames as errors but not disrupting the network. The frame format in introduces several new fields to accommodate these features. The Switch (BRS) bit, set to recessive, signals a transition to the higher data phase ; if dominant, the entire frame uses the arbitration rate. The State Indicator (ESI) bit follows the BRS, with a recessive value indicating the transmitter is in the error-passive state to prevent from propagating at high speeds. Additionally, the Flexible Data-rate (FDF) bit identifies the frame as format, and the data length code (DLC) is redefined to encode lengths up to 64 bytes using a non-linear mapping. CAN FD has seen widespread adoption in modern automotive applications, particularly for handling large data volumes from cameras, radars, and advanced driver-assistance systems (ADAS). According to industry projections from early 2025, the penetration rate in new models is expected to exceed 60%, driven by the need for higher bandwidth in electric and autonomous vehicles. Despite these advances, CAN FD retains the bus limitations of Classical CAN, restricting it to linear or configurations with up to 100 nodes, and lacks native features like or . For even greater speeds beyond 8 Mbps, extensions like CAN XL build upon these foundations.

CAN XL

CAN XL, the third generation of the Controller Area Network (CAN) protocol, is defined in the ISO 11898-1:2024 standard for the and ISO 11898-2:2024 for the , enabling higher performance for demanding applications. Proposed by the CAN in Automation (CiA) group around , it supports nominal bit rates in the arbitration phase up to 1 Mbit/s, similar to previous CAN versions, while achieving data phase bit rates of up to 20 Mbit/s or higher using (PWM) coding, depending on the . This allows for payloads of up to 2048 bytes per frame, a significant increase from the 64-byte limit in , facilitating efficient transmission of large data volumes such as diagnostic information or software updates. Key innovations in CAN XL include an Ethernet-like framing structure that separates the 11-bit priority identifier from a 32-bit acceptance field, effectively expanding the addressing space and supporting a 64-bit hardware acceptance filter for more granular . It incorporates flow control mechanisms, such as those defined in CiA 613-3 for frame fragmentation, to manage transmission of oversized payloads reliably. Additionally, the protocol features an optional 8-bit virtual CAN network identifier (VCID) for up to 256 logical networks on a single physical bus, and it is designed to integrate with higher-layer protocols including optional support for TCP/IP compatibility. These enhancements maintain CAN's robust error detection and principles while adapting to modern networking needs. CAN XL offers partial with CAN FD and classical CAN on shared buses through mixed frame formats, though full often requires gateways to handle protocol differences. It is primarily intended for backbone and sub-backbone networks in software-defined vehicles, where high-bandwidth communication between central compute units is essential. As of 2025, adoption remains in early stages, with implementations appearing in prototypes for autonomous driving systems and (V2X) communications, supported by the CiA 610 series specifications for protocol details and . Looking ahead, CAN XL's capabilities position it to enable zonal vehicle architectures, where distributed electronic control units (ECUs) are consolidated into fewer centralized controllers—potentially reducing the typical 100+ ECUs in modern vehicles to under 20—thereby simplifying wiring, lowering weight, and improving scalability for advanced features like over-the-air updates.

Network Architecture

Layered Model

The Controller Area Network (CAN) protocol is structured according to the ISO Open Systems Interconnection (OSI) reference model, primarily implementing the physical layer (Layer 1) and the data link layer (Layer 2). This design focuses on robust, low-level communication for real-time embedded systems, without native support for higher layers such as network (Layer 3) or transport (Layer 4). As a result, CAN assumes a shared broadcast medium where all nodes access the bus directly, employing a non-destructive arbitration mechanism rather than collision detection protocols like CSMA/CD. The in CAN handles the transmission of raw bit streams over the medium and is specified in ISO 11898-2 for high-speed applications and ISO 11898-3 for low-speed, fault-tolerant variants. It comprises sublayers including the physical medium dependent (PMD) sublayer for medium attachment, the physical medium attachment (PMA) sublayer for signaling, and the for bit encoding and synchronization. These ensure reliable electrical signaling, typically using differential twisted-pair wiring for noise immunity. The data link layer manages framing, , error detection, and acknowledgment, enabling multiple nodes to share the bus efficiently. Key functions include for synchronization, (CRC) for integrity, and priority-based using message identifiers to resolve bus contention without . This layer operates in a connectionless, message-oriented manner, frames to all nodes without establishing virtual circuits or performing routing. While core CAN lacks higher-layer abstractions, protocols such as extend it by introducing an object layer that provides application-layer functionality, including device profiling, , and data mapping via an object dictionary. effectively fills OSI Layers 3 through 7 for specific use cases, such as industrial automation, by defining services like process data objects (PDOs) for real-time exchange and service data objects (SDOs) for configuration. This layered extension maintains CAN's efficiency while adding structured abstraction beyond the base protocol's scope.

Physical Layer Specifications

The physical layer of the Controller Area Network (CAN) defines the electrical and mechanical interfaces for reliable in harsh environments, primarily governed by ISO 11898 standards. High-speed CAN, specified in ISO 11898-2, employs differential signaling over two wires, CAN_H and CAN_L, to transmit data robustly while minimizing . This balanced configuration uses a slope-controlled driver to limit electromagnetic emissions and ensure compatibility with twisted-pair cabling. In high-speed CAN, the recessive state (logical 1) maintains both CAN_H and CAN_L at approximately 2.5 V, resulting in a differential voltage near 0 V. During the dominant state (logical 0), CAN_H rises to about 3.5 V and CAN_L falls to 1.5 V, producing a differential voltage of roughly 2 V. This differential approach enables high common-mode rejection, allowing the receiver to ignore affecting both lines equally, with transceivers tolerant of common-mode voltages from -2 V to +7 V as per ISO 11898-2. For low-speed applications up to 125 kbit/s, ISO 11898-3 defines a fault-tolerant, single-ended variant using a single wire (CAN_L) referenced to ground, with voltage levels adjusted for lower-speed, -resistant operation in non-critical systems like automotive comfort features. Cabling for CAN networks typically consists of twisted-pair wire with a of 120 Ω to match the transceiver output and prevent signal reflections. The bus requires termination resistors of 120 Ω at both ends to maintain , forming a linear that supports up to 30 nodes. Maximum bus length varies with bit rate: 40 m at 1 Mbit/s due to delay limits, extending to 1000 m at 50 kbit/s for slower networks. Short stubs, limited to 0.3 m at 1 Mbit/s, connect nodes to the main bus line to avoid reflections, with the dual-wire design providing inherent by allowing continued operation if one wire fails. Variants like and CAN XL retain the core physical layer of classical high-speed CAN per ISO 11898-2:2024, enabling without hardware changes for phases up to 1 Mbit/s. However, their higher data-phase speeds—up to 8 Mbit/s for CAN FD and 20 Mbit/s for CAN XL—demand enhanced transceivers with signal improvement capabilities and often improved shielding on twisted-pair cabling to mitigate increased electromagnetic susceptibility at elevated rates.

Node Structure and Topology

A CAN node, often implemented as an (ECU), consists of three primary components: the for application logic and message processing, the CAN controller for managing protocol functions such as framing, , and error detection, and the for interfacing with the physical bus medium. The CAN controller handles the operations, including bit timing, synchronization, and fault confinement mechanisms, while the converts digital signals from the controller to differential electrical signals on the bus lines (CAN_H and CAN_L). The applies acceptance filtering to determine which received messages are relevant to the node's functions, ensuring efficient processing without unnecessary data handling. CAN networks employ content-addressed messaging rather than fixed node addresses; each message includes an identifier (11-bit in standard format or 29-bit in extended format) that defines the message's content, priority, and intended recipients. This identifier-based approach allows any node to transmit without predefined addressing, with lower numerical identifier values granting higher transmission priority during bus . The network operates in a multi-master configuration, where any node can initiate transmission at any time, facilitating decentralized control. The standard topology for CAN is a linear bus-line structure using twisted-pair cabling, with 120 Ω termination resistors at both ends to prevent signal reflections and ensure proper . Alternative configurations, such as or ring topologies, can be achieved using active star hubs (e.g., CANcentrate designs) to enhance fault isolation by localizing failures to individual branches without disrupting the entire network. Typically, up to 110 nodes can be connected on a single bus, though this depends on capabilities, bus length, and data rate; for instance, ISO 11898 specifies at least 30 nodes for high-speed operation over 40 m at 1 Mbps, with more possible at lower speeds if electrical loading is managed. Fault handling in CAN nodes relies on error counters to maintain network integrity; each node tracks transmit error count (TEC) and receive error count (REC), entering an error-passive state if either exceeds 127 and progressing to bus-off if TEC reaches 256, at which point the node ceases transmission to avoid further disruption. Self-recovery from bus-off occurs automatically once the node detects 128 sequences of 11 consecutive recessive bits on the bus, resetting the error counters and returning to error-active state without external intervention. This mechanism ensures fault confinement, allowing the network to continue operating with remaining healthy nodes.

Data Transmission Mechanisms

Bit Timing and Synchronization

In the Controller Area Network (CAN) protocol, bit timing ensures reliable transmission by dividing each bit time into precise segments measured in time quanta (tq), the smallest unit derived from the node's oscillator divided by a programmable prescaler value (typically 1 to 32). The bit time is subdivided into four segments: the Segment (Sync_Seg), always fixed at 1 tq to align nodes; the Propagation Segment (Prop_Seg), programmable from 1 to 8 tq to compensate for signal propagation delays and edge distortions in the physical medium; Phase Buffer Segment 1 (Phase_Seg1), also 1 to 8 tq for initial phase error adjustment; and Phase Buffer Segment 2 (Phase_Seg2), programmable from 1 to 8 tq but not exceeding Phase_Seg1, to allow further adjustments. The total number of time quanta per bit ranges from 4 to 25, providing flexibility for various bit rates up to 1 Mbps in classical CAN. Synchronization in CAN occurs through two primary mechanisms to maintain alignment despite clock variations among nodes. Hard synchronization is enforced at the start of each frame when a recessive-to-dominant edge (indicating the beginning of a ) resets the bit time for all listening nodes, forcing their Sync_Seg to restart immediately upon detecting this edge during bus idle. For ongoing transmission, resynchronization adjusts the receiver's by shifting the position of the sample point: if an edge occurs within Prop_Seg or Phase_Seg1, Phase_Seg1 can be lengthened or Phase_Seg2 shortened by a resynchronization jump width (programmable from 1 to a maximum of 4 tq or Phase_Seg1, whichever is smaller). This mechanism tolerates oscillator frequency variations of up to ±1.58% at 1 Mbps, enabling the use of cost-effective ceramic resonators for lower speeds (up to 125 kbit/s) while requiring crystals for higher rates to meet precision demands. The sample point, where the bus level is sampled and interpreted as the bit value, is positioned at the end of Phase_Seg1, typically configured to occur 75% to 90% into the bit time to optimize noise immunity and timing margins. This placement allows sufficient time for signal propagation and processing while leaving room for resynchronization adjustments in Phase_Seg2. The nominal is calculated as the oscillator frequency divided by the product of the prescaler value and the total number of segments per bit (Sync_Seg + Prop_Seg + Phase_Seg1 + Phase_Seg2), expressed as: Bit Rate=foscPrescaler×(1+Prop_Seg+Phase_Seg1+Phase_Seg2)\text{Bit Rate} = \frac{f_{\text{osc}}}{\text{Prescaler} \times (1 + \text{Prop\_Seg} + \text{Phase\_Seg1} + \text{Phase\_Seg2})} where foscf_{\text{osc}} is the oscillator frequency and Sync_Seg is fixed at 1; this derivation aligns with the timing parameters specified in ISO 11898 for high-speed CAN networks.

Message Arbitration and ID Assignment

The Controller Area Network (CAN) employs a non-destructive arbitration mechanism to resolve bus contention when multiple nodes attempt to transmit messages simultaneously, ensuring efficient and collision-free communication. This process follows a Carrier Sense Multiple Access with Collision Detection and Arbitration on Message Priority (CSMA/CD+AMP) strategy, where nodes listen to the bus before transmitting and use bitwise arbitration during the identifier field to determine priority without interrupting ongoing transmissions. Specifically, each node transmits its message identifier bit by bit, starting from the most significant bit, while simultaneously monitoring the bus state; a dominant bit (logical 0) overrides a recessive bit (logical 1), allowing the node with the lowest (most dominant) identifier value to prevail and continue transmission, while others detect the discrepancy and immediately cease without corrupting data. Message identifiers in Classical CAN (version 2.0) come in two formats: the standard 11-bit identifier, supporting 2048 unique values ranging from 0 to 2047, and the extended 29-bit identifier, accommodating up to 536,870,912 values from 0 to 2^{29}-1. These identifiers are transmitted as part of the arbitration field in data and remote frames, with the 11-bit format used in CAN 2.0A for compatibility and the 29-bit format introduced in CAN 2.0B to expand addressing capacity in larger networks. The identifier primarily encodes priority, with lower numerical values indicating higher priority to facilitate real-time applications, though higher-layer protocols may further assign IDs to denote source nodes, functional content, or specific data types—such as functional group IDs for broadcast messages versus specific IDs for targeted communication. In practice, ID allocation strategies prioritize deterministic access by reserving lower IDs for time-critical messages, such as engine control signals over less urgent diagnostics, while ensuring uniqueness within to avoid prolonged conflicts. For instance, if two nodes transmit identifiers 0x123 (binary 0010010011) and 0x124 (binary 0010010100) simultaneously, proceeds bit by bit until the fourth differing bit, where 0x123's dominant 0 overrides 0x124's recessive 1, allowing 0x123 to win without . Nodes that lose passively back off and retry transmission only when the bus becomes idle again, preserving the integrity of the winning message and preventing any corruption across . In CAN FD, the phase retains these same 11-bit and 29-bit identifier formats to maintain compatibility with Classical CAN systems.

Frame Spacing and Delimiters

In the Controller Area Network (CAN) protocol for Classical CAN (2.0), frame spacing and delimiters ensure reliable separation between transmissions, facilitating node and recovery on the shared bus. The interframe space (IFS) separates and remote frames from any preceding frame, consisting of an field of three consecutive recessive bits followed by a bus idle period of arbitrary length. This intermission provides nodes with processing time for the previous frame, and unlike data fields, it is not subject to to maintain fixed timing for bus recovery. Error or overload frames can extend the effective spacing by inserting additional recessive bits after the intermission. Delimiters within and at the end of frames further define boundaries to prevent misinterpretation of bit sequences. The end of frame (EOF) field, a sequence of seven recessive bits, marks the conclusion of data frames and remote frames, signaling to all nodes that the transmission has ended. Immediately preceding the EOF, the ACK delimiter—a single recessive bit—separates the acknowledgment slot from the rest of the frame, ensuring clear distinction during error-free receptions. Overload frames, used to postpone the next data or remote frame when a receiving node requires more recovery time, include an overload delimiter of eight recessive bits following the overload flag. This delimiter, like the error delimiter in error frames, helps restore bus equilibrium after disruptions. These spacing and delimiter mechanisms primarily serve to detect bus idle states, enabling oscillators in nodes to resynchronize and preparing the network for the next arbitration phase. Violations, such as the detection of a dominant bit during recessive-only fields like the intermission or delimiters, trigger error frame insertion to alert all nodes of the fault.

Frame and Message Formats

Data Frames

Data frames in the Controller Area Network (CAN) protocol serve as the primary mechanism for transmitting between nodes on the bus. In classical CAN, a data frame begins with a Start of Frame (SOF) field consisting of a single dominant bit, which synchronizes all receiving nodes. This is followed by the Identifier field, which is 11 bits long in the base format or 29 bits in the extended format, defining the message's priority and content type. The Remote Transmission Request (RTR) bit is set to dominant (0) in data frames to indicate that actual is being sent, distinguishing it from remote frames used to request . The Control field in classical CAN comprises 6 bits: 4 bits for the Data Length Code (DLC) and 2 reserved bits set to dominant. The DLC specifies the number of data bytes in the , ranging from 0 to 8; if fewer bytes are present, the field is padded with zeros to match the indicated length. The Data field itself carries 0 to 8 bytes (up to 64 bits) of , transmitted most significant bit first, typically used for readings, control commands, or status updates. This 8-byte limit in classical CAN constrains payloads to small, atomic packets, necessitating multiple frames for larger messages. Following the Data field is the (CRC) field of 15 bits plus a 1-bit recessive for detection, then the Acknowledgment (ACK) field with a 1-bit ACK slot and 1-bit recessive , where receivers confirm receipt by driving the slot dominant. The frame concludes with an End of Frame (EOF) of 7 recessive bits to signal completion. Data frames are broadcast to all nodes on the CAN bus, with each node filtering incoming messages based on the Identifier to accept only relevant ones, enabling efficient multimaster communication without address conflicts. Variants like CAN Flexible Data-rate (FD) extend the classical format while maintaining compatibility. In CAN FD, the DLC supports up to 64 bytes of data, and a Bit Rate Switch (BRS) bit in an 8-bit Control field (including EDL for extended data length and ESI for error state) triggers a higher bit rate (up to 8 Mbit/s or more) during the Data phase after arbitration, improving throughput for applications needing more payload without increasing bus load. CAN XL further advances this by allowing payloads up to 2048 bytes via an 11-bit DLC and additional fields like SDU Type and Virtual CAN Network ID, with the Data phase supporting rates up to 20 Mbit/s, facilitating integration of larger protocols such as Ethernet tunneling in automotive and industrial networks.

Remote Frames

Remote frames in the Controller Area Network (CAN) protocol serve as a mechanism for one node to request the transmission of a specific data frame from another node on the bus, facilitating a polled communication model where the requesting node explicitly solicits information rather than relying on spontaneous broadcasts. This legacy feature, defined in the ISO 11898-1 standard, allows for targeted in scenarios requiring deterministic responses, such as in certain control systems where a master node polls slaves for status updates. The structure of a remote frame closely mirrors that of a standard data frame but is distinguished by key modifications to indicate its request nature. It includes an identifier field (11-bit standard or 29-bit extended format) for addressing, followed by a recessive remote transmission request (RTR) bit set to 1, which differentiates it from data frames where the RTR bit is dominant (0). Unlike data frames, remote frames omit the actual field entirely, though the data length code (DLC) field specifies the expected length of the responding data frame to ensure compatibility. The frame concludes with a (CRC) sequence, acknowledgment slot, and end-of-frame delimiter, maintaining overall integrity. Upon transmission of a remote frame, the bus arbitration process—based on the identifier's priority—ensures it propagates if unopposed, after which an interframe space (IFS) of at least three recessive bits elapses before the targeted node responds. The receiving node, matched by the identifier (as detailed in message arbitration), then transmits a corresponding data frame with the same identifier but RTR=0, providing the requested payload. If multiple nodes claim the same identifier, the protocol's non-destructive arbitration resolves priority, though standard practice assigns unique identifiers to avoid conflicts. The requesting node must handle the response timing, typically within the bus's bit timing constraints, to maintain efficient polling cycles. In practice, remote frames are infrequently used in contemporary CAN implementations, which favor event-driven, producer-consumer models for efficiency in real-time applications like automotive and industrial automation. Their polling approach can introduce latency and bus overhead, making them suitable primarily for legacy systems or specific protocols requiring explicit , such as some early industrial control networks. With the evolution to CAN Flexible Data-rate (CAN FD) and CAN XL under extended ISO 11898 specifications, reliance on remote frames has diminished further, as these formats emphasize higher throughput and do not support RTR mechanisms, promoting asynchronous data transmission instead.

Error and Overload Frames

In the Controller Area Network (CAN) protocol, error frames and overload frames serve distinct purposes in maintaining bus integrity and managing transmission delays. Error frames are transmitted by any node upon detecting a transmission error, alerting all nodes on the bus to synchronize and abort the current frame, thereby enabling retransmission and fault isolation. Overload frames, in contrast, are deliberately initiated by a receiving node to impose a delay before accepting the next data or remote frame, typically due to temporary processing constraints such as buffer overflow. These frames ensure robust communication in noisy environments without requiring centralized error management. The frame consists of two fields: an flag followed by an delimiter. The flag is initiated as six consecutive dominant bits (active flag) by an error-active node or six recessive bits (passive flag) by an error-passive node; however, if multiple nodes detect the simultaneously, their flags superimpose, extending the effective to between 6 and 12 bits. This violation of the bit-stuffing rule—where no more than five identical bits are allowed consecutively—prompts all nodes to recognize the frame immediately. The delimiter then follows as eight recessive bits, providing a pause for recovery. frames are triggered by five primary detection mechanisms: bit , where a transmitting node monitors a mismatch between the sent and bus-received bit (except during or acknowledgment slots); stuff , arising from violations in the bit-stuffing process used for ; (CRC) , when the received CRC sequence does not match the calculated value; form , detected in fixed-format fields containing illegal bit levels; and acknowledgment (ACK) , where the transmitter observes no dominant bit in the ACK slot from any receiver. Similar in structure to the , the overload frame features an overload flag of six dominant bits—extendable to 12 bits via superposition from multiple nodes—and an overload delimiter of eight recessive bits. A node generates an overload frame either upon detecting a dominant bit during the period (the eight recessive bits separating frames) or due to internal delays requiring extra processing time before the next frame. To prevent bus congestion, a single node is limited to transmitting no more than two consecutive overload frames, though multiple nodes may contribute sequentially if conditions persist. Unlike , overload frames do not increment error counters and are not associated with fault detection. CAN nodes maintain two error counters to track reliability and enforce fault confinement: the Transmit Error Counter (TEC) and the Receive Error Counter (REC). These counters increment upon detection—typically by 8 for transmit-related issues or 1 for receive issues, with specific rules for certain conditions like acknowledgment errors—and decrement by 1 after successful frame handling, ensuring gradual recovery. Node operational states are determined by these counters: error-active (both TEC and REC below 128), where nodes fully participate and transmit active error flags; error-passive (either counter at or above 128 but TEC below 256), where nodes have reduced influence, transmitting passive error flags and observing an eight-bit suspend after any attempted transmission; and bus-off (TEC at or above 256), where the node disconnects from the bus entirely, disabling its drivers until recovery after 128 sequences of eleven consecutive recessive bits. This state-based mechanism confines faulty nodes, preventing them from overwhelming the bus while allowing reintegration upon stabilization. The transmission of an error or overload frame synchronizes all nodes, causing them to discard the interrupted frame and prepare for retransmission by the original sender after the required delimiters and interframe space. This process enhances fault tolerance by localizing error recovery and promoting bus-wide awareness, thereby improving overall system reliability in multi-node environments.

Acknowledgment and Bit Stuffing

In the Controller Area Network (CAN) protocol, the acknowledgment mechanism ensures that transmitted messages are successfully received by at least one node on the bus. The ACK field, located after the CRC sequence in a data or remote frame, consists of two bits: the ACK slot and the ACK delimiter. The transmitter sets the ACK slot to recessive (logical 1), while any receiver that has correctly received the message and verified the CRC overwrites this bit with a dominant (logical 0) during transmission monitoring. This dominant bit confirms receipt to all nodes, including the transmitter. If the transmitter monitors a recessive bit in the ACK slot, indicating no receiver has acknowledged the frame, it detects an acknowledgment error and initiates an error frame to alert the network. The ACK delimiter follows as a fixed recessive bit, providing a transition to separate the ACK field from the subsequent end-of-frame sequence and disabling bit stuffing in this segment. This mechanism relies on the multi-master nature of CAN, where multiple receivers can participate in acknowledgment without collision, as dominant bits prevail on the bus. Bit stuffing is a synchronization technique employed in CAN to prevent long sequences of identical bits from disrupting clock recovery in receiving nodes. During transmission, after five consecutive bits of the same polarity (dominant or recessive) in the start-of-frame, arbitration field, control field, data field, or CRC sequence, the transmitter automatically inserts an opposite bit (a "stuff bit"). This insertion occurs regardless of the data content, ensuring periodic signal transitions that allow receivers to resynchronize their oscillators without a separate clock line. Bit stuffing does not apply to the ACK field, end-of-frame, or interframe space, maintaining frame boundaries. Receivers perform destuffing by discarding the stuffed bit whenever they detect six consecutive identical bits, reconstructing the original bit stream for CRC validation and further processing. If a receiver encounters six identical bits in a stuffed field without a preceding five-bit sequence (indicating a missing stuff bit) or seven identical bits (due to improper stuffing), it detects a stuff and triggers an error frame. This process introduces protocol overhead, as stuffed bits increase the effective frame length, but it is essential for robust asynchronous communication; in the worst case, it can add up to one stuff bit for every five data bits, though average overhead depends on data patterns. also supports by providing synchronization edges during priority resolution.

Standards and Protocols

Core CAN Standards

The Controller Area Network (CAN) protocol is defined by a series of foundational standards developed by the International Organization for Standardization (ISO), the Society of Automotive Engineers (SAE), and other bodies, which specify the data link and physical layers for reliable serial communication in automotive and industrial applications. These standards ensure interoperability among electronic control units (ECUs) by mandating key features such as message framing, error detection via cyclic redundancy check (CRC), and arbitration mechanisms. The core specifications focus on the protocol's layered architecture, with the data link layer handling frame formats and access control, while physical layers address signaling and media attachment. The ISO 11898 series forms the backbone of CAN specifications. Part 1 outlines the , including classical CAN frame formats and the flexible data-rate () extension for higher payloads up to 64 bytes, with the 2024 edition incorporating CAN XL for even larger data frames up to 2048 bytes. Part 2 specifies the high-speed supporting transmission rates up to 1 Mbit/s for classical CAN, up to 8 Mbit/s for , and up to 20 Mbit/s for CAN XL, using a dominant-recessive signaling scheme on a twisted-pair medium. Part 3 specifies the low-speed, fault-tolerant for rates up to 125 kbit/s, suitable for applications requiring robustness against electrical faults. Part 4 addresses time-triggered communication for deterministic scheduling in safety-critical systems. These parts collectively ensure CAN's multi-master, operation without a central host. SAE J1939 builds on the ISO 11898 foundation for heavy-duty vehicles, such as trucks and buses, by defining a higher-layer protocol that uses parameter group numbers (PGNs) to structure messages for diagnostics, engine control, and powertrain data exchange. It employs 29-bit extended identifiers to support up to 8,192 unique PGNs, enabling standardized communication across vehicle subsystems. Additional standards include the CiA 300 series from CAN in Automation (CiA), where CiA DS-301 specifies basic device and communication profiles for embedded CAN implementations. The evolution of these standards began with the original ISO 11898 publication in 1993, establishing classical CAN at up to 1 Mbit/s. Subsequent amendments introduced in 2015 (ISO 11898-1:2015) for data rates up to 8 Mbit/s, and CAN XL was integrated into the 2024 editions of ISO 11898-1 and -2 to support payloads up to 2 KB and speeds beyond 10 Mbit/s. Compliance with core CAN standards requires mandatory implementation of CRC for error detection in every frame, ensuring across the bus. Optional conformance tests, as per ISO 16845, verify protocol adherence through static and dynamic assessments of transceivers and controllers.

Higher-Layer Protocol Extensions

Higher-layer protocols extend the core CAN bus to provide standardized communication frameworks for specific application domains, enabling efficient data exchange, configuration, and management in networked systems. These extensions build upon the physical and layers of CAN (ISO 11898) to support higher-level services such as object-oriented data mapping and device profiling, facilitating among devices from different manufacturers. CANopen, defined in the CiA 301 specification by CAN in Automation (CiA), serves as a widely adopted for industrial automation. It incorporates an object dictionary for device parameterization and supports real-time process data objects (PDOs) for cyclic transmission of control and status information, alongside service data objects (SDOs) for asynchronous configuration and diagnostics. This structure allows up to 127 nodes on a single network, with PDOs enabling efficient, low-latency exchanges of up to 8 bytes per message. DeviceNet, developed by the Open DeviceNet Vendors Association (ODVA), implements the (CIP) over CAN for factory automation and . It provides explicit messaging for device configuration and implicit I/O messaging for real-time control, supporting up to 64 nodes and baud rates of 125, 250, or 500 kbit/s. CIP's object model ensures vendor-independent integration of sensors, actuators, and controllers. SAE J1939 is a protocol suite tailored for heavy-duty vehicles, including trucks and agricultural tractors, utilizing CAN at 250 kbit/s for engine and powertrain communication. It employs parameter group numbers (PGNs) to identify message content and supports transport protocols like the Broadcast Announce Message (BAM) for transmitting large payloads exceeding 8 bytes, such as diagnostic data, by segmenting them into multi-packet sequences. This enables network-wide broadcasting without explicit addressing. CANopen Lift, specified in the CiA 417 series, addresses and systems by defining communication profiles for car drives, door controls, and safety chains. It extends with lift-specific objects for position feedback, emergency operations, and diagnostics, ensuring compliance with safety standards like EN 81-20 while supporting up to 127 devices in multi-car configurations. Additional extensions include gateways bridging CAN to other networks, such as LIN for low-cost sensor-actuator clusters in automotive body electronics, where a CAN-connected master ECU routes messages to reduce wiring complexity. bridging facilitates deterministic communication in high-performance chassis and powertrain applications, integrating CAN's flexibility with 's dual-channel redundancy. The () framework further integrates CAN interfaces into modular software architectures for automotive ECUs, promoting reusability across vehicle platforms via standardized runtime environments. Standardized higher-layer protocols encompass (CiA 301), , and (ODVA CIP), which dominate industrial and vehicular sectors due to their mature ecosystems and certification processes. Other notable extensions include SafetyCAN for functional safety in machinery per , providing error detection via redundant framing, and CANaerospace for , offering lightweight, time-triggered messaging for line-replaceable units in airborne systems.

Database and Configuration Files

The Database Container (DBC) file format, developed by Vector Informatik GmbH in the 1990s, is an ASCII-based standard for defining CAN bus message databases, enabling the mapping of raw CAN frames to meaningful signals and parameters. These files store communication-relevant data such as message identifiers, signal definitions, and scaling rules, facilitating decoding of binary CAN data into physical units like engine RPM or vehicle speed. DBC files are widely adopted in automotive and industrial applications for their simplicity as plain text, allowing easy editing with standard tools while supporting complex features like signal multiplexing. The core structure of a DBC file begins with a version declaration (e.g., VERSION "1.0"), followed by sections for network nodes (NS_), (BO_), and signals (SG_). The BO_ keyword defines a with its CAN ID, name, data length code (DLC), and sender node, as in:

BO_ 256 EngineData: 8 EngineECU

BO_ 256 EngineData: 8 EngineECU

This specifies a with identifier 0x100 (256 ), named "EngineData," 8 bytes long, transmitted by the "EngineECU" node. Signals within a are detailed using the SG_ keyword, which includes the signal name, start bit position, , length in bits, byte order (big- or little-endian), scaling factor, offset, value range, unit, and receivers. For instance:

SG_ RPM : 0|8@0+ (0.125,0) [0|8000] "rpm" EngineDisplay

SG_ RPM : 0|8@0+ (0.125,0) [0|8000] "rpm" EngineDisplay

Here, the "RPM" signal occupies bits 0-7 (starting from the least significant bit), is unsigned, scaled by a factor of 0.125 with no offset (yielding RPM = raw value × 0.125), and ranges from 0 to 8000 RPM. is supported via a signal (prefixed with M in SG_), allowing multiple signal sets within one message based on a mode selector, which is essential for optimizing bandwidth in resource-constrained systems. Additional sections like VAL_ for value tables and BA_ for attributes provide further customization, such as enumerations for discrete signals (e.g., gear positions). DBC files are integral to CAN development workflows, loaded into tools for simulation, real-time logging, and to interpret bus traffic without manual decoding. For example, Vector's and software use DBC files to generate virtual ECUs, monitor signal values, and automate testing scenarios, ensuring consistency across development teams. Their text-based nature supports version control systems like , enabling traceable changes in ECU configurations during iterative design. While DBC remains the de facto standard for CAN databases, alternatives exist for broader system integration. The AUTOSAR XML (ARXML) format, defined by the AUTOSAR consortium, provides a standardized XML schema for describing entire ECU networks, including CAN messages and signals, alongside other protocols like LIN and FlexRay. ARXML files support hierarchical system descriptions and are used in model-based development for generating runtime environments, offering greater interoperability in standardized automotive architectures compared to the simpler DBC. For extended CAN variants, DBC files have been adapted; Vector's CANdb++ tools support CAN FD (Flexible Data-rate) through extended DLC handling up to 64 bytes and specific attributes for the extended data phase, while CAN XL uses similar but enhanced DBC variants for even larger payloads. These adaptations maintain backward compatibility with classic CAN while accommodating higher data rates in modern vehicles.

Security Considerations

Protocol Vulnerabilities

The Controller Area Network (CAN) protocol, designed in the for reliable real-time communication in embedded systems, inherently lacks core features that are standard in modern networking protocols. This omission stems from its original focus on and efficiency in closed automotive environments, leaving it exposed to a range of attacks without built-in defenses. Key design flaws include the absence of mechanisms for verifying authenticity, protecting , or preventing unauthorized transmission, which collectively enable adversaries with bus access to disrupt or manipulate communications. A primary vulnerability is the lack of authentication in CAN messages, which provides no means to verify the sender's identity or ensure message integrity. Without authentication codes or digital signatures, any node connected to the bus can transmit frames impersonating legitimate electronic control units (ECUs), facilitating replay attacks where captured messages are resent to trigger unintended actions, such as unauthorized vehicle movements. This design choice, prioritizing low overhead for real-time performance, allows attackers to inject forged commands without detection by receiving nodes. The broadcast nature of the CAN bus exacerbates these risks, as all messages are transmitted to every node on without addressing or . This multi-access architecture, intended for efficient dissemination in resource-constrained systems, enables straightforward , where an attacker with physical or access can monitor all to extract sensitive like speed, braking status, or diagnostic . Unlike point-to-point protocols, CAN's open dissemination means no inherent filtering occurs at the receiver level, making passive trivial and amplifying the impact of active exploits. ID spoofing represents another critical flaw, exploiting CAN's priority-based arbitration mechanism where message identifiers (IDs) determine transmission order, with lower ID values gaining precedence. An attacker can forge frames with high-priority (low-numeric) IDs to dominate the bus, causing that starves lower-priority legitimate messages and delays critical operations like engine control or safety systems. This vulnerability arises because IDs serve dual roles as addresses and priorities without any validation, allowing a single malicious node to inject spoofed high-priority traffic and effectively monopolize bandwidth. Denial-of-service (DoS) attacks are facilitated by CAN's error handling and bit-level arbitration, which can be abused to lock the bus entirely. Attackers can flood the network with error frames—special transmissions triggered by detected faults—or continuously assert dominant bits (logical 0) during arbitration to override recessive bits (logical 1) from legitimate nodes, halting all communication. For instance, exploiting the error passive state and bus-off recovery mechanisms, a targeted attack can silence specific ECUs by rapidly increasing their transmit error counters, achieving suppression rates over 80% for critical modules like transmission control. Even a single attacker can reduce legitimate throughput to near zero by prioritizing dominant transmissions, rendering the bus unusable. The protocol's reliance on a shared physical medium without access controls heightens vulnerability to physical-layer intrusions. The unprotected twisted-pair wiring allows easy tapping via connectors like OBD-II ports or direct splicing, enabling attackers to inject malicious signals or monitor traffic undetected. This , optimized for simplicity and cost in harnesses, provides no or physical safeguards against such access, permitting bit-level manipulations like voltage-induced flips from dominant to recessive states through coordinated ECU collusion. Extensions like CAN with Flexible Data-rate (CAN FD) and CAN XL introduce further gaps by supporting larger payloads—up to 64 bytes in CAN FD and 2048 bytes in CAN XL—without incorporating encryption or authentication. These enhancements, aimed at increasing throughput to 10 Mbit/s or more, expand the attack surface by transmitting more data per frame, making injected or replayed payloads more damaging while retaining the core protocol's unencrypted broadcast model. The absence of built-in security in these variants leaves extended frames equally susceptible to eavesdropping, spoofing, and manipulation, potentially compromising larger datasets like sensor arrays or software updates.

Known Exploits and Attacks

One of the most notable exploits targeting the CAN bus occurred in 2015, when security researchers and Chris Valasek demonstrated a remote attack on a using the vehicle's Uconnect system. By exploiting vulnerabilities in the cellular connection and Sprint's network, the attackers gained access to the CAN bus, allowing them to manipulate the transmission, , and while the vehicle was in motion on a highway. This incident, which involved disabling the engine at 70 mph, highlighted the risks of unsegmented CAN networks in modern vehicles and led to the recall of 1.4 million vehicles. In 2018, researchers from the Dutch firm Computest uncovered remotely exploitable vulnerabilities in the systems of Sportback e-tron and GTE vehicles, enabling attackers to access the CAN bus via or cellular connections. The flaws allowed unauthorized control over the infotainment unit, potentially extending to vehicle functions like on conversations or tracking location through GPS data relayed over the bus. Although not directly tied to over-the-air (OTA) updates, the attack vector involved exposed ports that could facilitate similar infotainment compromises in connected models like the 2019 . Industrial applications of CAN bus, such as in programmable logic controllers (PLCs) via protocols like , are susceptible to injection attacks that can alter PLC behavior and disrupt production lines. These vulnerabilities highlight the protocol's risks in environments lacking authentication. Common attack vectors for CAN bus exploits include physical access through the OBD-II diagnostic port, which provides direct bus connection for message injection, and wireless gateways like or units that bridge external networks to the internal CAN without adequate isolation. Tools such as ICSim, an open-source instrument cluster simulator, have been used to replicate these attacks in controlled environments by emulating ECU responses and injecting crafted frames for testing purposes. These exploits have led to severe consequences, including risks such as loss of control or industrial , and data theft via intercepted diagnostic or location information transmitted over the bus. In response, regulatory bodies have implemented measures like the UNECE WP.29 regulations (UN R155 and R156), which mandate cybersecurity management systems for vehicles to address CAN-related vulnerabilities through and secure updates.

Mitigation Strategies and Architectures

Mitigation strategies for CAN bus security emphasize layered defenses that extend beyond the protocol's inherent limitations, incorporating intrusion detection, , , and zero-trust principles to protect automotive and industrial applications. These approaches, often integrated at higher layers or through specialized hardware, address vulnerabilities like unauthorized message injection by enabling real-time monitoring, data protection, and access controls. Architectures such as gateways and security modules facilitate isolation and verification, aligning with evolving standards to ensure resilience in connected environments. Intrusion detection systems (IDS) for CAN bus networks focus on monitoring traffic anomalies to identify potential attacks, such as deviations in message frequency or ID patterns that exceed normal operational baselines. For instance, machine learning-based IDS extract features like CAN ID, , and data bytes to detect flooding, fuzzy attacks, or impersonation, achieving detection accuracies up to 99.9% using algorithms on real-world datasets. These systems operate in real-time, often deployed as in-vehicle modules that alert on irregular payloads or timing, enhancing proactive threat response without disrupting bus performance. Encryption mechanisms provide and for CAN communications, particularly in advanced variants like CAN XL, where protocols such as CANsec implement MACsec-like features using with associated data (AEAD). CANsec employs symmetric keys, including a secure association key (SAK) derived via optimized key agreement protocols, to encrypt frames at line speed while protecting against replay attacks through packet numbers. In higher-layer extensions, protocols like CANcrypt utilize symmetric dynamic keys updated continuously, combined with message counters to form pseudo one-time pads for selective byte-level encryption and authentication across grouped devices. Network segmentation isolates critical CAN bus domains using gateways to limit attack propagation, separating high-security segments like powertrain controls from lower-risk ones such as comfort systems. Gateways act as intermediaries, filtering and routing messages based on predefined policies to prevent lateral movement from compromised infotainment networks to safety-critical ECUs. This architecture reduces the effective by enforcing domain-specific access, commonly implemented in modern vehicles to comply with cybersecurity frameworks. Zero-trust architecture (ZTA) adapts principles of continuous verification to CAN bus environments, requiring and for every message to eliminate implicit trust among ECUs. In automotive applications, ZTA incorporates micro-segmentation to divide the in-vehicle network into isolated zones, using policy decision points for dynamic trust evaluation and limiting lateral movement in case of compromise. This model, drawn from NIST SP 800-207, has been tailored for connected vehicles through 2024 implementations, such as blockchain-enhanced protocols that verify trajectory data and ECU registrations in real-time, improving accuracy in Internet of Vehicles scenarios. Standards like ISO/SAE 21434 guide cybersecurity engineering for CAN-based systems, mandating threat analysis and risk assessment (TARA) throughout the vehicle lifecycle to identify and mitigate bus-specific risks. The standard promotes firmware signing via secure processes, where digitally signed updates ensure authenticity during over-the-air deployments, incorporating mechanisms to prevent tampered code execution. Compliance involves integrating these practices into embedded , fostering auditable from concept to decommissioning. Best practices for CAN bus security include deploying hardware security modules (HSMs) to manage cryptographic operations, such as key storage and acceleration, within automotive ECUs. HSMs, as specialized processors in architectures, enable secure key generation and protect against physical attacks, supporting standards-compliant implementations in projects like EVITA for vehicular networks. Regular security audits, encompassing vulnerability assessments and penetration testing, ensure ongoing compliance and adaptation to emerging threats, with periodic reviews of and network configurations.

Development and Implementation

Hardware Tools and Interfaces

Hardware tools and interfaces for CAN bus systems enable physical connectivity, signal analysis, and debugging of networks in automotive, industrial, and embedded applications. These devices facilitate direct interaction with the bus, allowing engineers and technicians to monitor traffic, inject messages, and troubleshoot issues without disrupting the system. Common categories include adapters for computer integration, diagnostic scanners, signal analyzers, and breakout devices, each serving specific roles in development and workflows. USB-CAN adapters provide a straightforward bridge between personal computers and CAN networks, supporting both classical CAN and advanced variants like . For instance, the Kvaser Leaf series, such as the Leaf Light HS v2 OBD-II, connects via USB 2.0 and features a 16-pin OBD-II connector for easy access to diagnostics, offering and high-speed data rates up to 1 Mbps for standard CAN. These adapters are widely used for real-time monitoring and message transmission, with prices typically ranging from $200 to $900 depending on features like multi-channel support. OBD-II scanners serve as portable interfaces for vehicle-specific diagnostics, compliant with ISO 15765 standards that leverage CAN for (OBD). Devices like the OBDLink MX+ connect via or USB to read diagnostic trouble codes (DTCs), monitor live streams, and perform emissions testing on post-2008 vehicles using CAN protocols. These tools are essential for quick fault identification in automotive settings, often costing between $50 and $200 for consumer-grade models. For deeper analysis, oscilloscopes assess CAN signal integrity by visualizing voltage levels, rise times, and potential distortions on the differential bus lines, which operate at 2.0 to 3.3 V with strict eye diagram requirements. Models from manufacturers like Yokogawa, such as the DLM series, include built-in CAN decoding to correlate analog waveforms with protocol frames, aiding detection of issues like electromagnetic interference or termination faults. Logic analyzers, conversely, capture digital CAN frames at the bit level, decoding identifiers, data payloads, and error conditions across multiple channels for protocol-level debugging. Tools like those from Keysight or open-source options with CAN decoders enable timestamped logging of bus events, crucial for timing analysis in complex networks. Breakout boxes allow non-invasive tapping into CAN bus lines by providing accessible test points on OBD-II or DB9 connectors, enabling voltage measurements, signal , or inline monitoring without disconnecting components. The Power Probe PPECB, for example, tests CAN high/low lines for continuity and activity in 12-24 V systems, displaying protocol detection and voltage alarms to isolate wiring faults. These devices are particularly useful in field diagnostics, with costs around $100 to $300. Specialized interfaces like the PEAK-System PCAN-USB series cater to high-performance needs, supporting bit rates up to 8 Mbps and emerging CAN XL extensions with payloads up to 2048 bytes. The PCAN-USB FD variant offers dual-channel USB connectivity with 500 V isolation, ideal for industrial automation and advanced automotive prototyping. For even higher speeds, the PCAN-USB XL handles CAN XL networks at up to 20 Mbps, ensuring compatibility with next-generation in-vehicle communications. These professional tools range from $250 to over $1,000. In practice, these hardware tools support key use cases such as vehicle diagnostics to retrieve ECU data and clear codes, as well as of proprietary CAN messages in legacy systems. Overall costs for CAN hardware span from $50 for basic OBD scanners to $5,000 for integrated oscilloscope-logic analyzer setups, balancing accessibility with precision. They often pair with software for enhanced visualization, though the focus remains on physical interfacing.

Software Tools and Simulation

Software tools for CAN bus development enable engineers to simulate virtual networks, analyze protocol traffic, and configure communication parameters without relying on physical hardware. These tools support key features such as traffic generation for testing message flows, error injection to simulate fault conditions, and performance testing to evaluate latency and throughput in CAN environments. Commercial suites like Vector's and dominate the industry for their comprehensive simulation capabilities, while open-source alternatives provide accessible options for scripting and analysis, particularly in emerging applications like (EV) development as of 2025. CANoe from facilitates the creation of complete virtual CAN networks by automatically generating simulation environments from communication database descriptions, allowing developers to model ECU interactions and test higher-layer protocols. It supports traffic generation through scripted scenarios using the CAPL language, error injection for robustness testing (e.g., bit errors or bus-off conditions), and integration with / for co-simulation of control algorithms. complements this by focusing on real-time analysis and stimulation, enabling users to monitor CAN frames, filter signals based on identifiers, and inject stimuli to probe network behavior during development cycles. These tools are widely used in automotive OEMs for validating and Classic CAN setups, with performance testing features that measure metrics like bus load and response times under simulated loads. For open-source simulation, SocketCAN provides a Linux kernel-based framework for CAN protocol handling, including virtual CAN interfaces (vcan) that allow multiple processes to simulate a shared bus without hardware. Developers can create virtual networks by instantiating socket interfaces and linking them to emulate multi-node communication, supporting features like frame transmission and reception for testing applications in isolation. This is particularly useful for early-stage prototyping, where traffic can be generated via user-space tools like cansend and cansim to mimic real-world scenarios. Analysis tools emphasize packet capture and decoding to interpret CAN traffic. Wireshark, with its CAN-specific dissectors and extcap plugins, captures and displays CAN frames in real-time when connected via compatible interfaces, offering filters for identifiers, data payloads, and timestamps to aid in protocol issues. Plugins like those for USB-CAN adapters enable decoding of raw captures into human-readable formats, supporting extensions for protocols like or J1939. SavvyCAN serves as a dedicated open-source analyzer for , featuring graphical visualization of bus data, support for DBC file loading to decode signals into meaningful values (e.g., speed or temperature), and tools for filtering and exporting traces. It excels in offline analysis of logged data, making it suitable for post-capture review in resource-constrained environments. Configuration software streamlines the management of CAN network parameters and diagnostic descriptions. Vector's CANdelaStudio allows editing of ECU diagnostic specifications in a standardized format, facilitating the creation of database files that define message structures, signal mappings, and diagnostic services for CAN-based systems. It supports import/export of formats like ODX for integration with testing tools, ensuring consistency in vehicle network configurations. For AUTOSAR-compliant setups, tools such as Vector DaVinci Configurator and EB tresos Studio handle CAN interface parameterization, including baud rate selection, transceiver mappings, and runtime environment (RTE) generation to configure the across ECUs. These enable modular adaptation of CAN drivers to specific hardware, with validation checks for compliance to AUTOSAR specifications. Open-source libraries like python-can enhance scripting for CAN interactions, providing a Python interface to send, receive, and process messages across various backends, including SocketCAN and hardware adapters. It supports parsing for signal decoding and is popular in 2025 for EV prototyping, where scripts automate battery management simulations and testing in agile development workflows. The library's simplifies integration with data analysis frameworks like , enabling rapid iteration on CAN applications in research and startup environments.

Microcontroller Integration Techniques

Microcontroller integration of the Controller Area Network (CAN) typically involves either leveraging built-in hardware controllers for efficient protocol handling or employing software emulation techniques when hardware support is absent. Native integration utilizes dedicated CAN peripherals within the (MCU), which manage the protocol's timing, , and detection autonomously, reducing CPU overhead. In contrast, software-based approaches like bit-banging simulate CAN signaling using (GPIO) pins, suitable for resource-constrained systems or prototyping, though they demand precise timing control to meet protocol requirements. Many modern MCUs incorporate native CAN controllers, enabling direct bus interfacing without external chips. For instance, ' STM32 series features the bxCAN (basic extended CAN) or FDCAN (flexible data-rate CAN) peripherals, which support ISO 11898-1 compliant communication up to 1 Mbps for classical CAN and higher rates for . Similarly, offers the SJA1000 as a stand-alone CAN controller that integrates seamlessly with their MCU families, such as the LPC series, providing full protocol implementation including message buffering and acceptance filtering. These hardware modules handle the CAN frame transmission and reception, allowing the MCU to focus on application logic. Bit-banging implements CAN protocol in software by toggling GPIO pins to generate the differential signaling and bit timing, often used in MCUs lacking dedicated CAN hardware or for low-speed, non-critical applications. This method requires the MCU's or system to enforce the precise 1-bit time intervals (e.g., 1-25 μs at typical rates), making it challenging on slower processors due to synchronization demands. While feasible for testing or embedded systems with ample CPU cycles, bit-banging increases latency and power consumption compared to hardware solutions and is generally limited to rates below 500 kbps to avoid timing . Integrating a native CAN controller begins with initialization, where the MCU configures the peripheral's clock source, enables the interface, and sets the bit timing parameters to match the bus rate. Bit timing calculation involves programming the time segment lengths (, propagation, phase) based on the oscillator and desired speed, ensuring compliance with ISO 11898-2's sampling point (typically 75-80% of the bit time) for reliable and . Following initialization, interrupt handlers are set up for receive (RX) and transmit (TX) events; RX interrupts process incoming frames by reading message objects from the controller's FIFO or mailboxes, while TX interrupts confirm transmission status and manage retries for losses. interrupts monitor bus-off conditions, triggering recovery sequences like waiting for 11 consecutive recessive bits. Software libraries simplify CAN integration on supported MCUs, such as ' Layer (HAL) for the series, which provides high-level APIs like HAL_CAN_Init() for configuration and HAL_CAN_Transmit() for sending frames, abstracting register-level details. In real-time operating systems (RTOS) like , integrating CAN drivers introduces challenges such as ensuring interrupt priorities align with the RTOS scheduler to prevent task preemption during critical transmission windows, and using queues or semaphores for safe data exchange between interrupts and tasks. Interrupt-driven drivers are essential in RTOS environments to avoid polling, but misconfigured priorities can lead to missed frames or bus errors under high load. For advanced applications requiring high throughput, particularly with , (DMA) can be employed to offload data transfers between the CAN controller's buffers and system memory, minimizing CPU intervention during bursty traffic. In FDCAN implementations, DMA channels are configured to handle payload transfers up to 64 bytes per frame, supporting data rates exceeding 5 Mbps in the payload phase while maintaining classical arbitration speeds. counter management is crucial for robust operation; the CAN controller maintains transmit (TEC) and receive (REC) counters per ISO 11898-1, incrementing them on detected faults like bit or stuff , and transitioning states from error active (counters < 96) to error passive (> 127) or bus-off (> 255). Software must periodically read these counters via registers and implement recovery, such as reinitializing the controller after bus-off to rejoin the network.

References

Add your contribution
Related Hubs
User Avatar
No comments yet.