JP6864759B2 - Fraud detection method and in-vehicle network system - Google Patents

Fraud detection method and in-vehicle network system Download PDF

Info

Publication number
JP6864759B2
JP6864759B2 JP2020008169A JP2020008169A JP6864759B2 JP 6864759 B2 JP6864759 B2 JP 6864759B2 JP 2020008169 A JP2020008169 A JP 2020008169A JP 2020008169 A JP2020008169 A JP 2020008169A JP 6864759 B2 JP6864759 B2 JP 6864759B2
Authority
JP
Japan
Prior art keywords
frame
electronic control
control unit
ecu
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2020008169A
Other languages
Japanese (ja)
Other versions
JP6864759B6 (en
JP2020061789A (en
Inventor
前田 学
学 前田
松島 秀樹
秀樹 松島
芳賀 智之
智之 芳賀
勇二 海上
勇二 海上
良浩 氏家
良浩 氏家
剛 岸川
剛 岸川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Intellectual Property Corp of America
Original Assignee
Panasonic Intellectual Property Corp of America
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Panasonic Intellectual Property Corp of America filed Critical Panasonic Intellectual Property Corp of America
Publication of JP2020061789A publication Critical patent/JP2020061789A/en
Publication of JP6864759B2 publication Critical patent/JP6864759B2/en
Application granted granted Critical
Publication of JP6864759B6 publication Critical patent/JP6864759B6/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Small-Scale Networks (AREA)

Description

本開示は、電子制御ユニットが通信を行う車載ネットワークにおいて送信された不正なフレームを検知する技術に関する。 The present disclosure relates to a technique for detecting an illegal frame transmitted in an in-vehicle network with which an electronic control unit communicates.

近年、自動車の中のシステムには、電子制御ユニット(ECU:Electronic Control Unit)と呼ばれる装置が多数配置されている。これらのECUをつなぐネットワークは車載ネットワークと呼ばれる。車載ネットワークには、多数の規格が存在する。その中でも最も主流な車載ネットワークの一つに、ISO11898−1で規定されているCAN(Controller Area Network)という規格が存在する(「非特許文献1」参照)。 In recent years, a large number of devices called electronic control units (ECUs) are arranged in a system in an automobile. The network connecting these ECUs is called an in-vehicle network. There are many standards for in-vehicle networks. Among them, one of the most mainstream in-vehicle networks is a standard called CAN (Controller Area Network) defined by ISO11898-1 (see "Non-Patent Document 1").

CANでは、通信路は2本のバスで構成され、バスに接続されているECUはノードと呼ばれる。バスに接続されている各ノードは、フレームと呼ばれるメッセージを送受信する。フレームを送信する送信ノードは、2本のバスに電圧をかけ、バス間で電位差を発生させることによって、レセシブと呼ばれる「1」の値と、ドミナントと呼ばれる「0」の値を送信する。複数の送信ノードが全く同一のタイミングで、レセシブとドミナントを送信した場合は、ドミナントが優先されて送信される。受信ノードは、受け取ったフレームのフォーマットに異常がある場合には、エラーフレームと呼ばれるフレームを送信する。エラーフレームとは、ドミナントを6bit連続して送信することで、送信ノードや他の受信ノードにフレームの異常を通知するものである。 In CAN, the communication path is composed of two buses, and the ECU connected to the buses is called a node. Each node connected to the bus sends and receives a message called a frame. The transmitting node that transmits the frame transmits a value of "1" called recessive and a value of "0" called dominant by applying a voltage to the two buses and generating a potential difference between the buses. When a plurality of transmitting nodes transmit the recessive and the dominant at exactly the same timing, the dominant is given priority and transmitted. When the format of the received frame is abnormal, the receiving node sends a frame called an error frame. The error frame is to notify the transmitting node and other receiving nodes of the abnormality of the frame by transmitting the dominant 6 bits continuously.

またCANでは送信先や送信元を指す識別子は存在せず、送信ノードはフレーム毎にメッセージIDと呼ばれるIDを付けて送信し(つまりバスに信号を送出し)、各受信ノードは予め定められたメッセージIDのみを受信する(つまりバスから信号を読み取る)。また、CSMA/CA(Carrier Sense Multiple Access/Collision Avoidance)方式を採用しており、複数ノードの同時送信時にはメッセージIDによる調停が行われ、メッセージIDの値が小さいフレームが優先的に送信される。 In CAN, there is no identifier that points to the destination or source, and the transmitting node sends with an ID called a message ID for each frame (that is, sends a signal to the bus), and each receiving node is predetermined. Receive only the message ID (ie read the signal from the bus). Further, the CSMA / CA (Carrier Sense Multiple Access / Collision Avoidance) method is adopted, and when a plurality of nodes are simultaneously transmitted, arbitration is performed by the message ID, and the frame having a small message ID value is preferentially transmitted.

また、異常なメッセージがCANのバス上に送信された場合にゲートウェイ装置が異常メッセージを検出して、他のバスに転送しないことで、バスの負荷の上昇を抑える技術が知られている(「特許文献1」参照)。 Further, there is known a technique for suppressing an increase in bus load by detecting an abnormal message on a CAN bus and not forwarding the abnormal message to another bus ("" See Patent Document 1).

特開2007−38904号公報Japanese Unexamined Patent Publication No. 2007-38904

“CAN Specification 2.0 Part A”、[online]、CAN in Automation(CiA)、[平成26年11月14日検索]、インターネット(URL:http://www.can−cia.org/fileadmin/cia/specifications/CAN20A.pdf)"CAN Specification 2.0 Part A", [online], CAN in Automation (Cia), [Search on November 14, 2014], Internet (URL: http: //www.can-cia.org/fileadmin/ cia / specifications / CAN20A.pdf) RFC2104 HMAC: Keyed−Hashing for Message AuthenticationRFC2104 HMAC: Keyed-Hashing for Message Authentication

ところで、車載ネットワークにおいて不正なノードがバスに接続され、不正なノードが不正にフレーム(メッセージ)を送信することで、車体を不正にコントロールしてしまう可能性があるため、その抑制のために不正なメッセージの検知が必要となる。 By the way, in an in-vehicle network, an unauthorized node is connected to a bus, and an unauthorized node may transmit a frame (message) illegally, which may result in unauthorized control of the vehicle body. Message detection is required.

そこで、本開示は、CANプロトコル等に従って通信する車載ネットワークシステムにおいて、車載バッテリーの消費抑制等のために効率的に、バスに送信される不正なメッセージを検知する不正検知電子制御ユニット(不正検知ECU)を提供する。また、本開示は、効率的に不正なメッセージを検知するための不正検知方法、及び、不正検知ECUを備える車載ネットワークシステムを提供する。 Therefore, the present disclosure discloses a fraud detection electronic control unit (fraud detection ECU) that efficiently detects a fraudulent message transmitted to a bus in order to suppress consumption of a vehicle-mounted battery in an in-vehicle network system that communicates according to a CAN protocol or the like. )I will provide a. The present disclosure also provides an in-vehicle network system including a fraud detection method for efficiently detecting fraudulent messages and a fraud detection ECU.

本開示の一態様に係る不正検知方法は、1以上のネットワークを介して通信する複数の電子制御ユニットを備える車載ネットワークシステムにおいて用いられる不正検知方法であって、前記複数の電子制御ユニットは、第1の電子制御ユニットと第2の電子制御ユニットと第3の電子制御ユニットを含み、前記1以上のネットワークは、第1のネットワークと第2のネットワークを含み、前記第1の電子制御ユニットは前記第1のネットワークに接続され、前記第2の電子制御ユニットは前記第2のネットワークに接続され、前記第3の電子制御ユニットは第1の条件および第2の条件を含むルールを保持し、前記不正検知方法は、前記第3の電子制御ユニットが前記車載ネットワークシステムを備えた車両の状態が前記第1の条件または前記第2の条件を満たしたことを検出する検出ステップと、前記車両の状態が前記第1の条件または前記第2の条件を満たしたことを検出した場合に、前記第3の電子制御ユニットが切替指示メッセージを前記第1の電子制御ユニットと前記第2の電子制御ユニットへ送信し、(i)前記車両の状態が前記第1の条件を満たしたことが検出された場合に、前記第1の電子制御ユニットと前記第2の電子制御ユニットは、動作モードを、前記1以上のネットワーク上の不正なメッセージを検知する第1の種類の検知処理を行わない第1のモードへ移行し、(ii)前記車両の状態が前記第2の条件を満たしたことが検出された場合に、前記第2の電子制御ユニットは、動作モードを、前記第1の種類の検知処理を行う第2のモードへ移行する、切替ステップと、を含む。 The fraud detection method according to one aspect of the present disclosure is a fraud detection method used in an in-vehicle network system including a plurality of electronic control units that communicate via one or more networks, and the plurality of electronic control units are the first. One electronic control unit, a second electronic control unit, and a third electronic control unit are included, the one or more networks include a first network and a second network, and the first electronic control unit includes the first electronic control unit. The second electronic control unit is connected to the first network, the second electronic control unit is connected to the second network, and the third electronic control unit holds a rule including the first condition and the second condition. The fraud detection method includes a detection step in which the third electronic control unit detects that the state of the vehicle provided with the in-vehicle network system satisfies the first condition or the second condition, and the state of the vehicle. When it is detected that the first condition or the second condition is satisfied, the third electronic control unit sends a switching instruction message to the first electronic control unit and the second electronic control unit. When (i) it is detected that the state of the vehicle satisfies the first condition, the first electronic control unit and the second electronic control unit set the operation mode to the above 1. The mode shifts to the first mode in which the first type of detection processing for detecting the malicious message on the above network is not performed, and (ii) it is detected that the state of the vehicle satisfies the second condition. In this case, the second electronic control unit includes a switching step of shifting the operation mode to the second mode in which the first type of detection processing is performed.

また、上記課題を解決するために本開示の一態様に係る車載ネットワークシステムは、1以上のネットワークを介して通信する複数の電子制御ユニットと、前記複数の電子制御ユニットは、第1の電子制御ユニットと第2の電子制御ユニットと第3の電子制御ユニットを含み、前記1以上のネットワークは、第1のネットワークと第2のネットワークを含み、前記第1の電子制御ユニットは前記第1のネットワークに接続され、前記第2の電子制御ユニットは前記第2のネットワークに接続され、前記第3の電子制御ユニットは、第1の条件および第2の条件を含むルールを保持し、前記車載ネットワークシステムを備えた車両の状態が前記第1の条件または前記第2の条件を満たしたことを検出する検出部と、前記検出部により前記車両の状態が前記第1の条件または前記第2の条件を満たしたことが検出された場合に、切替指示メッセージを前記第1の電子制御ユニットと前記第2の電子制御ユニットへ送信する送信部と、を備え、前記車両の状態が前記第1の条件を満たしたことが検出された場合に、前記第1の電子制御ユニットと前記第2の電子制御ユニットは、動作モードを、前記1以上のネットワーク上の不正なメッセージを検知する第1の種類の検知処理を行わない第1のモードへ移行し、前記車両の状態が前記第2の条件を満たしたことが検出された場合に、前記第2の電子制御ユニットは、動作モードを、前記第1の種類の検知処理を行う第2のモードへ移行する。 Further, in order to solve the above problems, the in-vehicle network system according to one aspect of the present disclosure includes a plurality of electronic control units that communicate via one or more networks, and the plurality of electronic control units are first electronically controlled. The unit, the second electronic control unit, and the third electronic control unit are included, the one or more networks include a first network and a second network, and the first electronic control unit includes the first network. The second electronic control unit is connected to the second network, and the third electronic control unit holds a rule including the first condition and the second condition, and the in-vehicle network system. A detection unit that detects that the state of the vehicle provided with the above-mentioned first condition or the second condition is satisfied, and the detection unit determines that the state of the vehicle is the first condition or the second condition. A transmission unit for transmitting a switching instruction message to the first electronic control unit and the second electronic control unit when it is detected that the condition is satisfied is provided, and the state of the vehicle satisfies the first condition. When it is detected that the condition is satisfied, the first electronic control unit and the second electronic control unit set the operation mode to the first type of detection for detecting an unauthorized message on the one or more networks. When the mode shifts to the first mode in which the processing is not performed and it is detected that the state of the vehicle satisfies the second condition, the second electronic control unit sets the operation mode to the first mode. The mode shifts to the second mode in which the type of detection processing is performed.

本開示によれば、例えば車載バッテリーの電力等で稼動する車載ネットワークシステムでバスに不正なノードが接続されて不正なメッセージが送信された場合にその検知が可能となり、車両の状態に応じて一定条件下で検知を省略するので、バッテリー消費が抑制され得る。 According to the present disclosure, for example, in an in-vehicle network system operated by the electric power of an in-vehicle battery, when an unauthorized node is connected to a bus and an unauthorized message is transmitted, it is possible to detect the illegal message, which is constant according to the state of the vehicle. Since detection is omitted under the conditions, battery consumption can be suppressed.

実施の形態1に係る車載ネットワークシステムの全体構成を示す図である。It is a figure which shows the whole structure of the vehicle-mounted network system which concerns on Embodiment 1. FIG. CANプロトコルで規定されるデータフレームのフォーマットを示す図である。It is a figure which shows the format of the data frame specified by the CAN protocol. CANプロトコルで規定されるエラーフレームのフォーマットを示す図である。It is a figure which shows the format of the error frame specified by the CAN protocol. ヘッドユニットの構成図である。It is a block diagram of a head unit. 受信IDリストの一例を示した図である。It is a figure which showed an example of the reception ID list. ゲートウェイの構成図である。It is a block diagram of a gateway. 転送ルールの一例を示した図である。It is a figure which showed an example of the forwarding rule. 実施の形態1に係るECUの構成図である。It is a block diagram of the ECU which concerns on Embodiment 1. FIG. 受信IDリストの一例を示した図である。It is a figure which showed an example of the reception ID list. エンジンに接続されたECUから送信されるフレームにおけるID及びデータフィールドの一例を示す図である。It is a figure which shows an example of the ID and the data field in the frame transmitted from the ECU connected to an engine. ブレーキに接続されたECUから送信されるフレームにおけるID及びデータフィールドの一例を示す図である。It is a figure which shows an example of the ID and the data field in the frame transmitted from the ECU connected to a brake. ドア開閉センサに接続されたECUから送信されるフレームにおけるID及びデータフィールドの一例を示す図である。It is a figure which shows an example of the ID and the data field in the frame transmitted from the ECU connected to the door open / close sensor. 窓開閉センサに接続されたECUから送信されるフレームにおけるID及びデータフィールドの一例を示す図である。It is a figure which shows an example of the ID and the data field in the frame transmitted from the ECU connected to the window open / close sensor. 実施の形態1に係る不正検知ECUの構成図である。It is a block diagram of the fraud detection ECU which concerns on Embodiment 1. FIG. 不正検知ECUに保持される正規IDリストの一例を示した図である。It is a figure which showed an example of the regular ID list held in the fraud detection ECU. 不正検知ECUに保持される正規IDリストの一例を示した図である。It is a figure which showed an example of the regular ID list held in the fraud detection ECU. メッセージID毎の不正検知カウンタの状態の一例を示す図である。It is a figure which shows an example of the state of the fraud detection counter for each message ID. 実施の形態1における不正なフレームの検知及び実行阻止に係る動作例を示すシーケンス図である。It is a sequence diagram which shows the operation example which concerns on the detection and execution prevention of an illegal frame in Embodiment 1. FIG. 実施の形態2に係る車載ネットワークシステムの全体構成を示す図である。It is a figure which shows the whole structure of the vehicle-mounted network system which concerns on Embodiment 2. 実施の形態2に係る不正検知ECUの構成図である。It is a block diagram of the fraud detection ECU which concerns on Embodiment 2. FIG. 不正検知ECUに保持されるデータ範囲リストの一例を示した図である。It is a figure which showed an example of the data range list held in the fraud detection ECU. 実施の形態2における不正なフレームの検知及び実行阻止に係る動作例を示すシーケンス図である(図23に続く)。It is a sequence diagram which shows the operation example which concerns on the detection and execution prevention of an illegal frame in Embodiment 2 (following FIG. 23). 実施の形態2における不正なフレームの検知及び実行阻止に係る動作例を示すシーケンス図である(図22から続く)。It is a sequence diagram which shows the operation example which concerns on the detection and execution prevention of an illegal frame in Embodiment 2 (continuation from FIG. 22). 実施の形態3に係る車載ネットワークシステムの全体構成を示す図である。It is a figure which shows the whole structure of the vehicle-mounted network system which concerns on Embodiment 3. 実施の形態3に係るECUの構成図である。It is a block diagram of the ECU which concerns on Embodiment 3. エンジンに接続されたECUから送信されるデータフレームにおけるID及びデータフィールドの一例を示す図である。It is a figure which shows an example of the ID and the data field in the data frame transmitted from the ECU connected to an engine. ブレーキに接続されたECUから送信されるデータフレームにおけるID及びデータフィールドの一例を示す図である。It is a figure which shows an example of the ID and the data field in the data frame transmitted from the ECU connected to the brake. ドア開閉センサに接続されたECUから送信されるデータフレームにおけるID及びデータフィールドの一例を示す図である。It is a figure which shows an example of the ID and the data field in the data frame transmitted from the ECU connected to the door open / close sensor. 窓開閉センサに接続されたECUから送信されるデータフレームにおけるID及びデータフィールドの一例を示す図である。It is a figure which shows an example of the ID and the data field in the data frame transmitted from the ECU connected to the window open / close sensor. 実施の形態3に係る不正検知ECUの構成図である。It is a block diagram of the fraud detection ECU which concerns on Embodiment 3. 実施の形態3に係るカウンタ保持部に保持されているメッセージID毎のカウンタ値の一例を示す図である。It is a figure which shows an example of the counter value for each message ID held in the counter holding part which concerns on Embodiment 3. FIG. 実施の形態3における不正なフレームの検知及び実行阻止に係る動作例を示すシーケンス図である(図33に続く)。It is a sequence diagram which shows the operation example which concerns on the detection and execution prevention of an illegal frame in Embodiment 3 (following FIG. 33). 実施の形態3における不正なフレームの検知及び実行阻止に係る動作例を示すシーケンス図である(図32から続く)。It is a sequence diagram which shows the operation example which concerns on the detection and execution prevention of an illegal frame in Embodiment 3 (continuation from FIG. 32). 実施の形態4に係る車載ネットワークシステムシステムの全体構成を示す図である。It is a figure which shows the whole structure of the vehicle-mounted network system system which concerns on Embodiment 4. 実施の形態4に係るヘッドユニットの構成図である。It is a block diagram of the head unit which concerns on Embodiment 4. FIG. 実施の形態4に係る不正検知ECUの構成図である。It is a block diagram of the fraud detection ECU which concerns on Embodiment 4. FIG. 実施の形態4におけるチェックモードへの移行シーケンスの一例を示す図である。It is a figure which shows an example of the transition sequence to the check mode in Embodiment 4. 実施の形態4における待機モードへの移行シーケンスの一例を示す図である。It is a figure which shows an example of the transition sequence to the standby mode in Embodiment 4. 実施の形態4における待機モードへの移行シーケンスの一例を示す図である。It is a figure which shows an example of the transition sequence to the standby mode in Embodiment 4. 他の実施の形態に係るECUの構成図である。It is a block diagram of the ECU which concerns on other embodiment. 他の実施の形態に係る不正検知ECUの構成図である。It is a block diagram of the fraud detection ECU which concerns on other embodiment. 他の実施の形態に係る不正検知ECUの構成図である。It is a block diagram of the fraud detection ECU which concerns on other embodiment.

本開示の一態様に係る不正検知方法は、1以上のバスを介して通信する複数の電子制御ユニットを備える車載ネットワークシステムにおいて用いられる不正検知方法であって、前記車載ネットワークシステムを搭載する車両の状態が一定条件を満たしたことを検出する検出ステップと、前記検出ステップにおいて前記車両の状態が一定条件を満たしたことが検出された場合に、前記バスに接続された不正検知電子制御ユニットの動作モードを、当該バス上の不正なメッセージを検知する所定種類の検知処理を行う第1モードと当該所定種類の検知処理を行わない第2モードとの間で切り替える切替ステップとを含む不正検知方法である。ここで、不正検知電子制御ユニット(不正検知ECU)は、バスに接続され、そのバスに送信される不正なメッセージを検知するための所定種類の検知処理を実行する機能を有する。不正なメッセージか否かは、検知処理により、予め定められた条件に適合するか否かで判断される。例えば不正検知ECUが1種類の検知処理しか行えない場合には、検知処理を行うか行わないかが動作モードにより切り替わることになる。この不正検知方法によれば、車両の状態に応じて一定条件下で、不正検知ECUが不正なメッセージの所定種類の検知処理を省略可能となるため、車両のバッテリー消費が抑制され得る。 The fraud detection method according to one aspect of the present disclosure is a fraud detection method used in an in-vehicle network system including a plurality of electronic control units that communicate via one or more buses, and is a fraud detection method for a vehicle equipped with the in-vehicle network system. An operation of a fraud detection electronic control unit connected to the bus when a detection step for detecting that the state satisfies a certain condition and a detection step for detecting that the state of the vehicle satisfies a certain condition are detected. A fraud detection method that includes a switching step of switching the mode between a first mode that performs a predetermined type of detection process for detecting an illegal message on the bus and a second mode that does not perform the predetermined type of detection process. is there. Here, the fraud detection electronic control unit (fraud detection ECU) has a function of being connected to a bus and executing a predetermined type of detection process for detecting a fraudulent message transmitted to the bus. Whether or not the message is invalid is determined by the detection process based on whether or not the message meets a predetermined condition. For example, when the fraud detection ECU can perform only one type of detection processing, whether or not to perform the detection processing is switched depending on the operation mode. According to this fraud detection method, the fraud detection ECU can omit the detection process of a predetermined type of fraudulent message under certain conditions according to the state of the vehicle, so that the battery consumption of the vehicle can be suppressed.

また、前記複数の電子制御ユニットは、Controller Area Network(CAN)プロトコルに従って前記バスを介して通信を行うこととしても良い。これにより、CANプロトコルに従って通信する車載ネットワークシステムに不正なECUが接続されて不正なフレームが送信された場合にその不正を不正検知ECUが検知する期間が、車両の状態に応じて限定され得るため、電力消費量が低減され得る。 Further, the plurality of electronic control units may communicate via the bus according to the Controller Area Network (CAN) protocol. As a result, when a fraudulent ECU is connected to an in-vehicle network system that communicates according to the CAN protocol and a fraudulent frame is transmitted, the period for which the fraud detection ECU detects the fraud can be limited depending on the state of the vehicle. , Power consumption can be reduced.

また、前記検出ステップでは、前記複数の電子制御ユニットのうち1つの電子制御ユニットが前記検出を行い、前記切替ステップでは、前記検出ステップで前記検出を行った1つの電子制御ユニットが切替指示メッセージを送信し、当該切替指示メッセージを受信した場合に前記不正検知電子制御ユニットが前記動作モードを切り替えることとしても良い。これにより、例えば、不正検知ECUは、不正なメッセージを検知する検知処理を行わない第2モードにおいては、切替指示メッセージ(つまり動作モードの切り替えのトリガーとなるトリガーフレーム)の検出を行うだけで足りるようになる。即ち、不正検知ECUは、車両の状態を直接検出するための検出部(例えばセンサ等)を有さなくても良い。 Further, in the detection step, one of the plurality of electronic control units performs the detection, and in the switching step, one electronic control unit that performs the detection in the detection step issues a switching instruction message. The fraud detection electronic control unit may switch the operation mode when the transmission is performed and the switching instruction message is received. As a result, for example, in the second mode in which the fraud detection ECU does not perform the detection process for detecting a fraudulent message, it is sufficient to detect the switching instruction message (that is, the trigger frame that triggers the switching of the operation mode). Will be. That is, the fraud detection ECU does not have to have a detection unit (for example, a sensor or the like) for directly detecting the state of the vehicle.

また、前記検出ステップでは、前記1つの電子制御ユニットが、前記バス上で不正なメッセージを検知した場合に、前記車両の状態が前記一定条件を満たしたとして前記検出を行い、前記切替ステップでは、前記検出ステップで前記検出を行った場合に前記1つの電子制御ユニットが、前記第1モードに切り替える旨を示す切替指示メッセージを送信し、当該切替指示メッセージを受信した場合に前記不正検知電子制御ユニットが前記動作モードを前記第1モードに切り替えることとしても良い。これにより、あるバス上に不正なメッセージが送信されていることが検出された場合に、不正検知ECUが第1モード(不正なメッセージを検知するチェックモード)になり、不正検知ECUが接続されたバス上の不正なメッセージが検知されるようになる。 Further, in the detection step, when the one electronic control unit detects an invalid message on the bus, the detection is performed assuming that the state of the vehicle satisfies the certain condition, and in the switching step, the detection is performed. When the detection is performed in the detection step, the one electronic control unit transmits a switching instruction message indicating to switch to the first mode, and when the switching instruction message is received, the fraud detection electronic control unit. May switch the operation mode to the first mode. As a result, when it is detected that an illegal message is being transmitted on a certain bus, the fraud detection ECU is set to the first mode (check mode for detecting an illegal message), and the fraud detection ECU is connected. Illegal messages on the bus will be detected.

また、前記検出ステップでは、前記1つの電子制御ユニットが、前記バス上で一定期間において不正なメッセージを検知しなかった場合に、前記車両の状態が前記一定条件を満たしたとして前記検出を行い、前記切替ステップでは、前記検出ステップで前記検出を行った場合に前記1つの電子制御ユニットが、前記第2モードに切り替える旨を示す切替指示メッセージを送信し、当該切替指示メッセージを受信した場合に前記不正検知電子制御ユニットが前記動作モードを前記第2モードに切り替えることとしても良い。これにより、あるバス上に一定期間、不正なメッセージが送信されなかったことが検出された場合に、不正検知ECUが第2モード(不正なメッセージを検知しない待機モード)になり電力消費量が低減され得る。 Further, in the detection step, when the one electronic control unit does not detect an illegal message on the bus for a certain period of time, the detection is performed assuming that the state of the vehicle satisfies the certain condition. In the switching step, when the detection is performed in the detection step, the one electronic control unit transmits a switching instruction message indicating to switch to the second mode, and when the switching instruction message is received, the switching instruction message is received. The fraud detection electronic control unit may switch the operation mode to the second mode. As a result, when it is detected that an illegal message has not been transmitted on a certain bus for a certain period of time, the fraud detection ECU is set to the second mode (standby mode in which the illegal message is not detected) and the power consumption is reduced. Can be done.

また、前記一定条件は、前記車両の使用が開始されたことであり、前記切替ステップでは、前記検出ステップで前記車両の使用が開始されたことが検出された場合に、前記動作モードを前記第1モードに切り替えることとしても良い。車両の使用とは、例えば、ユーザが、車両を走行させること、車両の走行の準備(ドア開け、乗車、エンジン始動等)をすること等である。また、例えば走行が不要となったときに、駐車(エンジン停止等)すること、降車すること等で使用が終わる。なお、ユーザの自宅の駐車場等といった特定の駐車場以外の場所における駐車中(給油所その他の外出先での駐車中)においては駐車及び降車があっても使用が終わらないと扱っても良い。これにより、車両の使用が開始された場合に、不正検知ECUが第1モード(不正なメッセージを検知するチェックモード)になり、不正検知ECUが接続されたバス上の不正なメッセージが検知されるようになる。従って、例えば駐車してユーザが車両から離れている間に車載ネットワークシステムに不正なECUが付加されたとしても、ユーザが車両に戻って車両の使用を開始してからはその不正なECUが不正なメッセージを送信すれば、その不正が検知されるようになる。 Further, the certain condition is that the use of the vehicle is started, and in the switching step, when it is detected that the use of the vehicle is started in the detection step, the operation mode is set to the first operation mode. It may be switched to one mode. The use of a vehicle means, for example, that the user runs the vehicle, prepares for the running of the vehicle (opening a door, getting on a vehicle, starting an engine, etc.). Further, for example, when traveling is no longer necessary, the use is completed by parking (stopping the engine, etc.), getting off, or the like. In addition, while parking in a place other than a specific parking lot such as the user's home parking lot (parking at a gas station or other outside location), it may be treated that the use does not end even if the vehicle is parked or disembarked. .. As a result, when the vehicle starts to be used, the fraud detection ECU enters the first mode (check mode for detecting fraudulent messages), and fraudulent messages on the bus to which the fraud detection ECU is connected are detected. Will be. Therefore, for example, even if an illegal ECU is added to the in-vehicle network system while the user is parked and away from the vehicle, the illegal ECU is illegal after the user returns to the vehicle and starts using the vehicle. If you send a message, the fraud will be detected.

また、前記車両に搭載されたエンジンが始動したことを検出することにより、車両の使用が開始されたことの前記検出を行うこととしても良い。これにより、エンジンが始動したときから、不正検知ECUが不正なメッセージを検知する状態となる。従って、例えば駐車してユーザが車両から離れている間に車載ネットワークシステムに不正なECUが付加されたとしても、ユーザが車両に戻ってエンジンを始動してからはその不正なECUが不正なメッセージを送信すれば、その不正が検知されるようになる。 Further, by detecting that the engine mounted on the vehicle has started, the detection that the use of the vehicle has started may be performed. As a result, the fraud detection ECU is in a state of detecting a fraudulent message from the time the engine is started. Therefore, for example, even if an illegal ECU is added to the in-vehicle network system while the user is parked and away from the vehicle, the illegal ECU will give an invalid message after the user returns to the vehicle and starts the engine. If you send, the fraud will be detected.

また、前記不正検知方法は更に、前記切替ステップで前記動作モードが前記第1モードに切り替えられた後に、前記車両の使用が開始されてから所定時間が経過した際に、前記動作モードを前記第2モードに切り替える再切替ステップを含むこととしても良い。これにより、車両の使用が開始されてから所定時間が経過した際に、無条件又は一定条件下で不正検知ECUが第2モード(不正なメッセージを検知しない待機モード)になり、電力消費量が低減され得る。 Further, the fraud detection method further changes the operation mode to the first mode when a predetermined time elapses from the start of use of the vehicle after the operation mode is switched to the first mode in the switching step. It may include a re-switching step to switch to the two modes. As a result, when a predetermined time elapses from the start of use of the vehicle, the fraud detection ECU goes into the second mode (standby mode in which a fraudulent message is not detected) under unconditional or constant conditions, and the power consumption is reduced. Can be reduced.

また、前記一定条件は、前記複数の電子制御ユニットのいずれかが前記車両の外部の装置と通信を開始する状態になったことであり、前記切替ステップでは、前記検出ステップで前記通信を開始する状態になったことが検出された場合に、前記動作モードを前記第1モードに切り替えることとしても良い。これにより、外部との通信が開始されると不正検知ECUが不正なメッセージを検知する状態となる。従って、例えば外部の装置から車載ネットワークシステムのヘッドユニット等が攻撃され、不正なメッセージ(フレーム)を外部から注入されても迅速に検知し得るようになる。なお、外部から不正なメッセージを送信するためのプログラム等が供給されたような場合にも同様に対処し得る。 Further, the certain condition is that any one of the plurality of electronic control units is in a state of starting communication with an external device of the vehicle, and in the switching step, the communication is started in the detection step. When it is detected that the state has been reached, the operation mode may be switched to the first mode. As a result, when communication with the outside is started, the fraud detection ECU is in a state of detecting a fraudulent message. Therefore, for example, even if an external device attacks the head unit of an in-vehicle network system and an invalid message (frame) is injected from the outside, it can be quickly detected. It should be noted that the same measures can be taken when a program or the like for sending an illegal message is supplied from the outside.

また、前記一定条件は、前記複数の電子制御ユニットのいずれかが前記車両の外部の装置と通信して通信終了後の一定状態になったことであり、前記切替ステップでは、前記検出ステップで前記通信終了後の一定状態になったことが検出された場合に、前記動作モードを前記第2モードに切り替えることとしても良い。これにより、外部との通信が終了しバス上に不正なメッセージが送信される可能性が低下した場合に、不正なメッセージの検知の省略によりバッテリー消費を抑制できる。なお、不正なメッセージが送信される可能性が低下した場合は具体的には、例えば、通信が遮断された状態になった場合、通信終了から一定時間(例えば数分間)が経過した状態になった場合等である。 Further, the constant condition is that any one of the plurality of electronic control units communicates with an external device of the vehicle and becomes a constant state after the communication is completed. In the switching step, the detection step is described. When it is detected that a constant state has been reached after the end of communication, the operation mode may be switched to the second mode. As a result, when the communication with the outside is terminated and the possibility of transmitting an illegal message on the bus is reduced, the battery consumption can be suppressed by omitting the detection of the illegal message. When the possibility of sending an illegal message is reduced, specifically, for example, when communication is cut off, a certain period of time (for example, several minutes) has passed since the end of communication. For example.

また、前記車載ネットワークシステムでは前記複数の電子制御ユニットの通信に複数のバスが用いられ、前記車載ネットワークシステムは更に前記複数のバスの間でメッセージを転送する機能を有するゲートウェイ装置を備え、前記検出ステップでは、前記複数の電子制御ユニットのうち、前記不正検知電子制御ユニットと異なるバスに接続された1つの電子制御ユニットが前記検出を行い、前記切替ステップでは、前記検出ステップで前記検出を行った1つの電子制御ユニットが切替指示メッセージを送信し、前記ゲートウェイ装置に転送された当該切替指示メッセージを受信した場合に前記不正検知電子制御ユニットが前記動作モードを切り替えることとしても良い。これにより、車載ネットワークシステムにおける1つのバスに接続されたECUにより検出された車両の状態に応じて別の1以上のバスそれぞれに接続された各不正検知ECUが動作モードを切り替えることができるようになる。 Further, in the in-vehicle network system, a plurality of buses are used for communication of the plurality of electronic control units, and the in-vehicle network system further includes a gateway device having a function of transferring a message between the plurality of buses, and the detection. In the step, one of the plurality of electronic control units connected to a bus different from the fraud detection electronic control unit performed the detection, and in the switching step, the detection was performed in the detection step. When one electronic control unit transmits a switching instruction message and receives the switching instruction message transferred to the gateway device, the fraud detection electronic control unit may switch the operation mode. As a result, each fraud detection ECU connected to each of the other one or more buses can switch the operation mode according to the state of the vehicle detected by the ECU connected to one bus in the in-vehicle network system. Become.

また、前記検出ステップでは、車両の状態が変化した場合において、所定のユーザインタフェースにより前記動作モードの切り替えの要否に係る入力を受け付け、当該入力が前記動作モードの切り替えを要する旨を示すときには、前記車両の状態が前記一定条件を満たしたとして前記検出を行うこととしても良い。これにより、不正検知ECUの動作モードの切り替えに、ユーザの判断が反映されるようになるので、ユーザの事情等に応じて適切に動作モードが切り替えられるようになる。 Further, in the detection step, when the state of the vehicle changes, an input relating to the necessity of switching the operation mode is received by a predetermined user interface, and when the input indicates that the operation mode needs to be switched, the input indicates that the operation mode needs to be switched. The detection may be performed on the assumption that the state of the vehicle satisfies the certain condition. As a result, the user's judgment is reflected in the switching of the operation mode of the fraud detection ECU, so that the operation mode can be appropriately switched according to the user's circumstances and the like.

また、前記第2モードでは、不正なメッセージを検知可能な程度が、前記所定種類の検知処理とは異なる種類の検知処理を行うこととしても良い。例えば不正検知ECUが、不正なメッセージを検知するために処理量の比較的多い第一種の検知処理と処理量の比較的少ない第二種の検知処理とを実行可能である場合に、第一種の検知処理を行うか第二種の検知処理を行うかが動作モードにより切り替わる。これにより、車両の状態に応じて一定条件下で、不正検知ECUが不正なメッセージの所定種類の検知処理(例えば第一種の検知処理)を省略可能となるため、車両のバッテリー消費が抑制され得る。なお、不正検知ECUにおける検知処理の処理量の多さは、必ずしも不正を検知可能な程度の高さに比例するものではないが、概ね不正なメッセージを検知可能な程度の高さと関連する傾向がある。このため、例えば概ね不正検知程度が高く処理量の多い検知処理を一定の場合に限って実行しその他の場合にはそれより処理量の少ない検知処理を行うように動作モードを切り換えること等が有用となる。 Further, in the second mode, a type of detection process different from the predetermined type of detection process may be performed to the extent that an illegal message can be detected. For example, when the fraud detection ECU can execute the first type detection process having a relatively large amount of processing and the second type detection process having a relatively small amount of processing in order to detect a fraudulent message, the first case. Whether to perform the type detection process or the second type detection process is switched depending on the operation mode. As a result, the fraud detection ECU can omit a predetermined type of detection process (for example, first-class detection process) of a fraudulent message under certain conditions according to the state of the vehicle, so that the battery consumption of the vehicle is suppressed. obtain. The amount of detection processing in the fraud detection ECU is not necessarily proportional to the height at which fraud can be detected, but tends to be generally related to the height at which fraud can be detected. is there. For this reason, for example, it is useful to switch the operation mode so that the detection process having a high degree of fraud detection and a large amount of processing is executed only in a certain case and the detection process having a smaller amount of processing is performed in other cases. It becomes.

また、本開示の一態様に係る車載ネットワークシステムは、1以上のバスを介して通信する複数の電子制御ユニットと前記バスに接続された不正検知電子制御ユニットとを備える車載ネットワークシステムであって、前記車載ネットワークシステムを搭載する車両の状態が一定条件を満たしたことを検出する検出部と、前記検出部により前記車両の状態が一定条件を満たしたことが検出された場合に、前記バスに接続された不正検知電子制御ユニットの動作モードを、当該バス上の不正なメッセージを検知する所定種類の検知処理を行う第1モードと当該所定種類の検知処理を行わない第2モードとの間で切り替える切替部とを備える車載ネットワークシステムである。これにより、車両の状態に応じて一定条件下で、不正検知ECUが不正なメッセージの所定種類の検知処理を省略可能となるため、車両のバッテリー消費が抑制され得る。 Further, the in-vehicle network system according to one aspect of the present disclosure is an in-vehicle network system including a plurality of electronic control units that communicate via one or more buses and a fraud detection electronic control unit connected to the bus. A detection unit that detects that the state of the vehicle equipped with the in-vehicle network system satisfies a certain condition, and a detection unit that detects that the state of the vehicle satisfies a certain condition, the bus is connected to the bus. The operation mode of the fraud detection electronic control unit is switched between the first mode in which a predetermined type of detection process for detecting a fraudulent message on the bus is performed and the second mode in which the predetermined type of detection process is not performed. It is an in-vehicle network system equipped with a switching unit. As a result, the fraud detection ECU can omit the detection process of a predetermined type of the fraudulent message under a certain condition according to the state of the vehicle, so that the battery consumption of the vehicle can be suppressed.

また、本開示の一態様に係る不正検知電子制御ユニット(不正検知ECU)は、1以上のバスを介して通信する複数の電子制御ユニットが通信に用いるバスに接続される不正検知電子制御ユニットであって、前記複数の電子制御ユニットを搭載する車両の状態が一定条件を満たしたことを検出する検出部と、前記検出部により前記車両の状態が一定条件を満たしたことが検出された場合に、自装置の動作モードを、前記バス上の不正なメッセージを検知する所定種類の検知処理を行う第1モードと当該所定種類の検知処理を行わない第2モードとの間で切り替える切替部を備える不正検知電子制御ユニットである。これにより、車両の状態に応じて一定条件下で、不正検知ECUが不正なメッセージの所定種類の検知処理を省略可能となるため、車両のバッテリー消費が抑制され得る。 Further, the fraud detection electronic control unit (fraud detection ECU) according to one aspect of the present disclosure is a fraud detection electronic control unit connected to a bus used for communication by a plurality of electronic control units communicating via one or more buses. When the detection unit detects that the state of the vehicle equipped with the plurality of electronic control units satisfies a certain condition, and the detection unit detects that the state of the vehicle satisfies the certain condition. The operation mode of the own device is provided with a switching unit for switching between a first mode that performs a predetermined type of detection process for detecting an illegal message on the bus and a second mode that does not perform the predetermined type of detection process. It is a fraud detection electronic control unit. As a result, the fraud detection ECU can omit the detection process of a predetermined type of the fraudulent message under a certain condition according to the state of the vehicle, so that the battery consumption of the vehicle can be suppressed.

なお、これらの全般的又は具体的な態様は、システム、方法、集積回路、コンピュータプログラム又はコンピュータで読み取り可能なCD−ROM等の記録媒体で実現されても良く、システム、方法、集積回路、コンピュータプログラム又は記録媒体の任意な組み合わせで実現されても良い。 It should be noted that these general or specific aspects may be realized by a system, a method, an integrated circuit, a computer program, or a recording medium such as a computer-readable CD-ROM, and the system, method, integrated circuit, computer. It may be realized by any combination of programs or recording media.

以下、実施の形態に係る車載ネットワークシステム、不正検知ECU等について、図面を参照しながら説明する。ここで示す実施の形態は、いずれも本開示の一具体例を示すものである。従って、以下の実施の形態で示される数値、形状、材料、構成要素、構成要素の配置及び接続形態、並びに、ステップ(工程)及びステップの順序等は、一例であって本開示を限定するものではない。以下の実施の形態における構成要素のうち、独立請求項に記載されていない構成要素については、任意に付加可能な構成要素である。また、各図は、模式図であり、必ずしも厳密に図示されたものではない。 Hereinafter, the in-vehicle network system, the fraud detection ECU, and the like according to the embodiment will be described with reference to the drawings. Each of the embodiments shown here shows a specific example of the present disclosure. Therefore, the numerical values, shapes, materials, components, arrangement and connection forms of the components, steps (processes), order of steps, etc. shown in the following embodiments are examples and limit the present disclosure. is not it. Among the components in the following embodiments, the components not described in the independent claims are components that can be arbitrarily added. Further, each figure is a schematic view and is not necessarily exactly illustrated.

(実施の形態1)
以下、本開示の実施の形態として、メッセージIDを用いて他のノード(ECU)において不正なフレームに基づく処理が実行されることを阻止するための不正対処方法を実現する不正検知ECUを含む車載ネットワークシステム10について図面を用いて説明する。
(Embodiment 1)
Hereinafter, as an embodiment of the present disclosure, an in-vehicle device including a fraud detection ECU that realizes a fraud countermeasure method for preventing processing based on a fraud frame from being executed on another node (ECU) using a message ID. The network system 10 will be described with reference to the drawings.

[1.1 車載ネットワークシステム10の全体構成]
図1は、実施の形態1に係る車載ネットワークシステム10の全体構成を示す図である。車載ネットワークシステム10は、CANプロトコルに従って通信するネットワーク通信システムの一例であり、制御装置、センサ等の各種機器が搭載された自動車におけるネットワーク通信システムである。車載ネットワークシステム10は、バス500a、500bと、不正検知ECU100a、100b、ヘッドユニット200、ゲートウェイ300、及び、各種機器に接続されたECU400a〜400d等のECUといったバスに接続された各ノードとを含んで構成される。なお、図1では省略しているものの、車載ネットワークシステム10にはECU400a〜400d以外にもいくつものECUが含まれ得るが、ここでは、便宜上ECU400a〜400dに注目して説明を行う。ECUは、例えば、プロセッサ(マイクロプロセッサ)、メモリ等のデジタル回路、アナログ回路、通信回路等を含む装置である。メモリは、ROM、RAM等であり、プロセッサにより実行される制御プログラム(コンピュータプログラム)を記憶することができる。例えばプロセッサが、制御プログラム(コンピュータプログラム)に従って動作することにより、ECUは各種機能を実現することになる。なお、コンピュータプログラムは、所定の機能を達成するために、プロセッサに対する指令を示す命令コードが複数個組み合わされて構成されたものである。ここでは、バス500a、500bには不正なフレームを送信する不正ECUが接続されている可能性があることを前提として説明する。
[1.1 Overall configuration of in-vehicle network system 10]
FIG. 1 is a diagram showing an overall configuration of the vehicle-mounted network system 10 according to the first embodiment. The in-vehicle network system 10 is an example of a network communication system that communicates according to the CAN protocol, and is a network communication system in an automobile equipped with various devices such as a control device and a sensor. The in-vehicle network system 10 includes buses 500a and 500b, and each node connected to the bus such as fraud detection ECUs 100a and 100b, head unit 200, gateway 300, and ECUs such as ECUs 400a to 400d connected to various devices. Consists of. Although omitted in FIG. 1, the in-vehicle network system 10 may include a number of ECUs in addition to the ECUs 400a to 400d, but here, the ECUs 400a to 400d will be focused on for convenience. The ECU is, for example, a device including a processor (microprocessor), a digital circuit such as a memory, an analog circuit, a communication circuit, and the like. The memory is a ROM, RAM, or the like, and can store a control program (computer program) executed by the processor. For example, when the processor operates according to a control program (computer program), the ECU realizes various functions. A computer program is configured by combining a plurality of instruction codes indicating instructions to a processor in order to achieve a predetermined function. Here, the description will be made on the premise that there is a possibility that an illegal ECU for transmitting an illegal frame is connected to the buses 500a and 500b.

不正検知ECU100a、100bは、それぞれバス500a、バス500bに接続され、ECU400a〜400d等により送信されたフレームが不正であるかどうかを判定し、不正であればエラーフレームを送信する機能を有するECUである。 The fraud detection ECUs 100a and 100b are connected to the buses 500a and 500b, respectively, and are ECUs having a function of determining whether or not the frames transmitted by the ECUs 400a to 400d are invalid and transmitting an error frame if they are invalid. is there.

ECU400a〜400dは、いずれかのバスと接続され、また、それぞれエンジン401、ブレーキ402、ドア開閉センサ403、窓開閉センサ404に接続されている。ECU400a〜400dのそれぞれは、接続されている機器(エンジン401等)の状態を取得し、定期的に状態を表すフレーム(後述するデータフレーム)等をネットワーク(つまりバス)に送信している。 The ECUs 400a to 400d are connected to any of the buses, and are also connected to the engine 401, the brake 402, the door open / close sensor 403, and the window open / close sensor 404, respectively. Each of the ECUs 400a to 400d acquires the state of the connected device (engine 401, etc.) and periodically transmits a frame (data frame, which will be described later) or the like indicating the state to the network (that is, a bus).

ゲートウェイ300は、不正検知ECU100a、ECU400a及びECU400bがつながるバス500aと、不正検知ECU100b、ECU400c及びECU400dがつながるバス500bと、ヘッドユニット200がつながるバス500cとに接続しており、それぞれのバスから受信したフレームを他のバスに転送する機能を有する。また受信したフレームを転送するかしないかを接続されたバス間毎に切り替えることも可能である。ゲートウェイ300も一種のECUである。 The gateway 300 is connected to a bus 500a to which the fraud detection ECU 100a, the ECU 400a and the ECU 400b are connected, a bus 500b to which the fraud detection ECU 100b, the ECU 400c and the ECU 400d are connected, and a bus 500c to which the head unit 200 is connected, and received from each bus. It has a function to transfer a frame to another bus. It is also possible to switch whether to transfer the received frame or not for each connected bus. The gateway 300 is also a kind of ECU.

ヘッドユニット200は、フレームを受信する機能を持ち、ECU400a〜400dから送信されるフレームを受信し、各種状態をディスプレイ(図示しない)に表示して、ユーザに提示する機能を持つ。ヘッドユニット200も一種のECUである。 The head unit 200 has a function of receiving frames, and has a function of receiving frames transmitted from ECUs 400a to 400d, displaying various states on a display (not shown), and presenting them to the user. The head unit 200 is also a kind of ECU.

この車載ネットワークシステム10においてはCANプロトコルに従って各ECUがフレームの授受を行う。CANプロトコルにおけるフレームには、データフレーム、リモートフレーム、オーバーロードフレーム及びエラーフレームがある。説明の便宜上、まずはデータフレーム及びエラーフレームを中心に説明する。 In the in-vehicle network system 10, each ECU sends and receives frames according to the CAN protocol. Frames in the CAN protocol include data frames, remote frames, overload frames and error frames. For convenience of explanation, first, a data frame and an error frame will be mainly described.

[1.2 データフレームフォーマット]
以下、CANプロトコルに従ったネットワークで用いられるフレームの1つであるデータフレームについて説明する。
[1.2 Data frame format]
Hereinafter, a data frame, which is one of the frames used in a network according to the CAN protocol, will be described.

図2は、CANプロトコルで規定されるデータフレームのフォーマットを示す図である。同図には、CANプロトコルで規定される標準IDフォーマットにおけるデータフレームを示している。データフレームは、SOF(Start Of Frame)、IDフィールド、RTR(Remote Transmission Request)、IDE(Identifier Extension)、予約ビット「r」、DLC(Data Length Code)、データフィールド、CRC(Cyclic Redundancy Check)シーケンス、CRCデリミタ「DEL」、ACK(Acknowledgement)スロット、ACKデリミタ「DEL」、及び、EOF(End Of Frame)の各フィールドで構成される。 FIG. 2 is a diagram showing a data frame format defined by the CAN protocol. The figure shows a data frame in the standard ID format defined by the CAN protocol. The data frame is a SOF (Start Of Frame), ID field, RTR (Remote Transmission Request), IDE (Identifier Extension), reserved bit "r", DLC (Data Length Code), data field, CRC (Cyclic Redundancy Check) sequence. , CRC delimiter "DEL", ACK (Acknowledgement) slot, ACK delimiter "DEL", and EOF (End Of Frame) fields.

SOFは、1bitのドミナントで構成される。バスがアイドルの状態はレセシブになっており、SOFによりドミナントへ変更することでフレームの送信開始を通知する。 The SOF is composed of 1 bit dominant. The idle state of the bus is recessive, and the SOF changes the bus to dominant to notify the start of frame transmission.

IDフィールドは、11bitで構成される、データの種類を示す値であるID(メッセージID)を格納するフィールドである。複数のノードが同時に送信を開始した場合、このIDフィールドで通信調停を行うために、IDが小さい値を持つフレームが高い優先度となるよう設計されている。 The ID field is a field composed of 11 bits and storing an ID (message ID) which is a value indicating the type of data. When a plurality of nodes start transmission at the same time, a frame having a small ID value is designed to have a high priority in order to perform communication arbitration in this ID field.

RTRは、データフレームとリモートフレームとを識別するための値であり、データフレームにおいてはドミナント1bitで構成される。 The RTR is a value for distinguishing between a data frame and a remote frame, and is composed of a dominant 1 bit in the data frame.

IDEと「r」とは、両方ドミナント1bitで構成される。 Both IDE and "r" are composed of dominant 1 bit.

DLCは、4bitで構成され、データフィールドの長さを示す値である。なお、IDE、「r」及びDLCを合わせてコントロールフィールドと称する。 The DLC is composed of 4 bits and is a value indicating the length of the data field. The IDE, "r" and DLC are collectively referred to as a control field.

データフィールドは、最大64bitで構成される送信するデータの内容を示す値である。8bit毎に長さを調整できる。送られるデータの仕様については、CANプロトコルで規定されておらず、車載ネットワークシステム10において定められる。従って、車種、製造者(製造メーカ)等に依存した仕様となる。 The data field is a value indicating the content of data to be transmitted, which is composed of a maximum of 64 bits. The length can be adjusted in 8-bit units. The specifications of the data to be transmitted are not specified by the CAN protocol, but are specified by the in-vehicle network system 10. Therefore, the specifications depend on the vehicle type, the manufacturer (manufacturer), and the like.

CRCシーケンスは、15bitで構成される。SOF、IDフィールド、コントロールフィールド及びデータフィールドの送信値より算出される。 The CRC sequence consists of 15 bits. It is calculated from the transmission values of the SOF, ID field, control field and data field.

CRCデリミタは、1bitのレセシブで構成されるCRCシーケンスの終了を表す区切り記号である。なお、CRCシーケンス及びCRCデリミタを合わせてCRCフィールドと称する。 The CRC delimiter is a delimiter indicating the end of a CRC sequence composed of 1 bit of recessive. The CRC sequence and CRC delimiter are collectively referred to as a CRC field.

ACKスロットは、1bitで構成される。送信ノードはACKスロットをレセシブにして送信を行う。受信ノードはCRCシーケンスまで正常に受信ができていればACKスロットをドミナントとして送信する。レセシブよりドミナントが優先されるため、送信後にACKスロットがドミナントであれば、送信ノードは、いずれかの受信ノードが受信に成功していることを確認できる。 The ACK slot is composed of 1 bit. The transmitting node makes the ACK slot recessive and transmits. The receiving node transmits the ACK slot as a dominant if the CRC sequence is normally received. Since dominant is prioritized over recessive, if the ACK slot is dominant after transmission, the transmitting node can confirm that any receiving node has succeeded in receiving.

ACKデリミタは、1bitのレセシブで構成されるACKの終了を表す区切り記号である。 The ACK delimiter is a delimiter indicating the end of ACK composed of 1 bit recessive.

EOFは、7bitのレセシブで構成されており、データフレームの終了を示す。 The EOF is composed of 7 bits of recessive and indicates the end of the data frame.

[1.3 エラーフレームフォーマット]
図3は、CANプロトコルで規定されるエラーフレームのフォーマットを示す図である。エラーフレームは、エラーフラグ(プライマリ)と、エラーフラグ(セカンダリ)と、エラーデリミタとから構成される。
[1.3 Error frame format]
FIG. 3 is a diagram showing an error frame format defined by the CAN protocol. The error frame is composed of an error flag (primary), an error flag (secondary), and an error delimiter.

エラーフラグ(プライマリ)は、エラーの発生を他のノードに知らせるために使用される。エラーを検知したノードはエラーの発生を他のノードに知らせるために6bitのドミナントを連続で送信する。この送信は、CANプロトコルにおけるビットスタッフィングルール(連続して同じ値を6bit以上送信しない)に違反し、他のノードからのエラーフレーム(セカンダリ)の送信を引き起こす。 The error flag (primary) is used to notify other nodes that an error has occurred. The node that detects the error continuously transmits a 6-bit dominant to notify other nodes of the occurrence of the error. This transmission violates the bit stuffing rule in the CAN protocol (does not transmit the same value more than 6 bits in succession) and causes the transmission of an error frame (secondary) from another node.

エラーフラグ(セカンダリ)は、エラーの発生を他のノードに知らせるために使用される連続した6ビットのドミナントで構成される。エラーフラグ(プライマリ)を受信してビットスタッフィングルール違反を検知した全てのノードがエラーフラグ(セカンダリ)を送信することになる。 The error flag (secondary) consists of consecutive 6-bit dominants used to notify other nodes of the occurrence of an error. All nodes that receive the error flag (primary) and detect a bit stuffing rule violation will send the error flag (secondary).

エラーデリミタ「DEL」は、8bitの連続したレセシブであり、エラーフレームの終了を示す。 The error delimiter "DEL" is an 8-bit continuous recessive and indicates the end of the error frame.

[1.4 ヘッドユニット200の構成]
ヘッドユニット200は、例えば、自動車のインパネ(インストルメントパネル)等に設けられ、運転者に視認されるための情報を表示する液晶ディスプレイ(LCD:liquid crystal display)等の表示装置、運転者の操作を受け付ける入力手段等を備える一種のECUである。
[1.4 Configuration of head unit 200]
The head unit 200 is provided on, for example, an instrument panel (instrument panel) of an automobile, and is a display device such as a liquid crystal display (LCD) that displays information to be visually recognized by the driver, and a driver's operation. It is a kind of ECU provided with an input means and the like for receiving the above.

図4は、ヘッドユニット200の構成図である。ヘッドユニット200は、フレーム送受信部270と、フレーム解釈部260と、受信ID判断部240と、受信IDリスト保持部250と、フレーム処理部220と、表示制御部210と、フレーム生成部230とを含んで構成される。これらの各構成要素は、機能的な構成要素であり、その各機能は、ヘッドユニット200における通信回路、LCD、メモリに格納された制御プログラムを実行するプロセッサ或いはデジタル回路等により実現される。 FIG. 4 is a configuration diagram of the head unit 200. The head unit 200 includes a frame transmission / reception unit 270, a frame interpretation unit 260, a reception ID determination unit 240, a reception ID list holding unit 250, a frame processing unit 220, a display control unit 210, and a frame generation unit 230. Consists of including. Each of these components is a functional component, and each function is realized by a communication circuit in the head unit 200, an LCD, a processor that executes a control program stored in a memory, a digital circuit, or the like.

フレーム送受信部270は、バス500cに対して、CANプロトコルに従ったフレームを送受信する。バス500cからフレームを1bitずつ受信し、フレーム解釈部260に転送する。また、フレーム生成部230より通知を受けたフレームの内容をバス500cに1bitずつ送信する。 The frame transmission / reception unit 270 transmits / receives a frame according to the CAN protocol to the bus 500c. Frames are received one bit at a time from the bus 500c and transferred to the frame interpretation unit 260. In addition, the contents of the frame notified by the frame generation unit 230 are transmitted to the bus 500c one bit at a time.

フレーム解釈部260は、フレーム送受信部270よりフレームの値を受け取り、CANプロトコルで規定されているフレームフォーマットにおける各フィールドにマッピングするよう解釈を行う。フレーム解釈部260は、IDフィールドと判断した値は受信ID判断部240へ転送する。フレーム解釈部260は、受信ID判断部240から通知される判定結果に応じて、IDフィールドの値と、IDフィールド以降に現れるデータフィールドとを、フレーム処理部220へ転送するか、その判定結果を受けた以降においてフレームの受信を中止する(つまりそのフレームとしての解釈を中止する)かを決定する。また、フレーム解釈部260は、例えば、CRCの値が合わなかったり、ドミナント固定とされている項目がレセシブだったりする等、CANプロトコルに則っていないフレームと判断した場合は、エラーフレームを送信するようにフレーム生成部230へ通知する。また、フレーム解釈部260は、エラーフレームを受信した場合、つまり受け取ったフレームにおける値からエラーフレームになっていると解釈した場合には、それ以降はそのフレームを破棄する、つまりフレームの解釈を中止する。例えばデータフレームの途中からエラーフレームと解釈された場合においては、そのデータフレームの解釈は中止され、そのデータフレームに応じて特段の処理を行うことがなくなる。 The frame interpretation unit 260 receives the frame value from the frame transmission / reception unit 270 and interprets it so as to map it to each field in the frame format defined by the CAN protocol. The frame interpretation unit 260 transfers the value determined to be the ID field to the reception ID determination unit 240. The frame interpretation unit 260 transfers the value of the ID field and the data field appearing after the ID field to the frame processing unit 220 according to the determination result notified from the reception ID determination unit 240, or determines the determination result. Decide whether to stop receiving the frame (that is, stop interpreting it as the frame) after receiving it. Further, the frame interpretation unit 260 transmits an error frame when it determines that the frame does not conform to the CAN protocol, for example, the CRC value does not match or the item fixed as dominant is recessive. To notify the frame generation unit 230. Further, when the frame interpreting unit 260 receives an error frame, that is, when it interprets that the value in the received frame is an error frame, the frame interpreting unit 260 discards the frame after that, that is, stops interpreting the frame. To do. For example, when an error frame is interpreted from the middle of a data frame, the interpretation of the data frame is stopped, and no special processing is performed according to the data frame.

受信ID判断部240は、フレーム解釈部260から通知されるIDフィールドの値を受け取り、受信IDリスト保持部250が保持しているメッセージIDのリストに従い、そのIDフィールド以降のフレームの各フィールドを受信するかどうかの判定を行う。この判定結果を、受信ID判断部240は、フレーム解釈部260へ通知する。 The reception ID determination unit 240 receives the value of the ID field notified from the frame interpretation unit 260, and receives each field of the frame after the ID field according to the list of message IDs held by the reception ID list holding unit 250. Determine whether or not to do so. The reception ID determination unit 240 notifies the frame interpretation unit 260 of this determination result.

受信IDリスト保持部250は、ヘッドユニット200が受信するID(メッセージID)のリストである受信IDリストを保持する。図5は、受信IDリストの一例を示した図である。ヘッドユニット200は、エンジン401に接続されたECU400aからメッセージIDが「1」であるフレーム(メッセージ)を受信し、ブレーキ402に接続されたECU400bからメッセージIDが「2」であるフレームを受信し、ドア開閉センサ403に接続されたECU400cからメッセージIDが「3」であるフレームを受信し、窓開閉センサ404に接続されたECU400dからメッセージIDが「4」であるフレームを受信する。 The reception ID list holding unit 250 holds a reception ID list which is a list of IDs (message IDs) received by the head unit 200. FIG. 5 is a diagram showing an example of a reception ID list. The head unit 200 receives a frame (message) having a message ID of "1" from the ECU 400a connected to the engine 401, and receives a frame having a message ID of "2" from the ECU 400b connected to the brake 402. A frame having a message ID of "3" is received from the ECU 400c connected to the door opening / closing sensor 403, and a frame having a message ID of "4" is received from the ECU 400d connected to the window opening / closing sensor 404.

フレーム処理部220は、受信したフレームの内容(例えばメッセージID及びデータフィールドの内容)に基づいて、例えばLCDに表示されるべき画像を形成して、表示制御部210に通知する。なお、フレーム処理部220は、受信したデータフィールドの内容を保持し、入力手段を通じて受け付けた運転者による操作に応じて、LCDに表示されるべき画像(例えば車速表示用の画像、窓開閉状態表示用の画像等)を選択して通知しても良い。 The frame processing unit 220 forms, for example, an image to be displayed on the LCD based on the contents of the received frame (for example, the contents of the message ID and the data field), and notifies the display control unit 210. The frame processing unit 220 holds the contents of the received data field, and an image to be displayed on the LCD (for example, an image for displaying the vehicle speed, a window open / closed state display) according to the operation by the driver received through the input means. You may notify by selecting (such as an image for).

表示制御部210は、フレーム処理部220より通知を受けた内容をLCD等に表示する。 The display control unit 210 displays the content notified by the frame processing unit 220 on the LCD or the like.

フレーム生成部230は、フレーム解釈部260からのエラーフレームの送信を指示する通知に従い、エラーフレームを構成し、エラーフレームをフレーム送受信部270へ通知して送信させる。 The frame generation unit 230 configures an error frame according to the notification instructing the transmission of the error frame from the frame interpretation unit 260, and notifies the frame transmission / reception unit 270 of the error frame to transmit the error frame.

[1.5 受信IDリスト例1]
図5は、ヘッドユニット200、ゲートウェイ300、ECU400c及びECU400dのそれぞれにおいて保持される受信IDリストの一例を示す図である。同図に例示する受信IDリストは、ID(メッセージID)の値が「1」、「2」、「3」及び「4」のいずれかであるメッセージIDを含むフレームを選択的に受信して処理するために用いられる。例えば、ヘッドユニット200の受信IDリスト保持部250に図5の受信IDリストが保持されていると、メッセージIDが「1」、「2」、「3」及び「4」のいずれでもないフレームについては、フレーム解釈部260でのIDフィールド以後のフレームの解釈が中止される。
[1.5 Received ID list example 1]
FIG. 5 is a diagram showing an example of a reception ID list held in each of the head unit 200, the gateway 300, the ECU 400c, and the ECU 400d. The reception ID list illustrated in the figure selectively receives frames containing a message ID whose ID (message ID) value is any one of "1", "2", "3", and "4". Used to process. For example, when the reception ID list of FIG. 5 is held in the reception ID list holding unit 250 of the head unit 200, for a frame whose message ID is not any of "1", "2", "3", and "4". Is stopped from interpreting the frame after the ID field by the frame interpreting unit 260.

[1.6 ゲートウェイ300の構成]
図6は、ゲートウェイ300の構成図である。ゲートウェイ300は、フレーム送受信部360と、フレーム解釈部350と、受信ID判断部330と、受信IDリスト保持部340と、フレーム生成部320と、転送処理部310と、転送ルール保持部370とを含んで構成される。これらの各構成要素は、機能的な構成要素であり、その各機能は、ゲートウェイ300における通信回路、メモリに格納された制御プログラムを実行するプロセッサ或いはデジタル回路等により実現される。
[1.6 Gateway 300 Configuration]
FIG. 6 is a configuration diagram of the gateway 300. The gateway 300 includes a frame transmission / reception unit 360, a frame interpretation unit 350, a reception ID determination unit 330, a reception ID list holding unit 340, a frame generation unit 320, a transfer processing unit 310, and a transfer rule holding unit 370. Consists of including. Each of these components is a functional component, and each function is realized by a communication circuit in the gateway 300, a processor that executes a control program stored in a memory, a digital circuit, or the like.

フレーム送受信部360は、バス500a、500b、500cそれぞれに対して、CANプロトコルに従ったフレームを送受信する。バスからフレームを1bitずつ受信し、フレーム解釈部350に転送する。また、フレーム生成部320より通知を受けた転送先のバスを示すバス情報及びフレームに基づいて、そのフレームの内容をバス500a、500b、500cに1bitずつ送信する。 The frame transmission / reception unit 360 transmits / receives a frame according to the CAN protocol to each of the buses 500a, 500b, and 500c. Each frame is received from the bus one bit at a time and transferred to the frame interpreting unit 350. Further, based on the bus information indicating the transfer destination bus notified by the frame generation unit 320 and the frame, the contents of the frame are transmitted to the buses 500a, 500b, and 500c one bit at a time.

フレーム解釈部350は、フレーム送受信部360よりフレームの値を受け取り、CANプロトコルで規定されているフレームフォーマットにおける各フィールドにマッピングするよう解釈を行う。IDフィールドと判断した値は受信ID判断部330へ転送する。フレーム解釈部350は、受信ID判断部330から通知される判定結果に応じて、IDフィールドの値と、IDフィールド以降に現れるデータフィールド(データ)とを、転送処理部310へ転送するか、その判定結果を受けた以降においてフレームの受信を中止する(つまりそのフレームとしての解釈を中止する)かを決定する。また、フレーム解釈部350は、CANプロトコルに則っていないフレームと判断した場合は、エラーフレームを送信するようにフレーム生成部320へ通知する。また、フレーム解釈部350は、エラーフレームを受信した場合、つまり受け取ったフレームにおける値からエラーフレームになっていると解釈した場合には、それ以降はそのフレームを破棄する、つまりフレームの解釈を中止する。 The frame interpretation unit 350 receives the frame value from the frame transmission / reception unit 360 and interprets it so as to map it to each field in the frame format defined by the CAN protocol. The value determined to be the ID field is transferred to the reception ID determination unit 330. The frame interpretation unit 350 transfers the value of the ID field and the data field (data) appearing after the ID field to the transfer processing unit 310 according to the determination result notified from the reception ID determination unit 330, or the frame interpretation unit 350 thereof. After receiving the determination result, it is determined whether to stop the reception of the frame (that is, stop the interpretation as the frame). Further, when the frame interpretation unit 350 determines that the frame does not conform to the CAN protocol, the frame interpretation unit 350 notifies the frame generation unit 320 to transmit an error frame. Further, when the frame interpreting unit 350 receives an error frame, that is, when it interprets that the value in the received frame is an error frame, the frame interpreting unit 350 discards the frame after that, that is, stops interpreting the frame. To do.

受信ID判断部330は、フレーム解釈部350から通知されるIDフィールドの値を受け取り、受信IDリスト保持部340が保持しているメッセージIDのリストに従い、そのIDフィールド以降のフレームの各フィールドを受信するかどうかの判定を行う。この判定結果を、受信ID判断部330は、フレーム解釈部350へ通知する。 The reception ID determination unit 330 receives the value of the ID field notified from the frame interpretation unit 350, and receives each field of the frame after the ID field according to the list of message IDs held by the reception ID list holding unit 340. Determine whether or not to do so. The reception ID determination unit 330 notifies the frame interpretation unit 350 of this determination result.

受信IDリスト保持部340は、ゲートウェイ300が受信するID(メッセージID)のリストである受信IDリスト(図5参照)を保持する。 The reception ID list holding unit 340 holds a reception ID list (see FIG. 5), which is a list of IDs (message IDs) received by the gateway 300.

転送処理部310は、転送ルール保持部370が保持する転送ルールに従って、受信したフレームのメッセージIDに応じて、転送するバスを決定し、転送するバスを示すバス情報とフレーム解釈部350より通知されたメッセージIDとデータとをフレーム生成部320へ通知する。なお、ゲートウェイ300は、あるバスから受信されたエラーフレームについては他のバスに転送しない。 The transfer processing unit 310 determines the bus to be transferred according to the message ID of the received frame according to the transfer rule held by the transfer rule holding unit 370, and is notified by the bus information indicating the bus to be transferred and the frame interpretation unit 350. The message ID and the data are notified to the frame generation unit 320. The gateway 300 does not transfer the error frame received from one bus to another bus.

転送ルール保持部370は、バス毎のフレームの転送についてのルールを表す情報である転送ルールを保持する。図7は、転送ルールの一例を示した図である。 The forwarding rule holding unit 370 holds a forwarding rule which is information representing a rule for forwarding a frame for each bus. FIG. 7 is a diagram showing an example of a transfer rule.

フレーム生成部320は、フレーム解釈部350から通知されたエラーフレームの送信を指示する通知に従い、エラーフレームを構成し、エラーフレームをフレーム送受信部360へ通知して送信させる。また、フレーム生成部320は、転送処理部310より通知されたメッセージIDとデータとを使ってフレームを構成し、フレーム及びバス情報をフレーム送受信部360へ通知する。 The frame generation unit 320 configures an error frame according to the notification instructing the transmission of the error frame notified from the frame interpretation unit 350, and notifies the frame transmission / reception unit 360 of the error frame to transmit the error frame. Further, the frame generation unit 320 configures a frame by using the message ID and data notified by the transfer processing unit 310, and notifies the frame and bus information to the frame transmission / reception unit 360.

[1.7 転送ルール例]
図7は、ゲートウェイ300が保有する転送ルールの一例を示す。この転送ルールは、転送元のバスと転送先のバスと転送対象のID(メッセージID)とを対応付けている。図7中の「*」はメッセージIDにかかわらずフレームの転送がなされることを表している。また、同図中の「−」は転送対象のフレームがないことを示す。同図の例は、バス500aから受信するフレームはメッセージIDにかかわらず、バス500b及びバス500cに転送するように設定されていることを示している。また、バス500bから受信するフレームのうち、バス500cには全てのフレームが転送されるが、バス500aにはメッセージIDが「3」であるフレームのみが転送されるように設定されていることを示している。また、バス500cから受信されるフレームは、バス500aにもバス500bにも転送されないように設定されていることを示している。
[1.7 Example of forwarding rule]
FIG. 7 shows an example of the forwarding rule held by the gateway 300. In this transfer rule, the transfer source bus, the transfer destination bus, and the transfer target ID (message ID) are associated with each other. “*” In FIG. 7 indicates that the frame is transferred regardless of the message ID. Further, "-" in the figure indicates that there is no frame to be transferred. The example in the figure shows that the frame received from the bus 500a is set to be transferred to the bus 500b and the bus 500c regardless of the message ID. Further, among the frames received from the bus 500b, all the frames are transferred to the bus 500c, but only the frames having the message ID "3" are set to be transferred to the bus 500a. Shown. Further, it is shown that the frame received from the bus 500c is set so as not to be transferred to either the bus 500a or the bus 500b.

[1.8 ECU400aの構成]
図8は、ECU400aの構成図である。ECU400aは、フレーム送受信部460と、フレーム解釈部450と、受信ID判断部430と、受信IDリスト保持部440と、フレーム処理部410と、フレーム生成部420と、データ取得部470とを含んで構成される。これらの各構成要素は、機能的な構成要素であり、その各機能は、ECU400aにおける通信回路、メモリに格納された制御プログラムを実行するプロセッサ或いはデジタル回路等により実現される。
[1.8 Configuration of ECU 400a]
FIG. 8 is a configuration diagram of the ECU 400a. The ECU 400a includes a frame transmission / reception unit 460, a frame interpretation unit 450, a reception ID determination unit 430, a reception ID list holding unit 440, a frame processing unit 410, a frame generation unit 420, and a data acquisition unit 470. It is composed. Each of these components is a functional component, and each function is realized by a communication circuit in the ECU 400a, a processor that executes a control program stored in a memory, a digital circuit, or the like.

フレーム送受信部460は、バス500aに対して、CANプロトコルに従ったフレームを送受信する。バス500aからフレームを1bitずつ受信し、フレーム解釈部450に転送する。また、フレーム生成部420より通知を受けたフレームの内容をバス500aに送信する。 The frame transmission / reception unit 460 transmits / receives a frame according to the CAN protocol to the bus 500a. Frames are received one bit at a time from the bus 500a and transferred to the frame interpreting unit 450. Further, the content of the frame notified by the frame generation unit 420 is transmitted to the bus 500a.

フレーム解釈部450は、フレーム送受信部460よりフレームの値を受け取り、CANプロトコルで規定されているフレームフォーマットにおける各フィールドにマッピングするよう解釈を行う。IDフィールドと判断した値は受信ID判断部430へ転送する。フレーム解釈部450は、受信ID判断部430から通知される判定結果に応じて、IDフィールドの値と、IDフィールド以降に現れるデータフィールドとを、フレーム処理部410へ転送するか、その判定結果を受けた以降においてフレームの受信を中止する(つまりそのフレームとしての解釈を中止する)かを決定する。また、フレーム解釈部450は、CANプロトコルに則っていないフレームと判断した場合は、エラーフレームを送信するようにフレーム生成部420へ通知する。また、フレーム解釈部450は、エラーフレームを受信した場合、つまり受け取ったフレームにおける値からエラーフレームになっていると解釈した場合には、それ以降はそのフレームを破棄する、つまりフレームの解釈を中止する。 The frame interpretation unit 450 receives the frame value from the frame transmission / reception unit 460 and interprets it so as to map it to each field in the frame format defined by the CAN protocol. The value determined to be the ID field is transferred to the reception ID determination unit 430. The frame interpretation unit 450 transfers the value of the ID field and the data field appearing after the ID field to the frame processing unit 410 according to the determination result notified from the reception ID determination unit 430, or determines the determination result. Decide whether to stop receiving the frame (that is, stop interpreting it as the frame) after receiving it. Further, when the frame interpretation unit 450 determines that the frame does not conform to the CAN protocol, the frame interpretation unit 450 notifies the frame generation unit 420 to transmit an error frame. Further, when the frame interpreting unit 450 receives an error frame, that is, when it interprets that the value in the received frame is an error frame, the frame interpreting unit 450 discards the frame after that, that is, stops interpreting the frame. To do.

受信ID判断部430は、フレーム解釈部450から通知されるIDフィールドの値を受け取り、受信IDリスト保持部440が保持しているメッセージIDのリストに従い、そのIDフィールド以降のフレームの各フィールドを受信するかどうかの判定を行う。この判定結果を、受信ID判断部430は、フレーム解釈部450へ通知する。 The reception ID determination unit 430 receives the value of the ID field notified from the frame interpretation unit 450, and receives each field of the frame after the ID field according to the list of message IDs held by the reception ID list holding unit 440. Determine whether or not to do so. The reception ID determination unit 430 notifies the frame interpretation unit 450 of this determination result.

受信IDリスト保持部440は、ECU400aが受信するID(メッセージID)のリストである受信IDリストを保持する。図9は、受信IDリストの一例を示した図である。 The reception ID list holding unit 440 holds a reception ID list which is a list of IDs (message IDs) received by the ECU 400a. FIG. 9 is a diagram showing an example of a reception ID list.

フレーム処理部410は、受信したフレームのデータに応じてECU毎に異なる機能に係る処理を行う。例えば、エンジン401に接続されたECU400aは、時速が30kmを超えた状態でドアが開いている状態だと、アラーム音を鳴らす機能を備える。ECU400aは、例えばアラーム音を鳴らすためのスピーカ等を有している。そして、ECU400aのフレーム処理部410は、他のECUから受信したデータ(例えばドアの状態を示す情報)を管理し、エンジン401から取得された時速に基づいて一定条件下でアラーム音を鳴らす処理等を行う。 The frame processing unit 410 performs processing related to a function different for each ECU according to the received frame data. For example, the ECU 400a connected to the engine 401 has a function of sounding an alarm when the door is open when the speed exceeds 30 km / h. The ECU 400a has, for example, a speaker for sounding an alarm sound. Then, the frame processing unit 410 of the ECU 400a manages data received from another ECU (for example, information indicating the state of the door), and sounds an alarm sound under certain conditions based on the speed acquired from the engine 401, etc. I do.

データ取得部470は、ECUにつながっている機器、センサ等の状態を示すデータを取得し、フレーム生成部420に通知する。 The data acquisition unit 470 acquires data indicating the state of the device, the sensor, etc. connected to the ECU, and notifies the frame generation unit 420 of the data.

フレーム生成部420は、フレーム解釈部450から通知されたエラーフレームの送信を指示する通知に従い、エラーフレームを構成し、エラーフレームをフレーム送受信部460へ通知して送信させる。また、フレーム生成部420は、データ取得部470より通知されたデータの値に対して、予め定められたメッセージIDをつけてフレームを構成し、フレーム送受信部460へ通知する。 The frame generation unit 420 configures an error frame according to the notification instructing the transmission of the error frame notified from the frame interpretation unit 450, and notifies the frame transmission / reception unit 460 of the error frame to transmit the error frame. Further, the frame generation unit 420 constructs a frame by adding a predetermined message ID to the value of the data notified by the data acquisition unit 470, and notifies the frame transmission / reception unit 460.

なお、ECU400b〜400dも、上述したECU400aと基本的に同様の構成を備える。但し、受信IDリスト保持部440に保持される受信IDリストはECU毎に異なる内容となり得る。ECU400bは図9に例示する受信IDリストを保持し、ECU400c及びECU400dは図5に例示する受信IDリストを保持する。また、フレーム処理部410の処理内容は、ECU毎に異なる。例えば、ECU400cにおけるフレーム処理部410の処理内容は、ブレーキがかかっていない状況でドアが開くとアラーム音を鳴らす機能に係る処理を含む。例えば、ECU400b及びECU400dにおけるフレーム処理部410では特段の処理を行わない。なお、各ECUは、ここで例示した以外の機能を備えていても良い。なお、ECU400a〜400dのそれぞれが送信するフレームの内容については後に図10〜図13を用いて説明する。 The ECUs 400b to 400d also have basically the same configuration as the above-mentioned ECU 400a. However, the received ID list held in the received ID list holding unit 440 may have different contents for each ECU. The ECU 400b holds the reception ID list illustrated in FIG. 9, and the ECU 400c and the ECU 400d hold the reception ID list illustrated in FIG. Further, the processing content of the frame processing unit 410 is different for each ECU. For example, the processing content of the frame processing unit 410 in the ECU 400c includes a processing related to a function of sounding an alarm sound when the door is opened in a state where the brake is not applied. For example, the frame processing unit 410 in the ECU 400b and the ECU 400d does not perform any special processing. In addition, each ECU may have a function other than those illustrated here. The contents of the frames transmitted by each of the ECUs 400a to 400d will be described later with reference to FIGS. 10 to 13.

[1.9 受信IDリスト例2]
図9は、ECU400a及びECU400bのそれぞれにおいて保持される受信IDリストの一例を示す図である。同図に例示する受信IDリストは、ID(メッセージID)の値が「1」、「2」及び「3」のいずれかであるメッセージIDを含むフレームを選択的に受信して処理するために用いられる。例えば、ECU400aの受信IDリスト保持部440に図9の受信IDリストが保持されていると、メッセージIDが「1」、「2」及び「3」のいずれでもないフレームについては、フレーム解釈部450でのIDフィールド以後のフレームの解釈が中止される。
[1.9 Received ID list example 2]
FIG. 9 is a diagram showing an example of a reception ID list held in each of the ECU 400a and the ECU 400b. The reception ID list illustrated in the figure is for selectively receiving and processing a frame containing a message ID whose ID (message ID) value is any one of "1", "2", and "3". Used. For example, when the reception ID list of FIG. 9 is held in the reception ID list holding unit 440 of the ECU 400a, the frame interpretation unit 450 is used for a frame whose message ID is not any of "1", "2", and "3". Interpretation of frames after the ID field in is stopped.

[1.10 エンジンに係るECU400aの送信フレーム例]
図10は、エンジン401に接続されたECU400aから送信されるフレームにおけるID(メッセージID)及びデータフィールド(データ)の一例を示す図である。ECU400aが送信するフレームのメッセージIDは「1」である。データは、時速(km/時)を表し、最低0(km/時)〜最高180(km/時)までの範囲の値を取り、データ長は1byteである。図10の上行から下行へと、ECU400aから逐次送信される各フレームに対応する各メッセージID及びデータを例示しており、0km/時から1km/時ずつ加速されている様子を表している。
[Example of transmission frame of ECU 400a related to 1.10 engine]
FIG. 10 is a diagram showing an example of an ID (message ID) and a data field (data) in a frame transmitted from the ECU 400a connected to the engine 401. The message ID of the frame transmitted by the ECU 400a is "1". The data represents the speed (km / hour), takes a value in the range of a minimum of 0 (km / hour) to a maximum of 180 (km / hour), and has a data length of 1 byte. From the upper row to the lower row of FIG. 10, each message ID and data corresponding to each frame sequentially transmitted from the ECU 400a are illustrated, and the state of acceleration from 0 km / hour to 1 km / hour is shown.

[1.11 ブレーキに係るECU400bの送信フレーム例]
図11は、ブレーキ402に接続されたECU400bから送信されるフレームにおけるID(メッセージID)及びデータフィールド(データ)の一例を示す図である。ECU400bが送信するフレームのメッセージIDは「2」である。データは、ブレーキのかかり具合を割合(%)で表し、データ長は1byteである。この割合は、ブレーキを全くかけていない状態を0(%)、ブレーキを最大限かけている状態を100(%)としたものである。図11の上行から下行へと、ECU400bから逐次送信される各フレームに対応する各メッセージID及びデータを例示しており、100%から徐々にブレーキを弱めている様子を表している。
[1.11 Example of transmission frame of ECU 400b related to brake]
FIG. 11 is a diagram showing an example of an ID (message ID) and a data field (data) in a frame transmitted from the ECU 400b connected to the brake 402. The message ID of the frame transmitted by the ECU 400b is "2". The data represents the degree of braking as a percentage (%), and the data length is 1 byte. This ratio is 0 (%) when the brake is not applied at all and 100 (%) when the brake is applied to the maximum. From the upper row to the lower row of FIG. 11, each message ID and data corresponding to each frame sequentially transmitted from the ECU 400b are illustrated, and the state in which the brake is gradually weakened from 100% is shown.

[1.12 ドア開閉センサに係るECU400cの送信フレーム例]
図12は、ドア開閉センサ403に接続されたECU400cから送信されるフレームにおけるID(メッセージID)及びデータフィールド(データ)の一例を示す図である。ECU400cが送信するフレームのメッセージIDは「3」である。データは、ドアの開閉状態を表し、データ長は1byteである。データの値は、ドアが開いている状態が「1」、ドアが閉まっている状態が「0」である。図12の上行から下行へと、ECU400cから逐次送信される各フレームに対応する各メッセージID及びデータを例示しており、ドアが開いている状態から次第に閉められた状態へと移った様子を表している。
[1.12 Example of transmission frame of ECU 400c related to door open / close sensor]
FIG. 12 is a diagram showing an example of an ID (message ID) and a data field (data) in a frame transmitted from the ECU 400c connected to the door open / close sensor 403. The message ID of the frame transmitted by the ECU 400c is "3". The data represents the open / closed state of the door, and the data length is 1 byte. The value of the data is "1" when the door is open and "0" when the door is closed. From the upper row to the lower row in FIG. 12, each message ID and data corresponding to each frame sequentially transmitted from the ECU 400c are illustrated, and the state in which the door is gradually closed from the open state is shown. ing.

[1.13 窓開閉センサに係るECU400dの送信フレーム例]
図13は、窓開閉センサ404に接続されたECU400dから送信されるフレームにおけるID(メッセージID)及びデータフィールド(データ)の一例を示す図である。ECU400dが送信するフレームのメッセージIDは「4」である。データは、窓の開閉状態を割合(%)で表し、データ長は1byteである。この割合は、窓が完全に閉まっている状態を0(%)、窓が全開の状態を100(%)としたものである。図13の上行から下行へと、ECU400dから逐次送信される各フレームに対応する各メッセージID及びデータを例示しており、窓が閉まっている状態から徐々に開いていく様子を表している。
[1.13 Example of transmission frame of ECU 400d related to window open / close sensor]
FIG. 13 is a diagram showing an example of an ID (message ID) and a data field (data) in a frame transmitted from the ECU 400d connected to the window opening / closing sensor 404. The message ID of the frame transmitted by the ECU 400d is "4". The data represents the open / closed state of the window as a percentage (%), and the data length is 1 byte. This ratio is 0 (%) when the window is completely closed and 100 (%) when the window is fully open. From the upper row to the lower row of FIG. 13, each message ID and data corresponding to each frame sequentially transmitted from the ECU 400d are illustrated, and the state in which the window is gradually opened from the closed state is shown.

[1.14 不正検知ECU100aの構成]
図14は、不正検知ECU100aの構成図である。不正検知ECU100aは、フレーム送受信部160と、フレーム解釈部150と、不正フレーム検知部130と、正規IDリスト保持部120と、不正検知カウンタ保持部110と、フレーム生成部140とを含んで構成される。これらの各構成要素は、機能的な構成要素であり、その各機能は、不正検知ECU100aにおける通信回路、メモリに格納された制御プログラムを実行するプロセッサ或いはデジタル回路等により実現される。なお、不正検知ECU100bも基本的に同様の構成を備えるが、正規IDリスト保持部120が保持するリスト情報(正規IDリスト)の内容が不正検知ECU100aと不正検知ECU100bとでは異なる。
[1.14 Configuration of fraud detection ECU 100a]
FIG. 14 is a configuration diagram of the fraud detection ECU 100a. The fraud detection ECU 100a includes a frame transmission / reception unit 160, a frame interpretation unit 150, a fraud frame detection unit 130, a regular ID list holding unit 120, a fraud detection counter holding unit 110, and a frame generation unit 140. To. Each of these components is a functional component, and each function is realized by a communication circuit in the fraud detection ECU 100a, a processor that executes a control program stored in a memory, a digital circuit, or the like. The fraud detection ECU 100b basically has the same configuration, but the content of the list information (regular ID list) held by the regular ID list holding unit 120 is different between the fraud detection ECU 100a and the fraud detection ECU 100b.

フレーム送受信部160は、バス500aに対して、CANプロトコルに従ったフレームを送受信する。即ち、フレーム送受信部160は、バス上でのフレームの送信が開始された場合においてフレームを受信する言わば受信部として働き、また、バスにエラーフレーム等を送信する言わば送信部として働く。即ち、フレーム送受信部160は、バス500aからフレームを1bitずつ受信し、フレーム解釈部150に転送する。また、フレーム生成部140より通知を受けたフレームの内容をバス500aに送信する。 The frame transmission / reception unit 160 transmits / receives a frame according to the CAN protocol to the bus 500a. That is, the frame transmission / reception unit 160 functions as a so-called receiving unit that receives a frame when transmission of a frame on the bus is started, and also functions as a so-called transmission unit that transmits an error frame or the like to the bus. That is, the frame transmission / reception unit 160 receives frames one bit at a time from the bus 500a and transfers them to the frame interpretation unit 150. Further, the content of the frame notified by the frame generation unit 140 is transmitted to the bus 500a.

フレーム解釈部150は、フレーム送受信部160よりフレームの値を受け取り、CANプロトコルで規定されているフレームフォーマットにおける各フィールドにマッピングするよう解釈を行う。IDフィールドと判断した値は、不正フレーム検知部130へ転送する。また、フレーム解釈部150は、CANプロトコルに則っていないフレームと判断した場合は、エラーフレームを送信するようにフレーム生成部140へ通知する。また、フレーム解釈部150は、エラーフレームを受信した場合、つまり受け取ったフレームにおける値からエラーフレームになっていると解釈した場合には、それ以降はそのフレームを破棄する、つまりフレームの解釈を中止する。 The frame interpretation unit 150 receives the frame value from the frame transmission / reception unit 160 and interprets it so as to map it to each field in the frame format defined by the CAN protocol. The value determined to be the ID field is transferred to the fraudulent frame detection unit 130. Further, when the frame interpretation unit 150 determines that the frame does not conform to the CAN protocol, the frame interpretation unit 150 notifies the frame generation unit 140 to transmit an error frame. Further, when the frame interpreting unit 150 receives an error frame, that is, interprets that the value in the received frame is an error frame, the frame interpreting unit 150 discards the frame after that, that is, stops interpreting the frame. To do.

不正フレーム検知部130は、フレーム解釈部150から通知されるIDフィールドの値を受け取り、IDフィールドの値が不正を示す所定条件に該当するか否かを判定する。即ち不正フレーム検知部130は、受信されたフレームにおける所定フィールドの内容が不正を示す所定条件に該当するか否かを判定する言わば判定部として機能する。この不正を示す所定条件は、IDフィールドの値が、正規IDリスト保持部120が保持しているメッセージIDのリストに載っていないという条件である。即ち、正規IDリスト保持部120が保持しているメッセージIDのリストに従い、通知されたIDフィールドの値(メッセージID)が不正かどうかの判定を行う。このリスト(つまり後述する正規IDリスト)に載っていないメッセージIDを受信した場合は、不正の検知回数をインクリメントするために、受信したメッセージIDを不正検知カウンタ保持部110へ通知する。また、正規IDリストに載っていないメッセージIDを受信した場合は、エラーフレームを送信するように、フレーム生成部140へ通知する。また、不正の検知回数が一定回数以上に達した場合に、不正検知カウンタ保持部110より通知を受け、該当するメッセージIDを発行する不正なECUが存在することを示すエラー表示メッセージ(フレーム)を送信するようフレーム生成部140へ通知する。エラー表示メッセージのメッセージIDは予め定められており、このメッセージIDのメッセージ(フレーム)をヘッドユニット200が受信してエラー表示を行うようになっている。このエラー表示メッセージについては便宜上説明を省略していたが、エラー表示メッセージのメッセージIDは、ゲートウェイ300及びヘッドユニット200が保持する受信IDリスト、及び、後述する正規IDリストに掲載される。但し、図15、図16ではエラー表示メッセージについてのメッセージIDを省略している。 The fraudulent frame detection unit 130 receives the value of the ID field notified from the frame interpretation unit 150, and determines whether or not the value of the ID field corresponds to a predetermined condition indicating fraud. That is, the fraudulent frame detection unit 130 functions as a so-called determination unit for determining whether or not the content of the predetermined field in the received frame corresponds to a predetermined condition indicating fraud. The predetermined condition indicating this fraud is that the value of the ID field is not included in the list of message IDs held by the regular ID list holding unit 120. That is, it is determined whether or not the value (message ID) of the notified ID field is invalid according to the list of message IDs held by the regular ID list holding unit 120. When a message ID not included in this list (that is, a regular ID list described later) is received, the received message ID is notified to the fraud detection counter holding unit 110 in order to increment the number of fraud detections. When a message ID that is not on the regular ID list is received, the frame generation unit 140 is notified to send an error frame. Further, when the number of fraud detections reaches a certain number or more, an error display message (frame) indicating that there is a fraudulent ECU that receives a notification from the fraud detection counter holding unit 110 and issues the corresponding message ID is displayed. Notify the frame generation unit 140 to transmit. The message ID of the error display message is predetermined, and the head unit 200 receives the message (frame) of this message ID to display the error. Although the description of this error display message has been omitted for convenience, the message ID of the error display message is posted in the reception ID list held by the gateway 300 and the head unit 200, and in the regular ID list described later. However, in FIGS. 15 and 16, the message ID for the error display message is omitted.

正規IDリスト保持部120は、車載ネットワークシステム10においてバス500a上を送信されることとなるフレームに含まれるメッセージIDを予め規定したリストである正規IDリストを保持する(図15、図16参照)。 The regular ID list holding unit 120 holds a regular ID list, which is a list in which message IDs included in a frame to be transmitted on the bus 500a in the vehicle-mounted network system 10 are defined in advance (see FIGS. 15 and 16). ..

不正検知カウンタ保持部110は、メッセージID毎に検知回数をカウントするための不正検知カウンタを保持しており、不正フレーム検知部130からメッセージIDが通知されると、該当する不正検知カウンタをインクリメント(増加)する。不正検知カウンタが一定数(所定回数)以上に達した場合、不正フレーム検知部130に一定数を超えたことを通知する。ここでいう一定数(所定回数)の一例は、CANプロトコルにおける送信エラーカウンタの取り扱い規則に対応して定められた値である。CANプロトコルでは、ECUがエラーフレームによって送信を阻止する度に送信エラーカウンタが8カウントアップする。そして、この結果として送信ノードにおける送信エラーカウンタが128迄カウントアップすれば送信ノードはパッシブ状態に遷移してフレーム送信をしなくなるように規定されている。従って、128/8(=16)より大きな17をこの一定数として定めておけば、CANプロトコルにおける送信エラーカウンタに係る規則を無視した送信ノード(不正なECU)の存在が推定される場合に不正検知ECU100aからエラー表示メッセージが送信されるようになる。なお、不正なフレームを送信する、不正なECUが、CANプロトコルにおける送信エラーカウンタに係る規則に従うものであった場合には、不正検知ECU100aによるエラーフレームの送信によって、不正なECUの送信エラーカウンタは8インクリメントされる。この場合、不正なフレームの送信を繰り返すことで不正なECUの送信エラーカウンタが128まで上昇すると、不正なECUがパッシブ状態に遷移し、不正なECUによる不正なフレームの送信が停止することになる。 The fraud detection counter holding unit 110 holds a fraud detection counter for counting the number of detections for each message ID, and when the message ID is notified from the fraud frame detection unit 130, the corresponding fraud detection counter is incremented ( To increase. When the fraud detection counter reaches a certain number (predetermined number of times) or more, the fraud frame detection unit 130 is notified that the number has exceeded a certain number. An example of a fixed number (predetermined number of times) referred to here is a value determined in accordance with the handling rules of the transmission error counter in the CAN protocol. In the CAN protocol, the transmission error counter counts up by 8 each time the ECU blocks transmission due to an error frame. Then, as a result of this, if the transmission error counter in the transmission node counts up to 128, the transmission node transitions to the passive state and is not specified to transmit frames. Therefore, if 17 larger than 128/8 (= 16) is set as this fixed number, it is illegal when the existence of a transmission node (illegal ECU) that ignores the rules related to the transmission error counter in the CAN protocol is estimated. An error display message will be transmitted from the detection ECU 100a. If the illegal ECU that transmits the illegal frame complies with the rules related to the transmission error counter in the CAN protocol, the transmission error counter of the illegal ECU will be increased by the transmission of the error frame by the fraud detection ECU 100a. It is incremented by 8. In this case, when the transmission error counter of the illegal ECU rises to 128 by repeating the transmission of the illegal frame, the illegal ECU transitions to the passive state, and the transmission of the illegal frame by the illegal ECU is stopped. ..

フレーム生成部140は、フレーム解釈部150から通知されたエラーフレームの送信を指示する通知に従い、エラーフレームを構成し、エラーフレームをフレーム送受信部160へ通知して送信させる。また、フレーム生成部140は、不正フレーム検知部130から通知されたエラーフレームの送信を指示する通知に従い、エラーフレームを構成し、エラーフレームをフレーム送受信部160へ通知して送信させる。更にフレーム生成部140は、不正フレーム検知部130から通知されたエラー表示メッセージの送信を指示する通知に従い、エラー表示メッセージをフレーム送受信部160へ通知して送信させる。 The frame generation unit 140 configures an error frame according to the notification instructing the transmission of the error frame notified from the frame interpretation unit 150, and notifies the frame transmission / reception unit 160 of the error frame and causes the frame transmission / reception unit 160 to transmit the error frame. Further, the frame generation unit 140 configures an error frame according to the notification instructing the transmission of the error frame notified from the fraudulent frame detection unit 130, and notifies the frame transmission / reception unit 160 of the error frame to transmit the error frame. Further, the frame generation unit 140 notifies the frame transmission / reception unit 160 of the error display message and causes the frame transmission / reception unit 160 to transmit the error display message in accordance with the notification instructing the transmission of the error display message notified from the fraudulent frame detection unit 130.

[1.15 不正検知ECU100aの正規IDリスト例]
図15は、不正検知ECU100aの正規IDリスト保持部120に保持される正規IDリストの一例を示した図である。同図に例示する正規IDリストは、ID(メッセージID)の値が「1」、「2」及び「3」のいずれかであるメッセージIDを含むフレームがバス500aに流れ得ることを示している。
[1.15 Example of regular ID list of fraud detection ECU 100a]
FIG. 15 is a diagram showing an example of a regular ID list held in the regular ID list holding unit 120 of the fraud detection ECU 100a. The regular ID list illustrated in the figure shows that a frame containing a message ID whose ID (message ID) value is any one of "1", "2", and "3" can flow to the bus 500a. ..

[1.16 不正検知ECU100bの正規IDリスト例]
図16は、不正検知ECU100bの正規IDリスト保持部120に保持される正規IDリストの一例を示した図である。同図に例示する正規IDリストは、ID(メッセージID)の値が「1」、「2」、「3」及び「4」のいずれかであるメッセージIDを含むフレームがバス500bに流れ得ることを示している。
[1.16 Example of regular ID list of fraud detection ECU 100b]
FIG. 16 is a diagram showing an example of a regular ID list held in the regular ID list holding unit 120 of the fraud detection ECU 100b. In the regular ID list illustrated in the figure, a frame containing a message ID whose ID (message ID) value is any one of "1", "2", "3", and "4" can flow to the bus 500b. Is shown.

[1.17 不正検知カウンタ保存リスト例]
図17は、メッセージID毎の不正検知カウンタの状態の一例を示す図である。同図の例は、メッセージIDが「4」の不正検知カウンタだけが、不正を一度検知しており、その他のメッセージIDでは一度も検知していないことを示す。即ち、この例はバス500aに本来流れるはずがないメッセージID「4」のメッセージ(フレーム)が一度送信されたことを不正検知ECU100aが検知し、該当するメッセージID「4」に対応する不正検知カウンタを1インクリメントした場合を示している。
[1.17 Fraud detection counter save list example]
FIG. 17 is a diagram showing an example of the state of the fraud detection counter for each message ID. The example in the figure shows that only the fraud detection counter whose message ID is "4" has detected fraud once, and the other message IDs have never detected it. That is, in this example, the fraud detection ECU 100a detects that the message (frame) of the message ID "4" that should not originally flow to the bus 500a has been transmitted once, and the fraud detection counter corresponding to the corresponding message ID "4". Is incremented by 1.

[1.18 不正フレームの検知に係るシーケンス]
以下、上述の構成を備える車載ネットワークシステム10のバス500aに不正なECUが接続された場合について、バス500aに接続された不正検知ECU100a、ECU400a、ECU400b、ゲートウェイ300等の動作について説明する。
[1.18 Sequence related to detection of illegal frames]
Hereinafter, the operations of the fraud detection ECU 100a, ECU 400a, ECU 400b, gateway 300, etc. connected to the bus 500a will be described when a fraudulent ECU is connected to the bus 500a of the vehicle-mounted network system 10 having the above configuration.

図18は、不正検知ECU100aが不正なフレーム(メッセージ)を検知して、他のECUによりその不正なフレームに対応した処理がなされることを阻止する動作例を示すシーケンス図である。同図では、不正なECUが、バス500aにメッセージIDが「4」でデータフィールド(データ)が「255(0xFF)」となるデータフレームを送信する場合の例を示している。ここでの各シーケンスは、各種装置における各処理手順(ステップ)を意味する。 FIG. 18 is a sequence diagram showing an operation example in which the fraud detection ECU 100a detects a fraudulent frame (message) and prevents another ECU from performing a process corresponding to the fraudulent frame. The figure shows an example in which an unauthorized ECU transmits a data frame having a message ID of “4” and a data field (data) of “255 (0xFF)” to the bus 500a. Each sequence here means each processing procedure (step) in various devices.

まず、不正なECUは、メッセージIDが「4」、データが「255(0xFF)」となるデータフレームの送信を開始する(シーケンスS1001)。フレームを構成する各ビットの値は、上述したデータフレームフォーマットに従ってSOF、IDフィールド(メッセージID)といった順に逐次バス500a上に送出される。 First, the illegal ECU starts transmitting a data frame having a message ID of "4" and data of "255 (0xFF)" (sequence S1001). The value of each bit constituting the frame is sequentially transmitted onto the bus 500a in the order of SOF, ID field (message ID), etc. according to the above-mentioned data frame format.

不正なECUがIDフィールド(メッセージID)までをバス500aに送出し終えたときにおいて、不正検知ECU100a、ECU400a、ECU400b及びゲートウェイ300はそれぞれメッセージIDを受信する(シーケンスS1002)。 When the fraudulent ECU finishes sending up to the ID field (message ID) to the bus 500a, the fraud detection ECU 100a, the ECU 400a, the ECU 400b and the gateway 300 each receive the message ID (sequence S1002).

ECU400a、ECU400b及びゲートウェイ300はそれぞれ、保持している受信IDリストを用いてメッセージIDをチェックする(シーケンスS1003)。このとき、不正検知ECU100aは、保持している正規IDリストを用いてメッセージIDをチェックする(シーケンスS1004)。即ち、不正検知ECU100aは、送信されたフレームにおけるIDフィールドの内容が、不正を示す所定条件(正規IDリストに掲載されていないこと)に該当するか否かを判定する。 Each of the ECU 400a, the ECU 400b, and the gateway 300 checks the message ID using the received reception ID list held (sequence S1003). At this time, the fraud detection ECU 100a checks the message ID using the held regular ID list (sequence S1004). That is, the fraud detection ECU 100a determines whether or not the content of the ID field in the transmitted frame corresponds to a predetermined condition indicating fraud (not listed in the regular ID list).

シーケンスS1003において、ECU400a及びECU400bは、それぞれが保持している受信IDリストに「4」が含まれていないため(図9参照)、受信を終了する。つまりこれ以上不正なECUが送信を継続するフレームの解釈をせずフレームに対応した処理を行わない。また、シーケンスS1003においてゲートウェイ300は、保持している受信IDリストに「4」が含まれているため(図5参照)、受信を継続する。また、シーケンスS1004において不正検知ECU100aは、保持している正規IDリストに「4」が含まれていないため、不正なメッセージIDであると判断して、続いてエラーフレームの発行準備を開始する(シーケンスS1005)。 In the sequence S1003, the ECU 400a and the ECU 400b end the reception because "4" is not included in the reception ID list held by each of the ECU 400a and the ECU 400b (see FIG. 9). That is, the illegal ECU does not interpret the frame in which the transmission is continued and does not perform the processing corresponding to the frame. Further, in the sequence S1003, the gateway 300 continues reception because "4" is included in the received reception ID list held (see FIG. 5). Further, in the sequence S1004, the fraud detection ECU 100a determines that the message ID is invalid because "4" is not included in the held regular ID list, and subsequently starts preparation for issuing an error frame (). Sequence S1005).

シーケンスS1003に続いて、ゲートウェイ300はフレームの受信を継続する。例えば、不正検知ECU100aがエラーフレームの発行準備をしている間に、不正なECUからはバス500a上にIDフィールドより後の部分であるRTR、コントロールフィールド(IDE、r、DLC)が逐次送出され、続いてデータフィールドが1ビットずつ逐次送出される。ゲートウェイ300はこのRTR、コントロールフィールド(IDE、r、DLC)を受信し、続いてデータフィールドの受信を開始する(シーケンスS1006)。 Following the sequence S1003, the gateway 300 continues to receive frames. For example, while the fraud detection ECU 100a is preparing to issue an error frame, the fraudulent ECU sequentially sends RTRs and control fields (IDE, r, DLC), which are parts after the ID field, onto the bus 500a. Then, the data field is sequentially transmitted bit by bit. The gateway 300 receives the RTR and control fields (IDE, r, DLC), and then starts receiving data fields (sequence S1006).

次にエラーフレームの発行準備が終わって、不正検知ECU100aがエラーフレームを送信する(シーケンスS1007)。このエラーフレームの送信は、不正なフレームの最後尾が送信される前(例えばCRCシーケンスの最後尾が送信される前等)に行われる。この動作例においては、データフィールドの途中で行われる。このエラーフレームの送信が開始されることによりバス500aでは、不正なECUから送信中のフレームのデータフィールドの途中部分がエラーフレーム(優先されるドミナントのビット列)により上書きされることになる。 Next, the preparation for issuing the error frame is completed, and the fraud detection ECU 100a transmits the error frame (sequence S1007). This error frame is transmitted before the end of the invalid frame is transmitted (for example, before the end of the CRC sequence is transmitted). In this operation example, it is performed in the middle of the data field. When the transmission of this error frame is started, in the bus 500a, the middle part of the data field of the frame being transmitted from the illegal ECU is overwritten by the error frame (priority dominant bit string).

シーケンスS1007において送信されたエラーフレームを受信したゲートウェイ300は、データフィールドの受信途中で不正なECUが送信していたフレームの受信を中止する(シーケンスS1008)。つまり、ゲートウェイ300は、不正なECUからのデータフィールドがエラーフレームで上書きされており、エラーフレームを検出するので、不正なECUが送信していたフレームの受信を継続しない。 The gateway 300 that has received the error frame transmitted in the sequence S1007 stops receiving the frame transmitted by the illegal ECU during the reception of the data field (sequence S1008). That is, since the data field from the illegal ECU is overwritten by the error frame and the gateway 300 detects the error frame, the gateway 300 does not continue to receive the frame transmitted by the illegal ECU.

不正検知ECU100aは、エラーフレームを送信する対象となったデータフレームのメッセージID「4」に対応する不正検知カウンタをインクリメントする(シーケンスS1009)。 The fraud detection ECU 100a increments the fraud detection counter corresponding to the message ID “4” of the data frame to which the error frame is transmitted (sequence S1009).

インクリメントした結果としてメッセージID「4」に対応する不正検知カウンタが17以上となった場合、不正検知ECU100aは、ヘッドユニット200に受信されるようにエラー表示を通知するフレーム(エラー表示メッセージ)を送信する(シーケンスS1010)。この結果としてヘッドユニット200のフレーム処理部220によってエラー表示のための処理がなされLCD等を介してエラーが報知される。なお、エラーの報知は、LCD等への表示の他、音声出力、発光等によるものでも良い。 When the fraud detection counter corresponding to the message ID "4" becomes 17 or more as a result of the increment, the fraud detection ECU 100a transmits a frame (error display message) for notifying the error display so as to be received by the head unit 200. (Sequence S1010). As a result, the frame processing unit 220 of the head unit 200 performs processing for displaying an error, and the error is notified via the LCD or the like. In addition to the display on the LCD or the like, the error notification may be by voice output, light emission, or the like.

[1.19 実施の形態1の効果]
実施の形態1で示した不正検知ECUは、送信されたフレーム(データフレーム)が不正なフレームか否かを、フレームのIDフィールドについて正規IDリストを用いて判定する。これにより、データフレームにおけるIDフィールドによって不正を判定できるため、既存のノード(つまり不正検知ECU及び不正なECU以外のECU)において不正なフレームが解釈されてそのフレームに対応する処理が実行されることを阻止できる。また、データフレームの先頭のSOFに続くIDフィールドまで受信するだけで判定ができるため、データフレームの後部等を受信して判定を行う場合よりも、バスのトラフィックを抑えることが可能となる。
[Effect of 1.19 Embodiment 1]
The fraud detection ECU shown in the first embodiment determines whether or not the transmitted frame (data frame) is a fraudulent frame by using a regular ID list for the ID field of the frame. As a result, fraud can be determined by the ID field in the data frame, so that the fraud detection ECU and the ECU other than the fraud ECU interpret the fraudulent frame and execute the process corresponding to the frame. Can be blocked. Further, since the determination can be made only by receiving the ID field following the SOF at the beginning of the data frame, it is possible to suppress the bus traffic as compared with the case of receiving the rear part of the data frame and making the determination.

また、不正検知ECUが、不正検知カウンタを用いてエラーフレームを送信した回数をカウントすることで、エラーフレームの受信により不正なメッセージIDを送信するノードにおける送信エラーカウンタがCANプロトコルに従えばパッシブ状態に遷移すべき上限値まで到達していることを検出することができる。これにより、不正なメッセージIDを送信するノードが、CANプロトコルのエラーカウンタの仕様に準拠しているか否かを判定することが可能となる。 Further, the fraud detection ECU counts the number of times the error frame is transmitted by using the fraud detection counter, so that the transmission error counter in the node that transmits the fraudulent message ID by receiving the error frame is in a passive state if it follows the CAN protocol. It can be detected that the upper limit value to be transitioned to is reached. This makes it possible to determine whether or not the node that transmits the invalid message ID complies with the specifications of the error counter of the CAN protocol.

また、不正なフレームの判定を行うノードを不正検知ECUのみとすることで、既存のネットワーク構成への影響を最小限に抑えることができ、システム全体として処理量、電力消費量を抑えることができる。 Further, by using only the fraud detection ECU as the node that determines the fraudulent frame, the influence on the existing network configuration can be minimized, and the processing amount and power consumption of the entire system can be suppressed. ..

なお、上述した車載ネットワークシステム10における1つ又は複数の不正検知ECUが、検知を行うか否かを切り替え可能にしても良い。そして、車両の状態が、例えば使用開始から一定期間が経過した等といった一定の場合に限って、不正検知ECUが不正なメッセージの検知を行わないこととしても良い。これにより、電力消費量を抑えることが可能となり、車載ネットワークシステム10の電力供給源である車載バッテリーの消費を抑制できる。 It should be noted that one or more fraud detection ECUs in the above-mentioned in-vehicle network system 10 may switch whether or not to perform detection. Then, the fraud detection ECU may not detect a fraudulent message only when the vehicle is in a certain state, for example, a certain period of time has passed since the start of use. As a result, the power consumption can be suppressed, and the consumption of the vehicle-mounted battery, which is the power supply source of the vehicle-mounted network system 10, can be suppressed.

(実施の形態2)
以下、本開示の実施の形態として、メッセージID毎に許容されるデータ範囲に基づいて、他のノード(ECU)において不正なフレームに基づく処理が実行されることを阻止するための不正対処方法を実現する不正検知ECUを含む車載ネットワークシステム11について説明する。
(Embodiment 2)
Hereinafter, as an embodiment of the present disclosure, a fraudulent countermeasure method for preventing processing based on a fraudulent frame from being executed on another node (ECU) based on a data range allowed for each message ID will be provided. The in-vehicle network system 11 including the fraud detection ECU to be realized will be described.

[2.1 車載ネットワークシステム11の全体構成]
図19は、実施の形態2に係る車載ネットワークシステム11の全体構成を示す図である。車載ネットワークシステム11は、実施の形態1で示した車載ネットワークシステム10の一部を変形したものである。車載ネットワークシステム11は、バス500a、500bと、不正検知ECU2100a、2100b、ヘッドユニット200、ゲートウェイ300、及び、各種機器に接続されたECU400a〜400d等のECUといったバスに接続された各ノードとを含んで構成される。車載ネットワークシステム11の構成要素のうち、実施の形態1と同様の機能を有する構成要素は、同じ符号を付して説明を省略する。
[2.1 Overall configuration of in-vehicle network system 11]
FIG. 19 is a diagram showing an overall configuration of the vehicle-mounted network system 11 according to the second embodiment. The in-vehicle network system 11 is a modification of a part of the in-vehicle network system 10 shown in the first embodiment. The in-vehicle network system 11 includes buses 500a and 500b, and each node connected to the bus such as fraud detection ECUs 2100a and 2100b, head unit 200, gateway 300, and ECUs such as ECUs 400a to 400d connected to various devices. Consists of. Among the components of the in-vehicle network system 11, the components having the same functions as those in the first embodiment are designated by the same reference numerals, and the description thereof will be omitted.

不正検知ECU2100a、2100bは、それぞれバス500a、バス500bに接続され、ECU400a〜400d等により送信されたフレームが不正であるかどうかを判定し、不正であればエラーフレームを送信する機能を有するECUである。 The fraud detection ECUs 2100a and 2100b are ECUs that are connected to the bus 500a and the bus 500b, respectively, and have a function of determining whether or not the frame transmitted by the ECUs 400a to 400d is invalid, and if it is invalid, transmitting an error frame. is there.

[2.2 不正検知ECU2100aの構成]
図20は、不正検知ECU2100aの構成図である。不正検知ECU2100aは、フレーム送受信部160と、フレーム解釈部2150と、不正フレーム検知部2130と、データ範囲リスト保持部2120と、不正検知カウンタ保持部110と、フレーム生成部140とを含んで構成される。これらの各構成要素は、機能的な構成要素であり、その各機能は、不正検知ECU2100aにおける通信回路、メモリに格納された制御プログラムを実行するプロセッサ或いはデジタル回路等により実現される。不正検知ECU2100aは、実施の形態1で示した不正検知ECU100aの一部を変形したものであり、実施の形態1と同様の機能を有する構成要素は、同じ符号を付して説明を省略する。なお、不正検知ECU2100bも不正検知ECU2100aと同様の構成を備える。
[2.2 Configuration of fraud detection ECU 2100a]
FIG. 20 is a configuration diagram of the fraud detection ECU 2100a. The fraud detection ECU 2100a includes a frame transmission / reception unit 160, a frame interpretation unit 2150, a fraud frame detection unit 2130, a data range list holding unit 2120, a fraud detection counter holding unit 110, and a frame generation unit 140. To. Each of these components is a functional component, and each function is realized by a communication circuit in the fraud detection ECU 2100a, a processor that executes a control program stored in a memory, a digital circuit, or the like. The fraud detection ECU 2100a is a modification of a part of the fraud detection ECU 100a shown in the first embodiment, and components having the same functions as those of the first embodiment are designated by the same reference numerals and the description thereof will be omitted. The fraud detection ECU 2100b also has the same configuration as the fraud detection ECU 2100a.

フレーム解釈部2150は、実施の形態1で示したフレーム解釈部150を変形したものであり、フレーム送受信部160よりフレームの値を受け取り、CANプロトコルで規定されているフレームフォーマットにおける各フィールドにマッピングするよう解釈を行う。フレームがデータフレームであると判断した場合においてデータフィールドと判断した値(データ)は、IDフィールドのID(メッセージID)と共に、不正フレーム検知部2130へ転送する。また、フレーム解釈部2150は、CANプロトコルに則っていないフレームと判断した場合は、エラーフレームを送信するようにフレーム生成部140へ通知する。また、フレーム解釈部2150は、エラーフレームを受信した場合、つまり受け取ったフレームにおける値からエラーフレームになっていると解釈した場合には、それ以降はそのフレームを破棄する、つまりフレームの解釈を中止する。 The frame interpretation unit 2150 is a modification of the frame interpretation unit 150 shown in the first embodiment, receives a frame value from the frame transmission / reception unit 160, and maps it to each field in the frame format defined by the CAN protocol. Interpret as. When it is determined that the frame is a data frame, the value (data) determined to be a data field is transferred to the fraudulent frame detection unit 2130 together with the ID (message ID) of the ID field. Further, when the frame interpretation unit 2150 determines that the frame does not conform to the CAN protocol, the frame interpretation unit 2150 notifies the frame generation unit 140 to transmit an error frame. Further, when the frame interpreting unit 2150 receives an error frame, that is, interprets that the value in the received frame is an error frame, the frame interpreting unit 2150 discards the frame after that, that is, stops interpreting the frame. To do.

不正フレーム検知部2130は、実施の形態1で示した不正フレーム検知部130を変形したものであり、フレーム解釈部2150から通知されるメッセージIDと、データフィールドの値(データ)を受け取り、これらの値が不正を示す所定条件に該当するか否かを判定する。即ち不正フレーム検知部2130は、受信されたフレームにおける所定フィールドの内容が不正を示す所定条件に該当するか否かを判定する言わば判定部として機能する。この不正を示す所定条件は、データが、データ範囲リスト保持部2120が保持しているデータ範囲リストにメッセージIDと対応付けて載っているデータ範囲に入らないという条件である。不正フレーム検知部2130は、データ範囲リスト保持部2120に保持しているメッセージID毎のデータ範囲を定めたリストであるデータ範囲リストに従い、不正かどうかの判定を行う。不正フレーム検知部2130は、データ範囲リストで示される範囲以外のデータを受信した場合は、不正の検知回数をインクリメントするために、受信したメッセージIDを不正検知カウンタ保持部110へ通知する。この不正の検知回数が一定回数以上に達した場合において、ヘッドユニット200で受信されるようにエラー表示メッセージを送信するための制御については実施の形態1で説明した通りであるため、ここでの説明を省略する。また、データ範囲リストで示される範囲以外のデータを受信した場合は、エラーフレームを送信するように、フレーム生成部140へ通知する。 The fraudulent frame detection unit 2130 is a modification of the fraudulent frame detection unit 130 shown in the first embodiment, and receives the message ID notified from the frame interpretation unit 2150 and the value (data) of the data field, and these It is determined whether or not the value corresponds to a predetermined condition indicating invalidity. That is, the fraudulent frame detection unit 2130 functions as a so-called determination unit for determining whether or not the content of the predetermined field in the received frame corresponds to a predetermined condition indicating fraud. The predetermined condition indicating this fraud is a condition that the data does not fall into the data range listed in the data range list held by the data range list holding unit 2120 in association with the message ID. The fraudulent frame detection unit 2130 determines whether or not the data range list is fraudulent according to a data range list that defines the data range for each message ID held in the data range list holding unit 2120. When the fraud frame detection unit 2130 receives data outside the range indicated in the data range list, the fraud frame detection unit 2130 notifies the fraud detection counter holding unit 110 of the received message ID in order to increment the number of fraud detections. When the number of times of detection of this fraud reaches a certain number of times or more, the control for transmitting the error display message so as to be received by the head unit 200 is as described in the first embodiment. The explanation is omitted. Further, when data other than the range indicated by the data range list is received, the frame generation unit 140 is notified to transmit an error frame.

データ範囲リスト保持部2120は、車載ネットワークシステム11においてバス上を送信されるデータフレームに含まれるデータ(データフィールドの値)について許容される範囲を予め規定したリストであるデータ範囲リストを保持する(図21参照)。 The data range list holding unit 2120 holds a data range list which is a list in which an allowable range is predetermined for data (value of a data field) included in a data frame transmitted on a bus in the in-vehicle network system 11 ( (See FIG. 21).

[2.3 データ範囲リスト例]
図21は、不正検知ECU2100aのデータ範囲リスト保持部2120に保持されるデータ範囲リストの一例を示した図である。このデータ範囲リストは、各ID(メッセージID)と、そのメッセージIDのデータフレームにおけるデータフィールドの値(データ)として許容されるデータ範囲とを対応付けたものである。図21の例では、メッセージIDが「1」のデータフレームについては、データ範囲「0〜180」、メッセージIDが「2」又は「4」のデータフレームについては、データ範囲「0〜100」、メッセージIDが「3」のデータフレームについて、データ範囲「0、1」をそれぞれ正常としている。
[2.3 Data range list example]
FIG. 21 is a diagram showing an example of a data range list held in the data range list holding unit 2120 of the fraud detection ECU 2100a. This data range list associates each ID (message ID) with a data range that is allowed as a value (data) of a data field in the data frame of the message ID. In the example of FIG. 21, the data range is "0 to 180" for the data frame having the message ID "1", and the data range "0 to 100" is used for the data frame having the message ID "2" or "4". For the data frame whose message ID is "3", the data range "0, 1" is set to normal.

[2.4 不正フレームの検知に係るシーケンス]
以下、上述の構成を備える車載ネットワークシステム11のバス500aに不正なECUが接続された場合について、バス500aに接続された不正検知ECU2100a、ECU400a、ECU400b、ゲートウェイ300等の動作について説明する。
[2.4 Sequence related to detection of illegal frames]
Hereinafter, the operations of the fraud detection ECU 2100a, ECU 400a, ECU 400b, gateway 300, etc. connected to the bus 500a will be described when a fraudulent ECU is connected to the bus 500a of the vehicle-mounted network system 11 having the above configuration.

図22及び図23は、不正検知ECU2100aが不正なフレーム(メッセージ)を検知して、他のECUによりその不正なフレームに対応した処理がなされることを阻止する動作例を示すシーケンス図である。図22及び図23では、実施の形態1で示した図18の場合と同様に、不正なECUが、バス500aにメッセージIDが「4」でデータフィールド(データ)が「255(0xFF)」となるデータフレームを送信する場合の例を示している。実施の形態1で示したシーケンスと同じシーケンスには同じ符号を付しており、ここでは説明を簡略化する。 22 and 23 are sequence diagrams showing an operation example in which the fraud detection ECU 2100a detects a fraudulent frame (message) and prevents another ECU from performing processing corresponding to the fraudulent frame. In FIGS. 22 and 23, as in the case of FIG. 18 shown in the first embodiment, the illegal ECU indicates that the message ID is “4” and the data field (data) is “255 (0xFF)” on the bus 500a. An example of transmitting a data frame is shown. The same sequences as those shown in the first embodiment are designated by the same reference numerals, and the description thereof will be simplified here.

まず、不正なECUは、不正なデータフレームの送信を開始する(シーケンスS1001)。不正検知ECU2100a、ECU400a、ECU400b及びゲートウェイ300はそれぞれメッセージIDを受信する(シーケンスS1002)。ECU400a、ECU400b及びゲートウェイ300はそれぞれ、保持している受信IDリストを用いてメッセージIDをチェックする(シーケンスS1003)。ECU400a及びECU400bは、それぞれが保持している受信IDリストに「4」が含まれていないため(図9参照)、受信を終了する。ゲートウェイ300は、保持している受信IDリストに「4」が含まれているため(図5参照)、受信を継続しデータフィールドの受信を行う(シーケンスS1006a)。同様に不正検知ECU2100aもデータフィールドの受信を行う(シーケンスS1006a)。 First, the illegal ECU starts transmitting an illegal data frame (sequence S1001). The fraud detection ECU 2100a, ECU 400a, ECU 400b and gateway 300 each receive a message ID (sequence S1002). Each of the ECU 400a, the ECU 400b, and the gateway 300 checks the message ID using the received reception ID list held (sequence S1003). Since "4" is not included in the reception ID list held by each of the ECU 400a and the ECU 400b (see FIG. 9), the reception is terminated. Since the gateway 300 includes "4" in the received reception ID list held (see FIG. 5), the gateway 300 continues the reception and receives the data field (sequence S1006a). Similarly, the fraud detection ECU 2100a also receives the data field (sequence S1006a).

シーケンスS1006aに続いて、不正検知ECU2100aは、データ範囲リスト(図21参照)を用いて、データフィールドのデータをチェックする(シーケンスS2001)。即ち、不正検知ECU2100aは、送信されたフレームにおけるIDフィールドの内容が、不正を示す所定条件(データ範囲リストに記載されているデータの範囲に入らないこと)に該当するか否かを判定する。不正検知ECU2100aは、データ範囲リストにおいてID「4」に対応する「255(0xFF)」の値が記載されていないため、不正なデータフレームであると判断し、続いてエラーフレームの発行準備を開始する(シーケンスS1005)。 Following the sequence S1006a, the fraud detection ECU 2100a checks the data in the data field using the data range list (see FIG. 21) (sequence S2001). That is, the fraud detection ECU 2100a determines whether or not the content of the ID field in the transmitted frame corresponds to a predetermined condition indicating fraud (not within the range of data described in the data range list). The fraud detection ECU 2100a determines that the data frame is invalid because the value of "255 (0xFF)" corresponding to the ID "4" is not described in the data range list, and then starts preparing for issuing an error frame. (Sequence S1005).

不正検知ECU2100aがエラーフレームの発行準備をしている間に、不正なECUからはバス500a上にデータフィールドより後の部分であるCRCフィールド(CRCシーケンス及びCRCデリミタ)が1ビットずつ逐次送出される。ゲートウェイ300はこのCRCフィールドの受信を開始する(シーケンスS2002)。 While the fraud detection ECU 2100a is preparing to issue an error frame, a CRC field (CRC sequence and CRC delimiter), which is a part after the data field, is sequentially transmitted bit by bit from the fraudulent ECU on the bus 500a. .. The gateway 300 starts receiving this CRC field (sequence S2002).

次にエラーフレームの発行準備が終わって、不正検知ECU2100aがエラーフレームを送信する(シーケンスS1007)。このエラーフレームの送信が開始されることによりバス500aでは、不正なECUから送信中のフレームのCRCシーケンスの途中部分がエラーフレーム(優先されるドミナントのビット列)により上書きされることになる。 Next, the preparation for issuing the error frame is completed, and the fraud detection ECU 2100a transmits the error frame (sequence S1007). When the transmission of this error frame is started, in the bus 500a, the middle part of the CRC sequence of the frame being transmitted from the illegal ECU is overwritten by the error frame (priority dominant bit string).

シーケンスS1007において送信されたエラーフレームを受信したゲートウェイ300は、CRCシーケンスを含むCRCフィールドの受信途中で、不正なECUが送信していたデータフレームの受信を中止する(シーケンスS2003)。つまり、ゲートウェイ300は、不正なECUからのCRCシーケンスがエラーフレームで上書きされており、エラーフレームを検出するので、不正なECUが送信していたデータフレームの受信を継続しない。 The gateway 300 that has received the error frame transmitted in the sequence S1007 stops receiving the data frame transmitted by the invalid ECU during the reception of the CRC field including the CRC sequence (sequence S2003). That is, the gateway 300 does not continue to receive the data frame transmitted by the illegal ECU because the CRC sequence from the illegal ECU is overwritten with the error frame and detects the error frame.

不正検知ECU2100aは、エラーフレームを送信する対象となったデータフレームのID「4」に対応する不正検知カウンタをインクリメントする(シーケンスS1009)。インクリメントした結果としてID「4」に対応する不正検知カウンタが17以上となった場合、不正検知ECU2100aは、エラー表示メッセージを送信する(シーケンスS1010)。 The fraud detection ECU 2100a increments the fraud detection counter corresponding to the ID “4” of the data frame to which the error frame is transmitted (sequence S1009). When the fraud detection counter corresponding to the ID "4" becomes 17 or more as a result of the increment, the fraud detection ECU 2100a transmits an error display message (sequence S1010).

[2.5 実施の形態2の効果]
実施の形態2で示した不正検知ECUは、送信されたフレームが不正なフレームか否かを、フレーム(データフレーム)のIDフィールド及びデータフィールドについてデータ範囲リストを用いて判定する。これにより、データフレームにおけるIDフィールドとデータフィールドとの組み合わせによって不正を判定できるため、既存のECU(つまり不正検知ECU及び不正なECU以外のECU)において不正なフレームが解釈されてそのフレームに対応する処理が実行されることを阻止することができる。また、データフレームのデータフィールドまで受信するだけで判定ができるため、データフレームの後部を受信して判定を行う場合よりも、バスのトラフィックを抑えることが可能となる。
[2.5 Effect of Embodiment 2]
The fraud detection ECU shown in the second embodiment determines whether or not the transmitted frame is a fraudulent frame by using a data range list for the ID field and the data field of the frame (data frame). As a result, fraud can be determined by the combination of the ID field and the data field in the data frame, so that the fraud detection ECU and the ECU other than the fraud ECU interpret the fraudulent frame and correspond to the fraudulent frame. It is possible to prevent the process from being executed. Further, since the judgment can be made only by receiving the data field of the data frame, it is possible to suppress the bus traffic as compared with the case where the judgment is made by receiving the rear part of the data frame.

また、不正検知ECUが、不正検知カウンタを用いてエラーフレームを送信した回数をカウントすることで、エラーフレームの受信により不正なメッセージIDを送信するノードにおける送信エラーカウンタがCANプロトコルに従えばパッシブ状態に遷移すべき上限値まで到達していることを検出することができる。これにより、不正なメッセージIDを送信するノードが、CANプロトコルのエラーカウンタの仕様に準拠しているか否かを判定することが可能となる。 Further, the fraud detection ECU counts the number of times the error frame is transmitted by using the fraud detection counter, so that the transmission error counter in the node that transmits the fraudulent message ID by receiving the error frame is in a passive state if it follows the CAN protocol. It can be detected that the upper limit value to be transitioned to is reached. This makes it possible to determine whether or not the node that transmits the invalid message ID complies with the specifications of the error counter of the CAN protocol.

また、不正なフレームの判定を行うノードを不正検知ECUのみとすることで、既存のネットワーク構成への影響を最小限に抑えることができ、システム全体として処理量、電力消費量を抑えることができる。 Further, by using only the fraud detection ECU as the node that determines the fraudulent frame, the influence on the existing network configuration can be minimized, and the processing amount and power consumption of the entire system can be suppressed. ..

なお、上述した車載ネットワークシステム11における1つ又は複数の不正検知ECUが、検知を行うか否かを切り替え可能にしても良い。そして、車両の状態が、例えば使用開始から一定期間が経過した等といった一定の場合に限って、不正検知ECUが不正なメッセージの検知を行わないこととしても良い。これにより、電力消費量を抑えることが可能となる。 It should be noted that one or more fraud detection ECUs in the above-mentioned in-vehicle network system 11 may switch whether or not to perform detection. Then, the fraud detection ECU may not detect a fraudulent message only when the vehicle is in a certain state, for example, a certain period of time has passed since the start of use. This makes it possible to reduce power consumption.

(実施の形態3)
以下、本開示の実施の形態として、メッセージID、データ及びカウンタ値から算出されるメッセージ認証コード(MAC:Message Authentication Code)を用いて、他のノード(ECU)において不正なフレームに基づく処理が実行されることを阻止するための不正対処方法を実現する不正検知ECUを含む車載ネットワークシステム12について説明する。
(Embodiment 3)
Hereinafter, as an embodiment of the present disclosure, a process based on an invalid frame is executed on another node (ECU) using a message authentication code (MAC) calculated from a message ID, data, and a counter value. An in-vehicle network system 12 including a fraud detection ECU that realizes a fraud countermeasure method for preventing fraud will be described.

[3.1 車載ネットワークシステム12の全体構成]
図24は、実施の形態3に係る車載ネットワークシステム12の全体構成を示す図である。車載ネットワークシステム12は、実施の形態1で示した車載ネットワークシステム10の一部を変形したものである。車載ネットワークシステム12は、バス500a、500bと、不正検知ECU3100a、3100b、ヘッドユニット200、ゲートウェイ300、及び、各種機器に接続されたECU3400a〜3400d等のECUといったバスに接続された各ノードとを含んで構成される。車載ネットワークシステム12の構成要素のうち、実施の形態1と同様の機能を有する構成要素は、同じ符号を付して説明を省略する。
[3.1 Overall configuration of in-vehicle network system 12]
FIG. 24 is a diagram showing the overall configuration of the vehicle-mounted network system 12 according to the third embodiment. The in-vehicle network system 12 is a modification of a part of the in-vehicle network system 10 shown in the first embodiment. The in-vehicle network system 12 includes buses 500a and 500b, and each node connected to a bus such as a fraud detection ECU 3100a and 3100b, a head unit 200, a gateway 300, and ECUs such as ECUs 3400a to 3400d connected to various devices. Consists of. Among the components of the in-vehicle network system 12, the components having the same functions as those in the first embodiment are designated by the same reference numerals and the description thereof will be omitted.

不正検知ECU3100a、3100bは、それぞれバス500a、バス500bに接続され、ECU3400a〜3400d等により送信されたフレームが不正であるかどうかを判定し、不正であればエラーフレームを送信する機能を有するECUである。 The fraud detection ECUs 3100a and 3100b are ECUs that are connected to the bus 500a and the bus 500b, respectively, and have a function of determining whether or not the frame transmitted by the ECUs 3400a to 3400d is invalid, and if it is invalid, transmitting an error frame. is there.

ECU3400a〜3400dは、いずれかのバスと接続され、また、それぞれエンジン401、ブレーキ402、ドア開閉センサ403、窓開閉センサ404に接続されている。ECU3400a〜3400dのそれぞれは、接続されている機器(エンジン401等)の状態を取得し、定期的に状態を表すデータフレームをネットワーク(つまりバス)に送信している。送信されるデータフレームのデータフィールドには、メッセージIDとデータ値と送信毎にインクリメントされるカウンタ値とから計算により導出されるメッセージ認証コード(MAC)が付与される。 The ECUs 3400a to 3400d are connected to any of the buses, and are also connected to the engine 401, the brake 402, the door open / close sensor 403, and the window open / close sensor 404, respectively. Each of the ECUs 3400a to 3400d acquires the state of the connected device (engine 401, etc.) and periodically transmits a data frame indicating the state to the network (that is, the bus). A message authentication code (MAC) derived by calculation from a message ID, a data value, and a counter value that is incremented for each transmission is assigned to the data field of the transmitted data frame.

[3.2 ECU3400aの構成]
図25は、ECU3400aの構成図である。ECU3400aは、フレーム送受信部460と、フレーム解釈部450と、受信ID判断部430と、受信IDリスト保持部440と、フレーム処理部410と、フレーム生成部3420と、データ取得部470と、MAC生成部3410と、MAC鍵保持部3430と、カウンタ保持部3440とを含んで構成される。これらの各構成要素は、機能的な構成要素であり、その各機能は、ECU3400aにおける通信回路、メモリに格納された制御プログラムを実行するプロセッサ或いはデジタル回路等により実現される。ECU3400aは、実施の形態1で示したECU400aの一部を変形したものであり、実施の形態1と同様の機能を有する構成要素は、同じ符号を付して説明を省略する。
[3.2 Configuration of ECU 3400a]
FIG. 25 is a configuration diagram of the ECU 3400a. The ECU 3400a includes a frame transmission / reception unit 460, a frame interpretation unit 450, a reception ID determination unit 430, a reception ID list holding unit 440, a frame processing unit 410, a frame generation unit 3420, a data acquisition unit 470, and a MAC generation. A unit 3410, a MAC key holding unit 3430, and a counter holding unit 3440 are included. Each of these components is a functional component, and each function is realized by a communication circuit in the ECU 3400a, a processor that executes a control program stored in a memory, a digital circuit, or the like. The ECU 3400a is a modification of a part of the ECU 400a shown in the first embodiment, and components having the same functions as those of the first embodiment are designated by the same reference numerals and the description thereof will be omitted.

フレーム生成部3420は、実施の形態1で示したフレーム生成部420の一部を変形したものである。フレーム生成部3420は、フレーム解釈部450から通知されたエラーフレームの送信を指示する通知に従い、エラーフレームを構成し、エラーフレームをフレーム送受信部460へ通知して送信させる。また、フレーム生成部3420は、データ取得部470より通知されたデータの値と予め定められたメッセージIDとをMAC生成部3410へ通知して、算出されたMACを受け取る。フレーム生成部3420は、予め定められたメッセージIDとデータ取得部470より通知されたデータの値とMAC生成部3410から受け取ったMACとを含むようにフレームを構成し(図26参照)、フレーム送受信部460へ通知する。 The frame generation unit 3420 is a modification of a part of the frame generation unit 420 shown in the first embodiment. The frame generation unit 3420 configures an error frame according to the notification instructing the transmission of the error frame notified from the frame interpretation unit 450, and notifies the frame transmission / reception unit 460 of the error frame to transmit the error frame. Further, the frame generation unit 3420 notifies the MAC generation unit 3410 of the value of the data notified from the data acquisition unit 470 and the predetermined message ID, and receives the calculated MAC. The frame generation unit 3420 configures a frame so as to include a predetermined message ID, a data value notified from the data acquisition unit 470, and a MAC received from the MAC generation unit 3410 (see FIG. 26), and sends and receives frames. Notify department 460.

MAC生成部3410は、フレーム生成部3420より通知されるメッセージIDとデータの値と、カウンタ保持部3440で保持するカウンタ値とを結合した値(結合値)に対し、MAC鍵保持部3430で保持するMAC鍵を用いて、MACを算出(計算により導出)して、この算出した結果であるMACをフレーム生成部3420へと通知する。ここではMACの計算方法として、HMAC(Hash-based Message Authentication Code)(非特許文献2参照)を採用し、上述した結合値に対し、所定のブロック分(例えば4bytes)までパディングした値でMAC鍵を使って計算し、出てきた計算結果の先頭4bytesをMACとする。なお、ここでは、MACを算出するために用いる結合値は、メッセージIDとデータの値とカウンタ保持部3440で保持するカウンタ値とを使用しているが、これらの3つのうち、いずれか1つ又は2つの組み合わせを用いてMACを算出しても良い。 The MAC generation unit 3410 holds the message ID and data values notified by the frame generation unit 3420 and the counter value held by the counter holding unit 3440 in the MAC key holding unit 3430 with respect to the combined value (combined value). The MAC is calculated (derived by calculation) using the MAC key to be used, and the MAC resulting from the calculation is notified to the frame generation unit 3420. Here, HMAC (Hash-based Message Authentication Code) (see Non-Patent Document 2) is adopted as the MAC calculation method, and the MAC key is a value padded up to a predetermined block (for example, 4 bytes) with respect to the above-mentioned combined value. Is calculated using, and the first 4 bytes of the calculated result is MAC. Here, as the coupling value used for calculating the MAC, the message ID, the data value, and the counter value held by the counter holding unit 3440 are used, but any one of these three is used. Alternatively, the MAC may be calculated using a combination of the two.

MAC鍵保持部3430は、MACを計算するため必要となるMAC鍵を保持する。 The MAC key holding unit 3430 holds the MAC key required for calculating the MAC.

カウンタ保持部3440は、MACを計算するために必要となるカウンタ値を保持する。なお、このカウンタ値は、フレーム送受信部460においてデータフレームが正常に送信された度にインクリメントされる。 The counter holding unit 3440 holds a counter value required for calculating the MAC. The counter value is incremented each time the data frame is normally transmitted in the frame transmission / reception unit 460.

なお、ECU3400b〜3400dは、それぞれ実施の形態1で示したECU400b〜400dの一部を変形したものであり、上述したECU3400aと基本的に同様の構成を備える。但し、受信IDリスト保持部440に保持される受信IDリストはECU毎に異なる内容となり得る。例えばECU3400a及びECU3400bは図9に例示する受信IDリストを保持し、ECU3400c及びECU3400dは図5に例示する受信IDリストを保持する。また、フレーム処理部410の処理内容は、実施の形態1で示したようにECU毎に異なる。以下、ECU3400a〜3400dのそれぞれが送信するフレームの内容について図26〜図29を用いて説明する。 Each of the ECUs 3400b to 3400d is a modification of a part of the ECUs 400b to 400d shown in the first embodiment, and has basically the same configuration as the above-mentioned ECU 3400a. However, the received ID list held in the received ID list holding unit 440 may have different contents for each ECU. For example, the ECU 3400a and the ECU 3400b hold the reception ID list illustrated in FIG. 9, and the ECU 3400c and the ECU 3400d hold the reception ID list illustrated in FIG. Further, the processing content of the frame processing unit 410 differs for each ECU as shown in the first embodiment. Hereinafter, the contents of the frames transmitted by each of the ECUs 3400a to 3400d will be described with reference to FIGS. 26 to 29.

[3.3 エンジンに係るECU3400aの送信フレーム例]
図26は、エンジン401に接続されたECU3400aから送信されるデータフレームにおけるID(メッセージID)及びデータフィールド(データ)の一例を示す図である。ECU3400aが送信するフレームのメッセージIDは「1」である。データは、同図において1バイト毎に空白で区分して表しており、先頭の1byteが時速(km/時)を表し、次の1byteはカウンタ値を表し、次の4bytesがMACを表す。なお、図26の例においてMACは16進数で表記している。先頭1byteの時速(km/時)は、最低0(km/時)〜最高180(km/時)までの範囲の値を取る。図26の上行から下行へと、ECU3400aから逐次送信される各フレームに対応する各メッセージID及びデータを例示しており、カウンタ値が次第に増加し、時速が0km/時から1km/時ずつ加速されている様子を表している。
[Example of transmission frame of ECU 3400a related to 3.3 engine]
FIG. 26 is a diagram showing an example of an ID (message ID) and a data field (data) in a data frame transmitted from the ECU 3400a connected to the engine 401. The message ID of the frame transmitted by the ECU 3400a is "1". The data is represented by blanks for each byte in the figure, the first 1 byte represents the speed (km / hour), the next 1 byte represents the counter value, and the next 4 bytes represents the MAC. In the example of FIG. 26, MAC is expressed in hexadecimal. The speed (km / hour) of the first 1 byte takes a value in the range of a minimum of 0 (km / hour) to a maximum of 180 (km / hour). From the ascending line to the descending line of FIG. 26, each message ID and data corresponding to each frame sequentially transmitted from the ECU 3400a are illustrated, the counter value is gradually increased, and the speed is accelerated from 0 km / hour to 1 km / hour. It shows how it is.

[3.4 ブレーキに係るECU3400bの送信フレーム例]
図27は、ブレーキ402に接続されたECU3400bから送信されるデータフレームにおけるID(メッセージID)及びデータフィールド(データ)の一例を示す図である。ECU3400bが送信するフレームのメッセージIDは「2」である。データは、同図において1バイト毎に空白で区分して表しており、先頭の1byteがブレーキのかかり具合を割合(%)で表し、次の1byteはカウンタ値を表し、次の4bytesがMACを表す。なお、図27の例においてMACは16進数で表記している。先頭1byteのブレーキのかかり具合は、ブレーキを全くかけていない状態を0(%)、ブレーキを最大限かけている状態を100(%)としたものである。図27の上行から下行へと、ECU3400bから逐次送信される各フレームに対応する各メッセージID及びデータを例示しており、カウンタ値が次第に増加し、ブレーキについては100%から徐々にブレーキを弱めている様子を表している。
[Example of transmission frame of ECU 3400b related to 3.4 brake]
FIG. 27 is a diagram showing an example of an ID (message ID) and a data field (data) in a data frame transmitted from the ECU 3400b connected to the brake 402. The message ID of the frame transmitted by the ECU 3400b is "2". The data is represented by blanks for each byte in the figure, the first 1 byte represents the degree of braking as a percentage (%), the next 1 byte represents the counter value, and the next 4 bytes represents the MAC. Represent. In the example of FIG. 27, MAC is expressed in hexadecimal. The degree of braking of the first 1 byte is 0 (%) when the brake is not applied at all and 100 (%) when the brake is applied to the maximum. From the ascending line to the descending line of FIG. 27, each message ID and data corresponding to each frame sequentially transmitted from the ECU 3400b are illustrated, the counter value gradually increases, and the brake is gradually weakened from 100%. It shows how it is.

[3.5 ドア開閉センサに係るECU3400cの送信フレーム例]
図28は、ドア開閉センサ403に接続されたECU3400cから送信されるデータフレームにおけるID(メッセージID)及びデータフィールド(データ)の一例を示す図である。ECU3400cが送信するフレームのメッセージIDは「3」である。データは、同図において1バイト毎に空白で区分して表しており、先頭の1byteがドアの開閉状態を表し、次の1byteはカウンタ値を表し、次の4bytesがMACを表す。なお、図28の例においてMACは16進数で表記している。先頭1byteのドアの開閉状態は、ドアが開いている状態を「1」、ドアが閉まっている状態を「0」としたものである。図28の上行から下行へと、ECU3400cから逐次送信される各フレームに対応する各メッセージID及びデータを例示しており、カウンタ値が次第に増加し、ドアが開いている状態から次第に閉められた状態へと移った様子を表している。
[3.5 Transmission frame example of ECU 3400c related to door open / close sensor]
FIG. 28 is a diagram showing an example of an ID (message ID) and a data field (data) in a data frame transmitted from the ECU 3400c connected to the door open / close sensor 403. The message ID of the frame transmitted by the ECU 3400c is "3". The data is represented by blanks for each byte in the figure, the first 1 byte represents the open / closed state of the door, the next 1 byte represents the counter value, and the next 4 bytes represents the MAC. In the example of FIG. 28, MAC is expressed in hexadecimal. The open / closed state of the door of the first 1 byte is "1" when the door is open and "0" when the door is closed. From the ascending line to the descending line of FIG. 28, each message ID and data corresponding to each frame sequentially transmitted from the ECU 3400c are illustrated, and the counter value gradually increases, and the state in which the door is gradually closed is gradually increased. It shows how it moved to.

[3.6 窓開閉センサに係るECU3400dの送信フレーム例]
図29は、窓開閉センサ404に接続されたECU3400dから送信されるデータフレームにおけるID(メッセージID)及びデータフィールド(データ)の一例を示す図である。ECU3400dが送信するフレームのメッセージIDは「4」である。データは、同図において1バイト毎に空白で区分して表しており、先頭の1byteが窓の開閉状態を割合(%)で表し、次の1byteはカウンタ値を表し、次の4bytesがMACを表す。なお、図29の例においてMACは16進数で表記している。先頭1byteの窓の開閉状態は、窓が完全に閉まっている状態を0(%)、窓が全開の状態を100(%)としたものである。図29の上行から下行へと、ECU3400dから逐次送信される各フレームに対応する各メッセージID及びデータを例示しており、カウンタ値が次第に増加し、窓が閉まっている状態から徐々に開いていく様子を表している。
[Example of transmission frame of ECU3400d related to 3.6 window open / close sensor]
FIG. 29 is a diagram showing an example of an ID (message ID) and a data field (data) in a data frame transmitted from the ECU 3400d connected to the window opening / closing sensor 404. The message ID of the frame transmitted by the ECU 3400d is "4". The data is represented by blanks for each byte in the figure, the first 1 byte represents the open / closed state of the window as a percentage (%), the next 1 byte represents the counter value, and the next 4 bytes represents the MAC. Represent. In the example of FIG. 29, MAC is expressed in hexadecimal. The open / closed state of the window of the first 1 byte is 0 (%) when the window is completely closed and 100 (%) when the window is fully open. From the upper row to the lower row in FIG. 29, each message ID and data corresponding to each frame sequentially transmitted from the ECU 3400d are illustrated, the counter value gradually increases, and the window gradually opens from the closed state. It shows the situation.

[3.7 不正検知ECU3100aの構成]
図30は、不正検知ECU3100aの構成図である。不正検知ECU3100aは、フレーム送受信部160と、フレーム解釈部3150と、不正MAC検知部3130と、MAC鍵保持部3180と、カウンタ保持部3190と、フレーム生成部140と、MAC生成部3170と、不正検知カウンタ保持部110から構成される。これらの各構成要素は、機能的な構成要素であり、その各機能は、不正検知ECU3100aにおける通信回路、メモリに格納された制御プログラムを実行するプロセッサ或いはデジタル回路等により実現される。不正検知ECU3100aは、実施の形態1で示した不正検知ECU100aの一部を変形したものであり、実施の形態1と同様の機能を有する構成要素は、同じ符号を付して説明を省略する。なお、不正検知ECU3100bも同様の構成である。
[Structure of 3.7 fraud detection ECU 3100a]
FIG. 30 is a configuration diagram of the fraud detection ECU 3100a. The fraud detection ECU 3100a includes a frame transmission / reception unit 160, a frame interpretation unit 3150, a fraud MAC detection unit 3130, a MAC key holding unit 3180, a counter holding unit 3190, a frame generation unit 140, and a MAC generation unit 3170. It is composed of a detection counter holding unit 110. Each of these components is a functional component, and each function is realized by a communication circuit in the fraud detection ECU 3100a, a processor that executes a control program stored in a memory, a digital circuit, or the like. The fraud detection ECU 3100a is a modification of a part of the fraud detection ECU 100a shown in the first embodiment, and components having the same functions as those of the first embodiment are designated by the same reference numerals and the description thereof will be omitted. The fraud detection ECU 3100b has the same configuration.

フレーム解釈部3150は、実施の形態1で示したフレーム解釈部150を変形したものであり、フレーム送受信部160よりフレームの値を受け取り、CANプロトコルで規定されているフレームフォーマットにおける各フィールドにマッピングするよう解釈を行う。フレームがデータフレームであると判断した場合においてデータフィールドと判断した値(データ)は、IDフィールドのID(メッセージID)と共に、不正MAC検知部3130へ転送する。また、フレーム解釈部3150は、CANプロトコルに則っていないフレームと判断した場合は、エラーフレームを送信するようにフレーム生成部140へ通知する。また、フレーム解釈部3150は、エラーフレームを受信した場合、つまり受け取ったフレームにおける値からエラーフレームになっていると解釈した場合には、それ以降はそのフレームを破棄する、つまりフレームの解釈を中止する。 The frame interpretation unit 3150 is a modification of the frame interpretation unit 150 shown in the first embodiment, receives a frame value from the frame transmission / reception unit 160, and maps it to each field in the frame format specified by the CAN protocol. Interpret as. When it is determined that the frame is a data frame, the value (data) determined to be a data field is transferred to the fraudulent MAC detection unit 3130 together with the ID (message ID) of the ID field. Further, when the frame interpretation unit 3150 determines that the frame does not conform to the CAN protocol, the frame interpretation unit 3150 notifies the frame generation unit 140 to transmit an error frame. Further, when the frame interpreting unit 3150 receives an error frame, that is, interprets that the value in the received frame is an error frame, the frame interpreting unit 3150 discards the frame after that, that is, stops interpreting the frame. To do.

不正MAC検知部3130は、フレーム解釈部3150から通知されるメッセージIDと、データフィールドの値(データ)を受け取ってデータフィールド中のMACを検証する機能を有する。不正MAC検知部3130は、通知されたメッセージID及びデータフィールドの値を、MAC生成部3170へと通知し、MAC生成部3170により生成されたMACを取得する。不正MAC検知部3130は、データフィールドのデータが不正を示す所定条件に該当するか否かを判定する。即ち不正MAC検知部3130は、受信されたフレームにおける所定フィールドの内容が不正を示す所定条件に該当するか否かを判定する言わば判定部として機能する。この不正を示す所定条件は、定められた検証処理手順(MACの生成、MACの比較等を含む手順)での検証に失敗することであり、つまり、データに含まれるMACが、MAC生成部3170により生成されたMACと相違するという条件である。不正MAC検知部3130は、MAC生成部3170から取得したMACと、データフィールド中のMACとを比較することで、不正かどうかの判定(即ちMACの検証)を行う。両MACの値の比較の結果、不一致の場合は、不正の検知回数をインクリメントするために、受信したメッセージIDを不正検知カウンタ保持部110へ通知する。この不正の検知回数が一定回数以上に達した場合において、ヘッドユニット200で受信されるようにエラー表示メッセージを送信するための制御については実施の形態1で説明した通りであるため、ここでの説明を省略する。また、両MACの値の比較の結果、不一致の場合は、エラーフレームを送信するように、フレーム生成部140へ通知する。MAC値の比較の結果、一致する場合は、カウンタ保持部3190が保持する、メッセージIDに対応するカウンタ値をインクリメントするようにMAC生成部3170へ通知する。 The fraudulent MAC detection unit 3130 has a function of receiving the message ID notified from the frame interpretation unit 3150 and the value (data) of the data field and verifying the MAC in the data field. The fraudulent MAC detection unit 3130 notifies the MAC generation unit 3170 of the notified message ID and the value of the data field, and acquires the MAC generated by the MAC generation unit 3170. The fraudulent MAC detection unit 3130 determines whether or not the data in the data field meets a predetermined condition indicating fraud. That is, the fraudulent MAC detection unit 3130 functions as a so-called determination unit for determining whether or not the content of a predetermined field in the received frame corresponds to a predetermined condition indicating fraud. The predetermined condition indicating this fraud is that the verification in the specified verification processing procedure (procedure including MAC generation, MAC comparison, etc.) fails, that is, the MAC included in the data is the MAC generation unit 3170. The condition is that it differs from the MAC generated by. The fraudulent MAC detection unit 3130 determines whether or not it is fraudulent (that is, verification of the MAC) by comparing the MAC acquired from the MAC generation unit 3170 with the MAC in the data field. As a result of comparing the values of both MACs, if they do not match, the received message ID is notified to the fraud detection counter holding unit 110 in order to increment the number of fraud detections. When the number of times of detection of this fraud reaches a certain number of times or more, the control for transmitting the error display message so as to be received by the head unit 200 is as described in the first embodiment. The explanation is omitted. Further, as a result of comparing the values of both MACs, if they do not match, the frame generation unit 140 is notified to transmit an error frame. As a result of comparing the MAC values, if they match, the MAC generation unit 3170 is notified to increment the counter value corresponding to the message ID held by the counter holding unit 3190.

MAC生成部3170は、不正MAC検知部3130より通知されたメッセージIDを使って、MAC鍵保持部3180より、対応するMAC鍵を取得し、カウンタ保持部3190より対応するカウンタをそれぞれ取得する。MAC生成部3170は、不正MAC検知部3130より通知されたデータフィールドの値(先頭1byteの値)と、カウンタ保持部3190より取得したカウンタ値に対して、MAC鍵保持部3180より取得したMAC鍵を使ってMACを算出(計算により導出)し、算出したMACを不正MAC検知部3130へ通知する。なお、不正検知ECU3100a、3100b及びECU3400a〜3400dのいずれにおいても、MAC鍵を用いてMACを算出するアルゴリズムは同一のものを用いる。 The MAC generation unit 3170 acquires the corresponding MAC key from the MAC key holding unit 3180 and the corresponding counter from the counter holding unit 3190 by using the message ID notified by the fraudulent MAC detection unit 3130. The MAC generation unit 3170 has a MAC key acquired from the MAC key holding unit 3180 with respect to the data field value (value of the first 1 byte) notified by the fraudulent MAC detection unit 3130 and the counter value acquired from the counter holding unit 3190. The MAC is calculated (derived by calculation) using the above, and the calculated MAC is notified to the fraudulent MAC detection unit 3130. In any of the fraud detection ECUs 3100a and 3100b and the ECUs 3400a to 3400d, the same algorithm for calculating the MAC using the MAC key is used.

MAC鍵保持部3180は、MACを計算するため必要となるMAC鍵をメッセージID毎に対応付けて保持する。このMAC鍵保持部3180が保持するMAC鍵は、対応付けられたメッセージID毎に異なる値である。なお、ECU及び不正検知ECUにおいて用いられるMAC鍵は、1つの送信ノードが複数のメッセージIDそれぞれのフレームを送信する場合を想定すると、送信ノード毎に異なる鍵であることとしても良い。また、MAC鍵は、例えば同一のバス上で送信されるフレームに同一の値が用いられるようにしても良いし、異なるバス上であっても同一の鍵(値)としても良いし、車一台あたり同一の鍵としても良く、同一車種で同一の鍵としても良く、同一製造メーカ毎に同一の鍵としても良く、異なる製造メーカであっても同一の鍵としても良い。 The MAC key holding unit 3180 holds the MAC key required for calculating the MAC in association with each message ID. The MAC key held by the MAC key holding unit 3180 has a different value for each associated message ID. It should be noted that the MAC key used in the ECU and the fraud detection ECU may be a different key for each transmitting node, assuming that one transmitting node transmits a frame of each of a plurality of message IDs. Further, as the MAC key, for example, the same value may be used for frames transmitted on the same bus, the same key (value) may be used even on different buses, and the vehicle one. The same key may be used for each unit, the same key may be used for the same vehicle model, the same key may be used for the same manufacturer, and the same key may be used for different manufacturers.

カウンタ保持部3190は、MAC値を計算するために必要となるカウンタ値をメッセージID毎に保持する。このカウンタ値は、フレームを正常に受信した場合(つまり不正MAC検知部3130において比較した両MACが一致する場合)には、インクリメントされる。 The counter holding unit 3190 holds a counter value required for calculating the MAC value for each message ID. This counter value is incremented when the frame is normally received (that is, when both MACs compared by the illegal MAC detection unit 3130 match).

[3.8 カウンタ値の例]
図31は、カウンタ保持部3190に保持されているメッセージID毎のカウンタ値の一例を示す図である。同図では、メッセージIDが「1」のカウンタが1回、メッセージIDが「2」のカウンタが10回、メッセージIDが「3」のカウンタが15回、メッセージIDが「4」のカウンタが100回をそれぞれ示している。この各メッセージIDに対応するカウンタ値は、そのメッセージIDを含むフレームが正常に受信されている回数を表している。
[3.8 Counter value example]
FIG. 31 is a diagram showing an example of a counter value for each message ID held in the counter holding unit 3190. In the figure, the counter with the message ID "1" is once, the counter with the message ID "2" is 10 times, the counter with the message ID "3" is 15 times, and the counter with the message ID "4" is 100 times. Each time is shown. The counter value corresponding to each message ID represents the number of times the frame including the message ID is normally received.

[3.9 不正フレームの検知に係るシーケンス]
以下、上述の構成を備える車載ネットワークシステム12のバス500aに不正なECUが接続された場合について、バス500aに接続された不正検知ECU3100a、ECU3400a、ECU3400b、ゲートウェイ300等の動作について説明する。
[3.9 Sequence related to detection of illegal frames]
Hereinafter, the operations of the fraud detection ECU 3100a, ECU 3400a, ECU 3400b, gateway 300, etc. connected to the bus 500a will be described when a fraudulent ECU is connected to the bus 500a of the vehicle-mounted network system 12 having the above configuration.

図32及び図33は、不正検知ECU3100aが不正なフレーム(メッセージ)を検知して、他のECUによりその不正なフレームに対応した処理がなされることを阻止する動作例を示すシーケンス図である。図32及び図33では、実施の形態1で示した図18並びに実施の形態2で示した図22及び図23の場合と同様に、不正なECUが、バス500aに接続された例を示している。この不正なECUは、メッセージIDが「4」でデータフィールド(データ)が「0xFF FF FFFFFFFF」(6bytes)となるデータフレームを送信する。実施の形態1又は2で示したシーケンスと同じシーケンスには同じ符号を付しており、ここでは説明を簡略化する。 32 and 33 are sequence diagrams showing an operation example in which the fraud detection ECU 3100a detects a fraudulent frame (message) and prevents another ECU from performing a process corresponding to the fraudulent frame. 32 and 33 show an example in which an illegal ECU is connected to the bus 500a as in the case of FIG. 18 shown in the first embodiment and FIGS. 22 and 23 shown in the second embodiment. There is. This illegal ECU transmits a data frame in which the message ID is "4" and the data field (data) is "0xFF FF FFFFFFFF" (6 bytes). The same sequences as those shown in the first or second embodiment are designated by the same reference numerals, and the description thereof will be simplified here.

まず、不正なECUは、上述した不正なデータフレームの送信を開始する(シーケンスS1001a)。不正検知ECU3100a、ECU3400a、ECU3400b及びゲートウェイ300はそれぞれメッセージIDを受信する(シーケンスS1002)。ECU3400a、ECU3400b及びゲートウェイ300はそれぞれ、保持している受信IDリストを用いてメッセージIDをチェックする(シーケンスS1003)。ECU3400a及びECU3400bは、それぞれが保持している受信IDリストに「4」が含まれていないため(図9参照)、受信を終了する。ゲートウェイ300は、保持している受信IDリストに「4」が含まれているため(図5参照)、受信を継続しデータフィールドの受信を行う(シーケンスS1006a)。同様に不正検知ECU3100aもデータフィールドの受信を行う(シーケンスS1006a)。 First, the illegal ECU starts transmitting the above-mentioned illegal data frame (sequence S1001a). The fraud detection ECU 3100a, ECU 3400a, ECU 3400b and gateway 300 each receive a message ID (sequence S1002). Each of the ECU 3400a, the ECU 3400b, and the gateway 300 checks the message ID using the received reception ID list held (sequence S1003). Since "4" is not included in the reception ID list held by each of the ECU 3400a and the ECU 3400b (see FIG. 9), the reception is terminated. Since the gateway 300 includes "4" in the received reception ID list held (see FIG. 5), the gateway 300 continues the reception and receives the data field (sequence S1006a). Similarly, the fraud detection ECU 3100a also receives the data field (sequence S1006a).

シーケンスS1006aに続いて、不正検知ECU3100aは、データフィールドにおけるデータに含まれるMACを検証(チェック)する(シーケンスS3001)。即ち、不正検知ECU3100aは、送信されたフレームにおけるIDフィールドの内容が、不正を示す所定条件(MACの検証に失敗すること)に該当するか否かを判定する。不正検知ECU3100aは、不正なECUにより送信されたデータフレームにおけるデータフィールドの6bytesのデータ「0xFFFFFFFF」について、後半4bytesのMACと、メッセージID「4」に対応するMAC鍵とカウンタを用いて算定したMACとを比較することでMACの検証を行う。この比較の結果は不一致になり検証が失敗するので、不正検知ECU3100aでは、不正なデータフレームであると判断し、続いてエラーフレームの発行準備を開始する(シーケンスS1005)。 Following the sequence S1006a, the fraud detection ECU 3100a verifies (checks) the MAC included in the data in the data field (sequence S3001). That is, the fraud detection ECU 3100a determines whether or not the content of the ID field in the transmitted frame corresponds to a predetermined condition indicating fraud (failure in MAC verification). The fraud detection ECU 3100a uses the MAC of the latter half 4 bytes and the MAC key and counter corresponding to the message ID "4" to calculate the 6 bytes data "0xFFFFFFFF" of the data field in the data frame transmitted by the fraudulent ECU. The MAC is verified by comparing with. Since the results of this comparison are inconsistent and the verification fails, the fraud detection ECU 3100a determines that the data frame is fraudulent, and then starts preparation for issuing an error frame (sequence S1005).

不正検知ECU3100aがエラーフレームの発行準備をしている間に、ゲートウェイ300はCRCフィールドの受信を開始する(シーケンスS2002)。 While the fraud detection ECU 3100a is preparing to issue an error frame, the gateway 300 starts receiving the CRC field (sequence S2002).

次にエラーフレームの発行準備が終わって、不正検知ECU3100aがエラーフレームを送信する(シーケンスS1007)。このエラーフレームの送信が開始されることによりバス500aでは、不正なECUから送信中のフレームのCRCシーケンスの途中部分がエラーフレームにより上書きされることになる。 Next, the preparation for issuing the error frame is completed, and the fraud detection ECU 3100a transmits the error frame (sequence S1007). When the transmission of the error frame is started, in the bus 500a, the middle part of the CRC sequence of the frame being transmitted from the illegal ECU is overwritten by the error frame.

シーケンスS1007において送信されたエラーフレームを受信したゲートウェイ300は、CRCシーケンスを含むCRCフィールドの受信途中で、不正なECUが送信していたデータフレームの受信を中止する(シーケンスS2003)。 The gateway 300 that has received the error frame transmitted in the sequence S1007 stops receiving the data frame transmitted by the invalid ECU during the reception of the CRC field including the CRC sequence (sequence S2003).

不正検知ECU3100aは、エラーフレームを送信する対象となったデータフレームのID「4」に対応する不正検知カウンタをインクリメントする(シーケンスS1009)。インクリメントした結果としてID「4」に対応する不正検知カウンタが17以上となった場合、不正検知ECU3100aは、エラー表示メッセージを送信する(シーケンスS1010)。 The fraud detection ECU 3100a increments the fraud detection counter corresponding to the ID “4” of the data frame to which the error frame is transmitted (sequence S1009). When the fraud detection counter corresponding to the ID "4" becomes 17 or more as a result of the increment, the fraud detection ECU 3100a transmits an error display message (sequence S1010).

[3.10 実施の形態3の効果]
実施の形態3で示した不正検知ECUは、送信されたフレームが不正なフレームか否かを、フレーム(データフレーム)のデータフィールドに含ませたMACを検証することによって判定する。これにより、既存のECU(つまり不正検知ECU及び不正なECU以外のECU)において不正なフレームが解釈されてそのフレームに対応する処理が実行されることを阻止することができる。また、データフレームのデータフィールドまで受信するだけで判定ができるため、データフレームの後部を受信して判定を行う場合よりも、バスのトラフィックを抑えることが可能となる。
[3.10 Effect of Embodiment 3]
The fraud detection ECU shown in the third embodiment determines whether or not the transmitted frame is a fraudulent frame by verifying the MAC included in the data field of the frame (data frame). As a result, it is possible to prevent the existing ECU (that is, the fraud detection ECU and the ECU other than the fraudulent ECU) from interpreting the fraudulent frame and executing the process corresponding to the frame. Further, since the judgment can be made only by receiving the data field of the data frame, it is possible to suppress the bus traffic as compared with the case where the judgment is made by receiving the rear part of the data frame.

また、不正検知ECUが、不正検知カウンタを用いてエラーフレームを送信した回数をカウントすることで、エラーフレームの受信により不正なメッセージIDを送信するノードにおける送信エラーカウンタがCANプロトコルに従えばパッシブ状態に遷移すべき上限値まで到達していることを検出することができる。これにより、不正なメッセージIDを送信するノードが、CANプロトコルのエラーカウンタの仕様に準拠しているか否かを判定することが可能となる。 Further, the fraud detection ECU counts the number of times the error frame is transmitted by using the fraud detection counter, so that the transmission error counter in the node that transmits the fraudulent message ID by receiving the error frame is in a passive state if it follows the CAN protocol. It can be detected that the upper limit value to be transitioned to is reached. This makes it possible to determine whether or not the node that transmits the invalid message ID complies with the specifications of the error counter of the CAN protocol.

また、MACの検証を行うノードを不正検知ECUのみとすることで、不正検知ECU以外のECUで検証する必要がなく、システム全体として処理量、電力消費量を抑えることができる。 Further, by setting only the fraud detection ECU as the node for verifying the MAC, it is not necessary to verify with an ECU other than the fraud detection ECU, and the processing amount and the power consumption of the entire system can be suppressed.

なお、上述した車載ネットワークシステム12における1つ又は複数の不正検知ECUが、検知を行うか否かを切り替え可能にしても良い。そして、車両の状態が、例えば使用開始から一定期間が経過した等といった一定の場合に限って、不正検知ECUが不正なメッセージの検知を行わないこととしても良い。これにより、電力消費量を抑えることが可能となる。 It should be noted that one or more fraud detection ECUs in the above-mentioned in-vehicle network system 12 may switch whether or not to perform detection. Then, the fraud detection ECU may not detect a fraudulent message only when the vehicle is in a certain state, for example, a certain period of time has passed since the start of use. This makes it possible to reduce power consumption.

(実施の形態4)
以下、本開示の実施の形態として、車両の状態に応じて不正なメッセージ(フレーム)を検知する特定の検知処理を実行するか否かに係る不正検知ECUの動作モードを切り替えるための不正検知方法を実現する車載ネットワークシステム13について説明する。
(Embodiment 4)
Hereinafter, as an embodiment of the present disclosure, a fraud detection method for switching the operation mode of the fraud detection ECU relating to whether or not to execute a specific detection process for detecting a fraudulent message (frame) according to the state of the vehicle. The vehicle-mounted network system 13 that realizes the above will be described.

[4.1 車載ネットワークシステム13の全体構成]
図34は、実施の形態4に係る車載ネットワークシステム13の全体構成を示す図である。車載ネットワークシステム13は、実施の形態1で示した車載ネットワークシステム10の一部を変形したものである。車載ネットワークシステム13は、バス500a〜500cと、不正検知ECU4100a、4100b、ヘッドユニット4200、ゲートウェイ300、及び、各種機器に接続されたECU400a〜400d等のECUといったバスに接続された各ノードとを含んで構成される。車載ネットワークシステム13の構成要素のうち、実施の形態1と同様の機能を有する構成要素は、同じ符号を付して説明を省略する。
[4.1 Overall configuration of in-vehicle network system 13]
FIG. 34 is a diagram showing the overall configuration of the vehicle-mounted network system 13 according to the fourth embodiment. The in-vehicle network system 13 is a modification of a part of the in-vehicle network system 10 shown in the first embodiment. The in-vehicle network system 13 includes buses 500a to 500c and each node connected to the bus such as fraud detection ECUs 4100a to 4100b, head unit 4200, gateway 300, and ECUs such as ECUs 400a to 400d connected to various devices. Consists of. Among the components of the in-vehicle network system 13, components having the same functions as those in the first embodiment are designated by the same reference numerals, and the description thereof will be omitted.

不正検知ECU4100a、4100bは、それぞれバス500a、バス500bに接続され、ECU400a〜400d等により送信されたフレーム(メッセージ)が不正であるかどうかを判定し、不正であればエラーフレームを送信する機能を有するECUである。不正検知ECU4100a、4100bは、それぞれ実施の形態1で示した不正検知ECU100a、100bの一部を変形したものである。不正検知ECU4100a、4100bは動作モードとして、ECU400a〜400dが送信するフレーム(メッセージ)が不正であるかどうかを判定するチェックモード(検知モード)と、ECU400a〜dが送信するフレーム(メッセージ)が不正であるかどうかを判定しない待機モードとを持つ。そして不正検知ECU4100a、4100bは、ヘッドユニット4200からの指示(トリガーフレーム)を受けて、動作モードを切り替える機能を有する。トリガーフレームは動作モードの切り替えのトリガーとなる切替指示メッセージである。動作モードを待機モードにした場合には、不正なメッセージの検知に係る一定の処理を省略するため、チェックモードの場合と比べて処理量の軽減、消費電力の抑制等が実現され得る。 The fraud detection ECUs 4100a and 4100b are connected to the bus 500a and the bus 500b, respectively, and have a function of determining whether or not the frames (messages) transmitted by the ECUs 400a to 400d and the like are invalid, and if they are invalid, transmitting an error frame. It is an ECU to have. The fraud detection ECUs 4100a and 4100b are partially modified versions of the fraud detection ECUs 100a and 100b shown in the first embodiment, respectively. The fraud detection ECUs 4100a and 4100b have operation modes of a check mode (detection mode) for determining whether the frames (messages) transmitted by the ECUs 400a to 400d are invalid and a frame (message) transmitted by the ECUs 400a to d is invalid. It has a standby mode that does not determine whether or not it exists. The fraud detection ECUs 4100a and 4100b have a function of switching the operation mode in response to an instruction (trigger frame) from the head unit 4200. The trigger frame is a switching instruction message that triggers the switching of the operation mode. When the operation mode is set to the standby mode, certain processing related to the detection of an invalid message is omitted, so that the processing amount can be reduced and the power consumption can be suppressed as compared with the check mode.

ヘッドユニット4200は、フレームを送受信する機能を持ち、ECU400a〜400dから送信されるフレームを受信し、各種状態をディスプレイ(図示しない)に表示して、ユーザに提示する機能を有する。ヘッドユニット4200は、実施の形態1で示したヘッドユニット200の一部を変形したものである。ヘッドユニット4200は、例えばECU400a〜400dが送信するフレームが不正であるかどうかを判定し、不正なフレームが送信された場合に不正検知ECU4100a、4100bへチェックモードへの切り替えを指示する機能を有する。即ち、ヘッドユニット4200は、車両の状態が一定条件を満たす場合に、不正検知ECU4100a、4100bへトリガーフレームを送信して動作モードを変更するように指示する機能を有する。一定条件は、不正検知ECUにより不正なメッセージを検知する必要性の高さを左右する事象の発生を判断するための条件である。動作モードをチェックモードに切り替える場合の一定条件としては、例えば、車両に搭載された車載ネットワークシステムにおいて、不正なメッセージが伝送されたことが検知された場合、車両の使用が開始された場合、車両の外部の装置と通信を開始する状態になった場合等が挙げられる。また、動作モードを待機モードに切り替える場合の一定条件としては、例えば、一定期間において不正なメッセージが検知されなかった場合、車両の使用が開始されてから一定時間が経過した場合、車両の外部の装置と通信を終了して一定状態となった場合等のそれぞれ又は複数の組み合わせ等が挙げられる。 The head unit 4200 has a function of transmitting and receiving frames, and has a function of receiving frames transmitted from ECUs 400a to 400d, displaying various states on a display (not shown), and presenting them to the user. The head unit 4200 is a modified version of the head unit 200 shown in the first embodiment. The head unit 4200 has, for example, a function of determining whether or not the frames transmitted by the ECUs 400a to 400d are invalid, and instructing the fraud detection ECUs 4100a and 4100b to switch to the check mode when an illegal frame is transmitted. That is, the head unit 4200 has a function of transmitting a trigger frame to the fraud detection ECUs 4100a and 4100b to instruct to change the operation mode when the state of the vehicle satisfies a certain condition. The certain condition is a condition for determining the occurrence of an event that affects the high necessity of detecting an illegal message by the illegality detection ECU. Certain conditions for switching the operation mode to the check mode include, for example, when it is detected that an invalid message is transmitted in the in-vehicle network system mounted on the vehicle, when the vehicle is started to be used, and when the vehicle is started to be used. For example, when it is in a state of starting communication with an external device of. In addition, as a certain condition when switching the operation mode to the standby mode, for example, when an illegal message is not detected in a certain period of time, when a certain time has passed since the start of use of the vehicle, the outside of the vehicle is used. Examples thereof include each or a combination of a plurality of cases such as when communication with the device is terminated and a constant state is reached.

なお、本実施の形態では、ゲートウェイ300は、バス500a〜500c間で、トリガーフレームを転送するものとする。 In the present embodiment, the gateway 300 transfers the trigger frame between the buses 500a to 500c.

[4.2 ヘッドユニット4200の構成]
図35は、ヘッドユニット4200の構成図である。ヘッドユニット4200は、フレーム送受信部270と、フレーム解釈部4260と、受信ID判断部240と、受信IDリスト保持部250と、フレーム処理部220と、表示制御部210と、フレーム生成部4230と、不正フレーム検出部4280と、モード変更指示部4281と、車使用開始検出部4282と、通信開始・終了検出部4283とを含んで構成される。これらの各構成要素は、機能的な構成要素であり、その各機能は、ヘッドユニット4200における通信回路、LCD、メモリに格納された制御プログラムを実行するプロセッサ或いはデジタル回路等により実現される。なお、実施の形態1と同様の機能を有する構成要素は、同じ符号を付して説明を省略する。
[4.2 Configuration of Head Unit 4200]
FIG. 35 is a configuration diagram of the head unit 4200. The head unit 4200 includes a frame transmission / reception unit 270, a frame interpretation unit 4260, a reception ID determination unit 240, a reception ID list holding unit 250, a frame processing unit 220, a display control unit 210, a frame generation unit 4230, and the like. It includes an illegal frame detection unit 4280, a mode change instruction unit 4281, a vehicle use start detection unit 4282, and a communication start / end detection unit 4283. Each of these components is a functional component, and each function is realized by a communication circuit in the head unit 4200, an LCD, a processor that executes a control program stored in a memory, a digital circuit, or the like. The components having the same functions as those in the first embodiment are designated by the same reference numerals, and the description thereof will be omitted.

フレーム解釈部4260は、実施の形態1で示したフレーム解釈部260の一部を変形したものである。フレーム解釈部4260は、フレーム送受信部270よりフレームの値を受け取り、CANプロトコルで規定されているフレームフォーマットにおける各フィールドにマッピングするよう解釈を行う。フレーム解釈部4260は、IDフィールドと判断した値は受信ID判断部240へ転送する。フレーム解釈部4260は、受信ID判断部240から通知される判定結果に応じて、IDフィールドの値と、IDフィールド以降に現れるデータフィールドとを、フレーム処理部220及び不正フレーム検出部4280へ転送するか、その判定結果を受けた以降においてフレームの受信を中止する(つまりそのフレームとしての解釈を中止する)かを決定する。また、フレーム解釈部4260は、CANプロトコルに則っていないフレームと判断した場合は、エラーフレームを送信するようにフレーム生成部4230へ通知する。また、フレーム解釈部4260は、エラーフレームを受信した場合、つまり受け取ったフレームにおける値からエラーフレームになっていると解釈した場合には、それ以降はそのフレームを破棄する、つまりフレームの解釈を中止する。例えばデータフレームの途中からエラーフレームと解釈された場合においては、そのデータフレームの解釈は中止され、そのデータフレームに応じて特段の処理を行うことがなくなる。 The frame interpretation unit 4260 is a modification of a part of the frame interpretation unit 260 shown in the first embodiment. The frame interpretation unit 4260 receives the frame value from the frame transmission / reception unit 270 and interprets it so as to map it to each field in the frame format defined by the CAN protocol. The frame interpretation unit 4260 transfers the value determined to be the ID field to the reception ID determination unit 240. The frame interpretation unit 4260 transfers the value of the ID field and the data field appearing after the ID field to the frame processing unit 220 and the invalid frame detection unit 4280 according to the determination result notified from the reception ID determination unit 240. It is determined whether to stop receiving the frame (that is, stop the interpretation as the frame) after receiving the determination result. Further, when the frame interpretation unit 4260 determines that the frame does not conform to the CAN protocol, the frame interpretation unit 4260 notifies the frame generation unit 4230 to transmit an error frame. Further, when the frame interpreting unit 4260 receives an error frame, that is, when it interprets that the value in the received frame is an error frame, the frame interpreting unit 4260 discards the frame after that, that is, stops interpreting the frame. To do. For example, when an error frame is interpreted from the middle of a data frame, the interpretation of the data frame is stopped, and no special processing is performed according to the data frame.

フレーム送受信部270は、バス500cに対して、CANプロトコルに従ったフレームを送受信する。バス500cからフレームを1bitずつ受信し、フレーム解釈部4260に転送する。また、フレーム生成部4230より通知を受けたフレームの内容をバス500cに1bitずつ送信する。 The frame transmission / reception unit 270 transmits / receives a frame according to the CAN protocol to the bus 500c. Frames are received one bit at a time from the bus 500c and transferred to the frame interpretation unit 4260. In addition, the contents of the frame notified by the frame generation unit 4230 are transmitted to the bus 500c one bit at a time.

受信ID判断部240は、フレーム解釈部4260から通知されるIDフィールドの値を受け取り、受信IDリスト保持部250が保持しているメッセージIDのリストに従い、そのIDフィールド以降のフレームの各フィールドを受信するかどうかの判定を行う。この判定結果を、受信ID判断部240は、フレーム解釈部4260へ通知する。 The reception ID determination unit 240 receives the value of the ID field notified from the frame interpretation unit 4260, and receives each field of the frame after the ID field according to the list of message IDs held by the reception ID list holding unit 250. Determine whether or not to do so. The reception ID determination unit 240 notifies the frame interpretation unit 4260 of this determination result.

フレーム生成部4230は、実施の形態1のフレーム生成部230と同様に、フレーム解釈部4260からのエラーフレームの送信を指示する通知に従い、エラーフレームを構成し、エラーフレームをフレーム送受信部270へ通知して送信させる。更に、フレーム生成部4230は、モード変更指示部4281からのトリガーフレームの送信の依頼に従い、トリガーフレームを構成し、トリガーフレームをフレーム送受信部270へ通知して送信させる。 Similar to the frame generation unit 230 of the first embodiment, the frame generation unit 4230 configures an error frame according to the notification instructing the transmission of the error frame from the frame interpretation unit 4260, and notifies the frame transmission / reception unit 270 of the error frame. And send it. Further, the frame generation unit 4230 configures the trigger frame in response to the request from the mode change instruction unit 4281 to transmit the trigger frame, and notifies the frame transmission / reception unit 270 of the trigger frame to transmit the trigger frame.

不正フレーム検出部4280は、フレーム解釈部4260から通知されるIDフィールドの値とデータフィールドの値とを受け取り、不正なフレームがバス500c上に送信された場合に検出する。不正フレーム検出部4280は、不正なフレームを検出した場合に、モード変更指示部4281へ不正検知ECU4100a、4100bのチェックモードへの移行指示の通知を依頼する。不正フレーム検出部4280は、チェックモードへの移行指示の通知を依頼してから一定期間において不正なフレームを検出しなかった場合に、モード変更指示部4281へ不正検知ECU4100a、4100bの待機モードへの移行指示の通知を依頼しても良い。不正フレーム検出部4280における不正フレームの検出方法は、例えば、実施の形態1の不正フレーム検知部130と同じ方法である。また、不正フレーム検出部4280における不正フレームの検出方法は、例えば実施の形態2の不正フレーム検知部2130と同じ方法、実施の形態3の不正MAC検知部3130と同じ方法、或いは、その他の方法であっても良い。 The invalid frame detection unit 4280 receives the ID field value and the data field value notified from the frame interpretation unit 4260, and detects when an invalid frame is transmitted on the bus 500c. When an illegal frame is detected, the illegal frame detection unit 4280 requests the mode change instruction unit 4281 to notify the illegal frame detection ECU 4100a and 4100b of the shift instruction to the check mode. When the fraudulent frame detection unit 4280 does not detect an illegal frame within a certain period of time after requesting the notification of the transition instruction to the check mode, the fraudulent frame detection unit 4281 is set to the standby mode of the fraud detection ECUs 4100a and 4100b. You may request notification of migration instructions. The method of detecting an illegal frame in the illegal frame detecting unit 4280 is, for example, the same method as that of the illegal frame detecting unit 130 of the first embodiment. Further, the method for detecting an illegal frame in the illegal frame detection unit 4280 is, for example, the same method as the illegal frame detection unit 2130 of the second embodiment, the same method as the illegal MAC detection unit 3130 of the third embodiment, or another method. There may be.

モード変更指示部4281は、不正検知ECU4100a、4100bの動作モードの変更を指示するトリガーフレームの不正検知ECU4100a、4100bへの送信をフレーム生成部4230へ依頼する機能を有する。モード変更指示部4281は、車両の状態が一定条件を満たした場合に、不正フレーム検出部4280、車使用開始検出部4282或いは通信開始・終了検出部4283から依頼を受けて、フレーム生成部4230にトリガーフレームの送信の依頼を行う。このトリガーフレームは不正検知ECUの動作モードの切り替えのトリガーとなる切替指示メッセージである。トリガーフレームには、待機モードからチェックモードへの移行を指示するものと、チェックモードから待機モードへの移行を指示するものとがあり、両者は例えばIDフィールドのメッセージID、データフィールド内に設けた識別子等で区別される。トリガーフレームが送信されると、ゲートウェイ300はバス間でトリガーフレームを転送し、各不正検知ECUがトリガーフレームを受信する。 The mode change instruction unit 4281 has a function of requesting the frame generation unit 4230 to transmit the trigger frame instructing the change of the operation mode of the fraud detection ECUs 4100a and 4100b to the fraud detection ECUs 4100a and 4100b. When the state of the vehicle satisfies a certain condition, the mode change instruction unit 4281 receives a request from the illegal frame detection unit 4280, the vehicle use start detection unit 4482, or the communication start / end detection unit 4283, and sends the frame generation unit 4230 to the frame generation unit 4230. Request the transmission of the trigger frame. This trigger frame is a switching instruction message that triggers the switching of the operation mode of the fraud detection ECU. There are two types of trigger frames, one that instructs the transition from the standby mode to the check mode and the other that instructs the transition from the check mode to the standby mode. Both are provided in, for example, the message ID of the ID field and the data field. It is distinguished by an identifier or the like. When the trigger frame is transmitted, the gateway 300 transfers the trigger frame between the buses, and each fraud detection ECU receives the trigger frame.

車使用開始検出部4282は、車両の使用が開始されたことを検出し、モード変更指示部4281へ、不正検知ECU4100a、4100bのチェックモードへの移行指示の通知を依頼する。車使用開始検出部4282は、車両の使用が開始されたことの検出を、例えば、各ECUからのメッセージ等により、ドアロックの解除、ドアのオープン、エンジンの始動等を検知することで実現する。この結果として、例えば、駐車場に駐車された車両に不正ECUが取り付けられた場合にも、その後に車両が使用開始された際に、不正検知ECU4100a、4100bがチェックモードとなり不正ECUの検出が行えるようになる。なお、車両の使用開始前においてもバッテリー等から電力が供給されていれば車載ネットワークシステムは稼動し得る。また、車使用開始検出部4282は、車両の使用が開始されたことを検出してから一定時間が経過したことを検出し、モード変更指示部4281へ、不正検知ECU4100a、4100bの待機モードへの移行指示の通知を依頼する。この一定時間は、車両の使用開始前に仮に不正なECUが車載ネットワークシステムのバスに接続されていたとした場合において車両の使用開始後にその不正なECUが不正なメッセージを送信するのに要すると想定される時間より長い時間(例えば数分間)である。 The vehicle use start detection unit 4282 detects that the vehicle has started to be used, and requests the mode change instruction unit 4281 to notify the fraud detection ECU 4100a and 4100b of the shift instruction to the check mode. The vehicle use start detection unit 4482 realizes the detection that the vehicle has started to be used, for example, by detecting the release of the door lock, the opening of the door, the start of the engine, etc. by a message from each ECU. .. As a result, for example, even when a fraudulent ECU is attached to a vehicle parked in a parking lot, when the vehicle is subsequently started to be used, the fraud detection ECUs 4100a and 4100b are set to the check mode and the fraudulent ECU can be detected. Will be. The in-vehicle network system can operate even before the start of use of the vehicle as long as the electric power is supplied from the battery or the like. Further, the vehicle use start detection unit 4282 detects that a certain time has elapsed since the vehicle has started to be used, and sends the mode change instruction unit 4281 to the standby mode of the fraud detection ECUs 4100a and 4100b. Request notification of migration instructions. It is assumed that this fixed time is required for the illegal ECU to send an illegal message after the vehicle starts to be used, assuming that the illegal ECU is connected to the bus of the in-vehicle network system before the vehicle starts to be used. It is a time longer than the time (for example, a few minutes).

通信開始・終了検出部4283は、ヘッドユニット4200が外部と通信を開始したことを検出し、モード変更指示部4281へ、不正検知ECU4100a、4100bのチェックモードへの移行指示の通知を依頼する。この結果として、例えば、外部から通信によりヘッドユニット4200を介して不正に車載ネットワークシステムのバス上に不正なフレームが送信された場合に、チェックモードの不正検知ECU4100a、4100bにより不正の検出が行える。なお、外部からの通信によりヘッドユニット4200の制御プログラムが不正に書き換えられて、不正フレーム検出部4280、モード変更指示部4281等が機能しなくなることが想定される。しかし、外部との通信の前に、不正検知ECU4100a、4100bへチェックモードへの移行を指示しておくことで、不正フレーム検出部4280、モード変更指示部4281等が機能しなくなっても、不正なフレームを検出できる。また、通信開始・終了検出部4283は、ヘッドユニット4200が外部との通信を終了した後の一定状態になったことを検出し、モード変更指示部4281へ、不正検知ECU4100a、4100bの待機モードへの移行指示の通知を依頼する。外部との通信を終了した後の一定状態は、例えば外部との通信を終了した状態である。また、外部との通信を終了した後の一定状態は、外部との通信を終了した後に一定時間が経過した状態であるとしても良い。これにより、外部との通信により不正に書き換えられた制御プログラムが外部との通信の終了後に不正なフレームを送信するような場合に対応できる。この場合における一定時間は、外部との通信で外部から不正なプログラム等が供給された場合において通信終了後にそのプログラムが実行されて不正なメッセージを送信するのに要すると想定される時間より長い時間(例えば数分間)である。 The communication start / end detection unit 4283 detects that the head unit 4200 has started communication with the outside, and requests the mode change instruction unit 4281 to notify the fraud detection ECU 4100a and 4100b of the shift instruction to the check mode. As a result, for example, when an illegal frame is illegally transmitted onto the bus of the in-vehicle network system via the head unit 4200 by communication from the outside, the fraud detection ECU 4100a and 4100b in the check mode can detect the fraud. It is assumed that the control program of the head unit 4200 is illegally rewritten by communication from the outside, and the illegal frame detection unit 4280, the mode change instruction unit 4281, and the like do not function. However, by instructing the fraud detection ECUs 4100a and 4100b to shift to the check mode before communicating with the outside, even if the fraud frame detection unit 4280, the mode change instruction unit 4281, etc. do not function, it is illegal. Can detect frames. Further, the communication start / end detection unit 4283 detects that the head unit 4200 has reached a constant state after the communication with the outside is terminated, and sends the mode change instruction unit 4281 to the standby mode of the fraud detection ECUs 4100a and 4100b. Request notification of migration instructions. The constant state after the communication with the outside is terminated is, for example, the state in which the communication with the outside is terminated. Further, the constant state after the end of communication with the outside may be a state in which a certain time has elapsed after the end of communication with the outside. This makes it possible to deal with a case where a control program illegally rewritten by communication with the outside transmits an illegal frame after the communication with the outside is completed. In this case, the fixed time is longer than the time expected to be required for the program to be executed and send an illegal message after the communication is completed when an unauthorized program or the like is supplied from the outside in communication with the outside. (For example, a few minutes).

なお、モード変更指示部4281は、不正フレーム検出部4280、車使用開始検出部4282及び通信開始・終了検出部4283と連携して、一定期間において不正なメッセージが検知されなかった状況であり、かつ、車両の使用が開始されてから一定時間が経過した状況であり、かつ、車両の外部の装置と通信を終了して一定状態となった状況である場合に限って待機モードへの移行を指示するトリガーフレームの送信をフレーム生成部4230に依頼することとしても良い。モード変更指示部4281は、車両の状態に応じてどのような条件が満たされたらトリガーフレームの送信を依頼するかについて、判断基準となる予め定められたルールを保持し得る。このルールは、単一でも複数であっても良い。また、ルールは、ヘッドユニット4200の出荷時、車載ネットワークシステムを搭載する車両の出荷時、販売時等に設定され得る。また、ヘッドユニット4200が外部から通信によりルールを取得及び更新しても良い。また、ヘッドユニット4200を、ルールを保持する記録媒体が着脱自在となるように構成しても良い。なお、車両の状態として、駐車中、停車中、給油中、充電中、外部との通信中等を検知することを前提としたルールを定めていても良い。トリガーフレームの内容(例えばデータフィールド内)に例えば不正検知ECUを個別に識別する情報を含ませる等により、特定の不正検知ECUにだけ動作モードの変更を指示するようにしても良い。例えば、駐車中で外部と通信中に不正なフレームが検出され、不正フレーム検出部4280から不正検知ECU4100a、4100bのチェックモードへの移行指示の通知を依頼された場合、不正検知ECU4100bにのみチェックモードへの移行を指示するトリガーフレームを送信すると判断するルールが設定されていても良い。これは、駐車中であればエンジン401やブレーキ402の動作に影響を与えるような不正なフレームは送信されない、或いは、不正なフレームが送信されたとしても駐車中であれば問題ないと考えた場合のルールの例である。なお、特定の不正検知ECUに動作モードの変更を指示するようにトリガーフレームを構成する場合には、ゲートウェイ300はその特定の不正検知ECUにトリガーフレームが伝達されるために必要なバスにだけトリガーフレームの転送を行うようにしても良い。 The mode change instruction unit 4281 is in a situation in which an illegal message is not detected in a certain period of time in cooperation with the illegal frame detection unit 4280, the vehicle use start detection unit 4282, and the communication start / end detection unit 4283. , Instruction to shift to standby mode only when a certain amount of time has passed since the vehicle started to be used and the communication with the external device of the vehicle is terminated and the vehicle is in a constant state. The transmission of the trigger frame to be performed may be requested to the frame generation unit 4230. The mode change instruction unit 4281 can hold a predetermined rule as a determination criterion as to what kind of condition is satisfied according to the state of the vehicle to request the transmission of the trigger frame. This rule may be single or plural. Further, the rules may be set at the time of shipment of the head unit 4200, at the time of shipment of the vehicle equipped with the in-vehicle network system, at the time of sale, and the like. Further, the head unit 4200 may acquire and update the rules by communication from the outside. Further, the head unit 4200 may be configured so that the recording medium holding the rule is detachable. It should be noted that a rule may be set on the premise that the state of the vehicle is detected during parking, stopping, refueling, charging, communicating with the outside, and the like. The operation mode may be changed only to a specific fraud detection ECU by including, for example, information for individually identifying the fraud detection ECU in the content of the trigger frame (for example, in the data field). For example, when an illegal frame is detected while parking and communicating with the outside, and the illegal frame detection unit 4280 requests notification of a shift instruction to the check mode of the illegal detection ECUs 4100a and 4100b, only the illegal detection ECU 4100b is in the check mode. A rule may be set to determine that a trigger frame instructing the transition to is sent. This is when it is considered that an illegal frame that affects the operation of the engine 401 or the brake 402 is not transmitted when the vehicle is parked, or even if an illegal frame is transmitted, there is no problem if the vehicle is parked. This is an example of the rule of. When the trigger frame is configured to instruct the specific fraud detection ECU to change the operation mode, the gateway 300 triggers only on the bus necessary for transmitting the trigger frame to the specific fraud detection ECU. The frame may be transferred.

[4.3 不正検知ECU4100aの構成]
図36は、不正検知ECU4100aの構成図である。不正検知ECU4100aは、フレーム送受信部160と、フレーム解釈部4150と、不正フレーム検知部130と、正規IDリスト保持部120と、不正検知カウンタ保持部110と、フレーム生成部140と、トリガーフレーム検出部4170と、モード保持部4180とを含んで構成される。これらの各構成要素は、機能的な構成要素であり、その各機能は、不正検知ECU4100aにおける通信回路、メモリに格納された制御プログラムを実行するプロセッサ或いはデジタル回路等により実現される。実施の形態1と同様の機能を有する構成要素は、同じ符号を付して説明を省略する。なお、不正検知ECU4100bも基本的に同様の構成を備える。
[4.3 Configuration of fraud detection ECU 4100a]
FIG. 36 is a configuration diagram of the fraud detection ECU 4100a. The fraud detection ECU 4100a includes a frame transmission / reception unit 160, a frame interpretation unit 4150, a fraud frame detection unit 130, a regular ID list holding unit 120, a fraud detection counter holding unit 110, a frame generation unit 140, and a trigger frame detection unit. It is configured to include a 4170 and a mode holding unit 4180. Each of these components is a functional component, and each function is realized by a communication circuit in the fraud detection ECU 4100a, a processor that executes a control program stored in a memory, a digital circuit, or the like. Components having the same functions as those in the first embodiment are designated by the same reference numerals, and the description thereof will be omitted. The fraud detection ECU 4100b also has basically the same configuration.

フレーム解釈部4150は、実施の形態1のフレーム解釈部150と同様に、フレーム送受信部160よりフレームの値を受け取り、CANプロトコルで規定されているフレームフォーマットにおける各フィールドにマッピングするよう解釈を行う。また、フレーム解釈部4150は、モード保持部4180から不正検知ECU4100aの動作モードを取得し、受け取ったフレームの値の転送先を動作モードに応じて判断する。例えば、不正検知ECU4100aがチェックモードである場合には、IDフィールドの値を不正フレーム検知部130とトリガーフレーム検出部4170とへ転送し、IDフィールドの後のデータフィールドの値をトリガーフレーム検出部4170へ転送する。不正検知ECU4100aが待機モードである場合には、IDフィールドの値とその後のデータフィールドの値とをトリガーフレーム検出部4170へのみ転送する。これにより、動作モードがチェックモードである場合に限って、不正フレーム検知部130による不正の検知がなされるようになる。つまり、動作モードが待機モードである場合には、不正フレーム検知部130による不正の検知に係る処理が行われない。 Similar to the frame interpretation unit 150 of the first embodiment, the frame interpretation unit 4150 receives the frame value from the frame transmission / reception unit 160 and interprets it so as to map it to each field in the frame format defined by the CAN protocol. Further, the frame interpretation unit 4150 acquires the operation mode of the fraud detection ECU 4100a from the mode holding unit 4180, and determines the transfer destination of the received frame value according to the operation mode. For example, when the fraud detection ECU 4100a is in the check mode, the value of the ID field is transferred to the fraud frame detection unit 130 and the trigger frame detection unit 4170, and the value of the data field after the ID field is transferred to the trigger frame detection unit 4170. Transfer to. When the fraud detection ECU 4100a is in the standby mode, the ID field value and the subsequent data field value are transferred only to the trigger frame detection unit 4170. As a result, the fraudulent frame detection unit 130 detects fraud only when the operation mode is the check mode. That is, when the operation mode is the standby mode, the processing related to the detection of fraud by the fraud frame detection unit 130 is not performed.

トリガーフレーム検出部4170は、不正検知ECU4100aが受信したフレームが、ヘッドユニット4200が送信したトリガーフレームであるかどうかを判断する。トリガーフレーム検出部4170は、不正検知ECU4100aが受信したフレームがトリガーフレームの場合は、モード保持部4180に、動作モードとしてのチェックモード或いは待機モードを記録する。即ち、トリガーフレーム検出部4170は、受信されたフレームが待機モードからチェックモードへの移行を指示すトリガーフレームであった場合には、チェックモードであることを記録する。また、トリガーフレーム検出部4170は、受信されたフレームがチェックモードから待機モードへの移行を指示するトリガーフレームであった場合には、待機モードであることを記録する。 The trigger frame detection unit 4170 determines whether or not the frame received by the fraud detection ECU 4100a is the trigger frame transmitted by the head unit 4200. When the frame received by the fraud detection ECU 4100a is the trigger frame, the trigger frame detection unit 4170 records the check mode or the standby mode as the operation mode in the mode holding unit 4180. That is, when the received frame is a trigger frame indicating the transition from the standby mode to the check mode, the trigger frame detection unit 4170 records that it is in the check mode. Further, the trigger frame detection unit 4170 records that the received frame is in the standby mode when the received frame is a trigger frame instructing the transition from the check mode to the standby mode.

モード保持部4180は、自機(不正検知ECU4100a)の動作モードが待機モードであるか、チェックモードであるかをメモリ等の記憶媒体に保持する機能を有する。 The mode holding unit 4180 has a function of holding in a storage medium such as a memory whether the operation mode of the own machine (fraud detection ECU 4100a) is the standby mode or the check mode.

[4.4 チェックモードへの移行に係るシーケンス]
以下、上述の構成を備える車載ネットワークシステム13のバス500cに不正なフレーム(メッセージ)が送信された場合におけるヘッドユニット4200及び不正検知ECU4100aの動作について説明する。
[4.4 Sequence related to transition to check mode]
Hereinafter, the operations of the head unit 4200 and the fraud detection ECU 4100a when a fraudulent frame (message) is transmitted to the bus 500c of the vehicle-mounted network system 13 having the above configuration will be described.

図37は、ヘッドユニット4200が不正なメッセージを検知し、不正検知ECU4100aへチェックモードへの移行を指示し、不正検知ECU4100aがチェックモードへ移行する動作例を示すシーケンス図である。 FIG. 37 is a sequence diagram showing an operation example in which the head unit 4200 detects an illegal message, instructs the fraud detection ECU 4100a to shift to the check mode, and the fraud detection ECU 4100a shifts to the check mode.

この動作例の開始段階では、不正検知ECU4100aは、待機モードになっている(シーケンスS4001)。例えば、この段階以前に待機モードへの移行を指示するトリガーフレームを不正検知ECU4100aが受けた結果として、待機モードになっている状態である。このとき不正検知ECU4100aは、不正フレーム検知部130による不正なメッセージの検知を行っていない。 At the start stage of this operation example, the fraud detection ECU 4100a is in the standby mode (sequence S4001). For example, as a result of the fraud detection ECU 4100a receiving a trigger frame instructing the transition to the standby mode before this stage, the standby mode is in the state. At this time, the fraud detection ECU 4100a does not detect the fraudulent message by the fraudulent frame detection unit 130.

ヘッドユニット4200は、バス500cに送信されたフレーム(メッセージ)を受信する(シーケンスS4002)。 The head unit 4200 receives a frame (message) transmitted to the bus 500c (sequence S4002).

ヘッドユニット4200は、不正フレーム検出部4280により受信したメッセージが、不正なメッセージであるかどうかを確認する(シーケンスS4003)。不正なメッセージでなかった場合には、メッセージの受信の処理手順(シーケンスS4002)へ戻る。 The head unit 4200 confirms whether or not the message received by the illegal frame detection unit 4280 is an invalid message (sequence S4003). If the message is not invalid, the process returns to the message reception processing procedure (sequence S4002).

ヘッドユニット4200は、受信したメッセージが不正なメッセージであることを検出した場合に、以前の不正検知ECU4100aへの指示履歴から不正検知ECU4100aの動作モードが既にチェックモードであるか否かを判断する(シーケンスS4004)。なお、不正なメッセージは、例えば不正なECUがバスに接続されて送信され得る。ヘッドユニット4200は、トリガーフレームにより不正検知ECU4100a等にチェックモードへの移行指示又は待機モードへの移行指示をした場合に指示履歴を保持する等により、各不正検知ECUの動作モードを把握している。 When the head unit 4200 detects that the received message is an invalid message, the head unit 4200 determines from the previous instruction history to the fraud detection ECU 4100a whether or not the operation mode of the fraud detection ECU 4100a is already the check mode ( Sequence S4004). An illegal message can be transmitted by connecting an illegal ECU to a bus, for example. The head unit 4200 grasps the operation mode of each fraud detection ECU by holding an instruction history when the fraud detection ECU 4100a or the like is instructed to shift to the check mode or the standby mode by the trigger frame. ..

ヘッドユニット4200は、不正検知ECU4100aの動作モードがチェックモードではない(待機モードである)と判断した場合、チェックモードへの移行を指示する(シーケンスS4005)。具体的には、ヘッドユニット4200は、チェックモードへの移行を指示するトリガーフレームを送信する。なお、シーケンスS4004で不正検知ECU4100aの動作モードが既にチェックモードであると判断した場合には、ヘッドユニット4200はチェックモードへの移行の指示の処理手順をスキップして動作を終える。 When the head unit 4200 determines that the operation mode of the fraud detection ECU 4100a is not the check mode (standby mode), the head unit 4200 instructs the transition to the check mode (sequence S4005). Specifically, the head unit 4200 transmits a trigger frame instructing the transition to the check mode. If it is determined in the sequence S4004 that the operation mode of the fraud detection ECU 4100a is already the check mode, the head unit 4200 skips the processing procedure of the instruction to shift to the check mode and ends the operation.

ヘッドユニット4200からバス500cに送信されたチェックモードへの移行を指示するトリガーフレームは、ゲートウェイ300によりバス500a、500bに転送される。 The trigger frame instructing the transition to the check mode transmitted from the head unit 4200 to the bus 500c is transferred to the buses 500a and 500b by the gateway 300.

不正検知ECU4100aは、バス500aに送信されたトリガーフレームを受信して、動作モードをチェックモードに移行する(シーケンスS4006)。このときから、不正検知ECU4100aは、不正フレーム検知部130により不正なメッセージの検知を行う。即ち、チェックモードでは、不正検知ECU4100aは、他のノード(ECU)において不正なフレームに基づく処理が実行されることを阻止するための不正対処方法を実現する状態になる。従って、実施の形態1で示したように、不正検知ECU4100aが接続されているバス上に不正なメッセージが送信されても、その不正なメッセージに対応して処理がなされることを阻止できるようになる(図18参照)。 The fraud detection ECU 4100a receives the trigger frame transmitted to the bus 500a and shifts the operation mode to the check mode (sequence S4006). From this time, the fraud detection ECU 4100a detects a fraudulent message by the fraudulent frame detection unit 130. That is, in the check mode, the fraud detection ECU 4100a is in a state of realizing a fraud countermeasure method for preventing the other node (ECU) from executing the process based on the fraud frame. Therefore, as shown in the first embodiment, even if an illegal message is transmitted on the bus to which the fraud detection ECU 4100a is connected, it is possible to prevent processing from being performed in response to the illegal message. (See FIG. 18).

ここでは不正検知ECUのうち不正検知ECU4100aに着目して説明したが、例えば不正検知ECU4100bについても同様に、シーケンスS4005において送信されたトリガーフレームに対応して、動作モードをチェックモードにし得る。また、ヘッドユニット4200は、シーケンスS4004での判断を省略してシーケンスS4005でのチェックモードへの移行の指示を行うこととしても良い。シーケンスS4004での判断を省略する場合には、各不正検知ECUの動作モードを把握しなくても良く、指示履歴の保持を省略できる。但し、シーケンスS4004は、無用のトリガーフレームがバスに流れるのを防ぐために有用である。 Although the fraud detection ECU 4100a has been described here as a focus on the fraud detection ECU 4100a, for example, the fraud detection ECU 4100b can also be set to the check mode in the operation mode corresponding to the trigger frame transmitted in the sequence S4005. Further, the head unit 4200 may omit the determination in the sequence S4004 and give an instruction to shift to the check mode in the sequence S4005. When the determination in the sequence S4004 is omitted, it is not necessary to grasp the operation mode of each fraud detection ECU, and the holding of the instruction history can be omitted. However, the sequence S4004 is useful for preventing unnecessary trigger frames from flowing into the bus.

ここで示したシーケンスS4003の場合以外では、チェックモードへの移行は、例えば、通信開始・終了検出部4283が外部との通信開始を検出した場合、或いは車使用開始検出部4282が車両の使用開始を検出した場合に行われる。 Except for the case of the sequence S4003 shown here, the transition to the check mode is, for example, when the communication start / end detection unit 4283 detects the start of communication with the outside, or the vehicle use start detection unit 4482 starts using the vehicle. Is detected.

[4.5 待機モードへの移行に係るシーケンス(外部との通信終了時)]
以下、ヘッドユニット4200が外部との通信を終了した場合におけるヘッドユニット4200及び不正検知ECU4100aの動作について説明する。
[4.5 Sequence related to transition to standby mode (at the end of communication with the outside)]
Hereinafter, the operation of the head unit 4200 and the fraud detection ECU 4100a when the head unit 4200 ends communication with the outside will be described.

図38は、ヘッドユニット4200が外部との通信の終了を検知し、不正検知ECU4100aへ待機モードへの移行を指示し、不正検知ECU4100aが待機モードへ移行する動作例を示すシーケンス図である。 FIG. 38 is a sequence diagram showing an operation example in which the head unit 4200 detects the end of communication with the outside, instructs the fraud detection ECU 4100a to shift to the standby mode, and the fraud detection ECU 4100a shifts to the standby mode.

この動作例の開始段階では、不正検知ECU4100aは、チェックモードになっている(シーケンスS4101)。例えば、この段階以前に、ヘッドユニット4200が外部との通信を開始する際にチェックモードへの移行を指示するトリガーフレームを不正検知ECU4100aが受けた結果として、チェックモードになっている状態である。このとき不正検知ECU4100aは、不正フレーム検知部130により不正なメッセージの検知を行う状態である。 At the start stage of this operation example, the fraud detection ECU 4100a is in the check mode (sequence S4101). For example, before this stage, the fraud detection ECU 4100a receives a trigger frame instructing the transition to the check mode when the head unit 4200 starts communication with the outside, and as a result, the check mode is set. At this time, the fraud detection ECU 4100a is in a state where the fraud frame detection unit 130 detects a fraudulent message.

ヘッドユニット4200は、通信開始・終了検出部4283により外部との通信の終了が検出されると(シーケンスS4102)、車両の使用開始から一定時間が経過したか否かを判断する(シーケンスS4103)。車両の使用開始から一定時間が経過していない場合には、待機モードへ移行してはならないため、待機モードへの移行を指示するトリガーフレームを送信しない(つまりシーケンスS4104、S4105をスキップする)。 When the end of communication with the outside is detected by the communication start / end detection unit 4283 (sequence S4102), the head unit 4200 determines whether or not a certain time has elapsed from the start of use of the vehicle (sequence S4103). If a certain period of time has not passed since the start of use of the vehicle, the transition to the standby mode must not be performed, so the trigger frame instructing the transition to the standby mode is not transmitted (that is, the sequences S4104 and S4105 are skipped).

車両の使用開始から一定時間が経過した場合には、ヘッドユニット4200は、不正なメッセージを検出したかを判断する(シーケンスS4104)。チェックモードへの移行を指示するトリガーフレームの送信後に不正なメッセージを検出していた場合には、待機モードへ移行してはならないため、待機モードへの移行を指示するトリガーフレームを送信しない(つまりシーケンスS4105をスキップする)。 When a certain time has elapsed from the start of use of the vehicle, the head unit 4200 determines whether an invalid message has been detected (sequence S4104). If an invalid message is detected after sending the trigger frame instructing the transition to the check mode, the trigger frame instructing the transition to the standby mode is not sent because the transition to the standby mode must not be performed (that is, the trigger frame instructing the transition to the standby mode is not transmitted). Sequence S4105 is skipped).

シーケンスS4104において不正なメッセージを検出していないと判断した場合には、ヘッドユニット4200は、待機モードへの移行を指示する(ステップS4105)。具体的には、ヘッドユニット4200は、待機モードへの移行を指示するトリガーフレームを送信する。 If it is determined that no invalid message has been detected in the sequence S4104, the head unit 4200 instructs the transition to the standby mode (step S4105). Specifically, the head unit 4200 transmits a trigger frame instructing the transition to the standby mode.

ヘッドユニット4200からバス500cに送信された待機モードへの移行を指示するトリガーフレームは、ゲートウェイ300によりバス500a、500bに転送される。 The trigger frame instructing the transition to the standby mode transmitted from the head unit 4200 to the bus 500c is transferred to the buses 500a and 500b by the gateway 300.

不正検知ECU4100aは、バス500aに送信されたトリガーフレームを受信して、動作モードを待機モードに移行する(シーケンスS4106)。このときから、不正検知ECU4100aは、不正フレーム検知部130による不正なメッセージの検知を行わなくなる。 The fraud detection ECU 4100a receives the trigger frame transmitted to the bus 500a and shifts the operation mode to the standby mode (sequence S4106). From this time, the fraud detection ECU 4100a does not detect the fraudulent message by the fraudulent frame detection unit 130.

ここでは不正検知ECUのうち不正検知ECU4100aに着目して説明したが、例えば不正検知ECU4100bについても同様に、シーケンスS4105において送信されたトリガーフレームに対応して、動作モードを待機モードにし得る。 Although the fraud detection ECU 4100a has been described here as a focus on the fraud detection ECU 4100a, for example, the fraud detection ECU 4100b can also be set to the standby mode in the operation mode corresponding to the trigger frame transmitted in the sequence S4105.

[4.6 待機モードへの移行に係るシーケンス(車両の使用開始から一定時間経過時)]
以下、車両の使用が開始されてから一定時間が経過した場合におけるヘッドユニット4200及び不正検知ECU4100aの動作について説明する。
[4.6 Sequence related to transition to standby mode (when a certain period of time has passed since the start of use of the vehicle)]
Hereinafter, the operations of the head unit 4200 and the fraud detection ECU 4100a when a certain period of time has elapsed since the start of use of the vehicle will be described.

図39は、ヘッドユニット4200が車両の使用開始から一定時間が経過したことを検知し、不正検知ECU4100aへ待機モードへの移行を指示し、不正検知ECU4100aが待機モードへ移行する動作例を示すシーケンス図である。 FIG. 39 is a sequence showing an operation example in which the head unit 4200 detects that a certain time has elapsed from the start of use of the vehicle, instructs the fraud detection ECU 4100a to shift to the standby mode, and the fraud detection ECU 4100a shifts to the standby mode. It is a figure.

この動作例の開始段階では、不正検知ECU4100aは、チェックモードになっている(シーケンスS4201)。例えば、この段階以前に、ヘッドユニット4200が車両の使用開始を検出した際にチェックモードへの移行を指示するトリガーフレームを不正検知ECU4100aが受けた結果として、チェックモードになっている状態である。このとき不正検知ECU4100aは、不正フレーム検知部130により不正なメッセージの検知を行う状態である。 At the start stage of this operation example, the fraud detection ECU 4100a is in the check mode (sequence S4201). For example, before this stage, when the head unit 4200 detects the start of use of the vehicle, the fraud detection ECU 4100a receives a trigger frame instructing the transition to the check mode, and as a result, the check mode is set. At this time, the fraud detection ECU 4100a is in a state where the fraud frame detection unit 130 detects a fraudulent message.

ヘッドユニット4200は、車使用開始検出部4282により車両の使用が開始されてから一定時間が経過したことが検出されると(シーケンスS4202)、外部との通信中であるか否かを判断する(シーケンスS4203)。外部と通信している場合には、待機モードへ移行してはならないため、待機モードへの移行を指示するトリガーフレームを送信しない(つまりシーケンスS4204、S4205をスキップする)。 When the head unit 4200 detects that a certain time has elapsed from the start of use of the vehicle by the vehicle use start detection unit 4482 (sequence S4202), the head unit 4200 determines whether or not communication with the outside is in progress (sequence S4202). Sequence S4203). When communicating with the outside, since the transition to the standby mode must not be performed, the trigger frame instructing the transition to the standby mode is not transmitted (that is, the sequences S4204 and S4205 are skipped).

外部と通信中ではない場合には、ヘッドユニット4200は、不正なメッセージを検出したかを判断する(シーケンスS4204)。チェックモードへの移行を指示するトリガーフレームの送信後に不正なメッセージを検出していた場合には、待機モードへ移行してはならないため、待機モードへの移行を指示するトリガーフレームを送信しない(つまりシーケンスS4205をスキップする)。 When not communicating with the outside, the head unit 4200 determines whether an invalid message has been detected (sequence S4204). If an invalid message is detected after sending the trigger frame instructing the transition to the check mode, the trigger frame instructing the transition to the standby mode is not sent because the transition to the standby mode must not be performed (that is, the trigger frame instructing the transition to the standby mode is not transmitted). Sequence S4205 is skipped).

