JP6601244B2 - Communications system - Google Patents

Communications system Download PDF

Info

Publication number
JP6601244B2
JP6601244B2 JP2016017496A JP2016017496A JP6601244B2 JP 6601244 B2 JP6601244 B2 JP 6601244B2 JP 2016017496 A JP2016017496 A JP 2016017496A JP 2016017496 A JP2016017496 A JP 2016017496A JP 6601244 B2 JP6601244 B2 JP 6601244B2
Authority
JP
Japan
Prior art keywords
counter value
node
authentication
data
management unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2016017496A
Other languages
Japanese (ja)
Other versions
JP2017139530A (en
Inventor
将秀 坂野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toyota Motor Corp
Original Assignee
Toyota Motor Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toyota Motor Corp filed Critical Toyota Motor Corp
Priority to JP2016017496A priority Critical patent/JP6601244B2/en
Publication of JP2017139530A publication Critical patent/JP2017139530A/en
Application granted granted Critical
Publication of JP6601244B2 publication Critical patent/JP6601244B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Small-Scale Networks (AREA)

Description

本発明は、CAN(Controller Area Network)通信システムに関する。   The present invention relates to a CAN (Controller Area Network) communication system.

従来、メインメッセージと、メインメッセージに対応する認証用データ(例えば、MAC:Message Authentication Code)を生成して受信ノードに送信する送信ノードと、受信したメインメッセージに対応する認証用データを生成する受信ノードを含むCAN通信システムが知られている(例えば、特許文献1等参照)。   Conventionally, a main message, a transmitting node that generates authentication data (for example, MAC: Message Authentication Code) corresponding to the main message and transmits it to the receiving node, and a reception that generates authentication data corresponding to the received main message A CAN communication system including nodes is known (see, for example, Patent Document 1).

特許文献1では、送信ノードと受信ノードの双方が共通するカウンタ値を記憶し、送信ノードは、メインメッセージと自身が記憶するカウンタ値に所定のアルゴリズムを適用してMACを生成して受信ノードに送信する。そして、受信ノードは、受信したメインメッセージと自身が記憶するカウンタ値に同様のアルゴリズムを適用してMACを生成して、受信したMACと比較することにより、メインメッセージの正当性を認証する。   In Patent Literature 1, a counter value that is common to both a transmission node and a reception node is stored, and the transmission node applies a predetermined algorithm to the main message and the counter value stored by itself to generate a MAC to the reception node. Send. Then, the receiving node generates a MAC by applying a similar algorithm to the received main message and the counter value stored by itself, and compares it with the received MAC to authenticate the validity of the main message.

国際公開2013/065689号International Publication No. 2013/066569

しかしながら、特許文献1に開示される技術では、例えば、受信ノード或いは送信ノードが何等かの理由でリセットされると、送信ノードと受信ノードとの間で共通のカウンタ値にならない可能性がある。そのため、受信ノードは、受信メッセージの誤認証を行ってしまう可能性がある。   However, in the technique disclosed in Patent Document 1, for example, if the reception node or the transmission node is reset for some reason, there is a possibility that the counter value is not common between the transmission node and the reception node. For this reason, the receiving node may perform erroneous authentication of the received message.

一方、送信ノードから受信ノードにカウンタ値を送信して、受信ノードは、送信ノードから受信したカウンタ値を用いて認証用データを生成することも可能である。しかしながら、例えば、車両に搭載されるCAN通信装置では、車両寿命を勘案すると、カウンタ値のデータサイズとして128ビット程度が必要とされるのに対して、CANメッセージのデータフィールドは、最大8バイト(64ビット)である。そのため、送信ノードは、フルサイズのカウンタ値を受信ノードに送信することができない可能性がある。   On the other hand, the counter value can be transmitted from the transmitting node to the receiving node, and the receiving node can generate the authentication data using the counter value received from the transmitting node. However, for example, in a CAN communication device mounted on a vehicle, considering the vehicle life, a data size of the counter value requires about 128 bits, whereas the data field of the CAN message has a maximum of 8 bytes ( 64 bits). Therefore, the transmitting node may not be able to transmit the full size counter value to the receiving node.

そこで、上記課題に鑑み、送信ノード或いは受信ノードにリセット等が発生し、送信ノードと受信ノードの双方で保持されるカウンタ値が異なる状況になっても、受信ノードが送信ノードから送信されるメッセージの認証を適切に行うことが可能なCAN通信システムを提供することを目的とする。   Therefore, in view of the above problems, even if a reset or the like occurs in the transmission node or the reception node, and the counter value held in both the transmission node and the reception node is different, the message transmitted from the transmission node to the reception node. It is an object of the present invention to provide a CAN communication system capable of appropriately performing authentication.

上記目的を達成するため、本発明の一実施態様において、
マスタノード、送信ノード、及び受信ノードがバスで接続されるCAN通信システムであって、
前記マスタノードは、前記送信ノードからメッセージが送信される度に所定の規則に従いカウンタ値を更新すると共に、前記送信ノード及び前記受信ノードに前記カウンタ値を送信し、
前記送信ノードは、前記マスタノードから前記カウンタ値を受信する第1カウンタ値受信部と、前記受信ノードへの送信対象であるメインデータと前記第1カウンタ値受信部が受信したカウンタ値に基づき、第1認証用データを生成する第1生成部と、前記メインデータ及び前記第1認証用データを前記受信ノードに送信するデータ送信部と、前記送信ノードが起動してから前記第1カウンタ値受信部が前記カウンタ値を前記マスタノードから受信するまでの間、前記第1生成部及び前記データ送信部による処理を停止させる第1停止部と、を含み、
前記受信ノードは、前記送信ノードから前記メインデータ及び前記第1認証用データを受信するデータ受信部と、前記マスタノードから前記カウンタ値を受信する第2カウンタ値受信部と、前記データ受信部が受信した前記メインデータと前記第2カウンタ値受信部が受信した前記カウンタ値に基づき、第2認証用データを生成する第2生成部と、前記データ受信部が受信した前記第1認証用データと前記第2生成部が生成した前記第2認証用データの比較により、前記メインデータを含むメッセージの正当性を認証する認証部と、前記受信ノードが起動してから前記第2カウンタ値受信部が前記カウンタ値を前記マスタノードから受信するまでの間、前記第2生成部及び前記認証部による処理を停止させる第2停止部と、を含む、
CAN通信システムが提供される。
In order to achieve the above object, in one embodiment of the present invention,
A CAN communication system in which a master node, a transmission node, and a reception node are connected by a bus,
The master node updates a counter value according to a predetermined rule every time a message is transmitted from the transmission node, and transmits the counter value to the transmission node and the reception node,
The transmitting node is based on a first counter value receiving unit that receives the counter value from the master node, main data that is a transmission target to the receiving node, and a counter value received by the first counter value receiving unit, A first generation unit that generates first authentication data; a data transmission unit that transmits the main data and the first authentication data to the reception node; and reception of the first counter value after the transmission node is activated. A first stop unit that stops processing by the first generation unit and the data transmission unit until a unit receives the counter value from the master node,
The receiving node includes a data receiving unit that receives the main data and the first authentication data from the transmitting node, a second counter value receiving unit that receives the counter value from the master node, and the data receiving unit A second generator for generating second authentication data based on the received main data and the counter value received by the second counter value receiver; and the first authentication data received by the data receiver; An authentication unit that authenticates the validity of the message including the main data by comparing the second authentication data generated by the second generation unit, and the second counter value reception unit after the reception node is activated. A second stop unit that stops processing by the second generation unit and the authentication unit until the counter value is received from the master node.
A CAN communication system is provided.

本発明の一実施態様によれば、CAN通信装置のマスタノードは、送信ノードからメッセージが送信される度に所定の規則に従いカウンタ値を更新すると共に、送信ノード及び受信ノードにカウンタ値を送信する。そして、CAN通信装置の送信ノードは、送信ノードが起動してから第1カウンタ値受信部がカウンタ値を受信するまでの間、第1生成部及びデータ送信部による処理を停止させる第1停止部を含む。従って、何等かの理由で送信ノードがリセットされた場合、送信ノードが再起動した後、マスタノードから最新のカウンタ値を受信するまで、カウンタ値に基づく第1認証用データの生成や、メインデータ及び第1認証用データの送信が行われない。即ち、送信ノードのリセットにより、送信ノードが保持するカウンタ値が不定値等になり、受信ノードが保持するカウンタ値と異なるような事態が発生しても、マスタノードから最新のカウンタ値を受信しない限り、カウンタ値に基づく第1認証用データの生成やメインデータ及び第1認証用データの送信が行われない。そのため、送信ノードにおいて、受信ノードが保持するものと異なるカウンタ値に基づく第1認証用データが受信ノードに送信されることがなくなり、受信ノードにおける誤った第1認証用データに基づくメッセージの誤認証を抑制することができる。   According to an embodiment of the present invention, the master node of the CAN communication apparatus updates the counter value according to a predetermined rule every time a message is transmitted from the transmission node, and transmits the counter value to the transmission node and the reception node. . Then, the transmission node of the CAN communication device has a first stop unit that stops processing by the first generation unit and the data transmission unit from when the transmission node is activated until the first counter value reception unit receives the counter value. including. Therefore, when the transmission node is reset for some reason, after the transmission node is restarted, until the latest counter value is received from the master node, the generation of the first authentication data based on the counter value or the main data And the first authentication data is not transmitted. That is, even if a counter value held by the sending node becomes an indefinite value or the like due to resetting of the sending node and is different from the counter value held by the receiving node, the latest counter value is not received from the master node. As long as the first authentication data is not generated based on the counter value, the main data and the first authentication data are not transmitted. Therefore, the first authentication data based on a counter value different from that held by the receiving node is not transmitted to the receiving node in the transmitting node, and the message is erroneously authenticated based on the erroneous first authentication data in the receiving node. Can be suppressed.

また、受信ノードは、受信ノードが起動してから第2カウンタ値受信部がカウンタ値を受信するまでの間、第2生成部及び認証部による処理を停止させる第2停止部を含む。従って、何等かの理由で受信ノードがリセット等された場合、受信ノードが再起動した後、マスタノードから最新のカウンタ値を受信するまで、カウンタ値に基づく第2認証用データの生成や、送信ノードから受信する第1認証用データと第2認証用データとの比較によるメインデータを含むメッセージの正当性の認証が行われない。即ち、受信ノードのリセット等により、受信ノードが保持するカウンタ値が不定値等になり、送信ノードが保持するカウンタ値と異なるような事態が発生しても、マスタノードから最新のカウンタ値を受信しない限り、カウンタ値に基づく第2認証用データの生成や、送信ノードから受信する第1認証用データと第2認証用データとの比較によるメインデータを含むメッセージの正当性の認証が行われない。そのため、受信ノードにおいて、送信ノードが保持するものと異なるカウンタ値に基づく第2認証用データが生成されないようにすることができ、誤った第2認証用データに基づくメッセージの誤認証を抑制することができる。   The reception node includes a second stop unit that stops processing by the second generation unit and the authentication unit from when the reception node is activated until the second counter value reception unit receives the counter value. Accordingly, when the receiving node is reset for any reason, the second authentication data is generated or transmitted based on the counter value until the latest counter value is received from the master node after the receiving node is restarted. The authenticity of the message including the main data is not performed by comparing the first authentication data and the second authentication data received from the node. In other words, even if the counter value held by the receiving node becomes an indefinite value due to resetting of the receiving node, etc., and the situation differs from the counter value held by the transmitting node, the latest counter value is received from the master node. Unless this is done, the authentication of the validity of the message including the main data by the generation of the second authentication data based on the counter value and the comparison between the first authentication data and the second authentication data received from the transmission node is not performed. . Therefore, the second authentication data based on a counter value different from that held by the transmission node can be prevented from being generated in the receiving node, and erroneous authentication of a message based on the erroneous second authentication data can be suppressed. Can do.

送信ノード或いは受信ノードにリセット等が発生し、送信ノードと受信ノードの双方で保持されるカウンタ値が異なる状況になっても、受信ノードが送信ノードから送信されるメッセージの認証を適切に行うことが可能なCAN通信システムを提供することができる。   Even if a reset or the like occurs in the transmission node or the reception node, and the counter value held in both the transmission node and the reception node is different, the reception node appropriately authenticates the message transmitted from the transmission node. It is possible to provide a CAN communication system capable of

CAN通信システムの構成の一例を概略的に示す構成図である。It is a block diagram which shows an example of a structure of a CAN communication system roughly. ECUの構成の一例を概略的に示すブロック図である。It is a block diagram which shows an example of a structure of ECU roughly. ECUの起動時における処理の一例を概略的に示すフローチャートである。It is a flowchart which shows roughly an example of the process at the time of starting of ECU. ECUの停止時における処理の一例を概略的に示すフローチャートである。It is a flowchart which shows roughly an example of the process at the time of stop of ECU. ECUにおけるメッセージの送信処理の一例を概略的に示すフローチャートである。It is a flowchart which shows roughly an example of the transmission process of the message in ECU. ECUにおけるメッセージの受信処理の一例を概略的に示すフローチャートである。It is a flowchart which shows roughly an example of the reception process of the message in ECU.

図1は、本実施形態に係るCAN通信システム(以下、単に「通信システム」と称する)1の構成の一例を概略的に示す構成図である。   FIG. 1 is a configuration diagram schematically showing an example of a configuration of a CAN communication system (hereinafter simply referred to as “communication system”) 1 according to the present embodiment.

通信システム1は、例えば、車両に搭載され、バス2に接続される複数のECU(Electrical Control Unit)10と、マスタECU20とを含む。   The communication system 1 includes, for example, a plurality of ECUs (Electrical Control Units) 10 mounted on a vehicle and connected to a bus 2, and a master ECU 20.

ECU10は、予め割り当てられた機能を実現するための各種制御処理を行う電子制御ユニットである。各ECU10は、バス2を通じて、他のECU10との間で、CANプロトコルに基づくCANメッセージ(以下、単に「メッセージ」と称する)の送受信を行う。即ち、各ECU10は、通信システム1における送信ノードの一例であり、受信ノードの一例でもある。   The ECU 10 is an electronic control unit that performs various control processes for realizing functions assigned in advance. Each ECU 10 transmits / receives a CAN message (hereinafter simply referred to as “message”) based on the CAN protocol to / from another ECU 10 through the bus 2. That is, each ECU 10 is an example of a transmission node and a reception node in the communication system 1.

マスタECU20は、ECU10(即ち、送信ノード)の何れかがバス2を通じて他のECU10(即ち、受信ノード)にメッセージを送信する度、即ち、ECU10の何れかがメッセージをバス2上に出力する度に、所定の規則に従いカウンタ値Ctを更新する処理を行う。所定の規則は、例えば、"メッセージが送信される度に、カウンタ値Ctを所定値(例えば、"1")だけインクリメントすること"や"メッセージが送信される度に、カウンタ値Ctを所定値(例えば、"1")だけデクリメントすること"等、任意であってよい。以下、カウンタ値Ctは、所定の規則に従い、単調増加することを前提に説明を続ける。マスタECU20は、所定時間毎に、最新のカウンタ値Ctをバス2に出力して、各ECU10に送信する。   Each time the master ECU 20 sends a message to another ECU 10 (ie, receiving node) through the bus 2, that is, any of the ECUs 10 outputs a message on the bus 2. In addition, the counter value Ct is updated according to a predetermined rule. The predetermined rule is, for example, “every time a message is sent, the counter value Ct is incremented by a predetermined value (for example,“ 1 ””) or every time a message is sent, the counter value Ct is set to a predetermined value. (For example, “decrement by only“ 1 ””) may be arbitrary. Hereinafter, the description is continued on the assumption that the counter value Ct increases monotonously according to a predetermined rule. The master ECU 20 outputs the latest counter value Ct to the bus 2 and transmits it to each ECU 10 every predetermined time.

尚、本実施形態におけるマスタECU20は、バス2に含まれるバス2aとバス2bとの間で送受信されるメッセージの中継を行う機能を果たす。即ち、マスタECU20は、ゲートウェイ装置(ゲートウェイECU)である。   Note that the master ECU 20 in this embodiment fulfills a function of relaying messages transmitted and received between the bus 2a and the bus 2b included in the bus 2. That is, the master ECU 20 is a gateway device (gateway ECU).

次に、図2を参照して、ECU10の構成について説明する。   Next, the configuration of the ECU 10 will be described with reference to FIG.

図2は、本実施形態に係るECU10の構成の一例を概略的に示すブロック図である。ECU10は、アプリケーション101、送信管理部102、受信管理部103、認証管理部104、メッセージボックス(MBOX)105,106、CANコントローラ107、CANトランシーバ108を含む。   FIG. 2 is a block diagram schematically showing an example of the configuration of the ECU 10 according to the present embodiment. The ECU 10 includes an application 101, a transmission management unit 102, a reception management unit 103, an authentication management unit 104, message boxes (MBOX) 105 and 106, a CAN controller 107, and a CAN transceiver 108.

アプリケーション101は、ECU10内のCPU(不図示)上で実行され、各ECU10に割り当てられる任意の機能を実現するための各種制御処理を行うプログラムである。アプリケーション101は、予め規定された条件等に応じて、演算結果(以下、「制御データ(受信ノードである他のECU10への送信対象であるメインデータの一例)」と称する)を他のECU10に送信するため、送信管理部102に送信要求を出力する。   The application 101 is a program that is executed on a CPU (not shown) in the ECU 10 and performs various control processes for realizing an arbitrary function assigned to each ECU 10. The application 101 sends a calculation result (hereinafter referred to as “control data (an example of main data to be transmitted to another ECU 10 as a reception node)”) to another ECU 10 according to a predetermined condition or the like. A transmission request is output to the transmission management unit 102 for transmission.

送信管理部102は、マスタECU20から送信され、CANコントローラ107がCANトランシーバ108を介してバス2から受信したカウンタ値CtをMBOX105から取得する。また、送信管理部102は、起動している間、アプリケーション101からの制御データを含む送信要求と、MBOX105から取得したカウンタ値Ctを認証管理部104に送信する。一方、送信管理部102は、停止している間、アプリケーション101からの制御データを含む送信要求と、MBOX105から取得したカウンタ値Ctを認証管理部104に送信せず、アプリケーション101からの送信要求をキューイング或いは破棄する。   The transmission management unit 102 acquires the counter value Ct transmitted from the master ECU 20 and received from the bus 2 by the CAN controller 107 via the CAN transceiver 108 from the MBOX 105. In addition, the transmission management unit 102 transmits a transmission request including control data from the application 101 and the counter value Ct acquired from the MBOX 105 to the authentication management unit 104 during activation. On the other hand, the transmission management unit 102 does not transmit the transmission request including the control data from the application 101 and the counter value Ct acquired from the MBOX 105 to the authentication management unit 104 while stopping, but transmits the transmission request from the application 101. Queue or discard.

尚、送信管理部102が"起動している"状態は、アプリケーション101からの制御データを含む送信要求と、MBOX105から取得したカウンタ値Ctを認証管理部104に送信する機能が実行可能な状態になっていることを表す。即ち、ECU10が起動していれば、送信管理部102が起動していない場合でも、送信管理部102は、他の機能(送信要求の有無を判断する機能や送信要求をキューイング或いは破棄したりする機能等)を実行可能である。   Note that the state in which the transmission management unit 102 is “activated” is a state in which a function for transmitting a transmission request including control data from the application 101 and the counter value Ct acquired from the MBOX 105 to the authentication management unit 104 can be executed. It represents that. That is, if the ECU 10 is activated, even if the transmission management unit 102 is not activated, the transmission management unit 102 queues or discards other functions (a function for determining the presence or absence of a transmission request or a transmission request). Function etc.) can be executed.

