WO2017056395A1 - 不正検知電子制御ユニット、車載ネットワークシステム及び通信方法 - Google Patents

不正検知電子制御ユニット、車載ネットワークシステム及び通信方法 Download PDF

Info

Publication number
WO2017056395A1
WO2017056395A1 PCT/JP2016/004008 JP2016004008W WO2017056395A1 WO 2017056395 A1 WO2017056395 A1 WO 2017056395A1 JP 2016004008 W JP2016004008 W JP 2016004008W WO 2017056395 A1 WO2017056395 A1 WO 2017056395A1
Authority
WO
WIPO (PCT)
Prior art keywords
frame
bus
transmission
fraud detection
error
Prior art date
Application number
PCT/JP2016/004008
Other languages
English (en)
French (fr)
Inventor
博史 天野
中野 稔久
松崎 なつめ
芳賀 智之
良浩 氏家
剛 岸川
Original Assignee
パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from JP2016114879A external-priority patent/JP6836340B2/ja
Application filed by パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ filed Critical パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカ
Priority to EP16850576.6A priority Critical patent/EP3358788B1/en
Priority to CN201680002239.XA priority patent/CN107113214B/zh
Publication of WO2017056395A1 publication Critical patent/WO2017056395A1/ja
Priority to US15/879,962 priority patent/US10693905B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

Definitions

  • This disclosure relates to a fraud detection electronic control unit that detects fraudulent frames in a network in which an electronic control unit mounted on a vehicle or the like communicates.
  • ECUs electronice control units
  • a network connecting these ECUs is called an in-vehicle network.
  • in-vehicle network There are many standards for in-vehicle networks. Among them, one of the most mainstream in-vehicle networks is a CAN (Controller Area Network) standard defined by ISO11898-1.
  • CAN Controller Area Network
  • ISO11898-1 Controller Area Network
  • a fraud detection electronic control unit is a fraud detection electronic control unit in which a plurality of electronic control units communicating according to a CAN (Controller Area Network) protocol are connected to a bus used for communication.
  • a receiving unit that receives a frame for which transmission has started, and when a frame received by the receiving unit satisfies a predetermined condition indicating fraud, an error frame is transmitted to the bus before the end of the frame is transmitted.
  • the fraud detection electronic control unit includes a transmission unit that transmits and transmits a normal frame, which is a frame according to the CAN protocol, after transmission of the error frame to the bus.
  • An in-vehicle network system includes a plurality of electronic control units that communicate via a bus according to a CAN (Controller Area Network) protocol, and an unauthorized detection electronic control unit that is connected to the bus.
  • the fraud detection electronic control unit includes a receiving unit that receives a frame that has been transmitted to the bus, and a frame received by the receiving unit meets a predetermined condition indicating fraud.
  • a transmission unit that transmits an error frame to the bus before the end of the frame is transmitted, and transmits a normal frame that is a frame in accordance with a CAN protocol to the bus after the transmission of the error frame;
  • the unit includes a reception error counter and controls communication on the bus according to the CAN protocol.
  • a CAN controller that reduces the value of the reception error counter when a normal frame is successfully received from the bus.
  • a communication method is a communication method used in an in-vehicle network system including a plurality of electronic control units that communicate via a bus according to a CAN (Controller Area Network) protocol, and is transmitted to the bus.
  • FIG. 1 is a diagram showing an overall configuration of the in-vehicle network system according to the first embodiment.
  • FIG. 2 is a diagram showing a format of a data frame defined by the CAN protocol.
  • FIG. 3 is a diagram illustrating an error frame format defined by the CAN protocol.
  • FIG. 4 is a diagram illustrating an example of an increase in the error counter due to an error frame for invalidating an illegal frame.
  • FIG. 5 is a configuration diagram of the fraud detection ECU and the regular ECU.
  • FIG. 6 is a functional block diagram of the fraud detection ECU.
  • FIG. 7 is a flowchart showing an operation example 1 of the fraud detection ECU according to the first embodiment.
  • FIG. 8 is a flowchart showing an operation example 2 of the fraud detection ECU according to the first embodiment.
  • FIG. 1 is a diagram showing an overall configuration of the in-vehicle network system according to the first embodiment.
  • FIG. 2 is a diagram showing a format of a data frame defined by the CAN
  • FIG. 9 is a flowchart showing an operation example 3 of the fraud detection ECU according to the first embodiment.
  • FIG. 10 is a flowchart showing an operation example 4 of the fraud detection ECU according to the first embodiment.
  • FIG. 11 is a flowchart showing an operation example 5 of the fraud detection ECU according to the first embodiment.
  • FIG. 12 is a flowchart showing an operation example 6 of the fraud detection ECU according to the first embodiment.
  • FIG. 13 is a configuration diagram of the fraud detection ECU according to the second embodiment.
  • FIG. 14 is a functional block diagram of the fraud detection ECU according to the second embodiment.
  • FIG. 15 is a flowchart illustrating an operation example of the fraud detection ECU according to the second embodiment.
  • a reception error counter of a regular ECU connected to the CAN bus increases.
  • An increase in the reception error counter of the ECU may cause a situation where the ECU transitions to a passive state where rapid transmission of data frames or the like is restricted.
  • the present disclosure provides a fraud detection electronic control unit (fraud detection ECU) that can reduce the adverse effect on the legitimate ECU by sending an error frame to detect and invalidate the fraud frame.
  • the present disclosure provides an in-vehicle network system that can reduce an adverse effect that an error frame for invalidating an invalid frame has on a legitimate ECU, and a communication method used in the in-vehicle network system.
  • a fraud detection electronic control unit (fraud detection ECU) according to an aspect of the present disclosure is a fraud detection electronic control unit in which a plurality of electronic control units that communicate according to a CAN (Controller Area Network) protocol are connected to a bus used for communication.
  • a receiving unit that receives a frame that has been started to be transmitted to the bus, and an error occurs before the end of the frame is transmitted when the frame received by the receiving unit satisfies a predetermined condition indicating fraud.
  • a fraud detection electronic control unit comprising: a transmission unit that transmits a frame to the bus, and transmits a normal frame that is a frame in accordance with a CAN protocol to the bus after transmitting an error frame.
  • a normal frame is transmitted after an error frame is transmitted in order to invalidate an illegal frame.
  • the reception error counter of the regular ECU connected to the CAN bus is decreased. Accordingly, the adverse effect on the legitimate ECU of transmitting an error frame to invalidate an illegal frame can be reduced.
  • the fraud detection electronic control unit controls a communication interface connected to the bus, a CAN controller connected to the communication interface and controlling communication on the bus according to a CAN protocol, and the CAN controller, It is good also as providing CPU which implement
  • the CPU controls the CAN controller by executing the control program, and realizes transmission of a normal frame to the CAN bus following transmission of an error frame for invalidating an illegal frame. For this reason, it is possible to relatively easily implement a reduction in the adverse effect of transmitting an error frame to invalidate an illegal frame on a legitimate ECU by a control program.
  • the transmission unit may perform the transmission of the normal frame when the bus is first idle after the transmission of the error frame. Thereby, the state in which the reception error counter of the normal ECU is increased by transmitting the error frame to invalidate the illegal frame can be quickly restored to the state before the transmission of the error frame.
  • the transmission unit may transmit the same number of normal frames as the number of transmitted error frames.
  • the reception error counter of the normal ECU can be decreased by the amount corresponding to the increase of the reception error counter of the regular ECU by the error frame.
  • the transmission unit may transmit a normal frame when the transmission of the normal frame fails. As a result, even if transmission failure occurs due to communication arbitration for normal frames transmitted after transmission of error frames, normal frames are transmitted again. The possibility that it can be reduced can increase.
  • the transmitting unit subtracts the number of normal frames that is equal to or greater than the number obtained by subtracting the number of received normal frames that do not satisfy the predetermined condition after transmission of the error frame from the number of transmitted error frames. It may be sent.
  • the total number of appropriate frames (normal frames that are not illegal) that have flowed to the bus after the transmission of error frames and the number of transmitted normal frames is equal to or greater than the number of error frames, which increased due to the transmission of error frames.
  • the possibility that the reception error counter of the legitimate ECU can be reduced (recovered) to the value before the transmission of the error frame can be increased.
  • the transmission unit may transmit a normal frame indicating an ID having a value smaller than the ID indicated by the ID field of the normal frame.
  • a normal data frame using an ID (message ID) having a relatively low priority can be transmitted at first to suppress the influence on communication of other ECUs. If the transmission of the normal data frame fails, the message ID used for the normal frame (normal data frame) is changed to a higher priority, for example, unconditionally or under certain conditions, and lost in communication arbitration. Can be difficult. For this reason, possibility that the reception error counter of regular ECU can be decreased may increase.
  • the normal frame transmitted by the transmitting unit after transmitting the error frame may be a data frame having a data field length of zero. Therefore, the bus occupation time by the normal frame (normal data frame) transmitted becomes short, and the influence on a bus band is suppressed.
  • the ID indicated by the ID field of the normal frame transmitted by the transmitting unit after transmitting the error frame is the ID in any of the electronic control units connected to the bus other than the fraud detection electronic control unit. It is good also as ID which the process which should be identified and is not defined. This can prevent a normal ECU that has received the normal data frame to be transmitted from malfunctioning.
  • the transmission unit suppresses the transmission of the normal frame. Also good. As a result, after transmission of an error frame, when a non-illegal frame flows on the bus and the reception error counter of the legitimate ECU decreases, unnecessary normal frame transmission is suppressed and adverse effects on the bus bandwidth are reduced. obtain.
  • the fraud detection electronic control unit is connected to a plurality of buses and has a function of transferring a frame received from one bus to the other bus, and when the received frame meets the predetermined condition.
  • the transmission is suppressed, and when the frame received by the reception unit meets the predetermined condition, the transmission unit receives an error frame before the last of the frame is transmitted.
  • the normal frame may be transmitted to the bus after the error frame is transmitted.
  • the fraud detection ECU transmits the error frame for invalidating the fraud frame and the transmission of the normal data frame for suppressing the increase of the reception error counter to the bus that has detected the fraud frame. By doing this only, it is possible to suppress the influence of an illegal frame generated in a certain bus from spreading to other buses.
  • An in-vehicle network system includes a plurality of electronic control units that communicate via a bus according to a CAN (Controller Area Network) protocol, and an unauthorized detection electronic control unit that is connected to the bus.
  • the fraud detection electronic control unit includes a receiving unit that receives a frame that has been transmitted to the bus, and a frame received by the receiving unit meets a predetermined condition indicating fraud.
  • a transmission unit that transmits an error frame to the bus before the end of the frame is transmitted, and transmits a normal frame that is a frame in accordance with a CAN protocol to the bus after the transmission of the error frame;
  • the unit includes a reception error counter and controls communication on the bus according to the CAN protocol.
  • a CAN controller that reduces the value of the reception error counter when a normal frame is successfully received from the bus.
  • a communication method is a communication method used in an in-vehicle network system including a plurality of electronic control units that communicate via a bus according to a CAN (Controller Area Network) protocol, and is transmitted to the bus.
  • FIG. 1 is a diagram illustrating an overall configuration of an in-vehicle network system 10 according to the first embodiment.
  • the in-vehicle network system 10 is an example of a network communication system that performs communication according to a CAN protocol, and is a network communication system in an automobile on which various devices such as a control device and a sensor are mounted.
  • the in-vehicle network system 10 includes a bus 200, a fraud detection ECU (head unit) 100, and nodes connected to the bus such as ECUs such as ECUs 400a to 400d connected to various devices. Although omitted in FIG.
  • the in-vehicle network system 10 may include a number of ECUs in addition to the fraud detection ECU 100 and the ECUs 400a to 400d.
  • the ECU is a device including, for example, a processor (microprocessor), a digital circuit such as a memory, an analog circuit, a communication circuit, and the like.
  • the memory is a ROM, a RAM, or the like, and can store a control program (computer program) executed by the processor.
  • the processor operates according to a control program (computer program)
  • the ECU realizes various functions.
  • the computer program is configured by combining a plurality of instruction codes indicating instructions for the processor in order to achieve a predetermined function.
  • the ECUs 400a to 400d are connected to the bus 200, and are connected to the engine 310, the brake 320, the door opening / closing sensor 330, and the window opening / closing sensor 340, respectively.
  • Each of the ECUs 400a to 400d acquires the state of a connected device (such as the engine 310) and periodically transmits a frame (a data frame described later) indicating the state to a network (that is, a bus).
  • the fraud detection ECU (head unit) 100 is a kind of ECU, and has a function of receiving frames transmitted from the ECUs 400a to 400d, displaying various states on a display (not shown), and presenting them to the user.
  • the fraud detection ECU 100 has a function of generating a frame indicating each piece of information acquired and transmitting the frame to one or more ECUs via the bus 200. Further, the fraud detection ECU 100 determines whether or not the frame to be transmitted / received is conforming to the rule, thereby determining whether the frame is an unauthorized frame (that is, a frame that does not conform to the rule). It has a fraud detection function to send. It can also be said that an illegal frame is a frame that satisfies a predetermined condition indicating illegality.
  • the fraud detection ECU (head unit) 100 may have functions such as car navigation, music playback, video playback, web page display, cooperation with a smartphone, and download and execution of an application program. In the present embodiment, the operation related to the fraud detection function of the fraud detection ECU 100 that is the head unit will be described.
  • each ECU exchanges frames according to the CAN protocol.
  • Frames in the CAN protocol include a data frame, a remote frame, an overload frame, and an error frame.
  • a communication path is a bus (such as the above-described bus 200) configured by two wires, and an ECU connected to the bus is called a node.
  • Each node connected to the bus transmits and receives a message called a frame.
  • a transmitting node that transmits a frame transmits a value of “1” called recessive and a value of “0” called dominant by generating a potential difference between two wires.
  • a state where the potential difference between the two wires is large is dominant, and conversely, a state where the potential difference is small is recessive.
  • the dominant is transmitted with priority.
  • the receiving node transmits a frame called an error frame.
  • An error frame is a notification of frame abnormality to a transmitting node or another receiving node by transmitting dominants continuously for 6 bits.
  • the transmission node transmits an ID called a message ID for each frame (that is, sends a signal to the bus), and each reception node is predetermined. Only the ID frame is received (that is, the signal is read from the bus).
  • a CSMA / CA Carrier Sense Multiple Access / Collision Avoidance
  • arbitration is performed using a message ID during simultaneous transmission of a plurality of nodes, and a frame with a small message ID value is preferentially transmitted.
  • CAN data communication is performed using data frames.
  • data of up to 8 bytes can be transmitted in one frame.
  • FIG. 2 is a diagram showing a data frame format defined by the CAN protocol.
  • a data frame in a standard ID format defined by the CAN protocol is shown.
  • the data frame includes an SOF (Start Of Frame), ID field, RTR (Remote Transmission Request), IDE (Identifier Extension), reserved bit “r”, DLC (Data Length Code), data field, CRC (Cyclic Redundancy Check) sequence.
  • SOF is composed of 1-bit dominant. When the bus is idle, it is recessive, and the start of frame transmission is notified by changing to dominant by SOF.
  • the ID field is a field for storing an ID (message ID) that is a value indicating the type of data, which is composed of 11 bits.
  • ID message ID
  • a frame having a small ID is designed to have a high priority in order to perform communication arbitration in this ID field.
  • RTR is a value for identifying a data frame and a remote frame, and is composed of a dominant 1 bit in the data frame.
  • IDE and “r” are both composed of dominant 1 bit.
  • DLC is composed of 4 bits and is a value indicating the length of the data field. IDE, “r”, and DLC are collectively referred to as a control field.
  • the data field is a value indicating the content of data to be transmitted composed of a maximum of 64 bits. The length can be adjusted every 8 bits.
  • the specification of the data to be sent is not defined by the CAN protocol, but is defined in the in-vehicle network system 10. Therefore, the specification depends on the vehicle type, manufacturer (manufacturer), and the like.
  • CRC sequence consists of 15 bits. It is calculated from the transmission values of the SOF, ID field, control field and data field.
  • CRC delimiter is a delimiter representing 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 slot consists of 1 bit.
  • the transmitting node performs transmission with the ACK slot being recessive.
  • the receiving node transmits an ACK slot as a dominant if reception is successful up to the CRC sequence. Since dominant is given priority over recessive, if the ACK slot is dominant after transmission, the transmitting node can confirm that any receiving node has received successfully.
  • ACK delimiter is a delimiter representing the end of ACK composed of 1-bit recessive.
  • EOF is composed of 7 bits recessive and indicates the end of the data frame.
  • FIG. 3 is a diagram illustrating an error frame format defined by the CAN protocol.
  • the error frame includes an error flag (primary), an error flag (secondary), and an error delimiter.
  • the error flag (primary) is used to notify other ECUs (nodes) that an error has occurred.
  • a node that detects an error continuously transmits a 6-bit dominant to notify other nodes of the occurrence of the error. This transmission violates the bit stuffing rule in the CAN protocol (the same value is not transmitted continuously for 6 bits or more), and causes the transmission of an error frame (secondary) from another node.
  • the error flag (secondary) is composed of a continuous 6-bit dominant used to notify other nodes of the occurrence of an error. All nodes that have received the error flag (primary) and detected a violation of the bit stuffing rule will transmit the error flag (secondary).
  • the error delimiter “DEL” is an 8-bit continuous recess and indicates the end of the error frame.
  • each ECU that communicates with the CAN bus increases the error counter when an error occurs.
  • the ECU transmits an error frame (secondary).
  • the reception error counter in the CAN controller of the ECU is incremented by 1.
  • FIG. 4 is a diagram illustrating an example of an error counter after an illegal frame is transmitted to the CAN bus.
  • the unauthorized ECU connected to the CAN bus transmits an unauthorized frame, and when the unauthorized detection ECU detects this unauthorized frame, it transmits an error frame (primary) to be invalidated,
  • the ECU shows the increment value of the error counter of each ECU when the error frame (secondary) is transmitted.
  • the fraud detection ECU (head unit) 100 determines whether or not the frame transmitted by the fraud ECU is fraudulent depending on whether or not the frame that is predetermined in the in-vehicle network system is met.
  • each ECU makes a transition to a state called a passive state in which quick transmission is restricted when the reception error counter becomes larger than a certain threshold value.
  • the ECU In the normal state, the ECU cannot transmit a data frame unless the CAN bus is in a bus idle state, that is, after ITM (Intermission), which is a 3-bit recessive after the data frame.
  • ITM Intermission
  • the passive state since the data frame can be transmitted only after receiving the 8-bit recessive after the end of the ITM, quick transmission is limited.
  • the error frame for blocking (invalidating) transmission of illegal frames suppresses the adverse effect of error frame transmission that increases the reception error counter of the regular ECU and shifts to a state where rapid transmission is restricted. Therefore, the fraud detection ECU 100 has a function of quickly transmitting a normal frame under a certain condition after transmitting an error frame. If the normal ECU operating in accordance with the CAN protocol can receive a normal frame (that is, a frame in accordance with the CAN protocol) without a reception error, the regular ECU decrements the reception error counter by one. Thereby, the possibility of shifting to the passive state is reduced.
  • FIG. 5 is a configuration diagram illustrating an example of the configuration of the fraud detection ECU (head unit) 100, the regular ECU 400a, and the like.
  • a fraud detection ECU (head unit) 100 which is an ECU having a fraud detection function
  • a regular ECU which is an ECU having a fraud detection function
  • the ECU 400a is extracted and shown for convenience of explanation.
  • FIG. 5 additionally shows an unauthorized ECU 2001 as an ECU that transmits an unauthorized data frame depending on, for example, a failure state or a state controlled by an attacker.
  • the fraud ECU 2001, the regular ECU 400a, and the fraud detection ECU 100 perform transmission / reception of data frames related to electronic device control via the bus 200.
  • the fraud detection ECU 100 has a function of transmitting a data frame and an error frame in accordance with the CAN protocol.
  • the fraud detection ECU 100 monitors the bus 200, and if an illegal data frame flows on the bus 200, the fraud detection ECU 100 It has a function of preventing transmission of data frames (that is, invalid data frames are invalidated).
  • the fraud detection ECU 100 includes a calculation unit 3001, a communication control unit 3002, and a communication interface (communication I / F) 3003.
  • the arithmetic unit 3001 and the communication control unit 3002 are configured to be able to communicate with each other by wire or wirelessly, and the communication control unit 3002 and the communication I / F 3003 can similarly communicate with each other by wire or wirelessly. It is configured as follows.
  • the communication I / F 3003 is a CAN transceiver that is a communication circuit that is connected to the bus 200 (CAN bus) and transmits and receives frames.
  • the communication control unit 3002 is a CAN controller that is a processor that controls communication on the bus 200 and performs processing related to the CAN protocol, and includes data that can be read from the arithmetic unit 3001 as information received via the communication I / F 3003. And a function of transmitting a data frame or an error frame according to the CAN protocol via the communication I / F 3003 in response to an instruction from the arithmetic unit 3001. Further, the communication control unit 3002 that is a CAN controller includes an error counter (transmission error counter and reception error counter), and performs an operation of the error counter, a control according to the error counter, and the like.
  • an error counter transmission error counter and reception error counter
  • the arithmetic unit 3001 includes a CPU (Central Processing Unit) and a memory, and the CPU executes a control program stored in the memory, thereby controlling the communication control unit 3002 to perform processing and transmission based on the received frame.
  • Various functions related to frame generation and the like are realized.
  • ECU 400a regular ECU
  • a function of transmitting a data frame and an error frame according to the CAN protocol and a function of transmitting an error frame when an error in data flowing through the bus 200 is detected and incrementing (increase) a reception error counter
  • a function of decrementing (decreasing) the reception error counter when a data frame flowing through the bus 200 is normally received (without a reception error).
  • the ECU 400a includes a calculation unit 3011, a communication control unit 3012, and a communication interface (communication I / F) 3013 configured to be able to communicate with each other by wire or wireless as shown in FIG.
  • the calculation unit 3011, the communication control unit 3012, and the communication I / F 3013 are the same as the calculation unit 3001, the communication control unit 3002, and the communication I / F 3003, respectively.
  • the communication control unit 3012 is a CAN controller that includes a reception error counter and controls communication on the bus 200 in accordance with the CAN protocol. When the normal frame is successfully received from the bus 200, the communication control unit 3012 decreases the value of the reception error counter.
  • ECUs 400b to 400d also have the same configuration as ECU 400a.
  • FIG. 6 is a functional block diagram of the fraud detection ECU (head unit) 100.
  • the fraud detection ECU 100 includes a reception unit 110 and a transmission unit 120, and the transmission unit 120 includes a fraud determination unit 121.
  • the functions of the reception unit 110 and the transmission unit 120 are realized by a calculation unit 3001 that is a CPU that executes a control program.
  • the fraud detection ECU 100 as a head unit although not described here, exchanges data frames with other regular ECUs and performs various functions as a head unit (for example, car navigation, music playback, video playback). , Functions such as web page display and cooperation with a smartphone).
  • the receiving unit 110 has a function of receiving a frame whose transmission is started to the bus 200, and reads data related to the frame received by the communication control unit 3002.
  • the fraud determination unit 121 has a function of detecting whether the data frame flowing through the bus 200 is an illegal frame from the data frame data received by the reception unit 110. That is, the fraud determination unit 121 determines the suitability of a data frame to a predetermined determination rule (determination as to whether the data frame is illegal).
  • the determination rule may be any rule as long as it is predetermined in the in-vehicle network system 10. Examples of the determination rule include a rule that the frame has a message ID described in a list of predetermined message IDs. As another example, for example, the time interval at which a data frame having a message ID determined to be transmitted periodically is received is within a range of a predetermined margin from a predetermined appropriate period. There is a rule that it is within.
  • the transmission unit 120 has a function of transmitting an error frame when an illegal data frame is detected by the fraud determination unit 121. In order to appropriately control the reception error counter of the regular ECU, the transmission unit 120 promptly transmits the error frame under certain conditions. Has a function of transmitting a normal frame (data frame in accordance with the CAN protocol). The transmission unit 120 gives the frame content and controls the communication control unit 3002 to realize transmission of the frame to the bus 200.
  • the fraud detection ECU 100 can realize the operation according to each operation example by causing the arithmetic unit (CPU) 3001 to execute a control program corresponding to each process.
  • the fraud detection ECU 100 may execute a combination of some processing procedures in the following plurality of operation examples.
  • FIG. 7 is a flowchart showing a processing procedure according to operation example 1 of fraud detection ECU 100 in the present embodiment. The operation example 1 will be described below with reference to FIG.
  • the fraud detection ECU 100 first monitors the frames flowing through the bus 200, and the fraud determination unit 121 determines whether or not the frames received by the receiving unit 110 are fraudulent frames (step S401). ). That is, the fraud detection ECU 100 receives and monitors a frame, which is transmitted to the bus 200 by any ECU, bit by bit, and determines whether or not the determination rule is met.
  • the determination as to whether or not the determination rule is met can be said to be a determination as to whether or not a predetermined condition indicating a fraud (a condition that the determination rule is not met) is met.
  • the fraud ECU 2001 may transmit a data frame that conforms to the CAN protocol but meets a predetermined condition indicating fraud (does not conform to the determination rule).
  • the unauthorized data frame transmitted by the unauthorized ECU 2001 can be determined to be an unauthorized frame in step S401.
  • an illegal frame that does not conform to the determination rule that is, corresponds to a predetermined condition indicating fraud
  • the process in step S401 is repeated.
  • the fraud detection ECU 100 transmits an error frame by the transmission unit 120 or the like (step S402).
  • the transmission of the error frame is performed at a timing before the end of the illegal frame is transmitted, thereby invalidating at least a part of the illegal frame by overwriting the error frame on the bus 200. Is done. Therefore, transmission of the error frame prevents the legitimate ECU from receiving an illegal frame and executing function processing corresponding to the illegal frame.
  • the fraud detection ECU 100 transmits a normal frame (normal data frame) according to the CAN protocol by the transmission unit 120 or the like (step S403).
  • the transmission of the normal frame in step S403 is performed, for example, when the bus 200 first enters an idle state (bus idle) after transmitting the error frame in step S402.
  • the transmission of the normal frame in step S403 does not necessarily have to be performed at the moment when the bus 200 first becomes bus idle, but from the viewpoint of reducing the adverse effect on the legitimate ECU (increase in reception error counter) due to the error frame. It is useful that normal frames are transmitted promptly. If the fraud detection ECU 100 transmits an error frame in step S402 to invalidate the fraudulent frame and the fraud ECU 2001 immediately repeats the fraudulent data frame transmission, the fraud detection ECU 100 further An error frame may be transmitted, and a normal frame may be transmitted when the bus becomes idle after that.
  • the fraud detection ECU 100 continuously transmits a normal data frame when performing transmission blockage (invalidation) of an illegal frame using an error frame. Since fraud detection ECU 100 detects an illegal frame and transmits an error frame, it is clear that this is not a problem caused by the receiving node but a problem caused by the transmitting node that transmitted the illegal frame, and therefore the reception error counter is increased. In order to suppress the transmission, a normal frame is transmitted. Thereby, the reception error counter of the regular ECU is decremented.
  • the transmission of the normal frame after the transmission of the error frame by the fraud detection ECU 100 is suppressed from unilaterally increasing the reception error counter of the normal ECU, and the possibility that the normal ECU transitions to the passive state is reduced. obtain. Accordingly, it is possible to prevent the operation of the regular ECU from being limited by an error frame for invalidating the invalid frame.
  • FIG. 8 is a flowchart showing a processing procedure according to operation example 2 of fraud detection ECU 100 in the present embodiment. Hereinafter, the operation example 2 will be described with reference to FIG.
  • the fraud detection ECU 100 monitors the frames flowing on the bus 200, and the fraud determination unit 121 determines whether or not the frames received by the reception unit 110 are fraudulent frames (step S501). If an illegal frame is not detected, the process in step S501 is repeated. If an unauthorized frame that does not conform to the determination rule is detected, the fraud detection ECU 100 transmits an error frame by the transmission unit 120 or the like (step S502). Steps S501 and S502 are the same as steps S401 and S402, respectively.
  • fraud detection ECU 100 transmits a normal data frame having a data field length of 0 (zero) by transmission unit 120 or the like (step S503).
  • a normal data frame having a data field length of 0 is a data frame in accordance with the CAN protocol, and is a data frame having a DLC value of 0 because the data field does not contain data. Note that transmission of a normal data frame having a data field length of 0 in step S503 is performed, for example, when the bus 200 first becomes bus idle after transmitting an error frame in step S502.
  • the fraud detection ECU 100 transmits a normal data frame after the fraud detection block (invalidation) using an error frame. Thereby, it can suppress that the reception error counter of regular ECU increases unilaterally, and normal ECU can reduce possibility of changing to a passive state. Accordingly, it is possible to prevent the operation of the regular ECU from being limited by an error frame for invalidating the invalid frame. Further, since the normal data frame transmitted by the fraud detection ECU 100 to decrement the reception error counter of the regular ECU is a data frame having a data field length of 0, the bus occupation time by the transmitted normal data frame is It becomes shorter and the influence on the bus bandwidth is suppressed.
  • FIG. 9 is a flowchart illustrating a processing procedure according to operation example 3 of fraud detection ECU 100 in the present embodiment. The operation example 3 will be described below with reference to FIG.
  • the fraud detection ECU 100 monitors the frames flowing through the bus 200, and the fraud determination unit 121 determines whether or not the frames received by the reception unit 110 are fraudulent frames (step S601). If an illegal frame is not detected, the process in step S601 is repeated. When an unauthorized frame that does not conform to the determination rule is detected, the fraud detection ECU 100 transmits an error frame by the transmission unit 120 or the like (step S602). Steps S601 and S602 are the same as steps S401 and S402 described above, respectively.
  • the fraud detection ECU 100 transmits a normal data frame having an ID (message ID) that is not used by other ECUs by the transmission unit 120 or the like (step S603).
  • a message ID that is not used by another ECU is a process to be performed by identifying the message ID in any ECU (ECU 400a to 400d) other than the fraud detection ECU 100 connected to the bus 200 in the in-vehicle network system 10.
  • the message ID is not defined.
  • any ECU connected to the bus 200 other than the fraud detection ECU 100 does not transmit a data frame with a message ID of 0x200, and functions corresponding to the data frame when a data frame with a message ID of 0x200 is received.
  • the fraud detection ECU 100 transmits a normal data frame with a message ID of 0x200 in step S603.
  • the normal data frame transmitted in step S603 is usefully a data frame having a data field length of 0, but the data field length is not necessarily 0.
  • the normal data frame is transmitted in step S603, for example, when the bus 200 first becomes bus idle after transmitting the error frame in step S602.
  • the fraud detection ECU 100 transmits a normal data frame after the fraud detection block (invalidation) using an error frame. Thereby, it can suppress that the reception error counter of regular ECU increases unilaterally, and normal ECU can reduce possibility of changing to a passive state. Accordingly, it is possible to prevent the operation of the regular ECU from being limited by an error frame for invalidating the invalid frame.
  • the message ID of the normal data frame transmitted by the fraud detection ECU 100 to decrement the reception error counter of the normal ECU is an ID that is not used by other ECUs, the normal ECU that has received the normal data frame malfunctions. Doing so can be prevented.
  • FIG. 10 is a flowchart showing a processing procedure according to operation example 4 of fraud detection ECU 100 in the present embodiment. Hereinafter, the operation example 4 will be described with reference to FIG.
  • the fraud detection ECU 100 monitors the frames flowing through the bus 200, and the fraud determination unit 121 determines whether or not the frames received by the reception unit 110 are fraudulent frames (step S701). That is, the fraud detection ECU 100 receives and monitors a frame that has been transmitted to the bus 200 by one of the ECUs bit by bit, and determines whether or not the determination rule is met (whether a predetermined condition indicating fraud is met). Or not). Thereby, an illegal frame that does not conform to the determination rule (that is, corresponds to a predetermined condition indicating fraud) can be detected. If an illegal frame is not detected in step S701, step S702 and step S703 are skipped and the process proceeds to step S704.
  • step S702 the fraud detection ECU 100 transmits an error frame by the transmission unit 120 or the like (step S702).
  • the transmission of the error frame is performed at a timing before the end of the illegal frame is transmitted, thereby invalidating at least a part of the illegal frame by overwriting the error frame on the bus 200. Is done. Therefore, transmission of the error frame prevents the legitimate ECU from receiving an illegal frame and executing function processing corresponding to the illegal frame.
  • the fraud detection ECU 100 increments a normal data frame transmission number counter, which is a counter for normal data frame transmission management, by +1 (step S703). This normal data frame transmission count counter is used to transmit the same number of normal frames as the number of transmitted error frames. The initial value is 0 (zero), and is incremented by 1 every time an error frame is transmitted. Each time a data frame is successfully transmitted, it is decremented by one.
  • step S703 the fraud detection ECU 100 checks the value of the normal data frame transmission count counter (step S704). If it is 0, the process proceeds to step S701. To do.
  • step S705 the fraud detection ECU 100 transmits a normal data frame by the transmission unit 120 or the like (step S705).
  • the normal data frame is transmitted in step S705 by sending the normal data frame bit by bit to the bus 200 that has become bus idle.
  • the fraud detection ECU 100 determines whether or not the transmission of the normal data frame is successful (step S706).
  • step S706 there is a possibility of simultaneous transmission of data frames by other ECUs for normal data frames that have started to be sent bit by bit to bus 200 in step S705, so transmission was successful as a result of communication arbitration in CAN, etc. It is determined whether or not.
  • the determination as to whether or not the transmission is successful is made, for example, based on whether or not the transmitted normal data frame matches the bit value appearing on the bus 200. For example, the determination is made on the bus 200 for the transmitted normal data frame. This may be done depending on whether or not the ACK slot that appears is dominant. Whether or not the transmission is successful, for example, when the calculation unit (CPU) 3001 of the fraud detection ECU 100 receives a transmission completion notification from the communication control unit (CAN controller) 3002 to identify whether or not the transmission is successful. It is good also as judging. If it is determined in step S706 that the normal data frame has been successfully transmitted, the fraud detection ECU 100 decrements the normal data frame transmission number counter by -1 (step S707), and the process proceeds to step S701.
  • step S706 If it is determined in step S706 that the normal data frame has not been successfully transmitted due to loss of communication mediation or the like (that is, the transmission has failed), the fraud detection ECU 100 skips step S707 and proceeds to step S701. To do. Thus, when the transmission unit 120 of the fraud detection ECU 100 or the like fails to transmit the normal data frame, the normal data frame is transmitted again.
  • the fraud detection ECU 100 transmits an error frame in step S702 and invalidates the fraud frame, for example, when the fraud ECU 2001 immediately repeats the transmission of the fraud data frame, the fraud detection ECU 100 in step S705.
  • the fraud detection ECU 100 can transmit normal data frames according to the normal data frame transmission number counter.
  • the fraud detection ECU 100 transmits a normal data frame after the fraud detection (invalidation) of the fraud frame using the error frame. Thereby, it can suppress that the reception error counter of regular ECU increases unilaterally, and normal ECU can reduce possibility of changing to a passive state. Accordingly, it is possible to prevent the operation of the regular ECU from being limited by an error frame for invalidating the invalid frame. Further, the fraud detection ECU 100 transmits the same number of normal data frames as the number of transmitted error frames using the normal data frame transmission number counter.
  • FIG. 11 is a flowchart illustrating a processing procedure according to operation example 5 of fraud detection ECU 100 in the present embodiment. Hereinafter, the operation example 5 will be described with reference to FIG.
  • the fraud detection ECU 100 monitors the frames flowing through the bus 200, and the fraud determination unit 121 determines whether or not the frames received by the receiving unit 110 are fraudulent frames (that is, whether or not a predetermined condition indicating fraud is satisfied). Determination is made (step S801). If an illegal frame is not detected in step S801, step S802 and step S803 are skipped and the process proceeds to step S804.
  • step S801 when an illegal frame is detected, the fraud detection ECU 100 transmits an error frame by the transmission unit 120 or the like (step S802). Subsequently, the fraud detection ECU 100 increments a normal data frame transmission number counter, which is a counter for normal data frame transmission management, by +1 (step S803).
  • step S803 the fraud detection ECU 100 checks the value of the normal data frame transmission count counter (step S804). If it is 0, the process proceeds to step S801. To do.
  • step S804 If the value of the normal data frame transmission number counter is not 0 in step S804, the fraud detection ECU 100 transmits a normal data frame by the transmission unit 120 or the like (step S805). Subsequently, fraud detection ECU 100 determines whether or not the transmission of the normal data frame is successful (step S806). If it is determined in step S806 that the normal data frame has been successfully transmitted, the fraud detection ECU 100 decrements the normal data frame transmission count counter by 1 (step S807), and the process proceeds to step S808.
  • step S806 If it is determined in step S806 that transmission of a normal data frame has not succeeded due to loss of communication arbitration, the fraud detection ECU 100 skips step S807 and transitions to step S808.
  • steps S801, S802, S803, S804, S805, S806, and S807 are the same as steps S701, S702, S703, S704, S705, S706, and S707, respectively.
  • step S807 the fraud detection ECU 100 checks (determines) whether or not the normal data frame has flowed on the bus 200 ( Step S808). Specifically, in step S808, fraud detection ECU 100 has received a normal data frame from bus 200, for example, a normal data frame according to the CAN protocol and not a fraudulent frame (that is, not satisfying a predetermined condition indicating fraud). Check whether or not. If it is determined in step S808 that a normal data frame has not flowed on the bus 200, step S809 and step S810 are skipped, and the process proceeds to step S801.
  • step S808 If it is confirmed in step S808 that a normal data frame has flowed on the bus 200, the fraud detection ECU 100 sets the normal data frame transmission count counter as long as the normal data frame transmission count counter is greater than 0 (step S809). -1 (decrement) (step S810), the process proceeds to step S801.
  • the normal data frame transmission count counter has a number of normal data frames equal to or greater than the number obtained by subtracting the number of received normal data frames from the bus 200 after transmission of error frames from the number of error frames transmitted. Used to send.
  • the normal data frame transmission number counter has an initial value of 0 and is generally increased in response to the transmission of the error frame. When the normal data frame is successfully transmitted, or when the normal data frame is transmitted by another ECU on the bus 200. Is decremented accordingly.
  • the fraud detection ECU 100 transmits a normal data frame after the fraud detection block (invalidation) using an error frame. Thereby, it can suppress that the reception error counter of regular ECU increases unilaterally, and normal ECU can reduce possibility of changing to a passive state. Accordingly, it is possible to prevent the operation of the regular ECU from being limited by an error frame for invalidating the invalid frame. Further, the fraud detection ECU 100 uses the normal data frame transmission number counter so that the same number of normal data frames as the number of transmitted error frames flows on the bus 200.
  • the fraud detection ECU 100 reduces the number of normal data frames transmitted by itself in order to decrement the reception error counter of the regular ECU by the number of normal data frames that have flowed through the bus 200. Thereby, the bus occupation time by the normal data frame transmitted to decrement the reception error counter of the regular ECU is shortened, and the influence on the bus band is suppressed.
  • FIG. 12 is a flowchart showing a processing procedure according to an operation example 6 of the fraud detection ECU 100 in the present embodiment. Hereinafter, the operation example 6 will be described with reference to FIG.
  • the fraud detection ECU 100 monitors the frames flowing through the bus 200, and the fraud determination unit 121 determines whether or not the frames received by the receiving unit 110 are fraudulent frames (that is, whether or not a predetermined condition indicating fraud is satisfied). Determination is made (step S901). If an illegal frame is not detected in step S901, step S902 and step S903 are skipped and the process proceeds to step S904.
  • step S903 If an illegal frame is detected in step S901, the fraud detection ECU 100 transmits an error frame by the transmission unit 120 or the like (step S902). Subsequently, the fraud detection ECU 100 increments a normal data frame transmission number counter, which is a counter for managing transmission of normal data frames, by +1 (step S903).
  • step S903 the fraud detection ECU 100 checks the value of the normal data frame transmission number counter (step S904). If it is 0, the process proceeds to step S901. To do.
  • step S905 the fraud detection ECU 100 determines that the normal data frame transmission number counter is greater than the threshold value (step S905), and normal data to be transmitted in step S907.
  • the message ID value included in the ID field of the frame is changed to a smaller value (step S906).
  • the threshold value is a predetermined value equal to or greater than 0, and can take values such as 0, 1, 5, and the like. If the threshold is 0, the message ID used for the normal data frame can be changed to a smaller value when transmission of the normal data frame fails.
  • step S907 When the value of the normal data frame transmission number counter is not larger than the threshold value in step S905, or after step S906, the fraud detection ECU 100 transmits a normal data frame by the transmission unit 120 or the like (step S907). .
  • the fraud detection ECU 100 determines whether or not the transmission of the normal data frame has succeeded (step S908). If it is determined in step S908 that the transmission of the normal data frame is successful, the fraud detection ECU 100 decrements the normal data frame transmission number counter (step S909), and the process proceeds to step S910.
  • step S908 If it is determined in step S908 that transmission of the normal data frame has not succeeded due to loss of communication arbitration, the fraud detection ECU 100 skips step S909 and transitions to step S910.
  • step S909 the fraud detection ECU 100 checks (determines) whether or not the normal data frame has flowed on the bus 200 ( Step S910). If it is determined in step S910 that no normal data frame has flowed on the bus 200, step S911 and step S912 are skipped, and the process proceeds to step S901.
  • step S910 If it is confirmed in step S910 that a normal data frame has flowed on the bus 200, the fraud detection ECU 100 sets the normal data frame transmission number counter as long as the normal data frame transmission number counter is greater than 0 (step S911). -1 (decrement) (step S912), the process proceeds to step S901.
  • steps S901 to S904 and S907 to S912 are the same as steps S801 to S804 and S805 to S810, respectively.
  • the fraud detection ECU 100 changes the message ID in the normal data frame to be transmitted, which has been changed to a smaller value in step S906, at some timing (for example, when the normal data frame transmission number counter becomes 0). You may make it return to an initial value.
  • the fraud detection ECU 100 uses the error frame to prevent transmission (invalidation) of an illegal frame
  • the fraud detection ECU 100 transmits a normal data frame thereafter.
  • the fraud detection ECU 100 uses the normal data frame transmission number counter so that the same number of normal data frames as the number of transmitted error frames flows on the bus 200.
  • the fraud detection ECU 100 reduces the number of normal data frames transmitted by itself in order to decrement the reception error counter of the regular ECU by the number of normal data frames that have flowed through the bus 200. Thereby, the bus occupation time by the normal data frame transmitted to decrement the reception error counter of the regular ECU is shortened, and the influence on the bus band is suppressed.
  • the fraud detection ECU 100 increases the priority of the normal data frame transmitted to decrement the reception error counter of the normal ECU.
  • a normal data frame using a message ID having a low priority can be initially transmitted to suppress the influence on communication of other ECUs.
  • the normal data frame transmission count counter exceeds a certain threshold
  • the message ID used for the normal data frame is changed to a higher priority so that it is difficult to lose by communication arbitration, and the reception error of the regular ECU It is possible to ensure execution of the counter decrement.
  • the in-vehicle network system includes a fraud detection ECU 100a connected to both the bus 200 to which the ECU 400a and the like shown in the first embodiment are connected and another bus 1200.
  • the fraud detection ECU 100a is a modification of the fraud detection ECU 100 shown in the first embodiment.
  • the data detection unit transfers data frames between buses. Has a transfer function.
  • FIG. 13 is a configuration diagram illustrating an example of the configuration of the fraud detection ECU 100a and the like.
  • the bus 1200, the authorized ECU 1400 connected to the bus 1200, the unauthorized ECU 2011, the bus 200 and The fraud detection ECU 100a connected to both of the bus 1200 is shown.
  • Regular ECU 1400 has the same configuration and function as ECU 400a shown in the first embodiment.
  • the unauthorized ECU 2011 is an ECU that transmits an unauthorized data frame depending on, for example, a failure state or a state controlled by an attacker.
  • the fraud detection ECU 100a has a function of transmitting a data frame and an error frame according to the CAN protocol, monitors the bus 200, and when an illegal data frame flows on the bus 200, the fraud detection ECU 100a It has a function of preventing transmission of data frames (that is, invalid data frames are invalidated).
  • the fraud detection ECU 100a has a transfer function for transferring a data frame from one bus to the other bus under certain conditions between the bus 200 and the bus 1200.
  • the fraud detection ECU 100a having the transfer function can exchange data frames (messages) between, for example, the regular ECU 400a connected to the bus 200 and the regular ECU 1400 connected to the bus 1200.
  • the frame according to the CAN protocol can be transmitted and received on the bus 200, and the frame according to the CAN protocol can be similarly transmitted and received on the bus 1200.
  • the protocol used for communication on the bus 1200 does not necessarily match the protocol used for communication on the bus 200.
  • the CAN protocol is used for communication on the bus 200, and the communication on the bus 1200 is performed.
  • a CAN-FD (CAN with Flexible Data Rate) protocol may be used.
  • the fraud detection ECU 100a may have a function (gateway function) for performing protocol conversion at the time of frame transfer, for example.
  • the description will be continued assuming that the CAN protocol is used for both communication on the bus 200 and communication on the bus 1200.
  • the fraud detection ECU 100a includes a calculation unit 3001a, a communication control unit 3002, a communication control unit 3002a, a communication I / F 3003, and a communication I / F 3003a.
  • the arithmetic unit 3001a is configured to be able to communicate with the communication control units 3002 and 3002a in a wired or wireless manner, and the communication control unit 3002 and the communication I / F 3003 can communicate with each other in a wired or wireless manner.
  • the communication control unit 3002a and the communication I / F 3003a are configured to be able to communicate with each other by wire or wirelessly.
  • the communication I / F 3003a is a CAN transceiver or the like that is a communication circuit that is connected to a CAN bus (bus 1200) to transmit and receive frames.
  • the communication control unit 3002a is a CAN controller that is a processor that controls communication on the bus 1200 and performs processing related to the CAN protocol, and includes data that can be read from the arithmetic unit 3001a as information received via the communication I / F 3003a. And a function of transmitting a data frame or an error frame according to the CAN protocol via the communication I / F 3003a in response to an instruction from the arithmetic unit 3001a.
  • the communication control unit 3002a which is a CAN controller includes an error counter (transmission error counter and reception error counter), and performs an operation of the error counter and a control according to the error counter.
  • the arithmetic unit 3001a is composed of a CPU and a memory, and the CPU executes a control program stored in the memory, thereby controlling the communication control units 3002 and 3002a, processing based on the received frame, and generation of a frame to be transmitted.
  • Various functions related to the above are realized.
  • the regular ECU 400a, the regular ECU 1400, and the fraud detection ECU 100a perform transmission / reception of data frames related to electronic device control via the bus 200 or the bus 1200.
  • FIG. 14 is a functional block diagram of fraud detection ECU 100a.
  • the fraud detection ECU 100a includes a reception unit 110a and a transmission unit 120a, and the transmission unit 120a includes a fraud determination unit 121.
  • the functions of the reception unit 110a and the transmission unit 120a are realized by a calculation unit 3001a that is a CPU that executes a control program.
  • the fraud detection ECU 100a may have various functions as a head unit (for example, functions such as car navigation).
  • the receiving unit 110a has a function of receiving a frame whose transmission is started to the bus 200 or the bus 1200, and reads data related to the frame received by the communication control unit 3002 or the communication control unit 3002a.
  • the fraud determination unit 121 is the same as that shown in the first embodiment (see FIG. 6), and the function of detecting whether the data frame is an illegal frame from the data frame data received by the reception unit 110a. Have That is, the fraud determination unit 121 determines the suitability of a data frame to a predetermined determination rule (determination as to whether the data frame is illegal).
  • the transmission unit 120a determines which of the bus 200 and the bus 1200 the illegal frame is transmitted, and transmits the illegal frame. Function to send an error frame to the bus that has been registered, and a normal frame (protocol used for communication on that bus) immediately under certain conditions after sending the error frame in order to properly control the reception error counter of the regular ECU And a function of transmitting a data frame in accordance with The transmission unit 120a transmits an error frame on the bus to which the illegal data frame is transmitted before the tail end of the illegal data frame is transmitted, thereby preventing transmission of the illegal data frame ( Invalidate invalid data frames).
  • the transmission unit 120a gives the frame contents and controls the communication control unit 3002 or the communication control unit 3002a to realize transmission of the frame to the bus 200 or the bus 1200.
  • the fraud detection ECU 100a can realize the operation according to this operation example, for example, when the arithmetic unit (CPU) 3001a executes a control program.
  • CPU arithmetic unit
  • FIG. 15 is a flowchart showing a processing procedure according to an operation example of fraud detection ECU 100a in the present embodiment.
  • an operation example of the fraud detection ECU 100a will be described with reference to FIG.
  • the fraud detection ECU 100a monitors the frames flowing in the bus 200 and the bus 1200, and the fraud determination unit 121 determines whether the frame received from either the bus 200 or the bus 1200 by the reception unit 110a is an illegal frame.
  • Step S101 the fraud detection ECU 100a receives and monitors a frame that has been transmitted to the bus 200 or the bus 1200 by any ECU bit by bit, and determines whether or not the determination rule is met.
  • the determination as to whether or not the determination rule is met can be said to be a determination as to whether or not a predetermined condition indicating a fraud (a condition that the determination rule is not met) is met.
  • a predetermined condition indicating a fraud a condition that the determination rule is not met
  • the fraud detection ECU 100a determines which of the bus 200 and the bus 1200 has transmitted the illegal frame (step S102).
  • step S102 If it is determined in step S102 that an illegal frame has been transmitted on the bus 200, the fraud detection ECU 100a transmits an error frame to the bus 200 to which the illegal frame is transmitted by the transmission unit 120a or the like (step S102). S103).
  • the transmission of the error frame is performed at a timing before the end of the illegal frame is transmitted, thereby invalidating at least a part of the illegal frame by overwriting the error frame on the bus 200. Is done. Therefore, the transmission of the error frame prevents the legitimate ECU 400a or the like from receiving an illegal frame and executing a function process corresponding to the illegal frame.
  • the fraud detection ECU 100a transmits a normal frame (normal data frame) according to the CAN protocol to the bus 200 by the transmission unit 120 or the like (step S104).
  • the transmission of the normal frame in step S104 is performed, for example, when the bus 200 first becomes bus idle after the error frame is transmitted to the bus 200 in step S103.
  • the transmission of the normal frame in step S104 is not necessarily performed at the moment when the bus 200 first becomes bus idle, but the adverse effect on the regular ECU due to the error frame (increase in the reception error counter) is reduced. From the viewpoint, it is useful that normal frames are transmitted promptly.
  • step S102 If it is determined in step S102 that an illegal frame has been transmitted on the bus 1200, the fraud detection ECU 100a transmits an error frame to the bus 1200 from which the illegal frame is transmitted by the transmission unit 120a or the like (step S102). S105). Subsequently, the fraud detection ECU 100a transmits a normal frame (normal data frame) according to the CAN protocol to the bus 1200 by the transmission unit 120 or the like (step S106). Steps S105 and S106 are the same as steps S103 and S104 except that the destination bus is the bus 1200. The transmission of the error frame in step S105 is performed at the timing before the end of the illegal frame is transmitted, whereby at least a part of the illegal frame is overwritten on the error frame on the bus 1200.
  • the normal data frame transmitted in step S104 or step S106 is useful to be a data frame having a data field length of 0, for example, but the data field length is not necessarily zero.
  • the message ID of the normal data frame transmitted in step S104 or step S106 is a message ID that is not used by other ECUs.
  • the message ID that is not used by other ECUs means, for example, when transmitting a normal data frame to the bus 200, the message ID in any ECU other than the fraud detection ECU 100a connected to the bus 200.
  • Is a message ID for which processing to be performed by identifying is not defined. Further, the message ID not used by other ECUs identifies the message ID in any ECU other than the fraud detection ECU 100a connected to the bus 1200 when, for example, a normal data frame is transmitted to the bus 1200. Thus, the message ID is not defined for the process to be performed.
  • the fraud detection ECU 100a can transfer the data frame to the bus 1200 based on a predetermined transfer rule when a data frame that is not an illegal data frame is received on the bus 200. Further, when the fraud detection ECU 100a receives a data frame that is not a fraudulent data frame on the bus 1200, the fraud detection ECU 100a can transfer the data frame to the bus 200 based on a predetermined transfer rule. However, the fraud detection ECU 100a does not transfer the data when the fraud data frame is received.
  • the fraud detection ECU 100a continuously transmits a normal data frame when blocking transmission (invalidation) of an illegal frame using an error frame. Since fraud detection ECU 100a detects an illegal frame and transmits an error frame, it is clear that this is not a problem caused by the receiving node but a problem caused by the transmitting node that sent the illegal frame. In order to suppress the transmission, a normal frame is transmitted. Thereby, the reception error counter of the regular ECU is decremented. In other words, the transmission of the normal frame after the transmission of the error frame by the fraud detection ECU 100a suppresses the unilateral increase in the reception error counter of the normal ECU, and the possibility that the normal ECU transitions to the passive state is reduced. obtain.
  • the fraud detection ECU 100a performs transmission of an error frame for invalidating an invalid frame and transmission of a normal data frame for suppressing an increase in the reception error counter only to a bus that detects the illegal frame. Thus, it is possible to suppress the influence of an illegal frame generated in a certain bus from spreading to another bus.
  • Embodiments 1 and 2 have been described as examples of the technology according to the present disclosure.
  • the technology according to the present disclosure is not limited to this, and can also be applied to embodiments in which changes, replacements, additions, omissions, and the like are appropriately performed.
  • the following modifications are also included in one embodiment of the present disclosure.
  • the data frame in the CAN protocol is described in the standard ID format, but it may be in the extended ID format.
  • the fraud detection ECU may be an ECU having a fraud detection function, and does not necessarily have a function as a head unit. .
  • the in-vehicle network system has been described as an example.
  • the above-described fraud detection ECUs 100 and 100a are not limited to the in-vehicle network as long as they are networks that connect a plurality of ECUs communicated according to the CAN protocol.
  • it can be used in a network in which a plurality of ECUs mounted on industrial machines, robots, and the like are connected by a CAN bus.
  • the CAN protocol described above may have a broad meaning including derivative protocols such as TTCAN (Time-Triggered CAN) and CAN-FD (CAN with Flexible Data Rate).
  • TTCAN Time-Triggered CAN
  • CAN-FD CAN with Flexible Data Rate
  • Each ECU (including fraud detection ECU) in the above embodiment is a device including a digital circuit such as a processor and a memory, an analog circuit, a communication circuit, and the like. Other hardware components such as a keyboard and a mouse may be included. Further, instead of the control program stored in the memory being executed by the processor and realizing the function in software, the function may be realized by dedicated hardware (digital circuit or the like). In addition, the components such as the CPU, CAN controller, and CAN transceiver in each ECU are only examples, and these components may be integrated circuits or the like that are combined or separated in arbitrary units.
  • a part or all of the constituent elements constituting each device in the above embodiment may be constituted by one system LSI (Large Scale Integration).
  • the system LSI is an ultra-multifunctional LSI manufactured by integrating a plurality of components on a single chip.
  • the system LSI is a computer system including a microprocessor, a ROM, a RAM, and the like. .
  • a computer program is recorded in the RAM.
  • the system LSI achieves its functions by the microprocessor operating according to the computer program.
  • each part of the components constituting 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 of them.
  • 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's, and implementation using dedicated circuitry or general purpose processors is also possible.
  • An FPGA Field Programmable Gate Array
  • a reconfigurable processor that can reconfigure the connection and setting of circuit cells inside the LSI may be used.
  • 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. Biotechnology can be applied as a possibility.
  • Part or all of the constituent elements constituting each of the above devices may be configured from an IC card or a single module that can be attached to and detached from each device.
  • the IC card or the module is a computer system including a microprocessor, a ROM, a RAM, and the like.
  • the IC card or the module may include the super multifunctional LSI described above.
  • 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 have tamper resistance.
  • One aspect of the present disclosure may be a method such as a communication method for invalidating an invalid frame and reducing its influence in the above-described in-vehicle network.
  • the communication method when a frame that has been transmitted to the CAN bus is received, and the frame received in the reception step satisfies a predetermined condition indicating fraud, the tail of the frame is transmitted.
  • the present invention may be a computer program that realizes this method by a computer, or may be a digital signal composed of the computer program.
  • a computer-readable recording medium such as 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), recorded on a semiconductor memory or the like.
  • the digital signal may be recorded on these recording media.
  • 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, data broadcasting, or the like.
  • an aspect of the present disclosure may be a computer system including a microprocessor and a memory, the memory recording the computer program, and the microprocessor operating according to the computer program. .
  • the program or the digital signal is recorded on the recording medium and transferred, or the program or the digital signal is transferred via the network or the like and executed by another independent computer system. You may do that.
  • This disclosure can be used in an in-vehicle network system that detects and invalidates an illegal frame transmitted over a network.
  • In-vehicle network system 100, 100a Fraud detection electronic control unit (fraud detection ECU) 110, 110a Reception unit 120, 120a Transmission unit 121 Fraud determination unit 200, 1200 Bus 310 Engine 320 Brake 330 Door open / close sensor 340 Window open / close sensor 400a, 400b, 400c, 400d, 1400 Electronic control unit (ECU) 2001, 2011 Fraud ECU 3001, 3001a, 3011 arithmetic unit (CPU) 3002, 3002a, 3012 Communication control unit (CAN controller) 3003, 3003a, 3013 Communication interface (communication I / F)

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)