シーケンスS4204において不正なメッセージを検出していないと判断した場合には、ヘッドユニット4200は、待機モードへの移行を指示する(シーケンスS4205)。具体的には、ヘッドユニット4200は、待機モードへの移行を指示するトリガーフレームを送信する。 If it is determined that an invalid message has not been detected in the sequence S4204, the head unit 4200 instructs the transition to the standby mode (sequence S4205). Specifically, the head unit 4200 transmits a trigger frame instructing the transition to the standby mode.

ヘッドユニット4200からバス500cに送信された待機モードへの移行を指示するトリガーフレームは、ゲートウェイ300によりバス500a、500bに転送される。 The trigger frame instructing the transition to the standby mode transmitted from the head unit 4200 to the bus 500c is transferred to the buses 500a and 500b by the gateway 300.

不正検知ECU4100aは、バス500aに送信されたトリガーフレームを受信して、動作モードを待機モードに移行する(シーケンスS4206)。このときから、不正検知ECU4100aは、不正フレーム検知部130による不正なメッセージの検知を行わなくなる。 The fraud detection ECU 4100a receives the trigger frame transmitted to the bus 500a and shifts the operation mode to the standby mode (sequence S4206). From this time, the fraud detection ECU 4100a does not detect the fraudulent message by the fraudulent frame detection unit 130.