受信管理部103は、マスタECU20から送信され、CANコントローラ107がCANトランシーバ108を介してバス2から受信したカウンタ値CtをMBOX105から取得する。また、受信管理部103は、CANコントローラ107がCANトランシーバ108を介してバス2から受信した制御データを含むメッセージ(以下、「受信メッセージ」と称する)をMBOX106から取得する。また、受信管理部103は、起動している間、MBOX106から取得した受信メッセージと、MBOX105から取得したカウンタ値Ctを認証管理部104に送信する。一方、受信管理部103は、停止している間、MBOX106から取得した受信メッセージと、MBOX105から取得したカウンタ値Ctを認証管理部104に送信せず、受信メッセージをキューイング或いは破棄する。   The reception management unit 103 acquires the counter value Ct transmitted from the master ECU 20 and received by the CAN controller 107 from the bus 2 via the CAN transceiver 108 from the MBOX 105. In addition, the reception management unit 103 acquires a message including control data (hereinafter referred to as “reception message”) received from the bus 2 by the CAN controller 107 via the CAN transceiver 108 from the MBOX 106. In addition, the reception management unit 103 transmits the reception message acquired from the MBOX 106 and the counter value Ct acquired from the MBOX 105 to the authentication management unit 104 while being activated. On the other hand, while the reception management unit 103 is stopped, the reception message acquired from the MBOX 106 and the counter value Ct acquired from the MBOX 105 are not transmitted to the authentication management unit 104, and the received message is queued or discarded.