Abstract

CAN(Controller Area Network)プロトコルに従って通信する複数の電子制御ユニットが通信に用いるバスに接続される不正検知電子制御ユニット100であって、前記バスへ送信が開始されたフレームを受信する受信部110と、前記受信部により受信されたフレームが不正を示す所定条件に該当した場合に、当該フレームの最後尾が送信される前にエラーフレームを前記バスへ送信し、エラーフレームの送信後にCANプロトコルに従ったフレームである正常フレームを前記バスへ送信する送信部120とを備える不正検知電子制御ユニット。

Description

不正検知電子制御ユニット、車載ネットワークシステム及び通信方法
 本開示は、車両等に搭載される電子制御ユニットが通信を行うネットワークにおいて不正なフレームの検知等を行う不正検知電子制御ユニットに関する。
 近年、自動車の中のシステムには、電子制御ユニット(ECU:Electronic Control Unit)と呼ばれる装置が多数配置されている。これらのECUをつなぐネットワークは車載ネットワークと呼ばれる。車載ネットワークには、多数の規格が存在する。その中でも最も主流な車載ネットワークの一つに、ISO11898-1で規定されているCAN(Controller Area Network)という規格が存在する。なお、CANは、自動車の他に、電車、産業機械、ロボット、医療機器等といった各種分野のシステムで制御ネットワークとして利用されている。
 従来、CANのネットワークで正規のECUになりすまして不正なフレーム(不正なデータフレーム)を送信する脅威に対する対策として、CANの通信路であるバス(CANバス)に接続した不正検知機能を有するECU(不正検知ECU)により、不正なフレームを検知するとエラーフレームを送信することで不正なフレームを無効化する技術(不正なフレームの送信を阻止する技術)が知られている(例えば、特許文献1、非特許文献1、非特許文献2参照)。