ここでは不正検知ECUのうち不正検知ECU4100aに着目して説明したが、例えば不正検知ECU4100bについても同様に、シーケンスS4205において送信されたトリガーフレームに対応して、動作モードを待機モードにし得る。 Although the fraud detection ECU 4100a has been described here as a focus on the fraud detection ECU 4100a, for example, the fraud detection ECU 4100b can also be set to the standby mode in the operation mode corresponding to the trigger frame transmitted in the sequence S4205.

[4.7 実施の形態4の効果]
車載ネットワークシステム13では、車両の状態に応じて不正検知ECU4100a、4100bが、動作モードを、不正なメッセージの検知を行うチェックモードと不正なメッセージの検知を行わない待機モードとの間で切り替える。これにより、車両の状態に応じて必要な場合にだけ不正なメッセージの検知を行うようにすることで電力消費量を抑えることができる。また、不正検知ECU4100a、4100bは、車両の状態を直接検知する機構を有さなくても、ヘッドユニット4200からのトリガーフレームにより、動作モードを切り替えるタイミングを得ることができる。
[Effect of 4.7 Embodiment 4]
In the in-vehicle network system 13, the fraud detection ECUs 4100a and 4100b switch the operation mode between the check mode for detecting the fraudulent message and the standby mode for not detecting the fraudulent message according to the state of the vehicle. As a result, power consumption can be suppressed by detecting an illegal message only when necessary according to the state of the vehicle. Further, even if the fraud detection ECUs 4100a and 4100b do not have a mechanism for directly detecting the state of the vehicle, the timing for switching the operation mode can be obtained by the trigger frame from the head unit 4200.

