Open search

CAN Newsletter magazine

Part 2: Comparing CAN, CAN FD, and Ethernet

This analysis compares Classical CAN, CAN FD, and Ethernet systems with focus on a decentralized battery management system. Part 1 of this article was published in the CAN Newsletter magazine issue 2-2021.

Table 1: Measured frame processing times for various transmission rates and user data size (Source: OTH Regensburg)

The complete article is published in the September issue of the CAN Newsletter magazine 2021. This is just an excerpt.

In Part 1 of the article, the test environment setup as well as the evaluation criteria for the comparative analysis were introduced. Part 2 provides related results and discussion.

Results and discussion

Frame processing time comparison: The frame processing times were first measured for different user data lengths of 0 byte, 8 byte, 64 byte, and 1 500 byte aligned with the maximum frame sizes of CAN, CAN FD, and Ethernet (Table 1). The frame processing time was measured using CAN with 500 kbit/s, CAN FD with 500 kbit/s, 1 Mbit/s, and 4 Mbit/s as well as Ethernet with 100 Mbit/s.

The highest frame processing duration for a user data transmission of 0 byte up to 8 byte is consistently CAN FD with 500 kbit/s. At the identical transmission rate as CAN, CAN FD is on an average 27 μs slower because of the longer control field (9 bit vs. 6 bit) in the CAN FD frames. The main advantage of CAN FD is the bit-rate switch (BRS), i.e. the increased data rate compared to the arbitration rate. This is not exploited in case of a constant transmission rate of 500 kbit/s, but at a transmission speed of 1 Mbit/s and higher, the transmission time is reduced and CAN FD reveals its advantage over Classical CAN.

Since only the transmission time of the data phase is reduced, the effect of the BRS increases with an increasing number of user data (Table 1). The increased data rate is used for the user data and the CRC (cyclic redundancy check) field. A further increase of the CAN FD data rate to 4 Mbit/s shows a considerable improvement of the frame processing time, which is especially effective with a high amount of transmitted data byte.

Figure 1: Initialization and frame processing time for varying user data size (Source: OTH Regensburg)

The frame processing time of CAN FD is at any time significantly higher than the one of Ethernet. At 64 user data byte, the time difference between CAN FD (4 Mbit/s) and Ethernet has increased to 155 μs. These differences become even more striking when the payload exceeds the frame size, i.e. multiple segments are necessary. With a focus on the fastest possible data transmission, Ethernet is the communication technology of choice. Even with a payload of up to 64 byte, the data transmission is faster than with CAN FD. In addition, Ethernet enables user data transmission of up to 1 500 byte per data frame, which is higher than the maximum of 8 user data byte to be transmitted with CAN and the maximum of 64 user data byte with CAN FD (Figure 1). Comparing CAN FD and CAN, it becomes clear that CAN FD only shows advantages over CAN when bit-rate switching is used and the data rate is increased. Furthermore, it is shown that the effect of bit-rate switching becomes more significant as the payload increases.

When selecting the communication technology, the number of user data byte to be transmitted and the ratio between user data byte and overhead due to the data frame should be taken into account. If the objective is to transmit as much user data as possible within minimum time, the advantages of Ethernet outweigh those of CAN and CAN FD. For the transmission of fewer user data byte in short intervals, as it is the case for example within the DBMS (decentralized battery management system), CAN FD is definitely an option, especially if the trans- mission rate is further increased up to the maximum of 8 Mbit/s.

Figure 2: Energy consumption of CAN (FD) and Ethernet for diverse peripheral units in run, sleep and idle mode (Source: OTH Regensburg)

Processor workload analysis: The processor time is measured to compare the processor load caused by the respective communication technology. A part of the measurement is the required processor time for initialization. The initialization is executed once at system startup or after a reset. The initialization time for CAN (FD) is approx. 40 μs, whereas Ethernet requires 1,7 s and is over the factor 40 000 greater than the initialization time of CAN (FD) (Figure 1). Especially if an unexpected restart of the micro-controller and the applied real-time system occurs, the long downtime of the subscriber has consequences, including loss of information and the associated effects on system control and coordination. The Ethernet initialization time of 1,7 s (Figure 1) is quite long compared to the one for CAN (FD). The reason for this is the built-in Ethernet PHY (physical layer) on the applied evaluation board. By replacing the Ethernet PHY, the Ethernet initialization time could lie within the millisecond range.

Figure 3: Power consumption comparison (Source: OTH Regensburg)

Next, the processor load for CAN (FD) communication for sending and subsequent receiving of 1 000 data frames is measured. Varying numbers of frames showed a linear behavior between the CAN FD process and the number of frames. The processor time of the CAN FD process increases with the number of frames. The processor times were measured for intervals of 0,2 ms, 0,3 ms, 1 ms, and 10 ms. For shorter intervals between frames, the processor time share for the CAN FD thread increases slightly. With the shortest frame interval of 0,2 ms, the share of the CAN FD thread process is still only 1,5 %. The measurements show that the CAN FD communication only places a low overall load on the processor and cannot overload the processor due to communication channel restrictions limiting the transmission speed beforehand.

Measurements for CAN communication showed that it requires 10 μs less processor time for 1 000 data frames compared to CAN FD communication. Examining the per- centage processor utilization, there are no differences compared to CAN FD communication. Therefore, only the CAN FD measurements are used for the comparison with Ethernet. Receiving and unpacking CAN (FD) data frames is handled by an interrupt service routine and depends on the length of the user data. For example, for 8 byte of user data it takes 3,3 μs whereas it takes 7,8 μs for 64 byte.

Figure 4: Upper and lower limits for RER of CAN and Ethernet in different environments determined by using DCA (Source: OTH Regensburg)

The measurement of the processor times for sending of Ethernet frames shows that the processor times do not behave linearly, especially for a few frames, in contrast to the processor times for CAN (FD). The reason for this are threads, which are executed in a fixed time interval independent of the number of frames. The shorter the frame interval, the more processor time is required by the Ethernet threads. With a send interval of 10 ms the Ethernet communication requires only 1,8 % of the processor time while with a send interval of 0,2 ms it already requires 23,8 % of the processor time. If the increase is linear to the send intervals, it is possible that the processor utilization limit occurs before the minimum send interval limit of Ethernet, which is 5 μs. This behavior was not investigated in this work because such a short send interval is not necessary for the DBMS.

The measurements show that Ethernet communication requires significantly more processor time than CAN (FD) communication. At a transmission interval of 0,2 ms, Ethernet requires 23,8 %, while CAN (FD) requires only 1,5 %. The processor times are additionally strongly dependent on the transmission intervals. The processor load therefore depends on the communication technology and additionally on the selected frame interval. For the selected minimum frame interval, neither Ethernet nor CAN (FD) communication significantly loads the processor.

For receiving and unpacking of Ethernet frames, a separate thread and an interrupt service routine is used. For 8 byte of user data it takes 18 μs, which is significantly longer compared to the duration of 3,3 μs for CAN (FD) frames. With the maximum of 1 500 byte of user data, receiving and unpacking the frame takes 83,9 μs.

Energy consumption comparison: Since the same peripheral units are used for CAN and CAN FD communication, the energy consumption is combined for both types of communication. The processor operates constantly with a frequency of 400 MHz and an operating core voltage of 1,2 V. The operating voltage of the peripherals is 3,3 V. The total energy consumption is calculated in each case, including the necessary peripheral units, system components, and the supply of external peripherals. For Ethernet communication, significantly more peripheral units and system components are required and additionally the cache is utilized.

If you would like to read the full article from University of Regensburg, you can download it free of charge or you download the entire magazine.