JP6683105B2 - Communications system - Google Patents

Communications system Download PDF

Info

Publication number
JP6683105B2
JP6683105B2 JP2016219620A JP2016219620A JP6683105B2 JP 6683105 B2 JP6683105 B2 JP 6683105B2 JP 2016219620 A JP2016219620 A JP 2016219620A JP 2016219620 A JP2016219620 A JP 2016219620A JP 6683105 B2 JP6683105 B2 JP 6683105B2
Authority
JP
Japan
Prior art keywords
message
communication
information
received
counter
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
JP2016219620A
Other languages
Japanese (ja)
Other versions
JP2018078473A (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 JP2016219620A priority Critical patent/JP6683105B2/en
Publication of JP2018078473A publication Critical patent/JP2018078473A/en
Application granted granted Critical
Publication of JP6683105B2 publication Critical patent/JP6683105B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、車載された複数の電子制御装置がネットワーク接続されている通信システムに関する。   The present invention relates to a communication system in which a plurality of vehicle-mounted electronic control devices are network-connected.

周知のように、車両に搭載された複数の電子制御装置(ECU)は、それぞれが同じネットワークに接続されていて、それらの有する情報(車両情報)が相互に送受信可能である車両用の通信システムを構成していることが多い。こうした通信システムの一例が特許文献1に記載されている。   As is well known, a plurality of electronic control units (ECUs) mounted on a vehicle are connected to the same network, and information (vehicle information) that they have can be mutually transmitted and received. Often make up. An example of such a communication system is described in Patent Document 1.

特許文献1に記載されている通信システムは、データを送信する送信端末と、その送信端末からデータを受信する受信端末とを備える。送信端末は、データ取得部と、受信部と、鍵取得部と、受信部からチャレンジ情報を受信し、時変パラメータを管理する時変パラメータ管理部とを有する。また、送信端末は、受信した鍵情報、チャレンジ情報及び時変パラメータを用いて受信した通信データを変換して変換データを生成するデータ変換部と、データ変換部から変換データを受信し、該変換データを受信端末へ送信する送信部とを有する。一方、受信端末は、チャレンジ情報を生成するチャレンジ生成部と、チャレンジ情報を送信端末へ送信する送信部と、送信端末から変換データを受信する受信部と、送信端末における鍵情報と同一の鍵情報を取得する鍵取得部とを有する。また、受信端末は、受信した変換データの新規性を判断する時変パラメータ判断部と、受信した鍵情報、チャレンジ情報及び時変パラメータを用いて、受信した変換データが正しく変換されているか否かを認証し、その認証結果を時変パラメータ判断部へ送信するデータ認証部とを有する。そして、時変パラメータ判断部は、データ認証部から受信した認証結果に基づいて変換データの新規性を判断する。   The communication system described in Patent Document 1 includes a transmitting terminal that transmits data and a receiving terminal that receives data from the transmitting terminal. The transmission terminal includes a data acquisition unit, a reception unit, a key acquisition unit, and a time-varying parameter management unit that receives challenge information from the reception unit and manages time-varying parameters. Further, the transmitting terminal receives the conversion data from the data conversion unit and the data conversion unit that converts the received communication data by using the received key information, the challenge information and the time-varying parameter, and generates the conversion data. And a transmitter for transmitting data to the receiving terminal. On the other hand, the receiving terminal includes a challenge generating unit that generates challenge information, a transmitting unit that transmits the challenge information to the transmitting terminal, a receiving unit that receives conversion data from the transmitting terminal, and key information that is the same as the key information in the transmitting terminal. And a key acquisition unit for acquiring. In addition, the receiving terminal uses the time-varying parameter determination unit that determines the novelty of the received converted data, and whether the received converted data is correctly converted using the received key information, challenge information, and time-varying parameter. And a data authentication unit that sends the authentication result to the time-varying parameter determination unit. Then, the time-varying parameter determination unit determines the novelty of the converted data based on the authentication result received from the data authentication unit.

特開2011−66703号公報JP 2011-66703 A

特許文献1に記載のシステムによれば、通信メッセージに含まれている時変パラメータは、時変パラメータを適切に変更できない攻撃者による正規の送信者へのなりすましを抑制して、通信メッセージの信頼性を向上させるようになる。   According to the system described in Patent Document 1, the time-varying parameter included in the communication message suppresses the spoofing of the legitimate sender by an attacker who cannot appropriately change the time-varying parameter, and the reliability of the communication message is reduced. To improve the sex.

このように、時変パラメータを用いることで通信メッセージの信頼性が高められるようになるが、電源投入後やリセット後等であって時変パラメータが同期されるまでの間、受信装置と送信装置との間でそれぞれの記憶している時変パラメータが相違しているおそれがある。記憶している時変パラメータが相違しているような場合、受信装置は、送信装置が送信した正規の通信メッセージであっても、それを認証できないのみならず、不正であると判定してしまうことになる。   As described above, the reliability of the communication message can be improved by using the time-varying parameter, but the receiving device and the transmitting device can be used after the power is turned on or after the reset until the time-varying parameter is synchronized. And the stored time-varying parameters may differ from each other. If the stored time-varying parameters are different, the receiving device will not only be able to authenticate the legitimate communication message sent by the sending device, but also determine that it is invalid. It will be.

本発明は、このような実情に鑑みてなされたものであって、その目的は、時変パラメータを利用して通信メッセージの信頼性を確保する場合であれ、通信メッセージの正/不正を適切に判断することができる通信システムを提供することにある。   The present invention has been made in view of such circumstances, and an object of the present invention is to properly check whether a communication message is correct or incorrect, even when the reliability of the communication message is secured by using a time-varying parameter. It is to provide a communication system capable of making a judgment.

以下、上記課題を解決するための手段及びその作用効果を記載する。
上記目的を達成するために通信システムは、第1の情報と第2の情報とが組み合わされてなる管理コードのうちの前記第1の情報を記憶するとともに、記憶する前記第1の情報を前記第2の情報が複数回更新されることに基づいて1回更新するように管理する管理装置と、前記管理装置に通信ネットワークを介して通信可能に接続された受信装置及び送信装置とを備え、前記管理装置は、前記第1の情報を含む同期用メッセージを送信し、前記受信装置及び送信装置は、前記管理装置が送信した前記同期用メッセージを受信する都度、前記受信した同期用メッセージに含まれる前記第1の情報を保持するものであるとともに、前記管理装置からの前記同期用メッセージを受信しているか否かを判定するものであり、前記送信装置は、前記管理コードのうちの前記第2の情報を管理するものであり、通信データと、前記保持する前記第1の情報及び前記管理する第2の情報を組み合わせてなる前記管理コードとから認証子を生成して、前記通信データと、前記管理する第2の情報と、前記生成した認証子とを含み、前記保持する第1の情報を含まない通信メッセージを生成して送信するとともに、通信メッセージの生成後に前記管理する第2の情報の値を更新し、前記受信装置は、前記送信装置の送信した前記通信メッセージを受信して、前記受信した通信メッセージに含まれる認証子と、前記受信した通信メッセージに基づいて再生成した認証子との比較に基づいて前記受信した通信メッセージを認証するものであって、前記受信装置は、前記保持する第1の情報及び前記送信装置の送信した通信メッセージから取得した前記第2の情報を組み合わせて管理コードを再構成し、前記送信装置の送信した通信メッセージから取得した通信データと、前記再構成した管理コードとから前記再生成した認証子を取得するものであり、前記送信装置は、前記管理装置の送信した前記第1の情報を含む同期用メッセージが受信できていない場合に前記受信装置への通信メッセージを送信しないこと、及び、前記受信装置は、前記管理装置の送信した前記第1の情報を含む同期用メッセージが受信できていない場合に前記送信装置から受信した通信メッセージを認証しないことの少なくとも一方を行うことを特徴とする。
Hereinafter, the means for solving the above problems and the effects thereof will be described.
To achieve the above object, a communication system stores the first information of a management code formed by combining first information and second information, and stores the first information to be stored. A management device that manages the second information to be updated once based on multiple updates, and a reception device and a transmission device that are communicatively connected to the management device via a communication network, the management device transmits a synchronization message including the first information, the receiving apparatus and the transmitting apparatus, every time of receiving the synchronization message the management device transmits, included in synchronization the received message together is to hold the first information, the is intended to determine whether the receiving the synchronization message from the management apparatus, the transmitting apparatus, the management And managing the second information of the code, and generating an authenticator from communication data and the management code formed by combining the held first information and the managed second information. Then, while generating and transmitting a communication message including the communication data, the second information to be managed, and the generated authenticator, and not including the first information to be held, generation of the communication message The value of the second information to be managed is updated later, the receiving device receives the communication message transmitted by the transmitting device, the authenticator included in the received communication message, and the received communication message. For authenticating the received communication message based on a comparison with an authenticator regenerated based on the above, wherein the receiving device includes the first information held and the transmitting device. The management code is reconfigured by combining the second information acquired from the transmitted communication message, and the regenerated authentication is performed from the communication data acquired from the communication message transmitted by the transmission device and the reconfigured management code. Acquiring a child, the transmitting device does not transmit a communication message to the receiving device when the synchronization message including the first information transmitted by the management device has not been received , and The receiving device performs at least one of not authenticating a communication message received from the transmitting device when a synchronization message including the first information transmitted by the management device has not been received. .

通信の信頼性をより高めるためには管理コードを一度きりの値とすることが望ましいが、通信システムの使用期間に渡って管理コードを一度きりの値としようとすると管理コードに要する情報量が大きくなってしまう。そして、この管理コードを通信メッセージに含めるとなると、通信メッセージにおける管理コードの占有量が多くなり、送信したい通信内容であるメッセージデータに割り当てることのできる容量が少なくなってしまうといった問題がある。   It is desirable to set the management code to the one-time value in order to further improve the reliability of communication, but if you try to set the management code to the one-time value over the period of use of the communication system, the amount of information required for the management code will decrease. It gets bigger. When this management code is included in the communication message, the management code occupies a large amount in the communication message, and there is a problem that the capacity that can be assigned to the message data that is the communication content to be transmitted becomes small.

この点、送信装置が送信する通信メッセージには管理コードのうちの第2の情報だけを含むようにすることで通信データのために多くの領域を確保することができる。
また、管理コードのうちの第1の情報は、管理装置によって管理されることから、送信装置及び受信装置のそれぞれの間で同期されるようにもなる。つまり、受信装置は、管理装置から送信された第1の情報と、送信装置から送信された通信メッセージに含まれる第2の情報とを組み合わせることで、送信装置で認証子の生成に利用された管理コードを再構成することができる。すなわち、管理コードの大きさを信頼性の確保に必要とされるサイズにしたとしても、通信メッセージの格納に要する容量を少なく抑えて、通信データのための容量の減少を抑制することができる。
In this respect, by including only the second information of the management code in the communication message transmitted by the transmitting device, it is possible to secure a large area for communication data.
Further, the first information of the management code is managed by the management device, and thus can be synchronized between the transmission device and the reception device. That is, the receiving device combines the first information transmitted from the management device with the second information included in the communication message transmitted from the transmitting device, and is used by the transmitting device to generate the authenticator. The management code can be reconfigured. That is, even if the size of the management code is set to a size required for ensuring reliability, it is possible to suppress the capacity required for storing the communication message to be small and suppress the decrease in the capacity for communication data.

また、管理装置から送信された管理コードのうちの第1の情報が受信されることによって、受信した管理コードのうちの第1の情報に受信装置及び送信装置が記憶している管理コードのうちの第1の情報が更新される、すなわち同期される。これにより、管理コードが第1の情報と第2の情報とに2分割されたとしても、通信メッセージを管理コードによって認証することが可能になる。   Further, when the first information of the management codes transmitted from the management device is received, the first information of the management codes received among the management codes stored in the reception device and the transmission device is The first information of is updated, i.e. synchronized. Thereby, even if the management code is divided into the first information and the second information, the communication message can be authenticated by the management code.

また、受信装置及び送信装置に記憶されている管理コードのうちの第1の情報を同期させることができるので、受信装置や送信装置は、記憶している管理コードのうちの第1の情報がリセット等により非同期に初期化されたとしても、その記憶している管理コードが同期されて正常な値に設定し直されることで、認証を正常に行うことが可能にもなる。   Moreover, since the first information of the management codes stored in the receiving device and the transmitting device can be synchronized, the receiving device and the transmitting device can store the first information of the stored management codes in the first information. Even if the initialization is performed asynchronously by resetting or the like, the stored management code is synchronized and reset to a normal value, so that the authentication can be normally performed.

そして、このような構成によれば、送信装置は、第1の情報を含む同期用メッセージが受信できていない場合に受信装置への通信メッセージを送信しないこと、及び、受信装置は、第1の情報を含む同期用メッセージが受信できていない場合に送信装置から受信した通信メッセージを認証しないことの少なくとも一方を行う。つまり、管理コードの第1の情報が送信装置及び受信装置のそれらの間で同期されていないとき、通信メッセージが送信されない、又は、認証されないようになる。これにより、時変パラメータを利用して通信メッセージの信頼性を確保する場合であっても、管理コードの上位ビットが受信されていないことに起因して通信メッセージに対して不正であるとの判定がなされることが防止されて、通信メッセージの正/不正が適切に判断されるようになる。
According to such a configuration, the transmission device does not transmit the communication message to the reception device when the synchronization message including the first information has not been received , and the reception device has the first configuration. At least one of not authenticating the communication message received from the transmission device when the synchronization message including the information cannot be received. That is, when the first information of the management code is not synchronized between those of the transmitting device and the receiving device, the communication message is not transmitted or authenticated. As a result, even when the reliability of the communication message is secured by using the time-varying parameter, it is determined that the communication message is invalid because the upper bits of the management code are not received. Is prevented, and the correctness / incorrectness of the communication message is properly determined.

通信システムを具体化した一実施形態について、その概略構成を示すブロック図。The block diagram which shows the schematic structure about one Embodiment which materialized the communication system. 同実施形態においてゲートウェイで実行される処理の概要を模式的に示す模式図。The schematic diagram which shows the outline of the process performed by the gateway in the same embodiment. 同実施形態における電子制御装置(ECU)の概略構成を模式的に示す模式図。The schematic diagram which shows typically the schematic structure of the electronic control unit (ECU) in the same embodiment. 同実施形態において電子制御装置(ECU)が送信時に実行する処理の概要を模式的に示す模式図。The schematic diagram which shows typically the outline of the process which an electronic control unit (ECU) performs at the time of transmission in the same embodiment. 同実施形態において電子制御装置(ECU)が受信時に実行する処理の概要を模式的に示す模式図。The schematic diagram which shows typically the outline of the process which an electronic control unit (ECU) performs at the time of reception in the same embodiment. 同実施形態においてメッセージカウンタが同期されるときのゲートウェイ側の手順を示すフローチャート。6 is a flowchart showing a procedure on the gateway side when the message counters are synchronized in the same embodiment. 同実施形態においてメッセージカウンタが同期されるときのECU側の手順を示すフローチャート。The flowchart which shows the procedure by the side of ECU when a message counter is synchronized in the same embodiment. 同実施形態において電子制御装置(ECU)が通信メッセージの送信処理を示すフローチャート。The flowchart which shows the transmission process of a communication message by an electronic control unit (ECU) in the same embodiment. 同実施形態において電子制御装置(ECU)が通信メッセージの受信処理を示すフローチャート。The flowchart which shows the receiving process of a communication message by an electronic control unit (ECU) in the same embodiment.

図1を参照して、通信システムを具体化した一実施形態について説明する。本実施形態の通信システムは、図示しない車両に搭載された車載ネットワークに適用された通信システムである。   An embodiment in which the communication system is embodied will be described with reference to FIG. The communication system of the present embodiment is a communication system applied to an in-vehicle network mounted on a vehicle (not shown).

図1に示すように、通信システムは、送信装置及び受信装置の少なくとも一方としての第1〜第4電子制御装置(ECU)21〜24と、第1及び第2ECU21,22が通信可能に接続される通信用バスL1と、第3及び第4ECU23,24が通信可能に接続される通信用バスL2とを有している。本実施形態では、通信用バスL1と通信用バスL2とが通信ネットワークを構成する。また、通信システムは、通信用バスL1と通信用バスL2とに通信可能に接続される管理装置としてのゲートウェイ10を備えている。ゲートウェイ10は、通信用バスL1と通信用バスL2との間で通信メッセージMBを相互に転送(中継)することができる。よって、通信用バスL1に接続された第1及び第2ECU21,22と、通信用バスL2に接続された第3及び第4ECU23,24とは、ゲートウェイ10を介して、相互に通信メッセージMBの送受信が可能である。   As shown in FIG. 1, in the communication system, first to fourth electronic control units (ECUs) 21 to 24 as at least one of a transmission device and a reception device and first and second ECUs 21 and 22 are communicably connected. It has a communication bus L1 and a communication bus L2 to which the third and fourth ECUs 23 and 24 are communicatively connected. In this embodiment, the communication bus L1 and the communication bus L2 form a communication network. The communication system also includes a gateway 10 as a management device that is communicatively connected to the communication bus L1 and the communication bus L2. The gateway 10 can mutually transfer (relay) the communication message MB between the communication bus L1 and the communication bus L2. Therefore, the first and second ECUs 21 and 22 connected to the communication bus L1 and the third and fourth ECUs 23 and 24 connected to the communication bus L2 mutually transmit and receive the communication message MB via the gateway 10. Is possible.

通信システムは、通信プロトコルとして、例えば、CAN(コントローラエリアネットワーク)プロトコルが採用されている。また、通信システムは、通信経路の一部に無線通信を含んでいたり、ゲートウェイ等を介してその他のネットワークを経由する経路が含まれていたりしてもよい。   The communication system employs, for example, a CAN (Controller Area Network) protocol as a communication protocol. Further, the communication system may include wireless communication in a part of the communication path, or may include a path passing through another network via a gateway or the like.

CANプロトコルには、通信メッセージの構造であるフレームが規定されており、そのフレームには、通信メッセージの種類を示す識別子としての「メッセージID」の格納領域、ユーザが指定したデータである「メッセージデータ」の格納領域である「データフィールド」等が設けられている。「メッセージID」は、通信メッセージの種類毎に特定の値が定められており、各ECUは、送信する通信メッセージに、その種類に対応する「メッセージID」を付与して送信し、受信した通信メッセージの種類を「メッセージID」に基づいて判断する。この通信システムでは、ある1つの「メッセージID」を通信メッセージに付与して送信することができるのは、定められた一つのECUに限定されている。また、「メッセージデータ」が格納される領域である「データフィールド」は、0〜64ビット(8ビット×0〜8バイト)のうちのいずれかの長さで設定される。   The CAN protocol defines a frame that is a structure of a communication message. In the frame, a storage area of a "message ID" as an identifier indicating the type of the communication message and a "message data" that is data specified by a user are specified. “Data field” which is a storage area of “” is provided. The “message ID” has a specific value defined for each type of communication message, and each ECU adds the “message ID” corresponding to the type to the communication message to be transmitted and transmits the received communication message. The type of message is determined based on the "message ID". In this communication system, it is limited to one defined ECU that a certain “message ID” can be added to a communication message and transmitted. The "data field", which is an area for storing "message data", is set to have a length of any of 0 to 64 bits (8 bits x 0 to 8 bytes).

ゲートウェイ10は、演算装置(CPU)や記憶装置を有するマイクロコンピュータを含み構成されている。ゲートウェイ10には、プログラムの演算処理を実行する演算装置と、そのプログラムやデータ等が記憶された読み出し専用メモリ(ROM)と、演算装置の演算結果が一時的に記憶される揮発性メモリ(RAM)とが設けられている。これにより、ゲートウェイ10は、記憶装置に保持されているプログラムを演算装置に読み込み、実行することで、所定の機能を提供する。例えば、ゲートウェイ10は、2つの通信用バスL1,L2の間で通信メッセージMBを転送する処理や、管理コードとしてのメッセージカウンタMC(図2参照)を管理する処理を行う。また、ゲートウェイ10は、バッテリから常に電力が供給されることにより設定値や演算値を記憶保持するバックアップメモリを備えている。   The gateway 10 is configured to include a microcomputer having an arithmetic unit (CPU) and a storage device. The gateway 10 includes an arithmetic unit that executes arithmetic operations of programs, a read-only memory (ROM) that stores the programs and data, and a volatile memory (RAM) that temporarily stores the arithmetic results of the arithmetic units. ) And are provided. As a result, the gateway 10 provides a predetermined function by reading the program stored in the storage device into the arithmetic device and executing the program. For example, the gateway 10 performs a process of transferring the communication message MB between the two communication buses L1 and L2 and a process of managing the message counter MC (see FIG. 2) as a management code. The gateway 10 also includes a backup memory that stores and holds set values and calculated values when power is constantly supplied from a battery.