(他の実施の形態等)
以上のように、本開示に係る技術の例示として実施の形態1〜4を説明した。しかしながら、本開示に係る技術は、これに限定されず、適宜、変更、置き換え、付加、省略等を行った実施の形態にも適用可能である。例えば、以下のような変形例も本開示の一実施態様に含まれる。
(Other embodiments, etc.)
As described above, Embodiments 1 to 4 have been described as an example of the technique according to the present disclosure. However, the technique according to the present disclosure is not limited to this, and can be applied to embodiments in which changes, replacements, additions, omissions, etc. are made as appropriate. For example, the following modifications are also included in one embodiment of the present disclosure.

(1)上記実施の形態では、ECU400a〜400d或いはECU3400a〜3400dによりフレームが定期的に送信される例を示したが、フレームは、状態変化を通知するイベントとして送信されることとしても良い。例えば、ECUは、ドアの開閉状態を定期的に送信するのではなく、ドアの開閉状態が変化した場合にのみ、フレームを送信するとしても良い。また、ECUがフレームを、定期的に送信、かつ、状態変化が発生した時に送信することとしても良い。 (1) In the above embodiment, the example in which the frame is periodically transmitted by the ECUs 400a to 400d or the ECUs 3400a to 3400d is shown, but the frame may be transmitted as an event for notifying the state change. For example, the ECU may transmit the frame only when the open / closed state of the door changes, instead of transmitting the open / closed state of the door periodically. Further, the ECU may transmit the frame periodically and when a state change occurs.

