Protocols

CAN bus

CAN bus (Controller Area Network) is a two-wire network that lets the control units in a car, tractor or machine share short messages, with priority set by each message's identifier and no central computer.

Blue and grey network cables plugged into a patch panel

Photo: Jordan Harrison / Unsplash

CAN bus, short for Controller Area Network, is the wired network that lets the electronic control units of a vehicle talk to each other: engine, brakes, steering, airbags, dashboard. Each unit is an embedded system on the same pair of wires: it sends short messages labeled with an identifier, listens to all the others, and no central computer runs the conversation. Bosch presented CAN at the SAE (Society of Automotive Engineers) congress in February 1986, and Mercedes-Benz has used it in its upper-class cars since 1991, according to CAN in Automation (CiA), the industry association for CAN. It also links tractors to implements, industrial machines and the motors of robots.

What is CAN bus in a car?

It is the car’s internal network for control data. Instead of a wire from every sensor to every unit that needs its reading, each control unit puts its data on the shared bus once and every other unit can use it: the wheel-speed reading matters to the anti-lock brakes, the stability control and the speedometer alike. That saves wiring and weight.

A modern car usually has several CAN networks for different groups of functions, and many designs join them through a gateway unit that passes on only selected messages. The diagnostic socket under the dashboard, the OBD (on-board diagnostics) port, lets mechanics and plug-in dongles read fault codes and other data.

How does CAN bus work?

Every unit is connected to two wires, called CAN high and CAN low, and reads the difference in voltage between them, so electrical noise that hits both wires equally cancels out. Four rules make the system work.

  • Messages, not addresses. A frame carries an identifier that names its content, such as “engine speed”, not a destination. Every unit receives every frame and keeps the ones it needs, which CiA calls broadcast communication.
  • Priority by identifier. When two units start sending at the same moment, they compare identifiers bit by bit, and “the lowest value has the highest priority”. The loser stops, becomes a receiver and tries again once the bus is free. The winning message goes through undamaged, so urgent messages get low identifiers.
  • Short frames. A Classical CAN frame carries zero to eight bytes of data.
  • Built-in error checks. The protocol uses five error detection mechanisms, and a unit that keeps causing errors ends up switching itself off the bus.

CiA’s page notes that this data link layer is standardized in ISO 11898-1 and the most used physical layer in ISO 11898-2.

What are CAN FD and CAN XL?

They are the second and third generations of CAN, built for more data. CiA says CAN FD (flexible data rate) overcomes two limits of Classical CAN: its top speed of 1 Mbit/s (one million bits per second) and its payload of 8 bytes per frame. Bosch started developing it in 2011. A CAN FD frame carries up to 64 bytes: it settles priority at up to 1 Mbit/s, then switches to a faster rate for the data, limited by the transceivers, the chips that drive the wires.

CAN XL, which CiA started developing at the end of 2018, carries from 1 to 2,048 bytes per frame and allows bit rates of 20 Mbit/s and higher with suitable transceivers. According to CiA, all three generations are now specified in ISO 11898-1:2024.

Where is CAN bus used besides cars?

In trucks, farm machinery, factory equipment and robots, wherever several controllers in one machine need a robust, low-cost network.

  • Trucks and buses use SAE J1939, a CAN-based protocol defined by committees of the SAE, as CiA’s history page notes.
  • Farm machinery uses ISOBUS, the common name of ISO 11783, the standard for communication between agricultural machines. CiA’s history describes ISO 11783 as a CAN-based application profile built on the J1939 approach. The Agricultural Industry Electronics Foundation (AEF) gives the goal as “plug and play” with any tractor, terminal and implement, and writes extra guidelines because in practice this “is not quite that easy”. The data feeds precision agriculture.
  • Industry uses CANopen, a CAN-based communication system whose application layer is CiA 301. It started in machine control and now also appears in medical equipment, ships and railways.
  • Robots often drive their motors over CAN. CiA 402 is the CANopen profile for drives and motion control; maxon, a maker of motors and drives, offers EPOS4 controllers built to fit into robot joints and wheel drives, and says multi-axis systems with them can be built over CANopen or EtherCAT. Linux supports CAN through SocketCAN, which treats each CAN interface as a network interface.

How does CAN connect to telematics and the connected car?

CAN stays inside the vehicle; it has no internet link of its own. A telematics unit, or the modem of a connected car, reads selected CAN messages, such as fuel level, distance driven or fault codes, and sends them over the mobile network to a fleet platform or the maker’s cloud; plug-in OBD dongles do the same through the diagnostic socket. IoT in logistics shows how fleets use this data. Over-the-air software updates can take the opposite path, from the modem to each control unit. That bridge between the internet and the bus is where security matters most.

Is CAN bus secure?

Not on its own. CAN was designed for a closed network of trusted units: a frame names its content, not its sender, and carries no proof of who sent it, so any unit on the bus can send any message and the others have no built-in way to tell a forged message from a genuine one.

In 2015 the researchers Charlie Miller and Chris Valasek showed that they could reach the entertainment head unit of a 2014 Jeep Cherokee over the Sprint mobile network and, from there, send CAN messages that affected physical functions of the car. On 23 July 2015 Fiat Chrysler launched a recall of about 1.4 million vehicles to fix the flaws, according to the U.S. road safety agency NHTSA.

The defenses are layered. Gateways can keep the infotainment and telematics side apart from the safety-critical buses, a form of network segmentation. Message authentication can be added on top of CAN, for example with Secure Onboard Communication (SecOC), specified by AUTOSAR, a partnership of automotive and software companies. It attaches a message authentication code, a short value computed with a secret key, so that receivers can reject forged messages. For CAN XL, CiA is developing CANsec, an optional security protocol in CiA 613-2. For an IoT project, the practical rule is to read from CAN through a gateway that cannot write to it unless control is truly needed.

Part of the IoT Glossary. Spotted an error or a missing term? Tell us.