ゲートウェイ10は、メッセージカウンタMC(図2参照)を管理するコード管理部11と、メッセージカウンタMCの一部を送信する送信部12と、ゲートウェイ10が接続された各通信用バスL1,L2との間で各通信メッセージMBを授受する通信I/F部13とを備える。なお、コード管理部11及び送信部12の各機能は、ゲートウェイ10によるプログラムの演算処理により実現される。   The gateway 10 includes a code management unit 11 that manages the message counter MC (see FIG. 2), a transmission unit 12 that transmits a part of the message counter MC, and communication buses L1 and L2 to which the gateway 10 is connected. And a communication I / F unit 13 for exchanging each communication message MB between them. Each function of the code management unit 11 and the transmission unit 12 is realized by the arithmetic processing of the program by the gateway 10.

通信I/F13は、通信用バスL1,L2との間でCANプロトコルに基づく通信メッセージMBを送受信する。また、通信I/F13は、送信部12等との間で通信メッセージMBを授受する。これにより、ゲートウェイ10は、自身が出力する同期用メッセージMAを通信用バスL1,L2に送信可能であるとともに、通信用バスL1,L2を介して他のECUが送信する通信メッセージMBを取得することができる。なお、本実施形態では、同期用メッセージMAは、CANプロトコルに基づく通常の通信メッセージのうちで同期用メッセージであることを示すメッセージIDが付与されたものである。よって、同期用メッセージMAは、通常の通信メッセージと同様に、各通信用バスL1,L2に接続されているECU21〜24に対してブロードキャストで送信される。   The communication I / F 13 transmits / receives a communication message MB based on the CAN protocol to / from the communication buses L1 and L2. Further, the communication I / F 13 exchanges the communication message MB with the transmission unit 12 and the like. As a result, the gateway 10 can transmit the synchronization message MA output by itself to the communication buses L1 and L2, and also obtains the communication message MB transmitted from another ECU via the communication buses L1 and L2. be able to. It should be noted that in the present embodiment, the synchronization message MA is given a message ID indicating that it is a synchronization message among normal communication messages based on the CAN protocol. Therefore, the synchronization message MA is broadcasted to the ECUs 21 to 24 connected to the communication buses L1 and L2, as in a normal communication message.

図2を参照して、コード管理部11について説明する。
コード管理部11は、ゲートウェイ10のバックアップメモリに記憶されるメッセージカウンタMCを管理する。なお、コード管理部11は、メッセージカウンタMCのうちの「上位ビットMCH」を記憶、管理する。また、コード管理部11は、メッセージカウンタMCのうちの「下位ビットMCL」の最新の値を通信メッセージMBから取得して、その値を監視するために記憶する。以下では、メッセージカウンタMCの全長については、単にメッセージカウンタMCと記載する。
The code management unit 11 will be described with reference to FIG.
The code management unit 11 manages the message counter MC stored in the backup memory of the gateway 10. The code management unit 11 stores and manages the “upper bit MCH” of the message counter MC. Further, the code management unit 11 acquires the latest value of the “lower bit MCL” of the message counter MC from the communication message MB and stores it for monitoring the value. Hereinafter, the total length of the message counter MC will be simply referred to as the message counter MC.

メッセージカウンタMCは、「メッセージID」毎に管理されているカウンタであり、対応する「メッセージID」を有する通信メッセージが新たに生成されることに応じて、その値が更新されるカウンタである。つまり、「メッセージID」毎に対応するメッセージカウンタMCが更新される。本実施形態では、メッセージカウンタMCは、1ずつ増加させられるカウンタである。なお、以下では、1つの「メッセージID」と、これに対応するメッセージカウンタMCとを例にして説明し、説明の便宜上、その他の「メッセージID」とそれに対応するメッセージカウンタMCとの例についての説明は割愛する。   The message counter MC is a counter managed for each “message ID”, and its value is updated when a communication message having a corresponding “message ID” is newly generated. That is, the message counter MC corresponding to each "message ID" is updated. In this embodiment, the message counter MC is a counter that can be incremented by one. In the following, one "message ID" and a message counter MC corresponding to this will be described as an example, and for convenience of description, examples of other "message IDs" and corresponding message counters MC will be described. I will omit the explanation.

本実施形態では、メッセージカウンタMCを第1の情報としての「上位ビットMCH」と第2の情報としての「下位ビットMCL」とに2分割する。そして、「上位ビットMCH」をゲートウェイ10で記憶、管理及び送信し、「下位ビットMCL」を各ECU21〜24で記憶、管理及び送信するようにしている。また、メッセージカウンタMCは、「下位ビットMCL」が「0」から最大値まで変化したことに応じて、ゲートウェイ10が「上位ビットMCH」の値を「1」だけ増加させるとともに、その「上位ビットMCH」の増加に応じてECUが「下位ビットMCL」を初期値「0」に設定することを繰り返す。これにより、メッセージカウンタMCは、二度と同じ値にならないようになっている。なお、ゲートウェイ10は、メッセージカウンタMCを記憶する領域として確保された記憶領域にメッセージカウンタMCのうちの「上位ビットMCH」を記憶して、管理する。このとき、ゲートウェイ10は、メッセージカウンタMCのうちの「下位ビットMCL」を上記確保した記憶領域の下位ビットに対応する位置に入れて管理してもよいし、上記確保したメッセージカウンタMCを記憶する記憶領域とは別に確保した記憶領域にメッセージカウンタMCと分けて格納して、管理してもよい。つまり、ゲートウェイ10は、メッセージカウンタMCのうちの「下位ビットMCL」に対応するビットに、通信メッセージMBで受信される「下位ビットMCL」を入れてもよいし、所定の値を設定しておいてもよいし、「下位ビットMCL」に対応するビットを含まないかたちで管理してもよい。   In the present embodiment, the message counter MC is divided into two, that is, "upper bit MCH" as the first information and "lower bit MCL" as the second information. The "upper bit MCH" is stored, managed and transmitted by the gateway 10, and the "lower bit MCL" is stored, managed and transmitted by each ECU 21-24. Further, the message counter MC increases the value of the “upper bit MCH” by “1” in response to the change of the “lower bit MCL” from “0” to the maximum value, and The ECU repeatedly sets the "lower bit MCL" to the initial value "0" according to the increase of "MCH". As a result, the message counter MC never reaches the same value again. The gateway 10 stores and manages the “upper bit MCH” of the message counter MC in a storage area secured as an area for storing the message counter MC. At this time, the gateway 10 may manage the “lower bit MCL” of the message counter MC by putting it in a position corresponding to the lower bit of the secured storage area, or store the secured message counter MC. The message counter MC may be separately stored and managed in a storage area secured separately from the storage area. That is, the gateway 10 may put the “lower bit MCL” received in the communication message MB into the bit corresponding to the “lower bit MCL” of the message counter MC, or set a predetermined value. Alternatively, the management may be performed without including the bit corresponding to the “lower bit MCL”.

メッセージカウンタMCは、通信メッセージMBの信頼性を担保できる情報量、すなわちビット長(ビット数)に設定される。例えば、メッセージカウンタMCを単調増加させつつ、二度と同じ値で使用することがないようにすることで通信メッセージMBの信頼性を担保する場合、車両寿命と通信メッセージMBの送信頻度とから、メッセージカウンタMCの長さ(ビット数)は、計算上、8バイトの長さが必要である。この8バイトの長さは、「データフィールド」の最大長64ビット(=8バイト)と同じ長さであるため、もし、メッセージカウンタMCを通信メッセージMBに格納して送信しようとすると、通信メッセージMBにユーザが指定したデータである「メッセージデータ」が格納できないことになってしまう。そこで、上述のように、メッセージカウンタMCを「上位ビットMCH」と「下位ビットMCL」とに2分割にして管理する。   The message counter MC is set to an information amount capable of ensuring the reliability of the communication message MB, that is, a bit length (number of bits). For example, when the reliability of the communication message MB is ensured by never increasing the value of the message counter MC and never using the same value again, the message counter is calculated from the vehicle life and the transmission frequency of the communication message MB. The length (the number of bits) of MC needs to be 8 bytes in terms of calculation. Since the length of 8 bytes is the same as the maximum length of 64 bits (= 8 bytes) of the "data field", if the message counter MC is stored in the communication message MB and is transmitted, the communication message The "message data" which is the data specified by the user cannot be stored in the MB. Therefore, as described above, the message counter MC is divided into "upper bit MCH" and "lower bit MCL" and managed.

詳述すると、コード管理部11は、メッセージカウンタMCのうちの「上位ビットMCH」を管理する。例えば、本実施形態では、メッセージカウンタMCが8バイト長である場合、「上位ビットMCH」を7バイト(=56ビット)長、「下位ビットMCL」を1バイト(=8ビット)長とする。この場合「下位ビットMCL」の最大値は「255」になる。   More specifically, the code management unit 11 manages the “upper bit MCH” of the message counter MC. For example, in the present embodiment, when the message counter MC has a length of 8 bytes, the “upper bit MCH” has a length of 7 bytes (= 56 bits) and the “lower bit MCL” has a length of 1 byte (= 8 bits). In this case, the maximum value of the "lower bit MCL" is "255".

コード管理部11は、メッセージカウンタMCが二度と同じ値にならないように、メッセージカウンタMCのうちの「上位ビットMCH」を更新し、管理する。具体的には、コード管理部11は、メッセージカウンタMCのうちの「上位ビットMCH」を、更新タイミングで単調増加させることで更新する。更新タイミングは、メッセージカウンタMCのうちの「下位ビットMCL」が最大値になったタイミング、すなわち、「下位ビットMCL」の有する全てのパターンが使い切られるタイミングである。例えば、コード管理部11は、第1ECU21が送信する通信メッセージMBを受信することでメッセージカウンタMCのうちの「下位ビットMCL」を監視し、この「下位ビットMCL」が最大値以上になったときを更新タイミングにする。   The code management unit 11 updates and manages the “high-order bit MCH” of the message counter MC so that the message counter MC never becomes the same value again. Specifically, the code management unit 11 updates the “upper bit MCH” of the message counter MC by monotonically increasing at the update timing. The update timing is a timing when the “lower bit MCL” of the message counter MC reaches the maximum value, that is, a timing when all the patterns of the “lower bit MCL” are used up. For example, the code management unit 11 monitors the “lower bit MCL” of the message counter MC by receiving the communication message MB transmitted by the first ECU 21, and when the “lower bit MCL” becomes equal to or larger than the maximum value. Is the update timing.

コード管理部11は、メッセージカウンタMCのうちの「上位ビットMCH」を更新することに応じて、メッセージカウンタMCのうちの「上位ビットMCH」を送信部12に伝達する。   The code management unit 11 transmits the “upper bit MCH” of the message counter MC to the transmission unit 12 in response to updating the “upper bit MCH” of the message counter MC.

送信部12は、メッセージカウンタMCのうちの「上位ビットMCH」から「認証子AC1」を生成するとともに、生成した「認証子AC1」とメッセージカウンタMCのうちの「上位ビットMCH」とを含む同期用メッセージMAを生成する。同期用メッセージMAは、「データフィールド」にメッセージカウンタMCのうちの「上位ビットMCH」と、メッセージカウンタMCのうちの「上位ビットMCH」を暗号化した「認証子AC1」とを格納した通信メッセージである。そして、送信部12は、通信I/F13を介して、同期用メッセージMAを、CANプロトコルにおいて優先度の高いメッセージIDを有する通信メッセージとして、第1〜第4ECU21〜24へ送信する。なお、優先度の高いメッセージIDは、同期用メッセージMAのために予め設定されているものとする。そして、同期用メッセージMAは、ゲートウェイ10で管理しているメッセージカウンタMCのうちの「上位ビットMCH」を第1〜第4ECU21〜24へそれぞれ通知し、各ECU21〜24で管理されているメッセージカウンタMCのうちの「上位ビットMCH」を同期させる。   The transmission unit 12 generates the "authenticator AC1" from the "upper bit MCH" of the message counter MC, and performs synchronization including the generated "authenticator AC1" and the "upper bit MCH" of the message counter MC. Message MA for use is generated. The synchronization message MA is a communication message in which the "upper bit MCH" of the message counter MC and the "authenticator AC1" obtained by encrypting the "upper bit MCH" of the message counter MC are stored in the "data field". Is. Then, the transmission unit 12 transmits the synchronization message MA to the first to fourth ECUs 21 to 24 via the communication I / F 13 as a communication message having a message ID having a high priority in the CAN protocol. Note that the message ID having a high priority is set in advance for the synchronization message MA. Then, the synchronization message MA notifies the “first bit MCH” of the message counter MC managed by the gateway 10 to the first to fourth ECUs 21 to 24, respectively, and the message counter managed by each ECU 21 to 24. The "upper bit MCH" of MC is synchronized.

図2に示すように、送信部12は、暗号化エンジン111を備えている。暗号化エンジン111は、暗号鍵EKが設定されており、コード管理部11からメッセージカウンタMCのうちの「上位ビットMCH」を入力し、この入力したメッセージカウンタMCのうちの「上位ビットMCH」を暗号鍵EKで暗号化することで「認証子AC1」を生成する。そして、送信部12は、メッセージカウンタMCのうちの「上位ビットMCH」と、「認証子AC1」とから同期用メッセージMAを生成する。なお、暗号鍵EKは、耐タンパメモリ等を用いて外部から取得不可能であればなおよい。   As shown in FIG. 2, the transmission unit 12 includes an encryption engine 111. The encryption engine 111 is set with the encryption key EK, inputs the “upper bit MCH” of the message counter MC from the code management unit 11, and inputs the “upper bit MCH” of the input message counter MC. The "certifier AC1" is generated by encrypting with the encryption key EK. Then, the transmission unit 12 generates the synchronization message MA from the “upper bit MCH” of the message counter MC and the “authenticator AC1”. Note that the encryption key EK is better if it cannot be acquired from the outside using a tamper resistant memory or the like.

また、送信部12は、同期用メッセージMAを、メッセージカウンタMCのうちの「上位ビットMCH」が更新されることに応じて、全てのECUに対して送信する。つまり、ゲートウェイ10は、メッセージカウンタMCのうちの「上位ビットMCH」を送信する。   Further, the transmission unit 12 transmits the synchronization message MA to all the ECUs in response to the update of the “upper bit MCH” of the message counter MC. That is, the gateway 10 transmits the “upper bit MCH” of the message counter MC.

図3及び図4を参照して、第1〜第4ECU21〜24について説明する。なお、第1〜第4ECU21〜24は、いずれも同様の構成を有しているので、ここでは第1ECU21について詳しく説明し、その他のECUの構成についての説明は割愛する。   The first to fourth ECUs 21 to 24 will be described with reference to FIGS. 3 and 4. Since the first to fourth ECUs 21 to 24 all have the same configuration, the first ECU 21 will be described in detail here, and the description of the configuration of the other ECUs will be omitted.

第1ECU21は、演算装置(CPU)や記憶装置を有するマイクロコンピュータを含み構成されている。第1ECU21には、プログラムの演算処理を実行する演算装置と、そのプログラムやデータ等が記憶された読み出し専用メモリ(ROM)と、演算装置の演算結果が一時的に記憶される揮発性メモリ(RAM)とが設けられている。これにより、第1ECU21は、記憶装置に保持されているプログラムを演算装置に読み込み、実行することで、所定の機能を提供する。例えば、第1ECU21は、通信用バスL1との間で通信メッセージMBを送受信する処理や同期用メッセージMAを受信する処理、管理コードとしてのメッセージカウンタMCを管理する処理を行う。また、第1ECU21は、バッテリから常に電力が供給されることにより設定値や演算値を記憶保持するバックアップメモリを備えている。   The first ECU 21 is configured to include a microcomputer having an arithmetic unit (CPU) and a storage device. The first ECU 21 includes an arithmetic unit that executes arithmetic processing of a program, a read-only memory (ROM) that stores the program and data, and a volatile memory (RAM) that temporarily stores the arithmetic result of the arithmetic unit. ) And are provided. As a result, the first ECU 21 provides a predetermined function by reading the program stored in the storage device into the arithmetic device and executing the program. For example, the first ECU 21 performs a process of transmitting and receiving the communication message MB to and from the communication bus L1, a process of receiving the synchronization message MA, and a process of managing the message counter MC as a management code. The first ECU 21 is also provided with a backup memory that stores and holds set values and calculated values by being constantly supplied with electric power from a battery.

図3及び図4に示すように、第1ECU21は、CANプロトコル用の通信I/F30と、通信メッセージが一時的に格納される複数のMBOX(MessageBox)31a,31b,31cと、送信する通信メッセージMB等に含まれる「認証子AC2」を生成する認証子生成部33とを備える。また、第1ECU21は、認証子を含み送受信される通信メッセージMBを処理するメッセージ処理部34と、「メッセージデータDT」を処理する情報処理部32と、通信メッセージMBの送受信の可否を「上位ビットMCH」の更新状態に応じて判定する送受信判定部36とを備える。なお、認証子生成部33、メッセージ処理部34及び送受信判定部36の各機能は、第1ECU21によるプログラムの演算処理により実現される。   As shown in FIGS. 3 and 4, the first ECU 21 includes a communication I / F 30 for CAN protocol, a plurality of MBOXs (Message Box) 31a, 31b, 31c in which communication messages are temporarily stored, and communication messages to be transmitted. An authenticator generation unit 33 that generates an “authenticator AC2” included in the MB or the like is provided. In addition, the first ECU 21 processes the communication message MB including the authenticator, which processes the communication message MB, the information processing unit 32 which processes “message data DT”, and whether or not the communication message MB can be transmitted and received by “upper bit”. And a transmission / reception determination unit 36 that determines according to the update state of “MCH”. Each function of the authenticator generation unit 33, the message processing unit 34, and the transmission / reception determination unit 36 is realized by the arithmetic processing of the program by the first ECU 21.

通信I/F部30は、通信用バスL1を介して同期用メッセージMAを受信したり、通信メッセージMBを送受信したりする。
複数のMBOX31a,31b,31cは、通信I/F部30によって受信された通信メッセージMBを中継する。また、複数のMBOX31a,31b,31cは、通信I/F部30から送信する通信メッセージMBを中継する。例えば、MBOX31aは、通信I/F部30と情報処理部32との間で認証子を含まない通信メッセージを中継する。また、MBOX31bは、通信I/F部30と認証子生成部33との間で通信メッセージを中継する。MBOX31bは、特に、メッセージカウンタMCの管理に必要である同期用メッセージMAを中継する。MBOX31cは、通信I/F部30とメッセージ処理部34との間で通信メッセージを中継する。MBOX31cは、特に、通信メッセージMBを中継等する。
The communication I / F unit 30 receives the synchronization message MA and transmits / receives the communication message MB via the communication bus L1.
The plurality of MBOXs 31a, 31b, 31c relay the communication message MB received by the communication I / F unit 30. The plurality of MBOXs 31a, 31b, 31c relay the communication message MB transmitted from the communication I / F unit 30. For example, the MBOX 31a relays a communication message including no authenticator between the communication I / F unit 30 and the information processing unit 32. Further, the MBOX 31b relays a communication message between the communication I / F unit 30 and the authenticator generating unit 33. The MBOX 31b particularly relays the synchronization message MA required for managing the message counter MC. The MBOX 31c relays a communication message between the communication I / F unit 30 and the message processing unit 34. The MBOX 31c relays the communication message MB, among others.

情報処理部32は、第1ECU21が受信した通信メッセージに含まれる「メッセージデータDT」を利用する各種アプリケーションを実行する。また、情報処理部32は、各種アプリケーションが出力したデータを外部へ送信する「メッセージデータDT」として出力する。   The information processing unit 32 executes various applications using the “message data DT” included in the communication message received by the first ECU 21. Further, the information processing section 32 outputs the data output by various applications as “message data DT” to be transmitted to the outside.

認証子生成部33は、「メッセージデータDT」と「メッセージカウンタMC」とから「認証子AC2」を生成する。認証子生成部33は、メッセージカウンタMCのうちの「上位ビットMCH」を保持しているとともに、「下位ビットMCL」を記憶及び管理している。なお、認証子生成部33は、メッセージカウンタMCのうちの「上位ビットMCH」と「下位ビットMCL」とを1つだけ確保されたメッセージカウンタMCの記憶領域の対応するビット位置に記憶するようにしてもよいし、「上位ビットMCH」と「下位ビットMCL」とをそれぞれ別々に確保された記憶領域に記憶してもよい。   The authenticator generation unit 33 generates an “authenticator AC2” from the “message data DT” and the “message counter MC”. The authenticator generation unit 33 holds the “upper bit MCH” of the message counter MC and stores and manages the “lower bit MCL”. The authenticator generation unit 33 stores only one “upper bit MCH” and “lower bit MCL” of the message counter MC in the corresponding bit positions of the reserved storage area of the message counter MC. Alternatively, the “higher-order bit MCH” and the “lower-order bit MCL” may be stored in separately reserved storage areas.