(2)実施の形態3では、データ値とカウンタ値からMACを算出する例を示したが、データ値のみからMACを算出することとしても良い。またカウンタ値のみからMACを算出することとしても良い。また、フレームに含まれるMACのサイズは4bytesに制限されるものではなく、送信毎に異なるサイズであっても良い。同様に時速等のデータ値のサイズ及びカウンタ値のサイズも1byteに制限されるものではない。また、必ずしもフレームにカウンタ値が含まれていなくても良い。 (2) In the third embodiment, an example of calculating the MAC from the data value and the counter value is shown, but the MAC may be calculated only from the data value. Further, the MAC may be calculated only from the counter value. Further, the size of the MAC included in the frame is not limited to 4 bytes, and may be a different size for each transmission. Similarly, the size of the data value such as the speed per hour and the size of the counter value are not limited to 1 byte. Further, the frame does not necessarily have to include the counter value.

(3)実施の形態3では、カウンタ値を送信毎にインクリメントする例を示したが、カウンタ値が時刻に応じて自動的にインクリメントされる値であっても良い。また、時刻そのものの値をカウンタの代わりに使用しても良い。即ち、データフレームが送信される度に変化する変数(カウンタ、時刻等)に基づいてMACが生成されるようにすると、MACの不正な解読を困難化することが可能となる。また、実施の形態3では、不正検知ECUにおけるMAC生成部3170が、メッセージIDとデータフィールドの先頭1byteと、カウンタ保持部3190のカウンタ値とからMAC値を算出することとした。この代わりに、メッセージIDとデータフィールドの先頭1byteと、データフィールドの次の1byteであるカウンタ値とからMAC値を算出することとしても良い。また、不正ではないと判定されたデータフィールドにおけるカウンタ値に合わせるように、カウンタ保持部3190のカウンタ値を更新することとしても良い。 (3) In the third embodiment, an example in which the counter value is incremented for each transmission is shown, but the counter value may be a value that is automatically incremented according to the time. Moreover, the value of the time itself may be used instead of the counter. That is, if the MAC is generated based on variables (counter, time, etc.) that change each time a data frame is transmitted, it is possible to make it difficult to decipher the MAC illegally. Further, in the third embodiment, the MAC generation unit 3170 in the fraud detection ECU calculates the MAC value from the message ID, the first 1 byte of the data field, and the counter value of the counter holding unit 3190. Instead, the MAC value may be calculated from the message ID, the first 1 byte of the data field, and the counter value which is the next 1 byte of the data field. Further, the counter value of the counter holding unit 3190 may be updated so as to match the counter value in the data field determined to be not invalid.

