JP2020123961A - Communication system - Google Patents

Communication system Download PDF

Info

Publication number
JP2020123961A
JP2020123961A JP2020056060A JP2020056060A JP2020123961A JP 2020123961 A JP2020123961 A JP 2020123961A JP 2020056060 A JP2020056060 A JP 2020056060A JP 2020056060 A JP2020056060 A JP 2020056060A JP 2020123961 A JP2020123961 A JP 2020123961A
Authority
JP
Japan
Prior art keywords
message
communication
information
communication message
received
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.)
Granted
Application number
JP2020056060A
Other languages
Japanese (ja)
Other versions
JP6915717B2 (en
Inventor
将秀 坂野
Masahide Sakano
将秀 坂野
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
Priority claimed from JP2016219621A external-priority patent/JP6683106B2/en
Application filed by Toyota Motor Corp filed Critical Toyota Motor Corp
Priority to JP2020056060A priority Critical patent/JP6915717B2/en
Publication of JP2020123961A publication Critical patent/JP2020123961A/en
Application granted granted Critical
Publication of JP6915717B2 publication Critical patent/JP6915717B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

To provide a communication system capable of suppressing delay related to transmission/reception of a communication message even in a case where reliability of the communication message is secured by utilizing a time change parameter.SOLUTION: A gateway 10 transmits a synchronization message MA including a high-order bit. A first ECU 21 and a third ECU 23 acquire the high-order bit from the synchronization message MA. The first ECU 21 transmits a communication message MB that includes an authenticator generated by utilizing a message counter that is reconfigured by a stored and managed low-order bit and the acquired high-order bit. The third ECU 23 authenticates the received communication message MB on the basis of comparison between an authenticator regenerated by utilizing a message counter reconfigured from the communication message MB and the authenticator included in the communication message MB. Under a condition that the synchronization message MA cannot be received, the received communication message MB is treated as an authenticated one.SELECTED DRAWING: Figure 1

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. Also, 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 transmitting unit that transmits data to the receiving terminal. On the other hand, the receiving terminal has 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. Also, 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-67073, 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.

ところで上記技術では、電源投入後やリセット後等であって時変パラメータが同期されるまでの間、受信装置と送信装置との間でそれぞれの記憶している時変パラメータが相違しているおそれがある。記憶している時変パラメータが相違しているような場合、受信装置は、送信装置が送信した正規の通信メッセージを正しいものとして認証しない。しかしながら、通信メッセージのなかには、時変パラメータが同期される以前であったとしても、電源投入直後から早期に、受信装置と送信装置との間で授受されることが望ましい通信データも存在する。つまり、こうした早期の授受が望ましい通信データであれ、時変パラメータが同期されるまで、その通信データの授受が遅延することになりかねない。 By the way, in the above technique, there is a possibility that the stored time-varying parameters are different between the receiving device and the transmitting device until the time-varying parameters are synchronized after power-on or after reset. There is. If the stored time-varying parameters are different, the receiving device does not authenticate the legitimate communication message sent by the sending device as being correct. However, some communication messages include communication data that is desired to be exchanged between the receiving device and the transmitting device immediately after the power is turned on, even before the time-varying parameters are synchronized. That is, even if the communication data is desired to be exchanged at such an early stage, the exchange of the communication data may be delayed until the time-varying parameters are synchronized.

本発明は、このような実情に鑑みてなされたものであって、その目的は、時変パラメータを利用して通信メッセージの信頼性を確保する場合であれ、通信メッセージの授受にかかる遅延を抑制することができる通信システムを提供することにある。 The present invention has been made in view of the above circumstances, and an object thereof is to suppress a delay in transmission/reception of a communication message 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 performing.

以下、上記課題を解決するための手段及びその作用効果を記載する。
上記目的を達成するために通信システムは、第1の情報と第2の情報とが組み合わされてなる管理コードのうちの前記第1の情報を記憶するとともに、記憶する前記第1の情報を前記第2の情報が複数回更新されることに基づいて1回更新するように管理する管理装置と、前記管理装置に通信ネットワークを介して通信可能に接続された受信装置及び送信装置とを備え、前記管理装置は、前記第1の情報を含む通信メッセージを送信し、前記受信装置及び送信装置は、前記管理装置が送信した前記通信メッセージを受信する都度、前記受信した通信メッセージに含まれる前記第1の情報を保持するものであり、前記送信装置は、前記管理コードのうちの前記第2の情報を管理するものであり、通信データと、前記保持する前記第1の情報及び前記管理する第2の情報を組み合わせてなる前記管理コードとから認証子を生成して、前記通信データと、前記管理する第2の情報と、前記生成した認証子とを含み、前記保持する第1の情報を含まない通信メッセージを生成して送信するとともに、通信メッセージの生成後に前記管理する第2の情報の値を更新し、前記受信装置は、前記送信装置の送信した前記通信メッセージを受信して、前記受信した通信メッセージに含まれる認証子と、前記受信した通信メッセージに基づいて再生成した認証子との比較に基づいて前記受信した通信メッセージを認証するものであって、前記受信装置は、前記保持する第1の情報及び前記送信装置の送信した通信メッセージから取得した前記第2の情報を組み合わせて管理コードを再構成し、前記送信装置の送信した通信メッセージから取得した通信データと、前記再構成した管理コードとから前記再生成した認証子を取得するものであり、前記受信装置は、前記第1の情報を含む通信メッセージが受信できていないことを条件に、前記受信した通信メッセージを認証されたものとして取り扱うことを特徴とする。
Hereinafter, the means for solving the above problems and the operation effects thereof will be described.
To achieve the above object, a communication system stores the first information in 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 communication message including the first information, and the reception device and the transmission device each include the first communication message included in the received communication message every time the communication message transmitted by the management device is received. 1), the transmitting device manages the second information in the management code, and communication data, the first information to be held, and the managing first information. An authenticator is generated from the management code that is a combination of two pieces of information, and includes the communication data, the second information to be managed, and the generated authenticator, and stores the first information to be retained. A communication message that does not include is generated and transmitted, the value of the second information to be managed is updated after the generation of the communication message, and the receiving device receives the communication message transmitted by the transmitting device, Authenticating the received communication message based on a comparison between an authenticator included in the received communication message and an authenticator regenerated based on the received communication message, wherein the receiving device holds the holding message. The first information and the second information acquired from the communication message transmitted by the transmission device to reconfigure a management code, and communication data acquired from the communication message transmitted by the transmission device, and the reconfiguration. The received authentication message is acquired from the received management message, on condition that the communication message including the first information has not been received. The feature is that it is handled as an item.