送受信判定部36は、認証子生成部33とメッセージ処理部34との間で授受した情報に基づいて送受信の可否判断を行う。送受信判定部36は、認証子生成部33に記憶されている「上位ビットMCH」とその状態を取得し、送受信の可否結果を出力する。また、送受信判定部36は、メッセージ処理部34から「通信メッセージMB」又は「メッセージデータDT」を取得し、送受信の可否結果を出力する。   The transmission / reception determination unit 36 determines whether transmission / reception is possible based on the information exchanged between the authenticator generation unit 33 and the message processing unit 34. The transmission / reception determination unit 36 acquires the “high-order bit MCH” and its state stored in the authenticator generation unit 33, and outputs a transmission / reception availability result. In addition, the transmission / reception determination unit 36 acquires the “communication message MB” or the “message data DT” from the message processing unit 34, and outputs the transmission / reception availability result.

詳述すると、送受信判定部36は、「通信メッセージMB」又は「メッセージデータDT」に対応して認証子生成部33に記憶されている「上位ビットMCH」に基づいて、通信メッセージMBの送信の可否、又は、受信の可否について判定し、この判定した結果をメッセージ処理部34に出力する。よって、送受信判定部36は、送信の可否及び受信の可否の判定をするに際し、認証子生成部33に記憶されている「上位ビットMCH」の状態を判定する。この判定で「上位ビットMCH」の状態が適切であれば送信や受信が「可」であると判定し、状態が適切でなければ送信や受信が「否」であると判定する。状態が適切であることは、「上位ビットMCH」が定期的に更新されている状態や、先の更新から所定の期間以内である状態等であることに基づき判断される。逆に、状態が適切ではないことは、「上位ビットMCH」が初期値のままである状態や、「上位ビットMCH」の更新が停止されている状態や、先の更新から所定の期間を超えても更新されない状態等であることに基づいて判断される。送受信判定部36は、認証子生成部33が認証子を認証する必要があるときに送受信の可否の判定を行い、その判定結果を認証子生成部33やメッセージ処理部34に出力することができる。   More specifically, the transmission / reception determination unit 36 determines whether to transmit the communication message MB based on the “upper bit MCH” stored in the authenticator generation unit 33 in association with the “communication message MB” or the “message data DT”. Whether or not the reception is possible or not is determined, and the determination result is output to the message processing unit 34. Therefore, the transmission / reception determination unit 36 determines the state of the “upper bit MCH” stored in the authenticator generation unit 33 when determining whether the transmission is possible or not. If the state of the “high-order bit MCH” is appropriate in this determination, it is determined that the transmission or reception is “enabled”, and if the state is not appropriate, the transmission or reception is determined to be “no”. The appropriate state is determined based on the state in which the “high-order bit MCH” is regularly updated, the state within a predetermined period from the previous update, and the like. On the other hand, if the state is not appropriate, it means that the “high-order bit MCH” remains at the initial value, that the “high-order bit MCH” is not updated, or that a predetermined period has passed since the previous update. However, it is determined based on the fact that it is not updated. The transmission / reception determination unit 36 can determine whether transmission / reception is possible when the authenticator generation unit 33 needs to authenticate the authenticator, and output the determination result to the authenticator generation unit 33 or the message processing unit 34. .

メッセージ処理部34は、送受信される通信メッセージMBの信頼性を以下のようにして確保する。
通信メッセージMBを受信したとき、メッセージ処理部34は、MBOX31cから通信メッセージMBを入力し、この入力した通信メッセージMBの受信可否の判定及び認証処理をする。そしてメッセージ処理部34は、受信「可」の判定でのもと認証した通信メッセージMBに含まれる「メッセージデータDT」を情報処理部32に出力する。具体的には、メッセージ処理部34は、受信可否の判定を行うため、受信した通信メッセージMBを送受信判定部36に送り、送受信判定部36から受信の可否の判定結果が入力される。そして、メッセージ処理部34は、認証の結果にかかわらず、受信「否」の判定結果が入力されると、入力した通信メッセージMBを破棄する。一方、メッセージ処理部34は、受信「可」の判定結果が入力されると、入力した通信メッセージMBに対して認証結果に応じた処理を行う。そして、メッセージ処理部34は、認証処理を行うため、受信した通信メッセージMBを認証子生成部33に送り、認証子生成部33から通信メッセージMBに対する認証の結果を得る。
The message processing unit 34 secures the reliability of the communication message MB transmitted / received as follows.
When receiving the communication message MB, the message processing unit 34 inputs the communication message MB from the MBOX 31c, and determines whether or not the input communication message MB can be received and performs an authentication process. Then, the message processing unit 34 outputs, to the information processing unit 32, the “message data DT” included in the communication message MB that has been authenticated based on the determination of reception “possible”. Specifically, the message processing unit 34 sends the received communication message MB to the transmission / reception determination unit 36 in order to determine the reception availability, and the transmission / reception determination unit 36 inputs the reception availability determination result. Then, the message processing unit 34 discards the input communication message MB when the reception “no” determination result is input regardless of the authentication result. On the other hand, when the determination result of the reception “possible” is input, the message processing unit 34 processes the input communication message MB according to the authentication result. Then, in order to perform the authentication process, the message processing unit 34 sends the received communication message MB to the authenticator generating unit 33, and the authenticator generating unit 33 obtains the authentication result for the communication message MB.

また、通信メッセージMBを送信するとき、メッセージ処理部34は、情報処理部32から「メッセージデータDT」を入力し、この入力した「メッセージデータDT」の送信可否の判定、及びこの入力した「メッセージデータDT」に基づく「認証子AC2」の生成を行う。そして、メッセージ処理部34は、送信「可」の判定であるとき、「メッセージデータDT」と「認証子AC2」とを含む送信する通信メッセージMBを生成し、この生成した送信する通信メッセージMBをMBOX31cに出力する。具体的には、メッセージ処理部34は、送信可否の判定を行うため、送信対象である「メッセージデータDT」を送受信判定部36に送り、送受信判定部36から送信の可否の判定結果が入力される。そして、メッセージ処理部34は、送信「否」の判定結果が入力されると、「メッセージデータDT」を送信しない。一方、メッセージ処理部34は、送信「可」の判定結果が入力されると、入力された「メッセージデータDT」を含む通信メッセージMBの生成を行う。すなわち、メッセージ処理部34は、認証子を作成するため、「メッセージデータDT」を認証子生成部33に送り、認証子生成部33から「メッセージデータDT」に対する「認証子AC2」を得る。そしてメッセージ処理部34は、生成された「認証子AC2」と「メッセージデータDT」とを含む通信メッセージMBを生成する。   Further, when transmitting the communication message MB, the message processing unit 34 inputs the “message data DT” from the information processing unit 32, determines whether or not the input “message data DT” can be transmitted, and the input “message”. The "certifier AC2" is generated based on the data DT. Then, when it is determined that the transmission is “permitted”, the message processing unit 34 generates a transmission communication message MB including “message data DT” and “authentication element AC2”, and outputs the generated transmission communication message MB. Output to MBOX 31c. Specifically, the message processing unit 34 sends the “message data DT” that is the transmission target to the transmission / reception determination unit 36 in order to determine whether or not the transmission is possible, and the transmission / reception determination result is input from the transmission / reception determination unit 36. It Then, the message processing unit 34 does not transmit the "message data DT" when the determination result of the transmission "reject" is input. On the other hand, when the determination result of the transmission “possible” is input, the message processing unit 34 generates the communication message MB including the input “message data DT”. That is, the message processing unit 34 sends the “message data DT” to the authenticator generating unit 33 to create the authenticator, and obtains the “authenticator AC2” for the “message data DT” from the authenticator generating unit 33. Then, the message processing unit 34 generates a communication message MB including the generated “authentication element AC2” and “message data DT”.

認証子生成部33は、メッセージカウンタMCのうちの「上位ビットMCH」と「下位ビットMCL」とを管理している。なお、認証子生成部33は、メッセージカウンタMCのうちの「上位ビットMCH」と「下位ビットMCL」とを1つだけ確保されたメッセージカウンタMCの記憶領域の対応する位置に記憶するようにしてもよいし、「上位ビットMCH」と「下位ビットMCL」とをそれぞれ別々に確保された記憶領域に記憶するようにしてもよい。また、認証子生成部33は、電源遮断やリセットによって「下位ビットMCL」を記憶保持するため記憶領域や、「上位ビットMCH」を記憶保持するため記憶領域の値が初期化により初期値に設定されるようになっている。この初期化は、他のECUやゲートウェイ10とは非同期に生じることも少なくない。   The authenticator generation unit 33 manages “upper bit MCH” and “lower bit MCL” of the message counter MC. Note that the authenticator generation unit 33 stores only one “upper bit MCH” and “lower bit MCL” of the message counter MC in the corresponding positions of the reserved storage area of the message counter MC. Alternatively, the “higher-order bit MCH” and the “lower-order bit MCL” may be stored in separately reserved storage areas. Further, the authenticator generation unit 33 sets the value of the storage area for storing and holding the “lower bit MCL” and the storage area for storing and storing the “upper bit MCH” to the initial value by initialization by powering off or resetting. It is supposed to be done. This initialization often occurs asynchronously with other ECUs and the gateway 10.

認証子生成部33は、メッセージカウンタの同期処理と、通信メッセージの送信時処理と、通信メッセージの受信時処理とを行う。そこで各処理について、以下に詳述する。
[メッセージカウンタの同期処理]
認証子生成部33は、MBOX31bから同期用メッセージMAが入力されたとき、同期用メッセージMAを認証するとともに、認証できたことを条件に「上位ビットMCH」の値を同期用メッセージMAに含まれている「上位ビットMCH」の値により更新する。また、認証子生成部33は、「上位ビットMCH」の値の更新を条件に「下位ビットMCL」の値を初期化して「0」にする。これにより「下位ビットMCL」は「0」から最大値までの範囲で更新可能に設定される。
The authenticator generation unit 33 performs a message counter synchronization process, a communication message transmission time process, and a communication message reception time process. Therefore, each process will be described in detail below.
[Message counter synchronization processing]
When the synchronization message MA is input from the MBOX 31b, the authenticator generation unit 33 authenticates the synchronization message MA, and includes the value of the “high-order bit MCH” in the synchronization message MA on condition that the synchronization message MA is authenticated. The value is updated by the value of the “high-order bit MCH” that is set. Further, the authenticator generation unit 33 initializes the value of the “lower bit MCL” to “0” on condition that the value of the “higher bit MCH” is updated. As a result, the "lower bit MCL" is set to be updatable in the range from "0" to the maximum value.

また、認証子生成部33は、同期用メッセージMAの認証を行う。認証子生成部33は、MBOX31bから入力した同期用メッセージMAから「認証子AC1」と「上位ビットMCH」を取得する。そして、認証子生成部33は、取得した「上位ビットMCH」を、暗号化エンジン35で暗号化して認証子を再生成する。そして、認証子生成部33は、再生成した認証子と同期用メッセージMAから取得した「認証子AC1」とを比較し、比較の結果が一致すれば同期用メッセージMAを認証する旨を判定し、一致しないのであれば同期用メッセージMAを認証しない旨を判定する。   Further, the authenticator generation unit 33 authenticates the synchronization message MA. The authenticator generation unit 33 acquires the “authenticator AC1” and the “high-order bit MCH” from the synchronization message MA input from the MBOX 31b. Then, the authenticator generation unit 33 encrypts the acquired “high-order bit MCH” with the encryption engine 35 and regenerates the authenticator. Then, the authenticator generation unit 33 compares the regenerated authenticator with the “authenticator AC1” acquired from the synchronization message MA, and determines that the synchronization message MA is authenticated if the comparison results match. If they do not match, it is determined that the synchronization message MA is not authenticated.

すなわち、認証子生成部33に記憶されている「上位ビットMCH」は、同期用メッセージMAが入力されることで、定期的、又は、所定の期間以内に更新される。一方、受信されていないために同期用メッセージMAが入力されないときには、同記憶されている「上位ビットMCH」は、初期値のままであったり、更新が停止されていたり、先の更新から所定の期間を超えても更新されていなかったりするなどして、「上位ビットMCH」が所定の期間初期値の状態になる。更新停止は、更新が長時間停止していることや、外部入力されたフラグ等から判定され、所定の期間は、ECU内の時計やクロック等から取得できる。   That is, the “upper bit MCH” stored in the authenticator generation unit 33 is updated periodically or within a predetermined period by the input of the synchronization message MA. On the other hand, when the synchronization message MA is not input because it has not been received, the stored “high-order bit MCH” remains the initial value, the update is stopped, or a predetermined value from the previous update. The "high-order bit MCH" is in the state of the initial value for a predetermined period because it has not been updated even if it exceeds the period. The update stop is determined from the fact that the update is stopped for a long time, a flag externally input, or the like, and can be acquired from a clock or a clock in the ECU for a predetermined period.

なお、認証子生成部33は、暗号化エンジン35を備えている。暗号化エンジン35は、暗号鍵EKが設定されており、認証子生成部33からメッセージデータDTやメッセージカウンタMCを入力し、暗号鍵EKで暗号化することで認証子を生成する。暗号鍵EKは、ゲートウェイ10と同じものが設定されていることから、第1ECU21とゲートウェイ10との間、及び、第1ECU21と第2〜4ECU22〜24との間ではそれぞれ暗号化された通信が可能である。なお、暗号鍵EKは、耐タンパメモリ等を用いて外部から取得不可能であればなおよい。   The authenticator generation unit 33 includes an encryption engine 35. The encryption engine 35 is set with the encryption key EK, inputs the message data DT and the message counter MC from the authenticator generation unit 33, and generates an authenticator by encrypting with the encryption key EK. Since the same encryption key EK as that of the gateway 10 is set, encrypted communication is possible between the first ECU 21 and the gateway 10 and between the first ECU 21 and the second to fourth ECUs 22 to 24. Is. Note that the encryption key EK is better if it cannot be acquired from the outside using a tamper resistant memory or the like.

[通信メッセージの送信時処理]
認証子生成部33は、通信メッセージMBの送信時処理として、送信する通信メッセージMBの認証子の生成処理を行う。認証子生成部33は、メッセージ処理部34から「メッセージデータDT」が入力される。認証子生成部33は、認証子の生成処理に先立ち、送受信判定部36から送信の可否を取得し、送信「否」であれば送信時処理を終了し、送信「可」であれば、以下の処理を続ける。
[Processing when sending communication message]
The authenticator generation unit 33 performs an authenticator generation process of the communication message MB to be transmitted as a process at the time of transmitting the communication message MB. The “message data DT” is input to the authenticator generation unit 33 from the message processing unit 34. The authenticator generation unit 33 acquires the permission / prohibition of transmission from the transmission / reception determination unit 36 prior to the authenticator generation process. Continue processing.

つまり、図4に示すように、認証子生成部33は、管理している「下位ビットMCL」と同期用メッセージMAから取得して保持している「上位ビットMCH」とから、メッセージカウンタMCを再構成する。そして、認証子生成部33は、暗号化エンジン35で、再構成したメッセージカウンタMCと入力されたメッセージデータDTとを暗号鍵EKで暗号化して「認証子AC2」を生成する。また、認証子生成部33は、入力した「メッセージデータDT」と、「認証子AC2」の生成に使用した「下位ビットMCL」と、生成した「認証子AC2」とをメッセージ処理部34に出力する。そして、メッセージ処理部34は、認証子生成部33から入力した「メッセージデータDT」、「下位ビットMCL」及び「認証子AC2」から送信する通信メッセージMBを生成するとともに、この生成した通信メッセージMBをMBOX31cに出力する。また、認証子生成部33は、「認証子AC2」を生成したことに対応して「下位ビットMCL」を1つ大きい値に更新する。これによって、「認証子AC2」が生成されるとき、メッセージカウンタMCが過去の値と二度と同じ値にならないようになっている。   That is, as shown in FIG. 4, the authenticator generation unit 33 sets the message counter MC based on the “lower bit MCL” that it manages and the “upper bit MCH” that it acquires and holds from the synchronization message MA. Reconstruct. Then, the authenticator generating unit 33 uses the encryption engine 35 to encrypt the reconfigured message counter MC and the input message data DT with the encryption key EK to generate an “authenticator AC2”. Further, the authenticator generation unit 33 outputs the input “message data DT”, the “lower bit MCL” used to generate the “authenticator AC2”, and the generated “authenticator AC2” to the message processing unit 34. To do. Then, the message processing unit 34 generates a communication message MB to be transmitted from the “message data DT”, the “lower bit MCL”, and the “authentication element AC2” input from the authenticator generating unit 33, and the generated communication message MB. To the MBOX 31c. Further, the authenticator generation unit 33 updates the “lower bit MCL” to a value larger by 1 in response to the generation of the “authenticator AC2”. As a result, when the "certifier AC2" is generated, the message counter MC does not become the same value as the past value.

[通信メッセージの受信時処理]
認証子生成部33は、通信メッセージMBの受信時処理として、受信した通信メッセージMBの認証処理を行う。認証子生成部33は、認証処理に先立ち、送受信判定部36から受信の可否を取得し、受信「否」であれば認証処理を終了し、受信「可」であれば、以下の処理を続ける。認証処理では、「認証子AC2」に基づく認証を行う。
[Processing when receiving communication message]
The authenticator generation unit 33 performs the authentication process of the received communication message MB as the process at the time of receiving the communication message MB. Prior to the authentication process, the authenticator generation unit 33 acquires the acceptance / rejection of reception from the transmission / reception determination unit 36, terminates the authentication process if the reception is “No”, and continues the following process if the reception is “Yes”. . In the authentication process, the authentication based on the "authenticator AC2" is performed.

つまり、図5に示すように、認証子生成部33には、メッセージ処理部34から受信した通信メッセージMBの「メッセージデータDT」と、メッセージカウンタMCのうちの「下位ビットMCL」と、「認証子AC2」とが入力される。認証子生成部33は、入力された「下位ビットMCL」と、保持している「上位ビットMCH」とから、メッセージカウンタMCを再構成するとともに、暗号化エンジン35で、再構成したメッセージカウンタMCと入力された「メッセージデータDT」とを暗号鍵EKで暗号化して「認証子AC3」を再生成する。また、認証子生成部33は、入力した「認証子AC2」と、再生成した「認証子AC3」とを比較して、一致すれば認証する旨を判定し、一致しないのであれば認証しない旨を判定する。そして、認証子生成部33は、認証の判定結果をメッセージ処理部34に出力する。つまり、メッセージ処理部34は、受信「可」であり、かつ、認証された通信メッセージMBの「メッセージデータDT」を情報処理部32に出力する一方、受信「否」であったり、認証されなかった通信メッセージMBの「メッセージデータDT」を破棄する。   That is, as shown in FIG. 5, the authenticator generation unit 33 includes the “message data DT” of the communication message MB received from the message processing unit 34, the “lower bit MCL” of the message counter MC, and the “authentication”. Child AC2 ”is input. The authenticator generation unit 33 reconfigures the message counter MC from the input “lower bit MCL” and the held “upper bit MCH”, and also reconfigures the message counter MC by the encryption engine 35. The "message data DT" input with is encrypted with the encryption key EK to regenerate the "certifier AC3". Further, the authenticator generation unit 33 compares the input “authenticator AC2” with the regenerated “authenticator AC3” and determines that the authentication is performed. If they do not match, the authentication is not performed. To judge. Then, the authenticator generation unit 33 outputs the authentication determination result to the message processing unit 34. In other words, the message processing unit 34 outputs “message data DT” of the communication message MB that has been received “Yes” and that has been authenticated, to the information processing unit 32, while receiving “No” or has not been authenticated. The "message data DT" of the communication message MB that has been deleted is discarded.

本実施形態の通信システムの動作を説明する。
ここでは説明の便宜上、通信メッセージMBは、第1ECU21から送信されて、第3ECU23に受信されるものとする。
The operation of the communication system of this embodiment will be described.
Here, for convenience of explanation, it is assumed that the communication message MB is transmitted from the first ECU 21 and received by the third ECU 23.

[上位ビットの更新]
図6及び図7には、ECU21〜24の認証子生成部33が保持しているメッセージカウンタMCのうちの「上位ビットMCH」を更新する手順を示す。この手順は、ゲートウェイ10やECU21〜24で所定の周期毎、又は所定の条件が成立する毎に実行が開始される。
[Upper bit update]
6 and 7 show a procedure for updating the “upper bit MCH” of the message counter MC held by the authenticator generating unit 33 of the ECU 21 to 24. This procedure is started in the gateway 10 or the ECUs 21 to 24 every predetermined cycle or every time a predetermined condition is satisfied.

図6に示すように、ゲートウェイ10は、同期用メッセージMAを送信するタイミングであるか否かを判定する(図6のステップS10)。送信するタイミングは、例えば、メッセージカウンタMCのうちの「上位ビットMCH」がゲートウェイ10のコード管理部11により更新されたとき等である。送信するタイミングではないと判定した場合(図6のステップS10でNO)、上位ビットを更新する処理が一旦終了される。   As shown in FIG. 6, the gateway 10 determines whether or not it is time to transmit the synchronization message MA (step S10 in FIG. 6). The transmission timing is, for example, when the “upper bit MCH” of the message counter MC is updated by the code management unit 11 of the gateway 10. When it is determined that it is not the transmission timing (NO in step S10 in FIG. 6), the process of updating the upper bits is temporarily terminated.

一方、送信するタイミングであると判定した場合(図6のステップS10でYES)、ゲートウェイ10は、「同期用メッセージMA」を全ECU21〜24に送信する(図6のステップS11)。そして、上位ビットを更新する処理は一旦終了する。   On the other hand, when it is determined that it is the transmission timing (YES in step S10 in FIG. 6), the gateway 10 transmits the “synchronization message MA” to all the ECUs 21 to 24 (step S11 in FIG. 6). Then, the process of updating the high-order bits ends once.

図7に示すように、各ECU21〜24は、同期用メッセージMAを受信したか否かを判定する(図7のステップS20)。同期用メッセージMAを受信していないと判定した場合(図7のステップS20でNO)、上位ビットを更新する処理は一旦終了する。一方、同期用メッセージMAを受信したと判定した場合(図7のステップS20でYES)、各ECU21〜24は、受信した同期用メッセージMAの「認証子AC1」を認証する(図7のステップS21)。「認証子AC1」の認証は、認証子生成部33で再生成した認証子との比較で行われ、比較の結果が一致すれば認証される一方、比較の結果が一致しなければ認証されない。同期用メッセージMAの「認証子AC1」を認証できない場合(図7のステップS21でNO)、上位ビットを更新する処理は一旦終了する。   As shown in FIG. 7, each of the ECUs 21 to 24 determines whether or not the synchronization message MA is received (step S20 in FIG. 7). When it is determined that the synchronization message MA has not been received (NO in step S20 of FIG. 7), the process of updating the upper bit ends once. On the other hand, when it is determined that the synchronization message MA is received (YES in step S20 of FIG. 7), each of the ECUs 21 to 24 authenticates the “authenticator AC1” of the received synchronization message MA (step S21 of FIG. 7). ). The authentication of the "authentication element AC1" is performed by comparison with the authentication code regenerated by the authentication code generation unit 33. If the comparison result matches, the authentication is performed, whereas if the comparison result does not match, the authentication is not performed. If the “authenticator AC1” of the synchronization message MA cannot be authenticated (NO in step S21 of FIG. 7), the process of updating the high-order bit ends once.

一方、同期用メッセージMAの認証子AC1を認証した場合(図7のステップS21でYES)、各ECU21〜24は、記憶しているメッセージカウンタMCのうちの「上位ビットMCH」を更新する(図7のステップS22)。そして、上位ビットを更新する処理は一旦終了する。   On the other hand, when the authenticator AC1 of the synchronization message MA is authenticated (YES in step S21 of FIG. 7), each of the ECUs 21 to 24 updates the “upper bit MCH” of the stored message counter MC (FIG. Step S22 of 7.). Then, the process of updating the high-order bits ends once.

[通信メッセージの送信処理]
図8に示す、通信メッセージの送信処理は、所定の周期で繰り返し実行される、又は、メッセージデータDTの生成に応じて実行される。
[Communication message sending process]
The communication message transmission process shown in FIG. 8 is repeatedly executed at a predetermined cycle, or is executed in response to the generation of the message data DT.

図8に示すように、第1ECU21には、メッセージの送信要求として、情報処理部32で生成された「メッセージデータDT」がメッセージ処理部34に入力される(図8のステップS30)。第1ECU21では、メッセージ処理部34が実行する「メッセージデータDT」についての送信可否の判定結果を送受信判定部36から取得する。すなわち、送受信判定部36では、同期用メッセージMAを受信しているか否かが判定される(図8のステップS31)。ここで、同期用メッセージMAを受信しているか否かは、同期用メッセージMAに対応するメッセージIDを有する通信メッセージが受信されたか否か、及び、同期用メッセージMAが受信されて「上位ビットMCH」が適切に更新されているか否かの少なくとも一方によって判定される。よって、同期用メッセージMAが受信できていないことは、同期用メッセージMAに対応するメッセージIDを有する通信メッセージが受信されていないこと、及び、同期用メッセージMAが受信されていても「上位ビットMCH」が適切に更新されていないことの少なくとも一方に基づいて判定される。また、受信しているか否かは、第1ECU21が電源投入後やリセットされた後、又は、所定の条件の後であることに基づいて判定される。そして、所定の条件とは、ゲートウェイ10がリセットされたことや、通信が途絶したこと等である。また、適切に更新されていることは、「上位ビットMCH」が初期値から変更されていること、更新が停止されていないこと、及び、定期的に更新されていることに基づいて判定される。同期用メッセージを受信していないと判定した場合(図8のステップS31でNO)、第1ECU21は、メッセージ処理部34で「メッセージデータDT」をキューイングする、又は破棄する(図8のステップS32)。そして一旦、通信メッセージの送信処理が終了する。なお、キューイングされた「メッセージデータDT」は、所定の時間経過後に再度、メッセージの送信要求として再度処理されて、いわゆる送信がリトライされる。   As shown in FIG. 8, in the first ECU 21, “message data DT” generated by the information processing unit 32 is input to the message processing unit 34 as a message transmission request (step S30 in FIG. 8). The first ECU 21 acquires from the transmission / reception determination unit 36 the determination result of the transmission permission / inhibition for the “message data DT” executed by the message processing unit 34. That is, the transmission / reception determination unit 36 determines whether or not the synchronization message MA is received (step S31 in FIG. 8). Here, whether or not the synchronization message MA is received is determined by whether or not a communication message having a message ID corresponding to the synchronization message MA is received, and whether or not the synchronization message MA is received and the “high-order bit MCH is received. Is determined to be appropriately updated or not. Therefore, the fact that the synchronization message MA has not been received means that the communication message having the message ID corresponding to the synchronization message MA has not been received, and even if the synchronization message MA has been received, the “high-order bit MCH Is not updated appropriately and is determined based on at least one of the above. Further, whether or not it is received is determined based on that the first ECU 21 is powered on, reset, or after a predetermined condition. The predetermined condition is that the gateway 10 has been reset, communication has been interrupted, or the like. Further, the fact that the update is appropriately performed is determined based on that the “high-order bit MCH” has been changed from the initial value, that the update has not been stopped, and that it has been updated regularly. . When it is determined that the synchronization message has not been received (NO in step S31 in FIG. 8), the first ECU 21 queues or discards the “message data DT” in the message processing unit 34 (step S32 in FIG. 8). ). Then, the transmission processing of the communication message is once ended. The queued “message data DT” is processed again as a message transmission request after a predetermined time has passed, and so-called transmission is retried.

