In-vehicle network system, electronic control unit, receiving method and sending method

By using identifiers to calculate and verify message authentication codes in the CAN network, the problem of increased bus traffic caused by insufficient frame data fields is solved, achieving higher security and traffic suppression.

CN111464414BActive Publication Date: 2024-09-20PANASONIC INTELLECTUAL PROPERTY CORP OF AMERICA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010254008.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2015-03-23
Filing Date
2015-05-19
Publication Date
2024-09-20
Estimated Expiration
2035-05-19

AI Technical Summary

Technical Problem

In the CAN network, the data field in the frame is less than 8 bytes, so it must be divided and sent when storing the MAC, which increases bus traffic.

Method used

By introducing an identifier into the CAN network, it is used to calculate the message authentication code (MAC), and the identifier is included in the data frame to verify the legitimacy of the sent content, thereby improving the security of the message and suppressing the increase in bus traffic.

Benefits of technology

The security of messages is improved, and by flexibly determining the composition and storage method of data fields, the increase in bus traffic is suppressed and erroneous MAC verification processing is prevented.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111464414B_ABST
    Figure CN111464414B_ABST
Patent Text Reader

Abstract

The vehicle network system has multiple electronic control units, which comply with the CAN protocol, i.e., the controller area network protocol, and communicate via a bus. A first electronic control unit sends one or more data frames including an identifier (MAC calculation object field category, start mark, etc.) via the bus. The identifier is an identifier of data used in calculations for calculating a message authentication code (MAC). The message authentication code indicates the legitimacy of the sent content. A second electronic control unit receives one or more data frames sent on the bus, and performs verification processing of the message authentication code based on the identifier of the received data frame.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the Chinese patent application with the application date of May 19, 2015, application number 201580025316.9, and invention name: "Vehicle network system, electronic control unit, receiving method and sending method". Technical Field

[0002] The present disclosure relates to a technology for sending and receiving messages in a vehicle network. Background Art

[0003] In recent years, multiple devices called electronic control units (ECUs) have been configured in the systems in cars. The network connecting these ECUs is called an in-vehicle network. There are many standards for in-vehicle networks. Among the most mainstream in-vehicle networks, there is a standard called CAN (Controller Area Network) specified by ISO11898-1 (see "Non-Patent Document 1").

[0004] In CAN, the communication path is composed of two buses, and the ECU connected to the bus is called a node. Each node connected to the bus sends and receives messages called frames. The sending node that sends the frame applies voltage to the two buses to generate a potential difference between the buses, thereby sending a value called "1" and a value called "0" called dominant. When multiple sending nodes send recessive and dominant values ​​at exactly the same timing, the dominant value is sent first. When the format of the received frame is abnormal, the receiving node sends a frame called an error frame. An error frame is a frame that notifies the sending node and / or other receiving nodes of the frame abnormality by continuously sending 6 dominant bits.

[0005] In addition, there is no identifier indicating the destination and / or source in CAN. The sending node adds an ID called a message ID to each frame and sends it (that is, sends a signal to the bus), and each receiving node only receives a predetermined message ID (that is, reads a signal from the bus). In addition, the CSMA / CA (Carrier Sense Multiple Access / Collision Avoidance) method is adopted. When multiple nodes send at the same time, arbitration using the message ID is performed, and frames with smaller message ID values ​​are sent first.

[0006] In addition, in the vehicle network, an illegal node is connected to the bus, and the illegal node illegally sends a frame, which may lead to illegal control of the vehicle body. In order to prevent control caused by the sending of such illegal frames, the following technology is generally known: a message authentication code (MAC) is added to the data field of the CAN and sent (refer to "Patent Document 1").

[0007] Prior Art Literature

[0008] Patent Literature

[0009] Patent Document 1: Japanese Patent Application Publication No. 2013-98719

[0010] Non-patent literature

[0011] Non-patent document 1: CAN Specification 2.0 part A, [online], CAN in Automation (CiA), [retrieved on November 14, 2014], Internet (URL: http: / / www.can-cia.org / fileadmin / cia / specifications / CAN20A.pdf)

[0012] Non-patent document 2: RFC2104 HMAC: Keyed-Hashing for Message Authentication Summary of the invention

[0013] Problem that the invention aims to solve

[0014] However, there is no field for attaching MAC in CAN frames, and the data field in CAN is as short as 8 bytes. When MAC is stored in the data field of each frame, the following situation may occur: the data to be sent cannot be kept in the data field, and must be divided into multiple frames for transmission. In this case, the number of frames flowing through the bus increases, resulting in an increase in bus traffic.

[0015] Therefore, the present disclosure provides an in-vehicle network system that improves the security of messages (frames) sent and received and suppresses the increase in bus traffic. In addition, the present disclosure provides an electronic control unit (ECU), a receiving method, and a transmitting method used in the in-vehicle network system.

[0016] Means used to solve problems

[0017] In order to solve the above-mentioned problem, a technical solution disclosed in the present invention involves an in-vehicle network system, which is an in-vehicle network system with multiple electronic control units, which comply with the CAN (Controller Area Network) protocol and communicate via a bus. The in-vehicle network system comprises: a first electronic control unit, which sends one or more data frames containing an identifier through the bus, wherein the identifier is an identifier of data used in calculations for calculating a message authentication code, and the message authentication code indicates the legitimacy of the sent content; and a second electronic control unit, which receives one or more data frames sent on the bus and performs verification processing of the message authentication code based on the identifier of the received data frame.

[0018] In addition, in order to solve the above-mentioned problem, a technical solution of the present invention involves a receiving method, which is a receiving method used in a vehicle network system having multiple electronic control units, wherein the multiple electronic control units comply with the CAN (Controller Area Network) protocol and communicate via a bus, and the receiving method includes: a receiving step, receiving one or more data frames sent on the bus and containing an identifier, wherein the identifier is an identifier of data used in a calculation for calculating a message authentication code, and the message authentication code indicates the legitimacy of the sent content; and a verification step, wherein when one or more data frames are received in the receiving step, the message authentication code is verified based on the identifier of the received data frame.

[0019] In addition, in order to solve the above-mentioned problem, a technical solution of the present invention involves a sending method, which is a sending method used in a vehicle network system having multiple electronic control units, wherein the multiple electronic control units comply with the CAN (Controller Area Network) protocol and communicate via a bus, and the sending method includes: a calculation step, in which a message authentication code used to indicate the legitimacy of the sent content is calculated by calculation using data in one or more areas configured in one or more data frames; and a sending step, in which the message authentication code calculated in the calculation step is included in at least one of the one or more data frames, and the one or more data frames containing an identifier are sent. The identifier is an identifier of the data used in the calculation for calculating the message authentication code.

[0020] In addition, in order to solve the above-mentioned problem, a technical solution of the present invention involves an electronic control unit, which is an electronic control unit that complies with the CAN (Controller Area Network) protocol and communicates via a bus, and comprises: a receiving unit, which receives one or more data frames sent on the bus and contain an identifier, wherein the identifier is an identifier of data used in calculations for calculating a message authentication code, and the message authentication code indicates the legitimacy of the sent content; and a verification unit, which, when one or more data frames are received by the receiving unit, performs verification processing of the message authentication code based on the identifier of the received data frame.

[0021] In addition, in order to solve the above-mentioned problem, a technical solution of the present invention involves an electronic control unit, which is an electronic control unit that complies with the CAN (Controller Area Network) protocol and communicates via a bus, and comprises: a calculation unit, which calculates a message authentication code used to indicate the legitimacy of the sent content by calculation using data in one or more areas configured in one or more data frames; and a sending unit, which makes the message authentication code calculated by the calculation unit included in at least one data frame of the one or more data frames, and sends the one or more data frames containing an identifier, wherein the identifier is an identifier of the data used in the calculation for calculating the message authentication code.

[0022] Effects of the Invention

[0023] According to the present disclosure, by using a MAC indicating the legitimacy of the transmitted content, it is possible to improve the security of transmitted and received messages and suppress an increase in bus traffic. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 This is a diagram showing the overall configuration of the in-vehicle network system according to the first embodiment.

[0025] Figure 2 This is a diagram showing the format of a data frame specified by the CAN protocol.

[0026] Figure 3 This is a diagram showing the format of an error frame specified by the CAN protocol.

[0027] Figure 4 This is a diagram showing an example of a pattern related to adding MAC to a data frame in the first embodiment.

[0028] Figure 5 This is a diagram showing the configuration of the ECU according to the first embodiment.

[0029] Figure 6 This is a diagram showing an example of a receiving ID list.

[0030] Figure 7 This is a diagram showing an example of the data field format of a data frame.

[0031] Figure 8 This is a diagram showing an example of the data field format of a data frame.

[0032] Fig. 9 This is a diagram showing the data structure of the data field header in Implementation Example 1.

[0033] Fig.10 This is a diagram showing an example of the contents of the MAC calculation object field category.

[0034] Fig.11 This is a diagram showing an example of the contents of the data field configuration category.

[0035] Fig.12 This is a diagram showing an example of the content of a start tag.

[0036] Fig.13 This is a diagram showing an example of the ID and data fields in a frame transmitted from the ECU connected to the engine.

[0037] Fig.14 This is a flowchart showing the data frame transmission process in the ECU.

[0038] Fig.15 is a flowchart showing the data frame reception process in the ECU (followed by Fig.16 ).

[0039] Fig.16 is a flowchart showing the data frame reception process in the ECU (previous Fig.15 ).

[0040] Fig.17 This is a diagram showing an example of a pattern involving adding MAC to a data frame in the second embodiment.

[0041] Fig.18 This is a diagram showing the configuration of the ECU according to the second embodiment.

[0042] Fig.19 This is a diagram showing the data structure of the data field header in Implementation Method 2.

[0043] Fig. 20 This is a diagram showing the data structure of frame characteristic data.

[0044] Fig.21 This is a diagram showing an example of the ID and data fields in a frame transmitted from the ECU connected to the engine.

[0045] Fig. 22 It is a flowchart showing the transmission processing in the ECU.

[0046] Fig.23 is a flowchart showing the data frame reception process in the ECU (followed by Fig.24 ).

[0047] Fig.24 is a flowchart showing the data frame reception process in the ECU (followed by Fig.25 ).

[0048] Fig.25 is a flowchart showing the data frame reception process in the ECU (previous Fig.24 ).

[0049] Fig.26 This is a diagram showing an example of a pattern related to adding MAC to a data frame in Modification 1 of Implementation 2.

[0050] Fig. 27 This is a diagram showing an example of a pattern involving adding MAC to a data frame in Variation 2 of Implementation Example 2.

[0051] Fig.28 This is a diagram showing an example of a pattern related to adding MAC to a data frame in Modification 3 of Implementation 2. DETAILED DESCRIPTION

[0052] An in-vehicle network system according to one embodiment of the present disclosure is an in-vehicle network system having a plurality of electronic control units, the plurality of electronic control units complying with the CAN protocol, i.e., the controller area network protocol, and communicating via a bus, the in-vehicle network system comprising: a first electronic control unit, which transmits one or more data frames including an identifier via the bus, the identifier being an identifier of data used in calculation for calculating a message authentication code, the message authentication code indicating the legitimacy of the content to be transmitted; and a second electronic control unit, which receives one or more data frames transmitted on the bus, and performs verification processing of the message authentication code according to the identifier of the received data frame. Thus, by utilizing a message authentication code (MAC) indicating the legitimacy of the content to be transmitted, the security of the messages transmitted and received can be improved. In addition, by utilizing an identifier related to the data used in calculation for calculating a MAC, information used for calculating a MAC can be transmitted from the ECU on the transmitting side to the ECU on the receiving side, so that information such as a data value required for verification of a MAC and a data composition such as a MAC can be transmitted. Thus, for example, the composition of the data stored in the data field can be freely determined in the in-vehicle network system. Furthermore, when the ECU can freely set data requiring MAC verification, data not requiring MAC verification, and MAC in a data field and transmit them, an increase in bus traffic can be suppressed.

[0053] In addition, the first electronic control unit may include a message authentication code in at least one of the one or more data frames to be transmitted, the message authentication code being calculated by calculation using data in one or more areas configured in the one or more data frames, the identifier included in the one or more data frames transmitted by the first electronic control unit includes information indicating an area of ​​one or more data in the one or more data frames used in calculation for calculating the message authentication code, and the second electronic control unit performs the verification process by calculation using data in the area indicated by the identifier. Thus, for example, the area used in calculation for calculating MAC can be freely set to any field in the data frame, or to any position in a specific field, etc. Thus, for example, it is possible to suppress an increase in bus traffic or enhance security, etc.

