JP2020096368A - On-vehicle network system, electronic control unit, and fraud detection method - Google Patents
On-vehicle network system, electronic control unit, and fraud detection method Download PDFInfo
- Publication number
- JP2020096368A JP2020096368A JP2020032926A JP2020032926A JP2020096368A JP 2020096368 A JP2020096368 A JP 2020096368A JP 2020032926 A JP2020032926 A JP 2020032926A JP 2020032926 A JP2020032926 A JP 2020032926A JP 2020096368 A JP2020096368 A JP 2020096368A
- Authority
- JP
- Japan
- Prior art keywords
- data frame
- ecu
- event
- data
- vehicle
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Small-Scale Networks (AREA)
Abstract
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 systems in automobiles. A 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
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. A transmission node that transmits a frame transmits a value of "1" called recessive and a value of "0" called dominant by applying a voltage to the two buses to generate a potential difference between the buses. When a plurality of transmitting nodes transmit recessive and dominant at exactly the same timing, the dominant is preferentially transmitted. The receiving node transmits a frame called an error frame when the format of the received frame is abnormal. The error frame is a frame in which the transmitting node or another receiving node is notified of an abnormality in the frame by continuously transmitting dominant for 6 bits.
またCANでは送信先や送信元を指す識別子は存在せず、送信ノードはフレーム毎にメッセージIDと呼ばれるIDを付けて送信し(つまりバスに信号を送出し)、各受信ノードは予め定められたメッセージIDのみを受信する(つまりバスから信号を読み取る)。また、CSMA/CA(Carrier Sense Multiple Access/Collision Avoidance)方式を採用しており、複数ノードの同時送信時にはメッセージIDによる調停が行われ、メッセージIDの値が小さいフレームが優先的に送信される。 Also, in CAN, there is no identifier that indicates a destination or a source, the transmitting node attaches 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). In addition, a CSMA/CA (Carrier Sense Multiple Access/Collision Avoidance) method is adopted. When simultaneous transmission is performed by a plurality of nodes, arbitration is performed by the message ID, and a frame having a small message ID value is preferentially transmitted.
車載ネットワークにおいて不正なノードがバスに接続され、不正なノードが不正にデータフレームを送信した場合に、CANでは送信元の識別子が存在しないことから、不正なデータフレームが送信されていることを受信ノードは検知できない。 When an unauthorized node is connected to the bus in an in-vehicle network and the unauthorized node illegally transmits a data frame, the CAN does not have the sender identifier, so the reception of the illegal data frame is received. The node cannot be detected.
そこで従来、ECUが周期的にデータフレームを送信するという特徴を用いて、正常な周期から逸脱するようなデータフレームの送信を不正なデータフレームであると検知する技術が提案されている(「非特許文献2」参照)。またデータフレームが正規のECUから送信されていることを示すために、メッセージ認証コード(MAC:Message Authentication Code)の技術を用いた不正検知方法が提案されている(「非特許文献3」参照)。 Therefore, conventionally, there has been proposed a technique of detecting transmission of a data frame that deviates from a normal cycle as an invalid data frame by using the characteristic that the ECU periodically transmits the data frame (“non- See Patent Document 2). Further, in order to show that the data frame is transmitted from a legitimate ECU, a fraud detection method using a technique of a message authentication code (MAC) has been proposed (see “Non-patent document 3”). .
しかしながら、非特許文献2の技術では、ECUが周期的にデータフレームを送信するのに加えて、イベントをトリガに非周期的にデータフレーム(以下、非周期的に送信されるデータフレームを「イベントドリブンデータフレーム」と称する。)を送信することもある場合には、正当なイベントドリブンデータフレームを不正なデータフレームと誤検知してしまう。また、送信する全てのデータフレームにMACを付加する方法では、MACの付加及び検証に要する処理負荷が大きい。 However, in the technique of Non-Patent Document 2, in addition to the ECU periodically transmitting a data frame, an event triggers an aperiodic data frame (hereinafter, a data frame transmitted aperiodically is referred to as “event”). In some cases, a legitimate event-driven data frame is erroneously detected as an invalid data frame. Further, in the method of adding the MAC to all the data frames to be transmitted, the processing load required for adding and verifying the MAC is large.
そこで、本開示は、CANプロトコル等に従って通信する車載ネットワークシステムにおいて、バス上に不正なメッセージの送信が行われたことを効率的かつ適切に検知する電子制御ユニット(ECU)を提供する。また、本開示は、不正なメッセージを効率的かつ適切に検知するための不正検知方法、及び、ECUを備える車載ネットワークシステムを提供する。 Therefore, the present disclosure provides an electronic control unit (ECU) that efficiently and appropriately detects that an unauthorized message is transmitted on a bus in an in-vehicle network system that communicates according to the CAN protocol or the like. The present disclosure also provides a fraud detection method for efficiently and properly detecting fraudulent messages, and an in-vehicle network system including an ECU.
上記課題を解決するために本開示の一態様に係る不正検知方法は、車載ネットワークを介して通信する複数の電子制御ユニットを備える車載ネットワークシステムにおいて用いられる不正検知方法であって、前記車載ネットワーク上で送信されたデータフレームを受信する受信ステップと、前記受信ステップでイベントドリブンのデータフレームが受信され、かつ、前記車載ネットワークシステムを搭載する車両の状態が所定の状態である場合に限って、当該データフレーム中の所定位置のデータ値を検証する検証ステップとを含み、前記検証ステップで、前記所定位置のデータ値についての前記検証が成功したときには、当該データフレームを正当なデータフレームとして検知し、前記検証ステップで、前記所定位置のデータ値についての前記検証が失敗したときには、当該データフレームを不正なデータフレームとして検知し、前記予め設定された位置のデータ値は、前記データフレームのデータフィールド内の所定位置に配置されるカウンタ値であり、前記検証ステップでは、前記イベントドリブンの前記データフレーム中の前記所定位置のカウンタ値が、前記受信ステップで前記イベントドリブンのデータフレームが受信された回数を反映したカウンタ値と同一であるか否かを判別することにより前記検証を行う不正検知方法である。 In order to solve the above problems, a fraud detection method according to an 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 an in-vehicle network. In the receiving step of receiving the data frame transmitted in, and in the receiving step, the event-driven data frame is received, and only when the state of the vehicle equipped with the vehicle-mounted network system is a predetermined state, And a verification step of verifying a data value at a predetermined position in the data frame, in the verification step, when the verification of the data value at the predetermined position is successful, the data frame is detected as a valid data frame, When the verification of the data value at the predetermined position fails in the verification step, the data frame is detected as an invalid data frame, and the data value at the preset position is stored in the data field of the data frame. In the verification step, the counter value at the predetermined position in the event-driven data frame indicates the number of times the event-driven data frame is received in the receiving step. This is a fraud detection method for performing the verification by determining whether the counter value is the same as the reflected counter value.
また本開示の一態様に係る不正検知方法は、車載ネットワークを介して通信する複数の電子制御ユニットを備える車載ネットワークシステムにおいて不正検知の対象となるデータフレームを送信する不正検知方法であって、前記車載ネットワークシステムを搭載する車両の状態が所定の状態である場合に、イベントドリブンのデータフレームの送信するときに限って、当該データフレーム中の所定位置にデータ値を付与する付与ステップと、前記付与ステップで付与された所定位置にデータ値を含み前記イベントドリブンのデータフレームを前記車載ネットワークに送信する送信ステップとを含み、前記予め設定された位置のデータ値は、前記データフレームのデータフィールド内の所定位置に配置されるカウンタ値である不正検知方法である。 A fraud detection method according to an aspect of the present disclosure is a fraud detection method for transmitting a data frame that is a target of fraud detection in an in-vehicle network system including a plurality of electronic control units that communicate via an in-vehicle network. An assigning step of assigning a data value to a predetermined position in the data frame only when an event driven data frame is transmitted when the state of a vehicle equipped with an in-vehicle network system is in a predetermined state; A transmission step of transmitting the event-driven data frame to the in-vehicle network including a data value at a predetermined position given in step, and the data value at the preset position is within a data field of the data frame. This is a fraud detection method that is a counter value arranged at a predetermined position.
また、上記課題を解決するために本開示の一態様に係る車載ネットワークシステムは、車載ネットワークを介して通信する複数の電子制御ユニットを備える車載ネットワークシステムであって、前記車載ネットワークシステムを搭載する車両の状態が所定の状態である場合に、イベントドリブンのデータフレームの送信するときに限って当該データフレーム中の所定位置にデータ値を付与する付与部と、前記付与部で付与された前記データ値を含み前記イベントドリブンのデータフレームを前記車載ネットワークに送信する送信部とを有する第1電子制御ユニットと、前記車載ネットワーク上で送信されたデータフレームを受信する受信部と、前記受信部により前記イベントドリブンのデータフレームが受信され、かつ、前記車載ネットワークシステムを搭載する車両の状態が所定の状態である場合に限って、当該データフレーム中の所定位置のデータ値を検証する検証部とを有し、前記検証部は、前記所定位置のデータ値についての前記検証が成功したときには、当該データフレームを正当なデータフレームとして検知し、前記所定位置のデータ値についての前記検証が失敗したときには、当該データフレームを不正なデータフレームとして検知する第2電子制御ユニットとを備え、前記予め設定された位置のデータ値は、前記データフレームのデータフィールド内の所定位置に配置されるカウンタ値であり、前記第2電子制御ユニットは、前記イベントドリブンの前記データフレーム中の前記所定位置のカウンタ値が、前記受信ステップで前記イベントドリブンのデータフレームが受信された回数を反映したカウンタ値と同一であるか否かを判別することにより前記検証を行う車載ネットワークシステムである。 In order to solve the above problems, an in-vehicle network system according to an aspect of the present disclosure is an in-vehicle network system including a plurality of electronic control units that communicate via an in-vehicle network, and a vehicle equipped with the in-vehicle network system. When the state of is a predetermined state, only when transmitting an event-driven data frame, an assigning unit that assigns a data value to a predetermined position in the data frame, and the data value assigned by the assigning unit A first electronic control unit having a transmitter for transmitting the event-driven data frame to the vehicle-mounted network, a receiver for receiving the data frame transmitted on the vehicle-mounted network, and the event by the receiver. Only when a driven data frame is received and the vehicle equipped with the in-vehicle network system is in a predetermined state, a verification unit for verifying a data value at a predetermined position in the data frame is provided. When the verification of the data value at the predetermined position is successful, the verification unit detects the data frame as a valid data frame, and when the verification of the data value at the predetermined position fails, the data is detected. A second electronic control unit for detecting the frame as an invalid data frame, wherein the data value at the preset position is a counter value arranged at a predetermined position in the data field of the data frame, (2) The electronic control unit determines whether the counter value at the predetermined position in the event-driven data frame is the same as the counter value that reflects the number of times the event-driven data frame is received in the receiving step. It is an in-vehicle network system that performs the verification by determining
また、上記課題を解決するために本開示の一態様に係る電子制御ユニット(ECU)は、車載ネットワークを介して通信する電子制御ユニットであって、前記電子制御ユニットを含む車載ネットワークシステムを搭載する車両の状態が所定の状態である場合に、イベントドリブンのデータフレームの送信に際して当該データフレーム中の所定位置にデータ値を付与する付与部と、前記付与部で付与された前記所定位置のデータ値を含み前記イベントドリブンのデータフレームを前記車載ネットワークに送信する送信部とを備え、前記予め設定された位置のデータ値は、前記データフレームのデータフィールド内の所定位置に配置されるカウンタ値である電子制御ユニットである。 In order to solve the above problems, an electronic control unit (ECU) according to one aspect of the present disclosure is an electronic control unit that communicates via an in-vehicle network, and is equipped with an in-vehicle network system including the electronic control unit. When the state of the vehicle is in a predetermined state, when the event-driven data frame is transmitted, a giving unit that gives a data value to a given position in the data frame, and a data value of the given position given by the giving unit And a transmitter for transmitting the event-driven data frame to the vehicle-mounted network, wherein the data value at the preset position is a counter value arranged at a predetermined position in the data field of the data frame. It is an electronic control unit.
また本開示の一態様に係る電子制御ユニット(ECU)は、車載ネットワークを介して通信する電子制御ユニットであって、前記車載ネットワーク上で送信されたデータフレームを受信する受信部と、前記受信部によりイベントドリブンのデータフレームが受信され、かつ、前記電子制御ユニットを含む車載ネットワークシステムを搭載する車両の状態が所定の状態である場合に限って、当該データフレーム中の所定位置のデータ値を検証する検証部とを備え、前記検証部は、前記所定位置のデータ値についての前記検証が成功したときには、当該データフレームを正当なデータフレームとして検知し、前記所定位置のデータ値についての前記検証が失敗したときには、当該データフレームを不正なデータフレームとして検知し、前記予め設定された位置のデータ値は、前記データフレームのデータフィールド内の所定位置に配置されるカウンタ値であり、前記検証部は、前記イベントドリブンの前記データフレーム中の前記所定位置のカウンタ値が、前記受信ステップで前記イベントドリブンのデータフレームが受信された回数を反映したカウンタ値と同一であるか否かを判別することにより前記検証を行う電子制御ユニットである。 An electronic control unit (ECU) according to an aspect of the present disclosure is an electronic control unit that communicates via an in-vehicle network, the receiving unit receiving a data frame transmitted on the in-vehicle network, and the receiving unit. Only when the event-driven data frame is received by and the vehicle equipped with the in-vehicle network system including the electronic control unit is in the predetermined state, the data value at the predetermined position in the data frame is verified. When the verification of the data value of the predetermined position is successful, the verification unit detects the data frame as a valid data frame, and the verification of the data value of the predetermined position is performed. When it fails, the data frame is detected as an invalid data frame, and the data value at the preset position is a counter value arranged at a predetermined position in the data field of the data frame, and the verification unit is By determining whether or not the counter value at the predetermined position in the event-driven data frame is the same as the counter value that reflects the number of times the event-driven data frame is received in the receiving step. It is an electronic control unit that performs the verification.
本開示によれば、車載ネットワークシステムでバスに不正なノードが接続されて不正なデータフレームが送信された場合に効率的かつ適切にその検知が可能となる。 According to the present disclosure, when an unauthorized node is connected to a bus in an in-vehicle network system and an unauthorized data frame is transmitted, it can be detected efficiently and appropriately.
本開示の一態様に係る不正検知方法は、車載ネットワークを介して通信する複数の電子制御ユニットを備える車載ネットワークシステムにおいて用いられる不正検知方法であって、前記車載ネットワーク上で送信されたデータフレームを受信する受信ステップと、前記受信ステップでイベントドリブンのデータフレームが受信され、かつ、前記車載ネットワークシステムを搭載する車両の状態が所定の状態である場合に限って、当該データフレーム中の所定位置のデータ値を検証する検証ステップとを含み、前記検証ステップで、前記所定位置のデータ値についての前記検証が成功したときには、当該データフレームを正当なデータフレームとして検知し、前記検証ステップで、前記所定位置のデータ値についての前記検証が失敗したときには、当該データフレームを不正なデータフレームとして検知し、前記予め設定された位置のデータ値は、前記データフレームのデータフィールド内の所定位置に配置されるカウンタ値であり、前記検証ステップでは、前記イベントドリブンの前記データフレーム中の前記所定位置のカウンタ値が、前記受信ステップで前記イベントドリブンのデータフレームが受信された回数を反映したカウンタ値と同一であるか否かを判別することにより前記検証を行う不正検知方法である。このため、イベントドリブンのデータフレームであるため不正であると誤検知することが防止され、不正なデータフレーム(メッセージ)を適切に検知することが可能となる。また、このイベントドリブンのデータフレームのデータフィールド内の所定位置に配置されるカウンタ値の検証により不正なメッセージは検知可能となるため、全てのデータフレームについてその検証をする必要がなく、効率的な不正の検知が可能となる。なお、効率的な不正の検知は、車載ネットワークシステムの電力消費の抑制に繋がる。所定の状態は、例えば、不正なデータフレームがバス上に流れている場合に検知されるべき必要性が、所定の状態以外の状態よりも高いと想定される状態である。これにより、例えば不正検知の必要性が高いとき等といった車両が所定の状態である場合に効率的に検証を行うことが可能となる。また、データフレームを受信するECUにとっては、例えば不正検知の必要性が高いとき等の所定の状態である場合に限って効率的に検証を行うことが可能となる。 A fraud detection method according to an 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 an in-vehicle network, wherein a data frame transmitted on the in-vehicle network is Only when the receiving step of receiving and the event-driven data frame are received in the receiving step and the state of the vehicle equipped with the vehicle-mounted network system is in a predetermined state, A verification step of verifying a data value, wherein when the verification of the data value at the predetermined position is successful in the verification step, the data frame is detected as a valid data frame, and the predetermined step is performed in the verification step. When the verification of the data value of the position fails, the data frame is detected as an invalid data frame, and the data value of the preset position is arranged at a predetermined position in the data field of the data frame. In the verification step, the counter value at the predetermined position in the event-driven data frame is the same as the counter value that reflects the number of times the event-driven data frame is received in the receiving step. It is a fraud detection method for performing the verification by determining whether or not there is. For this reason, since the data frame is an event-driven data frame, it is prevented from being erroneously detected as illegal, and it is possible to properly detect an illegal data frame (message). Also, since an invalid message can be detected by verifying the counter value arranged at a predetermined position in the data field of this event-driven data frame, it is not necessary to verify it for all data frames, which is efficient. It is possible to detect fraud. Efficient fraud detection leads to suppression of power consumption of the vehicle-mounted network system. The predetermined state is, for example, a state in which it is assumed that the necessity to be detected when an illegal data frame is flowing on the bus is higher than the states other than the predetermined state. This makes it possible to efficiently perform verification when the vehicle is in a predetermined state, such as when there is a high need for fraud detection. Further, for the ECU that receives the data frame, the verification can be efficiently performed only when the ECU is in a predetermined state such as when the need for fraud detection is high.
また、前記検証ステップでは、前記受信したデータフレームが、イベントドリブンのデータフレームか否かを判定し、前記受信したデータフレームが前記イベントドリブンのデータフレームであると判定された場合に、前記車両の状態が前記所定の状態であるか否かを判定し、前記車両の状態が前記所定の状態であると判定された場合に、前記所定位置のデータ値についての前記検証を行っても良い。また、前記検証ステップで、前記受信ステップで前記イベントドリブンのデータフレームが受信され、かつ、前記車載ネットワークシステムを搭載する車両の状態が前記所定の状態でない場合は、当該データフレームを正当なデータフレームとして検知することとしても良い。また、前記検証ステップで、前記受信ステップで前記イベントドリブンのデータフレームが受信され、かつ、前記車載ネットワークシステムを搭載する車両の状態が前記所定の状態でない場合は、当該データフレームを不正なデータフレームとして検知することとしても良い。不正なデータフレームとして検知された場合の取り扱いは車載ネットワークシステムにおいて定めておくことができ、取り扱いとしては、例えば、データフレームを破棄すること(データフレームの内容に基づいて車両の制御を行わないこと等)、ログとして記録すること、車両の動作モードを変更すること等が挙げられる。所定の状態は、例えば、不正なデータフレームがバス上に流れている場合に検知されるべき必要性が、所定の状態以外の状態よりも高いと想定される状態である。これにより、例えば不正検知の必要性が高いとき等といった車両が所定の状態である場合に効率的に検証を行うことが可能となる。 Further, in the verification step, it is determined whether or not the received data frame is an event-driven data frame, and when it is determined that the received data frame is the event-driven data frame, It may be determined whether or not the state is the predetermined state, and when the state of the vehicle is determined to be the predetermined state, the verification of the data value at the predetermined position may be performed. In the verification step, if the event-driven data frame is received in the reception step and the vehicle equipped with the in-vehicle network system is not in the predetermined state, the data frame is a valid data frame. May be detected as. In the verification step, if the event-driven data frame is received in the reception step and the vehicle equipped with the in-vehicle network system is not in the predetermined state, the data frame is an invalid data frame. May be detected as. The handling when it is detected as an invalid data frame can be defined in the in-vehicle network system. For example, discard the data frame (do not control the vehicle based on the content of the data frame). Etc.), recording as a log, changing the operation mode of the vehicle, and the like. The predetermined state is, for example, a state in which it is assumed that the necessity to be detected when an illegal data frame is flowing on the bus is higher than the states other than the predetermined state. This makes it possible to efficiently perform verification when the vehicle is in a predetermined state, such as when there is a high need for fraud detection.
また、前記複数の電子制御ユニットは、CAN(Controller Area Network)プロトコルに従って通信を行うものであっても良い。 Further, the plurality of electronic control units may communicate according to a CAN (Controller Area Network) protocol.
また本開示の一態様に係る不正検知方法は、車載ネットワークを介して通信する複数の電子制御ユニットを備える車載ネットワークシステムにおいて不正検知の対象となるデータフレームを送信する不正検知方法であって、前記車載ネットワークシステムを搭載する車両の状態が所定の状態である場合に、イベントドリブンのデータフレームの送信するときに限って、当該データフレーム中の所定位置にデータ値を付与する付与ステップと、前記付与ステップで付与された所定位置のデータ値を含み前記イベントドリブンのデータフレームを前記車載ネットワークに送信する送信ステップとを含み、前記予め設定された位置のデータ値は、前記データフレームのデータフィールド内の所定位置に配置されるカウンタ値である不正検知方法である。これにより、イベントドリブンのデータフレームの受信側において当該データフレームのデータフィールド内の所定位置に配置されるカウンタ値を検証することで不正なデータフレームか否かの検知が可能となるように、車載ネットワークシステムを正規に構成する送信側のECUでカウンタ値を含めたイベントドリブンのデータフレームを送信する。このため、付与ステップと送信ステップとにより適切な不正検知が実現される。また、データフレームを受信するECUにとっては、例えば不正検知の必要性が高いとき等の所定の状態である場合に限って効率的に検証を行うことが可能となる。 A fraud detection method according to an aspect of the present disclosure is a fraud detection method for transmitting a data frame that is a target of fraud detection in an in-vehicle network system including a plurality of electronic control units that communicate via an in-vehicle network. An assigning step of assigning a data value to a predetermined position in the data frame only when an event driven data frame is transmitted when the state of a vehicle equipped with an in-vehicle network system is in a predetermined state; And a transmission step of transmitting the event-driven data frame including the data value of the predetermined position given in step to the in-vehicle network, wherein the data value of the preset position is within the data field of the data frame. This is a fraud detection method that is a counter value arranged at a predetermined position. As a result, on the receiving side of the event-driven data frame, it is possible to detect whether the data frame is an illegal one by verifying the counter value arranged at a predetermined position in the data field of the data frame. An event-driven data frame including a counter value is transmitted by an ECU on the transmission side that normally forms a network system. Therefore, appropriate fraud detection is realized by the giving step and the sending step. Further, for the ECU that receives the data frame, the verification can be efficiently performed only when the ECU is in a predetermined state such as when the need for fraud detection is high.
また、上記課題を解決するために本開示の一態様に係る車載ネットワークシステムは、車載ネットワークを介して通信する複数の電子制御ユニットを備える車載ネットワークシステムであって、前記車載ネットワークシステムを搭載する車両の状態が所定の状態である場合に、イベントドリブンのデータフレームの送信するときに限って当該データフレーム中の所定位置にデータ値を付与する付与部と、前記付与部で付与された前記データ値を含み前記イベントドリブンのデータフレームを前記車載ネットワークに送信する送信部とを有する第1電子制御ユニットと、前記車載ネットワーク上で送信されたデータフレームを受信する受信部と、前記受信部により前記イベントドリブンのデータフレームが受信され、かつ、前記車載ネットワークシステムを搭載する車両の状態が所定の状態である場合に限って、当該データフレーム中の所定位置のデータ値を検証する検証部とを有し、前記検証部は、前記所定位置のデータ値についての前記検証が成功したときには、当該データフレームを正当なデータフレームとして検知し、前記所定位置のデータ値についての前記検証が失敗したときには、当該データフレームを不正なデータフレームとして検知する第2電子制御ユニットとを備え、前記予め設定された位置のデータ値は、前記データフレームのデータフィールド内の所定位置に配置されるカウンタ値であり、前記第2電子制御ユニットは、前記イベントドリブンの前記データフレーム中の前記所定位置のカウンタ値が、前記受信ステップで前記イベントドリブンのデータフレームが受信された回数を反映したカウンタ値と同一であるか否かを判別することにより前記検証を行う車載ネットワークシステムである。これにより、送信周期が条件を満たさないデータフレームつまりイベントドリブンデータフレームが受信された場合において所定ルールに基づく正当性の判断はできないがデータフィールド内の所定位置に配置されるカウンタ値の検証により正当性の判断が可能になる。このため、所定ルールを満たさないため不正であると誤検知することが防止され、不正なデータフレーム(メッセージ)を適切に検知することが可能となる。また、データフレームを受信するECUにとっては、例えば不正検知の必要性が高いとき等の所定の状態である場合に限って効率的に検証を行うことが可能となる。 In order to solve the above problems, an in-vehicle network system according to an aspect of the present disclosure is an in-vehicle network system including a plurality of electronic control units that communicate via an in-vehicle network, and a vehicle equipped with the in-vehicle network system. When the state of is a predetermined state, only when transmitting an event-driven data frame, an assigning unit that assigns a data value to a predetermined position in the data frame, and the data value assigned by the assigning unit A first electronic control unit having a transmitter for transmitting the event-driven data frame to the vehicle-mounted network, a receiver for receiving the data frame transmitted on the vehicle-mounted network, and the event by the receiver. Only when a driven data frame is received and the vehicle equipped with the in-vehicle network system is in a predetermined state, a verification unit for verifying a data value at a predetermined position in the data frame is provided. When the verification of the data value at the predetermined position is successful, the verification unit detects the data frame as a valid data frame, and when the verification of the data value at the predetermined position fails, the data is detected. A second electronic control unit for detecting the frame as an invalid data frame, wherein the data value at the preset position is a counter value arranged at a predetermined position in the data field of the data frame, (2) The electronic control unit determines whether the counter value at the predetermined position in the event-driven data frame is the same as the counter value that reflects the number of times the event-driven data frame is received in the receiving step. It is an in-vehicle network system that performs the verification by determining As a result, when a data frame whose transmission cycle does not satisfy the condition, that is, an event-driven data frame is received, it is not possible to judge the validity based on a predetermined rule, but it is valid by verifying the counter value arranged at a predetermined position in the data field. It becomes possible to judge the sex. Therefore, since the predetermined rule is not satisfied, false detection of fraud is prevented, and fraudulent data frame (message) can be properly detected. Further, for the ECU that receives the data frame, the verification can be efficiently performed only when the ECU is in a predetermined state such as when the need for fraud detection is high.
また、上記課題を解決するために本開示の一態様に係る電子制御ユニット(ECU)は、車載ネットワークを介して通信する電子制御ユニットであって、前記電子制御ユニットを含む車載ネットワークシステムを搭載する車両の状態が所定の状態である場合に、イベントドリブンのデータフレームの送信に際して当該データフレーム中の所定位置にデータ値を付与する付与部と、前記付与部で付与された前記所定位置のデータ値を含み前記イベントドリブンのデータフレームを前記車載ネットワークに送信する送信部とを備え、前記予め設定された位置のデータ値は、前記データフレームのデータフィールド内の所定位置に配置されるカウンタ値である電子制御ユニットである。これにより、送信周期が条件を満たさないデータフレームつまりイベントドリブンデータフレームを送信する場合に、不正であると誤検知されないようにデータフレームを送信することが可能となる。 In order to solve the above problems, an electronic control unit (ECU) according to one aspect of the present disclosure is an electronic control unit that communicates via an in-vehicle network, and is equipped with an in-vehicle network system including the electronic control unit. When the state of the vehicle is in a predetermined state, when the event-driven data frame is transmitted, a giving unit that gives a data value to a given position in the data frame, and a data value of the given position given by the giving unit And a transmitter for transmitting the event-driven data frame to the vehicle-mounted network, wherein the data value at the preset position is a counter value arranged at a predetermined position in the data field of the data frame. It is an electronic control unit. As a result, when a data frame whose transmission cycle does not satisfy the condition, that is, an event driven data frame is transmitted, it is possible to transmit the data frame so as not to be erroneously detected as invalid.
また本開示の一態様に係る電子制御ユニット(ECU)は、車載ネットワークを介して通信する電子制御ユニットであって、前記車載ネットワーク上で送信されたデータフレームを受信する受信部と、前記受信部によりイベントドリブンのデータフレームが受信され、かつ、前記電子制御ユニットを含む車載ネットワークシステムを搭載する車両の状態が所定の状態である場合に限って、当該データフレーム中の所定位置のデータ値を検証する検証部とを備え、前記検証部は、前記所定位置のデータ値についての前記検証が成功したときには、当該データフレームを正当なデータフレームとして検知し、前記所定位置のデータ値についての前記検証が失敗したときには、当該データフレームを不正なデータフレームとして検知し、前記予め設定された位置のデータ値は、前記データフレームのデータフィールド内の所定位置に配置されるカウンタ値であり、前記検証部は、前記イベントドリブンの前記データフレーム中の前記所定位置のカウンタ値が、前記受信ステップで前記イベントドリブンのデータフレームが受信された回数を反映したカウンタ値と同一であるか否かを判別することにより前記検証を行う電子制御ユニットである。これにより、送信周期が条件を満たさないデータフレームつまりイベントドリブンデータフレームが受信された場合において所定ルールに基づく正当性の判断はできないがデータフィールド内の所定位置に配置されるカウンタ値の検証により正当性の判断が可能になる。このため、所定ルールを満たさないため不正であると誤検知することが防止され、不正なデータフレームを適切に検知することが可能となる。また、データフレームを受信するECUにとっては、例えば不正検知の必要性が高いとき等の所定の状態である場合に限って効率的に検証を行うことが可能となる。 An electronic control unit (ECU) according to an aspect of the present disclosure is an electronic control unit that communicates via an in-vehicle network, the receiving unit receiving a data frame transmitted on the in-vehicle network, and the receiving unit. Only when the event-driven data frame is received by and the vehicle equipped with the in-vehicle network system including the electronic control unit is in the predetermined state, the data value at the predetermined position in the data frame is verified. When the verification of the data value of the predetermined position is successful, the verification unit detects the data frame as a valid data frame, and the verification of the data value of the predetermined position is performed. When it fails, the data frame is detected as an invalid data frame, and the data value at the preset position is a counter value arranged at a predetermined position in the data field of the data frame, and the verification unit is By determining whether or not the counter value at the predetermined position in the event-driven data frame is the same as the counter value that reflects the number of times the event-driven data frame is received in the receiving step. It is an electronic control unit that performs the verification. As a result, when a data frame whose transmission cycle does not satisfy the condition, that is, an event-driven data frame is received, it is not possible to judge the validity based on a predetermined rule, but it is valid by verifying the counter value arranged at a predetermined position in the data field. It becomes possible to judge the sex. Therefore, since the predetermined rule is not satisfied, false detection of fraud is prevented, and fraudulent data frame can be properly detected. Further, for the ECU that receives the data frame, the verification can be efficiently performed only when the ECU is in a predetermined state such as when the need for fraud detection is high.
なお、これらの全般的又は具体的な態様は、システム、方法、集積回路、コンピュータプログラム又はコンピュータで読み取り可能なCD−ROM等の記録媒体で実現されても良く、システム、方法、集積回路、コンピュータプログラム又は記録媒体の任意な組み合わせで実現されても良い。 Note that these general or specific aspects may be realized by a recording medium such as a system, a method, an integrated circuit, a computer program or a computer-readable CD-ROM, and the system, the method, the integrated circuit, the computer. It may be realized by any combination of programs or recording media.
以下、実施の形態に係る車載ネットワークシステム、ECU等について、図面を参照しながら説明する。ここで示す実施の形態は、いずれも本開示の一具体例を示すものである。従って、以下の実施の形態で示される数値、形状、材料、構成要素、構成要素の配置及び接続形態、並びに、ステップ(工程)及びステップの順序等は、一例であって本開示を限定するものではない。以下の実施の形態における構成要素のうち、独立請求項に記載されていない構成要素については、任意に付加可能な構成要素である。また、各図は、模式図であり、必ずしも厳密に図示されたものではない。 Hereinafter, an in-vehicle network system, an ECU, and the like according to the embodiments will be described with reference to the drawings. Each of the embodiments shown here shows one specific example of the present disclosure. Therefore, the numerical values, shapes, materials, components, arrangements and connection forms of the components, steps (processes), the order of steps, and the like shown in the following embodiments are examples and limit the present disclosure. is not. Among the constituents in the following embodiments, constituents not described in the independent claims are constituents that can be added arbitrarily. In addition, each drawing is a schematic view and is not necessarily strictly illustrated.
(実施の形態1)
以下、本開示の実施の形態として、データフレームを送受信するECU100aとECU100bとの間で、周期的に送信されるデータフレームに加えて非周期的なイベントドリブンデータフレームが送信され得る前提の下で、不正なデータフレームが送信されたことを適切に検知するための不正検知方法を実現する車載ネットワークシステム10について図面を用いて説明する。
(Embodiment 1)
Hereinafter, as an embodiment of the present disclosure, under the assumption that an aperiodic event-driven data frame can be transmitted in addition to the periodically transmitted data frame between the
[1.1 車載ネットワークシステム10の全体構成]
図1は、実施の形態1に係る車載ネットワークシステム10の全体構成を示す図である。車載ネットワークシステム10は、CANプロトコルに従って通信するネットワーク通信システムの一例であり、制御装置、センサ等の各種機器が搭載された自動車におけるネットワーク通信システムである。車載ネットワークシステム10は、各種機器に接続されたECU100a、100b、及び、各ECUをつなぐバス200を含んで構成される。なお、図1では省略しているものの、車載ネットワークシステム10にはECU100a、100b以外にもいくつものECUが含まれ得るが、ここでは、便宜上ECU100a、100bに注目して説明を行う。ECUは、例えば、プロセッサ(マイクロプロセッサ)、メモリ等のデジタル回路、アナログ回路、通信回路等を含む装置である。メモリは、ROM、RAM等であり、プロセッサにより実行される制御プログラム(コンピュータプログラム)を記憶することができる。例えばプロセッサが、制御プログラム(コンピュータプログラム)に従って動作することにより、ECUは各種機能を実現することになる。なお、コンピュータプログラムは、所定の機能を達成するために、プロセッサに対する指令を示す命令コードが複数個組み合わされて構成されたものである。以下、バス200には不正なデータフレームを送信する不正なECUが接続されている可能性があることを前提として説明する。
[1.1 Overall Configuration of In-Vehicle Network System 10]
FIG. 1 is a diagram showing an overall configuration of an in-
ECU100aは、1つ以上のセンサを含む機器の一例としてのパワーウィンドウスイッチ110に接続されている。ECU100aは、パワーウィンドウスイッチ110の状態を示す情報を含むデータフレームを周期的にバス200に送信する。さらにパワーウィンドウスイッチ110の状態が変化した時にもパワーウィンドウスイッチ110の状態を示す情報(つまりセンサ値を示す情報)を含むデータフレームをバス200に送信する。従って、ECU100aは、一定の送信周期でデータフレームの送信を繰り返す他に、パワーウィンドウスイッチ110の状態の変化時がその送信周期と一致しないときに非周期的なイベントドリブンデータフレームをバス200に送信することになる。またECU100aは、ECU100bからバス200上に送信されてバス200に流れるデータフレームを受信し、例えばECU100aが送信したデータフレームが正しく受信されていること等を確認する。
The
ECU100bは、パワーウィンドウ120に接続されており、ECU100aから送信されバス200に流れているデータフレームを受信し、そのデータフレームに含まれるパワーウィンドウスイッチ110の状態に応じて、パワーウィンドウ120の開閉の制御を行う。またパワーウィンドウ120の開閉の制御状態に応じたデータフレームを周期的にバス200に送信する。この車載ネットワークシステム10においてはCANプロトコルに従って各ECUがフレームの授受を行う。各ECUは、受信したデータフレームが不正なデータフレームであるか否かを判断する機能を有している。
The
[1.2 データフレームフォーマット]
以下、CANプロトコルに従ったネットワークで用いられるフレームの1つであるデータフレームについて説明する。
[1.2 Data frame format]
Hereinafter, a data frame which is one of the frames used in the 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 format of a data frame defined by the CAN protocol. The figure shows a data frame in a standard ID format defined by the CAN protocol. The data frame includes an SOF (Start Of Frame), an ID field, an RTR (Remote Transmission Request), an IDE (Identifier Extension), a reserved bit “r”, a DLC (Data Length Code), a data field, and a CRC (Cyclic Redundancy Check) sequence. , CRC delimiter “DEL”, ACK (Acknowledgement) slot, ACK delimiter “DEL”, and EOF (End Of Frame).
SOFは、1bitのドミナントで構成される。バスがアイドルの状態はレセシブになっており、SOFによりドミナントへ変更することでフレームの送信開始を通知する。 The SOF is composed of 1-bit dominant. The state in which the bus is idle is recessive, and the start of frame transmission is notified by changing to dominant by SOF.
IDフィールドは、11bitで構成される、データの種類を示す値であるID(メッセージID)を格納するフィールドである。複数のノードが同時に送信を開始した場合、このIDフィールドで通信調停を行うために、IDが小さい値を持つフレームが高い優先度となるよう設計されている。 The ID field is a field configured with 11 bits and storing an ID (message ID) that is a value indicating the type of data. When a plurality of nodes start transmission at the same time, communication is arbitrated in this ID field, so that a frame having a small ID has a high priority.
RTRは、データフレームとリモートフレームとを識別するための値であり、データフレームにおいてはドミナント1bitで構成される。 The RTR is a value for identifying the data frame and the remote frame, and is composed of 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 the data to be transmitted, which is composed of a maximum of 64 bits. The length can be adjusted every 8 bits. The specifications of the data to be sent are not defined by the CAN protocol, but are defined by the vehicle-mounted
CRCシーケンスは、15bitで構成される。SOF、IDフィールド、コントロールフィールド及びデータフィールドの送信値より算出される。 The CRC sequence is composed 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 that represents the end of a CRC sequence composed of 1-bit recessive. The CRC sequence and the 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 transmits by making the ACK slot recessive. If the reception node has successfully received the CRC sequence, it transmits the ACK slot as a dominant. Since dominant is given priority over recessive, if the ACK slot is dominant after transmission, the transmitting node can confirm that any of the receiving nodes has succeeded in receiving.
ACKデリミタは、1bitのレセシブで構成されるACKの終了を表す区切り記号である。 The ACK delimiter is a delimiter that represents the end of ACK and is composed of 1-bit recessive.
EOFは、7bitのレセシブで構成されており、データフレームの終了を示す。 The EOF is composed of 7-bit recessive and indicates the end of the data frame.
[1.3 データフィールドフォーマット]
以下、車載ネットワークシステム10で用いられるデータフレームにおけるデータフィールドについて説明する。
[1.3 Data field format]
Hereinafter, the data field in the data frame used in the vehicle-mounted
図3は、車載ネットワークシステムで用いられるデータフィールドフォーマットの一例を示す図である。同図に示すように、データフィールドの最上位ビット「I」(先頭の1ビット)は、このデータフィールドを含むデータフレームが、イベントドリブンデータフレームであるか否かを識別するための識別フラグ(「イベントドリブン識別フラグ」と称する。)である。イベントドリブン識別フラグIは、周期的に送信されるデータフレームにおいては0がセットされ、イベントドリブンデータフレームにおいては1がセットされる。イベントドリブン識別フラグIに後続するデータ領域には、ECUが機器等から取得したセンサ値を示すデータ(ECU100aが送信するデータフレームにおいては例えばパワーウィンドウスイッチ110の状態を示す値等)が含まれる。図3の例では最上位ビットをイベントドリブン識別フラグIとしているが、イベントドリブン識別フラグIを、データフィールド内における最下位ビット等の任意の箇所に設けても良い。
FIG. 3 is a diagram showing an example of a data field format used in the vehicle-mounted network system. As shown in the figure, the most significant bit “I” (first 1 bit) of the data field is an identification flag (for identifying whether or not the data frame including this data field is an event driven data frame). It is referred to as an "event driven identification flag"). The event-driven identification flag I is set to 0 in a data frame that is periodically transmitted, and is set to 1 in an event-driven data frame. The data area subsequent to the event driven identification flag I includes data indicating a sensor value acquired by the ECU from a device or the like (for example, a value indicating the state of the
[1.4 ECU100aの構成]
図4は、ECU100aの構成図である。ECU100aは、データフレーム送受信部101と、データフレーム生成部102と、データフレーム生成ルール保持部103と、不正データフレーム判断部104と、受信データフレーム周期保持部105と、データフレーム受信履歴保持部106と、データフレーム処理部107と、タイマ108と、センサ値取得部109とを含んで構成される。これらの各構成要素は、機能的な構成要素であり、その各機能は、ECU100aにおける通信回路、メモリに格納された制御プログラムを実行するプロセッサ或いはデジタル回路等により実現される。なお、ECU100bもECU100aと基本的に同様の構成を備える。但し、データフレーム生成ルール保持部103及び受信データフレーム周期保持部105及びデータフレーム受信履歴保持部106の各保持内容はECU毎に異なる内容となり得る。また、データフレーム処理部107の処理内容は、ECU毎に異なる。
[1.4 Configuration of
FIG. 4 is a configuration diagram of the
データフレーム送受信部101は、バス200に流れるデータフレームを受信し、CANプロトコルに従ってデータフレームを解釈する。受信したデータフレームにおけるIDフィールドの内容であるID(メッセージID)が、自機(ECU100a)が受信するように予め定められているメッセージIDである場合は、データフレームの内容を不正データフレーム判断部104へ通知する。また、データフレーム送受信部101は、データフレーム生成部102から通知されたデータフレームをCANプロトコルに従ってバス200へ送信する。
The data frame transmitting/receiving
データフレーム生成部102は、データフレーム生成ルール保持部103に格納されたデータフレーム生成ルールに従い、データフレームを生成し、データフレーム送受信部101に通知する。データフレーム生成部102は、タイマ108から現在時刻を取得する。更にデータフレーム生成部102は、ECU100aに接続された機器(パワーウィンドウスイッチ110)に関するデータ(センサ値)をセンサ値取得部109から取得する。ECU100aからデータフレームを周期的に送信すべく、データフレーム生成部102は、現在時刻とデータフレーム生成ルール保持部103に格納される送信周期とによって、データフレームを生成するタイミングを決定し、データフレームの生成を周期的に行う。なお、データフレーム生成部102によりデータフレームが生成されると、そのデータフレームはデータフレーム送受信部101に通知され、データフレーム送受信部101はそのデータフレームの送信を行う。更に、データフレーム生成部102は、センサ値取得部109から取得されるセンサ値に変化があった時が、前述した周期的なタイミングとは異なる時である場合(例えば周期的なタイミングの許容範囲を示すマージンの範囲外である場合)には、イベントドリブンデータフレームの生成を行う。即ち、データフレーム生成部102は、送信周期を示すデータフレーム生成ルールに適合しないタイミングでデータフレームの送信をする際においてデータフレーム中にイベントドリブン識別フラグという特定識別子を付与したデータフレームを生成する、言わば付与部として働く。センサ値取得部109はセンサ(パワーウィンドウスイッチ110)からセンサ値に変更があった場合及び変更がない場合に随時センサ値を取得する方式で動作しても、センサ値に変更があった場合にのみセンサから供給されるセンサ値を取得する方式で動作しても良い。データフレーム生成部102は、センサ値取得部109が最後にセンサから取得したセンサ値をデータフィールドに格納したデータフレームを周期的に生成する他、前回のセンサ値から変化があったセンサ値を含むイベントドリブンデータフレームを生成することになる。なお、周期的にデータフレームを生成するタイミングにおいては、前回のセンサ値から変化がなく同じセンサ値を含むデータフレームを生成する可能性と、前回のセンサ値から変化があったセンサ値を含むデータフレームを生成する可能性とがある。また、その周期的なタイミングではないタイミングで生成されるイベントドリブンデータフレームは、前回のセンサ値から変化があったセンサ値を含むデータフレームである。従って、データフレーム送受信部101によりECU100aからバス200に、周期的にデータフレームが送信され、更に、非周期的にイベントドリブンデータフレームが送信される。即ち、データフレーム送受信部101は、バス200上で送信されたデータフレームを受信する受信部としての機能の他に、特定識別子を含み送信周期を示すデータフレーム生成ルールに適合しないデータフレームであるイベントドリブンデータフレームをバス200により他のECUに送信する、言わば送信部としての機能等を含む。
The data
データフレーム生成ルール保持部103は、メモリ等の記憶媒体で実現され、データフレーム生成ルールとして、自機(ECU100a)が送信するメッセージID毎に周期的にデータフレームを送信するための送信周期を格納している。図5は、データフレーム生成ルール保持部103に格納されたデータフレーム生成ルールの一例を示す図である。ここでは、ECU100aは、パワーウィンドウスイッチ110の状態を示すデータフレーム等、複数種類のデータフレーム(種類毎にメッセージIDで識別されるデータフレーム)を送信するものとする。図5の例は、ECU100aから周期的に送信されるメッセージIDが0x100のデータフレームの送信周期は、50msであり、メッセージIDが0x200のデータフレームの送信周期は、100msであり、メッセージIDが0x300のデータフレームの送信周期は、300msであることを示している。
The data frame generation
不正データフレーム判断部104は、受信したデータフレームが正当なデータフレームであるか(不正なデータフレームでないか)否かについて判断する。即ち、不正データフレーム判断部104は、データフレーム送受信部101から通知されたデータフレームについて、受信データフレーム周期保持部105の周期ルール情報(後述)を参照して、メッセージID毎に予め定められた送信周期の条件を満たすか否かを確認し、送信周期の条件を満たす場合には正規のECUから送信されたデータフレーム(正当なデータフレーム)であると判断する。また、送信周期の条件を満たさないデータフレームであっても、イベントドリブンデータフレームであるか否かを識別するためのイベントドリブン識別フラグを確認し、イベントドリブンデータフレームであると識別された場合には正規ECUから送信されたデータフレーム(正当なデータフレーム)であると判断する。即ち、不正データフレーム判断部104は、送信周期を示すデータフレーム生成ルールに呼応した周期ルール情報(後述)に適合しないデータフレームがデータフレーム送受信部101により受信された場合に、そのデータフレーム中のイベントドリブン識別フラグという特定識別子を検証する、言わば検証部としての機能を有する。不正データフレーム判断部104は、受信したデータフレームが予め定められた送信周期の条件を満たさず、かつ、イベントドリブン識別フラグによってイベントドリブンデータフレームであると確認されない場合(つまり特定識別子の検証に失敗した場合)には、受信したデータフレームを不正なデータフレームであると判断する。不正データフレーム判断部104は、正当なデータフレームであると判断した場合には、データフレーム処理部107にそのデータフレームの処理を行わせ、不正なデータフレームであると判断した場合には、そのデータフレームを破棄する(つまりそのデータフレームについてデータフレーム処理部107に処理させない)。また、不正データフレーム判断部104は、送信周期の条件を満たすデータフレームを受信した場合に、受信時刻をデータフレーム受信履歴保持部106に前回受信時刻(後述)として記録する。
The invalid data
受信データフレーム周期保持部105は、メモリ等の記憶媒体で実現され、周期ルール情報を保持する。この周期ルール情報は、自機(ECU100a)が受信するデータフレームのメッセージID毎に、予め定められた送信周期と、データフレームの受信間隔について、送信周期の条件が満たされる(つまり正当な送信周期に合致する)と判断されるための許容範囲を示すマージンとを対応付けた情報である。データフレームの受信側のECUの受信データフレーム周期保持部105に保持される周期ルール情報における送信周期は、そのデータフレームの送信側のECUのデータフレーム生成ルール保持部103に保持されるデータフレーム生成ルールにおける送信周期に呼応する。図6は、ECU100aから送信されたデータフレームを受信するECU100bにおける受信データフレーム周期保持部105に格納された周期ルール情報の一例を示す図である。同図の例では、メッセージIDが0x100のデータフレームの送信周期が50ms、メッセージIDが0x200のデータフレームの送信周期が100ms、メッセージIDが0x300のデータフレームの送信周期が70msであることを示している。同図の例では、マージンは、どのメッセージIDについても1msである。このマージンが1msであるため、メッセージIDが0x100のデータフレームについて送信周期が49ms以上51ms以下の範囲であれば、ECU100bにおける不正データフレーム判断部104は、送信周期の条件が満たされると判断することになる。
The received data frame
データフレーム受信履歴保持部106は、メモリ等の記憶媒体で実現され、自機(ECU100a)が正常に受信(つまり正当なデータフレームとして受信)した周期的なデータフレームについてメッセージID毎に、周期的に受信した最終時刻である前回受信時刻を対応付けてなるリストを保持している。図7は、正当なデータフレームとして受信した周期的なデータフレームのメッセージID毎に、データフレームの前回受信時刻を示す情報を列挙したリストの一例を示している。同図の例は、ECU100bにおけるデータフレーム受信履歴保持部106が保持するリストの例である。この例では、メッセージIDが0x100であるデータフレームを周期的に受信した最終時刻(前回受信時刻)は200ms、メッセージIDが0x200であるデータフレームを周期的に受信した前回受信時刻は220ms、メッセージIDが0x300であるデータフレームを周期的に受信した前回受信時刻は230msであることを示している。
The data frame reception
データフレーム処理部107は、不正データフレーム判断部104により正当なデータフレームであると判断されたデータフレームについて、そのデータフレームに応じてECU毎に予め定められた処理を行う。例えば、パワーウィンドウスイッチ110の状態を示すデータフレームを送信したECU100aでは、ECU100bからパワーウィンドウ120の開閉の制御状態に応じたデータフレームを受信して、パワーウィンドウ120が適切に反応しているかを確認する処理、適切に反応していない場合にアラーム音を鳴らす処理或いは他のECUに異常を通知する処理等を行う。
The data
タイマ108は、計時機構であり、例えば車両のエンジン始動時或いはバッテリからの電力供給開始時等において0にリセットされ、その時点から経過した時刻を、データフレーム生成部102及び不正データフレーム判断部104に通知する。タイマ108により、データフレーム生成部102は、データフレームを一定の送信周期で周期的に送信でき、不正データフレーム判断部104は、受信したデータフレームの受信周期が予め定められた送信周期の条件を満たすか否かを判断することができるようになる。
The
センサ値取得部109は、自機(ECU100a)が接続している機器(パワーウィンドウスイッチ110)の状態を示すセンサ値を取得し、データフレーム生成部102に周期的に通知し、更にセンサの値が変化した時にもセンサ値をデータフレーム生成部102に通知する。
The sensor
[1.5 データフレームの送受信]
以下、図8〜図10を用いて、バス200を介したECU間でのデータフレームの送受信について説明する。
[1.5 Data Frame Transmission/Reception]
Transmission and reception of data frames between the ECUs via the
図8は、ECU100aをデータフレームの送信側とし、ECU100bをデータフレームの受信側としたときのデータフレームの送受信の流れを示す図である。
FIG. 8 is a diagram showing a flow of data frame transmission/reception when the
図8に示す期間Tは、周期的に送信されるデータフレームの送信周期である。この期間Tは、送信側であるECU100aのデータフレーム生成ルール保持部103が保持するデータフレーム生成ルールにおける送信周期である。また、期間Tは、受信側であるECU100bの受信データフレーム周期保持部105が保持する周期ルール情報における送信周期と一致すると想定される。ECU100aは、周期的にデータフレームを送信する。ECU100aは、その周期的な送信に加えて、接続されたパワーウィンドウスイッチ110の状態の変化のタイミングがその周期的な送信タイミングと一致しない場合に、その状態の変化のタイミングで、イベントドリブンデータフレームを送信する。
The period T shown in FIG. 8 is a transmission cycle of a data frame that is periodically transmitted. This period T is a transmission cycle in the data frame generation rule held by the data frame generation
車載ネットワークシステム10においては、不正なECUがバス200に接続された不正なデータフレームを送信した場合に、ECU100aが送信した正当なデータフレームと区別できる。即ち、ECU100bにより不正なデータフレームと正当なデータフレームとは判別される。この判別には、上述した周期的に送信されるデータフレームについて周期ルール情報(送信周期に係る条件)が用いられ、また、その送信周期に係る条件を満たさないイベントドリブンデータフレームについてはデータフィールド中のイベントドリブン識別フラグという特定識別子が用いられる。
In the vehicle-mounted
図9は、ECU100aにおけるデータフレームの送信処理を示すフローチャートである。
FIG. 9 is a flowchart showing a data frame transmission process in the
ECU100aは、データフレーム生成ルールにおける送信周期に従った送信タイミング(前回の送信から送信周期が経過したタイミング)、或いは、センサ値取得部109からのセンサ値が変化したタイミングで、データフレームの生成が必要となり、図9の送信処理を開始する。送信処理においては、まず、ECU100aは、送信するデータフレームがイベントドリブンデータフレームか周期的なデータフレームかを判断する(ステップS1101)。
The
ECU100aは、ステップS1101において、送信するデータフレームが、データフレーム生成ルールにおける送信周期に従っていないイベントドリブンデータフレームであると判断した場合は、生成するデータフレームのデータフィールドのイベントドリブン識別フラグI(図3参照)に、イベントドリブンデータフレームであることを示す1をセットする(ステップS1102)。
If the
ECU100aは、ステップS1101において、送信するデータフレームが、データフレーム生成ルールにおける送信周期に従う周期的なデータフレームであると判断した場合(イベントドリブンデータフレームでないと判断した場合)は、生成するデータフレームのデータフィールドのイベントドリブン識別フラグI(図3参照)に、イベントドリブンデータフレームでないことを示す0をセットする(ステップS1103)。
When the
ECU100aは、ステップS1102又はS1103での処理を終えると、データフィールドのデータ領域にはセンサ値取得部109から取得した最新のセンサ値をセットして、送信するデータフレームを生成し、バス200へと送信する(ステップS1104)。これにより、バス200上にデータフレームが流れ、ECU100bに受信されるようになる。
When the processing in step S1102 or S1103 is completed, the
図10は、ECU100bにおけるデータフレームの受信処理を示すフローチャートである。
FIG. 10 is a flowchart showing a data frame reception process in the
ECU100bは、バス200上に現れるデータフレームを受信する(ステップS1201)。なお、ECU100bは、自機が受信すべきメッセージIDを含まないデータフレームであればそのデータフレームを破棄して処理を終了する。自機が受信すべきメッセージIDを含むデータフレームを受信した場合に、ECU100bは、その受信が、保持している周期ルール情報で規定された送信周期範囲内か否かを判断する(ステップS1202)。なお、ECU100bの不正データフレーム判断部104は、受信したデータフレームの受信間隔(つまり送信周期)が規定の送信周期の範囲内であるか否か(つまり周期ルール情報で定められた送信周期の条件を満たすか否か)を、タイマ108、受信データフレーム周期保持部105及びデータフレーム受信履歴保持部106から得られる情報に基づいて判断する。なお、規定の送信周期の範囲内とは、前回受信時刻と今回受信したデータフレームの受信時刻の差分(受信間隔)が、受信したデータフレームのメッセージIDに対応して定められた送信周期からマージンを引いた値以上であり、かつ、その送信周期にマージンを加えた値以下である場合を意味する。
The
ステップS1202において、データフレームの受信間隔が送信周期の範囲内である場合には、送信周期の条件が満たされたことになり、ECU100bは、データフレーム受信履歴保持部106が保持するリストに、受信したデータフレームのメッセージIDに対応付けて、前回受信時刻として、そのデータフレームの受信時刻を記録(つまり前回受信時刻を更新)する(ステップS1204)。そして、ステップS1204での処理に続いて、ECU100bの不正データフレーム判断部104により、受信したデータフレームが正当なデータフレームであると判断され(ステップS1205)、データフレーム処理部107によりそのデータフレームに対応した処理がなされる。
If the reception interval of the data frames is within the range of the transmission cycle in step S1202, the condition of the transmission cycle is satisfied, and the
また、ステップS1202において、データフレームの前回受信時刻と今回受信時刻の差分が送信周期の範囲内でない場合には、ECU100bは、データフレームのデータフィールドのイベントドリブン識別フラグIが1であるか否かを判別する(ステップS1203)。イベントドリブン識別フラグIが1である場合には、ECU100bの不正データフレーム判断部104は、受信したデータフレームが正当なデータフレームであると判断し(ステップS1205)、データフレーム処理部107によりそのデータフレームに対応した処理がなされる。
If the difference between the previous reception time and the current reception time of the data frame is not within the range of the transmission cycle in step S1202, the
また、ステップS1203において、データフレームのデータフィールドのイベントドリブン識別フラグIが1でないと判別した場合には、ECU100bは、受信したデータフレームが不正なデータフレームであると判断してデータフレームを破棄する(ステップS1206)。従って、ECU100bは、不正なECUにより送信された不正なデータフレームを処理しない。
If it is determined in step S1203 that the event-driven identification flag I in the data field of the data frame is not 1, the
なお、ステップS1202において、データフレームの受信間隔(つまり送信周期)が規定の送信周期の範囲内か否かを判断するに際して、初回等といった前回受信時刻が保存されていない場合においては、受信したデータフレームをイベントドリブンデータフレームと扱い、イベントドリブン識別フラグIが正しいときにそのデータフレームの受信時刻を前回受信時刻として記録してからステップS1205の処理を行うことができる。この場合、送信側のECUでは初回等の周期的な送信の起点においてはイベントドリブンデータフレームを送信する。また、各ECUが例えばスリープ状態等に入ってデータフレームの周期的な送信を休止する期間がある場合には、その後の周期的な送信の再開時にデータフレームをイベントドリブンデータフレームとして送信することとしても良い。この場合には、受信側のECUでは前回受信時刻から一定時間以上の間、送信側のECUがスリープ状態に入って周期的な送信が途切れた場合に、前回受信時刻を無効にして次回を初回と扱い、受信したデータフレームをイベントドリブンデータフレームと扱い、その正当性を判断することができる。 In step S1202, when it is determined whether the data frame reception interval (that is, the transmission cycle) is within the specified transmission cycle, if the previous reception time such as the first time is not stored, the received data is received. The frame can be treated as an event-driven data frame, and when the event-driven identification flag I is correct, the reception time of the data frame can be recorded as the previous reception time and then the process of step S1205 can be performed. In this case, the transmitting ECU transmits the event driven data frame at the starting point of the periodic transmission such as the first transmission. In addition, when there is a period in which each ECU enters a sleep state or the like and suspends periodic transmission of data frames, the data frame is transmitted as an event-driven data frame when the periodic transmission is resumed thereafter. Is also good. In this case, if the ECU on the transmitting side enters a sleep state for a certain period of time from the previous receiving time and the periodic transmission is interrupted, the receiving side ECU invalidates the previous receiving time and starts the next time. The received data frame is treated as an event-driven data frame, and its validity can be determined.
ここでは、ECU100aがデータフレームを送信してECU100bがデータフレームを受信する例を示したが、ECU100bがデータフレームを送信してECU100aがデータフレームを受信する場合においても同様の処理がなされる。即ち、ECU100bも図9に示すものと同様の送信処理を実行し得るし、ECU100aも図10に示すものと同様の受信処理を実行し得る。
Here, the example in which the
[1.6 実施の形態1の効果]
実施の形態1では、周期的に送信されるデータフレームに加えて、非周期的に送信されるイベントドリブンデータフレームが存在する場合でも、イベントドリブンデータフレーム内に特定識別子を含めることによって、正当なデータフレームか否かを区別可能にする車載ネットワークシステム10を示した。即ち、車載ネットワークシステム10では、送信周期の条件により正当なデータフレームであるか否かを判別し、送信周期の条件によっては判別ができない場合に限って特定識別子により正当なデータフレームであるか否かを判別するようにしている。不正なECUがデータフレームを送信する場合には、送信周期の条件を満たさない可能性が高く、特に特定識別子を付与しないため、このデータフレームを受信したECUによって不正なデータフレームであると判断されるようになる。なお、イベントドリブンデータフレームではないデータフレーム(つまり周期的に送信されるデータフレーム)においては、データフィールドにイベントドリブン識別フラグIを含めずにデータフィールドに、ECUが機器等から取得したセンサ値を示すデータだけを含ませることとしても良い。このようにすれば、正規のECUが周期的に送信するデータフレームには、特定識別子を設ける必要がないため例えばデータフィールドを最大限に有効活用できる。
[1.6 Effect of Embodiment 1]
In the first embodiment, even if there is an event-driven data frame that is transmitted aperiodically in addition to the data frame that is transmitted periodically, by including the specific identifier in the event-driven data frame, it becomes possible The in-
(実施の形態2)
以下、本開示の別の実施の形態として、データフレームを送受信するECU2100aとECU2100bとの間で、周期的に送信されるデータフレームに加えて非周期的なイベントドリブンデータフレームが送信され得る前提の下で、不正なデータフレームが送信されたことを適切に検知するための不正検知方法を実現する車載ネットワークシステム11について図面を用いて説明する。
(Embodiment 2)
Hereinafter, as another embodiment of the present disclosure, it is assumed that an aperiodic event-driven data frame may be transmitted in addition to the periodically transmitted data frame between the
[2.1 車載ネットワークシステム11の全体構成]
図11は、実施の形態2に係る車載ネットワークシステム11の全体構成を示す図である。車載ネットワークシステム11は、実施の形態1で示した車載ネットワークシステム10の一部を変形したものであり、制御装置、センサ等の各種機器が搭載された自動車におけるネットワーク通信システムである。車載ネットワークシステム11は、各種機器に接続されたECU2100a、2100b、及び、各ECUをつなぐバス200を含んで構成される。車載ネットワークシステム11の構成要素のうち、実施の形態1で示した車載ネットワークシステム10と同様の機能を有する構成要素は、同じ符号を付して説明を省略する。ECUは、例えば、プロセッサ(マイクロプロセッサ)、メモリ等のデジタル回路、アナログ回路、通信回路等を含む装置である。以下、バス200には不正なデータフレームを送信する不正なECUが接続されている可能性があることを前提として説明する。
[2.1 Overall Configuration of In-Vehicle Network System 11]
FIG. 11 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 the in-
ECU2100aは、実施の形態1で示したECU100aの一部を変形したものであり、パワーウィンドウスイッチ110に接続されている。ECU2100aは、パワーウィンドウスイッチ110の状態を示す情報を含むデータフレームを周期的にバス200に送信する。さらにパワーウィンドウスイッチ110の状態が変化した時にもパワーウィンドウスイッチ110の状態を示す情報(つまりセンサ値を示す情報)を含むデータフレームをバス200に送信する。従って、ECU2100aは、一定の送信周期でデータフレームの送信を繰り返す他に、パワーウィンドウスイッチ110の状態の変化時がその送信周期と一致しないときに非周期的なイベントドリブンデータフレームをバス200に送信することになる。またECU2100aは、ECU2100bからバス200上に送信されてバス200に流れるデータフレームを受信し、例えばECU2100aが送信したデータフレームが正しく受信されていること等を確認する。
The
ECU2100bは、実施の形態1で示したECU100bの一部を変形したものであり、パワーウィンドウ120に接続されている。ECU2100bは、ECU2100aから送信されバス200に流れているデータフレームを受信し、そのデータフレームに含まれるパワーウィンドウスイッチ110の状態に応じて、パワーウィンドウ120の開閉の制御を行う。またパワーウィンドウ120の開閉の制御状態に応じたデータフレームを周期的にバス200に送信する。この車載ネットワークシステム11においてはCANプロトコルに従って各ECUがフレームの授受を行う。各ECUは、受信したデータフレームが不正なデータフレームであるか否かを判断する機能を有している。
[2.2 データフィールドフォーマット]
以下、車載ネットワークシステム11で用いられるデータフレームにおけるデータフィールドについて説明する。
[2.2 Data field format]
Hereinafter, the data field in the data frame used in the in-vehicle network system 11 will be described.
図12は、車載ネットワークシステム11で用いられるデータフィールドフォーマットの一例を示す図である。同図に示すように、データフィールドの上位8ビット「I」(先頭の8ビット)は、イベントドリブンデータフレームを送信する度に増加するカウンタ(「イベントカウンタ」と称する。)である。イベントカウンタIの値は、周期的なデータフレームの送信時には変化せず、同じメッセージIDのイベントドリブンデータフレームを1回送信する度に値が1増加(インクリメント)する。なお、例外的にイベントカウンタIの値が最大値(8ビットの最大値)になっている場合にイベントカウンタを1増加すると最小値になる。イベントカウンタIは、データフレームの受信側において正当なイベントドリブンデータフレームであるか否かを識別するための特定識別子として働く。イベントカウンタIに後続するデータ領域にはECUが機器等から取得したセンサ値を示すデータ(ECU2100aが送信するデータフレームにおいては例えばパワーウィンドウスイッチ110の状態を示す値等)が含まれる。図12の例では上位8ビットをイベントカウンタIとしているが、イベントカウンタIを、データフィールド内における下位8ビット等の任意の箇所に設けても良い。また、イベントカウンタIの長さを8ビットとしているが、必ずしも8ビットである必要はなく、任意の長さにしても良い。
FIG. 12 is a diagram showing an example of a data field format used in the vehicle-mounted network system 11. As shown in the figure, the upper 8 bits “I” (the first 8 bits) of the data field is a counter (called “event counter”) that is incremented each time an event driven data frame is transmitted. The value of the event counter I does not change at the time of periodic data frame transmission, and the value is incremented (incremented) by 1 each time an event driven data frame having the same message ID is transmitted. In addition, when the value of the event counter I is exceptionally the maximum value (maximum value of 8 bits), the event counter I is incremented by 1 to the minimum value. The event counter I functions as a specific identifier for identifying whether or not the data frame receiving side is a valid event driven data frame. The data area subsequent to the event counter I includes data indicating a sensor value acquired by the ECU from a device or the like (for example, a value indicating the state of the
[2.3 ECU2100aの構成]
図13は、ECU2100aの構成図である。ECU2100aは、データフレーム送受信部101と、データフレーム生成部2102と、データフレーム生成ルール保持部2103と、不正データフレーム判断部2104と、受信データフレーム周期保持部105と、データフレーム受信履歴保持部2106と、データフレーム処理部107と、タイマ108と、センサ値取得部109とを含んで構成される。ECU2100aの構成要素のうち、実施の形態1で示したECU100aと同様の機能を有する構成要素は、同じ符号を付して説明を省略する。これらの各構成要素は、機能的な構成要素であり、その各機能は、ECU2100aにおける通信回路、メモリに格納された制御プログラムを実行するプロセッサ或いはデジタル回路等により実現される。なお、ECU2100bもECU2100aと基本的に同様の構成を備える。但し、データフレーム生成ルール保持部2103、受信データフレーム周期保持部105及びデータフレーム受信履歴保持部2106の各保持内容はECU毎に異なる内容となり得る。また、データフレーム処理部107の処理内容は、ECU毎に異なる。
[2.3 Configuration of
FIG. 13 is a configuration diagram of the
データフレーム生成部2102は、データフレーム生成ルール保持部2103に格納されたデータフレーム生成ルールに従い、データフレームを生成し、データフレーム送受信部101に送信する。データフレーム生成部2102は、タイマ108から現在時刻を取得する。更にデータフレーム生成部2102は、ECU2100aに接続された機器(パワーウィンドウスイッチ110)に関するデータ(センサ値)をセンサ値取得部109から取得する。ECU2100aからデータフレームを周期的に送信すべく、データフレーム生成部2102は、現在時刻とデータフレーム生成ルール保持部2103に格納される送信周期とによって、データフレームを生成するタイミングを決定し、データフレームの生成を周期的に行う。なお、データフレーム生成部2102によりデータフレームが生成されると、そのデータフレームはデータフレーム送受信部101に通知され、データフレーム送受信部101はそのデータフレームの送信を行う。更に、データフレーム生成部2102は、センサ値取得部109から取得されるセンサ値に変化があった時が、周期的なタイミングとは異なる時である場合には、イベントドリブンデータフレームの生成を行う。従って、データフレーム送受信部101によりECU2100aからバス200に、周期的にデータフレームが送信され、更に、非周期的にイベントドリブンデータフレームが送信される。データフレーム生成部2102は、周期的に送信するデータフレーム及びイベントドリブンデータフレームのデータフィールドに、イベントカウンタIとして、データフレーム生成ルール保持部2103に格納されている、メッセージID毎の送信イベントカウンタの値を含ませる。なお、データフレーム生成部2102は、イベントドリブンデータフレームを生成する場合には、データフレームの生成前にデータフレーム生成ルール保持部2103に格納されている送信イベントカウンタの値を1増加(インクリメント)する。データフレーム生成部2102も実施の形態1で示したデータフレーム生成部102と同様に、送信周期を示すデータフレーム生成ルールに適合しないタイミングでデータフレームの送信をする際においてデータフレーム中にイベントカウンタという特定識別子を付与したデータフレームを生成する付与部としての機能を有する。
The data
データフレーム生成ルール保持部2103は、メモリ等の記憶媒体で実現され、データフレーム生成ルールとしてECU2100aが送信するメッセージID毎に周期的にデータフレームを送信するための送信周期を格納しており、更に、データフレーム生成ルールに、送信したイベントドリブンデータフレームの回数を示す送信イベントカウンタを付与している。この送信イベントカウンタは、データフレームを送信する際に、データフィールドのイベントカウンタに設定する値として用いられる。データフレーム生成部2102がイベントドリブンデータフレームの送信時に、送信イベントカウンタを1増加し、その送信イベントカウンタの値をデータフィールド内のイベントカウンタIとして用いる。図14は、データフレーム生成ルール保持部2103に格納されたデータフレーム生成ルール及び送信イベントカウンタの一例を示す図である。ここでは、ECU2100aは、パワーウィンドウスイッチ110の状態を示すデータフレーム等、複数種類のデータフレーム(種類毎にメッセージIDで識別されるデータフレーム)を送信するものとする。図14の例では、ECU2100aから周期的に送信されるメッセージIDが0x100のデータフレームについては、送信周期が50msであり送信イベントカウンタが現在15(例えばイベントドリブンデータフレームを15回送信した状態を示す値)であり、メッセージIDが0x200のデータフレームについては、送信周期が100msであり送信イベントカウンタが現在0(例えば未だイベントドリブンデータフレームを送信していない状態を示す値)であり、メッセージIDが0x300のデータフレームについては、送信周期が300msであり送信イベントカウンタが現在5であることを示している。
The data frame generation
不正データフレーム判断部2104は、受信したデータフレームが正当なデータフレームであるか(不正なデータフレームでないか)否かについて判断する。即ち、不正データフレーム判断部2104は、受信データフレーム周期保持部105の周期ルール情報を参照して、メッセージID毎に予め定められた送信周期の条件を満たすか否かを確認し、送信周期の条件を満たす場合には正規のECUから送信されたデータフレーム(正当なデータフレーム)であると判断する。また、送信周期の条件を満たさないデータフレームであっても、データフレーム受信履歴保持部2106に格納されている受信イベントカウンタの値と受信したデータフレームに含まれるイベントカウンタIの値とを比較して確認し、イベントカウンタIの値が正当なイベントドリブンデータフレームに期待される値であると判定された場合には、正規ECUから送信されたイベントドリブンデータフレーム(正当なデータフレーム)であると判断する。即ち、不正データフレーム判断部2104は、実施の形態1で示した不正データフレーム判断部104と同様に、送信周期を示すデータフレーム生成ルールに呼応した周期ルール情報に適合しないデータフレームがデータフレーム送受信部101により受信された場合に、そのデータフレーム中のイベントカウンタという特定識別子を検証する検証部としての機能を有する。受信したデータフレームに含まれるイベントカウンタIの値が、受信イベントカウンタの値を1増加させた値と一致する場合には、正当なイベントドリブンデータフレームに期待される値であり、正当なデータフレームであると判断される。不正データフレーム判断部2104は、受信したデータフレームが予め定められた送信周期の条件を満たさず、かつ、イベントカウンタIにより正当なイベントドリブンデータフレームであると判定されない場合には、受信したデータフレームを不正なデータフレームであると判断する。不正データフレーム判断部2104は、正当なデータフレームであると判断した場合には、データフレーム処理部107にそのデータフレームの処理を行わせ、不正なデータフレームであると判断した場合には、そのデータフレームを破棄する(つまりそのデータフレームについてデータフレーム処理部107に処理させない)。また、不正データフレーム判断部2104は、送信周期の条件を満たすデータフレームを受信した場合に、受信時刻をデータフレーム受信履歴保持部2106に前回受信時刻として記録する。
The invalid data
データフレーム受信履歴保持部2106は、メモリ等の記憶媒体で実現され、自機(ECU2100a)が正常に受信(つまり正当なデータフレームとして受信)した周期的なデータフレームについてメッセージID毎に、周期的に受信した最終時刻である前回受信時刻を対応付けてなるリストを保持しており、このリストには更に正当に受信したイベントドリブンデータフレームの受信回数である受信イベントカウンタがメッセージID毎に付与されている。図15は、正当なデータフレームとして受信した周期的なデータフレームのメッセージID毎に、データフレームの前回受信時刻及び受信イベントカウンタを列挙したリストの一例を示している。同図の例は、ECU2100bにおけるデータフレーム受信履歴保持部2106が保持するリストの例である。この例では、メッセージIDが0x100であるデータフレームを周期的に受信した最終時刻(前回受信時刻)は200msでありメッセージIDが0x100のイベントドリブンデータフレームに対応する受信イベントカウンタが現在15(例えばイベントドリブンデータフレームを15回受信した状態を示す値)であり、メッセージIDが0x200であるデータフレームを周期的に受信した前回受信時刻は220msであり受信イベントカウンタが現在0(例えば未だイベントドリブンデータフレームを受信していない状態を示す値)であり、メッセージIDが0x300であるデータフレームを周期的に受信した前回受信時刻は230msであり受信イベントカウンタが現在5であることを示している。
The data frame reception
[2.4 ECU2100aにおけるデータフレームの送信処理]
以下、ECU2100aがデータフレームをバス200に送信し、ECU2100bがデータフレームをバス200から受信する例を想定して、ECU2100aにおけるデータフレームの送信処理を説明する。
[2.4 Transmission Processing of Data Frame in
Hereinafter, assuming that the
図16は、ECU2100aにおけるデータフレームの送信処理を示すフローチャートである。
FIG. 16 is a flowchart showing a data frame transmission process in the
ECU2100aは、データフレーム生成ルールにおける送信周期に従った送信タイミング(前回の送信から送信周期が経過したタイミング)、或いは、センサ値取得部109からのセンサ値が変化したタイミングで、データフレームの生成が必要となり、図16の送信処理を開始する。送信処理においては、まず、ECU2100aは、送信するデータフレームがイベントドリブンデータフレームか周期的なデータフレームかを判断する(ステップS2101)。
The
ECU2100aは、ステップS2101において、送信するデータフレームが、データフレーム生成ルールにおける送信周期に従っていないイベントドリブンデータフレームであると判断した場合は、データフレーム生成ルール保持部2103に格納されている送信イベントカウンタの値を1増加(インクリメント)する(ステップS2102)。また、ECU2100aは、ステップS2101において、送信するデータフレームが、データフレーム生成ルールにおける送信周期に従う周期的なデータフレームであると判断した場合(イベントドリブンデータフレームでないと判断した場合)には、ステップS2102での送信イベントカウンタの値の増加をスキップする。
If the
ECU2100aは、ステップS2102での処理を終えた場合、及び、ステップS2102での処理をスキップした場合に、データフィールドのイベントカウンタIに送信イベントカウンタの値をセットし、データフィールドのデータ領域にはセンサ値取得部109から取得した最新のセンサ値をセットして、送信するデータフレームを生成し、バス200へと送信する(ステップS2103)。これにより、バス200上にデータフレームが流れ、ECU2100bに受信されるようになる。
The
なお、ECU2100bも図16に示すものと同様の送信処理を実行し得る。
Note that the
[2.5 ECU2100bにおけるデータフレームの受信処理]
以下、ECU2100aがデータフレームをバス200に送信し、ECU2100bがデータフレームをバス200から受信する例を想定して、ECU2100bにおけるデータフレームの受信処理を説明する。
[2.5 Reception Processing of Data Frame in
Hereinafter, assuming that the
図17は、ECU2100bにおけるデータフレームの受信処理を示すフローチャートである。
FIG. 17 is a flowchart showing a data frame reception process in the
ECU2100bは、バス200上に現れるデータフレームを受信する(ステップS2201)。なお、ECU2100bは、自機が受信すべきメッセージIDを含まないデータフレームであればそのデータフレームを破棄して処理を終了する。自機が受信すべきメッセージIDを含むデータフレームを受信した場合に、ECU2100bは、その受信が、保持している周期ルール情報で規定された送信周期範囲内か否かを判断する(ステップS2202)。なお、ECU2100bの不正データフレーム判断部2104は、受信したデータフレームの受信間隔(つまり送信周期)が規定の送信周期の範囲内であるか否か(つまり周期ルール情報で定められた送信周期の条件を満たすか否か)を、タイマ108、受信データフレーム周期保持部105及びデータフレーム受信履歴保持部106から得られる情報に基づいて判断する。即ち、不正データフレーム判断部2104は、前回受信時刻と今回受信したデータフレームの受信時刻の差分(受信間隔)が、受信したデータフレームのメッセージIDに対応して定められた送信周期からマージンを引いた値以上であり、かつ、その送信周期にマージンを加えた値以下であるか否かを判断する。
The
ステップS2202において、データフレームの受信間隔が送信周期の範囲内である場合には、送信周期の条件が満たされたことになり、ECU2100bは、データフレーム受信履歴保持部2106が保持するリストに、受信したデータフレームのメッセージIDに対応付けて、前回受信時刻として、そのデータフレームの受信時刻を記録(つまり前回受信時刻を更新)する(ステップS2204)。そして、ステップS2204での処理に続いて、ECU2100bの不正データフレーム判断部2104により、受信したデータフレームが正当なデータフレームであると判断され(ステップS2206)、データフレーム処理部107によりそのデータフレームに対応した処理がなされる。
In step S2202, if the data frame reception interval is within the range of the transmission cycle, it means that the condition of the transmission cycle is satisfied, and the
また、ステップS2202において、データフレームの前回受信時刻と今回受信時刻の差分が送信周期の範囲内でない場合には、ECU2100bは、データフレームのデータフィールドのイベントカウンタIが、データフレーム受信履歴保持部2106に格納された受信イベントカウンタの値を1増加させた値と一致するか否かを判定する(ステップS2203)。一致する場合には、ECU2100bでは受信イベントカウンタの値を1増加(インクリメント)させる(ステップS2205)。続いてECU2100bの不正データフレーム判断部2104は、受信したデータフレームが正当なデータフレームであると判断し(ステップS2206)、データフレーム処理部107によりそのデータフレームに対応した処理がなされる。
If the difference between the previous reception time and the current reception time of the data frame is not within the range of the transmission cycle in step S2202, the
ステップS2203において一致しないと判定した場合には、ECU2100bは、受信したデータフレームが不正なデータフレームであると判断してデータフレームを破棄する(ステップS2207)。従って、ECU2100bは、不正なECUにより送信された不正なデータフレームを処理しない。
If it is determined in step S2203 that they do not match, the
なお、ステップS2202において、データフレームの受信間隔(つまり送信周期)が規定の送信周期の範囲内か否かを判断するに際して、初回等といった前回受信時刻が保存されていない場合においては、受信したデータフレームをイベントドリブンデータフレームと扱い、イベントカウンタが正しいときに受信イベントカウンタを1増加した後にそのデータフレームの受信時刻を前回受信時刻として記録してからステップS2206の処理を行うことができる。この場合、送信側のECUでは初回等の周期的な送信の起点においてはイベントドリブンデータフレームを送信する。また、各ECUが例えばスリープ状態等に入ってデータフレームの周期的な送信を休止する期間がある場合には、その後の周期的な送信の再開時にデータフレームをイベントドリブンデータフレームとして送信することとしても良い。この場合には、受信側のECUでは前回受信時刻から一定時間以上の間、送信側のECUがスリープ状態に入って周期的な送信が途切れた場合に、前回受信時刻を無効にして次回を初回と扱い、受信したデータフレームをイベントドリブンデータフレームと扱い、その正当性を判断することができる。 In step S2202, when determining whether the reception interval (that is, the transmission cycle) of the data frame is within the range of the specified transmission cycle, when the previous reception time such as the first time is not stored, the received data is received. The frame can be treated as an event-driven data frame, and when the event counter is correct, the reception event counter is incremented by 1, and the reception time of the data frame is recorded as the previous reception time, and then the process of step S2206 can be performed. In this case, the transmitting ECU transmits the event driven data frame at the starting point of the periodic transmission such as the first transmission. In addition, when there is a period in which each ECU enters a sleep state or the like and suspends periodic transmission of data frames, the data frame is transmitted as an event-driven data frame when the periodic transmission is resumed thereafter. Is also good. In this case, if the ECU on the transmitting side enters a sleep state for a certain period of time from the previous receiving time and the periodic transmission is interrupted, the receiving side ECU invalidates the previous receiving time and starts the next time. The received data frame is treated as an event-driven data frame, and its validity can be determined.
また、ECU2100aも図17に示すものと同様の受信処理を実行し得る。
Further, the
[2.6 実施の形態2の効果]
実施の形態2では、周期的に送信されるデータフレームに加えて、非周期的に送信されるイベントドリブンデータフレームが存在する場合でも、イベントドリブンデータフレーム内に特定識別子(つまりイベントカウンタ)を含めることによって、正当なデータフレームか否かを区別可能にする車載ネットワークシステム11を示した。即ち、車載ネットワークシステム11では、送信周期の条件により正当なデータフレームであるか否かを判別し、送信周期の条件によっては判別ができない場合に限って特定識別子により正当なデータフレームであるか否かを判別するようにしている。イベントカウンタは、固定値ではないため、不正なECUがイベントカウンタと同じ値をデータフレームに付与し難い。不正なECUがデータフレームを送信する場合には、送信周期の条件を満たさない可能性が高く、正しくイベントカウンタをセットすることは容易ではないため、このデータフレームを受信したECUによって不正なデータフレームであると判断されるようになる。なお、イベントドリブンデータフレームではないデータフレーム(つまり周期的に送信されるデータフレーム)においては、データフィールドにイベントカウンタIを含めずにデータフィールドに、ECUが機器等から取得したセンサ値を示すデータだけを含ませることとしても良い。このようにすれば、正規のECUが周期的に送信するデータフレームには、特定識別子を設ける必要がないため例えばデータフィールドを最大限に有効活用できる。
[2.6 Effect of Second Embodiment]
In the second embodiment, a specific identifier (that is, an event counter) is included in the event-driven data frame even when there is an event-driven data frame that is aperiodically transmitted in addition to the periodically-transmitted data frame. As a result, the in-vehicle network system 11 that can distinguish whether the data frame is valid or not is shown. That is, the in-vehicle network system 11 determines whether or not the data frame is a valid data frame based on the condition of the transmission cycle, and determines whether or not the data frame is a valid data frame based on the specific identifier only when the determination cannot be made depending on the condition of the transmission period. I'm trying to determine. Since the event counter is not a fixed value, it is difficult for an unauthorized ECU to give the same value as the event counter to the data frame. When an unauthorized ECU transmits a data frame, it is highly likely that the condition of the transmission cycle will not be satisfied, and it is not easy to set the event counter correctly. Will be determined to be. In a data frame that is not an event-driven data frame (that is, a data frame that is periodically transmitted), the data field does not include the event counter I and the data field indicates the sensor value acquired from the device by the ECU. It is also possible to include only. In this way, since it is not necessary to provide a specific identifier in the data frame periodically transmitted by the regular ECU, for example, the data field can be effectively utilized to the maximum extent.
(実施の形態3)
以下、本開示の別の実施の形態として、データフレームを送受信するECU3100aとECU3100bとの間で、周期的に送信されるデータフレームに加えて非周期的なイベントドリブンデータフレームが送信され得る前提の下で、不正なデータフレームが送信されたことを適切に検知するための不正検知方法を実現する車載ネットワークシステム12について図面を用いて説明する。
(Embodiment 3)
Hereinafter, as another embodiment of the present disclosure, it is assumed that an aperiodic event-driven data frame may be transmitted in addition to the periodically transmitted data frame between the
[3.1 車載ネットワークシステム12の全体構成]
図18は、実施の形態3に係る車載ネットワークシステム12の全体構成を示す図である。車載ネットワークシステム12は、実施の形態1で示した車載ネットワークシステム10の一部を変形したものであり、制御装置、センサ等の各種機器が搭載された自動車におけるネットワーク通信システムである。車載ネットワークシステム12は、各種機器に接続されたECU3100a、3100b、及び、各ECUをつなぐバス200を含んで構成される。車載ネットワークシステム12の構成要素のうち、実施の形態1で示した車載ネットワークシステム10と同様の機能を有する構成要素は、同じ符号を付して説明を省略する。ECUは、例えば、プロセッサ(マイクロプロセッサ)、メモリ等のデジタル回路、アナログ回路、通信回路等を含む装置である。以下、バス200には不正なデータフレームを送信する不正なECUが接続されている可能性があることを前提として説明する。
[3.1 Overall Configuration of In-Vehicle Network System 12]
FIG. 18 is a diagram showing the overall configuration of the vehicle-mounted
ECU3100aは、実施の形態1で示したECU100aの一部を変形したものであり、パワーウィンドウスイッチ110に接続されている。ECU3100aは、パワーウィンドウスイッチ110の状態を示す情報を含むデータフレームを周期的にバス200に送信する。さらにパワーウィンドウスイッチ110の状態が変化した時にもパワーウィンドウスイッチ110の状態を示す情報(つまりセンサ値を示す情報)を含むデータフレームをバス200に送信する。従って、ECU3100aは、一定の送信周期でデータフレームの送信を繰り返す他に、パワーウィンドウスイッチ110の状態の変化時がその送信周期と一致しないときに非周期的なイベントドリブンデータフレームをバス200に送信することになる。またECU3100aは、ECU3100bからバス200上に送信されてバス200に流れるデータフレームを受信し、例えばECU3100aが送信したデータフレームが正しく受信されていること等を確認する。
The
ECU3100bは、実施の形態1で示したECU100bの一部を変形したものであり、パワーウィンドウ120に接続されている。ECU3100bは、ECU3100aから送信されバス200に流れているデータフレームを受信し、そのデータフレームに含まれるパワーウィンドウスイッチ110の状態に応じて、パワーウィンドウ120の開閉の制御を行う。またパワーウィンドウ120の開閉の制御状態に応じたデータフレームを周期的にバス200に送信する。この車載ネットワークシステム12においてはCANプロトコルに従って各ECUがフレームの授受を行う。各ECUは、受信したデータフレームが不正なデータフレームであるか否かを判断する機能を有している。
[3.2 データフィールドフォーマット]
以下、車載ネットワークシステム12で用いられるデータフレームにおけるデータフィールドについて説明する。
[3.2 Data field format]
Hereinafter, the data field in the data frame used in the vehicle-mounted
図19は、車載ネットワークシステム12で用いられるデータフィールドフォーマットの一例を示す図である。同図の例は、イベントドリブンデータフレームの場合の一例であり、データフィールドの下位16ビット「I」(後尾の16ビット)は、メッセージ認証コード(MAC:Message Authentication Code)を格納するMACフィールドIである。イベントドリブンデータフレームについてのデータフィールドにMACフィールドIを含むか否か、並びに、MACフィールドIを含む場合にはMACフィールドIの位置及び長さについて、データフレーム生成ルール保持部3103に格納されているデータフレーム生成ルール内のイベントドリブンデータフレームフォーマット(後述)で規定される。イベントドリブンデータフレームを生成して送信する場合には、MACフィールドIにデータフレーム生成ルール保持部3103に格納されているイベントドリブンデータフレームフォーマットに従ってMACをセットする。MACは、イベントドリブンデータフレームが正当であることを識別する特定識別子として機能する。周期的なデータフレームを生成して送信する場合には、データフィールド内にMACを格納する必要はなく、MACの代わりに固定値を含めても良いが、特にMAC及びその代替データを含まずデータフィールド全域をデータ領域として活用して良い。ここでは、周期的なデータフレームにはMACは格納されず、イベントドリブンデータフレームにはMACが格納されることとして説明を続ける。データフィールドのMACフィールドI以外の領域であるデータ領域(図19参照)には、ECUが機器等から取得したセンサ値を示すデータ(ECU3100aが送信するデータフレームにおいては例えばパワーウィンドウスイッチ110の状態を示す値等)が含まれる。図19の例では下位16ビットをMACフィールドIとしているが、イベントドリブンデータフレームフォーマットで規定すれば、上位ビット等、任意の箇所にMACフィールドを含めても良い。また、MACのサイズを16ビット以外にしても良い。
FIG. 19 is a diagram showing an example of a data field format used in the vehicle-mounted
[3.3 ECU3100aの構成]
図20は、ECU3100aの構成図である。ECU3100aは、データフレーム送受信部101と、データフレーム生成部3102と、データフレーム生成ルール保持部3103と、不正データフレーム判断部3104と、受信データフレーム周期保持部3105と、データフレーム受信履歴保持部106と、データフレーム処理部107と、タイマ108と、センサ値取得部109と、MAC生成部3110と、MAC鍵保持部3111と、カウンタ保持部3112とを含んで構成される。ECU3100aの構成要素のうち、実施の形態1で示したECU100aと同様の機能を有する構成要素は、同じ符号を付して説明を省略する。これらの各構成要素は、機能的な構成要素であり、その各機能は、ECU3100aにおける通信回路、メモリに格納された制御プログラムを実行するプロセッサ或いはデジタル回路等により実現される。なお、ECU3100bもECU3100aと基本的に同様の構成を備える。但し、データフレーム生成ルール保持部3103、受信データフレーム周期保持部3105及びデータフレーム受信履歴保持部106の各保持内容はECU毎に異なる内容となり得る。また、データフレーム処理部107の処理内容は、ECU毎に異なる。
[3.3 Configuration of
FIG. 20 is a configuration diagram of the
データフレーム生成部3102は、データフレーム生成ルール保持部3103に格納されたデータフレーム生成ルールに従い、データフレームを生成し、データフレーム送受信部101に送信する。データフレーム生成部3102は、タイマ108から現在時刻を取得する。更にデータフレーム生成部3102は、ECU3100aに接続された機器(パワーウィンドウスイッチ110)に関するデータ(センサ値)をセンサ値取得部109から取得する。ECU3100aからデータフレームを周期的に送信すべく、データフレーム生成部3102は、現在時刻とデータフレーム生成ルール保持部3103に格納される送信周期とによって、データフレームを生成するタイミングを決定し、データフレームの生成を周期的に行う。なお、データフレーム生成部3102によりデータフレームが生成されると、そのデータフレームはデータフレーム送受信部101に通知され、データフレーム送受信部101はそのデータフレームの送信を行う。更に、データフレーム生成部3102は、センサ値取得部109から取得されるセンサ値に変化があった時が、周期的なタイミングとは異なる時である場合には、イベントドリブンデータフレームの生成を行う。イベントドリブンデータフレームを生成する際には、データフレーム生成部3102は、データフレーム生成ルール保持部3103に格納されているメッセージID毎のデータフレーム生成ルールのイベントドリブンデータフレームフォーマットに従ってMACをデータフレームに含める。このMACは、MAC生成部3110に、生成するデータフレームのメッセージID及びデータフィールドのデータ領域に格納するデータ(センサ値)を通知することによってMAC生成部3110から得られる値を、イベントドリブンデータフレームフォーマットで規定されるデータ長(ビット長)となるように切り捨てたものである。データフレーム生成部3102によるデータフレームの生成の結果として、データフレーム送受信部101によりECU3100aからバス200に、周期的にデータフレームが送信され、更に、非周期的にイベントドリブンデータフレームが送信される。データフレーム生成部3102も実施の形態1で示したデータフレーム生成部102と同様に、送信周期を示すデータフレーム生成ルールに適合しないタイミングでデータフレームの送信をする際においてデータフレーム中にMACという特定識別子を付与したデータフレームを生成する付与部としての機能を有する。
The data
データフレーム生成ルール保持部3103は、メモリ等の記憶媒体で実現され、データフレーム生成ルールとしてECU3100aが送信するメッセージID毎に周期的にデータフレームを送信するための送信周期と、MACの格納位置、データ長等を示すイベントドリブンデータフレームフォーマットとを格納している。図21は、データフレーム生成ルール保持部3103に格納されたデータフレーム生成ルールの一例を示している。ここでは、ECU3100aは、パワーウィンドウスイッチ110の状態を示すデータフレーム等、複数種類のデータフレーム(種類毎にメッセージIDで識別されるデータフレーム)を送信するものとする。図21の例では、ECU3100aから周期的に送信されるメッセージIDが0x100のデータフレームについては、送信周期が50msであり、この送信周期に従わずイベントドリブンデータフレームとして送信する場合にはデータフィールドの下位16ビットにMACを格納する必要があることを示している。また、メッセージIDが0x200のデータフレームについては、送信周期が100msであり、メッセージIDが0x200のイベントドリブンデータフレームは送信されないことを示している。また、ECU3100aから周期的に送信されるメッセージIDが0x300のデータフレームについては、送信周期が70msであり、この送信周期に従わずイベントドリブンデータフレームとして送信する場合にはデータフィールドの下位16ビットにMACを格納する必要があることを示している。
The data frame generation
不正データフレーム判断部3104は、受信したデータフレームが正当なデータフレームであるか(不正なデータフレームでないか)否かについて判断する。即ち、不正データフレーム判断部3104は、受信データフレーム周期保持部3105の周期ルール情報を参照して、メッセージID毎に予め定められた送信周期の条件を満たすか否かを確認し、送信周期の条件を満たす場合には正規のECUから送信されたデータフレーム(正当なデータフレーム)であると判断する。また、送信周期の条件を満たさないデータフレームであっても、データフィールドに正当なMACが含まれていることが検証された場合には、正当なデータフレームであると判断される。MACの検証は、データフレームのメッセージID及びデータフィールドのデータ領域の内容をMAC生成部3110に通知することによってMAC生成部3110から得られる値と、データフィールド内のMACフィールドIの内容とが、一致するか否かを判別することで行われ、一致した場合に検証に成功する。即ち、不正データフレーム判断部3104は、実施の形態1で示した不正データフレーム判断部104と同様に、送信周期を示すデータフレーム生成ルールに呼応した周期ルール情報に適合しないデータフレームがデータフレーム送受信部101により受信された場合に、そのデータフレーム中のMACという特定識別子を検証する検証部としての機能を有する。不正データフレーム判断部3104は、受信したデータフレームが予め定められた送信周期の条件を満たさず、かつ、MACの検証により正当なイベントドリブンデータフレームであると判定されない場合には、受信したデータフレームを不正なデータフレームであると判断する。不正データフレーム判断部2104は、正当なデータフレームであると判断した場合には、データフレーム処理部107にそのデータフレームの処理を行わせ、不正なデータフレームであると判断した場合には、そのデータフレームを破棄する(つまりそのデータフレームについてデータフレーム処理部107に処理させない)。また、不正データフレーム判断部3104は、送信周期の条件を満たすデータフレームを受信した場合に、受信時刻をデータフレーム受信履歴保持部106に前回受信時刻として記録する。
The invalid data
受信データフレーム周期保持部3105は、メモリ等の記憶媒体で実現され、周期ルール情報を保持する。この周期ルール情報は、自機(ECU3100a)が受信するデータフレームのメッセージID毎に、予め定められた送信周期と、データフレームの受信間隔について、送信周期の条件が満たされる(つまり正当な送信周期に合致する)と判断されるための許容範囲を示すマージンとを対応付けた情報である。周期ルール情報には、更に、送信周期の条件を満たさないイベントドリブンデータフレームのデータフィールド内に格納されるMACの格納位置、データ長等を示すイベントドリブンデータフレームフォーマットが含まれる。このイベントドリブンデータフレームフォーマットは、不正データフレーム判断部3104が、イベントドリブンデータフレームについての正当性を検証(つまりMACを検証)する際に用いられる。なお、データフレームの受信側のECUの受信データフレーム周期保持部3105に保持される周期ルール情報における送信周期は、そのデータフレームの送信側のECUのデータフレーム生成ルール保持部3103に保持されるデータフレーム生成ルールにおける送信周期に呼応する。また、データフレームの受信側のECUの受信データフレーム周期保持部3105に保持される周期ルール情報におけるイベントドリブンデータフレームフォーマットは、そのデータフレームの送信側のECUのデータフレーム生成ルール保持部3103に保持されるデータフレーム生成ルールにおけるイベントドリブンデータフレームフォーマットに呼応する。図22は、ECU3100aから送信されたデータフレームを受信するECU3100bにおける受信データフレーム周期保持部3105に格納された周期ルール情報の一例を示す図である。同図の例では、メッセージIDが0x100のデータフレームの送信周期が50ms、メッセージIDが0x200のデータフレームの送信周期が100ms、メッセージIDが0x300のデータフレームの送信周期が70msであることを示している。同図の例では、マージンは、どのメッセージIDについても1msである。このマージンが1msであるため、メッセージIDが0x100のデータフレームについて送信周期が49ms以上51ms以下の範囲であれば、ECU3100bにおける不正データフレーム判断部3104は、送信周期の条件が満たされると判断することになる。また、図22の例でのイベントドリブンデータフレームフォーマットについては、メッセージIDが0x100及び0x300のイベントドリブンデータフレームは、データフィールドの下位16ビットにMACが付与されていることを示しており、メッセージIDが0x200のイベントドリブンデータフレームは送信されないことを示している。
The received data frame
MAC生成部3110は、不正データフレーム判断部3104或いはデータフレーム生成部3102から通知されたデータフレームの内容(メッセージID及びデータフィールドのデータ領域のデータ)に基づいて、MACを生成してMACの値を通知元に与える。即ち、MAC生成部3110は、通知されたメッセージIDと、データフィールドのデータ領域のデータ値と、カウンタ保持部3112に格納されている、通知されたメッセージIDに対応するカウンタ値とを連結したものに対して、MAC鍵保持部3111に格納されている通知されたメッセージIDに対応するMAC鍵を用いてHMAC(非特許文献4)の演算を行うことによりMACを生成して、通知元にMACの値を返す。
The
MAC鍵保持部3111は、メモリ等の記憶媒体で実現され、自機(ECU3100a)が送信するデータフレームのメッセージID毎にMAC生成に用いられる暗号鍵を格納しており、更に、自機(ECU3100a)が受信するデータフレームのメッセージID毎にMAC生成に用いられる暗号鍵を格納している。
The MAC
カウンタ保持部3112は、メモリ等の記憶媒体を含んで実現され、自機(ECU3100a)が送信するデータフレームのメッセージID毎に対応して送信カウンタと、自機(ECU3100a)が受信するデータフレームのメッセージID毎に対応して受信カウンタとを保持する。データフレーム生成部3102からの通知を受けてMAC生成部3110にMACが生成される度に、対応するメッセージIDの送信カウンタが1増加(インクリメント)される。また、不正データフレーム判断部3104が、受信したデータフレームが不正でないと判断し、データフレーム処理部107にそのデータフレームが通知される都度、対応するメッセージIDの受信カウンタが1増加(インクリメント)される。これにより、メッセージID毎のイベントドリブンデータフレームの送信側のECUが保持する送信カウンタと受信側のECUが保持する受信カウンタとが同じ値となるよう同期する。MAC生成部3110は、データフレームの送信のためのMACの生成の際には送信カウンタを用いてMACを生成し、受信したデータフレームの検証のためのMACの生成の際には受信カウンタを用いてMACを生成する。
The
[3.4 ECU3100aにおけるデータフレームの送信処理]
以下、ECU3100aがデータフレームをバス200に送信し、ECU3100bがデータフレームをバス200から受信する例を想定して、ECU3100aにおけるデータフレームの送信処理を説明する。
[3.4 Data Frame Transmission Process in
Hereinafter, assuming that the
図23は、ECU3100aにおけるデータフレームの送信処理を示すフローチャートである。
FIG. 23 is a flowchart showing a data frame transmission process in the
ECU3100aは、データフレーム生成ルールにおける送信周期に従った送信タイミング(前回の送信から送信周期が経過したタイミング)、或いは、センサ値取得部109からのセンサ値が変化したタイミングで、データフレームの生成が必要となり、図23の送信処理を開始する。送信処理においては、まず、ECU3100aは、送信するデータフレームがイベントドリブンデータフレームか周期的なデータフレームかを判断する(ステップS3101)。
The
ECU3100aは、ステップS3101において、送信するデータフレームが、データフレーム生成ルールにおける送信周期に従っていないイベントドリブンデータフレームであると判断した場合には、イベントドリブンデータフレームフォーマットに従って、生成するデータフレームのデータフィールドのMACフィールドIに、MACを付与する(ステップS3102)。
When the
ECU3100aは、ステップS3101において、送信するデータフレームが、データフレーム生成ルールにおける送信周期に従う周期的なデータフレームであると判断した場合(イベントドリブンデータフレームでないと判断した場合)には、ステップS3102での処理をスキップする。
If the
ECU3100aは、ステップS3102の後、或いはステップS3102での処理をスキップした後に、データフィールドのデータ領域にセンサ値取得部109から取得した最新のセンサ値をセットして、送信するデータフレームを生成し、バス200へと送信する(ステップS3103)。これにより、バス200上にデータフレームが流れ、ECU3100bに受信されるようになる。
The
なお、ECU3100bも図23に示すものと同様の送信処理を実行し得る。
Note that the
[3.5 ECU3100bにおけるデータフレームの受信処理]
以下、ECU3100aがデータフレームをバス200に送信し、ECU3100bがデータフレームをバス200から受信する例を想定して、ECU3100bにおけるデータフレームの受信処理を説明する。
[3.5 Data Frame Reception Processing in
Hereinafter, assuming that the
図24は、ECU3100bにおけるデータフレームの受信処理を示すフローチャートである。
FIG. 24 is a flowchart showing a data frame reception process in the
ECU3100bは、バス200上に現れるデータフレームを受信する(ステップS3201)。なお、ECU3100bは、自機が受信すべきメッセージIDを含まないデータフレームであればそのデータフレームを破棄して処理を終了する。自機が受信すべきメッセージIDを含むデータフレームを受信した場合に、ECU3100bは、その受信が、保持している周期ルール情報で規定された送信周期範囲内か否かを判断する(ステップS3202)。なお、ECU3100bの不正データフレーム判断部3104は、受信したデータフレームの受信間隔(つまり送信周期)が規定の送信周期の範囲内であるか否か(つまり周期ルール情報で定められた送信周期の条件を満たすか否か)を、タイマ108、受信データフレーム周期保持部3105及びデータフレーム受信履歴保持部106から得られる情報に基づいて判断する。即ち、不正データフレーム判断部3104は、前回受信時刻と今回受信したデータフレームの受信時刻の差分(受信間隔)が、受信したデータフレームのメッセージIDに対応して定められた送信周期からマージンを引いた値以上であり、かつ、その送信周期にマージンを加えた値以下であるか否かを判断する。
The
ステップS3202において、データフレームの受信間隔が送信周期の範囲内である場合には、送信周期の条件が満たされたことになり、ECU3100bは、データフレーム受信履歴保持部106が保持するリストに、受信したデータフレームのメッセージIDに対応付けて、前回受信時刻として、そのデータフレームの受信時刻を記録(つまり前回受信時刻を更新)する(ステップS3204)。そして、ステップS3204での処理に続いて、ECU3100bの不正データフレーム判断部3104により、受信したデータフレームが正当なデータフレームであると判断され(ステップS3205)、データフレーム処理部107によりそのデータフレームに対応した処理がなされる。
If the data frame reception interval is within the range of the transmission cycle in step S3202, it means that the condition of the transmission cycle is satisfied, and the
また、ステップS3202において、データフレームの前回受信時刻と今回受信時刻の差分が送信周期の範囲内でない場合には、ECU3100bは、受信データフレーム周期保持部3105に格納されているイベントドリブンデータフレームフォーマットに従ってデータフレームのデータフィールドをMACフィールドIとデータ領域とに分けて、データ領域及びメッセージIDから算出されるMACと、MACフィールドに含まれるMACとを比較することで、データフレームの正当性(MACが正しいこと)を検証する(ステップS3203)。算出されるMACとMACフィールドに含まれるMACとが一致すればMACの検証(つまりMACの正当性の検証)に成功し、受信したデータフレームが正当なデータフレームであると判断され(ステップS3205)、データフレーム処理部107によりそのデータフレームに対応した処理がなされる。
If the difference between the previous reception time and the current reception time of the data frame is not within the range of the transmission cycle in step S3202, the
ステップS3203において、算出されるMACとMACフィールドに含まれるMACとが一致しない場合(MACの検証に成功しない場合)には、ECU3100bは、受信したデータフレームが不正なデータフレームであると判断してデータフレームを破棄する(ステップS3206)。従って、ECU3100bは、不正なECUにより送信された不正なデータフレームを処理しない。
In step S3203, when the calculated MAC does not match the MAC included in the MAC field (when the MAC verification is not successful), the
なお、ステップS3202において、データフレームの受信間隔(つまり送信周期)が規定の送信周期の範囲内か否かを判断するに際して、初回等といった前回受信時刻が保存されていない場合においては、受信したデータフレームをイベントドリブンデータフレームと扱い、MACの検証に成功したときにそのデータフレームの受信時刻を前回受信時刻として記録してからステップS3205の処理を行うことができる。この場合、送信側のECUでは初回等の周期的な送信の起点においては例外的にイベントドリブンデータフレームを送信する。また、各ECUが例えばスリープ状態等に入ってデータフレームの周期的な送信を休止する期間がある場合には、その後の周期的な送信の再開時にデータフレームをイベントドリブンデータフレームとして送信することとしても良い。この場合には、受信側のECUでは前回受信時刻から一定時間以上の間、送信側のECUがスリープ状態に入って周期的な送信が途切れた場合に、前回受信時刻を無効にして次回を初回と扱い、受信したデータフレームをイベントドリブンデータフレームと扱い、その正当性を判断することができる。 In step S3202, when determining whether the reception interval (that is, the transmission cycle) of the data frames is within the range of the specified transmission cycle, if the previous reception time such as the first time is not stored, the received data is received. The frame can be treated as an event-driven data frame, and when the MAC verification is successful, the reception time of the data frame can be recorded as the previous reception time, and then the process of step S3205 can be performed. In this case, the transmission side ECU exceptionally transmits the event driven data frame at the starting point of the periodic transmission such as the first transmission. In addition, when there is a period in which each ECU enters a sleep state or the like and suspends periodic transmission of data frames, the data frame is transmitted as an event-driven data frame when the periodic transmission is resumed thereafter. Is also good. In this case, if the ECU on the transmitting side enters a sleep state for a certain period of time from the previous receiving time and the periodic transmission is interrupted, the receiving side ECU invalidates the previous receiving time and starts the next time. The received data frame is treated as an event-driven data frame, and its validity can be determined.
また、ECU3100aも図24に示すものと同様の受信処理を実行し得る。
Further, the
[3.6 実施の形態3の効果]
実施の形態3では、周期的に送信されるデータフレームに加えて、非周期的に送信されるイベントドリブンデータフレームが存在する場合でも、イベントドリブンデータフレーム内に特定識別子としてのMACを含めることによって、正当なイベントドリブンデータフレームであることを検証可能にする車載ネットワークシステム12を示した。即ち、車載ネットワークシステム12では、送信周期の条件により正当なデータフレームであるか否かを判別し、送信周期の条件によっては判別ができない場合に限って特定識別子により正当なデータフレームであるか否かを判別(つまり検証)するようにしている。これにより、送信周期の条件を満たさない正当なイベントドリブンデータフレームが不正なものとして誤検知されることが防止される。また、不正なECUがデータフレームを送信する場合には、送信周期の条件を満たさない可能性が高く、正しくMACを付与できないため、このデータフレームを受信したECUによって不正なデータフレームであると判断されるようになる。なお、イベントドリブンデータフレームではないデータフレーム(つまり周期的に送信されるデータフレーム)においては、データフィールドにMACを含める必要がないため、例えばデータフィールドを最大限に有効活用できる。
[3.6 Effect of Third Embodiment]
In the third embodiment, by including the MAC as the specific identifier in the event-driven data frame even when there is an event-driven data frame that is transmitted aperiodically in addition to the data frame that is transmitted periodically. , The in-
(実施の形態4)
以下、本開示の別の実施の形態として、データフレームを送受信するECU4100aとECU4100bとの間で、周期的に送信されるデータフレームに加えて非周期的なイベントドリブンデータフレームが送信され得る前提の下で、車両の状態を踏まえて、不正なデータフレームが送信されたことを適切に検知するための不正検知方法を実現する車載ネットワークシステム13について図面を用いて説明する。なお、車載ネットワークシステム13は、実施の形態1で示した車載ネットワークシステム10及び実施の形態3で示した車載ネットワークシステム12の一部を変形したものであり、車載ネットワークシステム13で用いられるデータフレームにおけるデータフィールドのフォーマットは、実施の形態3で示したものと同様である。
(Embodiment 4)
Hereinafter, as another embodiment of the present disclosure, it is assumed that an aperiodic event-driven data frame may be transmitted in addition to the periodically transmitted data frame between the
[4.1 車載ネットワークシステム13の全体構成]
図25は、実施の形態4に係る車載ネットワークシステム13の全体構成を示す図である。車載ネットワークシステム13は、制御装置、センサ等の各種機器が搭載された自動車におけるネットワーク通信システムである。車載ネットワークシステム13は、各種機器に接続されたECU4100a〜4100c、及び、各ECUをつなぐバス200を含んで構成される。車載ネットワークシステム13の構成要素のうち、前述した車載ネットワークシステム10等と同様の機能を有する構成要素は、同じ符号を付して説明を省略する。ECUは、例えば、プロセッサ(マイクロプロセッサ)、メモリ等のデジタル回路、アナログ回路、通信回路等を含む装置である。以下、バス200には不正なデータフレームを送信する不正なECUが接続されている可能性があることを前提として説明する。
[4.1 Overall Configuration of In-Vehicle Network System 13]
FIG. 25 is a diagram showing the overall configuration of the vehicle-mounted
ECU4100cは、ギア4130に接続されており、ギア4130の状態に応じて、車両の状態を判定し、バス200に車両の状態を示すデータフレームを送信する。ギア4130から判定される車両の状態は、例えば、走行中、駐車中等の各状態である。
The
ECU4100aは、実施の形態1で示したECU100aの一部を変形したものであり、パワーウィンドウスイッチ110に接続されている。ECU4100aは、パワーウィンドウスイッチ110の状態を示す情報を含むデータフレームを周期的にバス200に送信する。さらにパワーウィンドウスイッチ110の状態が変化した時にもパワーウィンドウスイッチ110の状態を示す情報(つまりセンサ値を示す情報)を含むデータフレームをバス200に送信する。従って、ECU4100aは、一定の送信周期でデータフレームの送信を繰り返す他に、パワーウィンドウスイッチ110の状態の変化時がその送信周期と一致しないときに非周期的なイベントドリブンデータフレームをバス200に送信することになる。またECU4100aは、ECU4100bからバス200上に送信されてバス200に流れるデータフレームを受信し、例えばECU4100aが送信したデータフレームが正しく受信されていること等を確認する。また、ECU4100aは、ECU4100cが送信した車両の状態を示すデータフレームを受信し、車両の状態を把握し得る。
The
ECU4100bは、実施の形態1で示したECU100bの一部を変形したものであり、パワーウィンドウ120に接続されている。ECU4100bは、ECU4100aから送信されバス200に流れているデータフレームを受信し、そのデータフレームに含まれるパワーウィンドウスイッチ110の状態に応じて、パワーウィンドウ120の開閉の制御を行う。またパワーウィンドウ120の開閉の制御状態に応じたデータフレームを周期的にバス200に送信する。また、ECU4100bは、ECU4100cが送信した車両の状態を示すデータフレームを受信し、車両の状態を把握し得る。この車載ネットワークシステム13においてはCANプロトコルに従って各ECUがフレームの授受を行う。各ECUは、受信したデータフレームが不正なデータフレームであるか否かを判断する機能を有している。
[4.2 ECU4100aの構成]
図26は、ECU4100aの構成図である。ECU4100aは、データフレーム送受信部101と、データフレーム生成部4102と、データフレーム生成ルール保持部4103と、不正データフレーム判断部4104と、受信データフレーム周期保持部4105と、データフレーム受信履歴保持部106と、データフレーム処理部107と、タイマ108と、センサ値取得部109と、MAC生成部3110と、MAC鍵保持部3111と、カウンタ保持部3112とを含んで構成される。ECU4100aの構成要素のうち、実施の形態1で示したECU100a或いは実施の形態3で示したECU3100aと同様の機能を有する構成要素は、同じ符号を付して説明を省略する。これらの各構成要素は、機能的な構成要素であり、その各機能は、ECU4100aにおける通信回路、メモリに格納された制御プログラムを実行するプロセッサ或いはデジタル回路等により実現される。なお、ECU4100b及びECU4100cもECU4100aと基本的に同様の構成を備える。但し、データフレーム生成ルール保持部4103、受信データフレーム周期保持部4105及びデータフレーム受信履歴保持部106の各保持内容はECU毎に異なる内容となり得る。また、データフレーム処理部107の処理内容は、ECU毎に異なる。
[4.2 Configuration of
FIG. 26 is a configuration diagram of the
データフレーム生成部4102は、データフレーム生成ルール保持部4103に格納されたデータフレーム生成ルールに従い、データフレームを生成し、データフレーム送受信部101に送信する。データフレーム生成部4102は、タイマ108から現在時刻を取得する。更にデータフレーム生成部4102は、ECU4100aに接続された機器(パワーウィンドウスイッチ110)に関するデータ(センサ値)をセンサ値取得部109から取得する。ECU4100aからデータフレームを周期的に送信すべく、データフレーム生成部4102は、現在時刻とデータフレーム生成ルール保持部4103に格納される送信周期とによって、データフレームを生成するタイミングを決定し、データフレームの生成を周期的に行う。なお、データフレーム生成部4102によりデータフレームが生成されると、そのデータフレームはデータフレーム送受信部101に通知され、データフレーム送受信部101はそのデータフレームの送信を行う。更に、データフレーム生成部4102は、センサ値取得部109から取得されるセンサ値に変化があった時が、周期的なタイミングとは異なる時である場合には、イベントドリブンデータフレームの生成を行う。イベントドリブンデータフレームを生成する際には、データフレーム生成部4102は、データフレーム生成ルール保持部4103に格納されているメッセージID毎のデータフレーム生成ルールのMAC付与条件(後述)に基づいてMACをイベントドリブンデータフレームに含めるか否かを判断し、MACを含めると判断した場合にはイベントドリブンデータフレームフォーマットに従ってMACをデータフレームに含める。MACは、実施の形態3で説明したものと同様である。即ち、データフレーム生成部4102も実施の形態3で示したデータフレーム生成部3102と同様に、送信周期を示すデータフレーム生成ルールに適合しないタイミングでデータフレームの送信をする際においてデータフレーム中にMACという特定識別子を付与したデータフレームを生成する付与部としての機能を有する。データフレーム生成部4102によるデータフレームの生成の結果として、データフレーム送受信部101によりECU3100aからバス200に、周期的にデータフレームが送信され、更に、非周期的にイベントドリブンデータフレームが送信される。また、データフレーム生成部4102は、ECU4100aが送信を行う初回等(例えばエンジン始動時或いはその前、スリープ状態からの復帰時等)の周期的な送信の起点においてはデータフレームをイベントドリブンデータフレームの形式にして送信する。周期的な送信の起点においてイベントドリブンデータフレームではない周期的なデータフレームとしてしまうと、受信側で送信周期の条件に係る判断ができないからである。なお、初回等においてはイベントドリブンデータフレームにMACを含めることにしても良い。
The data
データフレーム生成ルール保持部4103は、メモリ等の記憶媒体で実現され、データフレーム生成ルールとしてECU4100aが送信するメッセージID毎に周期的にデータフレームを送信するための送信周期と、MACの格納位置、データ長等を示すイベントドリブンデータフレームフォーマットと、イベントドリブンデータフレームにMACを付与する条件であるMAC付与条件とを格納している。MAC付与条件は、車両の状態がどのような場合にMACを付与すべきかについて定めている。図27は、データフレーム生成ルール保持部4103に格納されたデータフレーム生成ルールの一例を示している。ここでは、ECU4100aは、パワーウィンドウスイッチ110の状態を示すデータフレーム等、複数種類のデータフレーム(種類毎にメッセージIDで識別されるデータフレーム)を送信するものとする。図27の例では、ECU4100aから周期的に送信されるメッセージIDが0x100のデータフレームについては、送信周期が50msであり、この送信周期に従わずイベントドリブンデータフレームとして送信する場合には、車両の状態が走行中であるときに限ってMACを付与し、MACを付与する際にはデータフィールドの下位16ビットにMACを格納する必要があることを示している。また、メッセージIDが0x200のデータフレームについては、送信周期が100msであり、メッセージIDが0x200のイベントドリブンデータフレームは送信されないことを示している。また、ECU4100aから周期的に送信されるメッセージIDが0x300のデータフレームについては、送信周期が70msであり、この送信周期に従わずイベントドリブンデータフレームとして送信する場合には、車両の状態が走行中であるとき及び駐車中であるときにMACを付与し、MACを付与する際にはデータフィールドの下位16ビットにMACを格納する必要があることを示している。
The data frame generation
不正データフレーム判断部4104は、受信したデータフレームが正当なデータフレームであるか(不正なデータフレームでないか)否かについて判断する。即ち、不正データフレーム判断部4104は、受信データフレーム周期保持部4105の周期ルール情報を参照して、メッセージID毎に予め定められた送信周期の条件を満たすか否かを確認し、送信周期の条件を満たす場合には正規のECUから送信されたデータフレーム(正当なデータフレーム)であると判断する。また、不正データフレーム判断部4104は、送信周期の条件を満たさないデータフレームであっても、車状態保持部4113に格納されている車両の状態が受信データフレーム周期保持部4105に格納されているMAC付与イベントドリブンデータフレーム受信条件を満たす場合には、イベントドリブンデータフレームフォーマットに従ってデータフレームにMACが含まれていることを検証することで不正なデータフレームか否かを判断する。MAC付与イベントドリブンデータフレーム受信条件は、車両の状態がどのような場合にMACが付与されたイベントドリブンデータフレームを受信するかを示す条件である。不正データフレーム判断部4104は、車両の状態がMAC付与イベントドリブンデータフレーム受信条件を満たす場合においてデータフィールド内のMACの検証に成功すれば、受信したデータフレームが正当であると判断し、検証に失敗すれば、受信したデータフレームが不正なデータフレームであると判断する。即ち、不正データフレーム判断部4104は、実施の形態3で示した不正データフレーム判断部3104と同様に、送信周期を示すデータフレーム生成ルールに呼応した周期ルール情報に適合しないデータフレームがデータフレーム送受信部101により受信された場合に、そのデータフレーム中のMACという特定識別子を検証する検証部としての機能を有する。MACの検証は、データフレームのメッセージID及びデータフィールドのデータ領域の内容をMAC生成部3110に通知することによってMAC生成部3110から得られる値と、データフィールド内のMACフィールドIの内容とが、一致するか否かを判別することで行われ、一致した場合に検証に成功する。不正データフレーム判断部4104は、受信したデータフレームが予め定められた送信周期の条件を満たさず、かつ、車両の状態がMAC付与イベントドリブンデータフレーム受信条件を満たさない場合には、MACの検証を行わないでイベントドリブンデータフレームを正当なデータフレームであると判断する。つまり、イベントドリブンデータフレームについて、車両の状態がMAC付与イベントドリブンデータフレーム受信条件を満たす場合にはMACを検証し、その他の場合には検証を省略している。但し、周期的な送信の初回等において送信側がイベントドリブンデータフレームにMACを含めることにする場合には、対応したMACの検証を受信側で行うと良い。なお、不正データフレーム判断部4104は、送信周期の条件を満たすデータフレームを受信した場合に、受信時刻をデータフレーム受信履歴保持部106に前回受信時刻として記録する。不正データフレーム判断部4104は、受信したデータフレームが正当なデータフレームであると判断した場合には、データフレーム処理部107にそのデータフレームの処理を行わせ、不正なデータフレームであると判断した場合には、そのデータフレームを破棄する(つまりそのデータフレームについてデータフレーム処理部107に処理させない)。
The invalid data
受信データフレーム周期保持部4105は、メモリ等の記憶媒体で実現され、周期ルール情報を保持する。この周期ルール情報は、自機(ECU4100a)が受信するデータフレームのメッセージID毎に、予め定められた送信周期と、データフレームの受信間隔について、送信周期の条件が満たされる(つまり正当な送信周期に合致する)と判断されるための許容範囲を示すマージンとを対応付けた情報である。周期ルール情報には、更に、送信周期の条件を満たさないイベントドリブンデータフレームのデータフィールド内に格納されるMACの格納位置、データ長等を示すイベントドリブンデータフレームフォーマットとMAC付与イベントドリブンデータフレーム受信条件とが含まれる。イベントドリブンデータフレームフォーマットは、不正データフレーム判断部4104が、イベントドリブンデータフレームについての正当性を検証(つまりMACを検証)する際に用いられる。また、MAC付与イベントドリブンデータフレーム受信条件は、車両の状態に係る条件であり、車両の状態がどの状態であればイベントドリブンデータフレームについてMACを検証すべきかを示す。なお、データフレームの受信側のECUの受信データフレーム周期保持部4105に保持される周期ルール情報における送信周期は、そのデータフレームの送信側のECUのデータフレーム生成ルール保持部4103に保持されるデータフレーム生成ルールにおける送信周期に呼応する。また、データフレームの受信側のECUの受信データフレーム周期保持部4105に保持される周期ルール情報におけるイベントドリブンデータフレームフォーマットは、そのデータフレームの送信側のECUのデータフレーム生成ルール保持部4103に保持されるデータフレーム生成ルールにおけるイベントドリブンデータフレームフォーマットに呼応する。また、データフレームの受信側のECUの受信データフレーム周期保持部4105に保持される周期ルール情報におけるMAC付与イベントドリブンデータフレーム受信条件は、そのデータフレームの送信側のECUのデータフレーム生成ルール保持部4103に保持されるデータフレーム生成ルールにおけるMAC付与条件に呼応する。図28は、ECU4100aから送信されたデータフレームを受信するECU4100bにおける受信データフレーム周期保持部4105に格納された周期ルール情報の一例を示す図である。同図の例では、メッセージIDが0x100のデータフレームの送信周期が50ms、メッセージIDが0x200のデータフレームの送信周期が100ms、メッセージIDが0x300のデータフレームの送信周期が70msであることを示している。同図の例では、マージンは、どのメッセージIDについても1msである。このマージンが1msであるため、メッセージIDが0x100のデータフレームについて送信周期が49ms以上51ms以下の範囲であれば、ECU4100bにおける不正データフレーム判断部4104は、送信周期の条件が満たされると判断することになる。また、図28の例でのイベントドリブンデータフレームフォーマットについては、メッセージIDが0x100及び0x300のイベントドリブンデータフレームは、データフィールドの下位16ビットにMACが付与されていることを示しており、メッセージIDが0x200のイベントドリブンデータフレームは送信されないことを示している。また、図28の例でのMAC付与イベントドリブンデータフレーム受信条件については、メッセージIDが0x100のイベントドリブンデータフレームは車両の状態が走行中であるときにMACの検証が必要であることを示し、メッセージIDが0x200のイベントドリブンデータフレームは送信されないのでMACの検証が不要であることを示し、メッセージIDが0x300のイベントドリブンデータフレームは車両の状態が走行中及び駐車中のいずれかの状態であるときにMACの検証が必要であることを示している。
The received data frame
車状態保持部4113は、メモリ等の記憶媒体で実現され、車両の状態を示す値が格納される。図29に車状態保持部4113に格納された車両の状態の一例を示している。この例では車両の状態が、走行中であることを示している。車状態保持部4113における車両の状態は、ECU4100cから送信されるデータフレーム(車両の状態を示すデータフレーム)が受信され、正当なデータフレームであると判断された場合に、データフレーム処理部107により、そのデータフレームの内容に応じて格納(更新)がなされる。
The vehicle
[4.3 ECU4100aにおけるデータフレームの送信処理]
以下、ECU4100aがデータフレームをバス200に送信し、ECU4100bがデータフレームをバス200から受信する例を想定して、ECU4100aにおけるデータフレームの送信処理を説明する。
[4.3 Data Frame Transmission Process in
Hereinafter, assuming that the
図30は、ECU4100aにおけるデータフレームの送信処理を示すフローチャートである。
FIG. 30 is a flowchart showing a data frame transmission process in the
ECU4100aは、データフレーム生成ルールにおける送信周期に従った送信タイミング(前回の送信から送信周期が経過したタイミング)、或いは、センサ値取得部109からのセンサ値が変化したタイミングで、データフレームの生成が必要となり、図30の送信処理を開始する。送信処理においては、まず、ECU4100aは、送信するデータフレームがイベントドリブンデータフレームか周期的なデータフレームかを判断する(ステップS4101)。
The
ECU4100aは、ステップS4101において送信するデータフレームがデータフレーム生成ルールにおける送信周期に従っていないイベントドリブンデータフレームであると判断した場合には、ECU4100cからのデータフレームに対応して車状態保持部4113に格納された車両の状態がデータフレーム生成ルールのMAC付与条件を満たすか否かを判断する(ステップS4102)。例えば、MAC付与条件が、走行中及び駐車中のいずれかを示し、ECU4100aからのデータフレームで示された車両の状態(車状態保持部4113の車両の状態)が走行中を示す場合には、車両の状態がMAC付与条件を満たすと判断される。
When the
ECU4100aは、ステップS4102において、車両の状態がMAC付与条件を満たすと判断した場合には、データフレーム生成ルールのイベントドリブンデータフレームフォーマットに従って、生成するデータフレームのデータフィールドのMACフィールドIに、MACを付与する(ステップS4103)。
When it is determined in step S4102 that the vehicle state satisfies the MAC assignment condition, the
ECU4100aは、ステップS4101において、送信するデータフレームが、データフレーム生成ルールにおける送信周期に従う周期的なデータフレームであると判断した場合(イベントドリブンデータフレームでないと判断した場合)には、ステップS4102、S4103での処理をスキップする。また、ECU4100aは、ステップS4102において、車両の状態がMAC付与条件を満たさないと判断した場合には、ステップS4103での処理をスキップする。
When the
ECU4100aは、ステップS4103の後、或いはステップS4103での処理をスキップした後に、データフィールドのデータ領域にセンサ値取得部109から取得した最新のセンサ値をセットして、送信するデータフレームを生成し、バス200へと送信する(ステップS4104)。これにより、バス200上にデータフレームが流れ、ECU4100bに受信されるようになる。
The
なお、ECU4100bも図30に示すものと同様の送信処理を実行し得る。
Note that the
[4.4 ECU4100bにおけるデータフレームの受信処理]
以下、ECU4100aがデータフレームをバス200に送信し、ECU4100bがデータフレームをバス200から受信する例を想定して、ECU4100bにおけるデータフレームの受信処理を説明する。
[4.4 Reception Processing of Data Frame in
Hereinafter, assuming that the
図31は、ECU4100bにおけるデータフレームの受信処理を示すフローチャートである。
FIG. 31 is a flowchart showing a data frame reception process in the
ECU4100bは、バス200上に現れるデータフレームを受信する(ステップS4201)。なお、ECU4100bは、自機が受信すべきメッセージIDを含まないデータフレームであればそのデータフレームを破棄して処理を終了する。自機が受信すべきメッセージIDを含むデータフレームを受信した場合に、ECU4100bは、その受信が、保持している周期ルール情報で規定された送信周期範囲内か否かを判断する(ステップS4202)。なお、ECU4100bの不正データフレーム判断部4104は、受信したデータフレームの受信間隔(つまり送信周期)が規定の送信周期の範囲内であるか否か(つまり周期ルール情報で定められた送信周期の条件を満たすか否か)を、タイマ108、受信データフレーム周期保持部4105及びデータフレーム受信履歴保持部106から得られる情報に基づいて判断する。即ち、不正データフレーム判断部4104は、前回受信時刻と今回受信したデータフレームの受信時刻の差分(受信間隔)が、受信したデータフレームのメッセージIDに対応して定められた送信周期からマージンを引いた値以上であり、かつ、その送信周期にマージンを加えた値以下であるか否かを判断する。
The
ステップS4202において、データフレームの受信間隔が送信周期の範囲内である場合には、送信周期の条件が満たされたことになり、ECU4100bは、データフレーム受信履歴保持部106が保持するリストに、受信したデータフレームのメッセージIDに対応付けて、前回受信時刻として、そのデータフレームの受信時刻を記録(つまり前回受信時刻を更新)する(ステップS4204)。そして、ステップS4204での処理に続いて、ECU4100bの不正データフレーム判断部4104により、受信したデータフレームが正当なデータフレームであると判断され(ステップS4206)、データフレーム処理部107によりそのデータフレームに対応した処理がなされる。
If the data frame reception interval is within the range of the transmission cycle in step S4202, it means that the condition of the transmission cycle is satisfied, and the
また、ステップS4202において、データフレームの前回受信時刻と今回受信時刻の差分が送信周期の範囲内でない場合には、ECU4100bは、車両の状態がMAC付与イベントドリブンデータフレーム受信条件を満たすか否かを判断する(ステップS4203)。即ち、ECU4100bは、ECU4100cからのデータフレームに対応して車状態保持部4113に格納された車両の状態が、MAC付与イベントドリブンデータフレーム受信条件を満たすか否かを判断する。
If the difference between the previous reception time and the current reception time of the data frame is not within the range of the transmission cycle in step S4202, the
ステップS4203において、車両の状態がMAC付与イベントドリブンデータフレーム受信条件を満たすと判断した場合には、ECU4100bは、受信データフレーム周期保持部4105に格納されているイベントドリブンデータフレームフォーマットに従ってデータフレームのデータフィールドをMACフィールドIとデータ領域とに分けて、データ領域及びメッセージIDから算出されるMACと、MACフィールドに含まれるMACとを比較することで、データフレームの正当性(MACが正しいこと)を検証する(ステップS4205)。算出されるMACとMACフィールドに含まれるMACとが一致すればMACの検証(つまりMACの正当性の検証)に成功し、受信したデータフレームが正当なデータフレームであると判断され(ステップS4206)、データフレーム処理部107によりそのデータフレームに対応した処理がなされる。
If it is determined in step S4203 that the state of the vehicle satisfies the MAC-added event-driven data frame reception condition, the
ステップS4205において、算出されるMACとMACフィールドに含まれるMACとが一致しない場合(MACの検証に成功しない場合)には、ECU4100bは、受信したデータフレームが不正なデータフレームであると判断してデータフレームを破棄する(ステップS4207)。従って、ECU4100bは、不正なECUにより送信された不正なデータフレームを処理しない。
In step S4205, when the calculated MAC does not match the MAC included in the MAC field (when the MAC verification is not successful), the
また、ステップS4203において車両の状態がMAC付与イベントドリブンデータフレーム受信条件を満たさないと判断した場合には、ECU4100bは、受信したデータフレームが正当なデータフレームである判断し(ステップS4206)、データフレーム処理部107によりそのデータフレームに対応した処理を行う。
If it is determined in step S4203 that the vehicle state does not satisfy the MAC addition event driven data frame reception condition, the
なお、ステップS4202において、データフレームの受信間隔(つまり送信周期)が規定の送信周期の範囲内か否かを判断するに際して、初回等といった前回受信時刻が保存されていない場合においては、受信したデータフレームをイベントドリブンデータフレームと扱い、MACの検証に成功したときにそのデータフレームの受信時刻を前回受信時刻として記録してからステップS4206の処理を行うことができる。この場合、送信側のECUでは初回等の周期的な送信の起点においては例外的にMACを付与したイベントドリブンデータフレームを送信する。また、各ECUが例えばスリープ状態等に入ってデータフレームの周期的な送信を休止する期間がある場合には、その後の周期的な送信の再開時にデータフレームをイベントドリブンデータフレームとして送信することとしても良い。この場合には、受信側のECUでは前回受信時刻から一定時間以上の間、送信側のECUがスリープ状態に入って周期的な送信が途切れた場合に、前回受信時刻を無効にして次回を初回と扱い、受信したデータフレームをイベントドリブンデータフレームと扱い、その正当性を判断することができる。 In step S4202, when determining whether the reception interval (that is, the transmission cycle) of the data frame is within the range of the specified transmission cycle, if the previous reception time such as the first time is not stored, the received data is received. The frame can be treated as an event driven data frame, and when the MAC verification is successful, the reception time of the data frame can be recorded as the previous reception time, and then the process of step S4206 can be performed. In this case, the transmission side ECU exceptionally transmits the event driven data frame to which the MAC is added at the starting point of the periodic transmission such as the first transmission. In addition, when there is a period in which each ECU enters a sleep state or the like and suspends periodic transmission of data frames, the data frame is transmitted as an event-driven data frame when the periodic transmission is resumed thereafter. Is also good. In this case, if the ECU on the transmitting side enters a sleep state for a certain period of time from the previous receiving time and the periodic transmission is interrupted, the receiving side ECU invalidates the previous receiving time and starts the next time. The received data frame is treated as an event-driven data frame, and its validity can be determined.
また、ECU4100aも図31に示すものと同様の受信処理を実行し得る。
Further, the
[4.5 ECU4100cにおける車両の状態を示すデータフレームの送信処理]
以下、ECU4100cが車両の状態を取得して車両の状態を示すデータフレームをバス200に送信する送信処理を説明する。
[4.5 Transmission Processing of Data Frame Showing Vehicle State in
Hereinafter, a transmission process in which the
図32は、ECU4100cにおける車両の状態を示すデータフレームの送信処理を示すフローチャートである。同図に示す処理は、ECU4100cにより繰り返し実行される。
FIG. 32 is a flowchart showing a transmission process of a data frame showing the state of the vehicle in the
ECU4100cは、接続されているギア4130の状態をセンサから取得する(ステップS4301)。
The
ECU4100cは、取得したギア4130の状態が前回取得した状態から変化したか否かを判断し(ステップS4302)、ギア4130の状態が変化した場合には、予め定められているギア4130の状態(例えば、ギアポジションについてパーキング、1速、2速等)と車両の状態(走行中、駐車中等)との対応関係に基づいて、車両の状態を特定してその車両の状態をデータフィールドの内容として含ませたデータフレームを生成し、イベントドリブンデータフレームとしてバス200へと送信する(ステップS4303)。
The
なお、ECU4100cは、イベントドリブンデータフレームにはMACを付与して送信しても良く、この場合には、ECU4100a及びECU4100bは、バス200から受信したイベントドリブンデータフレームのMACを検証して、検証に成功した場合に限って車両の状態を取得して車状態保持部4113に格納することになる。
It should be noted that the
[4.6 ECU4100bにおけるデータフレームの受信処理の変形例]
上述したデータフレームの受信処理(図31参照)においては、ステップS4203において車両の状態がMAC付与イベントドリブンデータフレーム受信条件を満たさない場合には、受信したデータフレームを正当であると判断することとしたが、車両の状態がMAC付与イベントドリブンデータフレーム受信条件を満たさない場合には、受信したデータフレームを不正なデータフレームであると判断して破棄するように変形しても良い。以下、受信処理の変形例について示す。
[4.6 Modification of Data Frame Reception Processing in
In the above-described data frame reception process (see FIG. 31), if the vehicle state does not satisfy the MAC addition event driven data frame reception condition in step S4203, it is determined that the received data frame is valid. However, when the vehicle state does not satisfy the MAC-added event-driven data frame reception condition, the received data frame may be determined to be an invalid data frame and may be discarded. Hereinafter, modified examples of the reception process will be described.
図33は、ECU4100bにおけるデータフレームの受信処理の変形例を示すフローチャートである。
FIG. 33 is a flowchart showing a modification of the data frame reception process in
ECU4100bは、バス200上に現れるデータフレームを受信する(ステップS4401)。ECU4100bは、自機が受信すべきメッセージIDを含むデータフレームを受信した場合に、その受信が、保持している周期ルール情報で規定された送信周期範囲内か否かを判断する(ステップS4402)。ステップS4402において、データフレームの受信間隔が送信周期の範囲内である場合には、ECU4100bは、データフレーム受信履歴保持部106が保持するリストに、受信したデータフレームのメッセージIDに対応付けて、前回受信時刻として、そのデータフレームの受信時刻を記録する(ステップS4404)。そして、ステップS4404での処理に続いて、ECU4100bの不正データフレーム判断部4104により、受信したデータフレームが正当なデータフレームであると判断され(ステップS4406)、データフレーム処理部107によりそのデータフレームに対応した処理がなされる。
The
また、ステップS4402においてデータフレームの受信が規定された送信周期範囲内でないと判断した場合には、ECU4100bは、車両の状態がMAC付与イベントドリブンデータフレーム受信条件を満たすか否かを判断する(ステップS4403)。
If it is determined in step S4402 that the reception of the data frame is not within the specified transmission cycle range, the
ステップS4403において、車両の状態がMAC付与イベントドリブンデータフレーム受信条件を満たすと判断した場合には、ECU4100bは、受信データフレーム周期保持部4105に格納されているイベントドリブンデータフレームフォーマットに基づいてデータ領域及びメッセージIDから算出されるMACと、MACフィールドに含まれるMACとを比較することで、データフレームの正当性(MACが正しいこと)を検証する(ステップS4405)。MACが正しいことを検証した場合にはECU4100bは、受信したデータフレームを正当なデータフレームであると判断し(ステップS4406)、データフレーム処理部107によりそのデータフレームに対応した処理を行う。
If it is determined in step S4403 that the state of the vehicle satisfies the MAC-added event-driven data frame reception condition, the
ステップS4403において車両の状態がMAC付与イベントドリブンデータフレーム受信条件を満たさないと判断した場合、及び、ステップS4405においてMACが正しいことの検証に成功しない場合には、ECU4100bは、受信したデータフレームが不正なデータフレームであると判断してデータフレームを破棄する(ステップS4407)。従って、ECU4100bは、不正なECUにより送信された不正なデータフレームを処理しない。
If it is determined in step S4403 that the vehicle state does not satisfy the MAC-added event-driven data frame reception condition, and if the verification that the MAC is correct is not successful in step S4405, the
[4.7 実施の形態4の効果]
実施の形態4では、周期的に送信されるデータフレームに加えて、非周期的に送信されるイベントドリブンデータフレームが存在する場合でも、イベントドリブンデータフレーム内に特定識別子としてのMACを含めることによって、正当なイベントドリブンデータフレームであることを検証可能にする車載ネットワークシステム13を示した。即ち、車載ネットワークシステム13では、送信周期の条件により正当なデータフレームであるか否かを判別し、送信周期の条件によっては判別ができない場合に限って特定識別子により正当なデータフレームであるか否かを判別(つまり検証)するようにしている。これにより、送信周期の条件を満たさない正当なイベントドリブンデータフレームが不正なものとして誤検知されることが防止される。また、不正なECUがデータフレームを送信する場合には、送信周期の条件を満たさない可能性が高く、正しくMACを付与できないため、このデータフレームを受信したECUによって不正なデータフレームであると判断されるようになる。またイベントドリブンデータフレームについても、車両の状態に応じてMACを付与及び検証するか否かを切り替えることによって、効率的に不正なデータフレームの検知が可能となる。
[4.7 Effects of Fourth Embodiment]
In the fourth embodiment, by including the MAC as the specific identifier in the event-driven data frame even when there is an event-driven data frame that is transmitted aperiodically in addition to the data frame that is transmitted periodically. , The in-
(他の実施の形態等)
以上のように、本開示に係る技術の例示として実施の形態1〜4を説明した。しかしながら、本開示に係る技術は、これに限定されず、適宜、変更、置き換え、付加、省略等を行った実施の形態にも適用可能である。例えば、以下のような変形例も本開示の一実施態様に含まれる。
(Other embodiments, etc.)
As described above,
(1)上記実施の形態では、イベントドリブンデータフレームを送信するECUがイベントドリブンデータフレームにイベントドリブン識別フラグ、イベントカウンタ、或いは、所定演算の結果値であるMACという特定識別子を付与し、イベントドリブンデータフレームを受信するECUで特定識別子を検証する例を示したが、特定識別子は例示した以外の形式の情報であっても良い。特定識別子の検証は、例えば、データフレームの所定位置における所定データ長のデータ値が、固定値又は所定演算により導出される値と一致するか否かを検査し、一致すれば検証に成功したと扱い、一致しなければ検証に失敗したと扱う処理手順等である。なお、上記実施の形態ではデータフレームを受信するECUが、データフレームが送信周期に係るルール(条件)に適合しないイベントドリブンデータフレームであると判断した後に特定識別子の検証を行う例を示したが、データフレーム中の特定識別子の検証を、送信周期のルールに適合するか否かの判断より前に、或いは、その判断と同時に、行っても良い。 (1) In the above embodiment, the ECU that transmits the event-driven data frame assigns the event-driven data frame with the event-driven identification flag, the event counter, or the specific identifier called MAC that is the result value of the predetermined operation, and the event-driven data frame is transmitted. Although the example in which the specific identifier is verified by the ECU that receives the data frame has been shown, the specific identifier may be information in a format other than the example. The verification of the specific identifier is performed, for example, by checking whether or not the data value of the predetermined data length at the predetermined position of the data frame matches a fixed value or a value derived by a predetermined calculation, and if they match, the verification is successful. The processing procedure, etc. is handled as if the verification fails if they do not match. In the above embodiment, the example in which the ECU that receives the data frame verifies the specific identifier after determining that the data frame is the event driven data frame that does not conform to the rule (condition) relating to the transmission cycle has been described. The verification of the specific identifier in the data frame may be performed before or simultaneously with the determination as to whether or not the rule of the transmission cycle is met.
(2)上記実施の形態では、メッセージIDとデータ値とカウンタ値とに基づく演算によりMACを生成(計算)しているが、データフレームの一部の内容を反映して(つまり一部の内容に基づいて)MACを生成すれば良く、データ値のみからMACを生成することとしても良い。またカウンタ値のみからMACを生成するとしても良い。データフレームを受信するECUにおけるMACの検証方式は、データフレームを送信するECUがデータフレームにMACを付与する方式に対応したものであれば良い。また、MACを付与するデータフレームにおいてはデータフィールド内にデータ値及びMACの他に、一部又は全てのカウンタ値を含めても良い。また、上記実施の形態では、MAC算出のアルゴリズムをHMACとしているが、これCBC−MAC(Cipher Block Chaining Message Authentication Code)、CMAC(Cipher-based MAC)であっても良い。また、MAC計算に用いられるパディングについては、ゼロパディング、ISO10126、PKCS#1、PKCS#5、PKCS#7、その他、ブロックのデータサイズが計算に必要となるパディングの方式であれば何でも良い。
(2) In the above embodiment, the MAC is generated (calculated) by the operation based on the message ID, the data value, and the counter value, but a part of the content of the data frame is reflected (that is, a part of the content). The MAC may be generated based on the above), or the MAC may be generated only from the data value. Further, the MAC may be generated only from the counter value. The MAC verification method in the ECU that receives the data frame may be any method that corresponds to the method in which the ECU that transmits the data frame adds the MAC to the data frame. Further, in the data frame to which the MAC is added, some or all of the counter values may be included in the data field in addition to the data value and the MAC. In the above embodiment, the MAC calculation algorithm is HMAC, but CBC-MAC (Cipher Block Chaining Message Authentication Code) or CMAC (Cipher-based MAC) may be used. The padding used in the MAC calculation may be zero padding, ISO10126,
(3)上記実施の形態では、車両の状態として走行中及び駐車中という2つの状態について説明したが、停車中、高速走行中、低速走行中、バック中、エンジン停止等の各種状態を区別し、各種状態のうち、イベントドリブンデータフレームにMACを付与及び検証すべき条件としての車両の状態を定めても良い。例えば、不正なECUにより不正なデータフレームがバス上に送信された場合に不正であることを検知する必要性が比較的高いタイミングに対応するように、MACを付与及び検証すべき条件としての車両の状態を定めること等が有用となり得る。また、車両の状態は、必ずしもギア4130の状態に基づいて判断する必要はなく、車両内のいずれかのECUがいずれかの機器から取得したセンサ値等を含むデータフレームを送信し、他のECUがそのデータフレームを受信することによって車両の状態を判断することとしても良い。例えば、走行スピードに関する情報等を示すデータフレームをECU間で送受信することで、そのデータフレームを受信した各ECUがそのデータフレームに基づいて車両の状態として高速走行中であること等を判断できるようにしても良い。このため、例えば車両の状態示すデータフレームを送信するECU4100cが必ずしもギア4130に接続されている必要はない。受信したデータフレームに基づいて各ECUが同様に車両の状態を判断すれば、あるECUが、MAC付与が必要な車両の状態である場合にMACを付与してデータフレームを送信すると、受信側のECUはその車両の状態に基づいてMACの検証が必要であることを認識して検証を行い得る。
(3) In the above embodiment, the two states of running and parking are described as the state of the vehicle. However, various states such as stopped, high speed running, low speed running, backing, and engine stop are distinguished. Of the various states, the state of the vehicle may be set as a condition for assigning and verifying the MAC to the event driven data frame. For example, a vehicle as a condition for assigning and verifying a MAC so as to correspond to a timing when there is a relatively high need to detect that a fraudulent data frame is transmitted on a bus by a fraudulent ECU. It may be useful to determine the state of. Further, the state of the vehicle does not necessarily need to be determined based on the state of the
(4)上記実施の形態では、イベントドリブンデータフレームを識別するための特定識別子としてイベントドリブン識別フラグ、イベントカウンタ、MACを用いる例について、それぞれ説明したが、イベントドリブン識別フラグ、イベントカウンタ及びMACの2つ以上を組み合わせて用いることとしても良い。例えば、データフレームを受信したECUが、イベントドリブン識別フラグによってイベントドリブンデータフレームであることを判断してから、MACによってデータフレームの正当性を検証することとしても良い。なお、イベントドリブンデータフレームでないデータフレームについては特定識別子を付与しても構わないが、付与する必要はない。 (4) In the above embodiments, the example in which the event-driven identification flag, the event counter, and the MAC are used as the specific identifiers for identifying the event-driven data frame has been described. Two or more may be used in combination. For example, the ECU that receives the data frame may determine the validity of the data frame by the MAC after determining that it is the event driven data frame by the event driven identification flag. A specific identifier may be added to a data frame that is not an event driven data frame, but it need not be added.
(5)上記実施の形態では、各ECUはデータフレームを送信することとしたが、車載ネットワークシステムは、データフレームを受信するのみでデータフレームを送信しないECUを含んでいても良い。また逆に、車載ネットワークシステムは、データフレームを送信するのみで、データフレームを受信しないECUを含んでいても良い。また、各ECUは必ずしも周期的なデータフレームの送信をしなくても良く、車載ネットワークシステムは、イベントドリブンデータフレームのみを送信するECUを含んでいても良い。 (5) In the above embodiment, each ECU transmits a data frame, but the vehicle-mounted network system may include an ECU that only receives the data frame and does not transmit the data frame. Conversely, the vehicle-mounted network system may include an ECU that only transmits a data frame and does not receive the data frame. Further, each ECU does not necessarily have to periodically transmit the data frame, and the vehicle-mounted network system may include an ECU that transmits only the event driven data frame.
(6)上記実施の形態では、ECUがパワーウィンドウスイッチ或いはパワーウィンドウに接続されている構成を例示したが、ECUは、パワーウィンドウスイッチ及びパワーウィンドウに限らず、その他の機器に接続されても良く、その機器の制御、その機器からの状態の取得等を行っても良い。 (6) In the above embodiment, the ECU is illustrated as being connected to the power window switch or the power window, but the ECU is not limited to the power window switch and the power window, and may be connected to other devices. The control of the device, the acquisition of the status from the device, etc. may be performed.
(7)上記実施の形態では、ECUは不正なデータフレームを検知した場合に、データフレームを破棄することとしたが、必ずしも破棄する必要はなく、不正なデータフレームを検知した場合に例えば不正を検知したことを知らせるデータフレームを送信しても良く、また例えばその送信するデータフレームには不正なデータフレームに関する情報を含めても良い。また、不正なデータフレームを検知した場合に、例えば、ログとして記録すること、或いは、車両の動作モードをより安全性を高める状態等に変更すること等の処理を行っても良い。 (7) In the above embodiment, the ECU discards a data frame when it detects an invalid data frame. However, it is not always necessary to discard the data frame. A data frame notifying that the data has been detected may be transmitted, and, for example, the transmitted data frame may include information regarding an invalid data frame. Further, when an unauthorized data frame is detected, for example, a process of recording it as a log, or changing the operation mode of the vehicle to a state that enhances safety, or the like may be performed.
(8)上記実施の形態では、イベントドリブンデータフレームの送信毎、及び、受信毎に各ECUの該当の送信カウンタ或いは受信カウンタが1増加(インクリメント)されることとしたが、これらのカウンタの値に対する演算は、1増加には限定されない。これらのカウンタの値に対する演算は、データフレームの送信側と受信側で同様の計算ができ、送信カウンタと受信カウンタとが同期するような演算であれば良い。例えば、前回の演算結果を入力値として予め定められたアルゴリズムに基づいて特定された出力値を演算結果とする演算等である。即ち、ECUは、イベントドリブンデータフレームに前回送信の際に付与したカウンタ等の特定識別子(つまり前回の演算結果)に基づいて、所定の演算を行った結果として得られる値を、次に送信するイベントドリブンデータフレームに特定識別子として含ませることとしても良い。 (8) In the above embodiment, the corresponding transmission counter or reception counter of each ECU is incremented (incremented) by 1 each time an event-driven data frame is transmitted or received. The operation for is not limited to incrementing by one. The calculation on the values of these counters may be the same calculation on the transmission side and the reception side of the data frame and the transmission counter and the reception counter may be synchronized. For example, it is a calculation in which the output value specified based on a predetermined algorithm is used as the calculation result, using the calculation result of the previous time as the input value. That is, the ECU next transmits a value obtained as a result of performing a predetermined calculation based on a specific identifier such as a counter (that is, a calculation result of the previous time) given to the event driven data frame at the time of the previous transmission. It may be included as a specific identifier in the event driven data frame.
(9)上記実施の形態で示したデータフレーム生成ルール及び周期ルール情報は、一例であり、例示した値と異なる値にしても良い。また、データフレーム生成ルール或いは周期ルール情報は、各ECUの出荷時に設定されても良いし、車載ネットワークシステムが搭載される車体の出荷時に設定されても良い。また、データフレーム生成ルール或いは周期ルール情報は、外部との通信に基づいて設定されても、各種記録媒体等を用いて設定されても、ツール類等によって設定されても良い。 (9) The data frame generation rule and the cycle rule information shown in the above embodiment is an example, and the values may be different from the exemplified values. Further, the data frame generation rule or the cycle rule information may be set at the time of shipment of each ECU, or may be set at the time of shipment of the vehicle body on which the vehicle-mounted network system is mounted. Further, the data frame generation rule or the cycle rule information may be set based on communication with the outside, set using various recording media, or set by tools or the like.
(10)上記実施の形態では、各ECUが不正なデータフレームを検知する機能を有する例を示したが、その機能を1台以上の特定のECUのみが有することとしても良い。例えば車載ネットワークシステムが複数のバスそれぞれに接続されたECU群で構成されることとした場合において各バスを繋ぐゲートウェイとしてのECUにのみ不正なデータフレームを検知する機能を含ませても良い。また、例えば車載ネットワークシステムが、自動車のインパネ(インストルメントパネル)等に設けられて運転者に視認されるための情報を表示する液晶ディスプレイ(LCD:liquid crystal display)等の表示装置、運転者の操作を受け付ける入力手段等を備える一種のECUであるヘッドユニットを含む場合において、ヘッドユニットにのみ不正なデータフレームを検知する機能を含ませても良い。また、車載ネットワークシステムが、上述の不正なデータフレームを検知する機能を有し、バスを監視して不正なデータフレームを検知した場合にその旨を示すデータフレームの送信等を行う1台以上の特定のECUを含むこととしても良い。 (10) In the above embodiment, an example in which each ECU has a function of detecting an invalid data frame has been shown, but the function may be provided only by one or more specific ECUs. For example, when the in-vehicle network system is configured by a group of ECUs connected to each of a plurality of buses, only the ECU as a gateway connecting the buses may have a function of detecting an invalid data frame. In addition, for example, an in-vehicle network system is provided in an instrument panel (instrument panel) of an automobile and a display device such as a liquid crystal display (LCD) for displaying information to be visually recognized by a driver, In the case of including a head unit which is a kind of ECU including an input unit for receiving an operation, the head unit may have a function of detecting an unauthorized data frame. In addition, the in-vehicle network system has a function of detecting the above-mentioned illegal data frame, and when the bus is monitored and an illegal data frame is detected, one or more data frames indicating the fact are transmitted. A specific ECU may be included.
(11)上記実施の形態では、MAC鍵をメッセージID毎に1つ保持している例を示したが、ECU毎に1つ保持することとしても良い。また、全てのECUが同じMAC鍵を保持している必要はない。また、同一のバスに接続された各ECUは、共通のMAC鍵を保持していても良い。 (11) In the above embodiment, an example is shown in which one MAC key is held for each message ID, but one MAC key may be held for each ECU. Further, it is not necessary that all ECUs hold the same MAC key. Also, each ECU connected to the same bus may hold a common MAC key.
(12)上記実施の形態では、送信カウンタ或いは受信カウンタを送信或いは受信するデータフレームのメッセージID毎に1つ保持しているが、複数のメッセージIDに対して1つ保持することとしても良い。また、同一のバス上を流れる全てのデータフレームに対して、同じカウンタを使用しても良い。 (12) In the above embodiment, one transmission counter or one reception counter is held for each message ID of a data frame to be transmitted or received, but one may be held for a plurality of message IDs. Also, the same counter may be used for all data frames flowing on the same bus.
(13)上記の実施の形態における、不正データフレーム判断部はCANコントローラと呼ばれるハードウェア、または、CANコントローラと接続して動作するマイコン上で動作するファームウェアに実装しても良い。また、MAC鍵保持部、カウンタ保持部、受信データフレーム周期保持部、データフレーム受信履歴保持部は、CANコントローラと呼ばれるハードウェアのレジスタ、または、CANコントローラと接続して動作するマイコン上で動作するファームウェアに格納されていても良い。 (13) In the above embodiment, the illegal data frame determination unit may be mounted on hardware called a CAN controller or firmware operating on a microcomputer that operates by connecting to the CAN controller. Further, the MAC key holding unit, the counter holding unit, the received data frame cycle holding unit, and the data frame reception history holding unit operate on a hardware register called a CAN controller or on a microcomputer that operates by connecting with a CAN controller. It may be stored in the firmware.
(14)上記実施の形態では、CANプロトコルにおけるデータフレームを標準IDフォーマットで記述しているが、拡張IDフォーマットであっても良い。拡張IDフォーマットの場合には、標準IDフォーマットにおけるID位置のベースIDと、拡張IDとを合わせて29ビットでID(メッセージID)を表すので、この29ビットのIDを上述の実施の形態におけるID(メッセージID)と扱えば良い。 (14) 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 at the ID position in the standard ID format and the extended ID are combined to represent the ID (message ID) in 29 bits. Therefore, this 29-bit ID is the ID in the above-described embodiment. It may be treated as (message ID).
(15)上記実施の形態で示したCANプロトコルは、TTCAN(Time-Triggered CAN)、CANFD(CAN with Flexible Data Rate)等の派生的なプロトコルをも包含する広義の意味を有するものであっても良い。 (15) The CAN protocol described in the above embodiments has a broad meaning that includes derivative protocols such as TTCAN (Time-Triggered CAN) and CANFD (CAN with Flexible Data Rate). good.
(16)上記実施の形態における各ECUは、例えば、プロセッサ、メモリ等のデジタル回路、アナログ回路、通信回路等を含む装置であることとしたが、ハードディスク装置、ディスプレイ、キーボード、マウス等の他のハードウェア構成要素を含んでいても良い。また、メモリに記憶された制御プログラムがプロセッサにより実行されてソフトウェア的に機能を実現する代わりに、専用のハードウェア(デジタル回路等)によりその機能を実現することとしても良い。 (16) Each of the ECUs in the above embodiments is a device including, for example, a digital circuit such as a processor and a memory, an analog circuit, a communication circuit, etc., but other hard disk devices, displays, keyboards, mice, etc. It may include hardware components. Further, instead of the control program stored in the memory being executed by the processor and realizing the function by software, the function may be realized by dedicated hardware (digital circuit or the like).
(17)上記実施の形態における各装置(ECU等)を構成する構成要素の一部または全部は、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に置き換わる集積回路化の技術が登場すれば、当然、その技術を用いて機能ブロックの集積化を行っても良い。バイオ技術の適用等が可能性としてあり得る。
(17) Part or all of the constituent elements of each device (ECU or the like) in the above-described embodiments may be configured by one system LSI (Large Scale Integration). The system LSI is an ultra-multifunctional LSI manufactured by integrating a plurality of constituent parts on one chip, and specifically, is a computer system including a microprocessor, ROM, RAM and the like. .. A computer program is recorded in the RAM. The system LSI achieves its function by the microprocessor operating according to the computer program. Further, each part of the constituent elements of each of the above devices may be individually made into one chip, or may be made into one chip so as to include a part or all. Although the system LSI is used here, it may be called IC, LSI, super LSI, or ultra LSI depending on the degree of integration. The method of circuit integration is not limited to LSI, and it may be realized by a dedicated circuit or a general-purpose processor. A field programmable gate array (FPGA) that can be programmed after the LSI is manufactured, or a reconfigurable processor that can reconfigure the connection and setting of circuit cells inside the LSI may be used. Further, if integrated circuit technology comes out to replace LSI's as a result of the advancement of semiconductor technology or a derivative other technology, it is naturally also possible to carry out function block integration using this technology. The application of biotechnology is possible.
(18)上記各装置を構成する構成要素の一部または全部は、各装置に脱着可能なICカードまたは単体のモジュールから構成されているとしても良い。前記ICカードまたは前記モジュールは、マイクロプロセッサ、ROM、RAM等から構成されるコンピュータシステムである。前記ICカードまたは前記モジュールは、上記の超多機能LSIを含むとしても良い。マイクロプロセッサが、コンピュータプログラムに従って動作することにより、前記ICカードまたは前記モジュールは、その機能を達成する。このICカードまたはこのモジュールは、耐タンパ性を有するとしても良い。 (18) Part or all of the constituent elements of each of the above devices may be configured by an IC card that can be attached to or detached from each device or a single module. The IC card or the module is a computer system including a microprocessor, ROM, RAM and the like. The IC card or the module may include the above super-multifunctional LSI. The IC card or the module achieves its function by the microprocessor operating according to the computer program. This IC card or this module may be tamper resistant.
(19)本開示の一態様としては、上記に示す不正検知方法であるとしても良い。また、この方法をコンピュータにより実現するコンピュータプログラムであるとしても良いし、前記コンピュータプログラムからなるデジタル信号であるとしても良い。また、本開示の一態様としては、前記コンピュータプログラムまたは前記デジタル信号をコンピュータで読み取り可能な記録媒体、例えば、フレキシブルディスク、ハードディスク、CD−ROM、MO、DVD、DVD−ROM、DVD−RAM、BD(Blu-ray(登録商標)Disc)、半導体メモリ等に記録したものとしても良い。また、これらの記録媒体に記録されている前記デジタル信号であるとしても良い。また、本開示の一態様としては、前記コンピュータプログラムまたは前記デジタル信号を、電気通信回線、無線または有線通信回線、インターネットを代表とするネットワーク、データ放送等を経由して伝送するものとしても良い。また、本開示の一態様としては、マイクロプロセッサとメモリを備えたコンピュータシステムであって、前記メモリは、上記コンピュータプログラムを記録しており、前記マイクロプロセッサは、前記コンピュータプログラムに従って動作するとしても良い。また、前記プログラムまたは前記デジタル信号を前記記録媒体に記録して移送することにより、または前記プログラムまたは前記デジタル信号を前記ネットワーク等を経由して移送することにより、独立した他のコンピュータシステムにより実施するとしても良い。 (19) As one aspect of the present disclosure, the fraud detection method described above may be used. Further, the method may be a computer program that realizes this method by a computer, or may be a digital signal including the computer program. In addition, as one aspect of the present disclosure, a computer-readable recording medium that can read the computer program or the digital signal, for example, a flexible disk, a hard disk, a CD-ROM, an MO, a DVD, a DVD-ROM, a DVD-RAM, or a BD. (Blu-ray (registered trademark) Disc), semiconductor memory, or the like may be used. Further, it may be the digital signal recorded on these recording media. As one aspect of the present disclosure, the computer program or the digital signal may be transmitted via an electric communication line, a wireless or wired communication line, a network typified by the Internet, a data broadcast, or the like. In addition, as one aspect of the present disclosure, a computer system including a microprocessor and a memory, wherein the memory records the computer program, and the microprocessor may operate according to the computer program. .. In addition, the program or the digital signal is recorded in the recording medium and transferred, or the program or the digital signal is transferred via the network or the like, thereby being implemented by another independent computer system. Also good.
(20)上記実施の形態及び上記変形例で示した各構成要素及び機能を任意に組み合わせることで実現される形態も本開示の範囲に含まれる。 (20) A form realized by arbitrarily combining the respective constituent elements and functions shown in the above-described embodiment and the above-described modified examples is also included in the scope of the present disclosure.
本開示は、車載ネットワークシステムにおいて不正なECUによりバス上に不正なメッセージの送信が行われたことを効率的かつ適切に検知するために利用可能である。 The present disclosure can be used to efficiently and appropriately detect that an unauthorized ECU has transmitted an unauthorized message on a bus in an in-vehicle network system.
10,11,12,13 車載ネットワークシステム
100a,100b,2100a,2100b,3100a,3100b,4100a,4100b,4100c 電子制御ユニット(ECU)
101 データフレーム送受信部
102,2102,3102,4102 データフレーム生成部
103,2103,3103,4103 データフレーム生成ルール保持部
104,2104,3104,4104 不正データフレーム判断部
105,3105,4105 受信データフレーム周期保持部
106,2106 データフレーム受信履歴保持部
107 データフレーム処理部
108 タイマ
109 センサ値取得部
110 パワーウィンドウスイッチ
120 パワーウィンドウ
200 バス
3110 MAC生成部
3111 MAC鍵保持部
3112 カウンタ保持部
4113 車状態保持部
4130 ギア
10, 11, 12, 13 In-
101 data frame transmission/
Claims (9)
前記車載ネットワーク上で送信されたデータフレームを受信する受信ステップと、
前記受信ステップでイベントドリブンのデータフレームが受信され、かつ、前記車載ネットワークシステムを搭載する車両の走行状態が予め設定された状態である場合に限って、当該データフレーム中の予め設定された位置のデータ値を検証する検証ステップとを含み、
前記検証ステップで、前記予め設定された位置のデータ値についての前記検証が成功したときには、当該データフレームを正当なデータフレームとして検知し、
前記検証ステップで、前記予め設定された位置のデータ値についての前記検証が失敗したときには、当該データフレームを不正なデータフレームとして検知し、
前記予め設定された位置のデータ値は、前記データフレームのデータフィールド内の所定位置に配置されるカウンタ値であり、
前記検証ステップでは、前記イベントドリブンの前記データフレーム中の前記所定位置のカウンタ値が、前記受信ステップで前記イベントドリブンのデータフレームが受信された回数を反映したカウンタ値と同一であるか否かを判別することにより前記検証を行う
不正検知方法。 A fraud detection method used in an in-vehicle network system comprising a plurality of electronic control units communicating via an in-vehicle network,
A receiving step of receiving a data frame transmitted on the in-vehicle network,
Only when the event-driven data frame is received in the receiving step and the traveling state of the vehicle equipped with the in-vehicle network system is in a preset state, a preset position in the data frame is set. And a validation step to validate the data value,
In the verification step, when the verification of the data value at the preset position is successful, the data frame is detected as a valid data frame,
In the verification step, when the verification of the data value at the preset position fails, the data frame is detected as an invalid data frame,
The data value of the preset position is a counter value arranged at a predetermined position in the data field of the data frame,
In the verification step, it is determined whether the counter value at the predetermined position in the event-driven data frame is the same as the counter value reflecting the number of times the event-driven data frame is received in the receiving step. A fraud detection method in which the above verification is performed by determining.
前記受信したデータフレームが、イベントドリブンのデータフレームか否かを判定し、
前記受信したデータフレームが前記イベントドリブンのデータフレームであると判定された場合に、前記車両の走行状態が前記予め設定された状態であるか否かを判定し、
前記車両の走行状態が前記予め設定された状態であると判定された場合に、前記予め設定された位置のデータ値についての前記検証を行なう
請求項1記載の不正検知方法。 In the verification step,
The received data frame is determined whether or not the event-driven data frame,
When it is determined that the received data frame is the event-driven data frame, it is determined whether the traveling state of the vehicle is the preset state,
The fraud detection method according to claim 1, wherein when the traveling state of the vehicle is determined to be the preset state, the verification is performed on the data value of the preset position.
請求項2記載の不正検知方法。 In the verification step, when the received data frame is determined to be the event-driven data frame and the traveling state of the vehicle is not the preset state, the data frame is regarded as a valid data frame. The fraud detection method according to claim 2, wherein the fraud detection is performed.
請求項2記載の不正検知方法。 When the received data frame is determined to be the event-driven data frame in the verification step and the traveling state of the vehicle is not the preset state, the data frame is regarded as an invalid data frame. The fraud detection method according to claim 2, wherein the fraud detection is performed.
請求項1記載の不正検知方法。 The fraud detection method according to claim 1, wherein the plurality of electronic control units perform communication according to a CAN (Controller Area Network) protocol.
イベントドリブンのデータフレームを送信する場合で、
前記車載ネットワークシステムを搭載する車両の走行状態が予め設定された状態である場合に、当該データフレーム中の予め設定された位置にデータ値を付与し、前記車載ネットワークシステムを搭載する車両の走行状態が予め設定された状態でない場合には、当該データフレーム中の予め設定された位置にデータ値を付与しない付与ステップと、
前記付与ステップで付与された予め設定された位置のデータ値を含み前記イベントドリブンのデータフレームを前記車載ネットワークに送信する送信ステップとを含み、
前記予め設定された位置のデータ値は、前記データフレームのデータフィールド内の所定位置に配置されるカウンタ値である
不正検知方法。 A fraud detection method for transmitting a data frame targeted for fraud detection in an in-vehicle network system comprising a plurality of electronic control units that communicate via an in-vehicle network,
When sending an event driven data frame,
When the traveling state of the vehicle equipped with the vehicle-mounted network system is in a preset state, a data value is given to a preset position in the data frame to drive the vehicle equipped with the vehicle-mounted network system. If is not a preset state, an assigning step of not assigning a data value to a preset position in the data frame,
And a transmitting step of transmitting the event-driven data frame including the data value of the preset position given in the giving step to the vehicle-mounted network,
The fraud detection method, wherein the data value at the preset position is a counter value arranged at a predetermined position in the data field of the data frame.
イベントドリブンのデータフレームを送信する場合で、
前記車載ネットワークシステムを搭載する車両の走行状態が予め設定された状態である場合に、当該データフレーム中の予め設定された位置にデータ値を付与し、前記車載ネットワークシステムを搭載する車両の走行状態が予め設定された状態でない場合には、当該データフレーム中の予め設定された位置にデータ値を付与しない付与部と、前記付与部で付与された前記データ値を含み前記イベントドリブンのデータフレームを前記車載ネットワークに送信する送信部とを有する第1電子制御ユニットと、
前記車載ネットワーク上で送信されたデータフレームを受信する受信部と、前記受信部により前記イベントドリブンのデータフレームが受信され、かつ、前記車載ネットワークシステムを搭載する車両の走行状態が予め設定された状態である場合に限って、当該データフレーム中の予め設定された位置のデータ値を検証する検証部とを有し、前記検証部は、前記予め設定された位置のデータ値についての前記検証が成功したときには、当該データフレームを正当なデータフレームとして検知し、前記予め設定された位置のデータ値についての前記検証が失敗したときには、当該データフレームを不正なデータフレームとして検知する第2電子制御ユニットとを備え、
前記予め設定された位置のデータ値は、前記データフレームのデータフィールド内の所定位置に配置されるカウンタ値であり、
前記第2電子制御ユニットは、前記イベントドリブンの前記データフレーム中の前記所定位置のカウンタ値が、前記受信ステップで前記イベントドリブンのデータフレームが受信された回数を反映したカウンタ値と同一であるか否かを判別することにより前記検証を行う
車載ネットワークシステム。 An in-vehicle network system comprising a plurality of electronic control units that communicate via an in-vehicle network,
When sending an event driven data frame,
When the traveling state of the vehicle equipped with the vehicle-mounted network system is in a preset state, a data value is given to a preset position in the data frame to drive the vehicle equipped with the vehicle-mounted network system. If is not a preset state, the event-driven data frame including the assigning unit that does not assign a data value to a preset position in the data frame, and the event-driven data frame that includes the data value assigned by the assigning unit. A first electronic control unit having a transmission unit for transmitting to the vehicle-mounted network;
A receiving unit that receives a data frame transmitted on the in-vehicle network, a state in which the event-driven data frame is received by the receiving unit, and a traveling state of a vehicle equipped with the in-vehicle network system is preset. And a verification unit that verifies a data value at a preset position in the data frame, and the verification unit succeeds in verifying the data value at the preset position. And a second electronic control unit that detects the data frame as a valid data frame and detects the data frame as an invalid data frame when the verification of the data value at the preset position fails. Equipped with
The data value of the preset position is a counter value arranged at a predetermined position in the data field of the data frame,
The second electronic control unit, the counter value of the predetermined position in the event-driven data frame is the same as the counter value that reflects the number of times the event-driven data frame is received in the receiving step. An in-vehicle network system that performs the verification by determining whether or not it is.
イベントドリブンのデータフレームを送信する場合で、
前記電子制御ユニットを含む車載ネットワークシステムを搭載する車両の走行状態が予め設定された状態である場合に、当該データフレーム中の予め設定された位置にデータ値を付与し、前記車載ネットワークシステムを搭載する車両の走行状態が予め設定された状態でない場合には、当該データフレーム中の予め設定された位置にデータ値を付与しない付与部と、
前記付与部で付与された前記予め設定された位置のデータ値を含み前記イベントドリブンのデータフレームを前記車載ネットワークに送信する送信部とを備え、
前記予め設定された位置のデータ値は、前記データフレームのデータフィールド内の所定位置に配置されるカウンタ値である
電子制御ユニット。 An electronic control unit that communicates via an in-vehicle network,
When sending an event driven data frame,
When the running state of a vehicle equipped with an in-vehicle network system including the electronic control unit is in a preset state, a data value is given to a preset position in the data frame to mount the in-vehicle network system. When the traveling state of the vehicle to be set is not a preset state, an assigning unit that does not assign a data value to a preset position in the data frame,
A transmitting unit that transmits the event-driven data frame including the data value of the preset position assigned by the assigning unit to the in-vehicle network,
The electronic control unit, wherein the data value at the preset position is a counter value arranged at a predetermined position in the data field of the data frame.
前記車載ネットワーク上で送信されたデータフレームを受信する受信部と、
前記受信部によりイベントドリブンのデータフレームが受信され、かつ、前記電子制御ユニットを含む車載ネットワークシステムを搭載する車両の走行状態が予め設定された状態である場合に限って、当該データフレーム中の予め設定された位置のデータ値を検証する検証部とを備え、前記検証部は、前記予め設定された位置のデータ値についての前記検証が成功したときには、当該データフレームを正当なデータフレームとして検知し、前記予め設定された位置のデータ値についての前記検証が失敗したときには、当該データフレームを不正なデータフレームとして検知し、
前記予め設定された位置のデータ値は、前記データフレームのデータフィールド内の所定位置に配置されるカウンタ値であり、
前記検証部は、前記イベントドリブンの前記データフレーム中の前記所定位置のカウンタ値が、前記受信ステップで前記イベントドリブンのデータフレームが受信された回数を反映したカウンタ値と同一であるか否かを判別することにより前記検証を行う
電子制御ユニット。 An electronic control unit that communicates via an in-vehicle network,
A receiver for receiving the data frame transmitted on the vehicle-mounted network,
Only when the event-driven data frame is received by the receiving unit and the traveling state of the vehicle equipped with the in-vehicle network system including the electronic control unit is in a preset state, And a verification unit for verifying the data value at the set position, wherein the verification unit detects the data frame as a valid data frame when the verification for the data value at the preset position is successful. When the verification of the data value at the preset position fails, the data frame is detected as an invalid data frame,
The data value of the preset position is a counter value arranged at a predetermined position in the data field of the data frame,
The verification unit determines whether the counter value at the predetermined position in the event-driven data frame is the same as the counter value that reflects the number of times the event-driven data frame is received in the receiving step. An electronic control unit that performs the verification by determining.
Applications Claiming Priority (5)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US201461990360P | 2014-05-08 | 2014-05-08 | |
US61/990,360 | 2014-05-08 | ||
JP2015032206 | 2015-02-20 | ||
JP2015032206 | 2015-02-20 | ||
JP2018179730A JP6670354B2 (en) | 2014-05-08 | 2018-09-26 | In-vehicle network system, electronic control unit and fraud detection method |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2018179730A Division JP6670354B2 (en) | 2014-05-08 | 2018-09-26 | In-vehicle network system, electronic control unit and fraud detection method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2020096368A true JP2020096368A (en) | 2020-06-18 |
JP6967097B2 JP6967097B2 (en) | 2021-11-17 |
Family
ID=71085257
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2020032926A Active JP6967097B2 (en) | 2014-05-08 | 2020-02-28 | In-vehicle network system, electronic control unit and fraud detection method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6967097B2 (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003248513A (en) * | 2002-02-26 | 2003-09-05 | Denso Corp | Electronic control system for vehicle and device for inspecting system operation |
JP2003324459A (en) * | 2002-04-26 | 2003-11-14 | Sumitomo Electric Ind Ltd | Communication system |
US20120124374A1 (en) * | 2010-11-12 | 2012-05-17 | Nxp B.V. | Secured acknowledge protocol for automotive remote keyless entry systems and for networked sensor devices |
JP2012178035A (en) * | 2011-02-25 | 2012-09-13 | Toyota Motor Corp | Data rewriting support system and data rewriting support method for vehicle control device |
JP2013098719A (en) * | 2011-10-31 | 2013-05-20 | Toyota Infotechnology Center Co Ltd | Message authentication method for communication system, and communication system |
JP2013101426A (en) * | 2011-11-07 | 2013-05-23 | Toyota Motor Corp | On-vehicle communication device |
WO2015170451A1 (en) * | 2014-05-08 | 2015-11-12 | パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ | In-vehicle network system, electronic control unit, and irregularity detection method |
-
2020
- 2020-02-28 JP JP2020032926A patent/JP6967097B2/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003248513A (en) * | 2002-02-26 | 2003-09-05 | Denso Corp | Electronic control system for vehicle and device for inspecting system operation |
JP2003324459A (en) * | 2002-04-26 | 2003-11-14 | Sumitomo Electric Ind Ltd | Communication system |
US20120124374A1 (en) * | 2010-11-12 | 2012-05-17 | Nxp B.V. | Secured acknowledge protocol for automotive remote keyless entry systems and for networked sensor devices |
JP2012178035A (en) * | 2011-02-25 | 2012-09-13 | Toyota Motor Corp | Data rewriting support system and data rewriting support method for vehicle control device |
JP2013098719A (en) * | 2011-10-31 | 2013-05-20 | Toyota Infotechnology Center Co Ltd | Message authentication method for communication system, and communication system |
JP2013101426A (en) * | 2011-11-07 | 2013-05-23 | Toyota Motor Corp | On-vehicle communication device |
WO2015170451A1 (en) * | 2014-05-08 | 2015-11-12 | パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ | In-vehicle network system, electronic control unit, and irregularity detection method |
Also Published As
Publication number | Publication date |
---|---|
JP6967097B2 (en) | 2021-11-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6670354B2 (en) | In-vehicle network system, electronic control unit and fraud detection method | |
US11811798B2 (en) | Method for sensing fraudulent frames transmitted to in-vehicle network | |
JP6487406B2 (en) | Network communication system | |
US20150172306A1 (en) | Method and apparatus for enhancing security in an in-vehicle communication network | |
WO2015159520A1 (en) | Vehicle-mounted network system, abnormality detection electronic control unit and abnormality detection method | |
KR101972457B1 (en) | Method and System for detecting hacking attack based on the CAN protocol | |
JP6651662B2 (en) | Fraud detection electronic control unit and fraud detection method | |
JP6967097B2 (en) | In-vehicle network system, electronic control unit and fraud detection method | |
JP2017085197A (en) | Communication system, transmitter and communication method | |
JP2014027509A (en) | Communication controller | |
JP2018011155A (en) | CAN communication system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20200228 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20210226 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20210309 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210506 |
|
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: 20211012 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20211022 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6967097 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |