Introduction
The physical layer of a Controller Area Network is almost always a pair of wires twisted together. The wires are called CAN High and CAN Low, because of the changes in voltage seen on the respective wire to transmit a bit. Most of this is taken for granted, but why two wires? Why opposing voltages? Why not one wire or wireless for that matter? And what's up with the resistors at the end? The answer to most of these questions is that CAN was developed to be extremely reliable in questionable environments. That is one of the reasons why it is so well suited for automotive use. Since the physical layer is so important to the reliability of the network, it is important to understand some basics about why the topology is what it is and why certain modifications can negatively affect network operation.
Linear, Ring, And Star Topology
There are 3 common network layouts, 2 of which you might see in an automotive application.
Ring Topology
Ring topology is least likely to make its way to automotive applications. It has the advantage of high reliability and fault tolerance, but requires each node to have 2 CAN connections. It is difficult to add/remove nodes with ring topology.
Star Topology
Star topology requires all nodes to connect to a central hub. This has the drawback of requiring an extra piece of hardware to act as the central hub, whereas ring and linear topologies do not. While star topology is not typically used for an individual network, it is common in modern autos to have several separate networks that interface at a gateway module. The gateway module in this case is the central hub serving the purpose of translating certain data between linear networks of differing baud rates and purposes.
Linear Topology
Linear topology is the simplest of the three examples here and is the one we'll spend the most time covering. Linear topology is most commonly used for individual networks on most autos today. It does not require nodes to have multiple CAN connections or special hardware to serve as a hub. The linear topology can be implemented with wire and two 120 ohm resistors. The wire and resistors form three basic parts of the topology: the backbone, the stubs, and the terminations.
Backbone, Stubs, And Terminations
There are three terms that can be used to describe the physical layout of a network. Most CAN standards use this same terminology, but if they don't you should still be able to figure out what they are talking about based on the context. Different standards may have different requirements for each of these items, but this article will stick to the general requirements seen across automotive CAN standards.
Backbone
The backbone is the longest part of the network layout. It's maximum length is typically limited to ~50 m, which is certainly long enough for automotive applications. If the length needs to be increased for some reason, it is possible to have a backbone up to 500 m long. These longer architectures require lowering the data transmission rate to ensure the integrity of the data. The backbone goes from node to node, linking them together daisy-chain style. Data sent on the bus does not need to go through any of the nodes, rather it is available to all nodes on the network at the same time.
Stubs
Stubs are relatively short branches that connect each module to the backbone. Stubs are supposed to be short, and in fact do have a maximum theoretical length that can be calculated based on the bus speed and other properties of the network. A good rule of thumb for automotive applications is to limit the sub length to less than 1 m for bus speeds 500 kB/s or less. You might see some automotive harnesses that have two wires crimped into each CAN terminal. This essentially makes the terminal the stub, keeping the stub length very short and the harness costs low. Unfortunately, this also makes it difficult for aftermarket suppliers to create plug-and-play T-Harnesses because they would be adding a stub to a stub. Technically, this is not correct. However, in practice, it does work just fine as long as the added stub is not excessively long.
Terminations
Two 120 ohm resistors are placed at the extreme ends of the backbone. This is done to eliminate reflections that build up when the bus voltages transition from their high to low states. Without terminating resistors, the signals have nowhere to go when they reach the end of the backbone, causing them to bounce back into the network which generates reflections or waves. When this happens, the transitions between high and low are stepped and take longer to complete the transition. This could cause loss of data, especially at higher baud rates where the transition delays are close to the baud rate. The resistors act like electrical shock absorbers, absorbing the signals when they crash into the end of the backbone with nowhere to go.