> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/rt-lab/configure-ios/communication-protocol-ios/can.md).

# CAN

## Introduction to CAN

Controller Area Network (CAN) is an international communication standard (ISO 11898) widely used for real‑time, distributed control systems, most notably in automotive, industrial automation, and embedded systems. It defines how multiple electronic control units (ECUs), sensors, and actuators communicate over a shared, robust serial bus without requiring a central host. CAN enables efficient, event‑driven data exchange with strong fault‑tolerance, making it well‑suited for environments with electrical noise and strict reliability requirements.

## Protocol characteristics

* **Multi‑master, message‑oriented architecture**\
  CAN uses a multi‑master architecture where any node on the bus may initiate transmission when the bus is idle. Instead of addressing devices directly, communication is message‑oriented: messages are broadcast to all nodes, and each node decides—based on message identifiers—whether the data is relevant. Arbitration ensures that the highest‑priority message is transmitted first without collisions, allowing deterministic access to the bus.
* **Identifier‑based data model**\
  All information in CAN is carried in frames identified by a unique message identifier (ID). The identifier defines both the meaning of the data and its priority on the bus. CAN supports standard (11‑bit) and extended (29‑bit) identifiers, enabling flexible system design. The data payload contains up to 8 bytes in Classical CAN (or up to 64 bytes in CAN FD), with interpretation entirely defined by higher‑level protocols or application conventions.
* **Function categories**\
  CAN supports several functional communication patterns, including periodic data transmission (e.g., sensor values), event‑driven messages (e.g., alarms or state changes), command and control signaling, and diagnostic communication. While CAN itself is application‑agnostic, standardized higher‑layer protocols such as CANopen, J1939, and ISO‑TP define consistent behaviors for device profiles, network management, diagnostics, and configuration.
* **Data link and physical layer characteristics**\
  CAN defines both the data link layer and the physical layer. Communication occurs over a differential two‑wire bus (CAN\_H and CAN\_L), providing high noise immunity. Frames include built‑in error detection mechanisms such as cyclic redundancy checks (CRC), frame checks, and acknowledgment bits. Automatic retransmission and fault confinement are handled by the protocol, ensuring robust communication even in harsh environments.
* **Reliability & latency considerations**\
  CAN is designed for high reliability and predictable timing. Non‑destructive bitwise arbitration guarantees that higher‑priority messages experience minimal latency. Error detection, retransmission, and node fault isolation contribute to dependable operation. While CAN provides bounded latency suitable for real‑time control, overall determinism depends on bus load, message prioritization, and network design.
* **Security model (protocol‑agnostic)**\
  The CAN protocol itself does not include authentication, encryption, or access control mechanisms. Security is therefore handled at the system level through physical bus protection, network segmentation, secure gateways, intrusion detection, or cryptographic measures implemented in higher‑layer protocols or application firmware.

## How the protocol works

* **Addressing and configuration**\
  A CAN network is configured by assigning message identifiers and defining their meaning, priority, and transmission conditions. Each node is programmed to transmit specific messages and to filter incoming messages based on identifiers. There is no inherent concept of device addresses; logical addressing and roles are established through identifier conventions and higher‑level protocol definitions.
* **Monitoring and control cycle**\
  In a typical CAN system, nodes periodically transmit status and measurement data while also sending event‑driven messages when state changes occur. Control nodes issue commands by transmitting messages with predefined identifiers. All nodes continuously monitor the bus, process relevant messages, and maintain synchronized system behavior through deterministic arbitration and acknowledgment mechanisms.
* **Data encoding**\
  CAN frames carry raw binary payloads whose structure and scaling are defined by the application or higher‑layer protocol. Signals such as measurements, states, counters, and commands are packed into bytes or bit fields according to predefined schemas. Time information, multi‑frame messages, and complex data types are handled by higher‑level protocols layered on top of CAN.

## Example applications

* **Automotive & Transportation**\
  Communication between ECUs for engine management, braking systems, body electronics, infotainment control, and diagnostics in cars, trucks, buses, and rail vehicles.
* **Industrial Automation**\
  Networking sensors, actuators, drives, and controllers in machines, production lines, and robotic systems where robustness and real‑time behavior are required.
* **Embedded & Real‑Time Systems**\
  Interconnecting microcontrollers and intelligent devices in embedded products such as medical equipment, elevators, and building automation systems.
* **Laboratory & HIL Systems**\
  Connecting simulated components and real controllers in hardware‑in‑the‑loop (HIL) environments for validation and testing of control algorithms.
* **Legacy system integration**\
  Serving as a stable and widely supported fieldbus for integrating existing embedded devices with newer control platforms via gateways or higher‑level industrial protocols.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/rt-lab/configure-ios/communication-protocol-ios/can.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
