Features

CAN, LIN and FlexRay Car Networks Compared on Speed, Cost and Use

Three networks, three price points: why a modern car needs CAN, LIN and FlexRay at once, and what each one carries.

FeaturesBy 10 min read
The short answer

CAN is the general-purpose bus linking a car's control units by priority-based messaging, LIN is a cheaper single-wire network up to 19.2 kbit/s for simple jobs, and FlexRay is a faster, costlier 10 Mbit/s bus with two channels. Cars use them together in a hierarchy.

A modern car can carry as many as 70 electronic control units, and most of them talk over a wiring idea Bosch started work on in 1983 to save copper. The Mercedes-Benz W140 of 1991 was the first production car to use it, and the controller area network, or CAN bus, later became one of the protocols behind on-board diagnostics too.

CAN is not alone. A cheaper network called LIN handles the humble jobs such as mirrors and climate control, while a faster and costlier one called FlexRay went into a long list of premium cars. Together they explain why one car holds several networks, and what each costs and delivers.

What is a CAN bus?

A controller area network is a vehicle bus standard that lets microcontrollers and devices communicate. It is message-based and was designed for multiplex wiring in cars, so that one pair of wires could do the work of many separate runs of copper.

Its central trick is how it handles two devices speaking at the same moment. Every frame is sent serially, and if more than one device transmits at once, the one with the highest priority carries on while the others back off. Every device on the bus, the sender included, receives each frame.

The need is plain once you count the computers. The engine control unit is usually the biggest, but there are others for transmission, airbags, anti-lock braking, cruise control, electric power steering, audio, windows, doors, mirrors, driver assistance and, in hybrids and electric cars, battery and charging systems. Some work alone. Many must share information, and a subsystem may need to drive actuators or read sensors elsewhere in the car.

Three-tier car network: FlexRay fastest and dearest, a CAN backbone linking control units, and LIN clusters for simple jobsThree-tier structureFlexRay: up to 10 Mbit/sHighest costEngine control unitTransmissionAirbagsCAN backboneLIN: up to 19.2 kbit/sPrimary nodeSecondary nodesLowest costMirrors and air conditioning
A car uses three networks: LIN clusters hang off a CAN backbone for simple jobs, while FlexRay is the fastest and costliest.
One sensor, many systems, and far less copper.

Why CAN made new features possible

Once systems share a network, features can be added in software alone, where hard-wiring them would add cost and complexity. A few examples show the idea.

  • Auto start/stop gathers speed, steering angle, air conditioning status and engine temperature over the CAN bus to decide whether the engine may shut down at a standstill.
  • An electric park brake with hill hold uses the tilt sensor (shared with the burglar alarm) and the road speed sensors that also serve the ABS, engine control and traction control. Seat belt sensors from the airbag system tell it the belts are fastened, so the brake lets go automatically when the car moves off.
  • Parking assist starts when reverse is selected: the transmission control unit signals the parking sensors and the passenger door mirror, which tilts down to show the kerb. The rain sensor can trigger the rear wiper at the same time.
  • Lane assist and collision avoidance take proximity data from the parking sensors, and more recently these signals travel the bus to apply the brakes electronically in active collision avoidance.
  • Auto brake wiping uses the rain sensor, via the bus, to ask the ABS module for a barely noticeable brake application that clears moisture from the rotors. Some high-performance Audi and BMW models include it.

A shared bus also lets a sensor sit wherever it works best. An outdoor temperature sensor, conventionally mounted at the front, can live in a door mirror away from engine heat, and its reading then serves the engine, the climate control and the driver display.

The history of CAN

Bosch began developing CAN in 1983, and the protocol made its official debut in 1986 at a Society of Automotive Engineers conference in Detroit. Intel introduced the first controller chips in 1987, with Philips close behind. The Mercedes-Benz W140, released in 1991, became the first production vehicle with a CAN-based multiplex wiring system.

Bosch's latest CAN specification, CAN 2.0, also dates from 1991. It has two parts: A, the standard format with an 11-bit identifier, and B, the extended format with a 29-bit one. Devices are commonly labelled CAN 2.0A or 2.0B accordingly, and the documents are freely available from Bosch.

The International Organization for Standardization released ISO 11898 in 1993. It was later split in two: ISO 11898-1 covers the data link layer and ISO 11898-2 the physical layer for high-speed CAN. A third part, ISO 11898-3, followed for low-speed CAN that tolerates faults. Neither physical layer standard belongs to Bosch's own specification.

In 2012 Bosch released CAN FD 1.0, short for flexible data-rate. Its frame format differs, allowing other data lengths and, optionally, a faster bit rate once arbitration is settled. New CAN FD devices can share a network with existing CAN 2.0 devices, because the older communication parameters still apply. As of 2018 Bosch was still active in extending the CAN standards.

CAN is also among the five protocols of the on-board diagnostics standard, OBD-II, which every car and light truck sold in the United States has had to follow since model year 1996. Europe's version, EOBD, applies to petrol cars sold in the European Union from 2001 and to diesels from 2004.

How CAN is wired

The wiring side is looser than most people expect. The electrical layer is specified in ISO 11898-2:2003, but the mechanical side, meaning connector type, colours, labels and pin-outs, has never been formally laid down. A typical ECU therefore has its own, often custom, connector. A 9-pin D-sub plug has emerged as the most common de facto standard, with CAN-Low on pin 2, ground on pin 3, CAN-High on pin 7 and power on pin 9.

The freedom has a cost. The missing specification kept the standard simple but left room for mechanical incompatibility, so many vehicle makers publish their own lists of permitted transceivers, along with limits on parasitic capacitance. Voltage differs between vehicle types too: during a jump start, lines in a light vehicle can reach 24V while truck systems can reach 36V.

Noise immunity comes from keeping the differential impedance of the bus low, using 120 ohm resistors at each end. The price is that a quiet bus draws more current than other voltage-based buses. Best practice carries the balanced signals on twisted pairs in a shielded cable, which cuts radio emissions and interference in the already noisy surroundings of a car. In the dominant state a transmitter pulls CAN-Low to 0 V and CAN-High to +5 V, and the terminating resistors form an essential part of that signalling, not just a guard against reflections.

What is a LIN bus?

LIN, the Local Interconnect Network, is a low-cost, single-wire serial protocol that supports communication up to 19.2 kbit/s over a bus of up to 40 metres (131.23 ft). The LIN specification 2.2 allows speeds up to 20 kbit/s.

It exists because CAN was too expensive to fit to every component as cars filled with features. European makers had begun to use different cheap serial technologies of their own, which caused compatibility problems. In the late 1990s five automakers, BMW, the Volkswagen Group, Audi, Volvo Cars and Mercedes-Benz, founded the LIN Consortium, with Volcano Automotive Group and Motorola supplying the networking and hardware know-how. Version 1.3, the first fully implemented specification, was published in November 2002, and version 2.0 followed in September 2003 with extra configuration and diagnostics features.

How does LIN differ from CAN?

FeatureLINCANFlexRay
RoleNon-critical subsystems such as air conditioning and infotainmentBackbone linking most ECUsFast, fault-tolerant links for demanding systems such as adaptive damping
CostLowestHigher than LINHighest, more expensive than CAN
SpeedUp to 19.2 kbit/s (20 kbit/s in version 2.2)Faster than LIN, slower than FlexRayUp to 10 Mbit/s
Who may talkOnly the primary node starts a messageAny device, with priority decidingPreallocated time slots plus a dynamic segment
WiringSingle wire, 12 VTwisted pairStar or bus, two optional channels

How a LIN network operates

A LIN network has 16 nodes, one primary and up to 15 secondary. The primary starts every message, and at most one secondary replies to a given identifier. Because nothing is ever sent without the primary asking, there is no need for collision detection. The primary can also reply to its own messages, and the nodes are typically microcontrollers, though specialised chips can cut cost, space or power. In cars, groups of these small networks hang off a CAN backbone.

Each frame has a header from the primary, made of a break, a synchronisation byte and an identifier, followed by a response of two, four or eight data bytes plus three bytes of control information. The break lasts at least 11 bit times, with 13 standard in use. Because secondary nodes may run on cheap RC oscillators instead of crystals, the sync field lets them measure bit timing from the primary and adjust their own baud rate.

The protocol offers several kinds of frame:

  • Unconditional frames always carry signals, with identifiers from 0 to 59.
  • Event-triggered frames reduce polling: a secondary replies only if its data has changed, and if two answer at once the primary resolves the clash.
  • Sporadic frames are sent by the primary only when a signal has been updated, so they cannot collide.
  • Diagnostic frames always carry eight data bytes, with identifiers 60 and 61. User-defined frames use 62, and 63 is reserved.

To save energy, nodes enter a sleep mode after a timeout and are woken by a WAKEUP frame that any node can send. Slave node position detection, also called auto-addressing, assigns each device its address after power-up, so identical devices can share a bus without end-of-line programming. The LIN Supplier ID registry is handled by CAN in Automation, and LIN is now covered by the ISO 17987 series, with LIN over the DC power line standardised in ISO/AWI 17987-8.

What is FlexRay?