特開2014-236248号公報
中野学/松本勉/Camille Vuillaume/小谷誠剛著、「自動車の情報セキュリティ」、日経BP社、2013年12月27日 畑正人/田邊正人/吉岡克成/松本勉著、「CANにおける不正送信阻止方式の実装と評価」、信学技報、電子情報通信学会、2012年12月
 本開示の一態様に係る不正検知電子制御ユニットは、CAN(Controller Area Network)プロトコルに従って通信する複数の電子制御ユニットが通信に用いるバスに接続される不正検知電子制御ユニットであって、前記バスへ送信が開始されたフレームを受信する受信部と、前記受信部により受信されたフレームが不正を示す所定条件に該当した場合に、当該フレームの最後尾が送信される前にエラーフレームを前記バスへ送信し、エラーフレームの送信後にCANプロトコルに従ったフレームである正常フレームを前記バスへ送信する送信部とを備える不正検知電子制御ユニットである。
 また、本開示の一態様に係る車載ネットワークシステムは、CAN(Controller Area Network)プロトコルに従ってバスを介して通信する複数の電子制御ユニットと、当該バスに接続される不正検知電子制御ユニットとを備える車載ネットワークシステムであって、前記不正検知電子制御ユニットは、前記バスへ送信が開始されたフレームを受信する受信部と、前記受信部により受信されたフレームが不正を示す所定条件に該当した場合に、当該フレームの最後尾が送信される前にエラーフレームを前記バスへ送信し、エラーフレームの送信後にCANプロトコルに従ったフレームである正常フレームを前記バスへ送信する送信部とを備え、前記電子制御ユニットは、受信エラーカウンタを含みCANプロトコルに従って前記バスでの通信を制御するCANコントローラを備え、前記バスからの正常フレームの受信に成功した場合には前記受信エラーカウンタの値を減少させる車載ネットワークシステムである。
 また、本開示の一態様に係る通信方法は、CAN(Controller Area Network)プロトコルに従ってバスを介して通信する複数の電子制御ユニットを備える車載ネットワークシステムにおいて用いられる通信方法であって、前記バスへ送信が開始されたフレームを受信する受信ステップと、前記受信ステップで受信されたフレームが不正を示す所定条件に該当した場合に、当該フレームの最後尾が送信される前にエラーフレームを前記バスへ送信し、エラーフレームの送信後にCANプロトコルに従ったフレームである正常フレームを前記バスへ送信する送信ステップとを含む通信方法である。
 本開示によれば、不正なフレームを無効化するためのエラーフレームの送信による正規のECUへの悪影響が低減され得る。