通信の信頼性をより高めるためには管理コードを一度きりの値とすることが望ましいが、通信システムの使用期間に渡って管理コードを一度きりの値としようとすると管理コードに要する情報量が大きくなってしまう。そして、この管理コードを通信メッセージに含めるとなると、通信メッセージにおける管理コードの占有量が多くなり、送信したい通信内容であるメッセージデータに割り当てることのできる容量が少なくなってしまうといった問題がある。 It is desirable to set the management code to the one-time value in order to further improve the reliability of communication, but if the management code is set to the one-time value over the period of use of the communication system, the amount of information required for the management code will increase. 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 allocated 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 can be one of the management codes stored in the receiving device and the transmitting device. The first information of is updated, ie 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の情報がリセット等により非同期に初期化されたとしても、その記憶している管理コードが同期されて正常な値に設定し直されることで、認証を正常に行うことが可能にもなる。 Further, 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 receiving device and the transmitting device. Even if the management code is asynchronously initialized by a reset 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の情報を含む通信メッセージが受信されれば、通信メッセージが認証されるようになることから必要とされる信頼性も維持される。これにより、時変パラメータを利用して通信メッセージの信頼性を確保する場合であっても、例えば、電源投入直後など、通信メッセージの授受にかかる遅延が抑制されるようになる。 Then, according to such a configuration, the receiving device treats the received communication message as an authenticated one, provided that the communication message including the first information has not been received. As a result, even if the receiving device has not yet received the communication message including the first information of the management code from the management device immediately after the power is turned on or after the reset, the receiving device and the receiving device. You will be able to share communication data that needs to be shared with. After that, if a communication message including the first information of the management code is received, the communication message will be authenticated, so that the required reliability is maintained. As a result, even when the reliability of the communication message is ensured by using the time-varying parameter, for example, a delay in transmitting and receiving the communication message immediately after the power is turned on can be suppressed.