FlexRay is an automotive communications protocol created by the FlexRay Consortium. Its aim was greater speed and reliability than CAN and TTP, at a higher price. The consortium disbanded in 2009, and the standard now lives on as ISO 17458-1 to 17458-5.

It supports data rates up to 10 Mbit/s and works in either star or bus layouts. It can use two independent channels, so communication continues at reduced bandwidth if one fails. The bus runs a repeating time cycle with a static segment and a dynamic one. The static segment is preallocated into slices for individual kinds of traffic, which gives stronger determinism than CAN. The dynamic segment behaves more like CAN, with nodes taking the bus as it becomes available.

The consortium's core members were Freescale Semiconductor, Bosch, NXP Semiconductors, Volkswagen, Daimler and General Motors. Around it sat 28 premium associate members and over 60 associate members by September 2009, and the group disbanded at the end of that year.

Which cars use FlexRay?

The first series production vehicle with FlexRay arrived at the end of 2006, the BMW X5 (E70), where it enabled a fast adaptive damping system. Full use came in 2008 with the new BMW 7 Series (F01).

Other cars followed. The list includes the Audi A8 (D4) from 2010 to 2017, Audi A6 (C7) from 2011 to 2018, Audi R8 from 2015 to 2023, Bentley Mulsanne from 2010 to 2020, Lamborghini Huracan, Mercedes-Benz S-Class (W222) from 2013 to 2020 and (W223) from 2020, Rolls-Royce Ghost from 2009 and Volvo XC90 from 2015.

How FlexRay keeps its clocks in step

Every ECU on a FlexRay bus has its own clock, and the rules limit drift to 0.15% from the reference, so the slowest and fastest clocks in the system differ by no more than 0.3%. In practice, for every 300 cycles of the sender the receiver will count between 299 and 301. Clocks are resynchronised often enough that this never causes trouble.

Only one ECU writes to the bus at any moment. Each bit is held for 8 sample clock cycles, and the receiver votes on the last 5 samples, so a single-cycle error near the edge of a bit cannot change the result in the middle of the 8-cycle window. A byte needs 80 cycles, 16 for its start signals and 64 for the bits. An idle bus rests high, so receivers know a message has begun when the voltage drops to 0.

What it means for a car buyer

For a driver, the choice of bus is invisible, but its effects are not. Shared networks are why a rain sensor can wake the rear wiper in reverse, why a mirror can tilt itself at the kerb, and why one sensor can serve several systems. OBD-II diagnostics, mandatory on US-sold cars since model year 1996, and EOBD on EU petrol cars since 2001 and diesels since 2004, list CAN as one of their five protocols.

Cost explains the three-tier structure. LIN keeps cheap components cheap, CAN does the general work, and FlexRay was reserved for jobs that justified the expense, such as the adaptive damping on the BMW X5 (E70).

Where this goes next

CAN is still being extended. CAN FD, released by Bosch in 2012, can coexist with older CAN 2.0 devices on the same network, and Bosch was still working on CAN standards in 2018. For FlexRay the outlook is less settled: Ethernet may replace it for bandwidth-intensive applications that are not safety critical. LIN, meanwhile, continues as part of the ISO 17987 series, including the standard for running it over a vehicle's battery power line.

Frequently asked questions

What does the CAN bus do in a car?
The CAN bus lets a car's electronic control units, which can number up to 70, exchange messages over shared wiring. When two devices transmit at once, the one with higher priority continues and the other backs off, and every device receives each frame.
What is the difference between CAN and LIN?
LIN is a cheaper single-wire protocol running up to 19.2 kbit/s over 40 metres, with one primary node starting every message. CAN suits more critical systems and acts as the backbone, with LIN groups for jobs such as air conditioning and infotainment hanging off it.
How fast is FlexRay?
FlexRay supports data rates up to 10 Mbit/s and can use two independent channels. It is faster and more reliable than CAN, but also more expensive, which is why it appeared on cars such as the BMW 7 Series (F01).
Why do cars need more than one network?
Cost and performance differ. CAN was too expensive to fit to every component, so LIN was created for non-critical parts, while FlexRay offers speed and fault tolerance for demanding systems. The networks are linked in a hierarchy, with LIN groups connected through a CAN backbone.
Is FlexRay being replaced?
The FlexRay Consortium disbanded in 2009, and the standard now sits in ISO 17458-1 to 17458-5. Ethernet may replace FlexRay for bandwidth-intensive applications that are not safety critical.

Sources

  1. CAN bus - Wikipedia
  2. Local Interconnect Network - Wikipedia
  3. FlexRay - Wikipedia
Next story / Features

Self-Parking Cars Date From Toyota's 2003 Prius and Now Include Valet Modes