尚、受信管理部103が"起動している"状態は、MBOX106から取得した受信メッセージと、MBOX105から取得したカウンタ値Ctを認証管理部104に送信する機能が実行可能な状態になっていることを表す。即ち、ECU10が起動していれば、受信管理部103が起動していない場合でも、受信管理部103は、他の機能(受信メッセージの有無を判断する機能や受信メッセージをキューイング或いは破棄したりする機能等)を実行可能である。   Note that the state where the reception management unit 103 is “activated” is a state in which the function of transmitting the reception message acquired from the MBOX 106 and the counter value Ct acquired from the MBOX 105 to the authentication management unit 104 can be executed. Represents. In other words, if the ECU 10 is activated, even if the reception management unit 103 is not activated, the reception management unit 103 performs other functions (such as a function for determining the presence / absence of a received message or queuing or discarding a received message). Function etc.) can be executed.

ここで、図3、図4を参照して、ECU10の起動/停止に伴う、送信管理部102、受信管理部103の起動/停止動作について説明する。   Here, with reference to FIG. 3 and FIG. 4, start / stop operations of the transmission management unit 102 and the reception management unit 103 in accordance with the start / stop of the ECU 10 will be described.

図3は、ECU10の起動時における処理の一例を概略的に示すフローチャートである。図4は、ECU10の停止時における処理の一例を概略的に示すフローチャートである。図3に示すフローチャートによる処理は、起動要求(起動信号)がECU10に入力されると実行される。また、図4に示すフローチャートによる処理は、停止要求(停止信号)がECU10に入力されると実行される。   FIG. 3 is a flowchart schematically showing an example of processing when the ECU 10 is activated. FIG. 4 is a flowchart schematically showing an example of processing when the ECU 10 is stopped. The process according to the flowchart shown in FIG. 3 is executed when an activation request (activation signal) is input to the ECU 10. 4 is executed when a stop request (stop signal) is input to the ECU 10.