図1は、実施の形態1に係る車載ネットワークシステムの全体構成を示す図である。 図2は、CANプロトコルで規定されるデータフレームのフォーマットを示す図である。 図3は、CANプロトコルで規定されるエラーフレームのフォーマットを示す図である。 図4は、不正なフレームを無効化するためのエラーフレームによるエラーカウンタの増加の一例を示す図である。 図5は、不正検知ECU及び正規ECUの構成図である。 図6は、不正検知ECUの機能ブロック図である。 図7は、実施の形態1に係る不正検知ECUの動作例1を示すフローチャートである。 図8は、実施の形態1に係る不正検知ECUの動作例2を示すフローチャートである。 図9は、実施の形態1に係る不正検知ECUの動作例3を示すフローチャートである。 図10は、実施の形態1に係る不正検知ECUの動作例4を示すフローチャートである。 図11は、実施の形態1に係る不正検知ECUの動作例5を示すフローチャートである。 図12は、実施の形態1に係る不正検知ECUの動作例6を示すフローチャートである。 図13は、実施の形態2に係る不正検知ECUの構成図である。 図14は、実施の形態2に係る不正検知ECUの機能ブロック図である。 図15は、実施の形態2に係る不正検知ECUの動作例を示すフローチャートである。
 (本発明の基礎となった知見)
 不正なフレームを無効化するためにエラーフレームが送信されると、CANバスに接続された正規のECUの受信エラーカウンタが増大する。ECUの受信エラーカウンタの増大は、そのECUが、データフレーム等の迅速な送信が制限されるパッシブ状態に遷移してしまう事態を、引き起こし得る。
 本開示は、不正なフレームを検知して無効化するためにエラーフレームを送信することが正規のECUへ及ぼす悪影響を低減し得る不正検知電子制御ユニット(不正検知ECU)を提供する。また、本開示は、不正なフレームを無効化するためのエラーフレームの送信が正規のECUへ及ぼす悪影響を低減し得る車載ネットワークシステム、及び、その車載ネットワークシステムで用いられる通信方法を提供する。
 本開示の一態様に係る不正検知電子制御ユニット(不正検知ECU)は、CAN(Controller Area Network)プロトコルに従って通信する複数の電子制御ユニットが通信に用いるバスに接続される不正検知電子制御ユニットであって、前記バスへ送信が開始されたフレームを受信する受信部と、前記受信部により受信されたフレームが不正を示す所定条件に該当した場合に、当該フレームの最後尾が送信される前にエラーフレームを前記バスへ送信し、エラーフレームの送信後にCANプロトコルに従ったフレームである正常フレームを前記バスへ送信する送信部とを備える不正検知電子制御ユニットである。これにより、不正なフレームを無効化するためにエラーフレームが送信された後に、正常フレームが送信される。この正常フレームを受信することで、CANバスに接続された正規のECUの受信エラーカウンタが減少する。従って、不正なフレームを無効化するためにエラーフレームを送信することが正規のECUに及ぼす悪影響が、低減され得る。
 また、前記不正検知電子制御ユニットは、前記バスに接続される通信インタフェースと、前記通信インタフェースに接続され、CANプロトコルに従って前記バスでの通信を制御するCANコントローラと、前記CANコントローラを制御し、前記受信部及び前記送信部を実現するCPUとを備えることとしても良い。これにより、CPUが、制御プログラムを実行することでCANコントローラを制御して、不正なフレームを無効化するためのエラーフレームの送信に続くCANバスへの正常フレームの送信を実現する。このため、不正なフレームを無効化するためにエラーフレームを送信することが正規のECUに及ぼす悪影響の低減化を、制御プログラムによって比較的容易に実装可能となる。
 また、前記送信部は、エラーフレームの前記送信後において前記バスが最初にアイドル状態になった際に、前記正常フレームの前記送信を行うこととしても良い。これにより、不正なフレームを無効化するためにエラーフレームを送信することで正規のECUの受信エラーカウンタが増大した状態を、速やかにエラーフレームの送信前の状態へと回復させ得る。
 また、前記送信部は、送信したエラーフレームの数と同数の正常フレームを送信することとしても良い。これにより、エラーフレームにより正規のECUの受信エラーカウンタが増大した分だけ、正常フレームによりその受信エラーカウンタを減少させ得る。
 また、前記送信部は、正常フレームの前記送信に失敗した場合に、正常フレームを送信することとしても良い。これにより、エラーフレームの送信後に送信した正常フレームについて通信調停等により送信失敗となっても、再び正常フレームを送信するので、エラーフレームの送信の影響で増大した、正規のECUの受信エラーカウンタを、減少させることができる可能性が増加し得る。
 また、前記送信部は、送信した前記エラーフレームの数から、前記エラーフレームの送信後に前記所定条件に該当しない正常フレームを前記バスから受信した数を、減算して得られる数以上の正常フレームを送信することとしても良い。これにより、エラーフレームの送信後にバスに流れた適正フレーム(不正でない正常フレーム)と送信した正常フレームとの合計数がエラーフレームの数と同数以上となるので、エラーフレームの送信の影響で増大した、正規のECUの受信エラーカウンタを、エラーフレームの送信前における値へと減少(回復)させることができる可能性が増加し得る。
 また、前記送信部は、正常フレームの前記送信に失敗した場合に、当該正常フレームのIDフィールドが示すIDより小さい値のIDをIDフィールドで示す正常フレームを送信することとしても良い。これにより、最初は優先度の相対的に低いID(メッセージID)を用いた正常データフレームを送信して他のECUの通信への影響を抑えることができる。そして、正常データフレームの送信に失敗した場合において例えば無条件或いは一定条件下で、正常フレーム(正常データフレーム)に用いるメッセージIDを、優先度のより高いものへと変更して、通信調停で負けにくくすることができる。このため、正規のECUの受信エラーカウンタを減少させることができる可能性が増加し得る。
 また、前記送信部が、エラーフレームの送信後に送信する前記正常フレームは、データフィールドの長さがゼロであるデータフレームであることとしても良い。これにより、送信される正常フレーム(正常データフレーム)によるバス占有時間が短くなり、バス帯域への影響が抑制される。
 また、前記送信部が、エラーフレームの送信後に送信する前記正常フレームのIDフィールドが示すIDは、前記不正検知電子制御ユニット以外の、前記バスに接続されたいずれの前記電子制御ユニットにおいても当該IDを識別して行うべき処理が定められていないIDであることとしても良い。これにより、送信される正常データフレームを受信した正規のECUが誤動作を行うことが防止され得る。
 また、前記送信部は、前記エラーフレームの送信後から正常フレームの前記送信の前までに、前記所定条件に該当しない正常フレームを前記バスから受信したときには、正常フレームの前記送信を抑止することとしても良い。これにより、エラーフレームの送信後に、不正でないフレームがバスに流れて正規のECUの受信エラーカウンタが減少している場合において、不要な正常フレームの送信を抑止してバス帯域への悪影響を低減し得る。
 また、前記不正検知電子制御ユニットは、複数のバスに接続され、一方のバスから受信したフレームを他方のバスに転送する機能を有し、受信した当該フレームが前記所定条件に該当した場合には当該転送を抑止し、前記送信部は、前記受信部により受信されたフレームが前記所定条件に該当した場合に、当該フレームの最後尾が送信される前にエラーフレームを当該フレームが受信されたバスへ送信し、エラーフレームの送信後に前記正常フレームを当該バスへ送信することとしても良い。これにより、不正検知ECUが、不正なフレームを無効化するためのエラーフレームの送信、及び、受信エラーカウンタの増加を抑制するための正常データフレームの送信を、不正なフレームを検知したバスに対してのみ行うことで、あるバスで発生した不正なフレームの影響が他のバスへ波及することを抑制し得る。
 また、本開示の一態様に係る車載ネットワークシステムは、CAN(Controller Area Network)プロトコルに従ってバスを介して通信する複数の電子制御ユニットと、当該バスに接続される不正検知電子制御ユニットとを備える車載ネットワークシステムであって、前記不正検知電子制御ユニットは、前記バスへ送信が開始されたフレームを受信する受信部と、前記受信部により受信されたフレームが不正を示す所定条件に該当した場合に、当該フレームの最後尾が送信される前にエラーフレームを前記バスへ送信し、エラーフレームの送信後にCANプロトコルに従ったフレームである正常フレームを前記バスへ送信する送信部とを備え、前記電子制御ユニットは、受信エラーカウンタを含みCANプロトコルに従って前記バスでの通信を制御するCANコントローラを備え、前記バスからの正常フレームの受信に成功した場合には前記受信エラーカウンタの値を減少させる車載ネットワークシステムである。これにより、不正検知ECUから不正なフレームを無効化するためにエラーフレームが送信された後に、正常フレームが送信される。この正常フレームを受信したECUでは、受信エラーカウンタが減少する。従って、不正なフレームを無効化するためにエラーフレームを送信することが正規のECUに及ぼす悪影響が、低減され得る。
 また、本開示の一態様に係る通信方法は、CAN(Controller Area Network)プロトコルに従ってバスを介して通信する複数の電子制御ユニットを備える車載ネットワークシステムにおいて用いられる通信方法であって、前記バスへ送信が開始されたフレームを受信する受信ステップと、前記受信ステップで受信されたフレームが不正を示す所定条件に該当した場合に、当該フレームの最後尾が送信される前にエラーフレームを前記バスへ送信し、エラーフレームの送信後にCANプロトコルに従ったフレームである正常フレームを前記バスへ送信する送信ステップとを含む通信方法である。これにより、不正なフレームを無効化するためにエラーフレームを送信することが正規のECUに及ぼす悪影響を、低減し得る。
 なお、これらの全般的又は具体的な態様は、システム、方法、集積回路、コンピュータプログラム又はコンピュータで読み取り可能なCD-ROM等の記録媒体で実現されても良く、システム、方法、集積回路、コンピュータプログラム又は記録媒体の任意な組み合わせで実現されても良い。
 以下、実施の形態に係る不正検知ECUを含む車載ネットワークシステムについて、図面を参照しながら説明する。ここで示す実施の形態は、いずれも本開示の一具体例を示すものである。従って、以下の実施の形態で示される数値、構成要素、構成要素の配置及び接続形態、並びに、ステップ(工程)及びステップの順序等は、一例であって本開示を限定するものではない。以下の実施の形態における構成要素のうち、独立請求項に記載されていない構成要素については、任意に付加可能な構成要素である。また、各図は、模式図であり、必ずしも厳密に図示されたものではない。
 (実施の形態1)
 以下、本開示の実施の形態として、複数の電子制御ユニット(ECU)がバスを介して通信する車載ネットワークシステム10について、図面を用いて説明する。
 [1.1 車載ネットワークシステム10の全体構成]
 図1は、実施の形態1に係る車載ネットワークシステム10の全体構成を示す図である。車載ネットワークシステム10は、CANプロトコルに従って通信するネットワーク通信システムの一例であり、制御装置、センサ等の各種機器が搭載された自動車におけるネットワーク通信システムである。車載ネットワークシステム10は、バス200と不正検知ECU(ヘッドユニット)100、各種機器に接続されたECU400a~400d等のECUといったバスに接続された各ノードとを含んで構成される。なお、図1では省略しているものの、車載ネットワークシステム10には、不正検知ECU100及びECU400a~400d以外にもいくつものECUが含まれ得る。ECUは、例えば、プロセッサ(マイクロプロセッサ)、メモリ等のデジタル回路、アナログ回路、通信回路等を含む装置である。メモリは、ROM、RAM等であり、プロセッサにより実行される制御プログラム(コンピュータプログラム)を記憶することができる。例えばプロセッサが、制御プログラム(コンピュータプログラム)に従って動作することにより、ECUは各種機能を実現することになる。なお、コンピュータプログラムは、所定の機能を達成するために、プロセッサに対する指令を示す命令コードが複数個組み合わされて構成されたものである。
 ECU400a~400dは、バス200と接続され、それぞれエンジン310、ブレーキ320、ドア開閉センサ330、窓開閉センサ340に接続されている。ECU400a~400dのそれぞれは、接続されている機器(エンジン310等)の状態を取得し、定期的に状態を表すフレーム(後述するデータフレーム)等をネットワーク(つまりバス)に送信している。
 不正検知ECU(ヘッドユニット)100は、一種のECUであり、ECU400a~400dから送信されるフレームを受信し、各種状態をディスプレイ(図示しない)に表示して、ユーザに提示する機能を持つ。また、不正検知ECU100が取得する各情報を示すフレームを生成して、そのフレームを、バス200を介して1台以上のECUに送信する機能を持つ。また、不正検知ECU100は、送受信するフレームについてルールへの適合性を判定することで、不正なフレーム(つまりルールに適合しないフレーム)か否かの判別を行い、不正なフレームを検知するとエラーフレームを送信する不正検知機能を有する。不正なフレームは、不正を示す所定条件に該当するフレームであるとも言える。なお、不正検知ECU(ヘッドユニット)100は、例えばカーナビゲーション、音楽再生、動画再生、ウェブページ表示、スマートフォンとの連携、アプリケーションプログラムのダウンロード及び実行等の機能を有し得る。本実施の形態では、ヘッドユニットである不正検知ECU100の不正検知機能に関連した動作に注目して説明する。
 車載ネットワークシステム10においてはCANプロトコルに従って、各ECUがフレームの授受を行う。CANプロトコルにおけるフレームには、データフレーム、リモートフレーム、オーバーロードフレーム及びエラーフレームがある。
 [1.2 CANでのデータの伝送]
 CANでは、通信路は2本のワイヤで構成されたバス(上述のバス200等)であり、バスに接続されているECUはノードと呼ばれる。バスに接続されている各ノードは、フレームと呼ばれるメッセージを送受信する。フレームを送信する送信ノードは、2本のワイヤで電位差を発生させることによって、レセシブと呼ばれる「1」の値と、ドミナントと呼ばれる「0」の値を送信する。2本のワイヤの電位差が大きい状態がドミナントであり、逆に電位差が小さい状態がレセシブである。複数の送信ノードが同一のタイミングで、レセシブとドミナントをバスに送出(送信)した場合は、ドミナントが優先されて送信される。受信ノードは、受け取ったフレームのフォーマットに異常がある場合には、エラーフレームと呼ばれるフレームを送信する。エラーフレームとは、ドミナントを6bit連続して送信することで、送信ノードや他の受信ノードにフレームの異常を通知するものである。
 またCANでは送信先や送信元を指す識別子は存在せず、送信ノードはフレーム毎にメッセージIDと呼ばれるIDを付けて送信し(つまりバスに信号を送出し)、各受信ノードは予め定められたIDのフレームのみを受信する(つまりバスから信号を読み取る)。また、CSMA/CA(Carrier Sense Multiple Access/Collision Avoidance)方式を採用しており、複数ノードの同時送信時にはメッセージIDによる調停が行われ、メッセージIDの値が小さいフレームが優先的に送信される。
 CANのデータ通信はデータフレームを用いて行われ、CAN2.0規格では1フレームで8バイトまでのデータを送信できる。
 [1.3 データフレームフォーマット]
 以下、CANプロトコルに従ったネットワークで用いられるフレームの1つであるデータフレームについて説明する。
 図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)の各フィールドで構成される。
 SOFは、1bitのドミナントで構成される。バスがアイドルの状態はレセシブになっており、SOFによりドミナントへ変更することでフレームの送信開始を通知する。
 IDフィールドは、11bitで構成される、データの種類を示す値であるID(メッセージID)を格納するフィールドである。複数のノードが同時に送信を開始した場合、このIDフィールドで通信調停を行うために、IDが小さい値を持つフレームが高い優先度となるよう設計されている。
 RTRは、データフレームとリモートフレームとを識別するための値であり、データフレームにおいてはドミナント1bitで構成される。
 IDEと「r」とは、両方ドミナント1bitで構成される。
 DLCは、4bitで構成され、データフィールドの長さを示す値である。なお、IDE、「r」及びDLCを合わせてコントロールフィールドと称する。
 データフィールドは、最大64bitで構成される送信するデータの内容を示す値である。8bit毎に長さを調整できる。送られるデータの仕様については、CANプロトコルで規定されておらず、車載ネットワークシステム10において定められる。従って、車種、製造者(製造メーカ)等に依存した仕様となる。
 CRCシーケンスは、15bitで構成される。SOF、IDフィールド、コントロールフィールド及びデータフィールドの送信値より算出される。
 CRCデリミタは、1bitのレセシブで構成されるCRCシーケンスの終了を表す区切り記号である。なお、CRCシーケンス及びCRCデリミタを合わせてCRCフィールドと称する。
 ACKスロットは、1bitで構成される。送信ノードはACKスロットをレセシブにして送信を行う。受信ノードはCRCシーケンスまで正常に受信ができていればACKスロットをドミナントとして送信する。レセシブよりドミナントが優先されるため、送信後にACKスロットがドミナントであれば、送信ノードは、いずれかの受信ノードが受信に成功していることを確認できる。
 ACKデリミタは、1bitのレセシブで構成されるACKの終了を表す区切り記号である。
 EOFは、7bitのレセシブで構成されており、データフレームの終了を示す。
 [1.4 エラーフレームフォーマット]
 図3は、CANプロトコルで規定されるエラーフレームのフォーマットを示す図である。エラーフレームは、エラーフラグ(プライマリ)と、エラーフラグ(セカンダリ)と、エラーデリミタとから構成される。
 エラーフラグ(プライマリ)は、エラーの発生を他のECU(ノード)に知らせるために使用される。エラーを検知したノードはエラーの発生を他のノードに知らせるために6bitのドミナントを連続で送信する。この送信は、CANプロトコルにおけるビットスタッフィングルール(連続して同じ値を6bit以上送信しない)に違反し、他のノードからのエラーフレーム(セカンダリ)の送信を引き起こす。
 エラーフラグ(セカンダリ)は、エラーの発生を他のノードに知らせるために使用される連続した6ビットのドミナントで構成される。エラーフラグ(プライマリ)を受信してビットスタッフィングルール違反を検知した全てのノードがエラーフラグ(セカンダリ)を送信することになる。
 エラーデリミタ「DEL」は、8bitの連続したレセシブであり、エラーフレームの終了を示す。
 [1.5 エラーカウンタ]
 CANプロトコルに従って、CANバスで通信する各ECUではエラー発生時にエラーカウンタを増加させる。
 CANバス上へのエラーフレームの送信が開始されると、それまでにバスに流れていたフレームの送信は、レセシブより優先されるドミナントが連続するエラーフレームにより上書き(つまり無効化)されることで、中断される。そして、それまでバスに流れていたフレームを送信したECU(送信ノード)は、送信エラーを確認すると、そのECUのCANコントローラにおける送信エラーカウンタを1増加する。
 また、エラーフレーム(プライマリ)がCANバスに送信されると、CANバスに接続されたECU(受信ノード)では、上述のビットスタッフィングルール違反のため受信エラーとなり、エラーフレーム(セカンダリ)を送信してそのECUのCANコントローラにおける受信エラーカウンタを1増加する。
 図4は、不正なフレームがCANバスに送信された後におけるエラーカウンタの一例を示す図である。この例では、CANバスに接続された不正ECUが不正なフレームを送信し、不正検知ECUがこの不正なフレームを検知すると無効化するためのエラーフレーム(プライマリ)を送信し、正規ECU(正規のECU)がエラーフレーム(セカンダリ)を送信した場合における各ECUのエラーカウンタの増加値を示している。
 CANでは、データフレームに送信元を検証する手段がなく、データフレームを送信するとバス上のすべてのノード(ECU)にブロードキャストされるため、バスに接続されたECUが一度不正に攻撃者に侵入されて操られる(コントロールされる)と、このECUが重要な制御を担う他のECUになりすまして、不正に機器の制御が行われてしまう脅威がある。不正ECUの一例は、この侵入されたECUである。なお、故障したECU等も不正ECUとなり得る。上述のように不正検知ECU(ヘッドユニット)100では、不正ECUが送信するフレームが、車載ネットワークシステムにおいて予め定めているルールに適合しているか否かにより、不正であるか否かを判別する。
 CANでは、各ECUで、受信エラーカウンタが一定閾値より大きくなると迅速な送信が制限されるパッシブ状態と呼ばれる状態に遷移する。通常状態ではECUは、CANバスがバスアイドル状態になった後、つまりデータフレーム後の3ビットのレセシブであるITM(Intermission)の後にならないと、データフレームを送信できない。これに対して、パッシブ状態では、更に、ITMの終了後に8ビットのレセシブを受信した後でないと、データフレームを送信できないので、迅速な送信は制限される。
 不正なフレームの送信阻止(無効化)のためのエラーフレームにより、正規ECUの受信エラーカウンタが増えて、迅速な送信が制限される状態へと移行してしまうというエラーフレームの送信の悪影響を抑制するために、不正検知ECU100は、エラーフレームの送信後に一定条件下で速やかに正常フレームを送信する機能を有している。CANプロトコルに従って動作する正規ECUは、正常フレーム(つまりCANプロトコルに従ったフレーム)を受信エラーなく受信できれば、受信エラーカウンタを1減少させる。これにより、パッシブ状態へ移行する可能性が低減する。
 [1.6 不正検知ECU100及びECU400aの構成]
 図5は、不正検知ECU(ヘッドユニット)100、正規ECU400a等の構成の一例を示す構成図である。同図では、図1に示した車載ネットワークシステム10のバス200に接続されたECUのうち、不正検知機能を有するECUである不正検知ECU(ヘッドユニット)100、及び、正規ECUの1つであるECU400aを、説明の便宜上抽出して、示している。図5には、例えば故障状態、或いは、攻撃者にコントロールされた状態等により不正なデータフレームを送信するECUとしての不正ECU2001を付記している。
 不正ECU2001、正規ECU400a、及び、不正検知ECU100は、バス200を介して、電子機器制御に関するデータフレームの送受信等を行う。
 不正検知ECU100は、CANプロトコルに従い、データフレーム及びエラーフレームを送信する機能を有し、バス200を監視し、不正なデータフレームがバス200上に流れている場合、エラーフレームを用いて、不正なデータフレームの送信を阻止(つまり不正なデータフレームを無効化)する機能を有する。
 不正検知ECU100は、図5に示すように、演算部3001、通信制御部3002、及び、通信インタフェース(通信I/F)3003を備える。演算部3001と通信制御部3002とは、有線又は無線で相互に通信可能となるように構成され、通信制御部3002と通信I/F3003とは、同様に有線又は無線で相互に通信可能となるように構成されている。通信I/F3003は、バス200(CANバス)に接続してフレームの送受信を行う通信回路であるCANトランシーバ等である。通信制御部3002は、バス200での通信を制御してCANプロトコルに係る処理を行うプロセッサであるCANコントローラであり、通信I/F3003を介して受信した情報を演算部3001から読み出し可能なデータとする機能、及び、演算部3001からの指示に応じて通信I/F3003を介してCANプロトコルに従ったデータフレーム或いはエラーフレームを送信する機能を有する。また、CANコントローラである通信制御部3002は、エラーカウンタ(送信エラーカウンタ及び受信エラーカウンタ)を含み、エラーカウンタの操作及びエラーカウンタに応じた制御等を行う。演算部3001は、CPU(Central Processing Unit)及びメモリで構成され、メモリに格納された制御プログラムをCPUで実行することにより、通信制御部3002を制御し、受信したフレームに基づく処理及び送信すべきフレームの生成等に係る各種機能を実現する。
 ECU400a(正規ECU)は、CANプロトコルに従い、データフレーム及びエラーフレームを送信する機能、バス200を流れるデータのエラーを検出した場合にエラーフレームを送信し、受信エラーカウンタをインクリメントする(増加させる)機能、並びに、バス200を流れるデータフレームを正常に(受信エラーなく)受信したときに受信エラーカウンタをデクリメントする(減少させる)機能を有する。
 ECU400aは、図5に示すように、有線又は無線で相互に通信可能となるように構成された演算部3011、通信制御部3012、及び、通信インタフェース(通信I/F)3013を備える。演算部3011、通信制御部3012及び通信I/F3013は、それぞれ、演算部3001、通信制御部3002、通信I/F3003と同様である。通信制御部3012は、受信エラーカウンタを含みCANプロトコルに従ってバス200での通信を制御するCANコントローラであり、バス200からの正常フレームの受信に成功した場合には受信エラーカウンタの値を減少させる。なお、図5では省略しているが、ECU400b~400dも、ECU400aと同様の構成を備える。
 [1.7 不正検知ECU100の機能構成]
 図6は、不正検知ECU(ヘッドユニット)100の機能ブロック図である。
 不正検知ECU100は、機能面において図6に示すように、受信部110及び送信部120を備え、送信部120は不正判定部121を備える。受信部110及び送信部120の機能は、制御プログラムを実行するCPUである演算部3001により実現される。なお、ヘッドユニットとしての不正検知ECU100は、ここでは説明を省略するが、他の正規ECUとの間でデータフレームの授受を行い、ヘッドユニットとしての各種機能(例えばカーナビゲーション、音楽再生、動画再生、ウェブページ表示、スマートフォンとの連携等の機能)を実現し得る。
 受信部110は、バス200へ送信が開始されたフレームを受信する機能を有し、通信制御部3002が受信したフレームに係るデータを読み出す。
 不正判定部121は、受信部110で受信されたデータフレームのデータから、バス200を流れるデータフレームが不正なフレームかどうかを検知する機能を有する。即ち、不正判定部121は、データフレームについて予め定められた判定ルールへの適合性の判定(データフレームが不正であるか否かの判定)を行う。判定ルールは、車載ネットワークシステム10において予め定められたものであれば、いかなるルールであっても良い。判定ルールの例としては、例えば、予め定められたメッセージIDのリストに記載されたメッセージIDを有するフレームであるというルールが挙げられる。また、別の例としては、例えば、定期的に送信されるように定められているメッセージIDを有するデータフレームが受信される時間間隔が、予め定められた適正周期からプラスマイナス一定のマージンの範囲内に収まっているというルールが挙げられる。
 送信部120は、不正判定部121により不正なデータフレームが検知された場合にエラーフレームを送信する機能、正規ECUの受信エラーカウンタを適切に制御するためにエラーフレームの送信後に一定条件下で速やかに正常フレーム(CANプロトコルに従ったデータフレーム)を送信する機能等を有する。送信部120は、フレーム内容を与えて通信制御部3002を制御し、バス200へのフレームの送信を実現させる。
 以下、不正なフレームを検知した場合の不正検知ECU100による処理についての各動作例を説明する。不正検知ECU100は、例えば、演算部(CPU)3001がそれぞれの処理に対応した制御プログラムを実行することで、各動作例に係る動作を実現し得る。なお、以下説明する各動作例は、一例に過ぎず、例えば、不正検知ECU100は、以下の複数の動作例における一部の処理手順を組み合わせて実行しても良い。
 [1.8 不正検知ECU100の動作例1]
 図7は、本実施の形態における不正検知ECU100の動作例1に係る処理手順を示すフローチャートである。以下、同図に即して動作例1について説明する。
 図7に示すように、まず、不正検知ECU100は、バス200に流れるフレームを監視し、受信部110で受信したフレームが不正なフレームであるか否かを不正判定部121で判定する(ステップS401)。即ち、不正検知ECU100は、いずれかのECUによりバス200に送信が開始されたフレームを1ビットずつ受信して監視し、判定ルールに適合しているか否かを判定する。判定ルールに適合しているか否かの判定は、不正を示す所定条件(判定ルールに適合しないという条件)に該当するか否かの判定とも言える。例えば、不正ECU2001は、CANプロトコルには適合するが、不正を示す所定条件に該当する(判定ルールに適合しない)データフレームを送信し得る。この不正ECU2001により送信された不正なデータフレームが、ステップS401で不正なフレームであると判定され得る。ステップS401での判定により、判定ルールに適合していない(つまり不正を示す所定条件に該当した)不正なフレームが検知され得る。不正なフレームが検知されない場合は、ステップS401での処理が繰り返される。
 不正なフレームを検知した場合には、不正検知ECU100は、送信部120等により、エラーフレームを送信する(ステップS402)。このエラーフレームの送信は、不正なフレームの最後尾が送信される前のタイミングで行われ、これにより、バス200上で、不正なフレームの少なくとも一部はエラーフレームに上書きされることで無効化される。従って、エラーフレームの送信により、正規ECUが不正なフレームを受信してその不正なフレームに対応した機能処理等を実行してしまうことが、阻止される。続いて、不正検知ECU100は、送信部120等により、CANプロトコルに従った正常フレーム(正常データフレーム)を送信する(ステップS403)。ステップS403での正常フレームの送信は、例えば、ステップS402でエラーフレームを送信した後においてバス200が最初にアイドル状態(バスアイドル)になった際に、行われる。ステップS403での正常フレームの送信は、必ずしもバス200が最初にバスアイドルになった瞬間に行われる必要はないが、エラーフレームによる正規ECUへの悪影響(受信エラーカウンタの増大)を低減させる観点において、正常フレームの送信が速やかに行われることは有用である。なお、不正検知ECU100がステップS402でエラーフレームを送信して、不正なフレームを無効化した場合に、不正ECU2001が直ちに不正なデータフレームの送信を繰り返すようなときにおいては、不正検知ECU100は、更に、エラーフレームの送信を行っても良く、その後においてバスアイドルになった際等において正常フレームを送信しても良い。
 [1.9 動作例1の効果]
 本実施の形態の動作例1では、不正検知ECU100が、エラーフレームを用いて不正なフレームの送信阻止(無効化)を行う際に、正常データフレームを続けて送信する。不正検知ECU100は、不正なフレームを検知してエラーフレームを送信するので、受信ノードによる問題ではなく、不正なフレームを送信した送信ノードによる問題であることが明らかであるので、受信エラーカウンタを増大させることを抑制するために正常フレームを送信している。これにより、正規ECUの受信エラーカウンタがデクリメントされる。即ち、不正検知ECU100によるエラーフレームの送信後の正常フレームの送信により、正規ECUの受信エラーカウンタが一方的に増大してしまうことが抑制され、正規ECUがパッシブ状態に遷移する可能性が低減され得る。従って、不正なフレームの無効化のためのエラーフレームによって正規ECUの動作が制限されてしまうことが防止され得る。
 [1.10 不正検知ECU100の動作例2]
 図8は、本実施の形態における不正検知ECU100の動作例2に係る処理手順を示すフローチャートである。以下、同図に即して動作例2について説明する。
 不正検知ECU100は、バス200に流れるフレームを監視し、受信部110で受信したフレームが不正なフレームであるか否かを不正判定部121で判定する(ステップS501)。不正なフレームが検知されない場合は、ステップS501での処理が繰り返される。判定ルールに適合していない不正なフレームを検知した場合には、不正検知ECU100は、送信部120等により、エラーフレームを送信する(ステップS502)。なお、ステップS501、S502はそれぞれ、上述のステップS401、S402と同様である。
 次に、不正検知ECU100は、送信部120等により、データフィールドの長さが0(ゼロ)である正常データフレームを送信する(ステップS503)。データフィールドの長さが0である正常データフレームは、CANプロトコルに従ったデータフレームであって、データフィールドにデータを含まないのでDLCの値が0のデータフレームである。なお、ステップS503でのデータフィールドの長さが0である正常データフレームの送信は、例えば、ステップS502でエラーフレームを送信した後にバス200が最初にバスアイドルになった際等に行われる。
 [1.11 動作例2の効果]
 本実施の形態の動作例2では、不正検知ECU100が、エラーフレームを用いて不正なフレームの送信阻止(無効化)を行った場合にその後に、正常データフレームを送信する。これにより、正規ECUの受信エラーカウンタが一方的に増大してしまうことを抑制し、正規ECUが、パッシブ状態に遷移する可能性を低減し得る。従って、不正なフレームの無効化のためのエラーフレームによって正規ECUの動作が制限されてしまうことが防止され得る。また、正規ECUの受信エラーカウンタをデクリメントするために不正検知ECU100により送信される正常データフレームは、データフィールドの長さが0のデータフレームであるので、送信される正常データフレームによるバス占有時間が短くなり、バス帯域への影響が抑制される。
 [1.12 不正検知ECU100の動作例3]
 図9は、本実施の形態における不正検知ECU100の動作例3に係る処理手順を示すフローチャートである。以下、同図に即して動作例3について説明する。
 不正検知ECU100は、バス200に流れるフレームを監視し、受信部110で受信したフレームが不正なフレームであるか否かを不正判定部121で判定する(ステップS601)。不正なフレームが検知されない場合は、ステップS601での処理が繰り返される。判定ルールに適合していない不正なフレームを検知した場合には、不正検知ECU100は、送信部120等により、エラーフレームを送信する(ステップS602)。なお、ステップS601、S602はそれぞれ、上述のステップS401、S402と同様である。
 次に、不正検知ECU100は、送信部120等により、他のECUで利用されないID(メッセージID)を有する正常データフレームを送信する(ステップS603)。他のECUで利用されないメッセージIDとは、車載ネットワークシステム10においてバス200に接続された、不正検知ECU100以外の、いずれのECU(ECU400a~400d)においてもそのメッセージIDを識別して行うべき処理が定められていないメッセージIDである。例えば、不正検知ECU100以外の、バス200に接続されたいずれのECUも、0x200というメッセージIDのデータフレームを送信せず、0x200というメッセージIDのデータフレームを受信した場合にそのデータフレームに対応した機能処理等を実行しない場合において、ステップS603において不正検知ECU100は、0x200というメッセージIDの正常データフレームを送信する。ステップS603で送信される正常データフレームは、例えばデータフィールドの長さが0であるデータフレームであることが有用であるが、必ずしもデータフィールドの長さが0でなくても良い。なお、ステップS603での正常データフレームの送信は、例えば、ステップS602でエラーフレームを送信した後にバス200が最初にバスアイドルになった際等に行われる。
 [1.13 動作例3の効果]
 本実施の形態の動作例3では、不正検知ECU100が、エラーフレームを用いて不正なフレームの送信阻止(無効化)を行った場合にその後に、正常データフレームを送信する。これにより、正規ECUの受信エラーカウンタが一方的に増大してしまうことを抑制し、正規ECUが、パッシブ状態に遷移する可能性を低減し得る。従って、不正なフレームの無効化のためのエラーフレームによって正規ECUの動作が制限されてしまうことが防止され得る。また、正規ECUの受信エラーカウンタをデクリメントするために不正検知ECU100により送信される正常データフレームのメッセージIDは、他のECUで利用されないIDであるため、正常データフレームを受信した正規ECUが誤動作を行うことが防止され得る。
 [1.14 不正検知ECU100の動作例4]
 図10は、本実施の形態における不正検知ECU100の動作例4に係る処理手順を示すフローチャートである。以下、同図に即して動作例4について説明する。
 不正検知ECU100は、バス200に流れるフレームを監視し、受信部110で受信したフレームが不正なフレームであるか否かを不正判定部121で判定する(ステップS701)。即ち、不正検知ECU100は、いずれかのECUによりバス200に送信が開始されたフレームを1ビットずつ受信して監視し、判定ルールに適合しているか否か(不正を示す所定条件に該当するか否か)を判定する。これにより、判定ルールに適合していない(つまり不正を示す所定条件に該当した)不正なフレームが検知され得る。ステップS701で不正なフレームが検知されない場合は、ステップS702及びステップS703をスキップしてステップS704での処理に進む。
 ステップS701で、不正なフレームを検知した場合には、不正検知ECU100は、送信部120等により、エラーフレームを送信する(ステップS702)。このエラーフレームの送信は、不正なフレームの最後尾が送信される前のタイミングで行われ、これにより、バス200上で、不正なフレームの少なくとも一部はエラーフレームに上書きされることで無効化される。従って、エラーフレームの送信により、正規ECUが不正なフレームを受信してその不正なフレームに対応した機能処理等を実行してしまうことが、阻止される。続いて、不正検知ECU100は、正常データフレームの送信管理用のカウンタである正常データフレーム送信回数カウンタを、+1(インクリメント)する(ステップS703)。この正常データフレーム送信回数カウンタは、送信したエラーフレームの数と同数の正常フレームを送信するために用いられ、初期値が0(ゼロ)であり、エラーフレームの送信毎に1増加させられ、正常データフレームの送信に成功する毎に1減少させられる。
 ステップS703の後において、或いは、ステップS701で不正なフレームが検知されない場合において、不正検知ECU100は、正常データフレーム送信回数カウンタの値を確認し(ステップS704)、0であれば、ステップS701に遷移する。
 ステップS704において正常データフレーム送信回数カウンタの値が0でなければ、不正検知ECU100は、送信部120等により、正常データフレームを送信する(ステップS705)。ステップS705での正常データフレームの送信は、バスアイドルとなったバス200に対して正常データフレームを1ビットずつ送出することで行われる。不正検知ECU100は、その正常データフレームの送信が成功したか否かを判定する(ステップS706)。ステップS706では、ステップS705でバス200に1ビットずつ送出を開始した正常データフレームについて、他のECUによるデータフレームの同時送信の可能性があるので、CANにおける通信調停の結果等として送信が成功したか否かを判定する。送信が成功したか否かの判定は、例えば、送信した正常データフレームとバス200に現れたビット値とが一致するか否かにより、行われ、また例えば送信した正常データフレームについてのバス200に現れたACKスロットがドミナントであるか否か等により、行われても良い。なお、不正検知ECU100の演算部(CPU)3001が、通信制御部(CANコントローラ)3002から送信が成功したか否かを識別可能な送信完了通知を受けること等によって、送信が成功したか否かを判定することとしても良い。ステップS706で、正常データフレームの送信が成功したと判定した場合には、不正検知ECU100は、正常データフレーム送信回数カウンタを、-1(デクリメント)して(ステップS707)、ステップS701に遷移する。
 ステップS706で、通信調停に負ける等により正常データフレームの送信に成功しなかった(つまり送信に失敗した)と判定した場合には、不正検知ECU100は、ステップS707をスキップして、ステップS701に遷移する。これにより、不正検知ECU100の送信部120等により、正常データフレームの送信に失敗した場合において、再び正常データフレームが送信されることになる。不正検知ECU100がステップS702でエラーフレームを送信して、不正なフレームを無効化した場合に、例えば不正ECU2001が直ちに不正なデータフレームの送信を繰り返すようなときにおいては、不正検知ECU100がステップS705で送信する正常データフレームがその不正なデータフレームによって通信調停に負ける可能性がある。このようなときでも不正検知ECU100は、正常データフレーム送信回数カウンタに従っていずれ正常データフレームを送信し得る。
 [1.15 動作例4の効果]
 本実施の形態の動作例4では、不正検知ECU100が、エラーフレームを用いて不正なフレームの送信阻止(無効化)を行った場合にその後に、正常データフレームを送信する。これにより、正規ECUの受信エラーカウンタが一方的に増大してしまうことを抑制し、正規ECUが、パッシブ状態に遷移する可能性を低減し得る。従って、不正なフレームの無効化のためのエラーフレームによって正規ECUの動作が制限されてしまうことが防止され得る。また、不正検知ECU100は正常データフレーム送信回数カウンタを用いて、送信したエラーフレームの数と同数の正常データフレームを送信する。これにより、万が一、正常データフレームが通信調停等によって一時的に送信できなかった場合でも、正規ECUの受信エラーカウンタをデクリメントするために正常データフレームが送信されることを保証し得る。このため、不正なフレームの無効化のためのエラーフレームによって正規ECUの動作が制限されてしまうことが防止され得る。
 [1.16 不正検知ECU100の動作例5]
 図11は、本実施の形態における不正検知ECU100の動作例5に係る処理手順を示すフローチャートである。以下、同図に即して動作例5について説明する。
 不正検知ECU100は、バス200に流れるフレームを監視し、受信部110で受信したフレームが不正なフレームであるか否か(つまり不正を示す所定条件に該当するか否か)を不正判定部121で判定する(ステップS801)。ステップS801で不正なフレームが検知されない場合は、ステップS802及びステップS803をスキップしてステップS804での処理に進む。
 ステップS801で、不正なフレームを検知した場合には、不正検知ECU100は、送信部120等により、エラーフレームを送信する(ステップS802)。続いて、不正検知ECU100は、正常データフレームの送信管理用のカウンタである正常データフレーム送信回数カウンタを、+1(インクリメント)する(ステップS803)。
 ステップS803の後において、或いは、ステップS801で不正なフレームが検知されない場合において、不正検知ECU100は、正常データフレーム送信回数カウンタの値を確認し(ステップS804)、0であれば、ステップS801に遷移する。
 ステップS804において正常データフレーム送信回数カウンタの値が0でなければ、不正検知ECU100は、送信部120等により、正常データフレームを送信する(ステップS805)。続いて、不正検知ECU100は、その正常データフレームの送信が成功したか否かを判定する(ステップS806)。ステップS806で、正常データフレームの送信が成功したと判定した場合には、不正検知ECU100は、正常データフレーム送信回数カウンタを、-1(デクリメント)して(ステップS807)、ステップS808に遷移する。
 ステップS806で、通信調停に負ける等により正常データフレームの送信が成功しなかったと判定した場合には、不正検知ECU100は、ステップS807をスキップして、ステップS808に遷移する。
 なお、ステップS801、S802、S803、S804、S805、S806、S807はそれぞれ、上述のステップS701、S702、S703、S704、S705、S706、S707と同様である。
 ステップS807の後において、或いは、ステップS806で正常データフレームの送信に成功しなかったと判定した場合において、不正検知ECU100は、バス200上に正常データフレームが流れたか否かを確認(判定)する(ステップS808)。具体的にはステップS808では、不正検知ECU100は、例えば、CANプロトコルに従った正常データフレームであって不正なフレームでない(つまり不正を示す所定条件に該当しない)正常データフレームをバス200から受信したか否かを確認する。ステップS808で、バス200上に正常データフレームが流れなかったと判定した場合には、ステップS809及びステップS810をスキップしてステップS801に遷移する。
 ステップS808で、バス200上に正常データフレームが流れたことを確認した場合には、不正検知ECU100は、正常データフレーム送信回数カウンタが0より大きい限り(ステップS809)、正常データフレーム送信回数カウンタをー1(デクリメント)して(ステップS810)、ステップS801に遷移する。この正常データフレーム送信回数カウンタは、送信したエラーフレームの数から、エラーフレームの送信後に不正なフレームでない正常データフレームがバス200から受信された数を減算して得られる数以上の正常データフレームを送信するために用いられる。正常データフレーム送信回数カウンタは、初期値が0であり、概ね、エラーフレームの送信に対応して増加させられ、正常データフレームの送信に成功した場合或いはバス200上に他のECUにより正常データフレームが送信された場合に対応して減少させられる。
 [1.17 動作例5の効果]
 本実施の形態の動作例5では、不正検知ECU100が、エラーフレームを用いて不正なフレームの送信阻止(無効化)を行った場合にその後に、正常データフレームを送信する。これにより、正規ECUの受信エラーカウンタが一方的に増大してしまうことを抑制し、正規ECUが、パッシブ状態に遷移する可能性を低減し得る。従って、不正なフレームの無効化のためのエラーフレームによって正規ECUの動作が制限されてしまうことが防止され得る。また、不正検知ECU100は正常データフレーム送信回数カウンタを用いて、送信したエラーフレームの数と同数の正常データフレームがバス200上に流れるようにする。これにより、万が一、正常データフレームが通信調停等によって一時的に送信できなかった場合でも、正規ECUの受信エラーカウンタをデクリメントするために正常データフレームが送信されることを保証し得る。このため、不正なフレームの無効化のためのエラーフレームによって正規ECUの動作が制限されてしまうことが防止され得る。また、バス200を流れた正常データフレームの数の分だけ、不正検知ECU100は、正規ECUの受信エラーカウンタをデクリメントするために自ら送信する正常データフレームの数を減らす。これにより、正規ECUの受信エラーカウンタをデクリメントするために送信する正常データフレームによるバス占有時間が短くなり、バス帯域への影響が抑制される。
 [1.18 不正検知ECU100の動作例6]
 図12は、本実施の形態における不正検知ECU100の動作例6に係る処理手順を示すフローチャートである。以下、同図に即して動作例6について説明する。
 不正検知ECU100は、バス200に流れるフレームを監視し、受信部110で受信したフレームが不正なフレームであるか否か(つまり不正を示す所定条件に該当するか否か)を不正判定部121で判定する(ステップS901)。ステップS901で不正なフレームが検知されない場合は、ステップS902及びステップS903をスキップしてステップS904での処理に進む。
 ステップS901で、不正なフレームを検知した場合には、不正検知ECU100は、送信部120等により、エラーフレームを送信する(ステップS902)。続いて、不正検知ECU100は、正常データフレームの送信管理用のカウンタである正常データフレーム送信回数カウンタを、+1(インクリメント)する(ステップS903)。
 ステップS903の後において、或いは、ステップS901で不正なフレームが検知されない場合において、不正検知ECU100は、正常データフレーム送信回数カウンタの値を確認し(ステップS904)、0であれば、ステップS901に遷移する。
 ステップS904において正常データフレーム送信回数カウンタの値が0でなければ、不正検知ECU100は、正常データフレーム送信回数カウンタの値が閾値より大きくなっていれば(ステップS905)、ステップS907で送信する正常データフレームのIDフィールドに含ませるメッセージIDの値を、より小さい値へ変更する(ステップS906)。CANではメッセージIDの値が小さいほどバス上での通信調停において優先度が高くなる。正常データフレーム送信回数カウンタの初期値は0であり、閾値は、0以上の予め定められた値であり、例えば0、1、5等といった値をとり得る。閾値が0であれば、正常データフレームの送信に失敗した場合において正常データフレームに用いるメッセージIDをより小さい値へ変更することになり得る。また、正常データフレームの送信に失敗した場合において一定条件下(例えば1以上の閾値を超える条件の下)で、正常データフレームに用いるメッセージIDを、優先度のより高いものへと変更しても良い。例えば、正常データフレームのメッセージIDの初期値としては、CANの通信調停における優先度が比較的低いところの大きな値のメッセージIDが用いられ、通信調停に負ける等により送信に失敗し、送信すべき正常データフレームの数が増加した場合等においては、ステップS906の処理で、それより優先度が高いメッセージID(つまりメッセージIDの値が、より小さなもの)に変更される。
 ステップS905で正常データフレーム送信回数カウンタの値が閾値より大きくなっていない場合において、或いは、ステップS906の後において、不正検知ECU100は、送信部120等により、正常データフレームを送信する(ステップS907)。
 続いて、不正検知ECU100は、その正常データフレームの送信が成功したか否かを判定する(ステップS908)。ステップS908で、正常データフレームの送信が成功したと判定した場合には、不正検知ECU100は、正常データフレーム送信回数カウンタを、-1(デクリメント)して(ステップS909)、ステップS910に遷移する。
 ステップS908で、通信調停に負ける等により正常データフレームの送信が成功しなかったと判定した場合には、不正検知ECU100は、ステップS909をスキップして、ステップS910に遷移する。
 ステップS909の後において、或いは、ステップS908で正常データフレームの送信に成功しなかったと判定した場合において、不正検知ECU100は、バス200上に正常データフレームが流れたか否かを確認(判定)する(ステップS910)。ステップS910で、バス200上に正常データフレームが流れなかったと判定した場合には、ステップS911及びステップS912をスキップしてステップS901に遷移する。
 ステップS910で、バス200上に正常データフレームが流れたことを確認した場合には、不正検知ECU100は、正常データフレーム送信回数カウンタが0より大きい限り(ステップS911)、正常データフレーム送信回数カウンタをー1(デクリメント)して(ステップS912)、ステップS901に遷移する。
 なお、ステップS901~S904、S907~S912はそれぞれ、上述のステップS801~S804、S805~S810と同様である。また、ステップS906で、より小さい値に変更した、送信する正常データフレームにおけるメッセージIDを、不正検知ECU100は、何らかのタイミングで(例えば、正常データフレーム送信回数カウンタが0になったとき等において)、初期値に戻すようにしても良い。
 [1.19 動作例6の効果]
 本実施の形態の動作例6では、不正検知ECU100が、エラーフレームを用いて不正なフレームの送信阻止(無効化)を行った場合にその後に、正常データフレームを送信する。これにより、正規ECUの受信エラーカウンタが一方的に増大してしまうことを抑制し、正規ECUが、パッシブ状態に遷移する可能性を低減し得る。従って、不正なフレームの無効化のためのエラーフレームによって正規ECUの動作が制限されてしまうことが防止され得る。また、不正検知ECU100は正常データフレーム送信回数カウンタを用いて、送信したエラーフレームの数と同数の正常データフレームがバス200上に流れるようにする。これにより、万が一、正常データフレームが通信調停等によって一時的に送信できなかった場合でも、正規ECUの受信エラーカウンタをデクリメントするために正常データフレームが送信されることを保証し得る。このため、不正なフレームの無効化のためのエラーフレームによって正規ECUの動作が制限されてしまうことが防止され得る。また、バス200を流れた正常データフレームの数の分だけ、不正検知ECU100は、正規ECUの受信エラーカウンタをデクリメントするために自ら送信する正常データフレームの数を減らす。これにより、正規ECUの受信エラーカウンタをデクリメントするために送信する正常データフレームによるバス占有時間が短くなり、バス帯域への影響が抑制される。また、不正検知ECU100は、正常データフレーム送信回数カウンタがある閾値を超えた場合は、正規ECUの受信エラーカウンタをデクリメントするために送信する正常データフレームの優先度を高くする。これにより、最初は優先度の低いメッセージIDを用いた正常データフレームを送信して他のECUの通信への影響を抑えることができる。そして、正常データフレーム送信回数カウンタがある閾値を超えた場合に正常データフレームに用いるメッセージIDを、優先度のより高いものへと変更して、通信調停で負けにくくして、正規ECUの受信エラーカウンタのデクリメントの実行の確保を図ることができる。
 (実施の形態2)
 以下、実施の形態1で示した車載ネットワークシステム10の一部を変形した車載ネットワークシステムについて説明する。
 本実施の形態に係る車載ネットワークシステムは、実施の形態1で示したECU400a等が接続されたバス200と、別のバス1200との両方に接続された不正検知ECU100aを備える。不正検知ECU100aは、実施の形態1で示した不正検知ECU100の一部を変形したものであり、不正なフレームを検知するとエラーフレームを送信する不正検知機能の他に、バス間でデータフレームを転送する転送機能を有する。
 [2.1 不正検知ECU100aの構成]
 図13は、不正検知ECU100a等の構成の一例を示す構成図である。同図では、図5に示したバス200と、このバス200に接続されたECU400a及び不正ECU2001とに加えて、バス1200と、バス1200に接続された正規ECU1400と、不正ECU2011と、バス200及びバス1200の両方に接続された不正検知ECU100aとを示している。正規ECU1400は、実施の形態1で示したECU400aと同様の構成及び機能を有する。なお、不正ECU2011は、例えば故障状態、或いは、攻撃者にコントロールされた状態等により不正なデータフレームを送信するECUである。
 不正検知ECU100aは、CANプロトコルに従い、データフレーム及びエラーフレームを送信する機能を有し、バス200を監視し、不正なデータフレームがバス200上に流れている場合、エラーフレームを用いて、不正なデータフレームの送信を阻止(つまり不正なデータフレームを無効化)する機能を有する。また、不正検知ECU100aは、バス200とバス1200との間で、一定条件下で、一方のバスから他方のバスへとデータフレームを転送する転送機能を有する。この転送機能を有する不正検知ECU100aにより、例えばバス200に接続された正規ECU400aとバス1200に接続された正規ECU1400との間でのデータフレーム(メッセージ)の授受が可能となる。
 バス200ではCANプロトコルに従ったフレームが送受信され、バス1200でも同様にCANプロトコルに従ったフレームが送受信され得る。なお、バス1200での通信に用いられるプロトコルが必ずしもバス200での通信に用いられるプロトコルと一致しなくても良く、例えば、バス200での通信にはCANプロトコルが用いられ、バス1200での通信にはCAN-FD(CAN with Flexible Data Rate)プロトコルが用いられることとしても良い。両バスのプロトコルが一致しない場合においては、不正検知ECU100aが、例えば、フレームの転送に際してプロトコル変換を行う機能(ゲートウェイ機能)を有することとしても良い。ここでは、バス200での通信にもバス1200での通信にもCANプロトコルが用いられるものとして説明を続ける。
 不正検知ECU100aは、図13に示すように、演算部3001a、通信制御部3002、通信制御部3002a、通信I/F3003、及び、通信I/F3003aを備える。演算部3001aは通信制御部3002、3002aと、有線又は無線で相互に通信可能となるように構成され、通信制御部3002と通信I/F3003とは、有線又は無線で相互に通信可能となるように構成され、通信制御部3002aと通信I/F3003aとは、同様に、有線又は無線で相互に通信可能となるように構成されている。図13では、図5に示した構成要素と同様の構成要素については、同じ符号を付しており、ここでは説明を省略する。通信I/F3003aは、CANバス(バス1200)に接続してフレームの送受信を行う通信回路であるCANトランシーバ等である。通信制御部3002aは、バス1200での通信を制御してCANプロトコルに係る処理を行うプロセッサであるCANコントローラであり、通信I/F3003aを介して受信した情報を演算部3001aから読み出し可能なデータとする機能、及び、演算部3001aからの指示に応じて通信I/F3003aを介してCANプロトコルに従ったデータフレーム或いはエラーフレームを送信する機能を有する。また、CANコントローラである通信制御部3002aは、エラーカウンタ(送信エラーカウンタ及び受信エラーカウンタ)を含み、エラーカウンタの操作及びエラーカウンタに応じた制御等を行う。演算部3001aは、CPU及びメモリで構成され、メモリに格納された制御プログラムをCPUで実行することにより、通信制御部3002、3002aを制御し、受信したフレームに基づく処理及び送信すべきフレームの生成等に係る各種機能を実現する。
 正規ECU400a、正規ECU1400、及び、不正検知ECU100aは、バス200或いはバス1200を介して、電子機器制御に関するデータフレームの送受信等を行う。
 [2.2 不正検知ECU100aの機能構成]
 図14は、不正検知ECU100aの機能ブロック図である。
 不正検知ECU100aは、機能面において図14に示すように、受信部110a及び送信部120aを備え、送信部120aは不正判定部121を備える。受信部110a及び送信部120aの機能は、制御プログラムを実行するCPUである演算部3001aにより実現される。なお、不正検知ECU100aは、例えば、ヘッドユニットとしての各種機能(例えばカーナビゲーション等の機能)を有しても良い。
 受信部110aは、バス200或いはバス1200へ送信が開始されたフレームを受信する機能を有し、通信制御部3002或いは通信制御部3002aが受信したフレームに係るデータを読み出す。
 不正判定部121は、実施の形態1で示したものと同様であり(図6参照)、受信部110aで受信されたデータフレームのデータから、そのデータフレームが不正なフレームかどうかを検知する機能を有する。即ち、不正判定部121は、データフレームについて予め定められた判定ルールへの適合性の判定(データフレームが不正であるか否かの判定)を行う。
 送信部120aは、不正判定部121により不正なデータフレームが検知された場合に、バス200及びバス1200のうちいずれのバスにおいて不正なフレームが送信されたかを判別して、その不正なフレームが送信されているバスへとエラーフレームを送信する機能と、正規ECUの受信エラーカウンタを適切に制御するためにエラーフレームの送信後に一定条件下で速やかに正常フレーム(そのバスでの通信に用いられるプロトコルに従ったデータフレーム)を送信する機能とを有する。送信部120aは、不正なデータフレームが送信されているバス上に、その不正なデータフレームの最後尾が送信される前にエラーフレームを送信することで、不正なデータフレームの送信を阻止する(不正なデータフレームを無効化する)。送信部120aは、フレーム内容を与えて通信制御部3002或いは通信制御部3002aを制御し、バス200或いはバス1200へのフレームの送信を実現させる。
 以下、不正なフレームを検知した場合の不正検知ECU100aによる処理についての動作例を説明する。不正検知ECU100aは、例えば、演算部(CPU)3001aが制御プログラムを実行することで、この動作例に係る動作を実現し得る。
 [2.3 不正検知ECU100aの動作例]
 図15は、本実施の形態における不正検知ECU100aの動作例に係る処理手順を示すフローチャートである。以下、同図に即して不正検知ECU100aの動作例について説明する。
 不正検知ECU100aは、バス200及びバス1200に流れるフレームを監視し、受信部110aでバス200及びバス1200のいずれかから受信したフレームが不正なフレームであるか否かを不正判定部121で判定する(ステップS101)。即ち、不正検知ECU100aは、いずれかのECUによりバス200或いはバス1200に送信が開始されたフレームを1ビットずつ受信して監視し、判定ルールに適合しているか否かを判定する。判定ルールに適合しているか否かの判定は、不正を示す所定条件(判定ルールに適合しないという条件)に該当するか否かの判定とも言える。これにより、判定ルールに適合していない(つまり不正を示す所定条件に該当した)不正なフレームが検知され得る。不正なフレームが検知されない場合は、ステップS101での処理が繰り返される。
 不正なフレームを検知した場合には、不正検知ECU100aは、バス200及びバス1200のうちいずれのバスにおいて不正なフレームが送信されたかを判別する(ステップS102)。
 ステップS102で不正なフレームがバス200で送信されたと判別した場合には、不正検知ECU100aは、送信部120a等により、その不正なフレームが送信されているバス200へとエラーフレームを送信する(ステップS103)。このエラーフレームの送信は、不正なフレームの最後尾が送信される前のタイミングで行われ、これにより、バス200上で、不正なフレームの少なくとも一部はエラーフレームに上書きされることで無効化される。従って、エラーフレームの送信により、正規ECU400a等が不正なフレームを受信してその不正なフレームに対応した機能処理等を実行してしまうことが、阻止される。続いて、不正検知ECU100aは、送信部120等により、CANプロトコルに従った正常フレーム(正常データフレーム)をバス200へと送信する(ステップS104)。ステップS104での正常フレームの送信は、例えば、ステップS103でエラーフレームをバス200に送信した後においてバス200が最初にバスアイドルになった際に、行われる。なお、ステップS104での正常フレームの送信は、必ずしもバス200が最初にバスアイドルになった瞬間に行われる必要はないが、エラーフレームによる正規ECUへの悪影響(受信エラーカウンタの増大)を低減させる観点において、正常フレームの送信が速やかに行われることは有用である。
 ステップS102で不正なフレームがバス1200で送信されたと判別した場合には、不正検知ECU100aは、送信部120a等により、その不正なフレームが送信されているバス1200へとエラーフレームを送信する(ステップS105)。続いて、不正検知ECU100aは、送信部120等により、CANプロトコルに従った正常フレーム(正常データフレーム)をバス1200へと送信する(ステップS106)。ステップS105及びステップS106は、送信先のバスがバス1200である点以外については、ステップS103及びステップS104と同様である。ステップS105でのエラーフレームの送信は、不正なフレームの最後尾が送信される前のタイミングで行われ、これにより、バス1200上で、不正なフレームの少なくとも一部はエラーフレームに上書きされることで無効化される。従って、エラーフレームの送信により、正規ECU1400等が不正なフレームを受信してその不正なフレームに対応した機能処理等を実行してしまうことが、阻止される。なお、ステップS104或いはステップS106で送信される正常データフレームは、例えばデータフィールドの長さが0であるデータフレームであることが有用であるが、必ずしもデータフィールドの長さが0でなくても良い。また、ステップS104或いはステップS106で送信される正常データフレームのメッセージIDは、他のECUで利用されないメッセージIDであることが有用である。ここで、他のECUで利用されないメッセージIDとは、例えば、バス200に正常データフレームを送信する場合においては、バス200に接続された、不正検知ECU100a以外の、いずれのECUにおいてもそのメッセージIDを識別して行うべき処理が定められていないメッセージIDである。また、他のECUで利用されないメッセージIDとは、例えばバス1200に正常データフレームを送信する場合においては、バス1200に接続された、不正検知ECU100a以外の、いずれのECUにおいてもそのメッセージIDを識別して行うべき処理が定められていないメッセージIDである。
 なお、不正検知ECU100aは、バス200で不正なデータフレームではないデータフレームを受信した場合において、予め定められた転送ルールに基づいて、そのデータフレームをバス1200に転送し得る。また、不正検知ECU100aは、バス1200で不正なデータフレームではないデータフレームを受信した場合において、予め定められた転送ルールに基づいて、そのデータフレームをバス200に転送し得る。しかし、不正検知ECU100aは、不正なデータフレームを受信した場合には、転送を行わない。
 [2.4 実施の形態2の効果]
 本実施の形態では、不正検知ECU100aが、エラーフレームを用いて不正なフレームの送信阻止(無効化)を行う際に、正常データフレームを続けて送信する。不正検知ECU100aは、不正なフレームを検知してエラーフレームを送信するので、受信ノードによる問題ではなく、不正なフレームを送信した送信ノードによる問題であることが明らかであるので、受信エラーカウンタを増大させることを抑制するために正常フレームを送信している。これにより、正規ECUの受信エラーカウンタがデクリメントされる。即ち、不正検知ECU100aによるエラーフレームの送信後の正常フレームの送信により、正規ECUの受信エラーカウンタが一方的に増大してしまうことが抑制され、正規ECUがパッシブ状態に遷移する可能性が低減され得る。従って、不正なフレームの無効化のためのエラーフレームによって正規ECUの動作が制限されてしまうことが防止され得る。不正検知ECU100aは、不正なフレームを無効化するためのエラーフレームの送信、及び、受信エラーカウンタの増加を抑制するための正常データフレームの送信を、不正なフレームを検知したバスに対してのみ行うことで、あるバスで発生した不正なフレームの影響が他のバスへ波及することを抑制し得る。
 (他の実施の形態)
 以上のように、本開示に係る技術の例示として実施の形態1、2を説明した。しかしながら、本開示に係る技術は、これに限定されず、適宜、変更、置き換え、付加、省略等を行った実施の形態にも適用可能である。例えば、以下のような変形例も本開示の一実施態様に含まれる。
 (1)上記実施の形態では、不正検知ECU100の送信部120が、バス200へのエラーフレームの送信に続けてバス200へ正常データフレーム(正常フレーム)を送信する例を示したが、送信部120は、そのエラーフレームの送信後から正常フレームの送信の前までに、不正を示す所定条件に該当しない正常フレームをバス200から受信したときには、正常フレームのその送信を抑止しても良い。
 (2)上記実施の形態では、CANプロトコルにおけるデータフレームを標準IDフォーマットで記述しているが、拡張IDフォーマットであっても良い。
 (3)上記実施の形態では不正検知ECUが、ヘッドユニットである一例を示したが、不正検知ECUは、不正検知機能を有するECUであれば良く、必ずしもヘッドユニットとしての機能を有する必要はない。
 (4)上記実施の形態では車載ネットワークシステムを例として説明したが、上述した不正検知ECU100、100aは、CANプロトコルに従って通信される複数のECUを接続するネットワークであれば車載ネットワークに限らず利用可能であり、例えば、産業機械、ロボット等に搭載された複数のECU間をCANバスで接続したネットワークにおいて利用され得る。
 (5)上述したCANプロトコルは、TTCAN(Time-Triggered CAN)、CAN-FD(CAN with Flexible Data Rate)等の派生的なプロトコルをも包含する広義の意味を有するものであっても良い。
 (6)上記実施の形態における各ECU(不正検知ECUを含む)は、例えば、プロセッサ、メモリ等のデジタル回路、アナログ回路、通信回路等を含む装置であることとしたが、ハードディスク装置、ディスプレイ、キーボード、マウス等の他のハードウェア構成要素を含んでいても良い。また、メモリに記憶された制御プログラムがプロセッサにより実行されてソフトウェア的に機能を実現する代わりに、専用のハードウェア(デジタル回路等)によりその機能を実現することとしても良い。また、各ECUにおけるCPU、CANコントローラ、CANトランシーバ等の構成要素は一例に過ぎず、これらの各構成要素は任意の単位で結合或いは分離された集積回路等であっても良い。
 (7)上記実施の形態における各装置を構成する構成要素の一部または全部は、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に置き換わる集積回路化の技術が登場すれば、当然、その技術を用いて機能ブロックの集積化を行っても良い。バイオ技術の適用等が可能性としてあり得る。
 (8)上記各装置を構成する構成要素の一部または全部は、各装置に脱着可能なICカードまたは単体のモジュールから構成されているとしても良い。前記ICカードまたは前記モジュールは、マイクロプロセッサ、ROM、RAM等から構成されるコンピュータシステムである。前記ICカードまたは前記モジュールは、上記の超多機能LSIを含むとしても良い。マイクロプロセッサが、コンピュータプログラムに従って動作することにより、前記ICカードまたは前記モジュールは、その機能を達成する。このICカードまたはこのモジュールは、耐タンパ性を有するとしても良い。
 (9)本開示の一態様としては、上述した車載ネットワークにおいて不正なフレームの無効化及びその影響の低減化のための通信方法等の方法であるとしても良い。例えば、通信方法は、CANバスへ送信が開始されたフレームを受信する受信ステップと、受信ステップで受信されたフレームが不正を示す所定条件に該当した場合に、そのフレームの最後尾が送信される前にエラーフレームをそのバスへ送信し、エラーフレームの送信後にCANプロトコルに従ったフレームである正常フレームをそのバスへ送信する送信ステップとを含む。また、この方法をコンピュータにより実現するコンピュータプログラムであるとしても良いし、前記コンピュータプログラムからなるデジタル信号であるとしても良い。また、本開示の一態様としては、前記コンピュータプログラムまたは前記デジタル信号をコンピュータで読み取り可能な記録媒体、例えば、フレキシブルディスク、ハードディスク、CD-ROM、MO、DVD、DVD-ROM、DVD-RAM、BD(Blu-ray(登録商標) Disc)、半導体メモリ等に記録したものとしても良い。また、これらの記録媒体に記録されている前記デジタル信号であるとしても良い。また、本開示の一態様としては、前記コンピュータプログラムまたは前記デジタル信号を、電気通信回線、無線または有線通信回線、インターネットを代表とするネットワーク、データ放送等を経由して伝送するものとしても良い。また、本開示の一態様としては、マイクロプロセッサとメモリを備えたコンピュータシステムであって、前記メモリは、上記コンピュータプログラムを記録しており、前記マイクロプロセッサは、前記コンピュータプログラムに従って動作するとしても良い。また、前記プログラムまたは前記デジタル信号を前記記録媒体に記録して移送することにより、または前記プログラムまたは前記デジタル信号を、前記ネットワーク等を経由して移送することにより、独立した他のコンピュータシステムにより実施するとしても良い。
 (10)上記実施の形態及び上記変形例で示した各構成要素及び機能を任意に組み合わせることで実現される形態も本開示の範囲に含まれる。
 本開示は、ネットワークで送信された不正なフレームを検知して無効化する車載ネットワークシステム等において利用可能である。
 10 車載ネットワークシステム
 100,100a 不正検知電子制御ユニット(不正検知ECU)
 110,110a 受信部
 120,120a 送信部
 121 不正判定部
 200,1200 バス
 310 エンジン
 320 ブレーキ
 330 ドア開閉センサ
 340 窓開閉センサ
 400a,400b,400c,400d,1400 電子制御ユニット(ECU)
 2001,2011 不正ECU
 3001,3001a,3011 演算部(CPU)
 3002,3002a,3012 通信制御部(CANコントローラ)
 3003,3003a,3013 通信インタフェース(通信I/F)