一方、同期用メッセージを受信していると判定した場合(図8のステップS31でYES)、第1ECU21は、メッセージ処理部34に保持している送信要求を認証子生成部33に送る(図8のステップS33)。つまり、メッセージ処理部34から認証子生成部33に「メッセージデータDT」が送られる。そして、図4も併せて参照すると、第1ECU21は、認証子生成部33で「メッセージデータDT」とメッセージカウンタMCとに基づいて「識別子AC2」を生成する(図8のステップS34)。また、第1ECU21は、「識別子AC2」を生成したときの「メッセージデータDT」及びメッセージカウンタMCのうちの「下位ビットMCL」と、生成した「識別子AC2」とから通信メッセージMBを生成する(図8のステップS35)とともに、この生成した通信メッセージMBを通信用バスL1に送信する(図8のステップS36)。通信用バスL1に送信された通信メッセージMBは、ゲートウェイ10で通信用バスL1から通信用バスL2に転送されて、通信用バスL2に接続されている第3ECU23で受信できるようになる。そして、第1ECU21は、通信メッセージの送信処理を一旦終了する。   On the other hand, when it is determined that the synchronization message has been received (YES in step S31 of FIG. 8), the first ECU 21 sends the transmission request held in the message processing unit 34 to the authenticator generation unit 33 (FIG. 8). Step S33). That is, the “message data DT” is sent from the message processing unit 34 to the authenticator generation unit 33. Then, referring also to FIG. 4, the first ECU 21 causes the authenticator generation unit 33 to generate an “identifier AC2” based on the “message data DT” and the message counter MC (step S34 in FIG. 8). Further, the first ECU 21 generates the communication message MB from the “message data DT” when the “identifier AC2” is generated, the “lower bit MCL” of the message counter MC, and the generated “identifier AC2” (FIG. 8, and the generated communication message MB is transmitted to the communication bus L1 (step S36 of FIG. 8). The communication message MB transmitted to the communication bus L1 is transferred from the communication bus L1 to the communication bus L2 by the gateway 10 and can be received by the third ECU 23 connected to the communication bus L2. Then, the first ECU 21 once ends the communication message transmission process.

[通信メッセージの受信処理]
図9に示す、通信メッセージの受信処理は、所定の周期で繰り返し実行される、又は、通信メッセージの受信に応じて実行される。
[Communication message reception processing]
The communication message receiving process shown in FIG. 9 is repeatedly executed at a predetermined cycle, or is executed in response to the reception of the communication message.

図9に示すように、第3ECU23は、受信した通信メッセージMBをメッセージ処理部34で取得したことに基づいて、送受信判定部36で同期用メッセージMAを受信しているか否かを判定する(図9のステップS40)。ここで、同期用メッセージMAを受信しているか否かは、図8のステップS31の処理と同様に、同期用メッセージMAに対応するメッセージIDが受信されたか否か、及び、同期用メッセージMAが受信されて「上位ビットMCH」が適切に更新されているか否かの少なくとも一方に基づいて判定される。よって、同期用メッセージMAが受信できていないことは、同期用メッセージMAに対応するメッセージIDを有する通信メッセージが受信されていないこと、及び、同期用メッセージMAが受信されていても「上位ビットMCH」が適切に更新されていないことの少なくとも一方に基づいて判定される。また、受信しているか否かは、第3ECU23が電源投入後やリセットされた後、又は、所定の条件の後であることに基づいて判定される。そして、所定の条件とは、ゲートウェイ10がリセットされたことや、通信が途絶したこと等である。同期用メッセージMAを受信していないと判定した場合(図9のステップS40でNO)、第3ECU23は、メッセージ処理部34で受信した「メッセージデータDT」を破棄するとともに、認証失敗を情報処理部32のアプリケーションに通知する(図9のステップS45)。そして、第3ECU23は、通信メッセージの受信処理を一旦終了する。   As shown in FIG. 9, the third ECU 23 determines whether or not the transmission / reception determination unit 36 has received the synchronization message MA, based on the fact that the message processing unit 34 has acquired the received communication message MB (FIG. 9 step S40). Here, whether or not the synchronization message MA is received is determined by whether or not the message ID corresponding to the synchronization message MA is received and whether or not the synchronization message MA is received, as in the process of step S31 of FIG. It is determined based on at least one of whether or not the “high-order bit MCH” is received and appropriately updated. Therefore, the synchronization message MA is not received, the communication message having the message ID corresponding to the synchronization message MA is not received, and even if the synchronization message MA is received, the “high-order bit MCH Is not updated appropriately and is determined based on at least one of the above. Further, whether or not it is received is determined based on that the third ECU 23 is powered on, reset, or after a predetermined condition. The predetermined condition is that the gateway 10 has been reset, communication has been interrupted, or the like. When it is determined that the synchronization message MA has not been received (NO in step S40 in FIG. 9), the third ECU 23 discards the “message data DT” received by the message processing unit 34, and at the same time determines that the authentication failure has occurred in the information processing unit. The 32 applications are notified (step S45 of FIG. 9). Then, the third ECU 23 once ends the communication message reception process.

一方、同期用メッセージMAを受信していると判定した場合(図9のステップS40でYES)、図5を併せて参照すると、第3ECU23は、認証子生成部33で通信メッセージMBから「メッセージデータDT」と、メッセージカウンタMCのうちの「下位ビットMCL」と、「識別子AC2」とを取得する(図9のステップS41)。また、第3ECU23は、認証子生成部33でメッセージカウンタMCのうちの「下位ビットMCL」と、同期用メッセージMAから事前に取得したメッセージカウンタMCのうちの「上位ビットMCH」とからメッセージカウンタMCを再構成する。そして、第3ECU23は、暗号化エンジン35で「メッセージデータDT」と再構成したメッセージカウンタMCとから「認証子AC3」を再生成する(図9のステップS42)。続いて、第3ECU23は、認証子生成部33で、取得した「識別子AC2」と再生成した「認証子AC3」とを比較して一致するか否か判定する(図9のステップS43)。   On the other hand, when it is determined that the synchronization message MA is received (YES in step S40 of FIG. 9), referring also to FIG. 5, the third ECU 23 causes the authenticator generation unit 33 to output “message data” from the communication message MB. DT "," lower bit MCL "of the message counter MC, and" identifier AC2 "are acquired (step S41 in FIG. 9). Further, the third ECU 23 determines the message counter MC from the “lower bit MCL” of the message counter MC in the authenticator generating unit 33 and the “upper bit MCH” of the message counter MC previously acquired from the synchronization message MA. Reconfigure. Then, the third ECU 23 regenerates the "certifier AC3" from the "message data DT" and the reconstructed message counter MC in the encryption engine 35 (step S42 in FIG. 9). Subsequently, the 3ECU23 compares the acquired "identifier AC2" with the regenerated "authentication AC3" in the authenticator generation unit 33 and determines whether or not they match (step S43 in Fig. 9).

一致すると判定された場合(図9のステップS43でYES)、第3ECU23は、「メッセージデータDT」を情報処理部32のアプリケーションに送る(図9のステップS44)。一方、一致しないと判定された場合、(図9のステップS43でNO)、第3ECU23は、上述したステップS45の処理、つまり、メッセージ処理部34で受信したメッセージデータDTを破棄するとともに、認証失敗を情報処理部32のアプリケーションに通知する処理を行う。そして、第3ECU23は、通信メッセージの受信処理を一旦終了する。   When it is determined that they match (YES in step S43 of FIG. 9), the third ECU 23 sends “message data DT” to the application of the information processing section 32 (step S44 of FIG. 9). On the other hand, when it is determined that they do not match (NO in step S43 of FIG. 9), the third ECU 23 discards the message data DT received by the process of step S45 described above, that is, the message processing unit 34, and fails the authentication. Is notified to the application of the information processing unit 32. Then, the third ECU 23 once ends the communication message reception process.

これにより、通信メッセージMBがなりすましなどで送信された不正なものである場合、この不正な通信メッセージMBに含まれている「メッセージデータDT」が情報処理部32へ送られ、処理されることが防がれるようになる。   As a result, when the communication message MB is an unauthorized one transmitted by spoofing or the like, the “message data DT” included in this unauthorized communication message MB may be sent to the information processing unit 32 and processed. You will be prevented.

以上説明したように、本実施形態に係る通信システムによれば、以下に示すような効果が得られるようになる。
(1)通信メッセージMBにはメッセージカウンタMCのうちの「下位ビットMCL」だけが含まれることとなり、メッセージデータのために多くの領域を確保することができる。また、「上位ビットMCH」は、ゲートウェイ10によって管理されることから、各ECU21〜24のそれぞれの間で同期されるようにもなる。つまり、受信側の各ECU21〜24は、ゲートウェイ10からの「上位ビットMCH」と、通信メッセージMBに含まれる「下位ビットMCL」とを組み合わせることで、送信側の各ECU21〜24で「認証子AC2」の生成に利用されたメッセージカウンタMCを再構成することができる。これにより、メッセージカウンタMCの大きさを信頼性の確保に必要とされるサイズにしたとしても、通信メッセージMBの格納に要する容量を少なく抑えて、メッセージデータのための容量の減少を抑制することができる。これにより、通信量の増大を抑えつつ、通信メッセージMBの信頼性を確保することができるようになる。
As described above, according to the communication system of this embodiment, the following effects can be obtained.
(1) Since the communication message MB includes only the "lower bit MCL" of the message counter MC, a large area can be reserved for the message data. Further, since the “high-order bit MCH” is managed by the gateway 10, the “upper bit MCH” is also synchronized among the respective ECUs 21 to 24. That is, each of the ECUs 21 to 24 on the receiving side combines the “upper bit MCH” from the gateway 10 with the “lower bit MCL” included in the communication message MB, so that each of the ECUs 21 to 24 on the transmitting side “authenticates”. The message counter MC used to generate "AC2" can be reconfigured. As a result, even if the size of the message counter MC is set to the size required for ensuring reliability, the capacity required for storing the communication message MB is suppressed to be small, and the decrease in capacity for message data is suppressed. You can As a result, it becomes possible to secure the reliability of the communication message MB while suppressing an increase in communication volume.

(2)ゲートウェイ10から送信されたメッセージカウンタMCのうちの「上位ビットMCH」が受信されることによって、各ECU21〜24に記憶されているメッセージカウンタMCのうちの「上位ビットMCH」が、受信したメッセージカウンタMCのうちの「上位ビットMCH」に更新されて、すなわち同期される。これにより、メッセージカウンタMCが「上位ビットMCH」と「下位ビットMCL」とに2分割されたとしても、通信メッセージMBをメッセージカウンタMCによって認証することが可能になる。   (2) By receiving the “upper bit MCH” of the message counter MC transmitted from the gateway 10, the “upper bit MCH” of the message counter MC stored in each of the ECUs 21 to 24 is received. The higher-order bit MCH of the message counter MC is updated, that is, synchronized. As a result, even if the message counter MC is divided into "upper bit MCH" and "lower bit MCL", the communication message MB can be authenticated by the message counter MC.

また、各ECU21〜24に記憶されているメッセージカウンタMCのうちの「上位ビットMCH」を同期させることができる。よって、各ECU21〜24に記憶されているメッセージカウンタMCのうちの「上位ビットMCH」がECU21〜24のリセット等により非同期に初期化されたりしたとしても、記憶しているメッセージカウンタMCが正常な値に設定し直されることで、認証を正常に行うことが可能にもなる。   In addition, the “upper bit MCH” of the message counter MC stored in each of the ECUs 21 to 24 can be synchronized. Therefore, even if the “upper bit MCH” of the message counters MC stored in each of the ECUs 21 to 24 is asynchronously initialized due to reset of the ECUs 21 to 24, the stored message counters MC are normal. By setting the value again, it becomes possible to perform authentication normally.

(3)「メッセージID」の別にメッセージカウンタMCが管理されるので、メッセージカウンタMCの大きさが抑えられる。また、「メッセージID」の別であればメッセージカウンタMCのうちの「下位ビットMCL」の更新にも時間的な余裕が得られるようになることからメッセージカウンタMCの同期の自由度も高められる。   (3) Since the message counter MC is managed for each "message ID", the size of the message counter MC can be suppressed. In addition, if the "message ID" is different, a time margin can be obtained for updating the "lower bit MCL" of the message counter MC, so that the degree of freedom of synchronization of the message counter MC is increased.

(4)同期用メッセージMAで送信されるメッセージカウンタMCのうちの「上位ビットMCH」を暗号鍵EKを用いて暗号化して得られる「認証子AC1」を利用することで、ゲートウェイ10から同期用メッセージMAで送信されるメッセージカウンタMCのうちの「上位ビットMCH」についても、その通信内容の信頼性が維持されるようになる。   (4) By using the “certifier AC1” obtained by encrypting the “high-order bit MCH” of the message counter MC transmitted in the synchronization message MA using the encryption key EK, the synchronization is transmitted from the gateway 10 The reliability of the communication content of the "upper bit MCH" of the message counter MC transmitted by the message MA is maintained.

すなわち、ゲートウェイ10から同期用メッセージMAで送信される「認証子AC1」は、メッセージカウンタMCのうちの「上位ビットMCH」から生成された「認証子AC1」である。このため、この同期用メッセージMAを受信した各ECU21〜24においても、同期用メッセージMAで送信された「認証子AC1」と、この同期用メッセージMAで送信されるメッセージカウンタMCのうちの「上位ビットMCH」から再生成した認証子とが取得でき、これら認証子の比較で、同期用メッセージMAの認証が可能になる。よって、各ECU21〜24は、ゲートウェイ10からの同期用メッセージMAを受信することで、信頼性の確保されたメッセージカウンタMCのうちの「上位ビットMCH」を取得し、これに基づく同期用メッセージMAの認証を行うことができるようになる。   That is, the “certifier AC1” transmitted from the gateway 10 in the synchronization message MA is the “certifier AC1” generated from the “upper bit MCH” of the message counter MC. Therefore, also in each of the ECUs 21 to 24 that have received this synchronization message MA, the “certifier AC1” transmitted in the synchronization message MA and the “upper order” of the message counter MC transmitted in this synchronization message MA. The authenticator regenerated from the bit MCH ”can be acquired, and the authentication of the synchronization message MA becomes possible by comparing these authenticators. Therefore, each of the ECUs 21 to 24 receives the synchronization message MA from the gateway 10 to acquire the “upper bit MCH” of the message counter MC whose reliability is ensured, and the synchronization message MA based on this. Will be able to authenticate.

(5)メッセージカウンタMCの値が重複することがないように更新されるので、一度送信された通信メッセージMBが再送信されたとしてもこれを無効と判断することができるようになる。   (5) Since the value of the message counter MC is updated so as not to be duplicated, even if the communication message MB once transmitted is retransmitted, it can be determined to be invalid.

(6)認証子AC1,AC2の信頼性、つまり通信メッセージMBの信頼性が共通の暗号鍵EKにより確保される。耐タンパメモリ等を用いて暗号鍵EKを外部から取得不可能にすればなおよい。   (6) The reliability of the authenticators AC1 and AC2, that is, the reliability of the communication message MB is secured by the common encryption key EK. It is better if the encryption key EK cannot be acquired from the outside by using a tamper resistant memory or the like.

(7)第1ECU21は、メッセージカウンタMCの「上位ビットMCH」を受信できていないことに基づいて通信メッセージMBを送信しない、及び、第3ECU23はメッセージカウンタMCの「上位ビットMCH」を受信できていないことに基づいて受信した通信メッセージMBを認証しないことの少なくとも一方を行う。つまり、メッセージカウンタMCの「上位ビットMCH」が第1ECU21及び第3ECU23のそれらの間で同期されていないとき、通信メッセージMBが送信されない、又は、認証されない。これにより、時変パラメータであるメッセージカウンタMCを利用して通信メッセージMBの信頼性を確保する場合であっても、メッセージカウンタMCの「上位ビットMCH」が受信されていないことに起因して通信メッセージMBに対して不正であるとする判定がなされることが防止される。すなわち、通信メッセージMBの正/不正が適切に判断されるようになる。   (7) The first ECU 21 does not transmit the communication message MB based on the failure to receive the “upper bit MCH” of the message counter MC, and the third ECU 23 has received the “upper bit MCH” of the message counter MC. At least one of not authenticating the received communication message MB based on the absence. That is, when the “upper bit MCH” of the message counter MC is not synchronized between those of the first ECU 21 and the third ECU 23, the communication message MB is not transmitted or is not authenticated. As a result, even when the reliability of the communication message MB is ensured by using the message counter MC which is a time-varying parameter, the communication is caused by the fact that the “upper bit MCH” of the message counter MC is not received. It is prevented that the message MB is determined to be invalid. That is, the correctness / incorrectness of the communication message MB can be properly determined.

(その他の実施形態)
なお、上記実施形態は、以下の態様で実施することもできる。
[同期用メッセージ]
・上記実施形態では、メッセージカウンタが同期用メッセージで送信される場合について例示した。このとき、1つのメッセージIDに対して、同期用メッセージに用いるメッセージIDを1つずつ設けるようにしてもよい。この場合、通信システム全体としてメッセージIDの数が2倍以上になるおそれがある。
(Other embodiments)
In addition, the above-mentioned embodiment can also be implemented in the following modes.
[Synchronization message]
In the above embodiment, the case where the message counter is transmitted by the synchronization message is illustrated. At this time, one message ID used for the synchronization message may be provided for each message ID. In this case, the number of message IDs may be doubled or more in the entire communication system.

また、すべてのメッセージIDに対して、同期用メッセージに用いるメッセージIDを1つだけ設けるようにしてもよい。この場合、通信システム全体としてメッセージIDの数が1つ増えるだけである。さらに、全部よりも少ない複数のメッセージIDに対して、同期用メッセージに用いるメッセージIDを1つずつ設けるようにしてもよい。すなわち、同期用メッセージを共用することができれば、数に限りのあるメッセージIDのなかから同期用メッセージに割り当てるメッセージIDの数を少なく抑えることができる。メッセージIDの数が少なく抑えられれば、メッセージIDやメッセージデータを記憶するための領域の増加の抑制、処理負荷の増大の抑制、通信負荷の増大の抑制等も図られる。   Further, for all the message IDs, only one message ID used for the synchronization message may be provided. In this case, the number of message IDs in the entire communication system increases by one. Further, one message ID used for the synchronization message may be provided for a plurality of message IDs that are less than all. That is, if the synchronization message can be shared, the number of message IDs assigned to the synchronization message can be reduced from the limited number of message IDs. If the number of message IDs is suppressed to a small number, it is possible to suppress an increase in area for storing message IDs and message data, suppress an increase in processing load, suppress an increase in communication load, and the like.

[ゲートウェイ]
・上記実施形態では、ゲートウェイ10は、複数の通信用バスL1,L2の間における通信メッセージを中継する場合について例示した。しかしこれに限らず、ゲートウェイは、1つの通信用バスに接続されていてもよいし、2つよりも多い通信用バスの間に通信メッセージを中継してもよい。
[gateway]
In the above embodiment, the gateway 10 exemplifies the case where the communication message is relayed between the plurality of communication buses L1 and L2. However, the present invention is not limited to this, and the gateway may be connected to one communication bus or may relay a communication message between more than two communication buses.

・上記実施形態では、ゲートウェイ10が同期用メッセージMAを管理して送信する場合について例示した。しかしこれに限らず、ECUが同期用メッセージを管理して送信してもよい。   In the above embodiment, the case where the gateway 10 manages and transmits the synchronization message MA has been illustrated. However, the present invention is not limited to this, and the ECU may manage and transmit the synchronization message.

・上記実施形態では、1つのゲートウェイ10が同期用メッセージMAを管理して送信する場合について例示した。しかしこれに限らず、複数のゲートウェイやECUが同期用メッセージを分担して管理してもよい。   In the above embodiment, the case where one gateway 10 manages and transmits the synchronization message MA has been illustrated. However, the present invention is not limited to this, and a plurality of gateways or ECUs may share and manage the synchronization message.

・上記実施形態では、コード管理部11は、メッセージカウンタMCのうちの「上位ビットMCH」を記憶、管理する場合について例示した。しかしこれに限らず、コード管理部は、メッセージカウンタMCの全長を保持していてもよい。そして、メッセージカウンタMCの「上位ビットMCH」に対応するビット部分を管理するようにしてもよい。なお、メッセージカウンタMCのうちの「下位ビットMCL」は最新の値を通信メッセージMBから取得してもよい。   In the above embodiment, the code management unit 11 exemplifies the case of storing and managing the “upper bit MCH” of the message counter MC. However, the present invention is not limited to this, and the code management unit may hold the entire length of the message counter MC. Then, the bit portion corresponding to the “upper bit MCH” of the message counter MC may be managed. The "lower bit MCL" of the message counter MC may acquire the latest value from the communication message MB.

・上記実施形態では、送信部12はメッセージカウンタMCの一部を送信する場合について例示した。しかしこれに限らず、ゲートウェイがメッセージカウンタの全体を保持していれば、送信部は同期用メッセージでメッセージカウンタの全体(全ビット数)を送信してもよい。なお、同期用メッセージを受信したECUは、メッセージカウンタの全体(全ビット数)のうちから上位ビットに対応する部分だけを利用すればよい。   In the above embodiment, the case where the transmission unit 12 transmits a part of the message counter MC has been illustrated. However, the present invention is not limited to this, and if the gateway holds the entire message counter, the transmitting unit may transmit the entire message counter (the total number of bits) as a synchronization message. Note that the ECU that receives the synchronization message may use only the portion corresponding to the higher-order bits of the entire message counter (total number of bits).

[通信プロトコル]
・上記実施形態では、通信プロトコルがCANプロトコルである場合について例示した。しかしこれに限らず、通信メッセージの信頼性確保にメッセージカウンタを用いるのであれば、通信プロトコルは、CANプロトコル以外のプロトコル、例えば、イーサーネット(登録商標)やフレックスレイ(登録商標)などの通信プロトコルであってもよい。
[Communication protocol]
In the above embodiment, the case where the communication protocol is the CAN protocol has been illustrated. However, the communication protocol is not limited to this, and if a message counter is used to secure the reliability of the communication message, the communication protocol is a protocol other than the CAN protocol, for example, a communication protocol such as Ethernet (registered trademark) or FlexRay (registered trademark). May be

[メッセージカウンタ]
・上記実施形態では、メッセージカウンタMCが「下位ビットMCL」と「上位ビットMCH」とからなる場合について例示した。しかしこれに限らず、メッセージカウンタは、ビット列のうち上位ビットとする位置と、下位ビットとする位置とが逆になってもよいし、別に確保された記憶領域をそれぞれ上位ビット用と下位ビット用として扱うようにしてもよい。
[Message Counter]
In the above embodiment, the case where the message counter MC is composed of the “lower bit MCL” and the “upper bit MCH” has been illustrated. However, the present invention is not limited to this, and the message counter may have the positions of the high-order bits and the low-order bits of the bit string reversed, and separately reserved storage areas for the high-order bits and the low-order bits, respectively. May be treated as

・上記実施形態では、メッセージカウンタMCの長さが8バイト(64ビット)である場合について例示した。しかしこれに限らず、二度と同じ値が繰り返されないか、又は、同じ値が繰り返されるにしても長時間の時間間隔が確保できれば、メッセージカウンタの長さは、64ビットよも長い124ビット等や、逆に、64ビットよも短い32ビット等であってもよい。   In the above embodiment, the case where the length of the message counter MC is 8 bytes (64 bits) has been illustrated. However, not limited to this, if the same value is never repeated, or if a long time interval can be secured even if the same value is repeated, the length of the message counter is 124 bits, which is longer than 64 bits. On the contrary, 32 bits shorter than 64 bits may be used.

・上記実施形態では、コード管理部11は、「下位ビットMCL」が最大値になることに応じて「上位ビットMCH」を更新する場合、いわゆる、ビット列において桁上がりが生じることと同様の態様について例示した。しかしこれに限らず、コード管理部はさらに、同期用メッセージMAを送信する所定の条件が成立することに応じて「上位ビットMCH」を更新してもよい。所定の条件には、イグニッションが「オフ」から「オン」された場合や、先の同期用メッセージを更新(送信)した時点から所定の時間(例えば、Ymsec:Yは設定可能な値)が経過した場合等の1又は複数の条件、及び、それらの条件の組み合わせからなる条件とすることができる。   In the above embodiment, the code management unit 11 updates the “higher-order bit MCH” in response to the “lower-order bit MCL” reaching the maximum value, which is similar to the case where a carry occurs in the bit string. Illustrated. However, the present invention is not limited to this, and the code management unit may further update the “upper bit MCH” when a predetermined condition for transmitting the synchronization message MA is satisfied. The predetermined condition is that a predetermined time (for example, Ymsec: Y is a settable value) has elapsed since the ignition was switched from "off" to "on" or when the previous synchronization message was updated (transmitted). In such a case, one or a plurality of conditions and a combination of these conditions can be used.

・上記実施形態では、メッセージカウンタMCの「下位ビットMCL」が「0」から最大値まで変化したことに応じてゲートウェイ10で「上位ビットMCH」の値が「1」だけ増加される(単調増加される)場合について例示した。しかしこれに限らず、メッセージカウンタMCが二度と同じ値にならないようにできるのであれば、「下位ビットMCL」が最大値を超えるよりも以前のタイミングを更新タイミングとして「上位ビットMCH」を更新してもよい。このとき、できるだけ「下位ビットMCL」の最大値に近い値であるときを更新タイミングとすれば、メッセージカウンタMCのビット数を有効に利用できるようになる。例えば、コード管理部で、ECUが送信する通信メッセージを受信することでメッセージカウンタのうちの「下位ビットMCL」を監視し、この「下位ビットMCL」が最大値未満に設定された閾値である更新値以上になったときを更新タイミングにするようにすればよい。   In the above embodiment, the value of the “upper bit MCH” is increased by “1” in the gateway 10 in response to the change of the “lower bit MCL” of the message counter MC from “0” to the maximum value (monotonically increasing). )) Case. However, the present invention is not limited to this, and if it is possible to prevent the message counter MC from reaching the same value again, the “upper bit MCH” is updated with the timing before the “lower bit MCL” exceeds the maximum value as the update timing. Good. At this time, if the update timing is set to a value that is as close to the maximum value of the “lower bit MCL” as possible, the number of bits of the message counter MC can be effectively used. For example, the code management unit monitors the “lower bit MCL” of the message counter by receiving the communication message transmitted by the ECU, and the “lower bit MCL” is a threshold value set to be less than the maximum value. The update timing may be set when the value becomes equal to or more than the value.