図3を参照するに、ステップS102にて、ECU10は起動する。   Referring to FIG. 3, in step S102, the ECU 10 is activated.

ステップS104にて、ECU10は、送信管理部102及び受信管理部103が停止しているか否かを判定する。ECU10は、送信管理部102及び受信管理部103が停止している場合、ステップS108に進み、停止していない場合、ステップS106に進む。   In step S104, the ECU 10 determines whether the transmission management unit 102 and the reception management unit 103 are stopped. When the transmission management unit 102 and the reception management unit 103 are stopped, the ECU 10 proceeds to step S108, and when not stopped, the ECU 10 proceeds to step S106.

ステップS106にて、ECU10は、送信管理部102及び受信管理部103を停止させて、ステップS108に進む。   In step S106, the ECU 10 stops the transmission management unit 102 and the reception management unit 103, and proceeds to step S108.

ステップS108にて、ECU10は、送信管理部102及び受信管理部103の初期化を行う。   In step S108, the ECU 10 initializes the transmission management unit 102 and the reception management unit 103.

ステップS110にて、ECU10は、ECU10の起動後、CANコントローラ107がCANトランシーバ108を介してマスタECU20からカウンタ値Ctを受信したか否かを判定する。ECU10は、マスタECU20からカウンタ値Ctを受信している場合、ステップS112に進み、マスタECU20からカウンタ値Ctを受信していない場合、ステップS110の処理を繰り返す。   In step S110, ECU 10 determines whether or not CAN controller 107 has received counter value Ct from master ECU 20 via CAN transceiver 108 after ECU 10 is activated. If the counter value Ct is received from the master ECU 20, the ECU 10 proceeds to step S112. If the counter value Ct is not received from the master ECU 20, the ECU 10 repeats the process of step S110.

ステップS112にて、ECU10は、送信管理部102及び受信管理部103を起動し、今回の処理を終了する。   In step S112, the ECU 10 activates the transmission management unit 102 and the reception management unit 103, and ends the current process.

また、図4を参照するに、ステップS202にて、ECU10は。送信管理部102及び受信管理部103を停止させる。   Further, referring to FIG. 4, in step S <b> 202, the ECU 10. The transmission management unit 102 and the reception management unit 103 are stopped.

そして、ステップS204にて、ECU10は、停止し、今回の処理を終了する。   In step S204, the ECU 10 stops and ends the current process.

このように、送信管理部102及び受信管理部103は、ECU10の停止に伴い、停止し、ECU10の起動した後、CANコントローラ107がCANトランシーバ108を介してマスタECU20から送信されたカウンタ値Ctを受信すると、起動する。即ち、送信管理部102及び受信管理部103は、ECU10が起動してから、マスタECU20からのカウンタ値を受信するまで、停止している。   Thus, the transmission management unit 102 and the reception management unit 103 stop when the ECU 10 stops, and after the ECU 10 is started, the CAN controller 107 receives the counter value Ct transmitted from the master ECU 20 via the CAN transceiver 108. When it receives, it starts. That is, the transmission management unit 102 and the reception management unit 103 are stopped until the counter value is received from the master ECU 20 after the ECU 10 is activated.

図2に戻り、認証管理部104は、制御データを含むメッセージ(以下、送信メッセージと称する)を他のECU10に送信する際、他のECU10で実行されるメッセージ認証のための認証用データ(以下、「第1認証用データ」と称する)を生成する。具体的には、認証管理部104は、送信管理部102から取得した制御データ及びカウンタ値Ctに基づき、第1認証用データを生成する。より具体的には、認証管理部104は、制御データとカウンタ値Ctを結合したデータに対して、所定のアルゴリズム(例えば、一方向ハッシュ関数等)を適用することにより、第1認証用データ(例えば、ハッシュ値)を生成する。以下、第1認証用データは、制御データとカウンタ値Ctを結合したデータに対して、一方向ハッシュ関数を適用して生成されるハッシュ値である前提で説明を継続する。そして、認証管理部104は、制御データ、カウンタ値Ctの下位ビットデータ(カウンタ値Ctの最下位ビットから予め規定された数桁分のデータ。以下、単に「下位ビットデータ」と称する)、及び第1認証用データ(ハッシュ値)を含む送信メッセージを生成する。具体的には、認証管理部104は、CANメッセージのデータフィールドの最大64ビットのデータサイズに収まるように、制御データ、下位ビットデータ、及びハッシュ値を含む送信メッセージを生成する。   Returning to FIG. 2, when the authentication management unit 104 transmits a message including control data (hereinafter referred to as a transmission message) to another ECU 10, authentication data (hereinafter referred to as authentication data) for message authentication executed by the other ECU 10. , Referred to as “first authentication data”). Specifically, the authentication management unit 104 generates first authentication data based on the control data acquired from the transmission management unit 102 and the counter value Ct. More specifically, the authentication management unit 104 applies a predetermined algorithm (for example, a one-way hash function) to the data obtained by combining the control data and the counter value Ct, whereby the first authentication data ( For example, a hash value) is generated. Hereinafter, the description is continued on the assumption that the first authentication data is a hash value generated by applying a one-way hash function to data obtained by combining the control data and the counter value Ct. Then, the authentication management unit 104 controls the control data, the lower bit data of the counter value Ct (data for several digits previously defined from the least significant bit of the counter value Ct. Hereinafter, simply referred to as “lower bit data”), and A transmission message including the first authentication data (hash value) is generated. Specifically, the authentication management unit 104 generates a transmission message including control data, lower-order bit data, and a hash value so as to fit within a data size of 64 bits at the maximum in the data field of the CAN message.

