New

Introducing Free Tier: Get Started with Cedalo MQTT Platform |Get Started

Back to Blog

CAN Bus Explained: Protocol Mechanics, Error Diagnosis, and IIoT Integration

Alex Reisler
Alex Reisler Published October 17, 2026 17 min read
Connected devices
CAN Bus Explained: Protocol Mechanics, Error Diagnosis, and IIoT Integration

The CAN bus protocol has connected ECUs in vehicles and machines for decades. Yet for many engineers, the gap between “I know CAN exists” and “I understand why my bus throws CRC errors at 70% load” remains surprisingly wide. Frame anatomy, arbitration, signal decoding, troubleshooting, and connecting CAN network data to modern IIoT architectures via MQTT are all covered here in the depth that practitioners actually need.

CAN Bus: Key takeaways

  • The CAN bus protocol uses priority-based, non-destructive bitwise arbitration. Among frames with different arbitration fields, the numerically lowest identifier wins the bus without destroying the winning frame.
  • For application-layer decoding, a raw CAN frame mainly provides an identifier and data bytes. DBC files, J1939 PGN/SPN tables, or CANopen object dictionaries transform this data into readable values like engine speed or coolant temperature.
  • CAN is bus-local by design and has no native path to cloud, SCADA, or analytics systems. A gateway that decodes CAN frames and publishes structured MQTT messages is a common architectural bridge.
  • Cedalo provides the enterprise MQTT infrastructure that makes CAN-derived IIoT pipelines production-ready, with clustering, TLS encryption, role-based access control, and native integrations into Kafka and major cloud platforms.

How Does a CAN Bus System Work?

The Controller Area Network (CAN) is a serial multi-master bus standard whose development started at Bosch in 1983 and was later standardized as ISO 11898. It was invented to reduce wiring and weight. Multiple nodes share a single differential two-wire medium, communicate without a central host, and resolve simultaneous transmissions through arbitration.

Every node connected to the CAN network monitors the bus continuously. When the bus is idle, any node can begin transmitting. If two nodes start simultaneously, the arbitration mechanism determines which message takes priority without either sender losing data.

Low-speed CAN, high-speed CAN, and CAN FD

ParameterLow-speed CANHigh-speed CANCAN FD
Max. nominal data rate125 kbit/s1 Mbit/s1 Mbit/s (arbitration phase)
Max. data phase rate125 kbit/s1 Mbit/sHigher than the arbitration phase; commonly 2–8 Mbit/s depending on the controller, transceiver, topology, and physical-layer design
Max. payload per frame8 bytes8 bytes64 bytes
StandardISO 11898-3ISO 11898-2ISO 11898-1:2024 includes Classical CAN, CAN FD, CAN FD Light, and CAN XL at the data-link/physical-coding level
Typical use caseAir conditioningAirbagADAS, high-bandwidth diagnostics
Classical CAN Data Frame: Simplified Field Anatomy

CAN Bus Protocol: Frame Structure and Identifier Logic

Every CAN message follows the same fixed frame structure, regardless of the application layer above it. The identifier field within that frame does two things at once. It labels the message and determines its priority on the bus. Understanding both is the foundation for reading bus traces, writing DBC mappings, and diagnosing frame-level errors.

What Does Each Field in a CAN Frame Do?

A simplified Classical CAN data frame can be described through these functional fields:

  • SOF (Start of Frame): One dominant bit that synchronizes all nodes to the beginning of a new transmission.
  • Arbitration field: Contains the identifier and RTR bit. The identifier is 11 bits in the base frame format or 29 bits in the extended frame format. A lower numerical value means higher bus priority.
  • Control field: Contains format/reserved bits and the DLC. In Classical CAN, the DLC indicates 0 to 8 payload bytes.
  • Data field: Zero to eight bytes of application payload. The content has no meaning without a higher-layer decoding definition.
  • CRC field: A 15-bit cyclic redundancy check plus CRC delimiter, used to detect transmission errors.
  • ACK field: ACK slot and ACK delimiter. Any node that receives the frame correctly pulls the ACK slot dominant, confirming reception. If the sender reads a recessive ACK slot, it raises an ACK error.
  • EOF (End of Frame): Seven consecutive recessive bits, signaling the end of the frame.

How Does CAN Bus Arbitration Prevent Collisions?

Arbitration on the CAN bus works through simultaneous bit-by-bit comparison across all transmitting nodes. A dominant bit (logical 0) always overrides a recessive bit (logical 1) on the shared wire. The first node that sends a recessive bit but reads back a dominant bit recognizes that another node holds higher priority, stops transmitting immediately, and waits.

The winning node continues without data loss or retransmission. This non-destructive bitwise arbitration is why CAN handles multiple nodes without collision overhead. Frames with low identifier values always transmit first, which means bus loads above 70–80% can cause significant queuing delays for lower-priority messages.