[0054] In addition, the first electronic control unit may calculate the message authentication code by calculation using data in one or more areas configured in a plurality of data frames to be sent, and include the calculated message authentication code in at least one of the plurality of data frames for transmission, the identifier included in the plurality of data frames transmitted by the first electronic control unit includes information indicating the number of the plurality of data frames, and the second electronic control unit performs the verification process by calculation using data in the area indicated by the identifier in each received data frame when receiving the number of data frames indicated by the identifier included in a certain received data frame. Thus, since the ECU transmitting the data frame can pass the number of frames to the receiving ECU, the data required for MAC verification can be divided into a plurality of data frames and transmitted, etc., and the degree of freedom of data composition or frame composition is improved. As the frame composition, for example, one of a single frame and a multi-frame can be arbitrarily selected, the single frame is a state in which MAC is included in a single frame (that is, a state in which MAC verification can be performed immediately when the frame is received), and the multi-frame is a state in which MAC is divided into a plurality of frames.

[0055] In addition, a receiving method according to an embodiment of the present disclosure is a receiving method used in an in-vehicle network system, the in-vehicle network system having a plurality of electronic control units that follow the CAN protocol, i.e., the controller area network protocol, and communicate via a bus, the receiving method comprising: a receiving step of receiving one or more data frames sent on the bus and containing an identifier, the identifier being an identifier of data used in calculation for calculating a message authentication code, the message authentication code indicating the legitimacy of the content sent; and a verification step of performing a message authentication code verification process based on the identifier of the received data frame when one or more data frames are received in the receiving step. Thus, the content of the verification process (e.g., obtaining the position in the data frame of the data used in the calculation for verification, etc.) can be changed according to the identifier contained in the data frame, and appropriate verification process that flexibly corresponds to the data structure can be performed.

[0056] In addition, the identifier in the data frame received in the receiving step may represent the category of the content of the data field of the data frame. Thus, the receiving side of the data frame can receive information such as whether the data field of the data frame contains data that is the object of MAC calculation, whether it contains data that is not the object of MAC calculation, and whether it contains MAC as the category. Therefore, based on this receiving method, the category of the data stored in the data field can be freely determined. For example, compared with the case where the ECU in the vehicle network system only sends and receives data with MAC attached, the increase in bus traffic can be suppressed.

[0057] In addition, at least one of the one or more data frames received in the receiving step may include a message authentication code, and the category of the content of the data field indicated by the identifier in the data frame received in the receiving step may indicate whether the data field includes an area for data used in calculation for calculating the message authentication code, and in the verification step, when the category of the content of the data field indicated by the identifier indicates that the area includes data used in calculation for calculating the message authentication code, the verification process may be performed by calculation using the value of the area for data used in calculation for calculating the message authentication code in the data field. Thus, by identifying whether the data field of the data frame includes data to be calculated as a MAC, the verification process of the MAC can be appropriately performed.

[0058] In addition, the identifier in the data frame received in the receiving step may represent a region of data of a category in the data field of the data frame. Thus, the receiving side of the data frame can receive, for example, data to be calculated as a MAC, data not to be calculated as a MAC, or information on a location (range) where a MAC is configured in the data field of the data frame. Therefore, with this receiving method as a premise, the configuration of the data stored in the data field can be freely determined.

[0059] In addition, at least one of the one or more data frames received in the receiving step may include a message authentication code, the area of ​​the one type of data indicated by the identifier in the data frame received in the receiving step may be an area of ​​data used in calculation for calculating the message authentication code, and in the verification step, the verification process may be performed by calculation using the data in the area indicated by the identifier. Thus, by confirming the position (range) of the data field of the data frame containing the data to be calculated for the MAC, the data to be calculated can be appropriately collected, and the verification process of the MAC can be appropriately performed.

[0060] Alternatively, the identifier in the data frame received in the receiving step may be arranged in the data field of the data frame, and in the verification step, the verification process may be performed based on the identifier in the data field of the received data frame. Thus, the MAC verification process may be appropriately performed by following the CAN protocol, referring to the data field that can determine the specifications in the vehicle network system, and confirming the identifier.

[0061] In addition, the identifier included in the one or more data frames may include information indicating an area of ​​one or more data in the one or more data frames, and the verification process may be performed by calculation using data in an area corresponding to the identifier in the data frame received in the receiving step. Thus, a field, a position, etc. storing data used in calculation for MAC verification can be determined based on the identifier, and MAC verification processing can be appropriately performed.

[0062] In addition, a transmission method according to an embodiment of the present disclosure is a transmission method used in an in-vehicle network system, the in-vehicle network system having a plurality of electronic control units that follow the CAN protocol, i.e., the controller area network protocol, and communicate via a bus, the transmission method comprising: a calculation step, calculating a message authentication code for indicating the legitimacy of the transmission content by calculation using data in one or more areas configured in one or more data frames; and a transmission step, including the message authentication code calculated in the calculation step in at least one of the one or more data frames, and transmitting the one or more data frames including an identifier, the identifier being an identifier of the data used in the calculation for calculating the message authentication code. Thus, by using the identifier included in the data frame, for example, the ECU on the transmission side of the data frame can transmit the position of the data used in the calculation for calculating the MAC in the data frame to the ECU on the receiving side, and therefore, the data structure in the data frame can be freely set.

[0063] In addition, the identifier in the data frame sent in the sending step may represent the category of the content of the data field of the data frame. Thus, for example, the ECU on the sending side of the data frame can transmit information such as whether the data field of the data frame contains data that is the object of MAC calculation, whether it contains data that is not the object of MAC calculation, and whether it contains MAC as the category to the ECU on the receiving side. Therefore, since the category of the data stored in the data field can be freely determined, the increase in bus traffic can be suppressed, for example, compared with the case where the ECU in the vehicle network system only sends and receives data with MAC attached.

[0064] Alternatively, the category of the content of the data field indicated by the identifier in the data frame transmitted in the transmitting step may indicate whether the data field contains an area for data used in the calculation for calculating the message authentication code in the calculating step. This makes it possible to select whether to include data to be calculated for the MAC in the data field of the data frame, and to freely determine the data structure.

[0065] In addition, the identifier in the data frame sent in the sending step may represent a region of data of a category in the data field of the data frame. Thus, the ECU on the sending side of the data frame can transmit information such as data to be calculated as a MAC, data not to be calculated as a MAC, or a location (range) where a MAC is configured in the data field of the data frame to the ECU on the receiving side. Therefore, the configuration of the data stored in the data field can be freely determined.

[0066] In addition, the area of ​​the one type of data represented by the identifier in the data frame sent in the sending step may be an area of ​​data used in the calculation for calculating the message authentication code in the calculating step. Thus, the ECU on the sending side of the data frame can transmit the position (range) of the data field of the data frame containing the data to be calculated as the object of MAC to the ECU on the receiving side, and can configure the data to be calculated as the object of MAC at any position.

[0067] In addition, in the sending step, the identifier may be placed in a data field of the data frame to be sent. Thus, the data field whose specifications can be determined in the vehicle network system can be used in accordance with the CAN protocol, and information related to the data used in the calculation for calculating the MAC can be transmitted. Therefore, the sending method can be easily implemented in an ECU that complies with the CAN protocol.

[0068] In addition, the identifier included in the one or more data frames sent in the sending step may include information indicating an area of ​​one or more data in the one or more data frames used in the calculation for calculating the message authentication code. Thus, a field, a position, etc. storing data used in the calculation for verifying the MAC can be appropriately transmitted, and the degree of freedom of data composition, etc. is improved.

[0069] In addition, an electronic control unit (ECU) according to one embodiment of the present disclosure is an electronic control unit that follows the CAN protocol, i.e., the controller area network protocol, and communicates via a bus, and includes: a receiving unit that receives one or more data frames sent on the bus and containing an identifier, the identifier being an identifier of data used in the calculation for calculating a message authentication code, the message authentication code indicating the legitimacy of the content sent; and a verification unit that performs message authentication code verification processing according to the identifier of the received data frame when one or more data frames are received by the receiving unit. Thus, the content of the verification processing can be changed according to the identifier contained in the data frame, and appropriate verification processing that flexibly responds to the data composition can be performed. For example, in an in-vehicle network system constructed by including the ECU, the composition of the data stored in the data field can be freely determined, and information on whether MAC verification is required or information on the area of ​​the data used in the MAC verification, etc., can be added to the data frame as an identifier and sent and received. Thus, for example, data frames can be sent and received in a manner that suppresses the increase in bus traffic.

[0070] In addition, an electronic control unit (ECU) according to one embodiment of the present disclosure is an electronic control unit that complies with the CAN protocol, i.e., the controller area network protocol, and communicates via a bus, and includes: a calculation unit that calculates a message authentication code for indicating the legitimacy of the content to be sent by using a calculation using data in one or more areas configured in one or more data frames; and a sending unit that includes the message authentication code calculated by the calculation unit in at least one of the one or more data frames, and sends the one or more data frames including an identifier, wherein the identifier is an identifier of the data used in the calculation for calculating the message authentication code. Thus, by using the identifier included in the data frame, for example, the ECU on the sending side of the data frame can transmit the position of the data used in the calculation for calculating the MAC in the data frame to the ECU on the receiving side, and the data structure in the data frame can be freely set.

[0071] In addition, these comprehensive or specific technical solutions can be implemented by systems, methods, integrated circuits, computer programs or computer-readable recording media such as CD-ROMs, or by any combination of systems, methods, integrated circuits, computer programs or recording media.

[0072] Hereinafter, the vehicle network system involved in the embodiment will be described with reference to the accompanying drawings. The embodiments shown here all represent a specific example of the present disclosure. Therefore, the numerical values, constituent elements, configurations and connection methods of constituent elements, steps (processes) and the order of steps shown in the following embodiments are examples and do not limit the present disclosure. Among the constituent elements of the following embodiments, the constituent elements that are not recorded in the independent claims are constituent elements that can be added arbitrarily. In addition, each figure is a schematic diagram and is not a strictly illustrated figure.

[0073] (Implementation Method 1)

[0074] Hereinafter, as an embodiment of the present disclosure, an in-vehicle network system 10 including an ECU that implements a transmission method or a reception method for enabling verification of data using MAC and enabling efficient transmission and reception of data will be described with reference to the drawings.

[0075] [1.1 Overall Configuration of the In-Vehicle Network System 10]

[0076] Figure 1 The diagram shows the overall structure of the vehicle network system 10 involved in the first embodiment. The vehicle network system 10 is an example of a network communication system that performs communication in accordance with the CAN protocol, and is a network communication system in a car equipped with various devices such as a control device and a sensor. The vehicle network system 10 includes a bus 200 and nodes connected to the bus 200, such as ECUs 100a to 100d connected to various devices. Figure 1 It is omitted in the in-vehicle network system 10, but in addition to ECU100a~100d, multiple ECUs can be included. Here, for the sake of convenience, the focus is on ECU100a~100d for explanation. ECU is a device including a processor (microprocessor), a memory, etc., including a digital circuit, an analog circuit, and a communication line. The memory is ROM, RAM, etc., which can store a control program (computer program) executed by the processor. For example, the processor operates according to the control program (computer program) to enable the ECU to implement various functions. In addition, the computer program is composed of a combination of multiple command codes representing instructions to the processor in order to implement a predetermined function.

[0077] ECU100a~100d are connected to engine 310, brake 320, door opening and closing sensor 330 and window opening and closing sensor 340 respectively. ECU100a~100d respectively obtain the status of the connected device (engine 310, etc.), and periodically send a frame indicating the status (data frame described later) to the network (that is, bus). ECU100a~100d performs a data frame transmission process (described later) for transmitting the data frame, and also performs a data frame reception process (described later) for receiving the data frame.

[0078] In the vehicle network system 10, each ECU performs frame transmission and reception in accordance with the CAN protocol. The frames under the CAN protocol include data frames, remote frames, overload frames, and error frames. For ease of explanation, the following description will focus on data frames and error frames.

[0079] [1.2 Data frame format]

[0080] Hereinafter, a data frame which is one of frames used in a network conforming to the CAN protocol will be described.

[0081] Figure 2This is a diagram showing the format of a data frame specified by the CAN protocol. In this figure, a data frame in the standard ID format specified by the CAN protocol is shown. The data frame includes SOF (Start Of Frame), ID field, RTR (Remote Transmission Request), IDE (Identifier Extension), reservation bit "r", DLC (Data Length Code), data field, CRC (Cyclic Redundancy Check) sequence, CRC delimiter "DEL", ACK (Acknowledgement) slot, ACK delimiter "DEL" and EOF (End Of Frame).

[0082] SOF consists of one dominant bit. It becomes recessive when the bus is idle, and the start of frame transmission is notified by changing SOF to dominant.

[0083] The ID field is a field consisting of 11 bits for storing ID (message ID), which is a value indicating the type of data. When multiple nodes start sending at the same time, in order to use this ID field for communication arbitration, it is designed that frames with smaller ID values ​​have higher priority.

[0084] RTR is a value used to distinguish between a data frame and a remote frame, and is composed of one dominant bit in a data frame.

[0085] Both IDE and "r" consist of 1 dominant bit.

[0086] DLC is composed of 4 bits and is a value indicating the length of the data field. In addition, IDE, "r" and DLC are collectively referred to as a control field.