また、認証管理部104は、メッセージを他のECU10から受信した際、受信メッセージに含まれる下位ビットデータと、例えば、RAM上の所定領域等に保持するカウンタ値Ctの前回値(最新値の1つ前のカウンタ値Ct。以下、単に「前回値」と称する)との比較により、受信メッセージの正当性を認証する(第1認証)。具体的には、認証管理部104は、受信メッセージに含まれる下位ビットデータと前回値との比較により、受信メッセージに含まれる下位ビットデータが所定の規則に従っている(即ち、前回値から単調増加している)と判断した場合、第1認証を成功とする。また、認証管理部104は、第1認証に成功した場合、受信メッセージに含まれる第1認証用データとの比較により、受信メッセージの正当性を認証するための認証用データ(以下、「第2認証用データ」と称する)を生成する。具体的には、認証管理部104は、受信管理部103から取得した受信メッセージに含まれる制御データと、受信管理部103から取得したカウンタ値Ctに基づき、第2認証用データを生成する。より具体的には、認証管理部104は、受信メッセージに含まれる制御データ及びマスタECU20から送信された最新のカウンタ値Ctを結合したデータに対して、第1認証用データを生成する際と同様のアルゴリズム、即ち、一方向ハッシュ関数を適用することにより、第2認証用データ(ハッシュ値)を生成する。そして、認証管理部104は、受信メッセージに含まれる第1認証用データ(ハッシュ値)と生成した第2認証用データ(ハッシュ値)を比較し、一致する場合、受信メッセージの正当性を認証する(第2認証)。即ち、認証管理部104は、第1認証と第2認証の双方に成功した場合、受信メッセージの正当性を認証する。   Further, the authentication management unit 104, when receiving a message from another ECU 10, the lower-order bit data included in the received message and the previous value (1 of the latest value) of the counter value Ct held in, for example, a predetermined area on the RAM. The authenticity of the received message is authenticated by comparison with the previous counter value Ct (hereinafter simply referred to as “previous value”) (first authentication). Specifically, the authentication management unit 104 compares the lower bit data included in the received message with the previous value, and the lower bit data included in the received message follows a predetermined rule (that is, increases monotonously from the previous value). The first authentication is successful. Further, when the first authentication is successful, the authentication management unit 104 compares authentication data (hereinafter referred to as “second data”) for authenticating the validity of the received message by comparison with the first authentication data included in the received message. Referred to as “authentication data”). Specifically, the authentication management unit 104 generates second authentication data based on the control data included in the received message acquired from the reception management unit 103 and the counter value Ct acquired from the reception management unit 103. More specifically, the authentication management unit 104 is the same as the case of generating the first authentication data for the data obtained by combining the control data included in the received message and the latest counter value Ct transmitted from the master ECU 20. The second authentication data (hash value) is generated by applying the above algorithm, that is, the one-way hash function. The authentication management unit 104 compares the first authentication data (hash value) included in the received message with the generated second authentication data (hash value), and authenticates the validity of the received message if they match. (Second authentication). That is, when both the first authentication and the second authentication are successful, the authentication management unit 104 authenticates the validity of the received message.

MBOX105は、マスタECU20から送信され、CANコントローラ107がCANトランシーバ108を介して受信するカウンタ値Ctを含むメッセージを格納する記憶領域である。   The MBOX 105 is a storage area for storing a message including a counter value Ct transmitted from the master ECU 20 and received by the CAN controller 107 via the CAN transceiver 108.

MBOX106は、他のECU10から送信され、CANコントローラ107がCANトランシーバ108を介してバス2から受信する制御データを含むメッセージ(受信メッセージ)を格納する記憶領域である。   The MBOX 106 is a storage area for storing a message (reception message) that is transmitted from another ECU 10 and includes control data that the CAN controller 107 receives from the bus 2 via the CAN transceiver 108.

CANコントローラ107は、プロトコルコントローラや、CPUクロックを分周する分周器、レジスタ等を備え、CANトランシーバ108を介して、バス2(バス2a或いはバス2b)との間でメッセージを送受信する。   The CAN controller 107 includes a protocol controller, a frequency divider that divides the CPU clock, a register, and the like, and transmits / receives a message to / from the bus 2 (the bus 2a or the bus 2b) via the CAN transceiver 108.

CANトランシーバ108は、CANコントローラ107から取得した送信メッセージを作動電圧に変換してバス2に出力する。また、CANトランシーバ108は、バス2からメッセージを取得する際、バス2の作動電圧を読み取り、所定の電圧範囲に含まれるように整形した受信信号をCANコントローラ107に出力する。   The CAN transceiver 108 converts the transmission message acquired from the CAN controller 107 into an operating voltage and outputs it to the bus 2. Further, when the CAN transceiver 108 acquires a message from the bus 2, the CAN transceiver 108 reads the operating voltage of the bus 2 and outputs a reception signal shaped to be included in a predetermined voltage range to the CAN controller 107.

次に、図5、図6を参照して、ECU10によるメッセージの送信処理及び受信処理について説明する。   Next, message transmission processing and reception processing by the ECU 10 will be described with reference to FIGS.

図5は、ECU10におけるメッセージの送信処理の一例を概略的に示すフローチャートである。図6は、ECU10におけるメッセージの受信処理の一例を概略的に示すフローチャートである。図5に示すフローチャートは、CPU上で実行されるアプリケーション101が送信対象である制御データを生成する度に実行される。図6に示すフローチャートは、CANコントローラ107がCANトランシーバ108を介して他のECU10からの制御データを含むメッセージを受信する度に実行される。   FIG. 5 is a flowchart schematically showing an example of message transmission processing in the ECU 10. FIG. 6 is a flowchart schematically showing an example of message reception processing in the ECU 10. The flowchart shown in FIG. 5 is executed whenever the application 101 executed on the CPU generates control data to be transmitted. The flowchart shown in FIG. 6 is executed each time the CAN controller 107 receives a message including control data from another ECU 10 via the CAN transceiver 108.

図5を参照するに、ステップS302にて、アプリケーション101は、送信管理部102に制御データを含むメッセージの送信要求を送る。   Referring to FIG. 5, in step S <b> 302, the application 101 sends a transmission request for a message including control data to the transmission management unit 102.

ステップS304にて、送信管理部102は、起動しているか否か、即ち、アプリケーション101からの制御データを含む送信要求と、MBOX105から取得したカウンタ値Ctを認証管理部104に送信する機能が実行可能な状態か否かを確認する。送信管理部102は、起動していない場合、ステップS306に進み、起動している場合、ステップS308に進む。   In step S304, the transmission management unit 102 performs a function of transmitting to the authentication management unit 104 whether or not the transmission management unit 102 is activated, that is, a transmission request including control data from the application 101 and the counter value Ct acquired from the MBOX 105. Check if it is possible. The transmission management unit 102 proceeds to step S306 if not activated, and proceeds to step S308 if activated.

ステップS306にて、送信管理部102は、アプリケーション101からの送信要求をキューイングし、ステップS318に進む。   In step S306, the transmission management unit 102 queues a transmission request from the application 101, and proceeds to step S318.

尚、本ステップにて、送信管理部102は、送信要求を破棄すると共に、その旨をアプリケーション101に通知してもよい。   In this step, the transmission management unit 102 may discard the transmission request and notify the application 101 to that effect.

一方、ステップS308にて、送信管理部102は、アプリケーション101からの制御データを含む送信要求と、MBOX105から取得したカウンタ値Ctを認証管理部104に送信する。   On the other hand, in step S 308, the transmission management unit 102 transmits a transmission request including control data from the application 101 and the counter value Ct acquired from the MBOX 105 to the authentication management unit 104.