(4)上記実施の形態では、CANプロトコルにおけるデータフレームを標準IDフォーマットで記述しているが、拡張IDフォーマットであっても良い。拡張IDフォーマットの場合には、標準IDフォーマットにおけるID位置のベースIDと、拡張IDとを合わせて29ビットでID(メッセージID)を表すので、この29ビットのIDを上述の実施の形態におけるID(メッセージID)と扱えば良い。 (4) In the above embodiment, the data frame in the CAN protocol is described in the standard ID format, but it may be in the extended ID format. In the case of the extended ID format, the base ID of the ID position in the standard ID format and the extended ID are combined to represent the ID (message ID) in 29 bits. Therefore, the 29-bit ID is the ID in the above-described embodiment. It may be treated as (message ID).

(5)上記実施の形態では、MAC算出のアルゴリズムをHMACとしているが、これCBC−MAC(Cipher Block Chaining Message Authentication Code)、CMAC((Cipher-based MAC)であっても良い。また、MAC計算に用いられるパディングについては、ゼロパディング、ISO10126、PKCS#1、PKCS#5、PKCS#7、その他、ブロックのデータサイズが計算に必要となるパディングの方式であれば何でも良い。また4bytes等のブロックへのサイズの変更方法についても、先頭、最後尾、中間のいずれの部分にパディングを行っても良い。また、MAC算出に用いるデータは、連続しているデータ(例えば4bytes分の連続データ)でなくても、特定のルールに従って1bitずつ収集して結合したものでも良い。 (5) In the above embodiment, the algorithm for calculating MAC is HMAC, but this may be CBC-MAC (Cipher Block Chaining Message Authentication Code) or CMAC ((Cipher-based MAC)). The padding used for is zero padding, ISO10126, PKCS # 1, PKCS # 5, PKCS # 7, or any other padding method that requires the data size of the block for calculation. Also, a block such as 4bytes. Regarding the method of changing the size to, padding may be performed at the beginning, the end, or the middle part. The data used for MAC calculation is continuous data (for example, continuous data for 4 bytes). It may not be necessary, but one bit may be collected and combined according to a specific rule.

(6)上記実施の形態で示したCANプロトコルは、TTCAN(Time-Triggered CAN)、CANFD(CAN with Flexible Data Rate)等の派生的なプロトコルをも包含する広義の意味を有するものであっても良い。 (6) Even if the CAN protocol shown in the above embodiment has a broad meaning including derivative protocols such as TTCAN (Time-Triggered CAN) and CANFD (CAN with Flexible Data Rate). good.

(7)上記実施の形態では、不正なECUがバスに接続される例を示したが、ECU400a〜400d或いはECU3400a〜3400dのような既存のECUが何らかの要因によって不正なECUとして働く可能性もある。その場合であっても、上記実施の形態で示したように不正検知ECUが適切に不正なフレームを検知してエラーフレームを送信することで、他のECUが不正なフレームを処理してしまうことを阻止できる。 (7) In the above embodiment, an example in which an illegal ECU is connected to a bus is shown, but an existing ECU such as ECU 400a to 400d or ECU 3400a to 3400d may act as an illegal ECU for some reason. .. Even in that case, as shown in the above embodiment, the fraud detection ECU appropriately detects the fraudulent frame and transmits the error frame, so that the other ECU processes the fraudulent frame. Can be blocked.

(8)実施の形態2では、メッセージIDと許容されているデータ範囲とが対応付けられたデータ範囲リストを用いて、受信されたデータフレームのデータが、メッセージID毎に許容されているデータ範囲に含まれているか否かによって、不正か否かの判定を行うこととしたが、データ範囲リストにメッセージIDを含ませず、全てのメッセージIDに共通して許容されているデータ範囲(例えば「0〜180」)を定めておき、メッセージIDにかかわらず不正か否かの判定を行うこととしても良い。また、不正検知ECUが保持するデータ範囲リストは、その不正検知ECUが接続されたバスにおいて送信され得るメッセージIDとデータ範囲とを対応付けたものとしても良い。これにより、データ範囲リストが、実施の形態1で示した正規IDリストとしても用いることができるようになる。これを利用して実施の形態2に示した不正検知ECUにおいても実施の形態1で示したメッセージIDのチェック(シーケンスS1004)を行うようにしても良い。 (8) In the second embodiment, the data of the received data frame is the data range allowed for each message ID by using the data range list in which the message ID and the allowed data range are associated with each other. It was decided to determine whether or not the data is invalid depending on whether or not it is included in the data range, but the data range does not include the message ID in the data range list, and the data range that is commonly allowed for all message IDs (for example, "" 0 to 180 ") may be set, and it may be determined whether or not the message ID is invalid. Further, the data range list held by the fraud detection ECU may be associated with a message ID that can be transmitted on the bus to which the fraud detection ECU is connected and a data range. As a result, the data range list can also be used as the regular ID list shown in the first embodiment. Utilizing this, the fraud detection ECU shown in the second embodiment may also check the message ID shown in the first embodiment (sequence S1004).

(9)実施の形態2で示したメッセージIDと許容されているデータ範囲とが対応付けられたデータ範囲リストの代わりに、不正検知ECUが、メッセージIDと、許容されているデータ長とを対応付けたデータ長リストを用いることとしても良い。この場合には、不正検知ECUは、受信されたデータフレームのコントロールフィールドの値が不正を示す所定条件に該当するか否かを判定する。この不正を示す所定条件は、コントロールフィールドにおけるデータ長(DLC)が、データ長リストにおいてメッセージIDに対応付けられているデータ長ではないという条件である。不正検知ECUは、受信されたDCLが、データ長リストにおいてメッセージID毎に許容されているデータ長であるか否かによって、不正か否かの判定を行う。 (9) Instead of the data range list in which the message ID shown in the second embodiment and the permissible data range are associated with each other, the fraud detection ECU corresponds the message ID and the permissible data length. The attached data length list may be used. In this case, the fraud detection ECU determines whether or not the value of the control field of the received data frame corresponds to a predetermined condition indicating fraud. The predetermined condition indicating this fraud is that the data length (DLC) in the control field is not the data length associated with the message ID in the data length list. The fraud detection ECU determines whether or not the received DCL is fraudulent depending on whether or not the received DCL has the data length permitted for each message ID in the data length list.

(10)上記実施の形態では、特にデータフレームに注目して説明したが、リモートフレームについても不正検知ECUが一定の不正を検知することが可能である。例えば、不正検知ECUが、実施の形態1で示した正規IDリストを用いて受信したリモートフレームにおけるメッセージIDが不正か否かを判定しても良い。また、不正検知ECUが、上述したデータ長リストを用いて受信したリモートフレームにおけるコントロールフィールドにおけるデータ長(DLC)が、メッセージID毎に許容されているデータ長であるか否かにより不正か否かを判定しても良い。また、上記実施の形態で示した不正検知ECUが不正なフレームを受信することで不正の検知を行った場合に送信するエラーフレームは、不正の検知後に迅速に送信されると良い。なお、不正検知ECUは、不正の検知後、その不正なフレームのCRCシーケンスの最後尾が送信される前までにエラーフレームを送信することは有用である。これにより他のECUは、エラーフレームの検出或いはCRCのチェックでのエラー検出により、その不正なフレームの処理を中止することになる。なお、リモートフレームもデータフレームと同様にメッセージID、コントロールフィールド及びCRCシーケンスを含む。 (10) In the above embodiment, the data frame has been described with particular attention, but the fraud detection ECU can also detect a certain fraud even for the remote frame. For example, the fraud detection ECU may determine whether or not the message ID in the received remote frame is fraudulent using the regular ID list shown in the first embodiment. Further, whether or not the data length (DLC) in the control field in the remote frame received by the fraud detection ECU using the above-mentioned data length list is fraudulent depending on whether or not the data length is allowed for each message ID. May be determined. Further, it is preferable that the error frame to be transmitted when the fraud detection ECU shown in the above embodiment detects fraud by receiving the fraud frame is promptly transmitted after the fraud is detected. It is useful for the fraud detection ECU to transmit an error frame after the fraud is detected and before the end of the CRC sequence of the fraud frame is transmitted. As a result, the other ECU stops processing the invalid frame by detecting the error frame or detecting the error in the CRC check. Note that the remote frame also includes a message ID, a control field, and a CRC sequence like the data frame.

(11)上記実施の形態では、不正検知ECUが一定条件下でエラー表示メッセージを送信することを示したが、エラー表示メッセージを送信しないこととしても良い。この場合には、ゲートウェイ及びヘッドユニット等のECUは特に不正検知ECUに対応した構成(エラー表示メッセージを受信するための受信IDリスト等)を保持する必要がなくなる。なお、不正検知ECUは、エラー表示メッセージの送信の代わりに自らスピーカ或いはディスプレイ等を備える場合においてエラーを自ら報知しても良いし、エラーのログを記憶媒体等に記録しても良い。 (11) In the above embodiment, it is shown that the fraud detection ECU transmits an error display message under certain conditions, but the error display message may not be transmitted. In this case, it is not necessary for the ECU such as the gateway and the head unit to hold a configuration (reception ID list for receiving the error display message, etc.) corresponding to the fraud detection ECU. The fraud detection ECU may notify the error by itself when the speaker or display is provided instead of transmitting the error display message, or may record the error log in the storage medium or the like.

(12)実施の形態4で示した車載ネットワークシステム13において、動作モードを切り替え可能な不正検知ECUと、動作モードを切り替えない不正検知ECU(つまり常時チェックモードと同様である不正検知ECU)が混在しても良い。また、不正検知ECUは、バス上で送信される不正なメッセージを検知する機能の他に、他のECUと同様に、不正でないメッセージに応じて予め定められた処理を実行する機能、或いは、車両の状態の検知又は車両の制御等の処理を実行する機能を有していても良い。動作モードが特定の不正検知を行わない待機モードである場合においては、電力消費の低減の他に、不正検知ECUの処理負荷の低減及びバスでのトラフィック低減等の効果も生じ得る。 (12) In the in-vehicle network system 13 shown in the fourth embodiment, a fraud detection ECU capable of switching the operation mode and a fraud detection ECU not switching the operation mode (that is, a fraud detection ECU similar to the constant check mode) are mixed. You may. Further, the fraud detection ECU has a function of detecting a fraudulent message transmitted on a bus, a function of executing a predetermined process according to a non-illegal message, or a vehicle, like other ECUs. It may have a function of executing processing such as detection of the state of the vehicle or control of the vehicle. When the operation mode is a standby mode in which a specific fraud detection is not performed, in addition to the reduction of power consumption, the processing load of the fraud detection ECU can be reduced and the traffic on the bus can be reduced.

(13)実施の形態4では、ヘッドユニット4200が、車両の状態が一定条件を満たした場合にトリガーフレームを送信する機能を有することとしたが、この機能を他のECUが有することとしても良い。この車両の状態が一定状態を満たした場合にトリガーフレームを送信する機能は、車載ネットワークシステム13における1台のECUが有しても良いし、複数のECU(全ECUであっても一部のECUであっても良い。)が有しても良い。即ち、実施の形態4で示したヘッドユニット4200の不正フレーム検出部4280、モード変更指示部4281、車使用開始検出部4282及び通信開始・終了検出部4283を、他のECU(ECU400a等)に含ませることとしても良い。図40は、ECU400aを一部変形して、不正フレーム検出部4280、モード変更指示部4281、車使用開始検出部4282及び通信開始・終了検出部4283を含ませてなるECU4400の構成図である。図40に示すECU4400におけるフレーム解釈部4450は、実施の形態1で示したフレーム解釈部450を一部変形したものである。フレーム解釈部4450は、フレーム処理部410、フレーム生成部4420及び受信ID判断部430へのデータの転送に加えて、不正フレーム検出部4280、車使用開始検出部4282及び通信開始・終了検出部4283へも、受信したフレームを転送する。この転送は、全ての受信したフレームの転送でも良いし、各検出部に関連するフレームのみの転送であっても良い。不正フレーム検出部4280は、実施の形態4の不正フレーム検出部4280と同じ動作を行う。車使用開始検出部4282及び通信開始・終了検出部4283は、ECU4400が受信したフレームから、車体が使用開始されたこと、通信が開始されたこと、通信が終了されたこと等を検出する。例えば、ヘッドユニット4200や外部との通信機能を持つECUが通信の開始或いは終了を知らせるフレームを送信し、通信開始・終了検出部4283がそのフレームの受信に対応して通信の開始或いは通信の終了を検出しても良い。モード変更指示部4281は、実施の形態4の機能と同様である。フレーム生成部4420は、実施の形態1のフレーム生成部420の機能を有する。フレーム生成部4420は更に、モード変更指示部4281からのモード変更のためのトリガーフレームの送信依頼に従ってトリガーフレームを構成してトリガーフレームをフレーム送受信部270へ通知して送信させる機能を有する。このECU4400は、図37のシーケンスS4002〜S4005で示す処理手順、図38のシーケンスS4102〜S4105で示す処理手順、及び、図39のシーケンスS4202〜S4205で示す処理手順と、同様の処理手順を実行する。この車両の状態が一定状態を満たした場合にトリガーフレームを送信する機能は、不正検知ECUが有しても良い。 (13) In the fourth embodiment, the head unit 4200 has a function of transmitting a trigger frame when the state of the vehicle satisfies a certain condition, but another ECU may have this function. .. One ECU in the in-vehicle network system 13 may have a function of transmitting a trigger frame when the state of the vehicle satisfies a certain state, or a plurality of ECUs (even if they are all ECUs, some of them). It may be an ECU.). That is, the illegal frame detection unit 4280, the mode change instruction unit 4281, the vehicle use start detection unit 4282, and the communication start / end detection unit 4283 of the head unit 4200 shown in the fourth embodiment are included in another ECU (ECU 400a or the like). It is also good to let it. FIG. 40 is a configuration diagram of an ECU 4400 in which the ECU 400a is partially modified to include an illegal frame detection unit 4280, a mode change instruction unit 4281, a vehicle use start detection unit 4282, and a communication start / end detection unit 4283. The frame interpretation unit 4450 in the ECU 4400 shown in FIG. 40 is a partially modified version of the frame interpretation unit 450 shown in the first embodiment. In addition to transferring data to the frame processing unit 410, the frame generation unit 4420, and the reception ID determination unit 430, the frame interpretation unit 4450 includes an illegal frame detection unit 4280, a vehicle use start detection unit 4282, and a communication start / end detection unit 4283. Also, the received frame is transferred to. This transfer may be the transfer of all received frames, or may be the transfer of only the frames related to each detection unit. The fraudulent frame detection unit 4280 performs the same operation as the fraudulent frame detection unit 4280 of the fourth embodiment. The vehicle use start detection unit 4282 and the communication start / end detection unit 4283 detect from the frame received by the ECU 4400 that the vehicle body has started to be used, communication has started, communication has ended, and the like. For example, the head unit 4200 or an ECU having a communication function with the outside transmits a frame notifying the start or end of communication, and the communication start / end detection unit 4283 starts or ends communication in response to the reception of the frame. May be detected. The mode change instruction unit 4281 has the same function as that of the fourth embodiment. The frame generation unit 4420 has the function of the frame generation unit 420 of the first embodiment. The frame generation unit 4420 further has a function of forming a trigger frame according to a transmission request of the trigger frame for mode change from the mode change instruction unit 4281 and notifying the frame transmission / reception unit 270 of the trigger frame to transmit the trigger frame. The ECU 4400 executes the same processing procedure as the processing procedure shown in the sequence S4002 to S4005 of FIG. 37, the processing procedure shown in the sequence S4102 to S4105 of FIG. 38, and the processing procedure shown in the sequence S4202 to S4205 of FIG. 39. .. The fraud detection ECU may have a function of transmitting a trigger frame when the state of the vehicle satisfies a certain state.

(14)実施の形態4で示したヘッドユニット4200による待機モードへの移行を指示すべきか否かの判断(図38、図39参照)は、有用な判断の一例にすぎず、この他の判断も可能である。例えば、単に通信終了を検出した場合に待機モードへの移行の指示がなされても良く、また、車両の使用開始から所定時間が経過した場合に待機モードへの移行の指示がなされても良い。この所定時間は、例えば数分間等の一定時間であっても良いし、また、車両の使用開始後にバス上で一定数のメッセージの送信がなされるまでに要した時間、使用開始後に一定の処理手順が実行されるまでに要した時間であっても良い。また、単にバス上で一定期間において不正なメッセージを検知しなかった場合に待機モードへの移行の指示がなされても良い。即ち、車両の状態に応じて不正検知ECUの動作モードをチェックモード或いは待機モードに変更するために、実験、理論等に基づき有用であるならば任意の判断材料に基づき任意の判断方法(判断アルゴリズム等)を利用し得る。例えば、ヘッドユニット4200は、車使用開始検出部4282及び通信開始・終了検出部4283の両方を必ずしも含まなくても良く、どちらか一方のみ含んでも良いし、他の車両の状態を検出するための検出部を含んでも良い。検出部としては、例えば駐車中か否かの検出部、停車中か否かの検出部、ドアの開閉の検出部、給油口の開閉の検出部、充電中か否かの検出部、走行中か否かの検出部、シートへの着席の検出部、乗車中の検出部、乗車完了の検出部、降車中の検出部等が挙げられる。車載ネットワークシステムは、車両の状態が一定条件を満たしたことが検出された場合に、不正検知ECUの動作モードを、バス上の不正なメッセージを検知する所定種類の検知処理を行う第1モード(チェックモード)とその検知処理を行わない第2モード(待機モード等)との間で切り替えるように構成されていれば良い。また、第2モードで不正なメッセージの検知処理を全く行わない方式の他に、第2モードでは、その所定種類の検知処理を行わないが、その所定種類の検知処理よりは処理量の少ない、ある種の不正なメッセージの検知処理を実行する方式も採り得る。また、ヘッドユニット4200が不正検知ECUの動作モード変更用ボタンその他のユーザインタフェースを備え、そのユーザインタフェースへのユーザによる操作、入力等に応じて不正検知ECUへ動作モードの変更を指示しても良い。そのユーザインタフェースとしては、物理的なボタンの他、タッチパネル等に表示したボタン等であっても良いし、音声入力機構を用いても良い。なお、車使用開始検出部4282、通信開始・終了検出部4283等の検出部により車両の状態の変化が検出されたときに、画面表示、音声出力等により、ユーザに動作モードの変更が必要か否かを問い合わせても良い。ヘッドユニット4200は、ユーザからの応答としての動作モードの変更の要否に係る入力を受け付けると、その入力が動作モードの切り替えを要する旨を示すならば不正検知ECUへ動作モードの変更を指示し得る。例えば、ヘッドユニット4200が、車両の使用開始から一定時間が経過した際に待機モードに移行するか否かをユーザに問い合わせ、これに対してユーザがチェックモードを継続することを選択し得る。また、ヘッドユニット4200が単に車両の使用開始、通信開始、通信終了等のイベントの情報だけを不正検知ECU4100a等に通知し、どの動作モードに移行するべきかを不正検知ECU4100a等が判断するようにしても良い。 (14) The determination as to whether or not the head unit 4200 shown in the fourth embodiment should be instructed to shift to the standby mode (see FIGS. 38 and 39) is only an example of a useful determination, and other determinations. Is also possible. For example, when the end of communication is simply detected, an instruction to shift to the standby mode may be given, or when a predetermined time has elapsed from the start of use of the vehicle, an instruction to shift to the standby mode may be given. This predetermined time may be a fixed time such as several minutes, the time required until a fixed number of messages are transmitted on the bus after the start of use of the vehicle, and a fixed process after the start of use. It may be the time required for the procedure to be executed. Further, if an invalid message is not detected on the bus for a certain period of time, an instruction to shift to the standby mode may be given. That is, in order to change the operation mode of the fraud detection ECU to the check mode or the standby mode according to the state of the vehicle, if it is useful based on experiments, theories, etc., an arbitrary judgment method (judgment algorithm) based on any judgment material. Etc.) can be used. For example, the head unit 4200 does not necessarily have to include both the vehicle use start detection unit 4282 and the communication start / end detection unit 4283, or may include only one of them, or for detecting the state of another vehicle. A detection unit may be included. Examples of the detection unit include a parking / non-parking detection unit, a stopped / non-stop detection unit, a door open / close detection unit, a refueling port open / close detection unit, a charging / non-charging detection unit, and a running unit. Examples include a detection unit for whether or not the vehicle is seated, a detection unit for seating, a detection unit for riding, a detection unit for completing boarding, a detection unit for getting off, and the like. When it is detected that the state of the vehicle satisfies a certain condition, the in-vehicle network system sets the operation mode of the fraud detection ECU to the first mode (first mode) in which a predetermined type of detection process for detecting a fraudulent message on the bus is performed. It suffices if it is configured to switch between the check mode) and the second mode (standby mode or the like) in which the detection process is not performed. Further, in addition to the method in which the detection processing of an illegal message is not performed at all in the second mode, the detection processing of the predetermined type is not performed in the second mode, but the processing amount is smaller than the detection processing of the predetermined type. A method of performing some kind of malicious message detection processing can also be adopted. Further, the head unit 4200 may be provided with a button for changing the operation mode of the fraud detection ECU and other user interfaces, and may instruct the fraud detection ECU to change the operation mode in response to an operation, input, etc. by the user to the user interface. .. As the user interface, in addition to physical buttons, buttons displayed on a touch panel or the like may be used, or a voice input mechanism may be used. When a change in the state of the vehicle is detected by the detection units such as the vehicle use start detection unit 4482 and the communication start / end detection unit 4283, is it necessary for the user to change the operation mode by screen display, voice output, or the like? You may inquire whether or not. When the head unit 4200 receives an input relating to the necessity of changing the operation mode as a response from the user, if the input indicates that the operation mode needs to be switched, the head unit 4200 instructs the fraud detection ECU to change the operation mode. obtain. For example, the head unit 4200 may ask the user whether or not to shift to the standby mode when a certain time has elapsed from the start of use of the vehicle, and the user may choose to continue the check mode. Further, the head unit 4200 simply notifies the fraud detection ECU 4100a and the like of information on events such as the start of use of the vehicle, the start of communication, and the end of communication, so that the fraud detection ECU 4100a and the like determine which operation mode to shift to. You may.