Does Differential Signaling Make the CAN Bus Electrical Layer Resistant to Interference?

The CAN bus electrical layer transmits data over a differential pair, CAN_H (CAN High) and CAN_L (CAN Low). Receivers evaluate only the voltage difference between the two wires, not their absolute levels. This common-mode rejection makes the CAN interface ideal for electromagnetically noisy environments such as factory floors, engine compartments, and high-voltage battery systems.

CAN Bus Electrical Layer

Voltage levels in practice:

StateCAN_HCAN_LDifferential voltage
Dominant (logic 0)~3.5 V~1.5 V~2.0 V
Recessive (logic 1)~2.5 V~2.5 V~0 V

The 120 ohm termination resistors at both physical ends of the bus match the cable’s characteristic impedance and prevent signal reflections. A missing terminator at one or both ends is one of the most common CAN bus electrical faults: the bus appears functional under low message load but degrades under high traffic as reflected signals corrupt frames.

Typical CAN bus electrical faults and their effects:

FaultSymptom
Swapped CAN_H and CAN_LNo or unstable communication; frequent errors due to inverted differential signaling
Missing termination at one endIntermittent CRC errors under high load
Missing termination at both endsSevere reflections, frequent error frames
Excessive stub lengthFrame corruption at higher baud rates
Missing ground reference between nodesShifted common-mode voltage, reduced noise margin

Step 1: Check termination. Power down the bus and measure resistance between CAN_H and CAN_L. Expected: ~60 ohm with two 120 ohm terminators in parallel. Deviations indicate missing, duplicate, or misplaced termination.

Step 2: Verify bit rate and timing. A node with a mismatched bit rate or incompatible timing can cause CRC, form, stuff, or ACK errors. Use a CAN analyzer or oscilloscope to confirm matching bit rate and compatible sample points.

Step 3: Measure bus load. Connect a CAN analyzer and observe utilization as a percentage. Sustained load above 80% causes queuing delays and can lead to missed timing requirements. Error-passive transitions require actual transmission or reception errors. If the load is excessive, review message scheduling or consider a higher baud rate.

Step 4: Locate error frames. A CAN analyzer or oscilloscope with CAN decoding can correlate error frames with nearby traffic and likely affected nodes, although error frames themselves do not carry normal message IDs. This narrows the fault location to a specific ECU or cable segment.

Step 5: Validate signal decoding. If communication runs but process values appear implausible, compare the DBC or J1939 mapping against the actual payload bytes. Byte order (Intel vs. Motorola), start bit, and scaling factor are frequent sources of decoding errors that produce physically impossible values.

Does a Raw CAN Frame Contain Enough Information for ECUs to Decode Network Data Directly?

A raw CAN frame contains only an identifier and a sequence of bytes, which carry no inherent meaning on their own. A decoding layer that maps payload bits to physical signals with units and scaling is what turns a frame into readable data.

DBC files, commonly used CAN database files, are the standard format for this mapping in automotive development. A DBC file defines which bits in a frame’s payload correspond to which signal, along with the scaling factor, offset, unit, and valid value range. A frame with ID 0x0CF00400 and two payload bytes might encode engine speed across bits 24 to 39 with a factor of 0.125 rpm/bit.

Higher-layer protocols that add standardized signal definitions:

  • J1939 (heavy-duty vehicles and construction machinery): Groups signals into Parameter Group Numbers (PGN). Individual signals within each PGN are identified by Suspect Parameter Numbers (SPN). Teams integrating truck telematics or agricultural equipment start with standardized J1939 PGN/SPN definitions; proprietary signals may still require OEM or vehicle-specific documentation.
  • CANopen (industrial automation): Uses an object dictionary with index and sub-index addressing. Process Data Objects (PDO) carry cyclic or event-driven process values. Service Data Objects (SDO) handle configuration and parameterization.
  • OBD-II (passenger vehicles): Standardized Parameter IDs (PIDs) accessible over CAN, readable by compliant scan tools when the vehicle supports the requested PID.

Regardless of the higher-layer protocol, the transformation from raw CAN frame to interpretable value is the step that separates bus monitoring from actionable data. Without correct decoding, engine_rpm, coolant_temperature, or state_of_charge remain unreadable byte sequences.

CAN Bus Errors: Types and Node States

Every CAN node tracks transmission and reception errors internally. When error counts cross defined thresholds, the node changes its behavior on the bus, up to the point where it disconnects entirely. Understanding which error types exist and how nodes respond to them separates a structured troubleshooting approach from trial and error.

What Are the Five CAN Error Types?

Error TypeDetection MechanismTypical Root Cause
Bit ErrorThe sender reads back a different bit than transmitted, except during arbitration and the ACK slotBus short, wiring fault, transceiver issue, or severe interference
Stuff ErrorMore than 5 identical consecutive bits on the busBit stuffing rule violated, corrupted frame
CRC ErrorThe receiver’s calculated CRC mismatches the received CRCTransmission noise, baud rate mismatch
Form ErrorFixed-format field contains an illegal bit valueCorrupted EOF or ACK delimiter
ACK ErrorThe transmitter reads recessive ACK slot after transmissionNo active receivers, missing termination

Any node that detects an error sends an error flag followed by an error delimiter. This sequence signals all other nodes to discard the current frame.

What Are the CAN Node Error States?

Each CAN node maintains two internal counters: the Transmit Error Counter (TEC) and the Receive Error Counter (REC). These counters determine the node’s participation state on the CAN network:

  • Error Active (TEC and REC below 128): Normal operating state. The node participates fully and sends active error flags to signal faults to other nodes.
  • Error Passive (TEC or REC ≥ 128, while TEC < 256): The node remains on the bus but sends passive error flags and observes additional delay rules before retrying.
  • Bus-Off (TEC ≥ 256): The node stops transmitting and no longer participates in normal bus communication. Recovery depends on controller configuration and software handling, typically after 128 occurrences of 11 consecutive recessive bits.

A node that repeatedly reaches the Bus-Off state is a primary diagnostic target. It points to a serious hardware fault, incorrect baud rate, or persistent interference on the bus segment serving that node.

How Does CAN Bus Data Reach IIoT and Cloud Systems via MQTT?

CAN is a bus-local protocol. It operates within a vehicle harness or a machine control cabinet, without IP addressing, without cloud connectivity, and without the topic-based message routing that IIoT architectures depend on. Raw CAN frames cannot route themselves to a SCADA system, a cloud analytics platform, or a fleet monitoring dashboard.

Connecting CAN data to IIoT systems requires an explicit translation step. A gateway or edge service reads frames from the CAN interface, decodes the raw payload into named signals using DBC, J1939, or CANopen definitions, normalizes the result into a structured payload, and publishes it to an MQTT broker. This produces a clean three-layer architecture:

  • CAN layer: Deterministic, bus-local ECU communication within the vehicle or machine
  • Gateway/Edge layer: Frame reading, signal decoding, timestamp assignment, payload normalization
  • MQTT/Broker layer: Scalable, authenticated distribution to cloud, SCADA, analytics, and enterprise systems
CAN Bus to IIoT: Three-Layer Architecture

How Do Node-RED and Edge Gateways Bridge CAN to MQTT?

For a software-defined approach on Linux-based edge hardware, Node-RED with SocketCAN-compatible nodes such as node-red-contrib-canbus can read CAN frames via SocketCAN and publish decoded signal values to the broker via the MQTT output node.

A practical integration walkthrough for connecting Node-RED with an enterprise MQTT broker is available in the Cedalo Node-RED and MQTT Broker Guide. The same publish pattern applies to microcontroller-based CAN readers: Arduino MQTT setups and ESP32 MQTT configurations follow identical topic-publish logic once CAN data is locally available.

Note

For deployments where Linux-based edge software is not practical, industrial hardware gateways can translate CAN, CANopen, or other fieldbus data to MQTT or OPC UA output, depending on the specific vendor and model. Softing and Cedalo address industrial MQTT and OPC UA integration patterns in a joint technical webinar (German language).

How Should CAN Data Be Structured as MQTT Topics and Payloads?

A consistent topic hierarchy makes CAN-derived data accessible to multiple consumers without custom integration per system. A useful pattern follows the physical hierarchy of the installation:

factory/line1/machine3/can/engine_rpm
factory/line1/machine3/can/coolant_temperature
vehicle/fleet/truck42/j1939/state_of_charge

Each MQTT message carries a structured JSON payload that includes the signal name, decoded value, physical unit, and a UTC timestamp:

{
  "signal": "engine_rpm",
  "value": 1450,
  "unit": "rpm",
  "timestamp": "2025-04-01T08:23:14.321Z"
}

QoS selection for CAN-derived data:

Use CaseRecommended QoSReason
High-frequency telemetry (rpm, temperature)QoS 0 or QoS 1Latest value matters more than delivery confirmation; occasional duplicates are acceptable at QoS 1
Critical state changes (fault codes, selected alarm signals)QoS 1, or QoS 2 when system design justifies itDepends on duplication tolerance, latency budget, and system design
Last known value for new subscribersRetained message (any QoS)Consumer gets the current state on connect

What Does an Enterprise MQTT Broker Add to CAN-Based IIoT Pipelines?