ステップS310にて、認証管理部104は、送信管理部102から受信した制御データ及びカウンタ値Ctからハッシュ値を生成する。   In step S310, the authentication management unit 104 generates a hash value from the control data and counter value Ct received from the transmission management unit 102.

ステップS312にて、認証管理部104は、制御データ、下位ビットデータ、及びハッシュ値を含む送信メッセージを生成する。   In step S312, the authentication management unit 104 generates a transmission message including control data, lower bit data, and a hash value.

ステップS314にて、認証管理部104は、作成した送信メッセージをMBOX106に格納する。   In step S314, authentication management unit 104 stores the created transmission message in MBOX 106.

ステップS316にて、CANコントローラ107は、CANトランシーバ108を介してMBOX106に格納される送信メッセージをバス2に出力し、他のECU10に送信する。   In step S <b> 316, the CAN controller 107 outputs a transmission message stored in the MBOX 106 via the CAN transceiver 108 to the bus 2 and transmits it to the other ECU 10.

ステップS318にて、送信管理部102は、キューに送信要求があるか否かを確認する。送信管理部102は、キューに送信要求がある場合、ステップS304に戻り、ステップS304〜S318の処理を繰り返し、キューに送信要求がない場合、今回の処理を終了する。   In step S318, the transmission management unit 102 checks whether there is a transmission request in the queue. When there is a transmission request in the queue, the transmission management unit 102 returns to step S304, repeats the processing of steps S304 to S318, and when there is no transmission request in the queue, ends the current processing.

また、図6を参照するに、ステップS402にて、CANコントローラ107は、他のECU10から制御データを含むメッセージを受信した旨を受信管理部103に通知する。   Referring to FIG. 6, in step S <b> 402, the CAN controller 107 notifies the reception management unit 103 that a message including control data has been received from another ECU 10.

ステップS404にて、受信管理部103は、起動しているか否か、即ち、MBOX106から取得した受信メッセージと、MBOX105から取得したカウンタ値Ctを認証管理部104に送信する機能が実行可能な状態になっているか否かを確認する。受信管理部103は、起動していない場合、ステップS406に進み、起動している場合、ステップS408に進む。   In step S <b> 404, the reception management unit 103 is in a state where it can execute the function of transmitting to the authentication management unit 104 whether or not it is activated, that is, the reception message acquired from the MBOX 106 and the counter value Ct acquired from the MBOX 105. Check if it is. The reception management unit 103 proceeds to step S406 if not activated, and proceeds to step S408 if activated.

ステップS406にて、受信管理部103は、受信メッセージをキューイングし、ステップS426に進む。   In step S406, the reception management unit 103 queues the received message, and the process proceeds to step S426.

尚、本ステップにて、受信管理部103は、受信メッセージを破棄すると共に、その旨をアプリケーション101に通知してもよい。   In this step, the reception management unit 103 may discard the received message and notify the application 101 to that effect.

一方、ステップS408にて、受信管理部103は、MBOX106から取得した受信メッセージと、MBOX105から取得したカウンタ値Ctを認証管理部104に送る。   On the other hand, in step S <b> 408, the reception management unit 103 sends the reception message acquired from the MBOX 106 and the counter value Ct acquired from the MBOX 105 to the authentication management unit 104.

ステップS410にて、認証管理部104は、受信メッセージから下位ビットデータを取得する。   In step S410, authentication management unit 104 acquires lower-order bit data from the received message.

ステップS412にて、認証管理部104は、下位ビットデータと前回値の比較を行い、下位ビットデータの最下位ビットが前回値から増加しているか否かを確認する。認証管理部104は、最下位ビットが前回値から増加していない場合、ステップS414に進み、最下位ビットが前回値から増加している場合、カウンタ値Ctが所定の規則に従い単調増加している、即ち、第1認証の成功と判断し、ステップS416に進む。   In step S412, the authentication management unit 104 compares the lower bit data with the previous value, and confirms whether the least significant bit of the lower bit data has increased from the previous value. If the least significant bit has not increased from the previous value, the authentication management unit 104 proceeds to step S414. If the least significant bit has increased from the previous value, the counter value Ct monotonically increases according to a predetermined rule. That is, it is determined that the first authentication is successful, and the process proceeds to step S416.

ステップS414にて、認証管理部104は、下位ビットデータの桁上がりがあるか否かを確認する。認証管理部104は、下位ビットデータの桁上がりがある場合、カウンタ値Ctが所定の規則に従い単調増加している、即ち、第1認証の成功と判断し、ステップS416に進み、下位ビットデータの桁上がりがない場合、第1認証の失敗と判断し、ステップS422に進む。   In step S414, authentication management unit 104 checks whether there is a carry of lower-order bit data. If there is a carry of the lower bit data, the authentication management unit 104 determines that the counter value Ct is monotonously increasing according to a predetermined rule, that is, the first authentication is successful, and proceeds to step S416, where the lower bit data If there is no carry, it is determined that the first authentication has failed, and the process proceeds to step S422.

尚、ECU10にリセットが発生し、前回値が保持されていない場合、認証管理部104は、MBOX105から取得した最新のカウンタ値Ctから所定の規則に従い、前回値を生成し、生成した前回値を用いて、ステップS412、S414の処理を実行する。   When the ECU 10 is reset and the previous value is not held, the authentication management unit 104 generates the previous value from the latest counter value Ct acquired from the MBOX 105 according to a predetermined rule, and the generated previous value is displayed. The processing of steps S412 and S414 is executed.

ステップS416にて、認証管理部104は、受信管理部103から取得した受信メッセージに含まれる制御データと、受信管理部103から取得したカウンタ値Ctからハッシュ値を生成する。   In step S416, the authentication management unit 104 generates a hash value from the control data included in the received message acquired from the reception management unit 103 and the counter value Ct acquired from the reception management unit 103.

ステップS418にて、認証管理部104は、受信メッセージから取得したハッシュ値と、ステップS416で生成したハッシュ値を比較し、一致するか否かを判定する。認証管理部104は、一致する場合、第2認証の成功と判断し、ステップS420に進み、一致しない場合、第2認証の失敗と判断し、ステップS422に進む。   In step S418, the authentication management unit 104 compares the hash value acquired from the received message with the hash value generated in step S416, and determines whether or not they match. If they match, the authentication management unit 104 determines that the second authentication has succeeded, and proceeds to step S420. If not, the authentication management unit 104 determines that the second authentication has failed, and proceeds to step S422.

ステップS420にて、認証管理部104は、受信メッセージの正当性を認証し、受信メッセージに含まれる制御データをアプリケーション101に送る(認証成功)。   In step S420, authentication management unit 104 authenticates the legitimacy of the received message and sends control data included in the received message to application 101 (authentication success).

一方、ステップS422にて、認証管理部104は、受信メッセージの正当性を認証せず(認証失敗)、受信メッセージを破棄し、ステップS424に進む。   On the other hand, in step S422, the authentication management unit 104 does not authenticate the validity of the received message (authentication failure), discards the received message, and proceeds to step S424.

そして、ステップS424にて、認証管理部104は、受信メッセージの認証失敗をアプリケーション101に通知する。   In step S424, the authentication management unit 104 notifies the application 101 of the authentication failure of the received message.

ステップS426にて、受信管理部103は、キューに受信メッセージがあるか否かを確認する。受信管理部103は、キューに受信メッセージがある場合、ステップS404に戻り、ステップS404〜S426の処理を繰り返し、キューに受信メッセージがない場合、今回の処理を終了する。   In step S426, reception management unit 103 checks whether there is a received message in the queue. If there is a received message in the queue, the reception management unit 103 returns to step S404, repeats the processing of steps S404 to S426, and if there is no received message in the queue, ends the current process.

尚、本実施形態では、第1認証と第2認証の双方により、受信メッセージの正当性の認証を試みるが、第2認証だけで受信メッセージの正当性の認証を行ってもよい。   In this embodiment, the authenticity of the received message is tried by both the first authentication and the second authentication, but the authenticity of the received message may be performed only by the second authentication.

このように、本実施形態では、マスタECU20は、各ECU10からメッセージが送信される度に所定の規則に従いカウンタ値を更新すると共に、各ECU10にカウンタ値を送信する。そして、送信管理部102は、ECU10が起動してからカウンタ値をマスタECU20から受信するまでの間、アプリケーション101からの制御データを含む送信要求と、MBOX105から取得したカウンタ値Ctを認証管理部104に送信する機能を停止する。換言すれば、送信管理部102は、認証管理部104による処理(即ち、カウンタ値Ctに基づく第1認証用データを生成すると共に、制御データ、下位ビットデータ、及び第1認証用データを含む送信メッセージを生成する処理)及びCANコントローラ107による処理(即ち、制御データを含む送信メッセージを他のECU10に送信する処理)を停止させる。従って、何等かの理由でECU10がリセットされた場合、ECU10が再起動した後、マスタECU20から最新のカウンタ値Ctを受信するまで、カウンタ値Ctに基づく第1認証用データの生成や、制御データ、下位ビットデータ、及び第1認証用データを含む送信メッセージの送信が行われない。即ち、ECU10(送信ノード)のリセットにより、当該ECU10が保持するカウンタ値が不定値等になり、他のECU10(受信ノード)が保持するカウンタ値と異なるような事態が発生しても、マスタECU20から最新のカウンタ値を受信しない限り、カウンタ値Ctに基づく第1認証用データの送信や制御データ、下位ビットデータ、及び第1認証用データを含む送信メッセージの送信が行われない。そのため、当該ECU10において、他のECU10が保持するものと異なるカウンタ値に基づく下位ビットデータや第1認証用データが他のECU10に送信されることがなくなり、他のECU10における誤った下位ビットデータや第1認証用データに基づく受信メッセージの誤認証を抑制することができる。   Thus, in this embodiment, the master ECU 20 updates the counter value according to a predetermined rule every time a message is transmitted from each ECU 10 and transmits the counter value to each ECU 10. Then, the transmission management unit 102 receives the transmission request including the control data from the application 101 and the counter value Ct acquired from the MBOX 105 until the counter value is received from the master ECU 20 after the ECU 10 is activated. Stop the function to send to. In other words, the transmission management unit 102 generates the first authentication data based on the processing by the authentication management unit 104 (that is, the first authentication data based on the counter value Ct, and includes the control data, the lower bit data, and the first authentication data). Message processing) and processing by the CAN controller 107 (that is, processing for transmitting a transmission message including control data to another ECU 10) are stopped. Therefore, when the ECU 10 is reset for some reason, after the ECU 10 restarts, until the latest counter value Ct is received from the master ECU 20, the generation of the first authentication data based on the counter value Ct and the control data The transmission message including the lower bit data and the first authentication data is not transmitted. That is, even if the counter value held by the ECU 10 becomes an indefinite value or the like due to the reset of the ECU 10 (transmission node) and is different from the counter value held by another ECU 10 (reception node), the master ECU 20 Unless the latest counter value is received from the first authentication data, the transmission of the first authentication data based on the counter value Ct and the transmission message including the control data, the lower bit data, and the first authentication data are not performed. Therefore, in the ECU 10, lower bit data or first authentication data based on a counter value different from that held by the other ECU 10 is not transmitted to the other ECU 10, and erroneous lower bit data in the other ECU 10 The erroneous authentication of the received message based on the first authentication data can be suppressed.

また、受信管理部103は、ECU10が起動してからカウンタ値をマスタECU20から受信するまでの間、MBOX106から取得した受信メッセージと、MBOX105から取得したカウンタ値Ctを認証管理部104に送信する機能を停止する。換言すれば、受信管理部103は、ECU10が起動してからカウンタ値をマスタECU20から受信するまでの間、認証管理部104による処理(即ち、カウンタ値Ctに基づく第2認証用データを生成すると共に、第1認証及び第2認証による受信メッセージの正当性を認証する処理)を停止させる。従って、何等かの理由でECU10がリセット等された場合、当該ECU10が再起動した後、マスタECU20から最新のカウンタ値を受信するまで、カウンタ値Ctに基づく第2認証用データの生成や、下位ビットデータ及び第2認証用データに基づく制御データを含む受信メッセージの正当性の認証が行われない。即ち、ECU10(受信ノード)のリセット等により、当該ECU10が保持するカウンタ値が不定値等になり、他のECU10(送信ノード)が保持するカウンタ値と異なるような事態が発生しても、マスタECU20から最新のカウンタ値を受信しない限り、カウンタ値Ctに基づく第2認証用データの生成や、下位ビットデータ及び第2認証用データに基づく制御データを含む受信メッセージの正当性の認証が行われない。そのため、当該ECU10において、他のECU10が保持するものと異なるカウンタ値に基づく第2認証用データが生成されないようにすることができると共に、誤った下位ビットデータ及び第2認証用データに基づく受信メッセージの正当性の認証(第1認証及び第2認証)が行われることがなくなり、当該ECU10における受信メッセージの誤認証を抑制することができる。   The reception management unit 103 has a function of transmitting the reception message acquired from the MBOX 106 and the counter value Ct acquired from the MBOX 105 to the authentication management unit 104 until the counter value is received from the master ECU 20 after the ECU 10 is activated. To stop. In other words, the reception management unit 103 generates the second authentication data based on the processing by the authentication management unit 104 (that is, the counter value Ct) from when the ECU 10 is activated until the counter value is received from the master ECU 20. At the same time, the process of authenticating the validity of the received message by the first authentication and the second authentication is stopped. Therefore, if the ECU 10 is reset for any reason, the second authentication data is generated based on the counter value Ct until the latest counter value is received from the master ECU 20 after the ECU 10 is restarted, The validity of the received message including the control data based on the bit data and the second authentication data is not authenticated. That is, even if the counter value held by the ECU 10 becomes an indefinite value or the like due to reset of the ECU 10 (reception node) or the like, and the counter value held by another ECU 10 (transmission node) is different, Unless the latest counter value is received from the ECU 20, the second authentication data is generated based on the counter value Ct, and the validity of the received message including the control data based on the lower bit data and the second authentication data is authenticated. Absent. Therefore, the second authentication data based on a counter value different from that held by the other ECU 10 can be prevented from being generated in the ECU 10, and the received message based on the erroneous lower bit data and the second authentication data. Authentication (first authentication and second authentication) is not performed, and erroneous authentication of the received message in the ECU 10 can be suppressed.

