The present invention relates to a transmission device and a reception device in a communication system which are connected by a bus, a transmission method, and a reception method.
As an in-vehicle network, a CAN (Controller Area Network) is popular. The CAN is a serial communication protocol employing a bus type network. Messages from each node connected to the bus are broadcast to all nodes connected to the bus. The messages do not include identification information of a transmission source node and a destination node. Therefore, in a reception node, it is not possible to simply determine whether a received message is a message from a correct communication partner.
In order to ensure integrity of a message and to prevent a replay attack from an unauthorized device connected to the CAN, a method using a message authentication code (MAC) is proposed. For example, there is proposed a method for generating the MAC for an ordinary message, and transmitting the message containing the MAC, each time when generating/transmitting the ordinary message (refer to PTL 1, for example).
PTL 1: Unexamined Japanese Patent Publication No. 2013-98719
The present invention provides a technique for improving security while suppressing the increase in the load of resources of a network.
A transmission device according to a certain aspect of the present invention has a first generator, a second generator, and a transmitter. The first generator generates data to be broadcast-transmitted. The second generator generates a message authentication code for at least the data generated in the first generator. The transmitter broadcast-transmits the data generated in the first generator, and the message authentication code generated in the second generator. The second generator omits generating message authentication codes for one or some of a plurality of pieces of data generated in the first generator.
An arbitrary combination of the above configuration elements, and a conversion of expressions of the present invention among methods, devices, systems, computer programs, and recording mediums storing therein computer programs, are also effective as an aspect of the present invention.
According to the present invention, security can be improved while suppressing the increase in the load of resources of a network.
Prior to the description of the exemplary embodiment of the present invention, problems of a conventional device will be briefly described. When a MAC is generated each time when the ordinary message is generated/transmitted, the load of the node becomes large and the power consumption also increases. Further, because the number of messages increases, a bus occupation rate also increases.
Hereinafter, a transmission device and a reception device according to an exemplary embodiment of the present invention will be described. The exemplary embodiment of the present invention relates to an in-vehicle network in which a plurality of ECUs (Electronic Control Units) mounted in a vehicle are connected as nodes, and a message containing a message identifier (ID), data, and the MAC is broadcast. Hereinafter, the exemplary embodiment of the present invention will be described by exemplifying a CAN system as such a network. As described above, the CAN employs a bus type network, and a message from each ECU connected to the bus is broadcast to all ECUs connected to the bus. In recent years, along with a progress of equipment of electronic devices in a vehicle, the number of ECUs mounted in one vehicle and an amount of data handled by the ECUs are increasing, accordingly a traffic amount of a CAN bus is increasing. Further, along with an increase and sophistication of the ECUs, power consumption of batteries is also increasing.
The data frame in
In the present exemplary embodiment, mainly ID field F1 and data field F2 are focused. An ID stored in ID field F1 (hereinafter, also appropriately referred to as CANID) is identification information that expresses a kind and priority of a message. In the present specification, a data frame in a transmittable state is called a message. A message in the CAN is a message concerning a specific function in the vehicle. The function contains a monitoring function for monitoring a specific monitoring target, and a control function for controlling a specific control target. For example, messages concerning specific functions in the vehicle include a message containing speed information, a message for instructing opening and closing of the door.
The CANID is related to information contained in a transmitted message. An ECU that has received the message determines the information contained in the message, based on the CANID. Data field F2 can store data of maximum 64 bits.
As illustrated in
In this way, a CAN protocol may be susceptible to impersonation. Further, because the message is broadcast-transmitted to the CAN bus, the message is more likely to be stolen than the message that is unicast-transmitted.
Against these threats, in the present exemplary embodiment, a CAN message is authenticated by using the MAC. The MAC is generated by applying a predetermined MAC algorithm to data to be authenticated and to a common key. The common key is a secret key shared beforehand among ECUs connected to the CAN. The MAC generation algorithm includes a scheme using a hash function (HMAC), and a scheme using a block encryption algorithm (OMAC/CMAC, CBC-MAC, PMAC). The reception-side ECU calculates the MAC by applying the MAC algorithm used by a transmission-side ECU, to the data to be authenticated contained in the message and to the common key of the reception-side ECU. When the calculated MAC and the received MAC coincide with each other, it is determined that the authentication is successful, and when the calculated MAC and the received MAC do not coincide with each other, it is determined that the authentication is unsuccessful.
Therefore, unless the common key is leaked out, a message from an unauthorized ECU or from a malicious transmission source will not be authenticated. A retransmission attack from the unauthorized ECU and the like that have received the authorized message and MAC can be coped with by containing a count value and the like in the data to be authenticated. In the present exemplary embodiment, a data length of the MAC generated by the transmission-side ECU is 64 bits or smaller. When the MAC having a data length greater than 64 bits is calculated, arbitrary 64 bits or smaller bits are extracted to be used.
Hereinafter, in the present specification, a message that contains information concerning a specific function (hereinafter, appropriately referred to as ordinary data) and does not contain the MAC in a data field is called a main message. The main message is a message transmitted for carrying out an ordinary control. A control value of a specific function or the like corresponds to the ordinary data. A message not containing ordinary data and containing the MAC in the data field is called a MAC message. A message containing both ordinary data and the MAC in the data field is called a MAC-attached main message.
In the above description, the CANID is related to the information contained in the message. In this case, depending on whether the message is the main message, the MAC message, or the MAC-attached main message, the message may be attached with a separate ID or may be attached with the same ID.
Each time when each ECU transmits a main message, a process for generating the MAC is carried out. When the MAC message is transmitted to the CAN, a processing load and consumption current of the ECU increase, and the bus occupation rate also increases. Because the process for generating the MAC includes an encryption process, the processing load of the ECU increases. Because some of ECUs in the vehicle have insufficient processing capacity, suppressing the processing load is desirable. When consumption current of the ECU increases in the vehicle, power of batteries is consumed rapidly, and the battery is easily dead, and battery life becomes short. Therefore, the consumption current of the ECU is desirably low. In the CAN, in order to avoid a communication failure due to the increase in the bus occupation rate, the bus occupation rate is generally set lower than a certain constant value. When the MAC message is transmitted each time when a main message is transmitted, the number of messages simply becomes a double of the number of messages in the conventional art.
In view of the above problems, the exemplary embodiment described below provides a method for efficiently ensuring security while decreasing transmission frequency, by devising a timing of transmitting the MAC, instead of transmitting the MAC each time a main message is transmitted. That is, by omitting generation/transmission of MACs for one or some pieces of ordinary data out of a plurality of pieces of ordinary data to be transmitted, the increase in the processing load and consumption current of the ECUs is suppressed, and the increase in the bus occupation rate is also suppressed. In the subsequent description, the expression of “generation/transmission” means any one of “generation and transmission” and “transmission only”.
Application processor 10 is realized by a processor, a memory, and an application programs loaded in the memories, for example. Message processor 30 is realized by a processor, a memory, a message processing program loaded in the memories, and a CAN controller, for example. A configuration of installing all functions in the CAN controller is also possible. Transmitting and receiving unit 50 is realized by a transceiver, for example.
Application processor 10 is connected to a control target or a monitoring target of each ECU 100 (for example, engine, steering, brake, or other various auxiliary machines), and obtains status information or instruction information from the control target or the monitoring target. Application processor 10 generates data to be broadcast-transmitted in the CAN, based on the information obtained from the control target or the monitoring target, and delivers the data to message processor 30. Further, application processor 10 receives from message processor 30 the data contained in a main message received via CAN bus 200 (through CAN bus 200 from other ECUs), and controls the control target or the monitoring target in accordance with the data.
Message processor 30 generates a message at a message transmission time, and analyzes the message at a message reception time. A concrete configuration of message processor 30 will be described later.
Transmitting and receiving unit 50 broadcast-transmits the message generated by message processor 30, to CAN bus 200. As described above, the message includes the main message, the MAC message, and the MAC-attached main message. Message processor 30 generates the MAC for at least the ordinary data generated by application processor 10. The MAC may be transmitted by being contained in a main message containing the ordinary data, or transmitted by a separate message. In the former case, the MAC-attached main message is transmitted, and in the latter case, a main message and the MAC message are transmitted separately. Both cases are the same in that the ordinary data and the MAC for the ordinary data are broadcast-transmitted to CAN bus 200.
Transmitting and receiving unit 50 receives, from CAN bus 200, a message generated by other ECUs 100 and broadcast-transmitted to CAN bus 200. Transmitting and receiving unit 50 delivers the received message to message processor 30.
CANID extractor 32 extracts the CANID from the ID field of the main message generated by main message generator 31 (S10 in
MAC generation-timing determiner 34 determines whether it is a timing for generating the MAC, based on the extracted CANID and data (S12). A concrete example of a determining method will be described later. If it is a MAC-generation-necessary timing (Y in S13), MAC generation-timing determiner 34 instructs MAC generator 35 to generate the MAC. MAC generator 35 generates the MAC, based on the extracted CANID and data (S14). Specifically, MAC generator 35 generates the MAC for an authentication target containing at least the CANID and data, by applying a predetermined MAC algorithm to the authentication target, using common key 35a held by MAC generator 35. MAC generator 35 delivers the generated MAC to MAC message generator 36.
MAC message generator 36 stores the MAC obtained from MAC generator 35 into the data field of the CAN message. Further, MAC message generator 36 stores in the ID field the CANID indicating a message containing the MAC for the data. For example, there may be used a value obtained by subtracting a predetermined fixed value from a value of the CANID indicating a message containing the data itself. MAC message generator 36 determines values of other items of the CAN message, and completes a MAC message. MAC message generator 36 delivers the generated MAC message to transmitting and receiving unit 50, and transmitting and receiving unit 50 broadcast-transmits the MAC message (S15). In step S13, if it is not a MAC-generation-necessary timing (N in S13), the MAC generation/transmission process in step S14 and step S15 is skipped.
MAC verification timing determiner 44 determines whether it is a timing for verifying the MAC, based on the extracted CANID and data (S22). While a concrete example of a determining method will be described later, the same determining method as that of transmission-side MAC generation-timing determiner 34 is used. If it is a MAC-verification-necessary timing (Yin S23), MAC verification timing determiner 44 instructs MAC generator 45 to generate the MAC. MAC generator 45 generates the MAC, based on the extracted CANID and data (S24). A generation method is the same as the generation method in transmission-side MAC generator 35. Reception-side MAC generator 45 holds common key 45a which is the same as common key 35a held by transmission-side MAC generator 35. MAC generator 45 delivers the generated MAC to MAC comparator 46.
ECU 100 waits for an arrival of the MAC message for the main message (N in S25). If the MAC message is received (Y in S25), transmitting and receiving unit 50 receives the MAC message from CAN bus 200, and delivers the received MAC message to message analyzer 41. Data field extractor 43 extracts the MAC stored in the data field of the MAC message received by message analyzer 41 (S26). Data field extractor 43 delivers the extracted MAC to MAC comparator 46.
MAC comparator 46 compares the MAC generated by MAC generator 45 with the MAC extracted by data field extractor 43 (S27). If both MACs coincide with each other (Y in S28), MAC comparator 46 determines that MAC verification is successful, and notifies data deliverer 47 of the successful verification. Data deliverer 47 delivers the data obtained from data field extractor 43 and reserved, to application processor 10 (S29). Application processor 10 controls a control target or monitors a monitoring target, in accordance with obtained data.
In step S28, if the MACs do not coincide with each other (N in S28), MAC comparator 46 determines that MAC verification is unsuccessful, and notifies data deliverer 47 of the unsuccessful verification. Data deliverer 47 does not deliver the data obtained from data field extractor 43 and reserved, to application processor 10. In step S23, if it is not a MAC-verification-necessary timing (N in S23), processes in steps S24 to S28 are skipped. Data deliverer 47 unconditionally delivers the data obtained from data field extractor 43 to application processor 10 (S29).
As illustrated in
If n or more main messages are held (Y in S31), message analyzer 41 discards an oldest main message out of a plurality of main messages held in main message temporary holder 48 (S32). Message analyzer 41 stores a received new main message into main message temporary holder 48 (S33). That is, main message temporary holder 48 is managed in a FIFO (FIRST-IN FIRST-OUT) manner. Processing a main message stored in main message temporary holder 48 is reserved until there is an instruction from message analyzer 41.
In step S31, if the number of main messages held in main message temporary holder 48 is less than n (N in S31), step S32 is skipped, and message analyzer 41 stores the received new main message into main message temporary holder 48 (S33).
In step S30, if a main message is not held in main message temporary holder 48 (N in S30), MAC verification timing determiner 44 determines whether MAC verification for the main message is necessary (S34). A concrete example of the determining method will be described later. If MAC verification is necessary (Y in S34), MAC verification timing determiner 44 notifies message analyzer 41 of the verification necessity. Message analyzer 41 stores a received new main message into main message temporary holder 48 (S33).
In step S34, if MAC verification is not necessary (N in S34), data deliverer 47 delivers the data obtained from data field extractor 43 to application processor 10 (S35). Application processor 10 controls the control target, or monitors the monitoring target, in accordance with the obtained data.
MAC comparator 46 compares the MAC generated from the main message with the MAC extracted from a received MAC message (S42). If both MACs coincide with each other (Y in S42), data deliverer 47 delivers the data obtained from data field extractor 43 to application processor 10 (S43). Application processor 10 controls the control target, or monitors the monitoring target, in accordance with the obtained data in accordance with the obtained data.
In the case of the successful verification determined by MAC comparator 46, if other main messages are held in main message temporary holder 48 (Y in S44), the held other main messages are discarded (S45). If other main messages are not held (N in S44), the process in step S45 is skipped.
In step S42, if the MACs do not coincide with each other (N in S42), the process shifts to step S40, and a determination about whether a verification-necessary main message is held is repeated.
In step S40, if a verification-necessary main message is not held in main message temporary holder 48 (N in S40), message analyzer 41 discards the received MAC message (S46).
In the case illustrated in
At a reception time point of a fourth main message (authorized), already three main messages are held in main message temporary holder 48. Therefore, the oldest header main message (unauthorized) is discarded by step S32 in
When main message temporary holder 48 holds a plurality of verification-necessary main messages, the main messages are verified starting from a new main message. In this example, verification is started from the third main message (unauthorized). The MAC generated from the third main message (unauthorized) does not coincide with the MAC contained in the received MAC message (authorized). Next, header main message (authorized) is verified. The MAC generated from the header main message (authorized) coincides with the MAC contained in the received MAC message (authorized). Therefore, the header main message (authorized) is delivered to application processor 10. In step S45 in
Further, generating the MAC of a main message prior to the reception of the MAC message is also considered. However, when a large amount of unauthorized main messages are transmitted, the load of ECU 100 due to generation of MACs of the main messages increases. In the present exemplary embodiment, after the reception of the MAC message, verification is carried out by sequentially generating MACs starting from a new main message. At a detection time point of a verification-successful main message, the remaining main messages are discarded. Accordingly, the increase in the load of ECU 100 can be suppressed.
Out of the two main messages held in main message temporary holder 48, a verification-necessary main message in step S40 in
Next, the MAC message (authorized) is further received. The MAC generated from the header main message (authorized) coincides with the MAC contained in the MAC message (unauthorized) received this time. Therefore, the header main message (authorized) is delivered to application processor 10. In step S45 in
Out of the two main messages held in main message temporary holder 48, a verification-necessary main message in step S40 in
Against the attack of inserting the unauthorized message into between the authorized main message and the authorized MAC message, setting the priority of the MAC message higher than the priority of the main message is effective. This can be realized by setting the CANID of each message so that the CANID of the MAC message becomes always smaller than the CANID of the main message. The reason is that in the CAN, as described above, when a plurality of messages are transmitted simultaneously, a message having a smaller value of the CANID is prioritized by communication arbitration. By setting the priority of the MAC message higher than the priority of a main message, it is possible to lower the probability of inserting a large amount of unauthorized messages into between the authorized main message and the authorized MAC message.
So far, the description has been given of a scheme, in which when the MAC-verification-necessary main message is received, the data contained in the main message in data deliverer 47 is reserved until the MAC message corresponding to the main message is received. Even when data deliverer 47 has received the MAC-verification-necessary main message, a scheme for data deliverer 47 to instantly deliver data contained in the main message to application processor 10 can be also employed. In this scheme, after receiving the MAC-verification-necessary main message, when data deliverer 47 cannot receive the MAC message corresponding to the main message within a predetermined set time, data deliverer 47 instructs application processor 10 to return the control state to a state before the data contained in the main message is delivered. This scheme is desirable for application to a control which does not relatively affect safety of the vehicle.
Data deliverer 47 may instruct application processor 10 to shift to a fail-safe mode, instead of instructing application processor 10 to return the control state to a state before the data contained in the main message is delivered.
MAC verification timing determiner 44 determines whether it is a timing for verifying the MAC, based on the extracted CANID and data (S22). If it is a MAC-verification-necessary timing (Y in S23), MAC generator 45 generates the MAC, based on the extracted CANID and data (S24). MAC comparator 46 compares the MAC generated by MAC generator 45 with the MAC extracted and separated by data field extractor 43 (S27a). If both MACs coincide with each other (Y in S28), MAC comparator 46 determines that MAC verification is successful, and notifies data deliverer 47 of the successful verification. Data deliverer 47 delivers the data obtained from data field extractor 43 and reserved, to application processor 10 (S29). Application processor 10 controls the control target, or monitors the monitoring target, in accordance with the obtained data.
In step S28, if the MACs do not coincide with each other (N in S28), MAC comparator 46 determines that MAC verification is unsuccessful, and notifies data deliverer 47 of the unsuccessful verification. Data deliverer 47 does not deliver the data obtained from data field extractor 43 and reserved, to application processor 10. In step S23, If it is not a MAC-verification-necessary timing (N in S23), processes in step S24, step S27a, and step S28 are skipped, and data deliverer 47 unconditionally delivers the data obtained from data field extractor 43 to application processor 10 (S29).
The above-described scheme for transmitting the MAC by the same message is effective when the quantity of ordinary data to be transmitted is small. The scheme for transmitting the MAC by the same message has basically an effect of decreasing the number of messages, as compared with the scheme for transmitting the MAC by a separate message. However, when the amount of the ordinary data is large, it becomes difficult to make the ordinary data and the MAC coexist in the 64-bit data field. In this case, at least one of the ordinary data and the MAC needs to be divided into a plurality of pieces, and accordingly, the number of messages increases. Further, the scheme for transmitting the MAC by a separate message usually facilitates simplification of the process of message processor 30. Therefore, the scheme for transmitting the MAC by the same message is not necessarily more advantageous than the scheme for transmitting the MAC by a separate message. Accordingly, both schemes are preferably set according to an application by considering the amount of the ordinary data and the like.
Hereinafter, the MAC message generation/transmission timing will be described. Each ECU 100 receives a message containing ordinary data, and executes a specific control by using a value indicated by the ordinary data. As described above, reception-side ECU 100 also determines a timing for adding the MAC, like transmission-side ECU 100. Reception-side ECU 100 reserves the control as long as verification of an arrived authorized MAC is not successful. Accordingly, unauthorized control from the attacker is prevented.
While there are various kinds of ordinary data transmitted via the CAN in the vehicle, there is also a large amount of ordinary data to be cyclically transmitted even when a value to be transmitted does not change. For example, vehicle speed information is cyclically transmitted from ECU 100 of a vehicle speed sensor.
In view of the above situation, a control scheme for generating/transmitting a MAC only when a value to be transmitted changes is considered. In this case, the load of ECU 100 and CAN bus 200 can be lowered while ensuring security. Hereinafter, a description will be given of a method for determining the MAC generation/transmission timing in accordance with an own feature or characteristic of the ordinary data to be transmitted or importance and the like of the ordinary data to be transmitted.
First, as a first example of the group for determining a timing due to a data change, a description will be given of a scheme for generating/transmitting a MAC when data expressing a state of the control target or the monitoring target has changed. For example, when ON/OFF of the door lock has changed, the MAC is generated/transmitted. Further, when the gear position (P, N, D, R) has changed, the MAC is generated/transmitted. In this way, the state of the control target or the monitoring target is expressed by a binary value and is expressed by a multiple value, depending on the case. Further, the state of the control target or the monitoring target may be expressed by a more detailed value like the engine rotation number. Data having the same value as that of the last-time data can be said to be data of low importance. Even when the data is unauthorized data, an influence given to the control is small. Therefore, generation/transmission of the MAC for the data is omitted by prioritizing a load decrease.
In third phase P3 and fifth phase P5 where the value of data to be transmitted changes, transmission-side ECU 100 generates a main message and the MAC message for the main message. Both the main message and the MAC message are transmitted from transmission-side ECU 100 to reception-side ECU 100.
Next, as a second example of the group for determining a timing due to a data change, a description will be given of a scheme for generating/transmitting a MAC when a change amount of a value expressed by data has exceeded a threshold value. The MAC is generated/transmitted when the engine rotation number has exceeded 100 rpm from a value of the engine rotation number at the last generation/transmission time of the MAC. Data having a small change amount of a value expressed by the data can be said to be data of low importance. Even when the data is unauthorized data, an influence given to the control is small. Therefore, generation/transmission of the MAC for the data is omitted by prioritizing a load decrease.
An absolute value of a difference between the engine rotation number (999 rpm) transmitted last time by the MAC-message-generated main message and the engine rotation number (1000 rpm) contained in header main message M1 is not more than 100 rpm. Similarly, an absolute value of a difference between the engine rotation number (999 rpm) transmitted last time by the MAC-message-generated main message and the engine rotation number (1002 rpm) contained in second main message M2 is also not more than 100 rpm. Similarly, an absolute value of a difference between the engine rotation number (999 rpm) transmitted last time by the MAC-message-generated main message and the engine rotation number (1005 rpm) contained in third main message M3 is also not more than 100 rpm. Therefore, MAC messages for header main message M1, second main message M2, and the third main message are not generated/transmitted.
An absolute value of a difference between the engine rotation number (999 rpm) transmitted last time by the MAC-message-generated main message and the engine rotation number (1100 rpm) contained in fourth main message M4 exceeds 100 rpm. Therefore, the MAC message for fourth main message M4 is generated/transmitted. Accordingly, the engine rotation number transmitted last time by the MAC-message-generated main message is updated to 1100 rpm.
An absolute value of a difference between the engine rotation number (1100 rpm) transmitted last time by MAC-message-generated fourth main message M4 and the engine rotation number (1103 rpm) contained in fifth main message M5 is not more than 100 rpm. Therefore, the MAC message for fifth main message M5 is not generated/transmitted.
In the examples illustrated in
Next, as a third example of the group for determining a timing due to a data change, a description will be given of a scheme for generating/transmitting a MAC when a value expressed by data exceeds or falls below a threshold value. For example, when the vehicle speed exceeds 10 km/h, the MAC is always generated/transmitted. Further, when a power supply voltage of the battery falls below a predetermined value, for example, the MAC is always generated/transmitted. Data having a value exceeding or falling below a threshold value can be said to be data of high importance. Therefore, the MAC is generated/transmitted for the data while giving priority to ensuring security.
In the scheme for generating/transmitting a MAC when the value exceeds or falls below the threshold value, the function necessary for MAC generation-timing determiner 34 of message processor 30 is sufficient if it has comparator 343 of MAC generation-timing determiner 34 in
In step S612, if the value of the data to be transmitted this time exceeds the threshold value (Y in S612), comparator 343 instructs MAC generator 35 to generate the MAC. MAC generator 35 generates the MAC, based on the CANID and data extracted by CANID extractor 32 and data field extractor 33 (S62). In step S612, if the value of the data to be transmitted this time is equal to or smaller than the threshold value (N in S612), the process in step S62 is skipped.
In step S613, if the value of the data to be transmitted this time falls below the threshold value (Y in S613), comparator 343 instructs MAC generator 35 to generate the MAC. MAC generator 35 generates the MAC, based on the CANID and data extracted by CANID extractor 32 and data field extractor 33 (S62). In step S613, if the value of the data to be transmitted this time is equal to or larger than the threshold value (N in S613), the process in step S62 is skipped.
Next, as a fourth example of the group for determining a timing due to a data change, a description will be given of a scheme for generating/transmitting a MAC when a change of a value expressed by data is a change in a prescribed direction. When the value of the data decreases, For example, the MAC is not generated/transmitted, and when the value of the data increases, for example, the MAC is generated/transmitted. This example expresses that a change of the value of data in a decreasing direction is a change to a safe side and that a change of the value of data in an increasing direction is a change to a risk side. By generating/transmitting the MAC for only the data whose value changes in a direction of the risk side, it is to possible to take balance between the ensuring of security and a load decrease.
In the scheme for generating/transmitting a MAC when a change of a value is a change in a prescribed direction, the function necessary for MAC generation-timing determiner 34 of message processor 30 is the same as the function of MAC generation-timing determiner 34 in
In step S512, if the value of the held data exceeds the value of the data to be transmitted this time (Y in S512), comparator 343 instructs MAC generator 35 to generate the MAC. MAC generator 35 generates the MAC, based on the CANID and data extracted by CANID extractor 32 and data field extractor 33 (S52). The data held in last-time data holder 341 is updated to the data transmitted this time (S53). In step S512, if the value of the held data is equal to or lower than the value of the data to be transmitted this time (N in S512), the processes in step S52 and step S53 are skipped.
In step S513, if the value of the held data is equal to or lower than the value of the data to be transmitted this time (Y in S513), comparator 343 instructs MAC generator 35 to generate the MAC. MAC generator 35 generates the MAC, based on the CANID and data extracted by CANID extractor 32 and data field extractor 33 (S52). The data held in last-time data holder 341 is updated to the data transmitted this time (S53). In step S513, if the value of the held data exceeds the value of the data to be transmitted this time (N in S513), the processes in step S52 and step S53 are skipped.
Next, as a fifth example of the group for determining a timing due to a data change, a description will be given of a scheme for generating/transmitting a MAC when a value expressed by data is different from a default value. For example, when a value of data takes other than the default value, the MAC is always generated/transmitted. Ordinarily, the default value is set to a safest side value. Therefore, when the value of data takes the default value, generation/transmission of the MAC for the data is omitted while giving priority to a load decrease.
In the scheme for generating/transmitting a MAC when a value is different from the default value, the function necessary for MAC generation-timing determiner 34 of message processor 30 is sufficient if it has comparator 343 of MAC generation-timing determiner 34 in
Next, as a first example of the group for determining a timing due to a transmission cyclic nature, a description will be given of a scheme for generating/transmitting a MAC by the thinning cycle. The MAC is generated/transmitted at a longer cycle than the transmission cycle of a main message, for example. The number of MAC generation/transmission times can be simply decreased.
In step S71, if the calculated elapsed time does not exceed the set cycle (N in S71), the processes in step S72, step S73, and step S74 are skipped. The above set cycle is set to a longer cycle than the transmission cycle of the main message. For example, the setting cycle is set to a value of an integer times of the transmission cycle of the main message.
Next, as a second example of the group for determining a timing due to a transmission cyclic nature, a description will be given of a scheme for generating/transmitting a MAC in accordance with a transmission cycle of a message. Depending on the ECU, the transmission cycle of the message is switched. This is because the information of the current transmission cycle about whether a short cycle or a long cycle is managed inside the ECU. Regarding the information of the transmission cycle, the information of the current transmission cycle is obtained from application processor 10 as transmission cycle information. In this way, based on the characteristic of a message (data) that the transmission cycle is changed, control is carried out as follows. For example, generation/transmission frequency of MACs is changed in accordance with the current cycle of the main message of which the cycle is changed. For example, when the current cycle of the main message is a short cycle, generation/transmission of the MAC is thinned. On the other hand, when the current cycle of the main message is a long cycle, generation/transmission of the MAC is not thinned. When the cycle of the main message is a short cycle, necessity of generating/transmitting the MAC for all main messages becomes low. Therefore, generation/transmission of MACs is thinned while giving priority to a load decrease.
In step S699, if the current transmission cycle of the main message is a short cycle (Y in S699), subsequent processes become the same as the processes in steps S70 to S74 in
In step S699, if the current transmission cycle of the main message is a long cycle (N in S699), subsequent processes become the same as the processes in steps S72 to S74 in
Next, as a third example of the group for determining a timing due to a transmission cyclic nature, a description will be given of a scheme for generating/transmitting a MAC in accordance with an event occurrence. In this way, based on the characteristic of a message (data) that transmission is carried out at an event occurrence time, control is carried out as follows. For example, when a main message is transmitted in accordance with the event occurrence, the MAC is always generated/transmitted. Specifically, the event occurrence corresponds to a case where a driver turns ON a headlight or the like. Data transmitted by the event occurrence can be said to be data of high importance. Therefore, the MAC for the data is always generated/transmitted while giving priority to ensuring security.
In the scheme for generating/transmitting a MAC in accordance with an event occurrence, the function necessary for MAC generation-timing determiner 34 of message processor 30 is sufficient if it has a function for determining whether the data contained in the main message generated by main message generator 31 is event transmission type data.
Next, as a fourth example of the group for determining a timing due to a transmission cyclic nature, a description will be given of a scheme for generating/transmitting a MAC in accordance with a request message. In this case, the request message is a message for a certain ECU to request other ECU for certain information. The ECU that receives the request message transmits a response main message to CAN bus 200. Based on the characteristic of a message (data) transmitted in this way as a response to the request message, control is carried out as follows. For example, when a main message is transmitted in accordance with the request message, the MAC is always generated/transmitted. Specifically, the request message corresponds to a case where there is a request from other ECU 100 for sending a numerical value of a measuring gauge which is monitored by own ECU 100. Data transmitted in accordance with a request message can be said to be the data of high importance. Therefore, the MAC for the data is always generated/transmitted while giving priority to ensuring security.
In the scheme for generating/transmitting a MAC in accordance with a request message, the function necessary for MAC generation-timing determiner 34 of message processor 30 is sufficient if it has a function for determining whether the data contained in the main message generated by main message generator 31 is on-demand transmission type data.
As a first example of the other group illustrated in
Comparator 350 compares the calculated bus occupation rate with the threshold value (S91). If the bus occupation rate exceeds the threshold value (Y in S91), comparator 350 instructs MAC generator 35 to generate the MAC. MAC generator 35 generates the MAC, based on the CANID and data extracted by CANID extractor 32 and data field extractor 33 (S92). In step S91, if the bus occupation rate is equal to or lower than the threshold value of the bus occupation rate (N in S91), the process in step S92 is skipped.
As a second example of the other group illustrated in
Upon receiving the notification of completion of the MAC from MAC generator 35, random number generator 352 generate a new pseudo random number, and supplies the pseudo random number to next-time MAC transmission count value holder 353. Accordingly, the count value up to a next-time transmission of the MAC held in next-time MAC transmission count value holder 353 is updated (S103). Further, upon receiving a notification of a completion of MAC generation from MAC generator 35, counting unit 351 resets the count value (S104).
In step S101, if the current count value of counting unit 351 has not reached a count value up to a next-time MAC transmission (N in S101), counting unit 351 increments the count value (S105). A pseudo random number value generated in step S103 is transmitted to other ECU 100 connected to CAN bus 200, by being contained in the data field of the MAC message, for example. The pseudo random number value contained in an independent control message may be transmitted instead of contained in the MAC message.
As a third example of the other group illustrated in
In the scheme for generating/transmitting a MAC in accordance with a vehicle state, the function necessary for MAC generation-timing determiner 34 of message processor 30 is sufficient if it has a function for obtaining vehicle information.
MAC generation-timing determiner 34 determines whether the obtained vehicle state is a vehicle state in which MAC transmission set in advance is necessary (S111). For example, when the obtained speed exceeds 60 km/h, MAC generation-timing determiner 34 determines that this is the vehicle state requiring MAC transmission by assuming that the vehicle is running at a high speed. If the obtained vehicle state is the vehicle state in which the MAC transmission is necessary (Y in S111), MAC generation-timing determiner 34 instructs MAC generator 35 to generate the MAC. MAC generator 35 generates the MAC, based on the CANID and data extracted by CANID extractor 32 and data field extractor 33 (S112). In step S111, if the obtained vehicle state is not the vehicle state in which the MAC transmission is necessary (N in S111), the process in step S112 is skipped.
As described above, according to the present exemplary embodiment, by controlling the timing of generating/transmitting the MAC, the increase in the bus occupation rate can be suppressed, and processing load and consumption current of each ECU can be decreased. By determining a timing for generating/transmitting the MAC in accordance with a feature (characteristic, importance) of data to be transmitted, security can be improved while suppressing the increase in the load of the bus and the ECU.
The present invention is described above based on the exemplary embodiment. The exemplary embodiment has been described for exemplary purposes only, and those skilled in the art concerned can understand that various modifications are possible in the combination of constituent elements and processing processes in the exemplary embodiment, and that these modifications are also within the range of the present invention.
For example, in reception-side ECU 100, there may be added a function for determining that the vehicle is not in the normally controllable state when too many unauthorized messages are transmitted as a result of counting the number of MAC verification unsuccessful times.
Number-of-times-of-unsuccessful-verification holder 49a holds an accumulated number of times of unsuccessful verification of MACs by MAC comparator 46. Specifically, number-of-times-of-unsuccessful-verification holder 49a counts up each time when MAC verification by MAC comparator 46 is unsuccessful. Abnormality determiner 49b determines that the vehicle is abnormal when the number of unsuccessful times held in number-of-times-of-unsuccessful-verification holder 49a exceeds a set value (for example, 128 times). When abnormality determiner 49b determines that the vehicle is abnormal, abnormality determiner 49b outputs, to application processor 10, an instruction signal for generating the data for making a whole vehicle shift to the fail-safe mode. Further, abnormality determiner 49b may output, to application processor 10, an instruction signal for generating the data for notifying the driver of the abnormality.
In the above description of the exemplary embodiment of the present invention, it is described that out of a plurality of pieces of ordinary data to be transmitted, generation and transmission of MACs for one or some of the ordinary data is omitted. As a modified exemplary embodiment, MACs may be generated for all the plurality of pieces of ordinary data to be transmitted and transmission of a part of MACs may be omitted based on a feature of the generated data.
The outline of one aspect of the present invention is as follow. A transmission device according to a certain aspect of the present invention has a first generator, a second generator, and a transmitter. The first generator generates data to be broadcast-transmitted. The second generator generates a message authentication code for at least the data generated in the first generator. The transmitter broadcast-transmits the data generated in the first generator, and the message authentication code generated in the second generator. The second generator omits generating message authentication codes for one or some of a plurality of pieces of data generated in the first generator. The “first generator” may be application processor 10 in
According to this aspect, by omitting generation of message authentication codes for one or some of the pieces of data, the load of the CAN and of the device connected to the CAN can be decreased while ensuring a constant level of security.
The second generator may determine whether to generate the message authentication code, based on a feature (at least any one of characteristic and importance) of the data generated in the first generator. According to this, it is possible to generate a message authentication code for data of high importance, and omit generating a message authentication code for data of low importance. Alternatively, generating a message authentication code can be properly omitted in accordance with a characteristic of data. Accordingly, ensuring of security and a load decrease can be efficiently realized.
The second generator may generate a message authentication code when data generated in the first generator has changed, and omit generating a message authentication code in other cases. When data has changed, the data can be said to be data of high importance. Accordingly, a message authentication code for data of high importance is generated, and generating a message authentication code for data of low importance is omitted, so that ensuring of security and a load decrease can be efficiently realized.
The second generator may generate a message authentication code when a change amount of a value expressed by the data generated in the first generator exceeds a threshold value, and omit generating a message authentication code in other cases. When a change of a value expressed by data exceeds a threshold value, the data can be said to be data of high importance. Accordingly, a message authentication code for data of high importance is generated, and generating a message authentication code for data of low importance is omitted, so that ensuring of security and a load decrease can be efficiently realized. The threshold value is set to a value guided by a designer based on an experiment, simulation, or experimental rule.
The second generator may generate a message authentication code when a value expressed by the data generated in the first generator exceeds a threshold value, and omit generating a message authentication code in other cases. When a value expressed by data exceeds a threshold value, the data can be said to be data of high importance. Accordingly, a message authentication code for data of high importance is generated, and generating a message authentication code for data of low importance is omitted, so that ensuring of security and a load decrease can be efficiently realized. The threshold value is set to a value guided by a designer based on an experiment, simulation, or experimental rule.
Another aspect of the present invention is a reception device. This device has a receiving unit and a processing unit. The receiving unit receives data and a message authentication code that are broadcast-transmitted by the transmission device. The message authentication code is for at least this data. The processing unit processes data and a message authentication code received in the receiving unit. Generating message authentication codes for a part of data out of a plurality of pieces of data received in the receiving unit is omitted in the transmission device. The “receiving unit” may be transmitting and receiving unit 50 in
According to this aspect, verification of the message authentication code for one or some of the pieces of data can be omitted, and the load of the CAN and of the device connected to the CAN can be decreased while ensuring a constant level of security.
Still another aspect of the present invention is a transmission method. This method includes a first step for generating data to be broadcast-transmitted, a second step for generating a message authentication code for at least the data generated in the first step, and a third step for broadcast-transmitting the data generated in the first step and the message authentication code generated in the second step. In the second step, generating message authentication codes for one or some out of a plurality of pieces of data generated in the first step is omitted.
According to this aspect, by omitting generation of message authentication codes for one or some of the pieces of data, the load of the CAN and of the device connected to the CAN can be decreased while ensuring a constant level of security.
Yet another aspect of the present invention is a reception method. This method includes a first step for receiving at least data and a message authentication code for at least the data that are broadcast-transmitted by a transmission device, and a second step for processing the data and the message authentication code received in the first step. Generating message authentication codes for one or some of pieces of data out of a plurality of pieces of data received in the first step is omitted in the transmission device.
According to this aspect, verification of the message authentication code for one or some of the pieces of data can be omitted, and the load of the CAN and of the device connected to the CAN can be decreased while ensuring a constant level of security.
The present invention can be utilized for a CAN.
Number | Date | Country | Kind |
---|---|---|---|
2014-097217 | May 2014 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2015/002219 | 4/24/2015 | WO | 00 |