JP6601244B2 - Communications system - Google Patents
Communications system Download PDFInfo
- 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
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
しかしながら、特許文献1に開示される技術では、例えば、受信ノード或いは送信ノードが何等かの理由でリセットされると、送信ノードと受信ノードとの間で共通のカウンタ値にならない可能性がある。そのため、受信ノードは、受信メッセージの誤認証を行ってしまう可能性がある。
However, in the technique disclosed in
一方、送信ノードから受信ノードにカウンタ値を送信して、受信ノードは、送信ノードから受信したカウンタ値を用いて認証用データを生成することも可能である。しかしながら、例えば、車両に搭載される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
図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
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
マスタ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
尚、本実施形態におけるマスタECU20は、バス2に含まれるバス2aとバス2bとの間で送受信されるメッセージの中継を行う機能を果たす。即ち、マスタECU20は、ゲートウェイ装置(ゲートウェイECU)である。
Note that the
次に、図2を参照して、ECU10の構成について説明する。
Next, the configuration of the
図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
アプリケーション101は、ECU10内のCPU(不図示)上で実行され、各ECU10に割り当てられる任意の機能を実現するための各種制御処理を行うプログラムである。アプリケーション101は、予め規定された条件等に応じて、演算結果(以下、「制御データ(受信ノードである他のECU10への送信対象であるメインデータの一例)」と称する)を他のECU10に送信するため、送信管理部102に送信要求を出力する。
The
送信管理部102は、マスタECU20から送信され、CANコントローラ107がCANトランシーバ108を介してバス2から受信したカウンタ値CtをMBOX105から取得する。また、送信管理部102は、起動している間、アプリケーション101からの制御データを含む送信要求と、MBOX105から取得したカウンタ値Ctを認証管理部104に送信する。一方、送信管理部102は、停止している間、アプリケーション101からの制御データを含む送信要求と、MBOX105から取得したカウンタ値Ctを認証管理部104に送信せず、アプリケーション101からの送信要求をキューイング或いは破棄する。
The
尚、送信管理部102が"起動している"状態は、アプリケーション101からの制御データを含む送信要求と、MBOX105から取得したカウンタ値Ctを認証管理部104に送信する機能が実行可能な状態になっていることを表す。即ち、ECU10が起動していれば、送信管理部102が起動していない場合でも、送信管理部102は、他の機能(送信要求の有無を判断する機能や送信要求をキューイング或いは破棄したりする機能等)を実行可能である。
Note that the state in which the
受信管理部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
尚、受信管理部103が"起動している"状態は、MBOX106から取得した受信メッセージと、MBOX105から取得したカウンタ値Ctを認証管理部104に送信する機能が実行可能な状態になっていることを表す。即ち、ECU10が起動していれば、受信管理部103が起動していない場合でも、受信管理部103は、他の機能(受信メッセージの有無を判断する機能や受信メッセージをキューイング或いは破棄したりする機能等)を実行可能である。
Note that the state where the
ここで、図3、図4を参照して、ECU10の起動/停止に伴う、送信管理部102、受信管理部103の起動/停止動作について説明する。
Here, with reference to FIG. 3 and FIG. 4, start / stop operations of the
図3は、ECU10の起動時における処理の一例を概略的に示すフローチャートである。図4は、ECU10の停止時における処理の一例を概略的に示すフローチャートである。図3に示すフローチャートによる処理は、起動要求(起動信号)がECU10に入力されると実行される。また、図4に示すフローチャートによる処理は、停止要求(停止信号)がECU10に入力されると実行される。
FIG. 3 is a flowchart schematically showing an example of processing when the
図3を参照するに、ステップS102にて、ECU10は起動する。
Referring to FIG. 3, in step S102, the
ステップS104にて、ECU10は、送信管理部102及び受信管理部103が停止しているか否かを判定する。ECU10は、送信管理部102及び受信管理部103が停止している場合、ステップS108に進み、停止していない場合、ステップS106に進む。
In step S104, the
ステップS106にて、ECU10は、送信管理部102及び受信管理部103を停止させて、ステップS108に進む。
In step S106, the
ステップS108にて、ECU10は、送信管理部102及び受信管理部103の初期化を行う。
In step S108, the
ステップS110にて、ECU10は、ECU10の起動後、CANコントローラ107がCANトランシーバ108を介してマスタECU20からカウンタ値Ctを受信したか否かを判定する。ECU10は、マスタECU20からカウンタ値Ctを受信している場合、ステップS112に進み、マスタECU20からカウンタ値Ctを受信していない場合、ステップS110の処理を繰り返す。
In step S110,
ステップS112にて、ECU10は、送信管理部102及び受信管理部103を起動し、今回の処理を終了する。
In step S112, the
また、図4を参照するに、ステップS202にて、ECU10は。送信管理部102及び受信管理部103を停止させる。
Further, referring to FIG. 4, in step S <b> 202, the
そして、ステップS204にて、ECU10は、停止し、今回の処理を終了する。
In step S204, the
このように、送信管理部102及び受信管理部103は、ECU10の停止に伴い、停止し、ECU10の起動した後、CANコントローラ107がCANトランシーバ108を介してマスタECU20から送信されたカウンタ値Ctを受信すると、起動する。即ち、送信管理部102及び受信管理部103は、ECU10が起動してから、マスタECU20からのカウンタ値を受信するまで、停止している。
Thus, the
図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
また、認証管理部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
MBOX105は、マスタECU20から送信され、CANコントローラ107がCANトランシーバ108を介して受信するカウンタ値Ctを含むメッセージを格納する記憶領域である。
The
MBOX106は、他のECU10から送信され、CANコントローラ107がCANトランシーバ108を介してバス2から受信する制御データを含むメッセージ(受信メッセージ)を格納する記憶領域である。
The
CANコントローラ107は、プロトコルコントローラや、CPUクロックを分周する分周器、レジスタ等を備え、CANトランシーバ108を介して、バス2(バス2a或いはバス2b)との間でメッセージを送受信する。
The
CANトランシーバ108は、CANコントローラ107から取得した送信メッセージを作動電圧に変換してバス2に出力する。また、CANトランシーバ108は、バス2からメッセージを取得する際、バス2の作動電圧を読み取り、所定の電圧範囲に含まれるように整形した受信信号をCANコントローラ107に出力する。
The
次に、図5、図6を参照して、ECU10によるメッセージの送信処理及び受信処理について説明する。
Next, message transmission processing and reception processing by the
図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
図5を参照するに、ステップS302にて、アプリケーション101は、送信管理部102に制御データを含むメッセージの送信要求を送る。
Referring to FIG. 5, in step S <b> 302, the
ステップS304にて、送信管理部102は、起動しているか否か、即ち、アプリケーション101からの制御データを含む送信要求と、MBOX105から取得したカウンタ値Ctを認証管理部104に送信する機能が実行可能な状態か否かを確認する。送信管理部102は、起動していない場合、ステップS306に進み、起動している場合、ステップS308に進む。
In step S304, the
ステップS306にて、送信管理部102は、アプリケーション101からの送信要求をキューイングし、ステップS318に進む。
In step S306, the
尚、本ステップにて、送信管理部102は、送信要求を破棄すると共に、その旨をアプリケーション101に通知してもよい。
In this step, the
一方、ステップS308にて、送信管理部102は、アプリケーション101からの制御データを含む送信要求と、MBOX105から取得したカウンタ値Ctを認証管理部104に送信する。
On the other hand, in
ステップS310にて、認証管理部104は、送信管理部102から受信した制御データ及びカウンタ値Ctからハッシュ値を生成する。
In step S310, the
ステップS312にて、認証管理部104は、制御データ、下位ビットデータ、及びハッシュ値を含む送信メッセージを生成する。
In step S312, the
ステップS314にて、認証管理部104は、作成した送信メッセージをMBOX106に格納する。
In step S314,
ステップS316にて、CANコントローラ107は、CANトランシーバ108を介してMBOX106に格納される送信メッセージをバス2に出力し、他のECU10に送信する。
In step S <b> 316, the
ステップS318にて、送信管理部102は、キューに送信要求があるか否かを確認する。送信管理部102は、キューに送信要求がある場合、ステップS304に戻り、ステップS304〜S318の処理を繰り返し、キューに送信要求がない場合、今回の処理を終了する。
In step S318, the
また、図6を参照するに、ステップS402にて、CANコントローラ107は、他のECU10から制御データを含むメッセージを受信した旨を受信管理部103に通知する。
Referring to FIG. 6, in step S <b> 402, the
ステップS404にて、受信管理部103は、起動しているか否か、即ち、MBOX106から取得した受信メッセージと、MBOX105から取得したカウンタ値Ctを認証管理部104に送信する機能が実行可能な状態になっているか否かを確認する。受信管理部103は、起動していない場合、ステップS406に進み、起動している場合、ステップS408に進む。
In step S <b> 404, the
ステップS406にて、受信管理部103は、受信メッセージをキューイングし、ステップS426に進む。
In step S406, the
尚、本ステップにて、受信管理部103は、受信メッセージを破棄すると共に、その旨をアプリケーション101に通知してもよい。
In this step, the
一方、ステップS408にて、受信管理部103は、MBOX106から取得した受信メッセージと、MBOX105から取得したカウンタ値Ctを認証管理部104に送る。
On the other hand, in step S <b> 408, the
ステップS410にて、認証管理部104は、受信メッセージから下位ビットデータを取得する。
In step S410,
ステップS412にて、認証管理部104は、下位ビットデータと前回値の比較を行い、下位ビットデータの最下位ビットが前回値から増加しているか否かを確認する。認証管理部104は、最下位ビットが前回値から増加していない場合、ステップS414に進み、最下位ビットが前回値から増加している場合、カウンタ値Ctが所定の規則に従い単調増加している、即ち、第1認証の成功と判断し、ステップS416に進む。
In step S412, the
ステップS414にて、認証管理部104は、下位ビットデータの桁上がりがあるか否かを確認する。認証管理部104は、下位ビットデータの桁上がりがある場合、カウンタ値Ctが所定の規則に従い単調増加している、即ち、第1認証の成功と判断し、ステップS416に進み、下位ビットデータの桁上がりがない場合、第1認証の失敗と判断し、ステップS422に進む。
In step S414,
尚、ECU10にリセットが発生し、前回値が保持されていない場合、認証管理部104は、MBOX105から取得した最新のカウンタ値Ctから所定の規則に従い、前回値を生成し、生成した前回値を用いて、ステップS412、S414の処理を実行する。
When the
ステップS416にて、認証管理部104は、受信管理部103から取得した受信メッセージに含まれる制御データと、受信管理部103から取得したカウンタ値Ctからハッシュ値を生成する。
In step S416, the
ステップS418にて、認証管理部104は、受信メッセージから取得したハッシュ値と、ステップS416で生成したハッシュ値を比較し、一致するか否かを判定する。認証管理部104は、一致する場合、第2認証の成功と判断し、ステップS420に進み、一致しない場合、第2認証の失敗と判断し、ステップS422に進む。
In step S418, the
ステップS420にて、認証管理部104は、受信メッセージの正当性を認証し、受信メッセージに含まれる制御データをアプリケーション101に送る(認証成功)。
In step S420,
一方、ステップS422にて、認証管理部104は、受信メッセージの正当性を認証せず(認証失敗)、受信メッセージを破棄し、ステップS424に進む。
On the other hand, in step S422, the
そして、ステップS424にて、認証管理部104は、受信メッセージの認証失敗をアプリケーション101に通知する。
In step S424, the
ステップS426にて、受信管理部103は、キューに受信メッセージがあるか否かを確認する。受信管理部103は、キューに受信メッセージがある場合、ステップS404に戻り、ステップS404〜S426の処理を繰り返し、キューに受信メッセージがない場合、今回の処理を終了する。
In step S426,
尚、本実施形態では、第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
また、受信管理部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
以上、本発明を実施するための形態について詳述したが、本発明はかかる特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形・変更が可能である。 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,
20 Master ECU (master node)
101
103 Reception management unit (second stop unit)
104 Authentication management unit (first generation unit, second generation unit, authentication unit)
105, 106
108 CAN transceiver
Claims (1)
前記マスタノードは、前記送信ノードからメッセージが送信される度に所定の規則に従いカウンタ値を更新すると共に、前記送信ノード及び前記受信ノードに前記カウンタ値を送信し、
前記送信ノードは、前記マスタノードから前記カウンタ値を受信する第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.
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)
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 |
-
2016
- 2016-02-01 JP JP2016017496A patent/JP6601244B2/en active Active
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 |