通信システムを具体化した一実施形態について、その概略構成を示すブロック図。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 typically. 同実施形態における電子制御装置(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 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 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側の手順を示すフローチャート。6 is a flowchart showing a procedure on the ECU side when the message counters are synchronized in the same embodiment. 同実施形態においてメッセージカウンタが同期していないときの認証処理を示すフローチャート。6 is a flowchart showing an authentication process when the message counters are not synchronized in the same embodiment. 同実施形態においてメッセージカウンタが同期しているときの認証処理を示すフローチャート。6 is a flowchart showing an authentication process when message counters are synchronized 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 this 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. And a communication bus L2 to which the third and fourth ECUs 23 and 24 are communicatively connected. In the present embodiment, the communication bus L1 and the communication bus L2 form a communication network. Further, the communication system includes a gateway 10 as a management device 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 the structure of a communication message. In the frame, a storage area for a "message ID" as an identifier that indicates the type of communication message, and "message data" that is data specified by the user “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 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 one 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 the 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 that exchanges 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 transmitted by broadcast to the ECUs 21 to 24 connected to the communication buses L1 and L2, like 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 the 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 the 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. In addition, the message counter MC increases the value of the “higher-order bit MCH” by “1” in response to the change of the “lower-order bit MCL” from “0” to the maximum value. 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 “high-order 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, it may be managed 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 of MC (the number of bits) 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" that 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 “high-order bit MCH” has a length of 7 bytes (=56 bits) and the “low-order 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 “higher-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 the timing when the “lower bit MCL” of the message counter MC reaches the maximum value, that is, the 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 an "authentication element AC1" from the "upper bit MCH" of the message counter MC, and performs synchronization including the generated "authentication element AC1" and the "upper bit MCH" of the message counter MC. Message MA 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 “upper 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 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 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 also includes a backup memory that stores and holds set values and calculated values when power is constantly supplied from the battery.

図3及び図4に示すように、第1ECU21は、CANプロトコル用の通信I/F30と、通信メッセージが一時的に格納される複数のMBOX(MessageBox)31a,31b,31cと、送信する通信メッセージMB等に含まれる「認証子AC2」を生成する認証子生成部33とを備える。また、第1ECU21は、認証子を含み送受信される通信メッセージMBを処理するメッセージ処理部34と、「メッセージデータDT」を処理する情報処理部32と、通信メッセージMBの受信の可否を「上位ビットMCH」の更新状態に応じて判定する仮受信判定部37とを備える。なお、認証子生成部33、メッセージ処理部34及び仮受信判定部37の各機能は、第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. The first ECU 21 also includes a message processing unit 34 that processes a communication message MB that includes an authenticator and is transmitted and received, an information processing unit 32 that processes “message data DT”, and determines whether or not the communication message MB can be received by “higher-order bits”. And a provisional reception determination unit 37 that determines according to the update state of “MCH”. Each function of the authenticator generation unit 33, the message processing unit 34, and the temporary reception determination unit 37 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 generation 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 section 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 generating 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 at the corresponding positions in 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.

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

詳述すると、仮受信判定部37は、認証子生成部33に記憶されている「上位ビットMCH」に基づいて通信メッセージMBの仮受信の可否について判定し、この判定した結果をメッセージ処理部34に出力する。仮受信判定部37は、認証子生成部33に記憶されている「上位ビットMCH」の状態を判定し、この判定で「上位ビットMCH」が過渡状態であれば仮受信が「可」であると判定し、定常状態であれば仮受信が「否」である旨を判定する。ここで定常状態とは、「上位ビットMCH」が定期的に更新されている状態や、先の更新から所定の期間以内である状態をいう。逆に、過渡状態とは、「上位ビットMCH」が初期値のままである状態をいう。なお、過渡状態に「上位ビットMCH」の更新が停止されている状態や、先の更新から所定の期間を超えても更新されない状態等を含ませることもできる。仮受信判定部37は、認証子生成部33が認証子を認証する必要があるときに仮受信の可否の判定を行い、その判定結果を認証子生成部33やメッセージ処理部34に出力することができる。 More specifically, the temporary reception determination unit 37 determines whether or not the temporary reception of the communication message MB is possible based on the “upper bit MCH” stored in the authenticator generation unit 33, and the result of this determination is determined by the message processing unit 34. Output to. The temporary reception determination unit 37 determines the state of the “upper bit MCH” stored in the authenticator generation unit 33, and if the “upper bit MCH” is in a transient state in this determination, the temporary reception is “OK”. If it is in the steady state, it is determined that the temporary reception is “no”. Here, the steady state refers to a state in which the “upper bit MCH” is regularly updated, or a state within a predetermined period from the previous update. On the contrary, the transient state is a state in which the “high-order bit MCH” remains the initial value. The transient state may include a state in which the update of the “high-order bit MCH” is stopped, a state in which the update is not performed even after a predetermined period of time from the previous update, and the like. The temporary reception determination unit 37 determines whether or not the temporary reception is possible when the authenticator generation unit 33 needs to authenticate the authenticator, and outputs the determination result to the authenticator generation unit 33 and the message processing unit 34. You can

メッセージ処理部34は、送受信される通信メッセージMBの信頼性を以下のようにして確保する。
通信メッセージMBを受信したとき、メッセージ処理部34は、MBOX31cから通信メッセージMBを入力し、この入力した通信メッセージMBの受信可否の判定及び認証処理を行う。そして、メッセージ処理部34は、認証子生成部33で認証された通信メッセージMBに含まれる「メッセージデータDT」を情報処理部32に出力する。具体的には、メッセージ処理部34は、認証処理を行うため、受信した通信メッセージMBを認証子生成部33に送り、認証子生成部33から通信メッセージMBに対する認証の結果を得る。認証子生成部33で認証されたメッセージ処理部34は、受信した通信メッセージMBから「メッセージデータDT」が取得され、この取得された「メッセージデータDT」が情報処理部32に送られる。
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 the “message data DT” included in the communication message MB authenticated by the authenticator generating unit 33 to the information processing unit 32. Specifically, 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. The message processing unit 34 authenticated by the authenticator generating unit 33 acquires the “message data DT” from the received communication message MB, and sends the acquired “message data DT” to the information processing unit 32.

一方、認証子生成部33で認証されなかった場合、メッセージ処理部34は、受信した通信メッセージMBについて受信可否の判定を取得する。詳述すると、認証子生成部33は、受信した通信メッセージMBを仮受信判定部37に送り、仮受信判定部37から受信の可否の判定結果が入力される。そして、メッセージ処理部34は、仮受信「否」の判定結果が入力されると、受信した通信メッセージMBを破棄する。これに対し、メッセージ処理部34は、仮受信「可」の判定結果が入力されると、認証子生成部33で認証されなかった受信した通信メッセージMBであれ、この受信した通信メッセージMBに対して認証されたときと同様の処理を行う。すなわち、メッセージ処理部34は、仮受信「可」と判定された受信した通信メッセージMBから「メッセージデータDT」を取得し、この取得した「メッセージデータDT」を情報処理部32に送る。これにより、電源投入直後やリセット直後等であって、「上位ビットMCH」が初期値のままであるときであっても、「メッセージデータDT」が情報処理部32に送られて、この「メッセージデータDT」が第1ECU21と第3ECU23とで共用される。 On the other hand, when the authenticator generation unit 33 has not been authenticated, the message processing unit 34 acquires a determination as to whether or not the received communication message MB can be received. More specifically, the authenticator generation unit 33 sends the received communication message MB to the temporary reception determination unit 37, and the temporary reception determination unit 37 inputs the determination result of the reception possibility. Then, the message processing unit 34 discards the received communication message MB when the determination result of the provisional reception “no” is input. On the other hand, when the determination result of the provisional reception “OK” is input, the message processing unit 34 responds to the received communication message MB even if the received communication message MB is not authenticated by the authenticator generating unit 33. Performs the same processing as when authenticated. That is, the message processing unit 34 acquires the “message data DT” from the received communication message MB that is determined to be “temporarily received” and sends the acquired “message data DT” to the information processing unit 32. As a result, the "message data DT" is sent to the information processing unit 32 even when the "high-order bit MCH" remains at the initial value immediately after the power is turned on or immediately after reset, and the "message" The data DT” is shared by the first ECU 21 and the third ECU 23.

また、通信メッセージMBを送信するとき、メッセージ処理部34は、情報処理部32から「メッセージデータDT」を入力し、この入力した「メッセージデータDT」に基づく「認証子AC2」を生成する。そして、メッセージ処理部34は、「メッセージデータDT」と「認証子AC2」とを含む送信する通信メッセージMBを生成し、この生成した送信する通信メッセージMBをMBOX31cに出力する。 Further, when transmitting the communication message MB, the message processing unit 34 inputs the “message data DT” from the information processing unit 32, and generates the “authenticator AC2” based on the input “message data DT”. Then, the message processing unit 34 generates the communication message MB to be transmitted including the “message data DT” and the “authentication element AC2”, and outputs the generated communication message MB to be transmitted to the MBOX 31c.

認証子生成部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. The authenticator generation unit 33 stores only one "upper bit MCH" and "lower bit MCL" of the message counter MC at the corresponding positions in the reserved storage area of the message counter MC. Alternatively, the “higher-order bit MCH” and the “lower-order bit MCL” may be stored separately in the reserved storage areas. Further, the authenticator generation unit 33 initializes the value of the storage area for storing and holding the “lower bit MCL” and the storage area for storing the “upper bit MCH” by powering off or resetting. It is like this. 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 process, and a communication message reception 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 “upper 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 generating 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が受信されて入力されるまでの間は、認証子生成部33に記憶されている「上位ビットMCH」は、初期値のままであったり、更新されていない状態であったりする。更新されていない状態とは、「上位ビットMCH」が所定の期間初期値であって、一度も、又は、長期間、同期用メッセージが受信されていないために更新されていない状態である。 Normally, the “high-order 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, immediately after power-on or reset, and until the synchronization message MA is received and input, the “high-order bit MCH” stored in the authenticator generation unit 33 remains the initial value. Or, it may not be updated. The non-updated state is a state in which the “high-order bit MCH” is the initial value for a predetermined period and has not been updated because the synchronization message has not been received even once or for a long period of time.

なお、認証子生成部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 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は、管理している「下位ビットMCL」と同期用メッセージMAから取得して保持している「上位ビットMCH」とから、メッセージカウンタMCを再構成するとともに、暗号化エンジン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が過去の値と二度と同じ値にならないようになっている。
[Processing when sending communication message]
The authenticator generation unit 33 performs a process of generating an authenticator of the communication message MB to be transmitted as the process 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 reconfigures the message counter MC from the managed “lower bit MCL” and the “upper bit MCH” acquired and held from the synchronization message MA, and at the same time, the encryption engine 35. Then, the reconfigured message counter MC and the input message data DT are encrypted with the encryption key EK to generate the "authentication element 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の認証処理を行う。認証処理では、「認証子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. 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に出力する。一方、メッセージ処理部34は、認証されなかった通信メッセージMBに対して仮受信判定部37から受信の可否判断を取得し、受信「可」であれば、通信メッセージ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 generating unit 33 compares the input “authenticator AC2” with the regenerated “authenticator AC3” and determines that authentication is performed. If they do not match, authentication is not performed. To judge. Then, the authenticator generating unit 33 outputs the authentication determination result to the message processing unit 34. The message processing unit 34 outputs the “message data DT” of the authenticated communication message MB to the information processing unit 32. On the other hand, the message processing unit 34 acquires the acceptance/non-permission determination of the unauthenticated communication message MB from the temporary reception determination unit 37, and if the reception is “acceptable”, the “message data DT” of the communication message MB is acquired. The message is output to the information processing unit 32, and if the message is “not received”, the “message data DT” of the communication message MB 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で所定の周期毎、又は所定の条件が成立する毎に実行が開始される。
[Update upper bits]
6 and 7 show a procedure for updating the "high-order bit MCH" of the message counter MC held by the authenticator generating unit 33 of the ECUs 21-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. If it is determined that it is not the transmission timing (NO in step S10 of 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 bit 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 has been received (step S20 in FIG. 7). If 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 bits 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 upper 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 bit ends once.

[通信メッセージの送信処理]
図4に示すように、第1ECU21は、情報処理部32が「メッセージデータDT」を生成すると、認証子生成部33で「メッセージデータDT」とメッセージカウンタMCとに基づいて「識別子AC2」を生成する。そして、第1ECU21は、「識別子AC2」を生成したときの「メッセージデータDT」及びメッセージカウンタMCのうちの「下位ビットMCL」と、生成した「識別子AC2」とから通信メッセージMBを生成するとともに、この生成した通信メッセージMBを通信用バスL1に送信する。通信用バスL1に送信された通信メッセージMBは、ゲートウェイ10で通信用バスL1から通信用バスL2に転送されて、通信用バスL2に接続されている第3ECU23で受信できるようになる。
[Communication message sending process]
As shown in FIG. 4, when the information processing unit 32 generates the “message data DT”, the first ECU 21 causes the authenticator generating unit 33 to generate the “identifier AC2” based on the “message data DT” and the message counter MC. To do. Then, the first ECU 21 generates the communication message MB from the “message data DT” when the “identifier AC2” is generated and the “lower bit MCL” of the message counter MC and the generated “identifier AC2”, and The generated communication message MB is transmitted to the communication bus L1. 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.

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

図8に示すように、第3ECU23は、受信した通信メッセージMBがメッセージ処理部34で取得されたことに基づいて、認証子生成部33で同期用メッセージMAを受信しているか否かを判定する(図8のステップS50)。同期用メッセージMAを受信しているか否かは、同期用メッセージMAに対応するメッセージIDを有する通信メッセージが受信されたか否か、及び、同期用メッセージMAが認証子生成部33に入力されたか否かの少なくとも一方に基づいて判定される。よって、同期用メッセージMAが受信できていいないことは、同期用メッセージMAに対応するメッセージIDを有する通信メッセージが受信されていないこと、及び、同期用メッセージMAが認証子生成部33に入力されていないことの少なくとも一方に基づいて判定される。また、受信しているか否かは、第3ECU23が電源投入されたことやリセットされたことによってECUが起動された後であることに基づいて判定される。同期用メッセージMAを受信していないと判定した場合(図8のステップS50でNO)、第3ECU23は、ECU起動から所定期間経過しているか否かを判定する(図8のステップS51)。ECU起動とは、電源投入後やリセット後にECUが起動することであり、所定期間は、ECU起動後に同期用メッセージMAが受信されることが期待される通常の期間であるとともに、メッセージID毎に予め設定されている期間である。ECU起動から所定期間経過していると判定した場合(図8のステップS51でYES)、第3ECU23は、メッセージ処理部34で受信した「メッセージデータDT」を破棄するとともに、認証失敗を情報処理部32のアプリケーションに通知する(図8のステップS56)。そして、第3ECU23は、通信メッセージMBの受信処理を一旦終了する。 As shown in FIG. 8, the third ECU 23 determines whether or not the authenticator generation unit 33 receives the synchronization message MA based on the received communication message MB being acquired by the message processing unit 34. (Step S50 of FIG. 8). Whether or not the synchronization message MA is received depends on 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 input to the authenticator generation unit 33. It is determined based on at least one of the above. Therefore, the synchronization message MA has not been received, the communication message having the message ID corresponding to the synchronization message MA has not been received, and the synchronization message MA has been input to the authenticator generation unit 33. It is judged based on at least one of the absence. Further, whether or not it is received is determined based on the fact that the ECU has been started up by the third ECU 23 being powered on or resetting. When it is determined that the synchronization message MA is not received (NO in step S50 of FIG. 8 ), the third ECU 23 determines whether or not a predetermined period has elapsed since the ECU was started (step S51 of FIG. 8 ). The ECU activation means that the ECU is activated after the power is turned on or reset, and the predetermined period is a normal period in which the synchronization message MA is expected to be received after the ECU is activated, and the predetermined period is different for each message ID. This is a preset period. When it is determined that the predetermined period has elapsed since the ECU was started (YES in step S51 of FIG. 8 ), the third ECU 23 discards the “message data DT” received by the message processing unit 34, and at the same time indicates that the authentication has failed. The 32 applications are notified (step S56 in FIG. 8). Then, the third ECU 23 once ends the reception process of the communication message MB.

一方、ECU起動から所定期間経過していないと判定した場合(図8のステップS51でNO)、第3ECU23は、暗号化エンジン35で「メッセージデータDT」と再構成したメッセージカウンタMCとから「認証子AC3」を再生成する(図8のステップS52)。続いて、第3ECU23は、認証子生成部33で、受信した通信メッセージMBから取得した「識別子AC2」と、上記再生成した「認証子AC3」とを比較して一致するか否か判定する(図8のステップS53)。一致しないと判定した場合(図8のステップS53でNO)、第3ECU23は、再度、ECU起動から所定期間経過しているか否かを判定する(図8のステップS54)。そして、ECU起動から所定期間経過していると判定した場合(図8のステップS54でYES)、上述したステップS56の処理が行なわれ、その後、通信メッセージMBの受信処理が一旦終了される。他方、ECU起動から所定期間経過していないと判定した場合(図8のステップS54でNO)、又は、上記ステップS53の判定で一致すると判定した場合(図8のステップS53でYES)、第3ECU23は、「メッセージデータDT」を情報処理部32のアプリケーションに送る(図8のステップS55)。そして、第3ECU23は、通信メッセージMBの受信処理を一旦終了する。 On the other hand, when it is determined that the predetermined period has not elapsed since the ECU was started (NO in step S51 of FIG. 8 ), the third ECU 23 uses the “message data DT” in the encryption engine 35 and the reconfigured message counter MC to perform “authentication”. Child AC3” is regenerated (step S52 in FIG. 8). Subsequently, the third ECU 23 compares the “identifier AC2” acquired from the received communication message MB with the regenerated “authentication AC3” by the authenticator generation unit 33 and determines whether or not they match ( Step S53 in FIG. 8). When it is determined that they do not match (NO in step S53 of FIG. 8), the third ECU 23 determines again whether or not a predetermined period has elapsed since the ECU was started (step S54 of FIG. 8). When it is determined that the predetermined period has elapsed since the ECU was started (YES in step S54 of FIG. 8), the process of step S56 described above is performed, and then the process of receiving communication message MB is temporarily terminated. On the other hand, if it is determined that the predetermined period has not elapsed since the ECU was started (NO in step S54 of FIG. 8) or if it is determined that they match in the determination of step S53 (YES in step S53 of FIG. 8), the third ECU 23 Sends the "message data DT" to the application of the information processing section 32 (step S55 in FIG. 8). Then, the third ECU 23 once ends the reception process of the communication message MB.

一方、図9に示すように、同期用メッセージMAを受信していると判定した場合(図8のステップS50でYES)、第3ECU23は、認証子生成部33で同期用メッセージMAを受信処理しているか否かを判定する(図9のステップS40)。ここで、同期用メッセージMAを受信処理しているか否かは、同期用メッセージMAが受信処理されて「上位ビットMCH」が適切に更新されているか否かに基づいて判定される。すなわち、受信しているか否かは、第3ECU23が電源投入されたことやリセットされたことによってECUが起動された後について判定される。また、適切に更新されていることは、「上位ビットMCH」が初期値から変更されていること、更新が停止されていないこと、及び、定期的に更新されていることに基づいて判定される。同期用メッセージMAを受信処理していないと判定した場合(図9のステップS40でNO)、第3ECU23は、メッセージ処理部34で受信した「メッセージデータDT」を破棄するとともに、認証失敗を情報処理部32のアプリケーションに通知する(図9のステップS45)。そして、第3ECU23は、通信メッセージMBの受信処理を一旦終了する。 On the other hand, as shown in FIG. 9, when it is determined that the synchronization message MA is received (YES in step S50 of FIG. 8), the third ECU 23 causes the authenticator generation unit 33 to receive the synchronization message MA. It is determined whether or not (step S40 in FIG. 9). Here, whether or not the synchronization message MA is being received is determined based on whether or not the synchronization message MA is subjected to the reception processing and the “upper bit MCH” is appropriately updated. That is, whether or not it is received is determined after the third ECU 23 is powered on or reset and the ECU is activated. 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 MA has not been received (NO in step S40 of FIG. 9 ), the third ECU 23 discards the “message data DT” received by the message processing unit 34 and processes the authentication failure as information processing. The application of the unit 32 is notified (step S45 of FIG. 9). Then, the third ECU 23 once ends the reception process of the communication message MB.

一方、同期用メッセージ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, if it is determined that the synchronization message MA is being received (YES in step S40 of FIG. 9 ), referring also to FIG. 5, the third ECU 23 causes the authenticator generation unit 33 to display the message “message”. The data DT, the "lower bit MCL" of the message counter MC, and the "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 third ECU 23 compares the acquired “identifier AC2” and 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は、通信メッセージMBの受信処理を一旦終了する。 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, if 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 informs the authentication failure. The processing of notifying the application of the processing unit 32 is performed. Then, the third ECU 23 once ends the reception process of the communication message MB.

以上説明した一連の処理により、時変パラメータを利用して通信メッセージの信頼性を確保する場合、認証されなかった通信メッセージMBであっても仮受信が「可」であれば、「メッセージデータDT」が情報処理部32へ送られるようになり、通信メッセージの授受にかかる遅延を抑制することができる。 In the case where the reliability of the communication message is secured by using the time-varying parameter by the series of processes described above, even if the communication message MB that has not been authenticated is “Yes” in the tentative reception, “Message data DT Is sent to the information processing unit 32, and a delay in sending and receiving a communication message can be suppressed.

以上説明したように、本実施形態に係る通信システムによれば、以下に示すような効果が得られるようになる。
(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 the present 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 “higher-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, the reliability of the communication message MB can be ensured 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. Accordingly, 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 “high-order bit MCH” of the message counter MC stored in each of the ECUs 21 to 24 can be synchronized. Therefore, even if the “high-order bit MCH” of the message counters MC stored in each of the ECUs 21 to 24 is asynchronously initialized by resetting the ECUs 21 to 24, the stored message counters MC are normal. By setting the value again, it is 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. Further, 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) Synchronizing from the gateway 10 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 reliability of the communication content of the “upper bit MCH” of the message counter MC transmitted by the message MA is also 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 by comparing these authenticators, the synchronization message MA can be authenticated. 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)第3ECU23は、メッセージカウンタMCのうちの上位ビットMCHを含む同期用メッセージMAが受信できていないことを条件に、受信した通信メッセージMBを認証されたものとして取り扱う。これにより、第3ECU23は、電源投入直後やリセット後であって、メッセージカウンタMCのうちの上位ビットMCHを含む同期用メッセージMAをゲートウェイ10からまだ受信できていない場合であっても、第1ECU21と第3ECU23との間で共有する必要のあるメッセージデータDTを共有できるようになる。なお、その後、同期用メッセージMAが受信されれば、通信メッセージMBが認証されるようになることから必要とされる信頼性も維持される。 (7) The third ECU 23 treats the received communication message MB as an authenticated one, provided that the synchronization message MA including the high-order bit MCH of the message counter MC has not been received. As a result, the third ECU 23 is connected to the first ECU 21 even immediately after the power is turned on or after the reset and even when the synchronization message MA including the high-order bit MCH of the message counter MC has not been received from the gateway 10. It becomes possible to share the message data DT that needs to be shared with the third ECU 23. After that, if the synchronization message MA is received, the communication message MB is authenticated, so that the required reliability is maintained.

(その他の実施形態)
なお、上記実施形態は、以下の態様で実施することもできる。
[同期用メッセージ]
・上記実施形態では、メッセージカウンタが同期用メッセージで送信される場合について例示した。このとき、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 as a synchronization message has been 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 double 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 is increased 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, not limited to this, 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-described embodiment, the code management unit 11 exemplifies a case where the “upper bit MCH” of the message counter MC is stored and managed. 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 transmission unit 12 exemplifies a case where a part of the message counter MC is transmitted. 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 high-order bit 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 the message counter is used for ensuring 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 be arranged such that the position of the upper bit and the position of the lower bit in the bit string may be reversed, and a separately reserved storage area for the upper bit and the lower bit, 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, the present invention is not limited to this, and 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” in the gateway 10 is increased by “1” 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, not limited to this, if it is possible to prevent the message counter MC from having 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 exceeds 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.

・上記実施形態では、メッセージカウンタは通信メッセージが送信される都度、値が「1」ずつ増加される場合について例示した。しかしこれに限らず、通信メッセージの信頼性が確保されるのであれば、メッセージカウンタは、例えば、二度と同じ値を使用しないように最大値から「0」まで減少してもよいし、不規則な変化をしてもよい。なお、上位ビットと下位ビットとは別々に管理されることから、上位ビットの変化態様と下位ビットの変化態様とは同一であってもよいし、別々であってもよい。 In the above-described embodiment, the message counter is illustrated as being 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-described embodiment, the case where the message counter MC is never set to the same value has been described as an example. However, the present invention is not limited to this, and the message counter MC may be set to the same value temporarily. For example, if the update of the “high-order bit” is not in time or cannot be synchronized, the message counter may temporarily have the same value as the past and may be used twice. Further, if the required reliability can be secured, 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 “high-order bit MCH” is 7 bytes and the “low-order bit MCL” is 1 byte has been 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 not be divided in byte units, but may be divided in bit units such as “60 bits” and “4 bits”.

[メッセージボックス]
・上記実施形態では、複数のMBOX31a,31b,31cを備える場合について例示したが、これに限らず、MBOXは、送受信する通信メッセージがECUのなかの適切な部分と授受できるように中継及び一時格納できるのであれば、1つでもよいし、2つや、4つ以上であってもよい。
[message-box]
In the above embodiment, the case where the plurality of MBOXs 31a, 31b, 31c are provided has been illustrated, 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 of 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 the authentication based on the "certifier AC2" is 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, and conversely, 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…暗号化エンジン、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 generating unit, 34... Message processing unit, 35... Encryption engine, 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.

ところで上記技術では、電源投入後やリセット後等であって時変パラメータが同期されるまでの間、受信装置と送信装置との間でそれぞれの記憶している時変パラメータが相違しているおそれがある By the way, in the above technique, there is a possibility that the stored time-varying parameters are different between the receiving device and the transmitting device until the time-varying parameters are synchronized after power-on or after reset. There is .

以下、上記課題を解決するための手段を記載する。
上記目的を達成するために通信システムは、第1の情報と第2の情報とが組み合わされてなる管理コードのうちの前記第1の情報を記憶するとともに、記憶する前記第1の情報を前記第2の情報が複数回更新されることに基づいて1回更新するように管理する管理装置と、前記管理装置に通信ネットワークを介して通信可能に接続された受信装置及び送信装置とを備え、前記管理装置は、前記第1の情報を含む同期用メッセージを送信し、前記受信装置及び送信装置は、前記同期用メッセージを受信する都度、前記受信した同期用メッセージに含まれる前記第1の情報を保持するものであり、前記送信装置は、前記管理コードのうちの前記第2の情報を管理するものであり、通信データと、前記保持する前記第1の情報及び前記管理する第2の情報を組み合わせてなる前記管理コードとから認証子を生成して、前記通信データと、前記管理する第2の情報と、前記生成した認証子とを含み、前記保持する第1の情報を含まない通信メッセージを生成して送信するとともに、通信メッセージの生成後に前記管理する第2の情報の値を更新し、前記受信装置は、前記通信メッセージを受信して、前記受信した通信メッセージに含まれる認証子と、前記受信した通信メッセージに基づいて再生成した認証子との比較に基づいて前記受信した通信メッセージを認証するものであって、前記受信装置は、前記保持する第1の情報及び前記受信した通信メッセージから取得した前記第2の情報を組み合わせて管理コードを再構成し、前記受信した通信メッセージから取得した通信データと、前記再構成した管理コードとから前記再生成した認証子を取得するものであり、前記受信装置は、前記同期用メッセージを受信しておらず、且つ当該受信装置が起動してから所定期間経過した場合には、前記受信した通信メッセージを破棄することを特徴とする。
Hereinafter referred to as a hand stage for solving the above problems.
To achieve the above object, a communication system stores the first information in 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, the first to send a message for synchronizing including information, said receiving apparatus and transmitting apparatus, every time of receiving the synchronization message, the first information included in the synchronization the received message The transmission device manages the second information in the management code, and communication data, the first information to be held, and the second information to be managed. A communication that generates an authenticator from the management code that is a combination of the above, and includes the communication data, the second information to be managed, and the generated authenticator, and does not include the first information to be held. together generates and transmits a message, updates the value of the second information the management after the generation of the communication message, the receiving device receives the previous SL communication message, contained in the communication the received message authentication For authenticating the received communication message based on a comparison between a child and an authenticator regenerated based on the received communication message, wherein the receiving device holds the first information held and the reception information. in combination with said second information acquired from the communication message to reconfigure the management code, and acquires the communication data acquired from the communication the received message, the authenticator that the regenerated from the management code the reconstituted The receiving device discards the received communication message when the receiving device has not received the synchronization message and a predetermined period has elapsed since the receiving device was activated. ..

Claims (1)

第1の情報と第2の情報とが組み合わされてなる管理コードのうちの前記第1の情報を記憶するとともに、記憶する前記第1の情報を前記第2の情報が複数回更新されることに基づいて1回更新するように管理する管理装置と、
前記管理装置に通信ネットワークを介して通信可能に接続された受信装置及び送信装置とを備え、
前記管理装置は、前記第1の情報を含む通信メッセージを送信し、前記受信装置及び送信装置は、前記管理装置が送信した前記通信メッセージを受信する都度、前記受信した通信メッセージに含まれる前記第1の情報を保持するものであり、
前記送信装置は、前記管理コードのうちの前記第2の情報を管理するものであり、通信データと、前記保持する前記第1の情報及び前記管理する第2の情報を組み合わせてなる前記管理コードとから認証子を生成して、前記通信データと、前記管理する第2の情報と、前記生成した認証子とを含み、前記保持する第1の情報を含まない通信メッセージを生成して送信するとともに、通信メッセージの生成後に前記管理する第2の情報の値を更新し、
前記受信装置は、前記送信装置の送信した前記通信メッセージを受信して、前記受信した通信メッセージに含まれる認証子と、前記受信した通信メッセージに基づいて再生成した認証子との比較に基づいて前記受信した通信メッセージを認証するものであって、
前記受信装置は、前記保持する第1の情報及び前記送信装置の送信した通信メッセージから取得した前記第2の情報を組み合わせて管理コードを再構成し、前記送信装置の送信した通信メッセージから取得した通信データと、前記再構成した管理コードとから前記再生成した認証子を取得するものであり、
前記受信装置は、前記第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 communication message including the first information, and the receiving device and the transmitting device each include the first communication message included in the received communication message each time the communication message transmitted by the management device is received. Holds the information of 1.
The transmission device manages the second information of the management codes, 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 first information to be held. 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 reconstructs 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 communication system, wherein the receiving device handles the received communication message as an authenticated one, on condition that the communication message including the first information has not been received.
JP2020056060A 2016-11-10 2020-03-26 Communications system Active JP6915717B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2020056060A JP6915717B2 (en) 2016-11-10 2020-03-26 Communications system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2016219621A JP6683106B2 (en) 2016-11-10 2016-11-10 Communications system
JP2020056060A JP6915717B2 (en) 2016-11-10 2020-03-26 Communications system

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2016219621A Division JP6683106B2 (en) 2016-11-10 2016-11-10 Communications system

Publications (2)

Publication Number Publication Date
JP2020123961A true JP2020123961A (en) 2020-08-13
JP6915717B2 JP6915717B2 (en) 2021-08-04

Family

ID=71993097

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020056060A Active JP6915717B2 (en) 2016-11-10 2020-03-26 Communications system

Country Status (1)

Country Link
JP (1) JP6915717B2 (en)

Citations (8)

* 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
JP2013098719A (en) * 2011-10-31 2013-05-20 Toyota Infotechnology Center Co Ltd Message authentication method for communication system, and communication system
WO2013084304A1 (en) * 2011-12-06 2013-06-13 富士通株式会社 Nodes, communication method, and communication system
WO2013128317A1 (en) * 2012-03-01 2013-09-06 Nds Limited Anti-replay counter measures
JP2014166216A (en) * 2013-02-28 2014-09-11 Kawajun Co Ltd Assembly shelf
JP2016100632A (en) * 2014-11-18 2016-05-30 株式会社東芝 Communication system and communication device
JP2016158204A (en) * 2015-02-26 2016-09-01 ルネサスエレクトロニクス株式会社 Communication system and communication device

Patent Citations (8)

* 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
JP2013098719A (en) * 2011-10-31 2013-05-20 Toyota Infotechnology Center Co Ltd Message authentication method for communication system, and communication system
WO2013084304A1 (en) * 2011-12-06 2013-06-13 富士通株式会社 Nodes, communication method, and communication system
WO2013128317A1 (en) * 2012-03-01 2013-09-06 Nds Limited Anti-replay counter measures
JP2014166216A (en) * 2013-02-28 2014-09-11 Kawajun Co Ltd Assembly shelf
JP2016100632A (en) * 2014-11-18 2016-05-30 株式会社東芝 Communication system and communication device
JP2016158204A (en) * 2015-02-26 2016-09-01 ルネサスエレクトロニクス株式会社 Communication system and communication device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
倉地 亮 ほか: "メッセージ認証を用いたCANの集中監視システム", 電子情報通信学会論文誌A, vol. 99, no. 2, JPN6017011701, 1 February 2016 (2016-02-01), JP, pages 118 - 130, ISSN: 0004528544 *

Also Published As

Publication number Publication date
JP6915717B2 (en) 2021-08-04

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
Bush et al. The resource public key infrastructure (RPKI) to router protocol
US10735435B2 (en) Communication system, management node, normal node, counter synchronization method, and storage medium
US9425968B2 (en) System and method for updating an encryption key across a network
US9189632B2 (en) Method for protecting security of data, network entity and communication terminal
US10812261B2 (en) Vehicle system and key distribution method
US9059839B2 (en) Communication terminal using a temporary network key for assembling a secure communication frame
JP6617173B2 (en) Independent security in wireless networks with multiple managers or access points
WO2017067154A1 (en) Data communication method and system for in-vehicle network comprising multiple subnetworks, and gateway
JP2014520444A (en) Method and apparatus for virtual pairing with a group of semi-connected devices
JP6512023B2 (en) Communication system, transmitting node, and receiving node
JP6614304B2 (en) Mobile communication system, group gateway, UE and communication method
CN103931220A (en) Key derivative function for network communications
KR20150135032A (en) System and method for updating secret key using physical unclonable function
JP6108235B2 (en) KEY INFORMATION CONTROL DEVICE, KEY INFORMATION UPDATE DEVICE, PROGRAM AND RECORDING MEDIUM, KEY INFORMATION UPDATE METHOD, KEY INFORMATION UPDATE SYSTEM
JP2016092716A (en) Key management communication device and key distribution method
JP6683105B2 (en) Communications system
JP6683106B2 (en) Communications system
JP6915717B2 (en) Communications system
JP2020123960A (en) Communication system
KR20210126319A (en) Apparatus and method for managing key
JP5835162B2 (en) Cryptographic communication system and cryptographic communication method
CN113791872B (en) Cloud computing-based authentication method and system
Bush et al. RFC 6810: The Resource Public Key Infrastructure (RPKI) to Router Protocol

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200424

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20200428

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210628

R151 Written notification of patent or utility model registration

Ref document number: 6915717

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151