Communication device
The communication device addresses unauthorized message injection and DoS attacks in vehicle networks by monitoring message transmission anomalies and fixing the communication line potential, enabling precise detection and prevention of unauthorized communication.
Patent Information
- Application Number
- DE112016003908
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2015-08-31
- Filing Date
- 2016-08-10
- Publication Date
- 2024-09-26
- Estimated Expiration
- 2036-08-10
AI Technical Summary
Existing vehicle communication systems are vulnerable to unauthorized message injection and Denial of Service (DoS) attacks, which can cause malfunctions and block legitimate communication, with existing technologies failing to provide efficient measures for detection and prevention.
A communication device that includes a detection unit to monitor message transmission, counting consecutive blocks and cumulative bits to detect anomalies, and a control unit to fix the communication line potential when anomalies are detected, with notification to other devices for error processing.
Precisely detects unauthorized message sending and DoS attacks by comparing consecutive blocks and cumulative bits with permissible limits, preventing further message transmission and notifying other devices of anomalies.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present invention relates to a communication device that sends and receives messages via a communication line. TECHNICAL BACKGROUND
[0002] According to the current technology, multiple electronic control units (ECUs) are mounted in a vehicle and connected to each other via a network such as a CAN (controller area network). The ECUs perform individual processing while exchanging information over the network. In recent years, the size of in-vehicle networks has tended to increase, often using a structure in which multiple smaller networks are connected to a relay device such as a gateway that relays a message between the networks.
[0003] JP 2014 - 86812 A describes a CAN system intended to improve fault tolerance by sending a retransmission request frame when the first node in the CAN system does not receive a frame and is in an error passive state, storing the frame sent to a communication line in the second node, and retransmitting the frame for which retransmission is requested to the first node.
[0004] JP 2011 - 103577 A describes a communication system intended to prevent erroneous operation on the receiving side of a frame with a configuration in which a CAN controller measures a transmission latency from the input of a frame to the start of transmission to a communication line and transmits the frame together with information regarding the transmission latency, while the CAN controller that has received the frame decides to execute processing according to the transmission latency.
[0005] EP 1 094 639 A2 discloses a communications controller that executes a transmission, and if an error occurs or the corresponding node loses in the race with other nodes due to a lower priority, counts the transmission losses and continues the transmission until the transmission from the node loses the predetermined number. When the number of transmission losses reaches the predetermined value, the communications controller stops the transmission and reports the transmission status to the CPU. In response to this report, the CPU modifies the transmission conditions, for example, the identification data in the arbitration field, in the same way as in a conventional approach to increase the priority.
[0006] WO 2013 / 188611 A2 discloses a system and method for detecting anomalous attacks in internet network flow by counting a number of internet traffic messages detected as anomalous attacks to provide a count; calculating a moving average of the number of messages detected as anomalous attacks; and comparing the count to the moving average to provide an anomalous attack alert if the count is greater than a multiple of the moving average. The attacks may include at least one of a spoofing attack and a denial-of-service attack.
[0007] BOSCH: CAN Specification Version 2.0, Robert Bosch GmbH, Postfach 300240, D-70442 Stuttgart, 1991, pages 1 - 68 + Differences page 1 + Addendum pages 1 - 3, company publication discloses the fixing of the potential of the communication line in the CAN bus in case of detecting anomalies.
[0008] US 9 634 859 B2 discloses a method for detecting a defective node connected to a bus, wherein the node in a normal operating state increments an internal error counter upon detection of an error, and the node changes to an isolated operating state in which the node does not exchange messages over the bus if the internal error counter of the node exceeds a predetermined error threshold, and wherein the node changes from the isolated operating state to the normal operating state if a condition is met and this state change is detected, and wherein the node is detected as defective if a rate of the detected state changes exceeds an adjustable change rate or a number of the detected state changes exceeds an adjustable state change threshold. OVERVIEW OF THE INVENTION PROBLEMS TO BE SOLVED BY THE INVENTION
[0009] However, K. Koscher, A. Czeskis, F. Roesner, S. Patel, T. Kohno, S. Checkoway, D. McCoy, B. Kantor, D. Anderson, H. Shacham, and S. Savage, "Experimental Security Analysis of a Modern Automobile," in Proc. of the IEEE Symposium on Security and Privacy, pages 447-462, 2010, report that an illicit, i.e., unauthorized, message can be sent to a network in a vehicle by injecting an unauthorized program into the ECU. If an illicit message is sent based on an unauthorized program, a malfunction can occur in another ECU connected to the network. Neither the CAN system according to JP 2014 - 86812 A nor the communication system according to JP 2011 - 103577 A could provide effective measures for such an impermissible sending of a message.
[0010] In addition, a so-called DoS attack is known, in which an ECU into which an unauthorized program has been injected sends a large number of messages to a network, blocking communication from other ECUs and causing problems in a communication system. In recent years, the possibility of a DoS attack also affecting a vehicle-mounted communication system has been pointed out, and there is a need for measures against such an attack.
[0011] The present invention has been made in view of the above circumstances and is intended to provide a communication system capable of detecting the sending of an improper message to a network. MEANS FOR SOLVING THE TASK
[0012] A communication device according to the present invention has the features of claim 1.
[0013] In an advantageous development, in the communication device according to the present invention, the detection unit determines, each time a message is to be sent from the communication unit, whether or not the number of consecutive blocks stored in the storage unit for storing the number of consecutive blocks is larger than the number of permissible blocks stored in the storage unit for storing the permissible number of blocks in accordance with the priority level attached to the message, and detects that an abnormality with respect to communication occurs at a time when it is determined that the number of consecutive blocks is larger than the number of permissible blocks.
[0014] Furthermore, in the communication device according to the present invention, in a case where the communication unit receives a message, the detection unit determines whether or not the number of consecutive blocks stored in the storage unit for storing the number of consecutive blocks is larger than the number of permissible blocks stored in the storage unit for storing the permissible number of blocks in accordance with the priority level attached to the message.
[0015] In an advantageous development, the communication device according to the present invention further comprises: a storage unit for storing a cumulative number of bits, in which the cumulative number of bits in a message transmitted or received on the communication line is stored; and a second detection unit for detecting an abnormality regarding the communication based on the cumulative number during a predetermined period of time.
[0016] In an advantageous development, the communication device according to the present invention further comprises a control unit for executing a control such that a potential of the communication line is fixed when the detection unit detects an abnormality.
[0017] In an advantageous development, the communication device according to the present invention further comprises a notification unit for notifying another device when the detection unit detects an abnormality via a signal line which is not the communication line.
[0018] According to one aspect of the present invention, the communication device sends and receives a message assigned a priority level to or from another device via a communication line. Furthermore, the communication device performs arbitration processing based on a priority level to determine which message to send when a message from the communication device and a message from another device are sent simultaneously and collide with each other. Such processing corresponds to arbitration processing according to, for example, the Controller Ara Network (CAN) communication protocol.
[0019] The communication device according to the present invention, which performs the above-described processing, counts the number of consecutively blocked transmitted messages as the number of consecutive blocks in the case where transmitted messages are blocked by the decision processing (that is, where the messages could not be transmitted as a result of losing the decision). Furthermore, the communication device stores the number of consecutive messages to be transmitted whose blocking is permitted as the number of permissible blocks, in association with the priority levels attached to the messages. For each message to be transmitted or received, the communication device compares the number of consecutive blocks with the number of permissible blocks for the message.If the number of consecutive blocks is greater than the number of allowable blocks, the communication device may detect that some abnormal message sending is in progress for the corresponding communication line.
[0020] Since the sending of a high-priority message is not easily blocked by the decision processing, while the sending of a low-priority message is easily blocked, the abnormal sending of a message such as a DoS attack can be accurately detected by using the number of allowable blocks stored for each of different priority levels of messages in judging the presence or absence of an anomaly.
[0021] According to another aspect of the present invention, each time an attempt is made to send a message but the message is blocked by the decision processing, the communication device determines whether or not the counted number of consecutive blocks is greater than the number of allowable blocks, according to a priority level attached to the message to be sent. Accordingly, even before the completion of sending a message, an abnormality can be detected at the time it is determined that the number of consecutive blocks is greater than the number of allowable blocks. This configuration is suitable in the case where each communication device included in a communication system individually executes anomaly detection processing.
[0022] According to another aspect of the present invention, the communication device continuously monitors consecutive messages on a communication line and counts the messages as the number of consecutive blocks. In the case of receiving a message, the communication device determines whether or not the number of consecutive blocks at that time is greater than the number of allowable blocks according to the priority level attached to the received message. This configuration is suitable in the case where any one of the communication devices included in a communication system, such as a communication device such as a gateway, executes the anomaly detection processing while the other communication devices do not execute the anomaly detection processing.
[0023] According to another aspect of the present invention, in addition to the above-described anomaly detection processing, the communication device performs anomaly detection by another method. That is, the communication device counts the cumulative number of bits in messages transmitted or received on a communication line and detects an abnormal transmission of a message on the communication line when, for example, the cumulative number of bits exceeds a threshold value in a predetermined period of time. This anomaly detection method is suitable for detecting a DoS attack in which a large number of illegible messages are transmitted on a communication line.
[0024] According to another aspect of the present invention, the communication device executes control to fix the potential of a communication line when an abnormality is detected. This control prevents any of the communication devices from sending messages to the communication line. Thus, even in the case where there is a communication device that does not perform abnormality detection processing on its own, the occurrence of an abnormality can be detected from the fixed potential of the communication line, and error processing or the like can be performed.
[0025] According to another aspect of the present invention, when an abnormality is detected, the communication device notifies another communication device of the abnormality detection via a signal line other than the communication line over which messages are sent or received. Thus, even if there is a communication device that does not perform abnormality detection processing on its own, the occurrence of an abnormality can be detected from the receipt of a notification via the signal line used for notification, and error processing or the like can be performed. EFFECT OF THE INVENTION
[0026] According to the present invention, with the configuration in which anomaly detection is performed by comparing the number of consecutive blocks for messages to be transmitted or received with the number of permissible blocks for each priority level attached to the messages, an improper transmission of a message to a network can be accurately detected. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a block diagram illustrating the configuration of a vehicle-mounted communication system according to an embodiment of the present invention; Fig. 2 is a block diagram illustrating the configuration of a gateway according to an embodiment of the present invention; Fig. 3 is a block diagram showing the configuration of a CAN controller according to the embodiment; Fig. 4 is a schematic view showing an example of a table for the allowable number of blocks; Fig. 5 is a circuit diagram showing a configuration example of a fixing control unit; Fig. 6 is a timing chart illustrating the operation of a consecutive block number counter according to Embodiment 1; Fig. 7 is a flowchart illustrating a method of processing a count value for the number of consecutive blocks executed by the CAN controller in a gateway according to Embodiment 1; Fig. 8 is a timing chart for illustrating anomaly detection based on the number of consecutive blocks; Fig. 9 is a flowchart illustrating a method of processing anomaly detection executed by the CAN controller in the gateway according to Embodiment 1; Fig. 10 is a flowchart illustrating a method of processing anomaly detection executed by the CAN controller in the gateway according to Embodiment 1; Fig. 11 is a block diagram illustrating the configuration of an in-vehicle communication system according to a variation example of Embodiment 1; Fig. 12 is a block diagram showing the configuration of an in-vehicle communication system according to Embodiment 2; Fig. 13 is a timing chart illustrating the operation of a consecutive block number counter according to Embodiment 2; Fig. 14 is a timing chart illustrating anomaly detection based on the number of consecutive blocks according to Embodiment 2; and Fig. 15 is a flowchart illustrating a method of processing anomaly detection executed by a CAN controller according to Embodiment 2. EMBODIMENTS OF THE INVENTION Embodiment 1
[0027] The present invention will be described in detail below with reference to the drawings which illustrate embodiments thereof. Fig. 1 is a block diagram illustrating the configuration of an in-vehicle communication system according to an embodiment of the present invention. The in-vehicle communication system according to the present embodiment is configured to include a gateway 10 and a plurality of electronic control units (ECUs) 4 mounted in a vehicle 1. In the illustrated example, six ECUs 4 are mounted on the vehicle 1, and these six ECUs 4 are divided into two groups. Three ECUs 4 in the first group are connected to the first communication line 2, through which the ECUs 4 send and receive messages from each other. Similarly, three ECUs 4 in the second group are connected to the second communication line 3, through which the ECUs 4 send and receive messages from each other.
[0028] The two communication lines 2 and 3 are not directly connected to each other, but are individually connected to the gateway 10. The gateway 10 is a device that receives a message output, for example, on one communication line 2 and outputs the received message to the other communication line 3 to forward the message between the groups (networks, communication lines). Accordingly, the message sent from the ECU 4 connected to the first communication line 2 is forwarded by the gateway 10 and is received by the ECU 4 connected to the second communication line 3.
[0029] Fig. 2 is a block diagram illustrating the configuration of the gateway 10 according to the present embodiment. The gateway 10 according to the present embodiment is configured to include a processing unit 11, two fixation control units 12, and two CAN controllers 20. The processing unit 11 is provided with an arithmetic processing device such as a central processing unit (CPU) or a microprocessing unit (MPU). The processing unit 11 reads and executes a program stored in a read-only memory (ROM) or the like (not shown) to perform various processing related to message forwarding.
[0030] The two CAN controllers 20 are connected to the communication lines 2 and 3, respectively, and send and receive messages to and from ECUs 4 through the communication lines 2 and 3, respectively. The CAN controllers 20 receive messages by sampling and obtaining signals output from the ECUs 4 to the communication lines 2 and 3, respectively, and send the received messages to the processing unit 11. In addition, the CAN controllers 20 send messages to the ECUs 4 by outputting the messages sent from the processing unit 11 as signals onto the communication line 2 or 3.
[0031] Each of the CAN controllers 20 is provided with a fixation control unit 12. A group of the CAN controller 20 and the fixation control unit 12 is connected to the common communication line 2 or 3. The fixation control unit 12 performs control to fix the potential of the connected communication line 2 or 3, thereby making it substantially impossible to transmit a message on the communication line 2 or 3. The control by the fixation control unit 12 is performed in response to a command from the CAN controller 20 in the same group. In the event that the transmission of an abnormal message on the communication line 2 or 3 is detected, the CAN controller 20 sends a command to the fixation control unit 12 to execute such control to fix the potential.
[0032] Fig. 3 is a block diagram illustrating the configuration of the CAN controller 20 according to the present embodiment. The CAN controller 20 according to the present embodiment is configured to include a control unit 21, a transmission unit 22, a reception unit 23, and a storage unit 24. The control unit 21 performs control for implementing message transmission and reception according to the CAN communication protocol by controlling the operation of each unit in the CAN controller 20. The control unit 21 performs message transmission by transmitting a transmission-destined message sent from the processing unit 11 in the gateway 10 to the transmission unit 22. The control unit 21 transmits a reception message sent from the reception unit 23 to the processing unit 11.When a message sent from the gateway 10 conflicts with a message sent from an ECU 4, the control unit 21 executes arbitration processing to decide which message transmission has priority. Note that this decision processing is performed by a decision part 21a in the control unit 21. Furthermore, the control unit 21 issues a control command to the fixation control unit 12.
[0033] The transmitting unit 22 transmits a message by converting digital data sent from the control unit 21 as a transmitting message into a binary electrical signal of dominant / recessive and outputting the signal to the communication line 2 or 3 for each bit. The receiving unit 23 samples the potential of the communication line 2 or 3 to obtain an electrical signal on the communication line 2 or 3 as digital data and sends the obtained digital data to the control unit 21 as a receiving message. Note that the receiving unit 23 performs sampling on the communication line 2 or 3 and sends digital data of a sampling result to the control unit 21 even while the transmitting unit 22 is transmitting messages.The decision part 21a in the control unit 21 determines whether or not data transmitted from the transmitting unit 22 matches the data received there by the receiving unit 23 in order to detect a collision with a message transmitted from another ECU 4 on the communication line 2 or 3. Note that the decision processing performed by the decision part 21a is performed according to the CAN communication protocol and will not be described in detail.
[0034] The CAN controller 20 according to the present embodiment has a function of detecting that the transmission of an abnormal message to the communication line 2 or 3 is being performed by another device. Note that the CAN controller 20 according to the present embodiment detects the transmission of an abnormal message by two methods described below. (1) Anomaly detection based on the number of consecutive blocks (2) Anomaly detection based on the number of cumulative bits
[0035] The CAN controller 20 includes a consecutive block number counter 21b and a bit number counter 21c in the control unit 21, and an allowable block number table 24a stored in the storage unit 24 to implement the aforementioned abnormality detection. The consecutive block number counter 21b is a counter for counting the number of messages that cannot be transmitted as a result of the decision processing by the decision part 21a, and is used for the abnormality detection of (1) above. The bit number counter 21c is a counter for counting the number of cumulative bits in the messages transmitted or received through the communication line 2 or 3, and is used for the abnormality detection of (2) above. The storage unit 24 is provided with a non-volatile memory element such as a mask read-only memory (RAM).ROM) or an electrically erasable programmable read-only memory (EEPROM) in which the allowable number of blocks table 24a has been prestored. The allowable number of blocks table 24a is used for the anomaly detection (1) described above.
[0036] Fig. Figure 4 is a schematic diagram illustrating an example of the allowable block count table 24a. The allowable block count table 24a stores the allowable block count along with an ID appended to the message. The ID appended to the message according to the CAN communication protocol represents the priority level of the message. The smaller the numerical value, the higher the priority level. The allowable block count is a numerical value indicating how many consecutive messages with the corresponding priority level will be blocked from transmission as a result of decision processing. In the example shown, the allowable block count for the highest priority level is set to 1 from 0x001, while the allowable block count for the highest priority level is set to 2 from 0x002.The number of allowable blocks can be calculated by the following equation. The number of allowed blocks = (the maximum number of consecutive messages with a high priority level that block a target message) + 1
[0037] Furthermore, in the case of detecting an abnormality as a result of the two abnormality detections described above, the CAN controller 20 according to the present embodiment causes the control unit 21 to issue a command to the fixing control unit 12. Accordingly, the fixing control unit 12 executes control to fix the potential of the communication line 2 or 3 to prevent a message from being sent to the communication line 2 or 3. By the CAN controller 20 and the fixing control unit 12 executing such control, the gateway 10 is able to notify the ECU 4 connected to the communication line 2 or 3 that an abnormality has been detected.
[0038] Fig. 5 is a circuit diagram showing a configuration example of the fixing control unit 12. While Fig. While Figure 5 illustrates the fixation control unit 12 connected to the communication line 2, the fixation control unit 12 connected to the communication line 3 also has a similar structure. According to the CAN communication protocol, the communication line 2, formed of a twisted pair of wires, actually includes two communication lines 2a and 2b. Therefore, the gateway 10 and the ECUs 4 send and receive differential signals to and from the communication line 2 or 3. The fixation control unit 12 includes a resistor R and a switch SW connected in series between the two communication lines 2a and 2b. The switch SW is normally in an open state. The fixation control unit 12 controls the closing of the switch SW in accordance with a command sent from the control unit 21.This connects the two communication lines 2a and 2b to each other via the resistor R, which fixes the potential of the two communication lines 2a and 2b to substantially the same potential. Thus, the gateway 10 and the ECUs 4 connected to the communication line 2 judge that the potential difference between the two communication lines 2a and 2b is approximately 0 V and determine that the signal on the communication line 2 is dominant.
[0039] Details of the abnormality detection processing performed by the CAN controller 20 in the gateway 10 according to the present embodiment will be described below. (1) Anomaly detection based on the number of consecutive blocks
[0040] In the communication system according to Embodiment 1, the gateway 10 is configured to detect an abnormality and notify the ECUs 4 thereof, while the individual ECUs 4 do not perform any abnormality detection processing. The gateway 10 needs to determine the number of consecutive blocks for all messages transmitted or received in the communication system. Thus, the allowable number of blocks table 24a stored by the CAN controller 20 in the gateway 10 in the storage unit 24 stores a link between the priority level and the allowable number of blocks for all messages to be transmitted or received on the communication line 2 or 3.
[0041] Each time the receiving unit 23 receives a message, the CAN controller 20 in the gateway 10 obtains the number of consecutive times that the transmission of this message is blocked as a result of the decision processing from the counted values in the consecutive block count counter 21b. The CAN controller 20 according to Embodiment 1 needs to obtain the consecutive block count for all messages to be received each time a message is received. Thus, the CAN controller 20 according to Embodiment 1 counts the consecutive block count by incrementing the consecutive block count counter 21b in the case where multiple consecutive messages exist on the communication line 2 or 3.For example, whether two messages are consecutive or not can be judged on the basis of whether a period of time from the time when the transmission of the last bit of the first message is completed to the time when the transmission of the first bit in the second message is started is shorter or longer than a predetermined period of time.
[0042] Fig. 6 is a timing chart illustrating the operation of the consecutive block number counter 21b according to Embodiment 1. When a state occurs in which a message is not sent to the communication line 2 or 3, the CAN controller 20 resets the consecutive block number counter 21b. This allows the value held by the consecutive block number counter 21b to be 0. In the case where messages with IDs of 1, 3, 5, and 6 are received sequentially in the described order, as shown in Fig. 6, the CAN controller 20 first judges that the message with ID 3 follows the message with ID 1 and adds 1 to the value of the consecutive block number counter 21b. This allows the value held by the consecutive block number counter 21b to be 1. Next, the CAN controller 20 judges that the message with ID 5 follows the message with ID 3 and adds 1 to the value of the consecutive block number counter 21b. This allows the value held by the consecutive block number counter 21b to be 2. Similarly, the CAN controller 20 judges that the message with ID 6 follows the message with ID 5 and adds 1 to the value of the consecutive block number counter 21b. This allows the value held by the counter 21b for the number of consecutive blocks to be 3.Thereafter, since no further messages follow the message with ID 6 and no message is sent on communication line 2 or 3, the CAN controller 20 resets the counter 21b for the number of consecutive blocks.
[0043] Accordingly, at the time when, for example, the reception of the message with ID 3 is completed, the value of the counter 21b for the number of consecutive blocks is 1, and therefore the CAN controller 20 can obtain 1 as the number of consecutive blocks for this message. Furthermore, at the time when, for example, the reception of the message with ID 5 is completed, the value of the counter 21b for the number of consecutive blocks is 2, and therefore the CAN controller 20 can obtain 2 as the number of consecutive blocks for this message. Furthermore, at the time when, for example, the reception of the message with ID 6 is completed, the value of the counter 21b for the number of consecutive blocks is 3, and therefore the CAN controller 20 can obtain 3 as the number of consecutive blocks for this message.As described above, the consecutive block number counter 21b according to Embodiment 1 counts the number of consecutive blocks for each message by counting the number of consecutive received messages.
[0044] Fig. 7 is a flowchart illustrating a method of consecutive block count processing performed by the CAN controller 20 in the gateway 10 according to Embodiment 1. The control unit 21 of the CAN controller 20 in the gateway 10 according to Embodiment 1 determines whether or not there is a message on the communication line 2 or 3 based on a result of scanning performed by the receiving unit 23 for the communication line 2 or 3 (step S1). If there is a message (S1: YES), the control unit 21 determines whether or not the message is consecutive to a previous message (step S2). If the message is consecutive (S2: YES), the control unit 21 adds 1 to the consecutive block count counter 21b (step S3) and returns the processing to step S1.If the message is not consecutive (S2: NO), the control unit 21 returns processing to step S1. Conversely, if there is no message on communication line 2 or 3 (S1: NO), the control unit 21 resets the consecutive block count counter 21b (step S4) and returns processing to step S1.
[0045] The CAN controller 20, which monitors a communication line 2 or 3 connected to it for a message and causes the consecutive block count counter 21b to count the number of consecutive messages, detects an abnormality upon receiving a message based on the counted value of the consecutive block count counter 21b and the number of permissible blocks stored in the permissible block count table 24a in the storage unit 24. Upon receiving a message at the receiving unit 23, the CAN controller 20 obtains a value counted by the consecutive block count counter 21b as the number of consecutive blocks. Furthermore, the CAN controller 20 obtains an ID (a priority level) included in the received message and obtains the permissible block count associated with the ID from the permissible block count table 24a.If the received number of consecutive blocks is greater than the number of allowable blocks, the CAN controller 20 may decide to execute the sending of an abnormal message for the communication line 2 or 3.
[0046] Fig. Figure 8 is a timing chart illustrating anomaly detection based on the number of consecutive blocks. Fig. 8 assumes a DoS attack in which consecutive illegal sending of messages with ID 2 is carried out. Furthermore, in the Fig. 4, assume that for the message with ID 1, the number of allowable blocks is set to 1, while for the message with ID 2, the number of allowable blocks is set to 2. The CAN controller 20 does not detect an abnormality for the first message with ID 1, the second message with ID 2, and the third message with ID 2, because the number of consecutive blocks counted by the consecutive block counter 21b is not greater than the number of allowable blocks.In case of receiving the next message with ID 2 (enclosed by the thick line), the CAN controller 20 detects an abnormality in sending and receiving the messages on the communication line 2 or 3 because the number of consecutive blocks counted by the consecutive block number counter 21b is 3, which is larger than the allowable block number of 2 set for the message with ID 2.
[0047] The CAN controller 20, which detected an anomaly, causes the control unit 21 to issue a command to the fixing control unit 12 to fix the potential. In response to the command, the fixing control unit 12 causes the switch SW to enter a conductive state to connect two electrical lines forming the communication line 2 or 3, thereby making it impossible to send messages to the communication line 2 or 3. Since such control by the gateway 10 makes it impossible to send messages to the communication line 2 or 3, in practice, after detecting an anomaly in the case of the Fig. 8 shown schedule, no messages are sent.
[0048] Fig. 9 is a flowchart illustrating a procedure of abnormality detection processing performed by the CAN controller 20 in the gateway 10 according to Embodiment 1. The control unit 21 of the CAN controller 20 in the gateway 10 according to Embodiment 1 determines whether or not a message is received from the receiving unit 23 (step S11). If no message is received (S11: NO), the control unit 21 waits until a message is received. If a message is received (S11: YES), the control unit 21 obtains the number of consecutive blocks counted by the consecutive block number counter 21b at that time (step S12).
[0049] Next, the control unit 21 obtains an ID included in the received message. The control unit 21 obtains the number of allowable blocks stored in the allowable block table 24a in the storage unit 24 based on the obtained ID (step S14). The control unit 21 determines whether or not the number of consecutive blocks obtained in step S12 is greater than the number of allowable blocks obtained in step S14 (step S15). If the number of consecutive blocks is greater than the number of allowable blocks (S15: YES), the control unit 21 detects an abnormality, issues a fixation control command to the fixation control unit 12 (step S16), and ends processing. If the number of consecutive blocks is not greater than the number of allowable blocks (S15: NO), the control unit 21 detects no abnormality and ends processing.
[0050] (2) Abnormality Detection Based on the Number of Cumulative Bits In the CAN controller 20 according to the present embodiment, the receiving unit 23 receives a message by scanning on the communication line 2 or 3. Here, the CAN controller 20 executes processing of adding 1 to the bit count counter 21c every time the receiving unit 23 receives information of 1 bit of a message. The CAN controller 20 obtains a count value from the bit count counter 21c at every predetermined time and compares the obtained value with a predetermined threshold. When the cumulative bit count counted by the bit count counter 21c is greater than the threshold, the CAN controller 20 detects that abnormal message transmission such as a DoS attack is being performed and sends a command to the fixing control unit 12 to execute control for fixing the potential of the communication line 2 or 3.In addition, after executing the comparison processing described above, the CAN controller 20 resets the bit count counter 21c at every predetermined time. Note that the threshold value compared with the cumulative number of bits may be stored in the storage unit 24 or stored in the control unit 21.
[0051] Fig. 10 is a flowchart illustrating an abnormality detection processing method executed by the CAN controller 20 in the gateway 10 according to Embodiment 1. The control unit 21 of the CAN controller 20 in the gateway 10 according to Embodiment 1 measures time using an internal time function or the like. The control unit 21 determines whether or not a predetermined period of time has elapsed (step S21). If a predetermined period of time has not elapsed yet (S21: NO), the control unit 21 determines whether or not 1 bit included in a message transmitted from an ECU 4 is received at the receiving unit 23 (step S22). If 1 bit of a message is not received (S22: NO), the control unit 21 returns the processing to step S21 and waits until a predetermined period of time has elapsed or 1 bit is received.
[0052] When 1 bit of the message is received by the receiving unit 23 (S22: YES), the control unit 21 adds 1 to the count value of the bit number counter 21c (step S23) and returns the processing to step S21.
[0053] If a predetermined period of time has elapsed (S21: YES), the control unit 21 obtains the number of cumulative bits counted by the bit number counter 21c (step S24). The control unit 21 determines whether the number of cumulative bits obtained in step S24 is greater than a predetermined threshold (step S25). If the number of cumulative bits is not greater than the threshold (S25: NO), the control unit 21 detects no abnormality and returns the processing to step S21. If the number of cumulative bits is greater than the threshold (S21: YES), the control unit 21 detects an abnormality, issues a fixation control command to the fixation control unit 12 (step S26), and ends the processing.
[0054] The gateway 10 according to Embodiment 1 having the above-described configuration transmits and receives a message to which a priority level (ID) is attached to and from an ECU 4 through the communication line 2 or 3. The CAN controller 20 in the gateway 10 includes a decision part 21 that executes so-called arbitration processing in which a decision is made based on a priority level to determine which message to transmit in the case where a message from its own device and a message from another device are transmitted simultaneously and the transmitted messages collide with each other. The CAN controller 20 according to Embodiment 1 causes the consecutive block number counter 21b to count the number of transmitted messages consecutively blocked by the decision processing as the number of consecutive blocks.In addition, the CAN controller 20 stores the number of consecutively permitted blocking messages as the number of permitted blocks in the permitted block count table 24a of the storage unit 24 in association with the priority levels attached to the messages received on the communication line 2 or 3. Each time a message is received, the CAN controller 20 compares the number of consecutive blocks with the number of permitted blocks for that message and detects an abnormality if the number of consecutive blocks is greater than the number of permitted blocks.
[0055] Since the transmission of a high-priority message is not easily blocked by the decision processing, while the transmission of a low-priority message is easily blocked, the gateway 10 according to the present embodiment can accurately detect the transmission of an abnormal message such as a DoS attack by using the number of allowable blocks stored for each of the priority levels of messages depending on the presence or absence of an abnormality.
[0056] The CAN controller 20 in the gateway 10 according to Embodiment 1 continuously monitors consecutive messages on the communication line 2 or 3 connected thereto and counts the number of consecutive messages as the number of consecutive blocks by the consecutive block counter 21b. Upon receiving a message at the receiving unit 23, the CAN controller 20 determines whether the number of consecutive blocks counted by the consecutive block counter 21b at that time is greater than the number of allowable blocks according to the priority level attached to the received message.Accordingly, even in a system configuration in which any of devices included in the communication system, for example, the gateway 10, performs anomaly detection processing while the ECUs 4 do not perform anomaly detection processing, the gateway 10 can detect the transmission of an abnormal message such as a DoS attack.
[0057] Furthermore, in the gateway 10 according to Embodiment 1, the CAN controller 20 causes the consecutive block count counter 21b to count the cumulative number of bits of a message transmitted or received on the communication line 2 or 3, and detects the transmission of an abnormal message on the communication line 2 or 3 when the cumulative number of bits exceeds a predetermined threshold in a predetermined period of time. Accordingly, the CAN controller 20 can accurately detect a DoS attack in which a large number of illegal messages are transmitted on the communication line 2 or 3.
[0058] Furthermore, in the gateway 10 according to Embodiment 1, the CAN controller 20 causes the fixation control unit 12 to execute control such as fixing the potential of the communication line 2 or 3 in the case where an abnormality is detected by the method described above. This control prohibits any ECU 4 from sending messages to the communication line 2 or 3. Therefore, in an ECU 4 that does not itself perform the abnormality detection processing, the occurrence of an abnormality can be detected from the fixed potential of the communication line 2 or 3, and error processing or the like can be performed.
[0059] While the gateway 10 and the ECUs 4 are configured to communicate according to the CAN communication protocol in the present embodiment, the configuration is not limited to this. The gateway 10 and the ECUs 4 may also be configured to perform communication according to a communication protocol other than CAN, such as TCP / IP, Ethernet (registered trademark), or FlexRay. While the communication system mounted on the vehicle 1 has been described as an example, the present technique can also be applied to a communication system other than vehicle-mounted communication systems, such as a communication system mounted on a moving body such as an aircraft or a ship, or a communication system installed in a factory, an office, or the like, and is not limited to the described example. (Variation example)
[0060] Fig. 11 is a block diagram illustrating the configuration of a vehicle-mounted communication system according to a variation example of Embodiment 1. The vehicle-mounted communication system according to the variation example is constructed such that two communication lines 2 and 3 are connected to a gateway 110, while three ECUs 104 are connected to each of the communication lines 2 and 3, as in the above-described embodiment shown in Fig. 1. However, in the vehicle-mounted communication system according to the variation example, the gateway 110 and the three ECUs 104 connected via the communication line 2 are also connected via a signal line 102. Furthermore, the gateway 110 and the three ECUs 104 connected via the communication line 3 are further connected via a signal line 103.
[0061] The abnormality detection processing performed by the gateway 110 according to the variation example is the same as the abnormality detection processing described above performed by the gateway 10 according to Embodiment 1. However, in the gateway 110 according to the variation example, the CAN controller 20 does not have the fixing control unit 12 and does not perform control for fixing the potential of the communication line 2 or 3 even when an abnormality is detected. Alternatively, when the CAN controller 20 detects an abnormality, the gateway 110 according to the variation example notifies the ECUs 104 of the detection via the signal line 102 or 103. The ECUs 104 notified by the gateway 110 via the signal line 102 or 103 are able to recognize that an abnormality occurs and execute error processing or the like. Embodiment 2
[0062] Fig. 12 is a block diagram illustrating the configuration of an in-vehicle communication system according to Embodiment 2. The in-vehicle communication system according to Embodiment 2 is configured such that two communication lines 2 and 3 are connected to a gateway 210, while three ECUs 204 are connected to each of the communication lines 2 and 3, as in the embodiment shown in Fig. 1. However, in the vehicle-mounted communication system according to Embodiment 2, processing for detecting the transmission of an abnormal message to the communication line 2 or 3 may be executed in each ECU 204, not only in the gateway 210.
[0063] Each ECU 204 according to Embodiment 2 is configured to include a processing unit 241, a CAN controller 220, a fixation control unit 12, etc. The processing unit 241 is configured with an arithmetic processing device such as a CPU or an MPU. The processing unit 241 reads and executes a program stored in an unillustrated ROM or the like to perform various processing related to controlling the vehicle 1. The fixation control unit 12 has the same configuration as that in the gateway 10 according to Embodiment 1 (see Fig. 5) contained.
[0064] Although not shown, the gateway 210 according to Embodiment 2 has substantially the same configuration as the gateway 10 according to the embodiment shown in Fig. 2, except that the CAN controller 220, which is the same as that in the ECU 204, is included instead of the CAN controller 20.
[0065] The CAN controllers 220 according to Embodiment 2 included in the gateway 210 and the ECU 204, like the CAN controller 20 according to Embodiment 1, perform (1) abnormality detection based on the number of consecutive blocks and (2) abnormality detection based on the number of cumulative bits, and, when an abnormality is detected, perform control of fixing the potential of the communication line 2 or 3 by sending a command to the fixing control unit 12. Note that (1) abnormality detection based on the number of consecutive blocks performed by the CAN controller 220 according to Embodiment 2 is somewhat different from that described in Embodiment 1. A method of abnormality detection based on the number of consecutive blocks performed by the CAN controller 220 according to Embodiment 2 will be described below.
[0066] The CAN controller 220 according to Embodiment 2 detects an abnormality for a message sent by itself by counting the number of consecutive blocks, while detecting no abnormality for a message sent from another device. Thus, in the allowable number of blocks table 24a stored by the CAN controller 220 according to Embodiment 2 in the storage unit 24, a link between the priority level and the number of allowable blocks for messages to be sent by itself is stored. In the case where each ECU 204 is configured to send a message using only one ID, no ECU 204 needs to count the allowable number of blocks table 24a as shown in Fig. 4, but only needs to store a value that corresponds to the number of allowable blocks set for itself.
[0067] In the case where a message to be transmitted is sent from the processing unit 11 or 241, the CAN controller 220 attempts to transmit the message to the communication line 2 or 3 at the transmitting unit 22. In the case where a message transmitted from its own device and a message transmitted from another device collide with each other, and the message transmitted from its own device is blocked by the decision processing of the decision part 21a based on the sensing result for the communication line 2 or 3 by the receiving unit 23, the CAN controller 220 adds 1 to the value of the consecutive block number counter 21b. Thereafter, the CAN controller 220 repeatedly attempts to transmit messages from itself and increments the value of the consecutive block number counter 21b each time the transmission of a message is blocked.
[0068] Here, each time the CAN controller 220 blocks the transmission of a message itself, it determines whether the number of consecutive blocks counted by the consecutive block counter 21b is greater than the number of permissible blocks stored in the permissible block table 24a in association with the priority level of the message. If the number of consecutive blocks is greater than the number of permissible blocks, the CAN controller 220 detects an abnormality in the transmission and reception of a message on the communication line 2 or 3 and issues a fixation control command to the fixation control unit 12.
[0069] Fig. 13 is a timing chart illustrating the operation of the consecutive block number counter 21b according to Embodiment 2. Fig. 13 illustrates an example where a message with ID 5 is sent from the CAN controller 220. In the case where a message transmission request is sent from the processing unit 11 or 241, the CAN controller 220 according to Embodiment 2 attempts to transmit the message to the communication line 2 or 3. Here, in the case where a message with ID 1 is transmitted on the communication line 2 or 3, the transmission of the message is blocked, and the CAN controller 220 adds 1 to the value of the consecutive block count counter 21b. This allows the number of consecutive blocks counted by the consecutive block count counter 21b to change from 0 to 1.
[0070] After the transmission of the message with ID 1 is completed, the CAN controller 220 attempts to transmit a message from its own device again. Here, a message with ID 3 is transmitted simultaneously on the communication line 2 or 3, and the transmission of the message from its own device is blocked by the decision processing, so the CAN controller 220 adds 1 to the value of the consecutive block count counter 21b. This allows the number of consecutive blocks counted by the consecutive block count counter 21b to change from 1 to 2. Similarly, after the transmission of the message with ID 3 is completed, the transmission of a message from the CAN controller 220 itself is blocked by the transmission of a message with ID 4, and therefore the number of consecutive blocks counted by the consecutive block count counter 21b is changed from 2 to 3.
[0071] After the transmission of the message with ID 4 is completed, the CAN controller 220 attempts to transmit a message with ID 5, which is assumed to be successfully transmitted. Here, the value of the counter 21b for the number of consecutive blocks is not changed. According to the Fig. 4, the number of permissible blocks is 5 for the message with ID 5, while the value of the counter 21b for the number of consecutive blocks obtained when the message with ID 5 is in the Fig. 13 is 3. Since the number of consecutive blocks is not greater than the number of allowable blocks, the CAN controller 220 does not detect an abnormality but performs normal message transmission. The CAN controller 220 resets the consecutive block counter 21b after the transmission of the message with ID 5 is completed. This resets the value counted by the consecutive block counter 21b to 0.
[0072] Fig. 14 is a timing chart illustrating anomaly detection based on the number of consecutive blocks according to Embodiment 2. In Fig. 14, a DoS attack is assumed, where illegal transmission of messages with ID 4 is carried out consecutively. The CAN controller 220 according to Embodiment 2 adds 1 to the value of the consecutive block count counter 21b each time the transmission of a message with ID 5 is blocked by its own device. Here, the CAN controller 220 compares the number of consecutive blocks counted by the consecutive block count counter 21b with the number of permissible blocks associated with the ID of the message to be transmitted. If the number of consecutive blocks is not greater than the number of permissible blocks, the CAN controller 220 repeatedly attempts to transmit messages until the transmission of the message is completed.When the number of consecutive blocks is greater than the number of allowable blocks (when the number of consecutive blocks is 6 in the present example), the CAN controller 220 detects an abnormality in sending and receiving the message on the communication line 2 or 3 and outputs a fixation control command to the fixation control unit 12.
[0073] In the case where the potential of the communication line 2 or 3 is fixed by the fixing control unit 12 of another device, the CAN controller 220 cannot perform any processing other than receiving a recessive signal by the receiving unit 23. Therefore, in a case where, for example, recessive signals are consecutively received by the receiving unit 23 for a predetermined period of time, the CAN controller 220 judges that the potential of the communication line 2 or 3 is fixed by another device. This allows the CAN controller 220 to recognize that an abnormality is detected on the other device side and to perform predetermined error processing.
[0074] Fig.15 is a flowchart illustrating a procedure of abnormality detection processing performed by the CAN controller 220 according to Embodiment 2. The control unit 21 of the CAN controller 220 according to Embodiment 2 determines whether or not a message transmission request is sent from the processing unit 11 or 241 to another device (step S41). If no transmission request is sent (S41: NO), the control unit 21 waits until the message transmission request is sent. If a message transmission request is sent (S41: YES), the control unit 21 obtains an ID of a message to be transmitted sent from the processing unit 11 or 241 (step S42). Based on the obtained ID, the control unit 21 obtains the number of allowable blocks stored in the allowable number of blocks table 24a in the storage unit 24 (step S43).
[0075] Next, the control unit 21 sends a message intended for transmission by sending the message sent from the processing unit 11 or 241 to the transmission unit 22 (step S44). Here, the control unit 21 determines whether or not the transmission of its own message is blocked by the transmission of a message from another device (step S45). If the transmission of the message is not blocked (S45: NO), the control unit 21 completes the transmission of the message and ends the processing.
[0076] If the transmission of the message is blocked (S45: YES), the control unit 21 adds 1 to the consecutive block count counter 21b (step S46). Furthermore, the control unit 21 determines whether the number of consecutive blocks counted by the consecutive block count counter 21b at this time is greater than the number of permissible blocks obtained at step S43 (step S47). If the number of consecutive blocks is not greater than the number of permissible blocks (S47: NO), the control unit 21 returns the processing to step S44 and continues the transmission of the message. If the number of consecutive blocks is greater than the number of permissible blocks (S47: YES), the control unit 21 detects an abnormality, issues a fixation control command to the fixation control unit 12 (step S48), and ends the processing.
[0077] The CAN controller 220 according to Embodiment 2 described above increments the count value of the consecutive block count counter 21b each time the transmission of a message attempted in response to a transmission request from the processing unit 11 or 241 is blocked as a result of decision processing. Furthermore, the CAN controller 220 determines whether the number of consecutive blocks counted by the consecutive block count counter 21b is greater than the number of allowable blocks stored in the allowable block count table 24a in association with the ID attached to a message intended for transmission, and detects a communication abnormality.This configuration allows the CAN controller 220 to detect an anomaly at the time it determines that the number of consecutive blocks is greater than the number of allowable blocks, even before the transmission of its own message is completed.
[0078] Since the other parts of the configuration in the in-vehicle communication system according to Embodiment 2 are similar to those in the in-vehicle communication system according to Embodiment 1, the same parts are designated by the same reference numerals and will not be described in detail. LIST OF REFERENCE SYMBOLS 1 vehicle 2, 3 Communication line 4 ECU (communication device) 10 Gateway (communication device) 11 Processing unit 12 Fixing control unit (control unit) 20 CAN controller (communication unit) 21 Control unit (detection unit, second detection unit) 21a Decision part 21b Counter for the number of consecutive blocks (storage unit for storing the number of consecutive blocks) 21c Bit counter (storage unit for storing the cumulative number of bits) 22 Transmitter unit 23 Receiving unit 24 Memory unit (memory unit for storing the permitted number of blocks) 24a Table for the permissible number of blocks 102, 103 Signal line 104 ECU 110 Gateway 204 ECU 210 Gateway 220 CAN controller 241 processing unit R resistance SW switch
Claims
[1] Communication device (4, 10, 104, 110, 204, 210), comprising: a communication unit (20, 220) for sending and receiving a message having a priority level via a communication line (2, 3); a decision part (21a) for deciding, in a case where the transmission of a message from the communication device (4, 10, 104, 110, 204, 210) and the transmission of a message from another device are carried out simultaneously, to determine which message is to be transmitted based on the priority level; a storage unit (21b) for storing a number of consecutive blocks corresponding to the number of messages whose transmission has been successively blocked as a result of the decision by the decision part (21a); a storage unit (24) for storing a permissible number of blocks corresponding to the number of consecutive messages whose blocking has been permitted, in association with the priority level; and a detection unit (21) for detecting an abnormality in communication based on the number of consecutive blocks stored in the storage unit (21b) for storing the number of consecutive blocks and the number of permissible blocks stored in the storage unit (24) for storing the permissible number of blocks, for each message to be sent or received by the communication unit (20, 220), wherein, in a case where the communication unit (20, 220) receives a message, the detection unit (21) determines whether or not the number of consecutive blocks stored in the storage unit (21b) for storing the number of consecutive blocks is greater than the number of permissible blocks stored in the storage unit (24) for storing the permissible number of blocks in accordance with the priority level attached to the message. [2] The communication device (4, 10, 104, 110, 204, 210) according to claim 1, wherein the detection unit (21) determines, each time a message is to be transmitted from the communication unit (20, 220), whether or not the number of consecutive blocks stored in the storage unit (21b) for storing the number of consecutive blocks is larger than the number of permissible blocks stored in the storage unit (24) for storing the permissible number of blocks in accordance with the priority level attached to the message, and detects that an abnormality occurs with respect to communication at a time when it determines that the number of consecutive blocks is larger than the number of permissible blocks. [3] Communication device (4, 10, 104, 110, 204, 210) according to one of claims 1 and 2, further comprising: a storage unit (21c) for storing a cumulative number of bits, in which the cumulative number of bits in a message sent or received on the communication line (2, 3) is stored; and a second detection unit (21) for detecting an abnormality in communication based on the cumulative number during a predetermined period of time. [4] Communication device (4, 10, 104, 110, 204, 210) according to one of claims 1 to 3, further comprising: a control unit (12) for executing control such that a potential of the communication line (2, 3) is fixed when the detection unit (21) detects an abnormality. [5] Communication device (4, 10, 104, 110, 204, 210) according to one of claims 1 to 3, further comprising: a notification unit (110) for notifying another device when the detection unit (21) detects an abnormality via a signal line (102, 103) other than the communication line (2, 3).
Citation Information
Patent Citations
Communication controller, communication system, and communication control method
JP2011103577A
Can system and node
JP2014086812A
A communication controller and a communication method
EP1094639A2
Method for detecting a defective node
US9634859B2
System and method for real-time reporting of anomalous internet protocol attacks
WO2013188611A2