Claims (13)

  1.  CAN(Controller Area Network)プロトコルに従って通信する複数の電子制御ユニットが通信に用いるバスに接続される不正検知電子制御ユニットであって、
     前記バスへ送信が開始されたフレームを受信する受信部と、
     前記受信部により受信されたフレームが不正を示す所定条件に該当した場合に、当該フレームの最後尾が送信される前にエラーフレームを前記バスへ送信し、エラーフレームの送信後にCANプロトコルに従ったフレームである正常フレームを前記バスへ送信する送信部とを備える
     不正検知電子制御ユニット。
  2.  前記不正検知電子制御ユニットは、
     前記バスに接続される通信インタフェースと、
     前記通信インタフェースに接続され、CANプロトコルに従って前記バスでの通信を制御するCANコントローラと、
     前記CANコントローラを制御し、前記受信部及び前記送信部を実現するCPUとを備える
     請求項1記載の不正検知電子制御ユニット。
  3.  前記送信部は、エラーフレームの前記送信後において前記バスが最初にアイドル状態になった際に、前記正常フレームの前記送信を行う
     請求項1又は2記載の不正検知電子制御ユニット。
  4.  前記送信部は、送信したエラーフレームの数と同数の正常フレームを送信する
     請求項1~3のいずれか一項に記載の不正検知電子制御ユニット。
  5.  前記送信部は、正常フレームの前記送信に失敗した場合に、正常フレームを送信する
     請求項1~3のいずれか一項に記載の不正検知電子制御ユニット。
  6.  前記送信部は、送信した前記エラーフレームの数から、前記エラーフレームの送信後に前記所定条件に該当しない正常フレームを前記バスから受信した数を、減算して得られる数以上の正常フレームを送信する
     請求項5記載の不正検知電子制御ユニット。
  7.  前記送信部は、正常フレームの前記送信に失敗した場合に、当該正常フレームのIDフィールドが示すIDより小さい値のIDをIDフィールドで示す正常フレームを送信する
     請求項5記載の不正検知電子制御ユニット。
  8.  前記送信部が、エラーフレームの送信後に送信する前記正常フレームは、データフィールドの長さがゼロであるデータフレームである
     請求項1~7のいずれか一項に記載の不正検知電子制御ユニット。
  9.  前記送信部が、エラーフレームの送信後に送信する前記正常フレームのIDフィールドが示すIDは、前記不正検知電子制御ユニット以外の、前記バスに接続されたいずれの前記電子制御ユニットにおいても当該IDを識別して行うべき処理が定められていないIDである
     請求項1~8のいずれか一項に記載の不正検知電子制御ユニット。
  10.  前記送信部は、前記エラーフレームの送信後から正常フレームの前記送信の前までに、前記所定条件に該当しない正常フレームを前記バスから受信したときには、正常フレームの前記送信を抑止する
     請求項1又は2記載の不正検知電子制御ユニット。
  11.  前記不正検知電子制御ユニットは、複数のバスに接続され、一方のバスから受信したフレームを他方のバスに転送する機能を有し、受信した当該フレームが前記所定条件に該当した場合には当該転送を抑止し、
     前記送信部は、前記受信部により受信されたフレームが前記所定条件に該当した場合に、当該フレームの最後尾が送信される前にエラーフレームを当該フレームが受信されたバスへ送信し、エラーフレームの送信後に前記正常フレームを当該バスへ送信する
     請求項1記載の不正検知電子制御ユニット。
  12.  CAN(Controller Area Network)プロトコルに従ってバスを介して通信する複数の電子制御ユニットと、当該バスに接続される不正検知電子制御ユニットとを備える車載ネットワークシステムであって、
     前記不正検知電子制御ユニットは、
     前記バスへ送信が開始されたフレームを受信する受信部と、
     前記受信部により受信されたフレームが不正を示す所定条件に該当した場合に、当該フレームの最後尾が送信される前にエラーフレームを前記バスへ送信し、エラーフレームの送信後にCANプロトコルに従ったフレームである正常フレームを前記バスへ送信する送信部とを備え、
     前記電子制御ユニットは、受信エラーカウンタを含みCANプロトコルに従って前記バスでの通信を制御するCANコントローラを備え、前記バスからの正常フレームの受信に成功した場合には前記受信エラーカウンタの値を減少させる
     車載ネットワークシステム。
  13.  CAN(Controller Area Network)プロトコルに従ってバスを介して通信する複数の電子制御ユニットを備える車載ネットワークシステムにおいて用いられる通信方法であって、
     前記バスへ送信が開始されたフレームを受信する受信ステップと、
     前記受信ステップで受信されたフレームが不正を示す所定条件に該当した場合に、当該フレームの最後尾が送信される前にエラーフレームを前記バスへ送信し、エラーフレームの送信後にCANプロトコルに従ったフレームである正常フレームを前記バスへ送信する送信ステップとを含む
     通信方法。