(15)実施の形態4で示した不正検知ECU4100aは、実施の形態1の不正検知ECU100aの機能を含むものとしたが、不正検知ECUにおける不正対処方法の具体的な実現態様は、実施の形態2、3に示したものであっても良い。即ち、車載ネットワークシステム13における各不正検知ECU(不正検知ECU4100a等)を、例えば図41に示すように実施の形態2の不正検知ECU2100aの機能を含む不正検知ECU5100としても良い。また、不正検知ECU4100a等を、図42に示すように実施の形態3の不正検知ECU3100aの機能を含む不正検知ECU6100としても良い。なお、図41に示した不正検知ECU5100及び図42に示した不正検知ECU6100はいずれも、不正検知ECU4100aと同様にフレーム解釈部4150、トリガーフレーム検出部4170、モード保持部4180を含む。また、不正検知ECU4100aが、実施の形態1〜3のそれぞれで示した不正検知の処理手順の2つ以上を、切り替えて実行できるように構成されても良い。例えば、不正検知ECUが、不正なメッセージを検知するために処理量の比較的多い実施の形態2又は3で示した不正検知の処理手順と、処理量の比較的少ない実施の形態1で示した不正検知の処理手順とを動作モードにより切り替えることとしても良い。この場合において、動作モードは、例えば処理量の比較的多い検知処理を行う第1モードと、処理量の比較的多い検知処理を行わず処理量の比較的少ない検知処理を行う第2モードとの間で切り替えられることになる。 (15) The fraud detection ECU 4100a shown in the fourth embodiment includes the function of the fraud detection ECU 100a of the first embodiment, but the specific implementation mode of the fraud countermeasure method in the fraud detection ECU is the embodiment. It may be the one shown in 2 and 3. That is, each fraud detection ECU (fraud detection ECU 4100a or the like) in the in-vehicle network system 13 may be a fraud detection ECU 5100 including the function of the fraud detection ECU 2100a of the second embodiment as shown in FIG. 41, for example. Further, the fraud detection ECU 4100a or the like may be a fraud detection ECU 6100 including the function of the fraud detection ECU 3100a of the third embodiment as shown in FIG. 42. The fraud detection ECU 5100 shown in FIG. 41 and the fraud detection ECU 6100 shown in FIG. 42 all include a frame interpretation unit 4150, a trigger frame detection unit 4170, and a mode holding unit 4180, similarly to the fraud detection ECU 4100a. Further, the fraud detection ECU 4100a may be configured so that two or more of the fraud detection processing procedures shown in each of the first to third embodiments can be switched and executed. For example, the fraud detection processing procedure shown in the second or third embodiment in which the fraud detection ECU has a relatively large amount of processing to detect a fraudulent message and the first embodiment in which the processing amount is relatively small are shown. The fraud detection processing procedure may be switched depending on the operation mode. In this case, the operation modes are, for example, a first mode in which a detection process having a relatively large amount of processing is performed and a second mode in which a detection process having a relatively large amount of processing is performed and a detection process having a relatively small amount of processing is performed. It will be switched between.