・上記実施形態では、メッセージカウンタMCのうちの「下位ビットMCL」が初期値の「0」から最大値に向けて変化する場合について例示した。しかしこれに限らず、初期値を「0」より大きい値に設定し、最大値の次に「0」に戻して初期値の手前の値まで変化させるようにしてもよい。   In the above embodiment, the case where the “lower bit MCL” of the message counter MC changes from the initial value “0” toward the maximum value is illustrated. However, the present invention is not limited to this, and the initial value may be set to a value larger than “0”, returned to “0” after the maximum value, and changed to a value before the initial value.

・上記実施形態では、メッセージカウンタMCは通信メッセージが送信される都度、値が「1」ずつ増加される場合について例示した。しかしこれに限らず、通信メッセージの信頼性が確保されるのであれば、メッセージカウンタは、例えば、二度と同じ値を使用しないように最大値から「0」まで減少してもよいし、不規則な変化をしてもよい。なお、上位ビットと下位ビットとは別々に管理されることから、上位ビットの変化態様と下位ビットの変化態様とは同一であってもよいし、別々であってもよい。   In the above embodiment, the message counter MC is illustrated as a case where the value is incremented by "1" each time a communication message is transmitted. However, the present invention is not limited to this, and if the reliability of the communication message is ensured, the message counter may be decreased from the maximum value to “0” so that the same value is never used again, or irregular. You may change. Since the high-order bit and the low-order bit are managed separately, the change mode of the high-order bit and the change mode of the low-order bit may be the same or may be different.