PCT/JP2016/004008 2015-09-29 2016-09-02 不正検知電子制御ユニット、車載ネットワークシステム及び通信方法 WO2017056395A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP16850576.6A EP3358788B1 (en) 2015-09-29 2016-09-02 Illegality detection electronic control unit, vehicle onboard network system, and communication method
CN201680002239.XA CN107113214B (zh) 2015-09-29 2016-09-02 不正常检测电子控制单元、车载网络***以及通信方法
US15/879,962 US10693905B2 (en) 2015-09-29 2018-01-25 Invalidity detection electronic control unit, in-vehicle network system, and communication method

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
JP2015-192327 2015-09-29
JP2015192327 2015-09-29
JP2016114879A JP6836340B2 (ja) 2015-09-29 2016-06-08 不正検知電子制御ユニット、車載ネットワークシステム及び通信方法
JP2016-114879 2016-06-08

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/879,962 Continuation US10693905B2 (en) 2015-09-29 2018-01-25 Invalidity detection electronic control unit, in-vehicle network system, and communication method

Publications (1)

Publication Number Publication Date
WO2017056395A1 true WO2017056395A1 (ja) 2017-04-06

Family

ID=58422877

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2016/004008 WO2017056395A1 (ja) 2015-09-29 2016-09-02 不正検知電子制御ユニット、車載ネットワークシステム及び通信方法