[0087] The data field is a value that is composed of a maximum of 64 bits and indicates the content of the data to be sent. The length can be adjusted by 8 bits. The specification of the data to be sent is not specified in the CAN protocol, but is determined in the vehicle network system 10. Therefore, it becomes a specification that depends on the model, manufacturer (manufacturer), etc.

[0088] The CRC sequence consists of 15 bits and is calculated based on the transmission values ​​of the SOF, ID field, control field, and data field.

[0089] The CRC delimiter is a delimiter symbol consisting of one recessive bit indicating the end of the CRC sequence. In addition, the CRC sequence and the CRC delimiter are collectively referred to as a CRC field.

[0090] The ACK gap consists of 1 bit. The sending node sets the ACK gap to implicit and sends it. If the CRC sequence can be received normally, the receiving node sets the ACK gap to explicit and sends it. Since explicit takes precedence over implicit, if the ACK gap is explicit after sending, the sending node can confirm that a certain receiving node has received it successfully.

[0091] The ACK delimiter is a delimiter consisting of one recessive bit and indicates the end of the ACK.

[0092] EOF consists of 7 recessive bits and indicates the end of the data frame.

[0093] [1.3 Error frame format]

[0094] Figure 3 This is a diagram showing the format of the error frame specified by the CAN protocol. The error frame consists of an error flag (primary: active), an error flag (secondary: passive), and an error delimiter.

[0095] The error flag (active) is used to inform other nodes of the occurrence of an error. The node that detects the error sends 6 dominant bits in succession to inform other nodes of the occurrence of the error. This transmission violates the bit stuffing rule in the CAN protocol (not continuously sending more than 6 bits of the same value), causing the transmission of error frames (passive) from other nodes.

[0096] The error flag (passive) is composed of 6 consecutive dominant bits for notifying other nodes of the occurrence of an error. All nodes that receive the error flag (active) and detect a violation of the bit stuffing rule send an error flag (passive).

[0097] The error delimiter "DEL" is 8 consecutive recessive bits, indicating the end of the error frame.

[0098] [1.4 MAC assignment pattern example]

[0099] Figure 4 This is a diagram showing an example of a mode in which a MAC is assigned to a data frame. For example, each data frame is sent to the bus 200 in order from the left side to the right side of the diagram. In order to indicate the legitimacy of the content being sent, a MAC is assigned to a data frame (message). Here, the mode in which a MAC is assigned has various variations depending on whether a MAC is assigned or which field is the object of MAC calculation.

[0100] Figure 4In the example of three data frames, the examples of data frame 401 on the left and data frame 403 on the right include MAC and data to be calculated as the object of MAC calculation (that is, data used in the calculation for calculating MAC) in one frame. In addition, the example of data frame 402 in the center does not include MAC. Here, in order to suppress the increase in bus traffic or to reduce the amount of calculation, an example is shown in which whether MAC is assigned to each frame and whether the data to be calculated as the object of MAC calculation is only the data field or includes the DLC field is switched, but it can also be a variation other than these examples. For example, MAC can be assigned to all frames, all of the ID field, DLC field, and data field can be used as the calculation object of MAC, one of the ID field, DLC field, and data field can be used as the calculation object of MAC alone, a combination of each can be used as the calculation object, or a combination of these fields with other fields can be used as the calculation object.

[0101] [1.5 Configuration of ECU 100a]

[0102] Figure 5 1 is a block diagram of ECU 100a. ECU 100a includes: a frame transceiver 101, a frame interpreter 102, a reception ID determination unit 103, a reception ID list storage unit 104, a frame processor 105, a MAC processor 106, a MAC key storage unit 107, a counter storage unit 108, a frame generator 109, and a data acquisition unit 110. These components are functional components, and the functions are realized by using a communication line in ECU 100a, a processor or a digital circuit that executes a control program stored in a memory, etc.

[0103] The frame transceiver 101 transmits and receives frames conforming to the CAN protocol to the bus 200. It receives frames from the bus 200 bit by bit and transfers them to the frame interpreter 102. It also transmits the contents of the frame notified from the frame generator 109 to the bus 200.

[0104] The frame interpretation unit 102 receives the value of the frame from the frame transceiver unit 101, and interprets it so as to map it to each field of the frame format specified in the CAN protocol. The value determined as the ID field is transmitted to the receiving ID determination unit 103. The frame interpretation unit 102 determines whether to transmit the value of the ID field and the DLC, data field, etc. that appear after the ID field to the frame processing unit 105 based on the determination result notified from the receiving ID determination unit 103, or to terminate the reception of the frame (that is, terminate the interpretation of the frame) after receiving the determination result. In addition, when the frame interpretation unit 102 determines that it is a frame that does not comply with the CAN protocol, it notifies the frame generation unit 109 to send an error frame. In addition, when the frame interpretation unit 102 receives an error frame, that is, when it interprets it as an error frame based on the value in the received frame, it discards the frame thereafter, that is, terminates the interpretation of the frame.

[0105] The reception ID determination unit 103 receives the value of the ID field notified from the frame interpretation unit 102, and determines whether to receive each field of the frame after the ID field according to the list of message IDs held by the reception ID list holding unit 104. The reception ID determination unit 103 notifies the frame interpretation unit 102 of the determination result.

[0106] The reception ID list holding unit 104 holds a reception ID list which is a list of IDs (message IDs) received by the ECU 100 a . Figure 6 This is a diagram showing an example of a receiving ID list.

[0107] The frame processing unit 105 receives the value of the data field from the frame interpretation unit 102, and performs processing corresponding to various tags (tags such as the data field header and the start tag described later, which can function as identifiers related to the data used in the calculation for calculating the MAC) contained in the data field. This processing includes verification of the data related to the MAC (that is, MAC verification processing) for the data to which the MAC is assigned, and also includes processing related to the function corresponding to the data. That is, the frame processing unit 105 has a function as a verification unit, and the verification unit performs MAC verification processing based on various tags (identifiers) of the received data frame when one or more data frames are received by the frame transceiver unit 101. In addition, as an example of the processing related to the above function, the ECU 100a connected to the engine 310 has the following function: if the door is open when the speed exceeds 30 km / h, an alarm sound is sounded, and the frame processing unit 105 manages the data received from other ECUs (such as information indicating the state of the door), and performs processing such as sounding an alarm sound under certain conditions based on the speed obtained from the engine 310. In addition, the following use Fig.14 , Fig.15 as well as Fig.16, explaining the specific contents (processing flow) related to the frame transmission and reception processing (data frame transmission processing and data frame reception processing). In addition, here, it is assumed that various tags are included in the data field of the data frame, but various tags can also be included in other fields such as the extended ID field.

[0108] The MAC processing unit 106 calculates a MAC value (derives it by calculation) from a value (combined value) for calculating MAC (which is a value added to a frame and transmitted as data to be calculated as MAC, such as a value of a message ID, a DLC, and a value of data for a data field) notified from the frame generation unit 109 and a value (combined value) formed by combining the transmission count value held by the count holding unit 108, using the MAC key held by the MAC key holding unit 107, and notifies the frame generation unit 109 of the MAC value as a result of the calculation. That is, the MAC processing unit 106 functions as a calculation unit that calculates MAC by calculation using data (data to be calculated as MAC) arranged in one or more regions in one or more frames. In addition, the MAC value is calculated from a value (combined value) formed by combining the data to be calculated as MAC included in the received frame notified from the frame processing unit 105 and the reception count value held by the count holding unit 108, using the key held by the MAC key holding unit 107, and notifies the frame processing unit 105 of the MAC value as a result of the calculation. Here, as a method for calculating MAC, HMAC (Hash-based Message Authentication Code: key-related hash operation message authentication code) (refer to non-patent document 2) is used, and the above-mentioned combined value is padded until it corresponds to a predetermined block (for example, 4 bytes) using the MAC key for calculation, and the first 4 bytes of the calculated result are used as MAC. Here, as a combined value used to calculate MAC, all examples of using the message ID, DLC value, data value, and the sending count value or receiving count value maintained by the counter holding unit 108 are described, but MAC can be calculated using a combination of one or more of these values. That is, when ECU100a sends a frame, based on the Figure 4 The MAC assigned to the example is determined by a predetermined algorithm determined by the mode involved, and a MAC for inclusion in the transmitted frame is calculated using one or a combination of two or more of these values. In addition, when receiving a frame, the ECU 100a determines the value required for calculating the MAC used in verification based on a predetermined algorithm or by referring to various tags included in the data field as needed, thereby calculating the MAC.

[0109] The MAC key storage unit 107 stores a MAC key required for calculating a MAC.

[0110] The counter holding unit 108 holds a counter value required for calculating MAC. The counter value is held for each message ID, for example, and includes two counter values: a transmission counter value that increases when a frame is normally transmitted and a reception counter value that increases when a frame is normally received.

[0111] The frame generation unit 109 constructs an error frame in accordance with the notification from the frame interpretation unit 102 indicating the sending of an error frame, notifies the frame transceiver unit 101, and sends the error frame. In addition, when ECU100a assigns MAC and sends data, the frame generation unit 109 notifies the MAC processing unit 106 of the value of the data notified from the data acquisition unit 110 and a predetermined message ID, and receives the calculated MAC. When ECU100a sends data assigned with MAC, the frame generation unit 109 constructs a data frame in the memory (transmission buffer) in a manner including a predetermined message ID, the value of the data notified from the data acquisition unit 110, and the MAC received from the MAC processing unit 106, and notifies the frame transceiver unit 101. When performing this transmission, the frame transceiver unit 101 functions as a transmission unit that causes at least one of the one or more data frames to include MAC, and sends the one or more data frames including various tags (identifiers, etc.) related to the data used in the calculation for calculating the MAC. In addition, the term "MAC" will be used later. Figure 7 and Figure 8 The structure of the data field of the data frame generated by the frame generation unit 109 will be described.

[0112] The data acquisition unit 110 acquires data indicating the status of devices, sensors, and the like connected to the ECU, and notifies the data to the frame generation unit 109 .

[0113] In addition, ECU100b~100d also have the same configuration as ECU100a. However, the content of the processing related to the function corresponding to the data performed by the frame processing unit 105 is different for each ECU. In addition, for example, when the frame transceiver unit 101 of ECU100a functions as a transmitting unit that transmits a data frame containing various tags, the frame transceiver unit 101 of ECU100b and the like connected to the bus 200 like ECU100a functions as a receiving unit that receives one or more data frames containing various tags transmitted.

[0114] [1.6 Example of receiving ID list]

[0115] Figure 61 is a diagram showing an example of a reception ID list maintained in each of ECU100a, ECU100b, ECU100c, and ECU100d. The reception ID list illustrated in the figure is used to selectively receive and process a frame containing a message ID, wherein the value of the ID (message ID) of the message ID is one of "1", "2", "3", and "4".

[0116] [1.7 Data field format example 1]

[0117] Figure 7 Indicates the use of Figure 4 FIG. 3 is an example of a data field format of a data frame transmitted in a mode involving a MAC assignment. In this example, an example of a data field having data not assigned a MAC as content is shown. The data field is composed of a data field header 301, a start marker 302, a data size 303, and general data 304.

[0118] The data field header 301 includes information indicating the type of data included in the data frame, the area (field type) of data to be calculated for MAC, and the like. Fig. 9 The data structure of the data header 301 will be described.

[0119] The start tag 302 is a tag for identifying the type of data after the start tag (that is, the data received after the start tag). Fig.12 An example of the content of the start tag 302 will be described.

[0120] The data size 303 indicates the size of the data identified by the start marker 302. The data length of the data size 303 is 6 bits.

[0121] The general data 304 is an area indicating data that is not a target for MAC calculation (that is, data that is neither a target for MAC calculation nor a MAC among the data stored in the data field).

[0122] [1.8 Data field format example 2]

[0123] Figure 8 Indicates the use of Figure 4 An example of the data field format of a data frame transmitted in a mode related to the MAC assignment of the MAC. In this example, an example of a data field including data to be calculated as a MAC and a MAC is shown. The data field is composed of a data field header 301, a start marker 302, a data size 303, MAC calculation data 305, and MAC 306. In addition, for Figure 7 The same elements are given the same reference numerals, and description thereof will be omitted here.

[0124] The MAC calculation data 305 indicates an area of ​​data to be calculated for MAC.

[0125] MAC 306 indicates an area where a MAC calculated by calculation using data to be calculated for MAC is arranged.

[0126] [1.9 Data structure example of data field header 301]

[0127] Fig. 9 The data structure of the data field header 301 is shown. The data field header 301 is set at the beginning of the data field when the frame generation unit 109 transmits a data frame.

[0128] The data field header 301 is composed of a reserved bit 311 (2 bits), a MAC calculation object field type 312 (3 bits), and a data field configuration type 313 (3 bits), and is 8 bits in total.

[0129] The value of the reserved bit 311 is "00" and is a fixed value.

[0130] Below, use Fig.10 , Fig.11 , which explains the specific data to be put into the MAC calculation object field category 312 and the data field composition category 313.