・上記実施形態では、1つのメッセージIDに1つのメッセージカウンタMCが対応している場合について例示した。しかしこれに限らず、1つのメッセージカウンタに、複数のメッセージIDが対応してもよい。メッセージカウンタが、複数のメッセージIDに対応する場合、管理するメッセージカウンタの数を減らすことができるようにもなる。   In the above embodiment, the case where one message counter MC corresponds to one message ID has been illustrated. However, the present invention is not limited to this, and a plurality of message IDs may correspond to one message counter. When the message counter corresponds to a plurality of message IDs, the number of managed message counters can be reduced.

・上記実施形態では、メッセージカウンタMCが二度と同じ値にならないようにしている場合について例示したが、これに限らず、メッセージカウンタMCが一時的に同じ値になったりしてもよい。例えば、「上位ビット」の更新が間に合わなかったり、同期できなかったりした場合、メッセージカウンタが一時的に過去と同じ値になって二度使用されてもよい。また、必要な信頼性が確保できるのであれば、同じ値を、所定回数だけ使いまわすようにしてもよい。   In the above embodiment, the case where the message counter MC is set to never have the same value again has been described, but the present invention is not limited to this, and the message counter MC may temporarily have the same value. For example, if the update of the “high-order bit” is not in time or the synchronization cannot be performed, the message counter may temporarily have the same value as the past and may be used twice. Further, if the required reliability can be ensured, the same value may be reused a predetermined number of times.

・上記実施形態では、「上位ビットMCH」を7バイト、「下位ビットMCL」を1バイトとする場合について例示した。しかしこれに限らず、上位ビットと下位ビットとは、それ以外のバイト、例えば、「6バイト」及び「2バイト」等で区切ってもよい。また、バイト単位で区切るのではなく、例えば「60ビット」と「4ビット」と等、ビットの単位で区切ってもよい。   In the above embodiment, the case where the “upper bit MCH” is 7 bytes and the “lower bit MCL” is 1 byte is illustrated. However, the present invention is not limited to this, and the upper bits and the lower bits may be separated by other bytes, for example, “6 bytes” and “2 bytes”. Further, the data may be divided in bit units such as “60 bits” and “4 bits” instead of being divided in byte units.

[メッセージボックス]
・上記実施形態では、複数のMBOX31a,31b,31cを備える場合について例示したが、これに限らず、MBOXは、送受信する通信メッセージがECUのなかの適切な部分と授受できるように中継及び一時格納できるのであれば、1つでもよいし、2つや、4つ以上であってもよい。
[message-box]
In the above embodiment, the case where a plurality of MBOXs 31a, 31b, 31c are provided has been exemplified, but the present invention is not limited to this, and the MBOX relays and temporarily stores so that a communication message to be transmitted and received can be exchanged with an appropriate part in the ECU. If possible, the number may be one, two, or four or more.

[認証子生成部]
・上記実施形態では、「認証子AC2」に基づく認証を行う場合について例示した。このとき、「認証子AC2」に基づく認証に先立ち、通信メッセージMBからメッセージカウンタMCのうちの「下位ビットMCL」を取得し、取得した「下位ビットMCL」が、前回の取得した「下位ビットMCL」よりも大きい(更新されている)か否かを確認してもよい。そして、大きい(更新されている)場合、「認証子AC2」に基づく認証を行い、逆に、大きくない(更新されていない)場合、認証しない旨を判定するとともに、「認証子AC2」に基づく認証を割愛してもよい。
[Authenticator generator]
-In the above-mentioned embodiment, the case where authentication based on "authenticator AC2" was performed was illustrated. At this time, prior to the authentication based on the "authenticator AC2", the "lower bit MCL" of the message counter MC is acquired from the communication message MB, and the acquired "lower bit MCL" is the previously acquired "lower bit MCL." It is possible to confirm whether or not it is larger than (is updated). Then, if it is large (updated), authentication based on the “authenticator AC2” is performed. On the contrary, if it is not large (not updated), it is determined that the authentication is not performed, and based on the “authenticator AC2”. Authentication may be omitted.

10…ゲートウェイ、11…コード管理部、12…送信部、13…通信I/F部、21〜24…第1電子制御装置(ECU)、30…通信I/F部、31a,31b,31c…MBOX、32…情報処理部、33…認証子生成部、34…メッセージ処理部、35…暗号化エンジン、36…送受信判定部、111…暗号化エンジン、DT…メッセージデータ、EK…暗号鍵、L1,L2…通信用バス、MA…同期用メッセージ、MB…通信メッセージ、MC…メッセージカウンタ、AC1,AC2…認証子。   10 ... Gateway, 11 ... Code management section, 12 ... Transmission section, 13 ... Communication I / F section, 21-24 ... First electronic control unit (ECU), 30 ... Communication I / F section, 31a, 31b, 31c ... MBOX, 32 ... Information processing unit, 33 ... Authenticator generation unit, 34 ... Message processing unit, 35 ... Encryption engine, 36 ... Transmission / reception determination unit, 111 ... Encryption engine, DT ... Message data, EK ... Encryption key, L1 , L2 ... Communication bus, MA ... Synchronization message, MB ... Communication message, MC ... Message counter, AC1, AC2 ... Authenticator.

Claims (1)

第1の情報と第2の情報とが組み合わされてなる管理コードのうちの前記第1の情報を記憶するとともに、記憶する前記第1の情報を前記第2の情報が複数回更新されることに基づいて1回更新するように管理する管理装置と、
前記管理装置に通信ネットワークを介して通信可能に接続された受信装置及び送信装置とを備え、
前記管理装置は、前記第1の情報を含む同期用メッセージを送信し、前記受信装置及び送信装置は、前記管理装置が送信した前記同期用メッセージを受信する都度、前記受信した同期用メッセージに含まれる前記第1の情報を保持するものであるとともに、前記管理装置からの前記同期用メッセージを受信しているか否かを判定するものであり、
前記送信装置は、前記管理コードのうちの前記第2の情報を管理するものであり、通信データと、前記保持する前記第1の情報及び前記管理する第2の情報を組み合わせてなる前記管理コードとから認証子を生成して、前記通信データと、前記管理する第2の情報と、前記生成した認証子とを含み、前記保持する第1の情報を含まない通信メッセージを生成して送信するとともに、通信メッセージの生成後に前記管理する第2の情報の値を更新し、
前記受信装置は、前記送信装置の送信した前記通信メッセージを受信して、前記受信した通信メッセージに含まれる認証子と、前記受信した通信メッセージに基づいて再生成した認証子との比較に基づいて前記受信した通信メッセージを認証するものであって、
前記受信装置は、前記保持する第1の情報及び前記送信装置の送信した通信メッセージから取得した前記第2の情報を組み合わせて管理コードを再構成し、前記送信装置の送信した通信メッセージから取得した通信データと、前記再構成した管理コードとから前記再生成した認証子を取得するものであり、
前記送信装置は、前記管理装置の送信した前記第1の情報を含む同期用メッセージが受信できていない場合に前記受信装置への通信メッセージを送信しないこと、及び、前記受信装置は、前記管理装置の送信した前記第1の情報を含む同期用メッセージが受信できていない場合に前記送信装置から受信した通信メッセージを認証しないことの少なくとも一方を行う
ことを特徴とする通信システム。
Storing the first information of the management code formed by combining the first information and the second information, and updating the stored first information of the second information a plurality of times. A management device that manages to update once based on
A receiving device and a transmitting device communicatively connected to the management device via a communication network,
The management device transmits a synchronization message including the first information, and the reception device and the transmission device include the synchronization message each time the management device transmits the synchronization message. Is for holding the first information, and for determining whether or not the synchronization message from the management device is received .
The transmission device manages the second information of the management code, and the management code is a combination of communication data, the first information held and the second information managed. To generate and transmit a communication message that includes the communication data, the second information to be managed, and the generated authenticator, and does not include the held first information. Together with updating the value of the second information managed after the generation of the communication message,
The receiving device receives the communication message transmitted by the transmitting device, and based on a comparison between an authenticator included in the received communication message and an authenticator regenerated based on the received communication message. Certifying the received communication message,
The receiving device reconfigures a management code by combining the held first information and the second information acquired from the communication message transmitted by the transmitting device, and acquires the management code from the communication message transmitted by the transmitting device. To obtain the regenerated authenticator from communication data and the reconfigured management code,
The transmitting device does not transmit a communication message to the receiving device when the synchronization message including the first information transmitted by the managing device has not been received ; and the receiving device includes the managing device. The communication system is characterized by performing at least one of not authenticating the communication message received from the transmitting device when the synchronization message including the first information transmitted by the above is not received.
JP2016219620A 2016-11-10 2016-11-10 Communications system Active JP6683105B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016219620A JP6683105B2 (en) 2016-11-10 2016-11-10 Communications system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016219620A JP6683105B2 (en) 2016-11-10 2016-11-10 Communications system

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2020056059A Division JP2020123960A (en) 2020-03-26 2020-03-26 Communication system

Publications (2)

Publication Number Publication Date
JP2018078473A JP2018078473A (en) 2018-05-17
JP6683105B2 true JP6683105B2 (en) 2020-04-15

Family

ID=62151004

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016219620A Active JP6683105B2 (en) 2016-11-10 2016-11-10 Communications system

Country Status (1)

Country Link
JP (1) JP6683105B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020123960A (en) * 2020-03-26 2020-08-13 トヨタ自動車株式会社 Communication system

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012169829A (en) * 2011-02-14 2012-09-06 Honda Motor Co Ltd Communication system and communication method
JP2013048374A (en) * 2011-08-29 2013-03-07 Toyota Motor Corp Protection communication method
JP5770602B2 (en) * 2011-10-31 2015-08-26 トヨタ自動車株式会社 Message authentication method and communication system in communication system
JP5900509B2 (en) * 2011-12-06 2016-04-06 富士通株式会社 Node, communication method, and communication system
WO2013128317A1 (en) * 2012-03-01 2013-09-06 Nds Limited Anti-replay counter measures
JP6181032B2 (en) * 2014-11-18 2017-08-16 株式会社東芝 Communication system and communication apparatus
JP6420176B2 (en) * 2015-02-26 2018-11-07 ルネサスエレクトロニクス株式会社 Communication system and communication apparatus
JP6555209B2 (en) * 2015-08-07 2019-08-07 株式会社デンソー Communication system, management node, communication node, counter synchronization method, count value distribution method, count value initialization method, program, recording medium
JP6409849B2 (en) * 2016-10-31 2018-10-24 トヨタ自動車株式会社 Communication system and communication method

Also Published As

Publication number Publication date
JP2018078473A (en) 2018-05-17

Similar Documents

Publication Publication Date Title
JP6409849B2 (en) Communication system and communication method
CN107846395B (en) Method, system, medium, and vehicle for securing communications on a vehicle bus
US10735435B2 (en) Communication system, management node, normal node, counter synchronization method, and storage medium
JP5878630B2 (en) Method and apparatus for virtual pairing with a group of semi-connected devices
US11245535B2 (en) Hash-chain based sender identification scheme
CN108810887B (en) Disjoint security for multiple managers or access points in a wireless network
JP5975594B2 (en) Communication terminal and communication system
US10812261B2 (en) Vehicle system and key distribution method
WO2017067154A1 (en) Data communication method and system for in-vehicle network comprising multiple subnetworks, and gateway
JP6512023B2 (en) Communication system, transmitting node, and receiving node
JP2013048374A (en) Protection communication method
US11303453B2 (en) Method for securing communication without management of states
CN103931220A (en) Key derivative function for network communications
JP6108235B2 (en) KEY INFORMATION CONTROL DEVICE, KEY INFORMATION UPDATE DEVICE, PROGRAM AND RECORDING MEDIUM, KEY INFORMATION UPDATE METHOD, KEY INFORMATION UPDATE SYSTEM
AU2019379062A1 (en) Method and architecture for securing and managing networks of embedded systems with optimised public key infrastructure
US20220191040A1 (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
JP6683105B2 (en) Communications system
JP6915717B2 (en) Communications system
JP6683106B2 (en) Communications system
CN109661797B (en) Communication system, relay device, and communication method
JP2020123960A (en) Communication system
JP2020137009A (en) Network system
WO2017073389A1 (en) Communication system and communication method
US20170214667A1 (en) Communication device
JP7380530B2 (en) Vehicle communication system, communication method and communication program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20181218

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A132

Effective date: 20191224

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200210

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: 20200225

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200309

R151 Written notification of patent or utility model registration

Ref document number: 6683105

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151