(16)上記実施の形態で示した不正フレーム検知部及び不正MAC検知部はCANコントローラと呼ばれるハードウェア、または、CANコントローラと接続して動作するプロセッサ上で動作するファームウェアに実装しても良い。また、MAC鍵保持部、カウンタ保持部、正規IDリスト保持部、データ範囲リスト保持部は、CANコントローラと呼ばれるハードウェアのレジスタ、または、CANコントローラと接続して動作するプロセッサ上で動作するファームウェアに格納されていても良い。 (16) The fraudulent frame detection unit and the fraudulent MAC detection unit shown in the above embodiment may be mounted on hardware called a CAN controller or firmware that operates on a processor that operates in connection with the CAN controller. In addition, the MAC key holding unit, counter holding unit, regular ID list holding unit, and data range list holding unit are used for hardware registers called CAN controllers or firmware that operates on a processor that operates in connection with the CAN controller. It may be stored.

(17)上記実施の形態における各ECU(ゲートウェイ及びヘッドユニットを含む)は、例えば、プロセッサ、メモリ等のデジタル回路、アナログ回路、通信回路等を含む装置であることとしたが、ハードディスク装置、ディスプレイ、キーボード、マウス等の他のハードウェア構成要素を含んでいても良い。また、メモリに記憶された制御プログラムがプロセッサにより実行されてソフトウェア的に機能を実現する代わりに、専用のハードウェア(デジタル回路等)によりその機能を実現することとしても良い。 (17) Each ECU (including a gateway and a head unit) in the above embodiment is a device including, for example, a digital circuit such as a processor and a memory, an analog circuit, a communication circuit, and the like, but a hard disk device and a display. , Keyboard, mouse and other hardware components may be included. Further, instead of the control program stored in the memory being executed by the processor to realize the function in software, the function may be realized by dedicated hardware (digital circuit or the like).

(18)上記実施の形態における各装置を構成する構成要素の一部または全部は、1個のシステムLSI(Large Scale Integration:大規模集積回路)から構成されているとしても良い。システムLSIは、複数の構成部を1個のチップ上に集積して製造された超多機能LSIであり、具体的には、マイクロプロセッサ、ROM、RAM等を含んで構成されるコンピュータシステムである。前記RAMには、コンピュータプログラムが記録されている。前記マイクロプロセッサが、前記コンピュータプログラムに従って動作することにより、システムLSIは、その機能を達成する。また、上記各装置を構成する構成要素の各部は、個別に1チップ化されていても良いし、一部又はすべてを含むように1チップ化されても良い。また、ここでは、システムLSIとしたが、集積度の違いにより、IC、LSI、スーパーLSI、ウルトラLSIと呼称されることもある。また、集積回路化の手法はLSIに限るものではなく、専用回路又は汎用プロセッサで実現しても良い。LSI製造後に、プログラムすることが可能なFPGA(Field Programmable Gate Array)や、LSI内部の回路セルの接続や設定を再構成可能なリコンフィギュラブル・プロセッサを利用しても良い。さらには、半導体技術の進歩又は派生する別技術によりLSIに置き換わる集積回路化の技術が登場すれば、当然、その技術を用いて機能ブロックの集積化を行っても良い。バイオ技術の適用等が可能性としてあり得る。 (18) A part or all of the components constituting each device in the above embodiment may be composed of one system LSI (Large Scale Integration). The system LSI is an ultra-multifunctional LSI manufactured by integrating a plurality of components on one chip, and specifically, is a computer system including a microprocessor, a ROM, a RAM, and the like. .. A computer program is recorded in the RAM. When the microprocessor operates according to the computer program, the system LSI achieves its function. Further, each part of the component components constituting each of the above devices may be individually integrated into one chip, or may be integrated into one chip so as to include a part or all of them. Further, although the system LSI is used here, it may be referred to as an IC, an LSI, a super LSI, or an ultra LSI depending on the degree of integration. Further, the method of making an integrated circuit is not limited to LSI, and may be realized by a dedicated circuit or a general-purpose processor. An FPGA (Field Programmable Gate Array) that can be programmed after the LSI is manufactured, or a reconfigurable processor that can reconfigure the connection and settings of circuit cells inside the LSI may be used. Furthermore, if an integrated circuit technology that replaces an LSI appears due to advances in semiconductor technology or another technology derived from it, it is naturally possible to integrate functional blocks using that technology. The application of biotechnology, etc. is possible.

(19)上記各装置を構成する構成要素の一部または全部は、各装置に脱着可能なICカードまたは単体のモジュールから構成されているとしても良い。前記ICカードまたは前記モジュールは、マイクロプロセッサ、ROM、RAM等から構成されるコンピュータシステムである。前記ICカードまたは前記モジュールは、上記の超多機能LSIを含むとしても良い。マイクロプロセッサが、コンピュータプログラムに従って動作することにより、前記ICカードまたは前記モジュールは、その機能を達成する。このICカードまたはこのモジュールは、耐タンパ性を有するとしても良い。 (19) A part or all of the components constituting each of the above devices may be composed of an IC card or a single module that can be attached to and detached from each device. The IC card or the module is a computer system composed of a microprocessor, a ROM, a RAM, and the like. The IC card or the module may include the above-mentioned super multifunctional LSI. When the microprocessor operates according to a computer program, the IC card or the module achieves its function. This IC card or this module may have tamper resistance.

(20)本開示の一態様としては、上記に示す不正検知方法、不正対処方法等の方法であるとしても良い。また、これらの方法をコンピュータにより実現するコンピュータプログラムであるとしても良いし、前記コンピュータプログラムからなるデジタル信号であるとしても良い。また、本開示の一態様としては、前記コンピュータプログラムまたは前記デジタル信号をコンピュータ読み取り可能な記録媒体、例えば、フレキシブルディスク、ハードディスク、CD−ROM、MO、DVD、DVD−ROM、DVD−RAM、BD(Blu-ray(登録商標) Disc)、半導体メモリ等に記録したものとしても良い。また、これらの記録媒体に記録されている前記デジタル信号であるとしても良い。また、本開示の一態様としては、前記コンピュータプログラムまたは前記デジタル信号を、電気通信回線、無線または有線通信回線、インターネットを代表とするネットワーク、データ放送等を経由して伝送するものとしても良い。また、本開示の一態様としては、マイクロプロセッサとメモリを備えたコンピュータシステムであって、前記メモリは、上記コンピュータプログラムを記録しており、前記マイクロプロセッサは、前記コンピュータプログラムに従って動作するとしても良い。また、前記プログラムまたは前記デジタル信号を前記記録媒体に記録して移送することにより、または前記プログラムまたは前記デジタル信号を前記ネットワーク等を経由して移送することにより、独立した他のコンピュータシステムにより実施するとしても良い。 (20) As one aspect of the present disclosure, the fraud detection method, the fraud countermeasure method, and the like shown above may be used. Further, it may be a computer program that realizes these methods by a computer, or it may be a digital signal composed of the computer program. Further, as one aspect of the present disclosure, the computer program or a recording medium capable of reading the digital signal by a computer, for example, a flexible disk, a hard disk, a CD-ROM, an MO, a DVD, a DVD-ROM, a DVD-RAM, a BD ( It may be recorded on a Blu-ray (registered trademark) Disc), a semiconductor memory, or the like. Further, it may be the digital signal recorded on these recording media. Further, as one aspect of the present disclosure, the computer program or the digital signal may be transmitted via a telecommunication line, a wireless or wired communication line, a network typified by the Internet, data broadcasting, or the like. Further, one aspect of the present disclosure is a computer system including a microprocessor and a memory, in which the memory records the computer program, and the microprocessor may operate according to the computer program. .. Further, it is carried out by another independent computer system by recording and transferring the program or the digital signal on the recording medium, or by transferring the program or the digital signal via the network or the like. It may be.

(21)上記実施の形態及び上記変形例で示した各構成要素及び機能を任意に組み合わせることで実現される形態も本開示の範囲に含まれる。 (21) The scope of the present disclosure also includes a form realized by arbitrarily combining the above-described embodiment and each component and function shown in the above-described modification.

本開示は、車載ネットワークシステムにおいて不正なECUによる影響を効率的に抑制するために利用可能である。 The present disclosure can be used to efficiently suppress the influence of an unauthorized ECU in an in-vehicle network system.

10,11,12,13 車載ネットワークシステム
100a,100b,2100a,2100b,3100a,3100b,4100a,4100b,5100,6100 不正検知電子制御ユニット(不正検知ECU)
110 不正検知カウンタ保持部
120 正規IDリスト保持部
130,2130 不正フレーム検知部
140,230,320,420,3420,4230,4420 フレーム生成部
150,260,350,450,2150,3150,4150,4260,4450 フレーム解釈部
160,270,360,460 フレーム送受信部
200,4200 ヘッドユニット
210 表示制御部
220,410 フレーム処理部
240,330,430 受信ID判断部
250,340,440 受信IDリスト保持部
300 ゲートウェイ
310 転送処理部
370 転送ルール保持部
400a,400b,400c,400d,3400a,3400b,3400c,3400d,4400 電子制御ユニット(ECU)
401 エンジン
402 ブレーキ
403 ドア開閉センサ
404 窓開閉センサ
470 データ取得部
500a,500b,500c バス
2120 データ範囲リスト保持部
3130 不正MAC検知部
3410,3170 MAC生成部
3430,3180 MAC鍵保持部
3440,3190 カウンタ保持部
4170 トリガーフレーム検出部
4180 モード保持部
4280 不正フレーム検出部
4281 モード変更指示部
4282 車使用開始検出部
4283 通信開始・終了検出部
10, 11, 12, 13 In-vehicle network system 100a, 100b, 2100a, 2100b, 3100a, 3100b, 4100a, 4100b, 5100, 6100 Fraud detection electronic control unit (fraud detection ECU)
110 Fraud detection counter holding unit 120 Regular ID list holding unit 130, 2130 Fraud frame detection unit 140, 230, 320, 420, 3420, 4230, 4420 Frame generator 150, 260, 350, 450, 2150, 3150, 4150, 4260 , 4450 Frame interpretation unit 160, 270, 360, 460 Frame transmission / reception unit 200, 4200 Head unit 210 Display control unit 220, 410 Frame processing unit 240, 330, 430 Reception ID judgment unit 250, 340, 440 Reception ID list holding unit 300 Gateway 310 Transfer processing unit 370 Transfer rule holding unit 400a, 400b, 400c, 400d, 3400a, 3400b, 3400c, 3400d, 4400 Electronic control unit (ECU)
401 Engine 402 Brake 403 Door open / close sensor 404 Window open / close sensor 470 Data acquisition unit 500a, 500b, 500c Bus 2120 Data range list holding unit 3130 Illegal MAC detection unit 3410, 3170 MAC generation unit 3430, 3180 MAC key holding unit 3440, 3190 Counter Holding unit 4170 Trigger frame detection unit 4180 Mode holding unit 4280 Illegal frame detection unit 4281 Mode change instruction unit 4282 Vehicle use start detection unit 4283 Communication start / end detection unit

Claims (17)

1以上のネットワークを介して通信する複数の電子制御ユニットを備える車載ネットワークシステムにおいて用いられる不正検知方法であって、
前記複数の電子制御ユニットは、第1の電子制御ユニットと第2の電子制御ユニットと第3の電子制御ユニットを含み、
前記1以上のネットワークは、第1のネットワークと第2のネットワークを含み、
前記第1の電子制御ユニットは前記第1のネットワークに接続され、
前記第2の電子制御ユニットは前記第2のネットワークに接続され、
前記第3の電子制御ユニットは第1の条件および第2の条件を含むルールを保持し、
前記不正検知方法は、
前記第3の電子制御ユニットが前記車載ネットワークシステムを備えた車両の状態が前記第1の条件または前記第2の条件を満たしたことを検出する検出ステップと、
前記車両の状態が前記第1の条件または前記第2の条件を満たしたことを検出した場合に、前記第3の電子制御ユニットが切替指示メッセージを前記第1の電子制御ユニットと前記第2の電子制御ユニットへ送信し、
(i)前記車両の状態が前記第1の条件を満たしたことが検出された場合に、前記第1の電子制御ユニットと前記第2の電子制御ユニットは、動作モードを、前記1以上のネットワーク上の不正なメッセージを検知する第1の種類の検知処理を行わない第1のモードへ移行し、
(ii)前記車両の状態が前記第2の条件を満たしたことが検出された場合に、前記第2の電子制御ユニットは、動作モードを、前記第1の種類の検知処理を行う第2のモードへ移行する、切替ステップと、を含む、
不正検知方法。
A fraud detection method used in an in-vehicle network system including a plurality of electronic control units that communicate via one or more networks.
The plurality of electronic control units include a first electronic control unit, a second electronic control unit, and a third electronic control unit.
The one or more networks include a first network and a second network.
The first electronic control unit is connected to the first network, and the first electronic control unit is connected to the first network.
The second electronic control unit is connected to the second network, and the second electronic control unit is connected to the second network.
The third electronic control unit holds a rule including the first condition and the second condition.
The fraud detection method is
A detection step in which the third electronic control unit detects that the state of the vehicle equipped with the in-vehicle network system satisfies the first condition or the second condition.
When it is detected that the state of the vehicle satisfies the first condition or the second condition, the third electronic control unit sends a switching instruction message to the first electronic control unit and the second electronic control unit. Send to the electronic control unit,
(I) When it is detected that the state of the vehicle satisfies the first condition, the first electronic control unit and the second electronic control unit set the operation mode to the network of one or more. Move to the first mode that does not perform the first type of detection processing that detects the above malicious message,
(Ii) When it is detected that the state of the vehicle satisfies the second condition, the second electronic control unit sets the operation mode to the second type of detection process. Transition to mode, including switching steps,
Fraud detection method.
前記第3の電子制御ユニットは外部と通信可能に構成され、
前記第3の電子制御ユニットは、前記ルールを外部から取得する、
請求項1記載の不正検知方法。
The third electronic control unit is configured to be able to communicate with the outside.
The third electronic control unit acquires the rule from the outside.
The fraud detection method according to claim 1.
前記第3の電子制御ユニットは外部と通信可能に構成され、
前記第3の電子制御ユニットは、前記外部と通信し、前記ルールを更新する、
請求項1記載の不正検知方法。
The third electronic control unit is configured to be able to communicate with the outside.
The third electronic control unit communicates with the outside and updates the rule.
The fraud detection method according to claim 1.
前記第3の電子制御ユニットは前記ルールを着脱自在な記録媒体に保持する、
請求項1記載の不正検知方法。
The third electronic control unit holds the rule on a detachable recording medium.
The fraud detection method according to claim 1.
前記第3の電子制御ユニットはヘッドユニットである、
請求項1記載の不正検知方法。
The third electronic control unit is a head unit.
The fraud detection method according to claim 1.
前記第2の条件は、前記第3の電子制御ユニットが、前記1以上のネットワーク上で不正なメッセージを検知したことである、
請求項1記載の不正検知方法。
The second condition is that the third electronic control unit has detected an invalid message on the one or more networks.
The fraud detection method according to claim 1.
前記第1の条件は、前記第3の電子制御ユニットが、前記1以上のネットワーク上で所定の期間において不正なメッセージを検知しなかったことである、
請求項6記載の不正検知方法。
The first condition is that the third electronic control unit did not detect an unauthorized message on the one or more networks for a predetermined period of time.
The fraud detection method according to claim 6.
前記第2の条件は、前記第3の電子制御ユニットが前記車両の外部の装置と通信を開始する状態になったことである、
請求項1記載の不正検知方法。
The second condition is that the third electronic control unit is in a state of starting communication with an external device of the vehicle.
The fraud detection method according to claim 1.
前記第1の条件は、前記第3の電子制御ユニットが前記車両の外部の装置との通信を終了して所定の状態になったことである、
請求項8記載の不正検知方法。
The first condition is that the third electronic control unit ends communication with an external device of the vehicle and is in a predetermined state.
The fraud detection method according to claim 8.
前記第2の条件は、前記車両の状態が駐車中である、
請求項1記載の不正検知方法。
The second condition is that the state of the vehicle is parked.
The fraud detection method according to claim 1.
前記第2のネットワークは、前記複数の電子制御ユニットのうち、前記車両の駆動に関する電子制御ユニットを含まない、
請求項10記載の不正検知方法。
The second network does not include the electronic control unit related to the driving of the vehicle among the plurality of electronic control units.
The fraud detection method according to claim 10.
前記1以上のネットワークは、さらに、第3のネットワークを含み、
前記第3の電子制御ユニットは、前記第3のネットワークに接続され、
前記車載ネットワークシステムは更に、前記第1のネットワークと前記第2のネットワークと前記第3のネットワークとの間でメッセージを転送するゲートウェイ装置を備え、
前記切替ステップでは、
前記第3の電子制御ユニットが切替指示メッセージを前記ゲートウェイ装置へ送信し、
前記車両の状態が前記第1の条件を満たしたことが検出された場合は、前記ゲートウェイ装置は、前記切替指示メッセージを前記第1の電子制御ユニットと前記第2の電子制御ユニットへ送信し、
前記車両の状態が前記第2の条件を満たしたことが検出された場合は、前記ゲートウェイ装置は、前記切替指示メッセージを前記第2の電子制御ユニットへ送信する、
請求項1記載の不正検知方法。
The one or more networks further include a third network.
The third electronic control unit is connected to the third network and is connected to the third electronic control unit.
The vehicle-mounted network system further includes a gateway device that transfers a message between the first network, the second network, and the third network.
In the switching step,
The third electronic control unit sends a switching instruction message to the gateway device, and the third electronic control unit sends a switching instruction message to the gateway device.
When it is detected that the state of the vehicle satisfies the first condition, the gateway device transmits the switching instruction message to the first electronic control unit and the second electronic control unit.
When it is detected that the state of the vehicle satisfies the second condition, the gateway device transmits the switching instruction message to the second electronic control unit.
The fraud detection method according to claim 1.
前記第1の条件または前記第2の条件は、
前記車両の状態が変化した場合において、所定のユーザインタフェースで前記動作モードの切り替えを要することを示す入力を受け付けることである、
請求項1記載の不正検知方法。
The first condition or the second condition is
When the state of the vehicle changes, the predetermined user interface accepts an input indicating that the operation mode needs to be switched.
The fraud detection method according to claim 1.
前記第1のモードでは、不正なメッセージを検知可能な程度が、前記第1の種類の検知処理とは異なる、第2の種類の検知処理を行う、
請求項1記載の不正検知方法。
In the first mode, a second type of detection process is performed, in which the degree to which an invalid message can be detected is different from that of the first type of detection process.
The fraud detection method according to claim 1.
前記第3の電子制御ユニットは、前記第1のネットワークと前記第2のネットワークの間でメッセージを転送するゲートウェイ装置であり、
前記切替ステップでは、
前記車両の状態が前記第1の条件を満たしたことが検出された場合は、前記第3の電子制御ユニットは、前記切替指示メッセージを前記第1の電子制御ユニットと前記第2の電子制御ユニットへ送信し、
前記車両の状態が前記第2の条件を満たしたことが検出された場合は、前記第3の電子制御ユニットは、前記切替指示メッセージを前記第2の電子制御ユニットへ送信する、
請求項1記載の不正検知方法。
The third electronic control unit is a gateway device that transfers a message between the first network and the second network.
In the switching step,
When it is detected that the state of the vehicle satisfies the first condition, the third electronic control unit sends the switching instruction message to the first electronic control unit and the second electronic control unit. Send to
When it is detected that the state of the vehicle satisfies the second condition, the third electronic control unit transmits the switching instruction message to the second electronic control unit.
The fraud detection method according to claim 1.
前記複数の電子制御ユニットは、Controller Area Network(CAN)プロトコルに従って前記1以上のネットワークを介して通信を行う、
請求項1記載の不正検知方法。
The plurality of electronic control units communicate via the one or more networks according to the Controller Area Network (CAN) protocol.
The fraud detection method according to claim 1.
車載ネットワークシステムであって、
1以上のネットワークを介して通信する複数の電子制御ユニットと、
前記複数の電子制御ユニットは、第1の電子制御ユニットと第2の電子制御ユニットと第3の電子制御ユニットを含み、
前記1以上のネットワークは、第1のネットワークと第2のネットワークを含み、
前記第1の電子制御ユニットは前記第1のネットワークに接続され、
前記第2の電子制御ユニットは前記第2のネットワークに接続され、
前記第3の電子制御ユニットは、第1の条件および第2の条件を含むルールを保持し、
前記車載ネットワークシステムを備えた車両の状態が前記第1の条件または前記第2の条件を満たしたことを検出する検出部と、
前記検出部により前記車両の状態が前記第1の条件または前記第2の条件を満たしたことが検出された場合に、切替指示メッセージを前記第1の電子制御ユニットと前記第2の電子制御ユニットへ送信する送信部と、を備え、
前記車両の状態が前記第1の条件を満たしたことが検出された場合に、
前記第1の電子制御ユニットと前記第2の電子制御ユニットは、動作モードを、前記1以上のネットワーク上の不正なメッセージを検知する第1の種類の検知処理を行わない第1のモードへ移行し、
前記車両の状態が前記第2の条件を満たしたことが検出された場合に、
前記第2の電子制御ユニットは、動作モードを、前記第1の種類の検知処理を行う第2のモードへ移行する、
車載ネットワークシステム。
It is an in-vehicle network system
With multiple electronic control units communicating over one or more networks,
The plurality of electronic control units include a first electronic control unit, a second electronic control unit, and a third electronic control unit.
The one or more networks include a first network and a second network.
The first electronic control unit is connected to the first network, and the first electronic control unit is connected to the first network.
The second electronic control unit is connected to the second network, and the second electronic control unit is connected to the second network.
The third electronic control unit holds a rule including the first condition and the second condition.
A detection unit that detects that the state of the vehicle equipped with the in-vehicle network system satisfies the first condition or the second condition.
When the detection unit detects that the state of the vehicle satisfies the first condition or the second condition, a switching instruction message is sent to the first electronic control unit and the second electronic control unit. Equipped with a transmitter to send to
When it is detected that the state of the vehicle satisfies the first condition,
The first electronic control unit and the second electronic control unit shift the operation mode to the first mode that does not perform the first type of detection processing for detecting an invalid message on the one or more networks. And
When it is detected that the state of the vehicle satisfies the second condition,
The second electronic control unit shifts the operation mode to the second mode in which the first type of detection processing is performed.
In-vehicle network system.
JP2020008169A 2014-04-17 2020-01-22 Fraud detection method and in-vehicle network system Active JP6864759B6 (en)

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
US201461980821P 2014-04-17 2014-04-17
US61/980,821 2014-04-17
JP2015032179 2015-02-20
JP2015032179 2015-02-20
JP2019032763A JP6651662B2 (en) 2014-04-17 2019-02-26 Fraud detection electronic control unit and fraud detection method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2019032763A Division JP6651662B2 (en) 2014-04-17 2019-02-26 Fraud detection electronic control unit and fraud detection method

Publications (3)

Publication Number Publication Date
JP2020061789A JP2020061789A (en) 2020-04-16
JP6864759B2 true JP6864759B2 (en) 2021-04-28
JP6864759B6 JP6864759B6 (en) 2021-06-23

Family

ID=67180321

Family Applications (2)

Application Number Title Priority Date Filing Date
JP2019032763A Active JP6651662B2 (en) 2014-04-17 2019-02-26 Fraud detection electronic control unit and fraud detection method
JP2020008169A Active JP6864759B6 (en) 2014-04-17 2020-01-22 Fraud detection method and in-vehicle network system

Family Applications Before (1)

Application Number Title Priority Date Filing Date
JP2019032763A Active JP6651662B2 (en) 2014-04-17 2019-02-26 Fraud detection electronic control unit and fraud detection method

Country Status (1)

Country Link
JP (2) JP6651662B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7507205B2 (en) 2021-12-20 2024-06-27 本田技研工業株式会社 Communication monitoring device and communication monitoring method
JP2024073252A (en) * 2022-11-17 2024-05-29 株式会社オートネットワーク技術研究所 Relay device, illegal frame detection method, and in -vehicle device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003271205A (en) * 2002-03-14 2003-09-26 Omron Corp Programmable controller and peripheral unit
JP4093075B2 (en) * 2003-02-18 2008-05-28 住友電気工業株式会社 Incorrect data detection method and in-vehicle device
JP5522160B2 (en) * 2011-12-21 2014-06-18 トヨタ自動車株式会社 Vehicle network monitoring device
JP5651615B2 (en) * 2012-02-16 2015-01-14 日立オートモティブシステムズ株式会社 In-vehicle network system
JP5919205B2 (en) * 2013-01-28 2016-05-18 日立オートモティブシステムズ株式会社 Network device and data transmission / reception system

Also Published As

Publication number Publication date
JP6651662B2 (en) 2020-02-19
JP6864759B6 (en) 2021-06-23
JP2019110581A (en) 2019-07-04
JP2020061789A (en) 2020-04-16

Similar Documents

Publication Publication Date Title
JP6490058B2 (en) In-vehicle network system and fraud detection method
JP2020141411A (en) Fraud handling method, fraud detection electronic control unit, and network communication system
JP6679680B2 (en) In-vehicle network system, electronic control unit, and fraud countermeasure method
JP6864759B2 (en) Fraud detection method and in-vehicle network system
JP6698190B2 (en) Fraud handling method, fraud detection electronic control unit, and network communication system
JP6875576B2 (en) Fraud handling method
JP7490636B2 (en) Authentication method, authentication system, and authentication device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200122

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20210219

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210402

R150 Certificate of patent or registration of utility model

Ref document number: 6864759

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150