以上、本発明を実施するための形態について詳述したが、本発明はかかる特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形・変更が可能である。   As mentioned above, although the form for implementing this invention was explained in full detail, this invention is not limited to this specific embodiment, In the range of the summary of this invention described in the claim, various Can be modified or changed.

1 CAN通信システム
2,2a,2b バス
10 ECU(送信ノード、受信ノード)
20 マスタECU(マスタノード)
101 アプリケーション
102 送信管理部(第1停止部)
103 受信管理部(第2停止部)
104 認証管理部(第1生成部、第2生成部、認証部)
105,106 メッセージボックス
107 CANコントローラ(データ送信部、第1カウンタ値受信部、データ受信部、第2カウンタ値受信部)
108 CANトランシーバ
1 CAN communication system 2, 2a, 2b Bus 10 ECU (sending node, receiving node)
20 Master ECU (master node)
101 Application 102 Transmission management unit (first stop unit)
103 Reception management unit (second stop unit)
104 Authentication management unit (first generation unit, second generation unit, authentication unit)
105, 106 Message box 107 CAN controller (data transmission unit, first counter value reception unit, data reception unit, second counter value reception unit)
108 CAN transceiver

Claims (1)

マスタノード、送信ノード、及び受信ノードがバスで接続されるCAN通信システムであって、
前記マスタノードは、前記送信ノードからメッセージが送信される度に所定の規則に従いカウンタ値を更新すると共に、前記送信ノード及び前記受信ノードに前記カウンタ値を送信し、
前記送信ノードは、前記マスタノードから前記カウンタ値を受信する第1カウンタ値受信部と、前記受信ノードへの送信対象であるメインデータと前記第1カウンタ値受信部が受信したカウンタ値に基づき、第1認証用データを生成する第1生成部と、前記メインデータ及び前記第1認証用データを前記受信ノードに送信するデータ送信部と、前記送信ノードが起動してから前記第1カウンタ値受信部が前記カウンタ値を前記マスタノードから受信するまでの間、前記第1生成部及び前記データ送信部による処理を停止させる第1停止部と、を含み、
前記受信ノードは、前記送信ノードから前記メインデータ及び前記第1認証用データを受信するデータ受信部と、前記マスタノードから前記カウンタ値を受信する第2カウンタ値受信部と、前記データ受信部が受信した前記メインデータと前記第2カウンタ値受信部が受信した前記カウンタ値に基づき、第2認証用データを生成する第2生成部と、前記データ受信部が受信した前記第1認証用データと前記第2生成部が生成した前記第2認証用データの比較により、前記メインデータを含むメッセージの正当性を認証する認証部と、前記受信ノードが起動してから前記第2カウンタ値受信部が前記カウンタ値を前記マスタノードから受信するまでの間、前記第2生成部及び前記認証部による処理を停止させる第2停止部と、を含む、
CAN通信システム。
A CAN communication system in which a master node, a transmission node, and a reception node are connected by a bus,
The master node updates a counter value according to a predetermined rule every time a message is transmitted from the transmission node, and transmits the counter value to the transmission node and the reception node,
The transmitting node is based on a first counter value receiving unit that receives the counter value from the master node, main data that is a transmission target to the receiving node, and a counter value received by the first counter value receiving unit, A first generation unit that generates first authentication data; a data transmission unit that transmits the main data and the first authentication data to the reception node; and reception of the first counter value after the transmission node is activated. A first stop unit that stops processing by the first generation unit and the data transmission unit until a unit receives the counter value from the master node,
The receiving node includes a data receiving unit that receives the main data and the first authentication data from the transmitting node, a second counter value receiving unit that receives the counter value from the master node, and the data receiving unit A second generator for generating second authentication data based on the received main data and the counter value received by the second counter value receiver; and the first authentication data received by the data receiver; An authentication unit that authenticates the validity of the message including the main data by comparing the second authentication data generated by the second generation unit, and the second counter value reception unit after the reception node is activated. A second stop unit that stops processing by the second generation unit and the authentication unit until the counter value is received from the master node.
CAN communication system.
JP2016017496A 2016-02-01 2016-02-01 Communications system Active JP6601244B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016017496A JP6601244B2 (en) 2016-02-01 2016-02-01 Communications system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016017496A JP6601244B2 (en) 2016-02-01 2016-02-01 Communications system

Publications (2)

Publication Number Publication Date
JP2017139530A JP2017139530A (en) 2017-08-10
JP6601244B2 true JP6601244B2 (en) 2019-11-06

Family

ID=59566028

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016017496A Active JP6601244B2 (en) 2016-02-01 2016-02-01 Communications system

Country Status (1)

Country Link
JP (1) JP6601244B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5446650B2 (en) * 2009-09-17 2014-03-19 沖電気工業株式会社 Communication data novelty confirmation system, transmitting terminal and receiving terminal
JP5770602B2 (en) * 2011-10-31 2015-08-26 トヨタ自動車株式会社 Message authentication method and communication system in communication system
EP3142288B1 (en) * 2014-05-08 2018-12-26 Panasonic Intellectual Property Corporation of America In-car network system, electronic control unit and update processing method

Also Published As

Publication number Publication date
JP2017139530A (en) 2017-08-10

Similar Documents

Publication Publication Date Title
JP6512023B2 (en) Communication system, transmitting node, and receiving node
CN108023730B (en) Communication system and communication method
US10735435B2 (en) Communication system, management node, normal node, counter synchronization method, and storage medium
EP3038318B1 (en) Communication control apparatus, communication control method and communication control program
JP6814549B2 (en) Arithmetic logic unit, authentication system, authentication method
JP2018133744A (en) Communication system, vehicle, and monitoring method
WO2016098303A1 (en) Signature verification device, signature generation device, signature processing system, signature verification method, and signature generation method
US10050983B2 (en) Communication system, receiving apparatus, receiving method, and computer program product
KR102437864B1 (en) Method of receiving firmware and method of transmitting firmware
US12021999B2 (en) Devices and methods for the generating and authentication of at least one data packet to be transmitted in a bus system (BU), in particular of a motor vehicle
JP2017191965A (en) Communication device and packet transmission/reception program
JP6376073B2 (en) COMMUNICATION SYSTEM, COUNT VALUE SYNCHRONIZATION METHOD, AND PROGRAM
JP2018121220A (en) In-vehicle network system
JP6601244B2 (en) Communications system
CN113505382A (en) Micro-service authentication method, electronic device and storage medium
Lenard et al. LOKI: A lightweight cryptographic key distribution protocol for controller area networks
US11139982B2 (en) Communication-efficient device delegation
KR102411841B1 (en) Method of receiving firmware and method of transmitting firmware
WO2017026361A1 (en) Communication system, management node, normal node, counter synchronization method, program, and recording medium
JP6683105B2 (en) Communications system
JP2011508553A (en) Method and apparatus for restoring at least one setting
JP6615721B2 (en) COMMUNICATION SYSTEM, RECEPTION DEVICE, RECEPTION METHOD, AND PROGRAM
JP6915717B2 (en) Communications system
JP5768622B2 (en) Message authentication system, communication device, and communication program
JP6683106B2 (en) Communications system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180921

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190815

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20190910

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190923

R151 Written notification of patent or utility model registration

Ref document number: 6601244

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151