Once CAN data arrives as structured MQTT messages, the broker layer determines whether the pipeline is production-ready or a prototype. Four capabilities make the difference in practice.

Security covers TLS and mutual TLS encryption between gateways and the broker, role-based access control for topic-level permissions, and audit trails for connections and permission changes. In regulated industries such as automotive or energy, this traceability is often required by regulation, customer requirements, or internal compliance policies.

High availability through clustering helps remove single points of failure. Automated failover can keep data flowing when a node goes offline while reducing manual intervention and message loss when QoS, persistence, and queue settings are configured appropriately.

Observability gives teams real-time visibility into throughput per topic, client states, and message latency. Metrics export to Prometheus or InfluxDB fits into existing monitoring infrastructure.

Enterprise integrations route CAN-derived MQTT data directly to databases and cloud platforms without custom middleware, streaming pipelines via MQTT-to-Kafka integration, and cloud platforms, including AWS, Azure, and Google Cloud without custom middleware.

These four capabilities are what separate a functional proof of concept from infrastructure that holds up in production. The right broker choice at this layer determines how far a CAN-based IIoT architecture can scale.

How Teams Turn CAN Bus Data into Actionable IIoT Intelligence

CAN bus reliably handles fast, deterministic communication between controllers and sensors. The real challenge begins when that data needs to reach cloud systems, analytics platforms, or SCADA environments. That step requires a protocol bridge, a structured MQTT topic design, and broker infrastructure that holds up under production conditions.

Your Advantages with Cedalo:

  • Enterprise MQTT infrastructure built on Eclipse Mosquitto, a widely deployed open-source MQTT broker used across many installations
  • Clustering and automated failover help keep CAN-derived data flowing with reduced interruption risk when individual nodes go offline
  • Granular access control, TLS encryption, and audit trails help meet compliance requirements in regulated industries
  • Available integrations with Kafka, major cloud platforms, and selected operational systems help turn decoded CAN data into actionable insights across the organization

Turn Your CAN Bus Data into Actionable IIoT Intelligence

Cedalo moves CAN-derived machine data from bus level to cloud, analytics, and enterprise systems. Secure, scalable, and based on open protocols such as MQTT.

CAN Bus: Frequently Asked Questions

How Many Nodes Can a CAN Bus Support?

The CAN specification does not define a fixed node limit, but physical layer constraints typically cap practical deployments at 32 to 110 nodes, depending on transceiver type and bus length. Adding nodes increases bus capacitance, which degrades signal integrity and limits the maximum achievable baud rate.

Does Bus Length Affect the Maximum Baud Rate on a CAN Network?

Yes, there is a direct trade-off between bus length and bit rate on a CAN network. At 1 Mbit/s, the commonly recommended maximum bus length is about 40 meters, while 125 kbit/s can support up to roughly 500 meters under suitable physical-layer conditions. Signal propagation delay, topology, transceivers, and cable quality all affect the practical limit.

Is the CAN Bus Protocol Secure Against Unauthorized Access?

CAN has no native authentication or encryption, which makes it vulnerable to spoofing and replay attacks when physical access to the bus is possible. In automotive cybersecurity, ISO/SAE 21434 addresses this at the system level, while industrial environments typically rely on physical access controls and network segmentation.

What Is the Difference Between CANopen and J1939?

Both are higher-layer protocols built on CAN, but they target different industries. CANopen is common in industrial automation and uses an object dictionary for device parameterization, while J1939 is the standard for heavy-duty vehicles and organizes data into PGNs and SPNs. The two are not interoperable at the application layer.

How Does Cedalo Handle CAN-Derived Data Across Multiple Sites?

Cedalo’s clustered MQTT infrastructure distributes CAN-derived data across multiple broker nodes, which helps reduce single points of failure and can keep data flowing when individual nodes become unavailable. Teams managing CAN networks across several plants or vehicle fleets can route decoded signal data through one centrally managed MQTT layer with consistent topic structures and access policies.

Can Cedalo Integrate CAN Bus Data with Existing SCADA and ERP Systems?

Cedalo can connect CAN-derived MQTT data to Kafka pipelines and cloud platforms, including AWS, Azure, and Google Cloud through available integrations. Depending on the target SCADA or ERP system, custom middleware may be reduced or avoided, which can lower integration effort on both the OT and IT side.

About the author

Alex Reisler

Alex Reisler

Software Developer at Cedalo

Alex Reisler is a software developer at Cedalo with a strong focus on low-level and embedded technology. Their work centers on connected devices and the systems that tie them together, from firmware and constrained hardware up to the MQTT layer that moves the data.

An avid tech enthusiast, Alex spends their free time building connected devices, digging into embedded systems, and experimenting with hardware hacking, hands-on experience that shapes how they think about reliable, resource-aware IoT integration.