[0131] [1.10MAC calculation object field category 312]

[0132] Fig.10 An example of the content of the MAC calculation target field type 312 included in the data field header 301 is shown. In addition, in this figure, the value is expressed by a 3-bit value (binary).

[0133] The most significant bit of the 3-bit MAC calculation target field type 312 indicates whether the field configuring the data to be calculated as the MAC includes an ID field (see Figure 2 ), becomes "1" when the ID field becomes the calculation object of MAC, and becomes "0" when the ID field does not become the calculation object of MAC. The middle bit of the MAC calculation object field category 312 indicates whether the field configured as the data to be calculated as the MAC contains DLC, and becomes "1" when the DLC becomes the calculation object of MAC, and becomes "0" when the DLC does not become the calculation object of MAC. In addition, the least significant bit of the MAC calculation object field category 312 indicates whether the field configured as the data to be calculated as the MAC contains a data field, and becomes "1" when the data field contains data to be calculated as the MAC, and becomes "0" when the data field does not contain data to be calculated as the MAC.

[0134] [1.11 Data field composition category 313]

[0135] Fig.11 An example of the content of the data field configuration type 313 included in the data field header 301 is shown. In addition, in this figure, the value is expressed by a 3-bit value (binary).

[0136] The most significant bit of the 3-bit data field composition category 313 (hereinafter referred to as the "MAC bit") indicates whether the data field contains a MAC, and becomes "1" if it contains a MAC, and becomes "0" if it does not contain a MAC. The middle bit of the data field composition category 313 (hereinafter referred to as the "MAC calculation data bit") indicates whether the data field contains data to be calculated for the MAC (that is, whether it contains Figure 8 The MAC calculation data 305 shown in the figure becomes "1" when it contains data that is the object of MAC calculation, and becomes "0" when it does not contain data that is the object of MAC calculation. In the transmitted data frame, the MAC calculation data bit indicates whether the data field in the data frame contains an area for data used in the calculation for calculating MAC. In addition, the least significant bit of the data field composition category 313 (hereinafter referred to as the "general data bit") indicates whether the data field contains general data that is not the object of MAC calculation (that is, whether it contains Figure 7 The general data 304 shown in FIG. 1 is "1" when the general data is included, and is "0" when the general data is not included. Fig.11 For the sake of convenience, the example of the content of all patterns that can be expressed by a 3-bit value composed of such a MAC bit, a MAC calculation data bit, and a general data bit is shown. Fig.11 Part of the values ​​in the content example ("only data for MAC calculation" and "general data + data for MAC calculation") can be used in Implementation Example 2 described later, but cannot be used in Implementation Example 1.

[0137] [1.12 Start Tag 302]

[0138] Fig.12 The start marker 302 is an example of the content, and the start marker 302 indicates the start position and type of the data included in the data field. The start marker 302 is set in the data field when the data frame is transmitted by the frame generation unit 109. The position where the start marker 302 is set is, for example, a position following the data field header 301, or a position following the data (general data, data to be calculated as MAC, or MAC) arranged in the data field (refer to Figure 7 and Figure 8 ).

[0139] The start marker 302 consists of 2 bits and indicates that the following data size 303 (see Figure 7 and Figure 8 )’s data category, the data size 303 follows the start tag 302.

[0140] When the data following the data size 303 is general data that is not a calculation target of MAC, "00" (2-bit value) is set as the value of the start marker 302 that follows the start marker 302. When the data following the data size 303 is data that is a calculation target of MAC (MAC calculation data), "01" (2-bit value) is set as the value of the start marker 302 that follows the start marker 302. In the transmitted data frame, the area of ​​data used in the calculation for calculating MAC is indicated by the start marker 302 of "01" (2-bit value) and the subsequent data size 303. When the data following the data size 303 is MAC, "10" (2-bit value) is set as the value of the start marker 302 that follows the start marker 302.

[0141] [1.13 Example of transmission frame of ECU100a related to engine]

[0142] Fig.13 This is a diagram showing an example of the ID (message ID) and the content (data) of the data field in a data frame sent from ECU100a connected to engine 310. The message ID of the frame sent by ECU100a is "1". In this diagram, the content (data) of the data field is separated by spaces for each byte and expressed in hexadecimal. Fig.13 In the example, the first byte of each line is the data field header 301, the next (second) byte is the start mark 302 and the data size 303, and the next (third) byte is the MAC calculation data 305 indicating the speed (km / hour) (only the second line is the general data 304). Fig.13 The next (fourth) byte in the first and third lines of the example is the start tag 302 and the data size 303, and the following 4 bytes are the MAC 306. The speed (km / hour) takes a value in the range of 0 (km / hour) to 180 (km / hour). Fig.13 From the top row to the bottom row, the example is as follows Figure 4 In the pattern related to MAC assignment illustrated in the example, the content (data) of each message ID and data field corresponding to each frame successively transmitted from the ECU 100a shows a situation where the speed is accelerated from 0 km / hour by 1 km / hour.

[0143] [1.14 Data frame transmission process]

[0144] Fig.14 1 is a flowchart showing the data frame transmission process executed by ECU 100a. The data frame transmission process in ECU 100a will be described below according to this figure. In addition, although the contents of the data frames to be transmitted are different, ECU 100b to 100d also perform the same data frame transmission process as ECU 100a. In ECU 100a, the data frame transmission process is performed regularly.

[0145] When the ECU 100a obtains the state of the engine 310 and determines the data representing the state (data to be transmitted), the frame generation unit 109 starts the data frame generation process (step S1001). The data frames composed of the data to be transmitted and the frame composition to be transmitted one by one are determined according to a predetermined algorithm predetermined by the vehicle network system 10. As an example of a predetermined algorithm for determining the frame composition and data composition, the above-mentioned Figure 4 Examples include the following algorithms: for example, three transmissions are regarded as a set, wherein the data field of the data frame 401 transmitted for the first time includes MAC calculation data 305 indicating speed and MAC calculated by calculation using the MAC calculation data 305, the data field of the data frame 402 transmitted for the second time includes general data 304 indicating speed, and the data field of the data frame 403 transmitted for the third time includes MAC calculation data 305 indicating speed and MAC calculated by calculation using the DLC and the MAC calculation data 305 and transmits them.

[0146] As a data frame generation process, the frame generation unit 109 sets a value indicating the structure of the data to be transmitted determined based on a predetermined algorithm at a corresponding position of the MAC calculation target field type 312 in the data field header 301 of the data field of the data frame determined in the memory (transmission buffer) (step S1002). Figure 4 ), in the data frame 403 sent for the third time in FIG. 1 , the bits corresponding to the DLC and data fields of the MAC calculation object field type 312 (3 bits) are set to "1" respectively.

[0147] The frame generation unit 109 of the ECU 100a determines whether the data frame including the data to be transmitted includes general data 304 (that is, data not to be calculated by MAC) (step S1003). If the general data 304 is not included, the processing related to the general data is skipped (steps S1004 to S1007).

[0148] When it is determined in step S1003 that the data frame to be transmitted includes general data 304, the frame generation unit 109 sets "1" to the general data bit of the data field configuration type 313 in the data field header 301 of the data frame specified in the transmission buffer (step S1004).

[0149] Next, the frame generation unit 109 sets "00" (2-bit value) representing general data as the start mark 302 in the data field of the data frame determined in the sending buffer (step S1005), sets a value corresponding to the size of the general data 304 as the data size 303 (step S1006), and sets the general data 304 (step S1007).

[0150] In addition, the frame generation unit 109 determines whether the data frame to be transmitted including the data to be transmitted is a frame including the MAC calculation data 305 (that is, data to be calculated by MAC) (step S1008). If the MAC calculation data 305 is not included, the processing related to the MAC calculation data (steps S1009 to S1012) is skipped.

[0151] When it is determined in step S1008 that the data frame to be transmitted includes the MAC calculation data 305, the frame generation unit 109 sets "1" to the MAC calculation data bit of the data field configuration type 313 in the data field header 301 of the data frame specified in the transmission buffer (step S1009).

[0152] Next, the frame generation unit 109 sets "01" (2-bit value) indicating MAC calculation data in the data field of the data frame determined in the transmission buffer as the start marker 302 (step S1010), sets a value corresponding to the size of the MAC calculation data 305 as the data size 303 (step S1011), and sets the MAC calculation data 305 (step S1012).

[0153] Furthermore, the frame generation unit 109 determines whether the data frame to be transmitted including the data to be transmitted is a frame including the MAC 306 (step S1013). If the MAC 306 is not included, the processing related to the MAC is skipped (steps S1014 to S1018).

[0154] When it is determined in step S1013 that the data frame to be transmitted includes MAC 306, the frame generation unit 109 sets "1" to the MAC bit of the data field configuration type 313 in the data field header 301 of the data frame specified in the transmission buffer (step S1014).

[0155] Next, the frame generation unit 109 transmits data determined based on a predetermined algorithm (that is, data based on the value set in the MAC calculation object field type 312) as data to be calculated as MAC to be calculated, and the MAC processing unit 106 calculates MAC (step S1015). The MAC processing unit 106 calculates a value obtained by combining the data to be calculated as MAC transmitted to the frame generation unit 109 and the transmission count value held by the count holding unit 108, using the MAC key held by the MAC key holding unit 107, thereby calculating a MAC value to be set as MAC 306 in the data frame to be transmitted.

[0156] Next, the frame generation unit 109 sets "10" (2-bit value) representing MAC as the start marker 302 in the data field of the data frame determined in the sending buffer (step S1016), sets a value corresponding to the size of MAC306 as the data size 303 (step S1017), and sets MAC306 (step S1018).

[0157] When the process of step S1018 is completed or the process related to MAC is skipped, the frame generation unit 109 completes the data frame generation process for generating a data frame to be transmitted, and notifies the frame transmission and reception unit 101 (step S1019).

[0158] The frame transceiver 101 transmits the data frame generated in the transmission buffer by the frame generator 109 to the bus 200 (step S1020). If the frame is normally transmitted, the transmission count value is increased (by 1) (step S1021).

[0159] [1.15 Data frame reception processing]

[0160] Fig.15 and Fig.16 1 is a flowchart showing the data frame reception process executed by the ECU 100b. The data frame reception process of the ECU 100b will be described below with reference to this figure. The ECUs 100a, 100c, and 100d also perform the same data frame reception process as the ECU 100b.

[0161] When a frame is transmitted to the bus 200 , the data frame reception process is started in the ECU 100 b .

[0162] ECU100b receives data bit by bit from bus 200 according to CAN protocol, receives ID etc. in data frame and processes it, then receives data field. At this time, frame interpretation unit 102 transmits ID, DLC, data field etc. to frame processing unit 105, and frame processing unit 105 starts data processing associated with data field (step S1101).

[0163] The frame processing unit 105 of the ECU 100b obtains the data field header 301 in the data field of the received data frame and stores it in a buffer as a working storage area (step S1102). In addition, the start marker 302 in the data field is obtained and stored in the buffer (step S1103).

[0164] Next, the frame processing unit 105 determines whether the value of the acquired start marker 302 is "00" (2 bits) indicating the general data 304, "01" (2 bits) indicating the MAC calculation data 305, or another value (indicating MAC) (steps S1104, S1105).

[0165] Next, the frame processing unit 105 obtains the data size 303 following the start marker 302, and reserves a buffer according to the size (step S1106a, S1106b, or S1106c). Next, when the start marker 302 indicates general data 304, the general data 304 is obtained and stored in the reserved buffer (step S1107). When the start marker 302 indicates MAC calculation data 305, the MAC calculation data 305 is obtained and stored in the reserved buffer (step S1108). In other cases, MAC 306 is obtained and stored in the reserved buffer (step S1109).

[0166] The frame processing unit 105 determines whether the acquisition of all data in the received data field has been completed based on the DLC and the data field, and repeats the processing of the above steps S1103 to S1109 until the acquisition of all data in the data field is completed (step S1110).

[0167] When the acquisition of data in all data fields is completed, the frame processing unit 105 checks the composition of the received data frame based on the data field composition type 313 included in the data field header 301 (step S1111). When it is determined that the frame contains only general data 304 (that is, a data frame in which the general data bit of the data field composition type 313 is "1" and the other two bits are "0") (step S1112), the frame processing unit 105 performs a predetermined process (processing related to the function corresponding to the data) according to the content of the received data (step S1113).

[0168] When the received data frame is not a frame including only the general data 304, the frame processing unit 105 checks the MAC calculation target field type 312 included in the data field header 301 (step S1114). Next, the frame processing unit 105 obtains the value of each field storing the data to be calculated for MAC based on the confirmed MAC calculation target field type 312, thereby collecting data required for MAC verification (step S1115).

[0169] The frame processing unit 105 notifies the MAC processing unit 106 of the data required for the collected MAC verification and performs MAC verification processing using the obtained MAC value. If the verification is successful (step S1116), a predetermined process (processing related to the function corresponding to the data) is performed according to the content of the received data (step S1117). In addition, the MAC processing unit 106 calculates the value obtained by combining the data (data to be calculated by the MAC) obtained from the frame processing unit 105 and the reception count value held by the count holding unit 108 using the key held by the MAC key holding unit 107, thereby calculating the MAC value, and notifies the frame processing unit 105 of the MAC as the calculated result. Then, in the frame processing unit 105, the MAC verification is performed by determining whether the value of MAC306 in the data field of the received data frame is consistent with the MAC calculated by the MAC processing unit 106. If they are consistent, the verification is successful, and if they are inconsistent, the verification fails.

[0170] If the verification is unsuccessful in step S1116, the frame processing unit 105 skips the processing related to the function corresponding to the data in the data field of the received data frame (step S1117).

[0171] When the process of step S1117 is completed or skipped, the frame processing unit 105 clears all buffers (step S1118), and increases the reception count value (by 1) (step S1119).

[0172] [1.16 Effects of Implementation Method 1]

[0173] In the in-vehicle network system 10 shown in the first embodiment, the data field of the data frame transmitted and received between the plurality of ECUs includes a data field header 301, a start tag 302, etc. that can function as an identifier related to the data used in the calculation for calculating the MAC, thereby making it possible to freely determine the composition of the data stored in the data field. As a result, for example, it is possible to perform operations such as coexistence and transmission of a data frame storing a MAC in the data field and a data frame not storing a MAC in the data field, and compared with the case where the MAC is always stored in the data frame, the increase in bus traffic can be suppressed. In addition, since even when a data frame including the MAC calculation data 305 to which the MAC 306 is attached and a data frame including the general data 304 to which the MAC is not attached is transmitted as a frame of the same ID (message ID), the MAC calculation data 305 and the general data 304 can be reliably identified by the data field header 301, the start tag 302, etc., it is possible to prevent the general data 304 from being mistakenly subjected to the MAC verification process.

[0174] (Implementation Method 2)

[0175] Hereinafter, as an embodiment of the present disclosure, an in-vehicle network system (hereinafter referred to as “in-vehicle network system 11”) including an ECU will be described with reference to the accompanying drawings, wherein the ECU implements a sending method or a receiving method for enabling verification of data using a MAC and enabling efficient transmission and reception of data.

[0176] The vehicle network system 11 is a system that is partially modified from the vehicle network system 10 described in the first embodiment, and is the same as the vehicle network system 10 except for the points not specifically described here. In the vehicle network system 10, in a data frame including a MAC, the MAC is a value that is calculated by calculation using data in a certain field in the data frame and verified using the data. In contrast, in the vehicle network system 11 shown in the second embodiment, the data that becomes the calculation object of the MAC (that is, the data used in the calculation for calculating the MAC) can be included in a data frame different from the MAC, thereby expanding the degree of freedom of the data structure and the composition of the data frame.

[0177] [2.1 Overall structure of the vehicle network system 11]

[0178] The overall configuration of the in-vehicle network system 11 is basically the same as the overall configuration of the in-vehicle network system 10 according to the first embodiment (see Figure 1 ), and includes a bus 200, and nodes connected to the bus 200, such as ECUs 2100a to 2100d connected to various devices. ECUs 2100a to 2100d are respectively ECUs 100a to 100d shown in Embodiment 1 (see Figure 1 ) is partially deformed. ECU2100a~2100d is connected to engine 310, brake 320, door opening and closing sensor 330 and window opening and closing sensor 340 respectively. ECU2100a~2100d can change the processing content of the executed frame according to the data requiring MAC verification, data not requiring MAC verification, MAC, and identifier for determining the data to be calculated as the object of MAC stored in the data field and transmitted within the range of multiple frames.

[0179] In the in-vehicle network system 11 , each ECU also exchanges frames in accordance with the CAN protocol.

[0180] [2.2 MAC assignment mode example]

[0181] Fig.17This is a diagram showing an example of a mode of assigning a MAC to a data frame. For example, each data frame is sequentially transmitted to the bus 200 in the order from the left side to the right side of the diagram. Here, the mode of assigning a MAC has various variations on whether to assign a MAC or which field of which frame the MAC calculation object is. Fig.17 In the three data frame examples, the central data frame 502 does not include a MAC. Fig.17 In the example of FIG. 5 , the following example is shown: MAC is calculated based on the values ​​of the data fields included in two or more frames and divided, and the divided MACs are stored in the same frame as a certain data to be calculated and sent. That is, the following example is shown: MAC is calculated based on the data field of the data frame 501 on the left and the DLC and data field of the data frame 503 on the right, a part of the MAC is stored in the data frame 501 on the left and sent, and the other part of the MAC is stored in the data frame 503 on the right and sent.

[0182] Here, in order to suppress the increase of bus traffic or reduce the amount of calculation, an example is shown in which whether MAC is assigned to each frame and whether the data to be calculated for MAC is only the data field or includes the DLC field is switched, but variations other than these examples are also possible. For example, MAC may be assigned to all frames, all of the ID field, DLC field, and data field may be used as the calculation object of MAC, one of the ID field, DLC field, and data field may be used as the calculation object of MAC alone, a combination of each may be used as the calculation object, or a combination of these fields and other fields may be used as the calculation object.

[0183] [2.3 Configuration of ECU2100a]

[0184] Fig.18 This is a diagram of the structure of ECU2100a. ECU2100a includes: a frame transceiver unit 101, a frame interpretation unit 102, a reception ID judgment unit 103, a reception ID list holding unit 104, a frame processing unit 2105, a MAC processing unit 106, a MAC key holding unit 107, a counter holding unit 108, a frame generation unit 2109 and a data acquisition unit 110. Each of these components is a functional component, and each function is implemented by a communication line in ECU2100a, a processor or a digital circuit that executes a control program stored in a memory, etc. In addition, ECU2100b~2100d also have the same structure. In addition, for the same as embodiment 1 (refer to Figure 5 ) are assigned the same reference numerals and their descriptions are omitted.

[0185] The frame processing unit 2105 is a component formed by transforming a part of the frame processing unit 105. It receives the value of the data field from the frame interpretation unit 102 and performs processing corresponding to various tags contained in the data field (tags that can function as identifiers such as the data field header and the start tag, and the identifier is an identifier of the data used in the calculation for calculating the MAC). This processing includes data verification related to the MAC (that is, MAC verification processing) for the data assigned with the MAC, and can also include processing related to the function corresponding to the data shown in Implementation Example 1. In addition, when using Figure 22 to Figure 25 , explaining the specific contents (processing flow) related to the frame transmission and reception processing (data frame transmission processing and data frame reception processing). In addition, here, it is assumed that various tags are included in the data field of the data frame, but various tags can also be included in other fields such as the extended ID field.

[0186] The frame generation unit 2109 is a component formed by deforming a part of the frame generation unit 109, and it constructs an error frame according to the notification from the frame interpretation unit 102 indicating the sending of an error frame, and notifies the frame transceiver unit 101 to send the error frame. In addition, when ECU2100a assigns MAC and sends data, the frame generation unit 2109 notifies the MAC processing unit 106 of the value of the data notified from the data acquisition unit 110 and a predetermined message ID, and receives the calculated MAC. When ECU2100a sends data assigned with MAC, the frame generation unit 2109 constructs a data frame in the memory (transmission buffer) in a manner including a predetermined message ID, the value of the data notified from the data acquisition unit 110, and the MAC received from the MAC processing unit 106, and notifies the frame transceiver unit 101. Fig.19 and Fig. 20 The structure of the data field of the data frame generated by the frame generation unit 2109 will be described.

[0187] [2.4 Data field format]

[0188] The data field format of the data frame sent to the ECU in the in-vehicle network system 11 is basically the same as the data field format used in the in-vehicle network system 10 shown in the first embodiment (see Figure 7 and Figure 8 ). However, the data field header 301 is replaced with the data field header 2301.

[0189] [2.5 Data structure example of data field header 2301]

[0190] Fig.19 The data structure of the data field header 2301 is shown. When the data frame is transmitted by the frame generation unit 2109, the data field header 2301 is set at the beginning of the data field.

[0191] The data field header 2301 is composed of frame characteristic data 2311 (18 bits), a MAC calculation object field type 312 (3 bits), and a data field configuration type 313 (3 bits), and is 24 bits in total.

[0192] Since the MAC calculation object field type 312 and the data field configuration type 313 are the same as those in the first embodiment, their description is omitted here (see Fig.10 and Fig.11 ).

[0193] [2.6 Data structure example of frame characteristic data 2311]

[0194] Fig. 20 Indicates the data structure of the frame characteristic data 2311 included in the data field header 2301.

[0195] The frame characteristic data 2311 is composed of a frame number (frame No.) 2321, a total number of frames 2322, a number of frames including MAC calculation data 2323, and a number of frames including MAC 2324, and is 18 bits in total.

[0196] Frame No. 2321 is a value used to identify the group of a series of data frames when the data to be sent is divided into multiple data frames and sent from other groups, and is represented by 6 bits. Frame No. 2321 is assigned by the ECU that sends the data frame so that: Frame No. 2321 becomes the same value in each data frame belonging to the group of a series of data frames formed by dividing the data to be sent, and Frame No. 2321 becomes another value in the data frames belonging to other groups. The method for determining the value of the frame No., for example, can be set to a consecutive number, and the value can be incremented each time a group of data frames is sent, or a value can be randomly generated when a group of data frames should be sent. In addition, it is also possible to set the frame No. to zero in a data frame that does not contain MAC calculation data or MAC but only contains general data, and process it as an exception. The following is an example of setting the frame No. to zero in a data frame containing only general data.

[0197] The total number of frames 2322 is a value indicating the number of data frames in a group of data frames divided into a plurality of data frames, and is expressed by 4 bits. The number of frames including MAC calculation data 2323 is a value indicating the number of frames including MAC calculation data in the group of data frames, and is expressed by 4 bits. In addition, the number of frames including MAC 2324 is a value indicating the number of frames including MAC in the total number of frames, and is expressed by 4 bits.

[0198] [2.7 Example of transmission frame of ECU2100a related to engine]

[0199] Fig.21 This is a diagram showing an example of the ID (message ID) and the content (data) of the data field in a data frame sent from ECU2100a connected to engine 310. The message ID of the frame sent by ECU2100a is "1". In this diagram, the content (data) of the data field is separated by spaces for each byte and expressed in hexadecimal. Fig.21 In the example, the first 3 bytes of each line are the data field header 2301, the next (4th byte) byte is the start mark 302 and the data size 303, and the next (5th byte) byte is the MAC calculation data 305 indicating the speed (km / hour) (only the second line is the general data 304). Fig.21 The next byte (the 6th byte) in the first and third lines of the example is the start tag 302 and the data size 303, and the following 4 bytes (the 7th byte) are MAC 306. The speed (km / hour) takes a value in the range of 0 (km / hour) to 180 (km / hour). Fig.21 The upper row to the lower row of the example shows that Fig.17 The pattern related to MAC assignment illustrated in the example shows that the content (data) of each message ID and data field corresponding to each frame successively sent from ECU2100a shows a situation where the speed is accelerated from 0 km / hour by 1 km / hour.

[0200] [2.8 Data frame transmission process]

[0201] Fig. 22 2 is a flowchart showing the data frame transmission processing executed by ECU 2100a. The data frame transmission processing in ECU 2100a will be described below according to this figure. Fig. 22 In the data frame transmission process ( Fig.14 ) The same processing steps (steps) are given the same reference numerals, and the description of these steps is appropriately simplified. In addition, although the contents of the data frames sent are different, ECU2100b~2100d also perform the same data frame sending process as ECU2100a. In ECU2100a, the data frame sending process is performed regularly.

[0202] ECU2100a determines the data to be sent, and causes the frame generation unit 109 to start the data frame generation process (step S1001). The data frames formed by the data to be sent and the frame composition used to send the data to be sent one by one are determined according to a predetermined algorithm predetermined by the vehicle network system 11. As an example of a predetermined algorithm for determining the frame composition and data composition, the above-mentioned Fig.17Examples include the following algorithms: for example, three transmissions are set as a set, and the data frame 501 transmitted for the first time and the data frame 503 transmitted for the third time are set as the same group, and in the data field of the data frame 501 transmitted for the first time, a part of the calculated MAC (for example, the first 2 bytes) is included by using the MAC calculation data 305 indicating the speed, the MAC calculation data 305 of the data frame 501 and other data frames 503, and the DLC of other data frames 503, and in the data field of the data frame 502 transmitted for the second time, general data 304 indicating the speed is included, and in the data field of the data frame 503 transmitted for the third time, the MAC calculation data 305 indicating the speed and the remaining part of the above-mentioned MAC (for example, the second 2 bytes) are included and transmitted.

[0203] As a data frame generation process, the frame generation unit 2109 sets a value indicating the structure of data to be transmitted determined based on a predetermined algorithm at a corresponding position of the MAC calculation target field type 312 in the data field header 2301 of the data field in the data frame determined in the transmission buffer (step S1002).

[0204] Next, in order to divide the data to be transmitted into a plurality of data frames and transmit them, the ECU 2100a divides the data to be transmitted into the number of frames (N) determined according to a predetermined algorithm (step S2001). That is, the division positions of the data to be transmitted are determined.

[0205] Next, the ECU 2100a sequentially focuses on each data frame according to the data to be transmitted according to a predetermined algorithm, and repeatedly sets the data in the data frame every N frames (steps S1003 to S1018) (step S2002).

[0206] That is, the frame generation unit 2109 of the ECU 2100a determines whether the data frame to be transmitted (the data frame of interest) containing the data to be transmitted is a frame containing the general data 304 (step S1003). If the general data 304 is not contained, the processing associated with the general data is skipped (steps S1004 to S1007). If it is determined in step S1003 that the data frame to be transmitted contains the general data 304, the frame generation unit 2109 sets "1" to the general data bit of the data field configuration category 313 in the data field header 2301 in the data frame determined in the transmission buffer (step S1004). Next, the frame generation unit 2109 sets a value indicating general data as the start marker 302 in the data field of the data frame determined in the transmission buffer (step S1005), sets a value corresponding to the size of the general data 304 as the data size 303 (step S1006), and sets the general data 304 (step S1007).

[0207] In addition, the frame generation unit 2109 determines whether the data frame to be transmitted (the data frame of interest) containing the data to be transmitted is a frame containing the MAC calculation data 305 (step S1008). If the MAC calculation data 305 is not contained, the processing associated with the MAC calculation data is skipped (steps S1009 to S1012). If it is determined in step S1008 that the data frame to be transmitted contains the MAC calculation data 305, the frame generation unit 2109 sets "1" to the MAC calculation data bit of the data field configuration type 313 in the data field header 2301 of the data frame determined in the transmission buffer (step S1009). Next, the frame generation unit 2109 sets a value indicating the MAC calculation data as the start marker 302 in the data field of the data frame determined in the transmission buffer (step S1010), sets a value corresponding to the size of the MAC calculation data 305 as the data size 303 (step S1011), and sets the MAC calculation data 305 (step S1012).

[0208] In addition, the frame generation unit 2109 determines whether the data frame to be transmitted (the data frame of interest) containing the data to be transmitted is a frame containing MAC 306 (step S1013). If MAC 306 is not contained, the processing associated with MAC is skipped (steps S1014 to S1018). If it is determined in step S1013 that the data frame to be transmitted contains MAC 306, the frame generation unit 2109 sets the MAC bit of the data field configuration type 313 in the data field header 2301 in the data frame in the transmission buffer to "1" (step S1014).

[0209] Next, the frame generation unit 2109 transmits data determined based on a predetermined algorithm (that is, data based on the value set in the MAC calculation object field type 312) to the MAC processing unit 106 as data to be calculated for MAC, and the MAC processing unit 106 calculates MAC (step S1015). The MAC processing unit 106 calculates the value obtained by combining the data to be calculated for MAC transmitted to the frame generation unit 2109 and the transmission count value held by the count holding unit 108, using the MAC key held by the MAC key holding unit 107, thereby calculating the MAC value to be set as MAC 306 in the data frame to be transmitted. Next, the frame generation unit 2109 sets a value indicating MAC as the start marker 302 in the data field of the data frame determined in the transmission buffer (step S1016), sets a value corresponding to the size of MAC 306 as the data size 303 (step S1017), and sets MAC 306 (step S1018). When the predetermined algorithm determines to divide the MAC and transmit it, in step S1018, the frame generation unit 2109 divides the MAC value calculated in the MAC processing unit 106 and sets the divided MAC values ​​306 in data fields of different data frames.

[0210] When the processing in step S1018 is completed or the processing associated with MAC is skipped, the frame generation unit 2109 determines whether the generation of N data frames from the 1st frame to the Nth frame is completed (step S2002). If not completed, it focuses on the data frames in the N frames that have not yet been focused on, and repeats the processing of steps S1003 to S1018.

[0211] When it is determined in step S2002 that the generation of N data frames has been completed, the frame generation unit 2109 sets the frame characteristic data 2311 in the data field header 2301 of each data frame according to the content of the generated data frame (step S2003). Thus, the frame generation unit 2109 ends the data frame generation process for generating N data frames to be transmitted, and notifies the frame transceiver 101 (step S1019).

[0212] The frame transceiver 101 transmits the data frame generated in the transmission buffer by the frame generator 2109 to the bus 200 (step S1020). If the frame is normally transmitted, the transmission count value is incremented (step S1021).

[0213] [2.9 Data frame reception processing]

[0214] Figure 23 to Figure 25 2 is a flowchart showing the data frame receiving process performed by ECU 2100b. The data frame receiving process of ECU 2100b will be described below according to this figure. Figure 23 to Figure 25In the data frame reception process ( Fig.15 and Fig.16 ) The same processing steps (steps) are given the same reference numerals, and the description of these steps is appropriately simplified. In addition, ECU2100a, 2100c, and 2100d also perform the same data frame reception processing as ECU2100b.

[0215] When a frame is transmitted to the bus 200 , the data frame reception process is started in the ECU 2100 b .

[0216] ECU2100b receives data bit by bit from bus 200 according to CAN protocol, receives ID etc. in data frame and processes it, then receives data field. At this time, frame interpretation unit 102 transmits ID, DLC, data field etc. to frame processing unit 2105, and frame processing unit 2105 starts data processing associated with data field (step S1101). In addition, frame processing unit 2105 distinguishes frames by ID, and processes the case where multiple frames with the same ID may be sent as a group.

[0217] The frame processing unit 2105 of the ECU 2100b obtains the data field header 2301 in the data field of the received data frame, and stores it in a buffer as a working storage area (step S1102).

[0218] The frame processing unit 2105 checks the frame characteristic data 2311 included in the data field header 2301 (step S2101), and determines whether the value of the frame No. 2321 of the frame characteristic data 2311 is consistent with the value of the previously saved frame No. (step S2102). Thus, it is determined whether the frame containing the data field received this time is a frame sent as the same group as the previously received data frame. If they are inconsistent, the saved frame No. is overwritten with the received frame No., that is, the received frame No. is saved (step S2103), and the received frame number, which is a variable value used in the data frame reception process, is cleared to zero (step S2104).

[0219] If it is determined to be consistent in step S2102 and if step S2104 is executed, the frame processing unit 2105 increases the number of received frames (increases by 1) (step S2105). Thus, the number of received frames indicates which data frame is the data frame received this time among multiple data frames sent as the same group. In addition, it is also possible to skip the processing of steps S2102 to S2105 when the frame number is exceptionally zero. In addition, it is also possible to manage the number of received frames for each frame number separately when it is necessary to allow multiple groups of frames to coexist and be sent.

[0220] Next, the frame processing unit 2105 obtains the start marker 302 in the data field of the received data frame, and stores it in the buffer (step S1103).

[0221] Next, the frame processing unit 2105 determines whether the acquired value of the start marker 302 indicates the general data 304, the MAC calculation data 305, or another value (a value indicating MAC) (steps S1104, S1105).

[0222] Next, the frame processing unit 2105 obtains the data size 303 following the start marker 302, and reserves a buffer according to the size (step S1106a, S1106b, or S1106c). Next, when the start marker 302 indicates general data 304, the general data 304 is obtained and stored in the buffer (step S1107). When the start marker 302 indicates MAC calculation data 305, the MAC calculation data 305 is obtained and stored in the buffer (step S1108). In other cases, MAC 306 is obtained and stored in the buffer (step S1109).

[0223] The frame processing unit 2105 determines whether the acquisition of all data in the received data field has been completed based on the DLC and the data field, and repeats the processing of the above steps S1103 to S1109 until the acquisition of all data in the data field is completed (step S1110).

[0224] When all the data in the data field have been obtained, the frame processing unit 2105 checks the composition of the received data frame based on the data field composition type 313 included in the data field header 2301, and determines whether it is a frame containing only general data 304 (step S1112). When it is determined that it is a frame containing only general data 304, the frame processing unit 2105 performs processing related to a predetermined function according to the content of the received data (step S1113). After step S1113, the frame processing unit 2105 clears the buffer that holds the general data (step S2106), and increases the reception count value (step S1119), thereby completing the data frame reception processing.

[0225] In addition, when it is determined in step S1112 that the frame does not include only general data 304, the frame processing unit 2105 determines whether data frames of the same group corresponding to the number indicated by the total frame number 2322 of the frame characteristic data 2311 have been received based on the number of received frames (step S2107). When it is determined that data frames of the same group corresponding to the number indicated by the total frame number 2322 have not been received, the frame processing unit 2105 increases the reception count value (step S1119).

[0226] In addition, when it is determined in step S2107 that the same group of data frames corresponding to the number indicated by the total frame number 2322 is received, the frame processing unit 2105 confirms the MAC calculation target field type 312 included in the data field header 2301 (step S1114). Next, the frame processing unit 2105 obtains the value of each field storing the data to be calculated for MAC based on the confirmed MAC calculation target field type 312 (that is, obtains the value of the required field of each received data frame from the buffer), thereby collecting the data required for MAC verification (step S1115).

[0227] The frame processing unit 2105 notifies the MAC processing unit 106 of the collected data required for MAC verification and performs MAC verification processing using the obtained MAC value. If the verification is successful (step S1116), a predetermined process (processing related to the function corresponding to the data) is performed according to the content of the received data (step S1117). In steps S1115 and S1116, when the type of the content of the data field represented by various tags functioning as identifiers indicates an area containing data used in calculation for calculating MAC, the verification process is performed by calculation using the value of the area of ​​the data used in calculation for calculating MAC (the area corresponding to the various tags) in the data field.

[0228] If the verification is unsuccessful in step S1116, the frame processing unit 2105 skips the processing related to the function corresponding to the data in the data field of the received data frame (step S1117).

[0229] When the process of step S1117 is completed or skipped, the frame processing unit 2105 clears all buffers (step S1118) and increases the reception count value (step S1119).

[0230] [2.10 Effects of Implementation Method 2]

[0231] In the in-vehicle network system 11 shown in the second embodiment, the data field header 2301, the start tag 302, etc., which can function as an identifier for data used in the calculation for calculating MAC, is included in the data field of the data frame transmitted and received between multiple ECUs, so that the structure of the data stored in the data field can be freely determined. As a result, for example, the MAC calculation data 305 and MAC306 can be assigned the same frame number, and can be freely divided and configured in the data fields of multiple frames and sent, etc., so that flexible data design can be performed, and the increase in bus traffic can be suppressed. In addition, even if a data frame containing the MAC calculation data 305 with the MAC306 attached and a data frame containing the general data 304 without the MAC attached is sent as a frame with the same ID (message ID), the MAC calculation data 305 and the general data 304 can be reliably identified by the data field header 2301, the start tag 302, etc., so it is possible to prevent the general data 304 from being mistakenly subjected to MAC verification processing.

[0232] [2.11 Modification 1 of Implementation Method 2]

[0233] In implementation mode 2, Fig.17 The MAC assignment mode of the data frame MAC assignment shown can be transformed into Fig.26 For example, press Fig.26 The data frames are sent to the bus 200 in sequence from left to right.

[0234] Fig.26 Of the five data frame examples shown, data frame 602 does not include MAC and MAC calculation data. Fig.26 In the example of FIG. 6 , the following example is shown: MAC is calculated based on the values ​​of the data fields included in two or more frames and divided, and the divided MACs are stored in frames that are different from any of the data to be calculated (each independent) and sent. That is, the following example is shown: MAC is calculated based on the DLC and data field of data frame 601 and the DLC and data field of data frame 603, a part of the MAC is stored in data frame 604 and sent, and the other part of the MAC is stored in data frame 605 and sent.

[0235] and Fig.26Corresponding to the example, the predetermined algorithm for determining the frame composition and data composition used in the vehicle network system is, for example, the following algorithm: 5 transmissions are regarded as a set, wherein the data frames 601, 603 to 605 transmitted for the first, third to fifth times are set as the same group, the data fields of the data frames 601 and 603 contain MAC calculation data 305 indicating the value to be transmitted such as the speed, the data field of the data frame 602 contains general data 304 indicating the value to be transmitted such as the speed, the data field of the data frame 604 contains a part of the MAC calculated by using the MAC calculation data 305 of the data frames 601 and 603 and the DLC calculation (for example, the first half 2 bytes), and the data field of the data frame 605 contains the remaining part of the above MAC (for example, the second half 2 bytes) and transmits it. Various modifications can be made to the predetermined algorithm. In addition, the values ​​to be transmitted that are divided and included in each data frame are not necessarily values ​​generated or obtained separately at a time, and can be values ​​generated or obtained as a whole, or values ​​generated or obtained independently at the same time. Furthermore, each data frame does not necessarily need to be sent periodically (that is, at regular intervals in time).

[0236] In addition, Fig.26 Corresponding to the example of the mode involved in the MAC assignment, except for the change in the content of the predetermined algorithm for determining the frame composition and data composition, the structure and operation of each ECU of the vehicle network system in the modification example 1 are the same as those of the above-mentioned ECUs 2100a to 2100d. Fig.26 Corresponding to the example of, as a predetermined algorithm for determining the frame composition and data composition, in the case where it is possible to use a field other than the data field (ID field or DLC) in the previous data frame to calculate the MAC in the subsequent data frame, the data frame reception process may be modified as follows. That is, in step S2107 ( Fig.25 ) in a case where it is determined that no data frames of the same group corresponding to the number represented by the total frame number 2322 have been received, the frame processing unit 2105 may pre-store the contents of the ID field and DLC in a buffer in order to be able to use the ID field or DLC in the calculation of the MAC in the subsequently received frame.

[0237] [2.12 Effects of Modification 1 of Implementation Method 2]

[0238] In the vehicle network system involved in variant example 1, a frame containing MAC calculation data 305 and a frame containing MAC306 calculated based on the MAC calculation data 305 can be separated and sent separately, thereby producing the following effect: the processing load of frames per unit time in each ECU on the sending side and the receiving side can be reduced (dispersed).

[0239] [2.13 Modification 2 of Implementation Method 2]

[0240] In implementation mode 2, Fig.17 The MAC assignment mode of the data frame assigned to the MAC can also be transformed into Fig. 27 Example shown.

[0241] Fig. 27 The example of data frame 612 in the example of five data frames shown does not include a MAC and MAC calculation data. Fig. 27 In the example of , the following example is shown: MAC is calculated based on the values ​​of the data fields included in two or more frames and divided, and the divided MACs are stored together with general data in frames that are different from any of the data to be calculated and sent. That is, the following example is shown: MAC is calculated based on the data field of data frame 611 and the data field of data frame 613, a part of the MAC is stored together with general data (that is, data not used in the calculation of MAC) in data frame 614 and sent, and the other part of the MAC is stored together with general data in data frame 615 and sent.

[0242] and Fig. 27 Corresponding to the example of , the predetermined algorithm for determining the frame composition and data composition used in the vehicle network system is, for example, the following algorithm: 5 transmissions are set as a set, wherein the data frames 611, 613 to 615 transmitted in the first, third to fifth times are set as the same group, the data fields of the data frames 611 and 613 contain the MAC calculation data 305 indicating the value to be transmitted such as the speed, the data field of the data frame 612 contains the general data 304 indicating the value to be transmitted such as the speed, the data field of the data frame 614 contains the general data 304 and a part of the MAC calculated by calculation using the MAC calculation data 305 of the data frames 611 and 613 (for example, the first half 2 bytes), and the data field of the data frame 615 contains the general data 304 and the remaining part of the MAC (for example, the second half 2 bytes) and transmits. Various modifications can be made to the predetermined algorithm. In addition, the values ​​to be sent and included in each data frame are not necessarily values ​​generated or obtained separately at a certain time, and can be values ​​generated or obtained as a whole, or values ​​generated or obtained independently at the same time. In addition, each data frame does not necessarily need to be sent regularly (that is, at a certain interval in time).

[0243] In addition, Fig. 27 Corresponding to the example of the mode involving MAC assignment, except for the change in the content of the predetermined algorithm for determining the frame composition and data composition, the structure and operation of each ECU of the vehicle network system in the modified example 2 are the same as the above-mentioned ECU2100a~2100d.

[0244] [2.14 Effects of Modification 2 of Implementation Method 2]

[0245] In the in-vehicle network system according to the second modification, the frame including the MAC calculation data 305 and the frame including the MAC 306 calculated based on the MAC calculation data 305 can be transmitted and received at different times, and for example, general data that can be transmitted at the time of transmitting the MAC 306 can be transmitted together with the MAC. Thus, the completion of frame transmission and reception can be accelerated as a whole.

[0246] [2.15 Modification 3 of Implementation Method 2]

[0247] In implementation mode 2, Fig.17 The MAC assignment mode of the data frame MAC assignment shown can also be transformed into Fig.28 Example shown.

[0248] Fig.28 Of the four data frame examples shown, data frame 624 does not include a MAC or MAC calculation data. Fig.28 In the example of , the following example is shown: MAC is calculated based on the values ​​of the data fields included in two or more frames, and the MAC is stored together with general data in a frame that is different from any of the data to be calculated (each independent) and sent. That is, the following example is shown: MAC is calculated based on the data field of data frame 621 and the data field of data frame 623, and the MAC is stored together with general data (that is, data not used in the calculation of MAC) in data frame 622 and sent, and in the last data frame 624, only the general data is stored in the data field and sent.

[0249] and Fig.28Corresponding to the example, the predetermined algorithm for determining the frame composition and data composition used in the vehicle network system is, for example, the following algorithm: 4 transmissions are regarded as a set, and all data frames 621 to 624 are set as the same group. In the data fields of data frames 621 and 623, MAC calculation data 305 indicating the value to be sent, such as speed, is included. In the data field of data frame 622, general data 304 and MAC calculated by calculation using the MAC calculation data 305 of data frame 621 and data frame 623 are included. In the data field of data frame 624, general data 304 indicating the value to be sent, such as speed, is included and sent. Various modifications can be made to the predetermined algorithm. In addition, the values ​​to be sent that are divided into and included in each data frame are not necessarily values ​​generated or obtained separately at a time, and can be values ​​generated or obtained as a whole, or values ​​generated or obtained independently at the same time. In addition, it is not necessary to send each data frame regularly (that is, at a certain interval in time).

[0250] In addition, Fig.28 Corresponding to the example of the mode involved in the MAC assignment of the MAC, except for the change in the content of the predetermined algorithm for determining the frame composition and data composition, the composition and operation of each ECU of the vehicle network system in the modification example 3 are the same as those of the above-mentioned ECUs 2100a to 2100d. However, in the above-mentioned embodiment 2, in step S2107 ( Fig.25 ) uses the total frame number 2322 to determine the number of received data frames, but in Modification 3, the frame number 2323 containing MAC calculation data and the frame number 2324 containing MAC data are used ( Fig. 20 ) to determine the timing at which the MAC verification process can be started. As a result, the MAC verification process can be started before the number of received frames reaches the total number of frames 2322. Therefore, for example, it is useful to determine the frame composition in a manner such that data other than data to be calculated for the MAC is configured in a data frame sent after the data frame containing the MAC. In addition, the frame characteristic data 2311 may include information indicating which data frame among a plurality of data frames belonging to a group (that is, data frames assigned the same frame No.) is received after which the MAC verification process can be started, instead of the number of frames 2323 containing data for MAC calculation and the number of frames 2324 containing MAC data, and the ECU determines the timing at which the MAC verification process is started based on the information.

[0251] [2.16 Effects of Modification 3 of Implementation Method 2]

[0252] In the in-vehicle network system according to Modification 3, since the ECU can start the MAC verification process before the number of received frames reaches the total number of frames 2322, the completion of frame transmission and reception can be accelerated.

[0253] [2.17 Supplement]

[0254] The above describes various modes related to MAC assignment, but these are just examples, and various modes can be used at any timing. In addition, the state in which MAC is included in a single frame (that is, the state in which MAC verification can be performed directly when the frame is received) is called a single frame. In addition, the state in which MAC is divided into multiple frames is called a multi-frame.

[0255] In the ECU, as a predetermined algorithm for determining the frame composition and data structure of the transmitted data, various algorithms can be used that arbitrarily determine whether to transmit data in a single frame or in multiple frames and switch at an arbitrary timing.

[0256] (Other embodiments)

[0257] As described above, embodiments 1 and 2 and variations 1 to 3 are described as examples of the technology involved in the present disclosure. However, the technology involved in the present disclosure is not limited thereto, and can also be applied to embodiments that are appropriately changed, replaced, added, or omitted. For example, the following variations are also included in one embodiment of the present disclosure.

[0258] (1) The mode involved in the assignment of MAC shown in the above embodiment may be a mode that is different for each frame ID. In addition, even if the frame ID is the same, the mode involved in the assignment of MAC is not limited to one mode and can be set to change at any time. For example, it is also possible to change the mode involved in the assignment of MAC by using a plurality of predetermined algorithms that are predetermined in advance to determine the frame composition and data composition in order to implement the mode involved in the assignment of MAC, and switching the predetermined algorithms one by one. The timing of the change may be either periodic or random. In addition, the mode involved in the assignment of MAC may be changed according to the bus occupancy status.

[0259] (2) In the above embodiment, as a mode involving the assignment of MAC, an example of reducing the number of times MAC is assigned to a frame sent by an ECU or the number of times MAC calculation data is included in a sent frame (an example of thinning out) is shown. In addition, the number of times MAC verification processing is performed on a frame in the receiving ECU may be thinned out. In addition, the sending ECU may add data for indicating a change in processing in the receiving ECU to the frame and send it.

[0260] (3) In the above embodiment, it is shown that the data values ​​of the ID, DLC, and data fields and the count value can be used for the calculation of MAC, but the values ​​of other fields included in the data frame can be used for calculation, and the MAC can be calculated based on one of their values ​​or a combination of multiple values. In addition, the size of the MAC included in the frame is not limited to a specific size, and can be set to a different size each time it is sent, or can be set to a different size for each message ID. In addition, similarly, the size of the data value such as the speed and the size of the count value are not limited to a specific size.

[0261] (4) In the above embodiment, an example is shown in which the count value is increased each time the count value is sent or received, but the count value may also be a value that is automatically increased according to the time. In addition, the value of the time itself may be used instead of the count value. That is, when a MAC is generated based on a variable (count value, time, etc.) that changes each time a data frame is sent, it is possible to make it difficult to illegally decipher the MAC. In addition, the sending count value may be set to increase each time MAC data is generated, and the receiving count value may be set to increase each time the MAC is verified.

[0262] (5) In the above embodiment, the data frame under the CAN protocol is described in the standard ID format, but it may be an extended ID format.

[0263] (6) In the above embodiment, various tags are added to the data field of the data frame under the CAN protocol and recorded, but they can also be stored in the extended ID field. In addition, they can also be added to other fields of the data frame.

[0264] (7) In the above embodiment, the MAC calculation algorithm is set to HMAC, but it can also be CBC-MAC (Cipher Block Chaining Message Authentication Code) or CMAC (Cipher-based MAC). In addition, regarding the padding used for MAC calculation, any padding method can be used as long as it is zero padding, ISO10126, PKCS#1, PKCS#5, PKCS#7, or other padding methods required by the data size of the calculation block. In addition, regarding the method of changing the size of a block of 4 bytes, etc., padding can also be performed at the beginning, the end, or any part in the middle. In addition, even if the data used for MAC calculation is not continuous data (for example, 4 bytes of continuous data), it can be collected and combined bit by bit according to specific rules.

[0265] (8) In the above embodiment, a MAC key is maintained for each message ID, but a MAC key may be maintained for each ECU (that is, for one or more message ID groups). In addition, it is not necessary for all ECUs to maintain the same MAC key. In addition, each ECU connected to the same bus may maintain a common MAC key. However, the same MAC key needs to be maintained in the ECU that sends a frame with the same message ID and the ECU that receives the frame and verifies it. In addition, in the above embodiment, a count value (sending count value, receiving count value) is maintained for each message ID, but a count value may be maintained for each ECU (that is, for one or more message ID groups). In addition, a common count value may be used for all frames flowing on the same bus.

[0266] (9) In the above embodiment, the transmission count value is used to calculate the MAC, but the ECU may add all or part of the transmission count value to the data field and transmit it.

[0267] (10) In the above embodiment, for data frames sent and received between ECUs, the receiving ECU verifies the MAC of the data frame, but the vehicle network system may also include a MAC verification ECU that verifies the MAC assigned to all data frames. The MAC verification ECU, for example, maintains the MAC key and count value corresponding to all message IDs. Alternatively, when the result of MAC verification is judged to be an error (i.e., it is judged to be a verification failure), the MAC verification ECU may send an error frame to prevent it from being received by other ECUs.

[0268] (11) The arrangement and expression forms of various tags (tags that can function as identifiers related to data used in calculations for calculating MAC) such as the data field header 301, 2301, and the start tag 302 shown in the above-mentioned embodiment are merely examples. Therefore, for example, the data field header 301, 2301 may be determined at a predetermined position other than the beginning of the data field, or the same content as the various tags may be determined in different expression forms. In addition, the various tags, as identifiers related to the data used in calculations for calculating MAC, have the function of determining, for example, identification information of whether MAC verification is required, or information required for verification of the area of ​​data to be calculated as the object of MAC (for example, the type of content of the data field, the location of the area of ​​each type of data, the size of the data, and the like).

[0269] (12) The predetermined algorithm for determining the frame composition and data composition shown in the above embodiment is implemented, for example, by a processor that executes a control program in an ECU. A storage medium (memory, etc.) storing the control program related to the predetermined algorithm may be installed in the ECU, or the ECU may obtain the control program from the outside and store it in a storage medium for use.

[0270] (13) In the above embodiment, each ECU transmits a data frame, but the in-vehicle network system may include an ECU that only receives data frames but does not transmit data frames. Alternatively, the in-vehicle network system may include an ECU that only transmits data frames but does not receive data frames.

[0271] (14) The CAN protocol described in the above embodiments may have a broad meaning including derivative protocols such as TTCAN (Time-Triggered CAN) and CAN FD (CAN with Flexible Data Rate).

[0272] (15) The MAC key holding unit and the count holding unit in the above-mentioned embodiments may be stored in registers of hardware called a CAN controller or in firmware running on a personal computer connected to and running the CAN controller.

[0273] (16) Each ECU in the above-mentioned embodiments is a device including a digital circuit, an analog circuit, and a communication line, such as a processor and a memory, but may also include other hardware components such as a hard disk device, a display, a keyboard, and a mouse. In addition, a function may be implemented by dedicated hardware (digital circuit, etc.) instead of using a processor to execute a control program stored in a memory and implement the function in software.

[0274] (17) A part or all of the components of each device (ECU, etc.) in the above-mentioned embodiment can be constituted by a system LSI (Large Scale Integration). System LSI is a super-multifunctional LSI manufactured by integrating multiple components on a single chip. Specifically, it is a computer system composed of a microprocessor, ROM, RAM, etc. A computer program is recorded in the RAM. The system LSI realizes its function by the microprocessor working according to the computer program. In addition, each part of the components constituting the above-mentioned devices can be formed as an independent single chip or as a single chip containing a part or all. In addition, here, it is set as system LSI, but depending on the degree of integration, it is sometimes also called IC, LSI, super LSI and ultra-large-scale LSI. In addition, the method of integrated circuitization is not limited to LSI, and it can also be implemented using a dedicated circuit or a general-purpose processor. After LSI is manufactured, a programmable FPGA (Field Programmable Gate Array) or a reconfigurable processor that can reconstruct the connection and setting of the circuit units inside the LSI can also be used. Furthermore, if integrated circuit technology that replaces LSI emerges due to the advancement of semiconductor technology or other derived technologies, it is of course possible to use this technology to integrate functional blocks. It is also possible to apply biotechnology, etc.

[0275] (18) A part or all of the components constituting each of the above-mentioned devices may be constituted by an IC card or a single module that can be detachably mounted on each device. The IC card or the module is a computer system composed of a microprocessor, a ROM, a RAM, etc. The IC card or the module may also include the above-mentioned ultra-multifunctional LSI. The IC card or the module realizes its function by the microprocessor operating according to the computer program. The IC card or the module may also be tamper-resistant.

[0276] (19) As a technical solution of the present disclosure, the sending method or the receiving method shown above may also be used. In addition, it may be a computer program that implements the method using a computer, or it may be a digital signal composed of the computer program. In addition, as a technical solution of the present disclosure, the computer program or the digital signal may be recorded on a computer-readable recording medium, such as a floppy disk, a hard disk, a CD-ROM, an MO, a DVD, a DVD-ROM, a DVD-RAM, a BD (Blu-ray (registered trademark) Disc), and a semiconductor memory. In addition, it may be the digital signal recorded in these recording media. In addition, as a technical solution of the present disclosure, the computer program or the digital signal may be transmitted via an electric communication line, a wireless or wired communication line, a network represented by the Internet, and data broadcasting. In addition, as a technical solution of the present disclosure, it is a computer system having a microprocessor and a memory, the memory recording the computer program, and the microprocessor operating according to the computer program. In addition, the program or the digital signal may be recorded on the recording medium and transferred, or the program or the digital signal may be transferred via the network, etc., so as to be implemented using other independent computer systems.

[0277] (20) A form achieved by arbitrarily combining the components and functions described in the above-mentioned embodiment and the above-mentioned modification examples is also included in the scope of the present disclosure.

[0278] Industrial Applicability

[0279] The present disclosure can be used to ensure the security of messages sent and received in an in-vehicle network system.

[0280] Description of symbols

[0281] 10In-vehicle network system

[0282] 100a~100d、2100a Electronic Control Unit (ECU)

[0283] 101 frame transceiver

[0284] 102 frame interpretation unit

[0285] 103 receiving ID judgment unit

[0286] 104 Receiving ID list holding unit

[0287] 105, 2105 frame processing unit

[0288] 106MAC Processing Unit

[0289] 107MAC key holding unit

[0290] 108 counting holding unit

[0291] 109, 2109 frame generation unit

[0292] 110 Data Acquisition Department

[0293] 200 bus

[0294] 310 engine

[0295] 320 brake

[0296] 330 door opening and closing sensor

[0297] 340 window opening and closing sensor

[0298] 301, 2301 data field header

[0299] 302 Start Tag

[0300] 303 Data Size

[0301] 304 General Data

[0302] 305MAC calculation data

[0303] 306MAC data

[0304] 311 appointment bit

[0305] 312MAC calculation object field category

[0306] 313 Data field composition category

[0307] 2311 frame characteristic data

[0308] 2321 Frame number (Frame No.)

[0309] 2322 total frames

[0310] 2323 The number of frames containing data used for MAC calculation

[0311] 2324 Number of frames containing MAC

Claims

1. An in-vehicle network system, comprising a plurality of electronic control units that follow the CAN protocol (i.e., the controller area network protocol) and communicate via a bus, the in-vehicle network system comprising: a first electronic control unit, transmitting, via the bus, one or more data frames including an identifier, the identifier being an identifier representing data used in calculation for calculating a message authentication code, the message authentication code representing the legitimacy of the transmitted content; and The second electronic control unit receives one or more data frames sent on the bus, and performs message authentication code verification processing according to the identifier of the received data frame, The first electronic control unit causes a message authentication code to be included in at least one of the one or more data frames to be transmitted, the message authentication code being calculated by calculation using data arranged in one or more areas within the one or more data frames, The identifier included in the one or more data frames sent by the first electronic control unit includes information indicating a region of one or more data in the one or more data frames used in calculation for calculating the message authentication code, the second electronic control unit performs the verification process by calculation using data of the area indicated by the identifier, The first electronic control unit calculates the message authentication code by calculation using data in one or more areas configured in a plurality of data frames to be transmitted, and transmits the calculated message authentication code by including it in at least one data frame among the plurality of data frames. The identifier included in the plurality of data frames sent by the first electronic control unit includes information indicating the number of the plurality of data frames, When the second electronic control unit receives the number of data frames indicated by the identifier included in a received data frame, the second electronic control unit performs the verification process by calculation using data of the area indicated by the identifier in each received data frame. The received data frame includes an ID field and a data field, and the identifier indicates whether the data field includes data used in calculation for calculating a message authentication code.

2. A receiving method is a receiving method used in an in-vehicle network system, wherein the in-vehicle network system has a plurality of electronic control units that follow the CAN protocol (i.e., the controller area network protocol) and communicate via a bus, the receiving method comprising: A receiving step of receiving one or more data frames sent on the bus and containing an identifier, wherein the identifier is an identifier representing data used in calculation for calculating a message authentication code, and the message authentication code represents the legitimacy of the sent content; and a verification step, in which, when one or more data frames are received in the receiving step, a message authentication code is verified according to the identifier of the received data frame, The identifier in the data frame received in the receiving step indicates the type of the content of the data field of the data frame, The identifier in the data frame received in the receiving step is arranged in a data field of the data frame, In the verification step, the verification process is performed based on the identifier in the data field of the received data frame.

3. A receiving method is a receiving method used in a vehicle network system, wherein the vehicle network system has a plurality of electronic control units that follow the CAN protocol (i.e., the controller area network protocol) and communicate via a bus, and the receiving method comprises: A receiving step of receiving one or more data frames sent on the bus and containing an identifier, wherein the identifier is an identifier representing data used in calculation for calculating a message authentication code, and the message authentication code represents the legitimacy of the sent content; and a verification step, in which, when one or more data frames are received in the receiving step, a message authentication code is verified according to the identifier of the received data frame, The identifier in the data frame received in the receiving step indicates the type of the content of the data field of the data frame, The identifier included in the one or more data frames includes the following information, which indicates an area of ​​one or more data in the one or more data frames, In the verification step, the verification process is performed by calculation using data of a region corresponding to the identifier in the data frame received in the receiving step.

4. The receiving method according to claim 2 or 3, At least one of the one or more data frames received in the receiving step comprises a message authentication code, The category of the content of the data field represented by the identifier in the data frame received in the receiving step represents whether the data field contains an area for data used in calculation for calculating a message authentication code, In the verification step, when the category of the content of the data field represented by the identifier indicates an area containing data used in calculation for calculating a message authentication code, the verification process is performed by calculation using the value of the area of ​​data used in calculation for calculating a message authentication code in the data field.

5. A receiving method is used in a vehicle network system, wherein the vehicle network system has a plurality of electronic control units that follow the CAN protocol (i.e., the controller area network protocol) and communicate via a bus, and the receiving method comprises: A receiving step of receiving one or more data frames sent on the bus and containing an identifier, wherein the identifier is an identifier representing data used in calculation for calculating a message authentication code, and the message authentication code represents the legitimacy of the sent content; and a verification step, in which, when one or more data frames are received in the receiving step, a message authentication code is verified according to the identifier of the received data frame, The identifier in the data frame received in the receiving step indicates an area of ​​data of one category in the data field of the data frame, The identifier in the data frame received in the receiving step is arranged in a data field of the data frame, In the verification step, the verification process is performed based on the identifier in the data field of the received data frame.

6. A receiving method is used in a vehicle network system, wherein the vehicle network system has a plurality of electronic control units that follow the CAN protocol (i.e., the controller area network protocol) and communicate via a bus, the receiving method comprising: A receiving step of receiving one or more data frames sent on the bus and containing an identifier, wherein the identifier is an identifier representing data used in calculation for calculating a message authentication code, and the message authentication code represents the legitimacy of the sent content; and a verification step, in which, when one or more data frames are received in the receiving step, a message authentication code is verified according to the identifier of the received data frame, The identifier in the data frame received in the receiving step indicates an area of ​​data of one category in the data field of the data frame, The identifier included in the one or more data frames includes the following information, which indicates an area of ​​one or more data in the one or more data frames, In the verification step, the verification process is performed by calculation using data of a region corresponding to the identifier in the data frame received in the receiving step.

7. The receiving method according to claim 5 or 6, at least one of the one or more data frames received in the receiving step comprises a message authentication code, The area of ​​the one type of data indicated by the identifier in the data frame received in the receiving step is an area of ​​data used in calculation for calculating a message authentication code, In the verification step, the verification process is performed by calculation using data of the area indicated by the identifier.

8. An electronic control unit, which is an electronic control unit that complies with the CAN protocol, i.e., the controller area network protocol, and communicates via a bus, and has: a receiving unit that receives one or more data frames transmitted on the bus and including an identifier, wherein the identifier is an identifier indicating data used in calculation for calculating a message authentication code, wherein the message authentication code indicates the legitimacy of the transmitted content; and a verification unit, which performs verification processing of a message authentication code according to the identifier of the received data frame when one or more data frames are received by the receiving unit, The identifier in the data frame received by the receiving unit indicates the type of content of the data field of the data frame.

9. An electronic control unit, which is an electronic control unit that complies with the CAN protocol (i.e., the controller area network protocol) and communicates via a bus, and has: a receiving unit that receives one or more data frames transmitted on the bus and including an identifier, wherein the identifier is an identifier indicating data used in calculation for calculating a message authentication code, wherein the message authentication code indicates the legitimacy of the transmitted content; and a verification unit, which performs verification processing of a message authentication code according to the identifier of the received data frame when one or more data frames are received by the receiving unit, The identifier in the data frame received by the receiving unit indicates an area of ​​one type of data in a data field of the data frame.

10. An electronic control unit, which is an electronic control unit that complies with the CAN protocol (i.e., the controller area network protocol) and communicates via a bus, and has: a calculation unit, calculating a message authentication code for indicating the legitimacy of the transmitted content by calculation using data arranged in one or more areas in one or more data frames; and a transmitting unit that includes the message authentication code calculated by the calculating unit in at least one of the one or more data frames, and transmits the one or more data frames including an identifier for data used in calculation for calculating the message authentication code, The identifier in the data frame transmitted by the transmission unit indicates the type of the content of the data field of the data frame.

11. An electronic control unit, which is an electronic control unit that complies with the CAN protocol (i.e., the controller area network protocol) and communicates via a bus, and has: a calculation unit, calculating a message authentication code for indicating the legitimacy of the transmitted content by calculation using data in one or more areas arranged in one or more data frames; and a transmitting unit that includes the message authentication code calculated by the calculating unit in at least one of the one or more data frames, and transmits the one or more data frames including an identifier for data used in calculation for calculating the message authentication code, The identifier in the data frame transmitted by the transmitting unit indicates an area of ​​one type of data in a data field of the data frame.