Country Status (1)

Country Link
WO (1) WO2017056395A1 (ja)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003198592A (ja) * 2001-12-21 2003-07-11 Kyushu Ando Denki Kk Lan間接続装置
JP2012204934A (ja) * 2011-03-24 2012-10-22 Fujitsu Ten Ltd 通信装置および通信システム
JP2014236248A (ja) * 2013-05-30 2014-12-15 日立オートモティブシステムズ株式会社 電子制御装置、電子制御システム

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003198592A (ja) * 2001-12-21 2003-07-11 Kyushu Ando Denki Kk Lan間接続装置
JP2012204934A (ja) * 2011-03-24 2012-10-22 Fujitsu Ten Ltd 通信装置および通信システム
JP2014236248A (ja) * 2013-05-30 2014-12-15 日立オートモティブシステムズ株式会社 電子制御装置、電子制御システム

Similar Documents

Publication Publication Date Title
JP6836340B2 (ja) 不正検知電子制御ユニット、車載ネットワークシステム及び通信方法
US11063971B2 (en) Method for preventing electronic control unit from executing process based on malicious frame transmitted to bus
JP7027592B2 (ja) ゲートウェイ装置、方法及び車載ネットワークシステム
CN111934966B (zh) 不正常检测电子控制单元、车载网络***以及不正常检测方法
CN107078938B (zh) 网关装置、车载网络***以及通信方法
EP3435617B1 (en) A node, a vehicle, an integrated circuit and method for updating at least one rule in a controller area network
JP7280082B2 (ja) 不正検知方法、不正検知装置及びプログラム
JP7182559B2 (ja) ログ出力方法、ログ出力装置及びプログラム
US10462161B2 (en) Vehicle network operating protocol and method
US11336618B2 (en) Security apparatus, attack detection method, and storage medium
US20240031199A1 (en) Anomaly determination method, anomaly determination device, and recording medium
JP2014236248A (ja) 電子制御装置、電子制御システム
WO2018110046A1 (ja) 制御装置、制御システム、制御方法、制御プログラムおよび記憶媒体
JP6527647B1 (ja) 不正検知方法、不正検知装置及びプログラム
JP2018182713A (ja) 情報処理装置、情報処理システム、情報処理方法、及びプログラム
JP6573236B2 (ja) 通信装置、および受信装置
WO2017056395A1 (ja) 不正検知電子制御ユニット、車載ネットワークシステム及び通信方法
WO2018020833A1 (ja) フレーム伝送阻止装置、フレーム伝送阻止方法及び車載ネットワークシステム
JP2019097206A (ja) 不正対処方法、不正検知電子制御ユニット、および、ネットワーク通信システム
JP6788717B1 (ja) 接続装置、接続方法およびプログラム
CN117749555A (zh) 控制器区域网络***和用于***的方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16850576

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE