CAN transceiver

By designing a transceiver in the CAN bus that can detect the arbitration status and send a predefined bit pattern, the problem of nodes maliciously manipulating control after losing arbitration is solved, ensuring the security and integrity of data transmission.

CN113225240BActive Publication Date: 2024-10-22NXP BV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110100370.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-02-04
Filing Date
2021-01-25
Publication Date
2024-10-22
Estimated Expiration
2041-01-25

AI Technical Summary

Technical Problem

In the CAN bus, nodes may maliciously manipulate bus control after losing arbitration, causing data transmission interruption or data tampering, causing security risks.

Method used

Design a transceiver that can detect if a node has lost arbitration and send a predefined bit pattern, including CAN error frames, after losing arbitration to prevent malicious manipulation. The transceiver also contains a whitelist/blacklist module that verifies message identifiers to ensure that only legitimate nodes can send messages.

Benefits of technology

It effectively prevents nodes from maliciously manipulating the CAN bus after losing arbitration, ensures the security and integrity of data transmission, and prevents data communication failure or tampering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113225240B_ABST
    Figure CN113225240B_ABST
Patent Text Reader

Abstract

A transceiver for sending and receiving data from a Controller Area Network (CAN) bus is disclosed. The transceiver is configured to detect whether a node has sent a dominant bit on the CAN bus after losing arbitration. The transceiver is further configured to send a predefined bit pattern on the CAN bus after receiving the dominant bit from the node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a CAN transceiver. Background Art

[0002] The Controller Area Network (CAN bus) is a vehicle bus standard designed to allow microcontrollers and devices to communicate with each other's applications without a host. CAN is a message-based protocol that uses two wires to enable multiple devices to communicate with each other and is used in many types of applications, including automotive applications. For each message, the data in the packet is transmitted sequentially, but in such a way that if more than one device transmits a message at the same time, only the highest priority message can continue, and the other devices will stop transmitting their messages. This process is called "arbitration" and is used by all sending devices, and the device attempting to send the highest priority message will win the arbitration. The transmission packet is received by all devices, including by the transmitting device receiving its own message. However, even after losing arbitration, parasitic devices may attempt to manipulate bus control. Summary of the invention

[0003] This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.

[0004] In one embodiment, a transceiver for sending and receiving data from a controller area network (CAN) bus is disclosed. The transceiver is configured to detect whether a node has sent a dominant bit on the CAN bus after losing arbitration. The transceiver is further configured to send a predefined bit pattern on the CAN bus after receiving the dominant bit from the node. In some examples, the predefined bit pattern may include a CAN error frame.

[0005] In another embodiment, a method for preventing a node from interrupting transmission on a controller area network (CAN) bus is disclosed. The method includes: detecting whether the node has lost arbitration and whether a remote node is transmitting; after the node has lost the arbitration and before the end of the current frame transmission of the remote node, detecting whether the node transmits a dominant bit to the CAN bus; and sending a complete error frame on the CAN bus.

[0006] In some examples, the transceiver is configured to send the predefined bit pattern to the CAN bus in response to the bit counter reaching a predefined number of bits. The transceiver may further include a bit decoder for processing data bits sent by the node to the CAN bus after the node has lost arbitration. The transceiver may also be configured to send the predefined bit pattern to the CAN bus in response to detecting a predefined receive bit pattern from the node.

[0007] In some examples, the transceiver is further configured to deactivate the node for a preselected time period after sending the complete error frame. The transceiver can be configured to store a whitelist of message identifiers, and can be configured to detect whether the node has won the arbitration, and to verify through the whitelist whether the node is permitted to send the message identifier that the node is sending, and if the node is not permitted to send the message identifier, ignore the message identifier and set a recessive bit on the CAN bus. In some embodiments, the transceiver can also be configured to store a blacklist of message identifiers for detection,

[0008] In some embodiments, the transceiver may include: a counter for counting data bits sent by the node to the CAN bus after the node has lost the arbitration; and an error frame generator configured to generate a CAN error frame after detecting that the node has lost the arbitration and has sent a dominant bit. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order that the manner in which the above-mentioned features of the invention may be understood in detail, the invention briefly summarized above may be described in more detail by reference to embodiments, some of which are shown in the accompanying drawings. However, it should be noted that the drawings illustrate only typical embodiments of the invention and therefore should not be considered as limiting the scope of the invention, as the invention may admit of other equally effective embodiments. The advantages of the claimed subject matter will be apparent to those skilled in the art upon reading this specification in conjunction with the accompanying drawings, in which the same reference numerals are used to refer to the same elements, and wherein:

[0010] Figure 1 depicts a controller area network (CAN) bus with termination resistors and capacitors;

[0011] Figure 2 depicts the CAN bus communication protocol, showing the representation of "0" and "1" based on the differential voltage at CANH and CANL;

[0012] Figure 3 A schematic diagram showing a transceiver according to one or more embodiments of the present disclosure; and

[0013] Figure 4 A flow chart regarding CAN data transmission according to one or more embodiments of the present disclosure is shown.

[0014] It should be noted that the drawings are not necessarily drawn to scale. Not all components of the transceiver are shown. The omitted components are known to those skilled in the art. DETAILED DESCRIPTION

[0015] Many well-known manufacturing steps, components, and connectors have been omitted or not described in detail in the description to avoid obscuring the present disclosure.

[0016] It will be readily appreciated that the components of the embodiments as generally described herein and illustrated in the accompanying drawings may be arranged and designed in a variety of different configurations. Therefore, the following more detailed description of the various embodiments represented in the figures is not intended to limit the scope of the present disclosure, but is merely representative of the various embodiments. Although various aspects of the embodiments are presented in the drawings, the drawings are not necessarily drawn to scale unless specifically indicated.

[0017] The present invention may be embodied in other specific forms without departing from the spirit or essential characteristics of the present invention. The described embodiments are considered in all respects to be illustrative only and not restrictive. Therefore, the scope of the present invention is indicated by the appended claims rather than by the specific embodiments. All changes within the equivalent meaning and scope of the claims are included within the scope of the claims.

[0018] References throughout this specification to features, advantages, or similar language do not imply that all features and advantages that can be achieved by the present invention should be or are in any single embodiment of the present invention. Rather, language referring to features and advantages should be understood to mean that a particular feature, advantage, or characteristic described in conjunction with an embodiment is included in at least one embodiment of the present invention. Therefore, discussion of features and advantages and similar language throughout this specification may (but does not necessarily) refer to the same embodiment.

[0019] In addition, the described features, advantages and characteristics of the present invention may be combined in any suitable manner in one or more embodiments. Those skilled in the art will recognize that, in view of the description herein, the present invention may be practiced without one or more of the specific features or advantages of a particular embodiment. In other cases, additional features and advantages may be identified in certain embodiments that may not be present in all embodiments of the present invention.

[0020] References throughout this specification to "one embodiment," "an embodiment," "an example," or similar language mean that a particular feature, structure, or characteristic described in connection with the specified embodiment is included in at least one embodiment of the present invention. Thus, the phrases "in one embodiment," "in an embodiment," and similar language throughout this specification may (but do not necessarily) all refer to the same embodiment.

[0021] The Controller Area Network (CAN) is a peer-to-peer network. This means that there is no master device that controls when individual nodes have access to read and write data on the CAN bus. When a CAN node is ready to transmit data, it checks if the CAN bus is idle and then simply writes a CAN frame to the network. The transmitted CAN frame does not contain the address of the transmitting node or any intended receiving node. However, an arbitration ID that is unique throughout the network is included in the data frame. All nodes on the CAN network receive CAN frames, and depending on the message or arbitration identifier of the transmitted frame, each CAN node on the network decides whether to accept the frame for further processing.

[0022] If multiple nodes attempt to transmit messages to the CAN bus at the same time, the node with the highest priority (lowest value of message or arbitration identifier) ​​will gain access to the bus. Nodes (or messages) with lower priority must wait until the bus is available before they can try to transmit again.

[0023] CAN nodes (e.g., ECUs) use transceivers to connect to the CAN bus. Transceivers include an Rx port and a Tx port to enable communication with other CAN nodes over the CAN bus. Transceivers usually provide a simple connection for mode control of devices / microcontrollers in the network. Typical standard transceivers use at most two dedicated mode control pins, which means that there are usually no more than four different operating states.

[0024] The CAN protocol specifies the structure of a CAN frame. A CAN frame consists of (in this order):

[0025] 1. SOF (Start of Frame) bit - indicates the beginning of a message with a dominant (logic 0) bit.

[0026] 2. Message or arbitration ID - identifies the message and indicates the priority of the message. There are two formats of frames - standard frames using 11-bit arbitration ID, and extended frames using 29-bit arbitration ID.

[0027] 3. IDE (Identifier Extension) bit - allows the distinction between standard and extended frames.

[0028] 4. RTR (Remote Transmission Request) bit - used to distinguish remote frames from data frames. A dominant (logic 0) RTR bit indicates a data frame. A recessive (logic 1) RTR bit indicates a remote frame.

[0029] 5. DLC (Data Length Code) - indicates the number of bytes the data field contains.

[0030] 6. Data field - contains 0 to 8 bytes of data.

[0031] 7. CRC (Cyclic Redundancy Check) - Contains 15 bits of cyclic redundancy check code and implicit delimiter bits. The CRC field is used for error detection.

[0032] 8. ACK (Acknowledge) Slot - Any CAN controller that receives a message correctly will send an ACK bit at the end of the message. The transmitting node checks for the presence of an ACK bit on the bus and retries the transmission if no acknowledgement is detected.

[0033] 9. CAN signal - each data segment contained in the data field of the CAN frame. CAN signal can also be called a channel because the data field can contain up to 8 bytes of data.

[0034] Figure 1 Depicted is a controller area network (CAN) bus 100. The CAN bus 100 includes a terminal resistor for suppressing wave reflections. In some embodiments, a capacitor 108 may also be used at the terminal. The CAN bus 100 includes a twisted pair 106. The twisted pair 106 includes a CANH conductor and a CANL conductor. The CAN bus 100 may include a plurality of communication microcontrollers or electronic control units (ECUs) 104-1 ... 104-N coupled to the twisted pair by a plurality of transceivers 110-1 ... 110-N. The capacitor 108 is typically 4.7nF. The value of the capacitor 108 can be increased to about 100nF. By increasing the value of the capacitor 108, the signal voltage at the CANL or CANH during intermittent disconnection is improved. The resistors coupled to the capacitor 108 are typically 60 ohms each (the total resistance at each end is 120 ohms).

[0035] As shown, communication nodes (ECUs) 104-1...104-N are connected via unshielded twisted pair 106. Termination is implemented on the far left and far right of the CAN bus 100. There are two options: by using a single resistor as shown on the left side of the CAN bus 100, or via two resistors and capacitors 108, known as "split termination," as shown on the right side of the CAN bus 100. The latter method is usually used because it provides additional low-pass filtering to improve EMC performance.

[0036] like Figure 2As shown, in normal operation (when there is no error), the CAN bus 100 uses signals to indicate that CANH and CANL are driven so that a differential voltage is generated (to send a dominant signal) or no differential signal is generated (to send a recessive bit). In some embodiments, for a dominant bit ("0"), the voltage at CANL is about 1.5V and the voltage at CANH is 3.5V, and V diff Represents the difference between the voltage at CANH and the voltage at CANL. In some examples, Vdiff>0.9V can be considered a dominant bit, and Vdiff<0.5 can be considered a recessive bit.

[0037] When the CAN bus 100 is in an idle state (e.g., in a recessive state for a period of time), a communication node (e.g., ECU 104-1...104-N) on the CAN bus 100 that wishes to send data on the CAN bus sends a dominant SOF bit to indicate that the node wants to send a data frame. Next, each node sends a message identifier. It should be noted that the nodes are configured so that no two nodes can send a data frame including the same message identifier. The CAN protocol provides an 11-bit message identifier. In another version of the CAN protocol, the message identifier is specified to include 29 bits. The relative priority of the message identifier is characterized by the value of the message identifier. A message identifier with a lower value has a higher priority. For example, a message identifier with a value of 11001000111 (0x647) will have a higher priority than a message identifier with a value of 11011111111 (0x6FF).

[0038] If ECU 104-1 and ECU 104-N simultaneously send the SOF bit and then begin transmitting the message identifiers 11001000111 and 11011111111 respectively on the fourth bit, ECU 104-1 will win arbitration because ECU 104-1 will send a dominant bit that will overwrite the recessive bit sent by ECU 104-N. ECU 104-1 will read the dominant bit after sending the dominant bit on the CAN bus 100 and will continue to send additional data bits, while ECU 104-N will read the dominant bit after having sent the recessive bit (e.g., the fourth most significant bit in the message identifier example above) and will assume that it has lost arbitration and will stop sending additional data bits on the CAN bus 100 and will wait until the CAN bus 100 is idle again before trying to send a message, and the arbitration process will begin again.

[0039] However, the process described above can only work if ECU 104-N complies with the CAN protocol. If ECU 104-N is a malicious component that is maliciously programmed to interrupt data transmission on the CAN bus 100, ECU 104-N may still flip the next bit sent by ECU 104-1 on the CAN bus 100 after it has lost arbitration. This may be done during the data phase of the CAN frame transmission (e.g., during the transmission of the data field) to replace the valid data being sent with malicious data. For example, when ECU 104-N detects that ECU 104-1 has sent a recessive bit, ECU 104-N may send a dominant bit on the CAN bus 100 to overwrite the recessive bit sent by ECU 104-1. Because the dominant bit overwrites the recessive bit on the CAN bus 100, the data sent by ECU 104-1 will no longer be valid data. ECU 104-N may continue to repeat this malicious action to fail data communication on the CAN bus 100. This failure may, for example, cause a dangerous situation to the user of the vehicle. Assuming that ECU 104-1 is transmitting anti-lock braking data when the vehicle is slipping on an icy road, a communication failure caused by malicious actions of ECU 104-N may cause a serious risk of injury.

[0040] Assuming again that ECU 104 -N is a malicious ECU, ECU 104 -N may continue to send high priority messages to virtually manipulate CAN bus 100 by prohibiting other ECUs (eg, ECU 104 - 1 ) from sending data on CAN bus 100 .

[0041] Figure 3 The transceiver 120 is shown. It should be noted that many components of the transceiver 120 have been omitted to avoid obscuring the present disclosure. The transceiver 120 may be replaced Figure 1 transceiver 110-N in (and, of course, any other transceiver on the CAN bus 100) so that Figure 1 The CAN bus 100 shown becomes a secure CAN bus. With the transceiver 120 monitoring the ECU 104 -N, the ECU 104 -N will no longer be able to maliciously interrupt the data communication on the CAN bus 100 .

[0042] The transceiver 120 includes a transmission (tx) gateway 150. In some embodiments, the transceiver 120 may also optionally include a whitelist / blacklist module 156 that provides storage and verification of message identifiers that are allowed to be passed to the CAN bus 100 through the transceiver 120. When the transceiver 120 is provided for use, the message identifiers stored in the whitelist module 156 can be configured. Before sending the message identifier to the CAN bus 100, the transceiver 120 verifies whether the verified message identifier is allowed to be sent to the CAN bus 100 by the ECU 104-N. If the whitelist / blacklist module 156 does not include the message identifier in the whitelist (or if the message identifier is included in the blacklist), the whitelist / blacklist module 156 will reject the message. For example, if the ECU 104-N should not receive and accept a certain message identifier, the whitelist / blacklist module 156 will not transmit those messages to the ECU 104-N. The whitelist / blacklist module 156 is configured such that the ECU 104 -N cannot modify the list stored in the whitelist / blacklist module 156 .

[0043] The tx gateway 150 includes a bit processor 152 and an error generator 154. The tx gateway 150 monitors whether the ECU 104-N has won or lost arbitration. The whitelist / blacklist module 156 can process or filter the data before or after the tx gateway has completed processing. If the tx gateway 150 determines that the ECU 104-N has lost arbitration and is still trying to send a dominant bit, the bit processor 152 begins counting the number of bits being sent. In some examples, the counting may include checking the width of the dominant bit sent by the ECU 104-N. If the ECU 104-N continues to send more bits, the ECU 104-N may be sending a legitimate error frame (6 bits or longer), and such a message is allowed to reach the CAN bus 100. However, if the ECU 104-N stops sending more dominant bits, the tx gateway will send the remaining bits to indicate an error condition. If ECU 104-N sends more than one error frame within a preselected time interval, the tx gateway 150 can deactivate ECU 104-N for a preselected time period to prevent ECU 104-N from launching a denial of service attack. In one example, once the dominant bit is received, other ECUs can assume that ECU 104-N has control over the CAN bus 100, and then the malicious ECU 104-N can send a complete CAN frame with a valid CRC to manipulate the CAN bus 100. In another example, because the dominant bit sent by ECU 104-N will overwrite the recessive bit sent by ECU 104-1, the CAN frame sent by ECU 104-1 will be damaged. The transceiver 120 will prevent the malicious ECU 104-N from corrupting the data sent by ECU 104-1 or from manipulating the CAN bus 100 after losing arbitration. It should be noted that the term "ECU" is used for example only. The term "ECU" means any device (e.g., a microcontroller) that uses the CAN bus 100.

[0044] In some examples, if the dominant pulse is less than 6 bits, the transceiver 120 is configured to extend the dominant pulse on the CAN bus 100 to a longer amount, such as 6 or 11 dominant bits.

[0045] If the ECU 104-N stops sending additional bits after sending the dominant bit, then after losing arbitration, the error generator 154 will continue to send more bits, a total of six bits (or more, depending on the implementation), to send a legal error frame on the CAN bus 100. The tx gateway 150 can then disable data transmission of the ECU 104-N for a preselected period of time (e.g., a few seconds) to prevent the ECU 104-N from launching a data interruption attack on the CAN bus 100. The tx gateway 150 can be implemented in hardware or software. In some embodiments, the error generator can be implemented in the bit processor 152. In some examples, the bit processor 152 can include a CAN protocol controller.

[0046] Figure 4 A flow chart 200 for protecting the CAN bus 100 via the transceiver 120 is shown. Thus, at step 202, before sending data on the CAN bus 100, the ECU 104-N (for example) via the transceiver 120 checks whether the CAN bus is in an idle state in accordance with the CAN protocol. At step 204, the transceiver 120 checks whether the ECU 104-N has won or lost arbitration. If the ECU 104-N has won arbitration and attempts to send a message identifier that does not allow the ECU 104-N to send, the transceiver 120 stops transmitting the remaining CAN frames from the ECU 104-N and sets a recessive bit on the CAN bus 100, α allowing other ECUs to attempt to use the CAN bus 100. In some embodiments, the transceiver 120 may disable the sending of any additional messages via the ECU 104-N for a preselected period of time.

[0047] If the ECU 104-N has lost arbitration, then at step 206, upon detecting that another node that has won arbitration has sent a bit to the CAN bus 100, the ECU 104-N will send a dominant bit detected by the transceiver 120. At step 208, through the bit processor 152, the transceiver 120 monitors whether the ECU 104-N is attempting to send a legitimate error frame (6 bits or longer). If so, the transceiver 120 allows the error frame to pass. However, if the ECU 104-N continuously sends a predetermined and configurable number of error frames within a preselected and configurable time period, the transceiver 120 may disable the transmission of messages from the ECU 104-N for a preselected and configurable time period. Similarly, at step 210, if the transceiver 120 detects that the ECU 104-N stops sending complete error frames, the transceiver 120 generates the remaining bits to send a valid error frame on the CAN bus 100. In some examples, the bit processor 152 or the error generator 154 may generate the predefined bit pattern based on the bit pattern received from the ECU 104-N. Subsequently, at step 212, the transceiver 120 stops accepting any further data from the ECU 104-N for a configurable preselected time period.

[0048] Some or all of these embodiments may be combined, some may be omitted entirely, and additional process steps may be added while still achieving the products described herein.Thus, the subject matter described herein may be embodied in many different variations, and all such variations are contemplated to be within the scope of the claims.

[0049] Although one or more embodiments have been described by way of example and according to specific embodiments, it should be understood that one or more embodiments are not limited to the disclosed embodiments. On the contrary, it is intended to cover various modifications and similar arrangements that will be obvious to those skilled in the art. Therefore, the scope of the appended claims should be given the broadest interpretation so as to cover all such modifications and similar arrangements.

[0050] Unless otherwise indicated herein or clearly contradictory to the content, in the case of describing the subject matter (especially in the case of the attached claims), the use of the terms "a", "an" and "the" and similar indicators should be understood to cover both the singular and the plural. Unless otherwise indicated herein, the recitation of the value range herein is intended only to serve as a shorthand method of individually referring to each individual value belonging to the range, and each individual value is incorporated into this specification as if it were individually described herein. In addition, the foregoing description is for illustrative purposes only, not for limiting purposes, because the scope of protection sought is defined by the claims set forth below and any equivalents thereof. Unless otherwise required, the use of any and all examples or exemplary language (e.g., "for example") provided herein is intended only to better illustrate the subject matter, rather than to limit the scope of the subject matter. The use of the term "based on" and other similar phrases indicates the conditions that produce the results in the attached claims and written descriptions, rather than other conditions that are intended to exclude the results. Any language in this specification should not be understood to indicate that any unclaimed element is essential to practicing the claimed invention.

[0051] Preferred embodiments known to the inventor for practicing the claimed subject matter are described herein. Of course, after reading the foregoing description, variations of those preferred embodiments will become apparent to those of ordinary skill in the art. The inventor expects that those of ordinary skill in the art will adopt such variations as appropriate, and the inventor intends to practice the claimed subject matter in other ways than those specifically described herein. Therefore, the claimed subject matter includes all variations and equivalents of the subject matter recited in the appended claims as permitted by applicable law. In addition, unless otherwise noted herein or otherwise clearly contradictory to the content, any combination of the elements described above in all possible variations thereof is encompassed.

Claims

1. A transceiver for sending and receiving data from a Controller Area Network (CAN) bus, It is characterized in that The transceiver is configured to detect whether a node associated with the transceiver has sent a dominant bit on the CAN bus after the node loses arbitration, wherein the transceiver is configured to detect whether the node stops sending complete error frames, and if the node stops sending the complete error frames, the transceiver is further configured to send a predefined bit pattern on the CAN bus after receiving the dominant bit from the node and then stop further receiving any data from the node within a configurable preselected time period.

2. The transceiver according to claim 1, It is characterized in that The node is further configured to deactivate the node within a preselected time period after transmitting the predefined bit pattern.

3. The transceiver according to claim 1, It is characterized in that The predefined bit pattern comprises a CAN error frame.

4. The transceiver according to claim 1, It is characterized in that Additionally configured to store a whitelist of message identifiers.

5. The transceiver according to claim 4, It is characterized in that It is also configured to detect whether the node has won the arbitration, and to verify through the white list whether the node is permitted to send the message identifier that the node is sending, and if the node is not permitted to send the message identifier, ignore the message identifier and set a recessive bit on the CAN bus.

6. The transceiver according to claim 1, It is characterized in that Additionally configured to store a blacklist of message identifiers.

7. The transceiver according to claim 6, It is characterized in that The method is further configured to detect, through the blacklist, whether another node that wins the arbitration does not legitimately use a message identifier that is part of the blacklist.

8. The transceiver according to claim 1, It is characterized in that Also included is a counter for counting data bits sent by the node to the CAN bus after the node has lost the arbitration.

9. The transceiver according to claim 8, It is characterized in that The device is further configured to send the predefined bit pattern to the CAN bus in response to the counter reaching a predefined bit number.

10. A method for preventing a node from interrupting communication on a Controller Area Network (CAN) bus, It is characterized in that The method comprises: detecting whether the node has lost arbitration; receiving, by a transceiver associated with the node, a dominant bit from the node after the node has lost the arbitration; detecting whether the node stops sending complete error frames; If the node stops sending complete error frames, the transceiver associated with the node sends a predefined bit pattern to the CAN bus after receiving the dominant bit from the node that has lost the arbitration, and then the transceiver stops receiving any further data from the node for a configurable preselected time period.