KR20180137306A - Method and System for detecting hacking attack based on the CAN protocol - Google Patents

Method and System for detecting hacking attack based on the CAN protocol Download PDF

Info

Publication number
KR20180137306A
KR20180137306A KR1020170076811A KR20170076811A KR20180137306A KR 20180137306 A KR20180137306 A KR 20180137306A KR 1020170076811 A KR1020170076811 A KR 1020170076811A KR 20170076811 A KR20170076811 A KR 20170076811A KR 20180137306 A KR20180137306 A KR 20180137306A
Authority
KR
South Korea
Prior art keywords
message
reception
received
reception time
difference
Prior art date
Application number
KR1020170076811A
Other languages
Korean (ko)
Other versions
KR101972457B1 (en
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
Application filed by 주식회사 페스카로 filed Critical 주식회사 페스카로
Priority to KR1020170076811A priority Critical patent/KR101972457B1/en
Priority to PCT/KR2018/006756 priority patent/WO2018230988A1/en
Publication of KR20180137306A publication Critical patent/KR20180137306A/en
Application granted granted Critical
Publication of KR101972457B1 publication Critical patent/KR101972457B1/en
Priority to US16/715,437 priority patent/US11522878B2/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
    • H04L12/40052High-speed IEEE 1394 serial bus
    • H04L12/40104Security; Encryption; Content protection
    • 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
    • H04L12/40052High-speed IEEE 1394 serial bus
    • H04L12/40058Isochronous transmission
    • 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
    • H04L63/1408Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
    • H04L63/1416Event detection, e.g. attack signature detection
    • 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
    • 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/40267Bus for use in transportation systems
    • H04L2012/40273Bus for use in transportation systems the transportation system being a vehicle

Landscapes

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

Abstract

According to an embodiment of the present invention, provided is a method for detecting a hacking attack based on CAN communication for a method for detecting an abnormal message based on CAN communication. The method for detecting a hacking attack based on CAN communication comprises: a step of obtaining a receiving time of a receiving message; a receiving filter step of performing period calculation comparing a reference period of a corresponding message ID with a difference between receiving times of receiving messages having the same message ID; an abnormal message detecting step of determining the receiving message as an abnormal message when the difference between the receiving times is smaller the reference period according to a result of the period calculation, and determining the receiving message as a normal message when the difference is greater than the reference period; and a blocking step of blocking the abnormal message.

Description

CAN 통신 기반 해킹공격 탐지 방법 및 시스템 {Method and System for detecting hacking attack based on the CAN protocol}[0001] The present invention relates to a method and a system for detecting a hacking attack based on CAN communication,

본 발명은 CAN 버스를 통해 전달되는 수신 메시지의 수신 시간 정보를 이용하여, 수신 메시지들의 수신 주기와 기준 주기를 비교하여 비정상 메시지를 검출하는, CAN 통신 기반 해킹공격 탐지방법 및 시스템 에 관한 것이다.The present invention relates to a CAN communication-based hacking attack detection method and system for detecting an abnormal message by comparing reception periods of reception messages with reference periods using reception time information of a reception message transmitted via a CAN bus.

일반적으로, 전자제어기술의 비약적인 발전에 따라 자동차에서도 기계적인 방법에 의해 동작하던 각종 장치들이 운전자의 편리성 및 운행의 안전성 등의 이유로 전기적인 방법에 의해 구동되고 있으며, 자동차의 시스템은 점차 고도화되고 최첨단화되어 가고 있다. 특히, 차량의 시스템이 전자동화됨에 따라, 차량 내부 제어기들 간의 통신 또한 빈번하게 이뤄지고 있다. 차량 내부 통신을 위해서 CAN(Controller Area Network) 통신이 일반적으로 이용된다.In general, according to the remarkable development of electronic control technology, various devices which are operated by a mechanical method in an automobile are driven by an electric method for convenience of driver and safety of operation, and automobile systems are gradually advanced It is becoming more advanced. Particularly, as the system of the vehicle becomes electronic, communication among the in-vehicle controllers is also frequently performed. CAN (Controller Area Network) communication is generally used for intra-vehicle communication.

즉, 자동차 내부의 전자제어시스템은 엔진제어기, 변속기제어기, 브레이크제어기, 에어백제어기 등 수십여개의 전자식 제어기(Electronic Control Unit)들로 구성되어 있다. 또한, 각 전자식 제어기들은 CAN 통신을 위한 CAN 컨트롤러를 구비하고, 이러한 전자식 제어기들 간의 통신은 CAN 통신을 사용한다.That is, the electronic control system in the automobile is composed of dozens of electronic control units such as an engine controller, a transmission controller, a brake controller, and an air bag controller. In addition, each electronic controller has a CAN controller for CAN communication, and the communication between these electronic controllers uses CAN communication.

기본적으로, CAN(Controller Area Network) 프로토콜 방식의 메시지 통신에 따르면, 네트워크는 다수의 노드(또는 CAN 컨트롤러)와 공통의 CAN 버스로 구성되고, 각 노드는 브로드캐스팅 방식으로 메시지를 전송하고, 각 노드가 필요한 메시지를 선택하여 수신한다. 즉, 모든 CAN 컨트롤러(또는 노드)는 CAN 버스(Bus)를 공통으로 사용하여 메시지를 송수신한다. 또한, 각 CAN 컨트롤러(또는 노드)는 전송할 메시지들을 네트워크 상 모든 노드들에게 브로드캐스트 방식으로 전송한다. 그리고 메시지 식별자에 의한 자체적인 중재 기능을 제공한다. 구체적으로, 각 노드 또는 CAN 컨트롤러는 메시지의 식별자를 인식하여, 브로드캐스트된 메시지들 중에서 필요한 메시지만 걸러서 수신한다. 즉, CAN 통신에는, 메시지의 데이터 프레임 내에 메시지의 송신 대상(destination)을 인증할 수 있는 필드가 없다.Basically, according to a CAN (Controller Area Network) protocol-based message communication, a network is composed of a plurality of nodes (or a CAN controller) and a common CAN bus, each node transmits a message in a broadcast manner, Selects and receives a necessary message. That is, all CAN controllers (or nodes) send and receive messages using a common CAN bus. In addition, each CAN controller (or node) broadcasts messages to be transmitted to all nodes on the network in a broadcast manner. And provides its own arbitration function based on the message identifier. Specifically, each node or the CAN controller recognizes the identifier of the message, and receives only necessary messages among the broadcasted messages. That is, in the CAN communication, there is no field for authenticating the transmission destination of the message in the data frame of the message.

그런데, 앞서 본 바와 같이, CAN(Controller Area Network) 통신은 브로드캐스팅 방식과 메시지 식별자만을 이용하여 송수신함으로써, CAN 프로토콜에 내재된 보안위험성이 존재한다.However, as described above, there is a security risk inherent in the CAN protocol by transmitting and receiving CAN (Controller Area Network) communication using only the broadcasting method and message identifier.

예를 들어, CAN 통신이 브로드캐스트 방식으로 메시지를 전송하기 때문에, CAN 통신 네트워크에 악의적인 노드를 추가하면, 악의적인 노드는 다른 노드들이 전송하는 모든 메시지를 수집할 수 있다. 그리고 악의적인 노드는 수집된 정보를 이용하여, 가짜 메시지를 생성하여 CAN통신 네트워크에 전송할 수 있다. CAN 통신 메시지의 데이터 프레임 내에는 송신하는 대상을 인증하는 별도의 필드가 존재하지 않기 때문에, 상기와 같은 스푸핑 공격이 쉽게 가능하다.For example, because a CAN communication sends messages in a broadcast fashion, adding a malicious node to a CAN communication network can allow a malicious node to collect all messages sent by other nodes. The malicious node can then use the collected information to generate a fake message and send it to the CAN communication network. In the data frame of the CAN communication message, there is no separate field for authenticating the transmission object, so that the spoofing attack as described above is easily possible.

또한, CAN 메시지 식별자에 의한 중재기능을 악용하면, 서비스거부 공격도 쉽게 가능하다. 식별자에 의한 중재기능은 각 식별자에 우선순위가 부여되어, 우선순위가 부여된 메시지를 우선적으로 전송해주는 기능을 말한다. 일단 공격자(또는 악의적인 노드)가 CAN통신 네트워크상 메시지를 수집하여 가장 높은 우선순위를 가진 식별자(ID)를 알아낸다. 그리고 공격자는 상기 식별자를 이용하여 가짜 메시지를 만들고, 이 메시지를 네트워크 상에 지속적으로 전송한다. 공격자에 의한 가짜 메시지가 높은 우선순위를 가지고 있기 때문에, 다른 정상적인 메시지는 CAN 메시지 식별자에 의한 중재기능에 의해 전송되지 못한다. 이러한 상태가 지속되면 CAN 통신 네트워크에는 공격자의 메시지만이 남게 되어, 다른 정상적인 메시지들이 전달되지 못하게 되는 서비스 거부 상황이 발생된다.In addition, if the arbitration function based on the CAN message identifier is abused, a denial of service attack is also easily possible. An arbitration function based on an identifier is a function of assigning a priority to each identifier and preferentially transmitting a message to which a priority is assigned. Once an attacker (or malicious node) collects messages on the CAN communication network, it finds out the identifier with the highest priority (ID). Then, the attacker uses the identifier to create a fake message, and continuously transmits the message on the network. Since the fake message by the attacker has a high priority, other normal messages are not transmitted by the arbitration function by the CAN message identifier. If this state continues, only the attacker's message remains in the CAN communication network, resulting in a denial of service situation where other normal messages can not be delivered.

특히, 종래의 CAN 통신에 의한 차량 전자제어 시스템은 보안 취약성이 높은 장치들과 보안상 중요한 장치들이 동일한 CAN버스에 연결되어 있다. 따라서 외부망 연결성이 높아 보안 취약성이 높은 장치들(텔레매틱스, AVN시스템 등)이 해커들에게 장악되면, 보안상 중요한 장치들(엔진제어기, 브레이크제어기, 에어백제어기등)이 도용되어, 차량 시스템에 중대한 보안 위협이 될 수 있는 문제점이 존재한다.In particular, conventional vehicle electronic control systems based on CAN communication are connected to the same CAN bus with high security vulnerability devices and security critical devices. Therefore, if security devices (such as engine controller, brake controller, airbag controller, etc.) are stolen when high-security devices (telematics, AVN system, etc.) are secured to hackers due to high external network connectivity, There is a problem that can become a security threat.

상기와 같은 문제점을 해결하기 위해, 암호화키를 서로 교환하고 상호 공유되는 타임 윈도우 내에서만 암호화하여 메시지를 송수신하는 기술이 제시되고 있 다[특허문헌 1]. 또한, 비밀키 스트림을 생성하여 대칭키 방식으로 암호화하여 메시지를 송수신하는 기술도 제시되고 있다[특허문헌 2,3]. 또한, 암호키를 생성하기 위한 OTP(원타임 패스워드) ROM을 구비하는 기술도 제시되고 있다[특허문헌 4].CAN 통신에서 메시지의 주기성을 이용하여 해킹 메시지 여부를 판단하는 기술이 제시되고 있다[특허문헌 5].In order to solve the above problems, there is proposed a technique of transmitting and receiving a message by exchanging encryption keys and encrypting only within a mutually-shared time window [Patent Document 1]. Also, there is proposed a technique of generating a secret key stream and encrypting it with a symmetric key method to transmit and receive a message [Patent Literatures 2 and 3]. In addition, a technique of providing an OTP (one-time password) ROM for generating an encryption key is also proposed (Patent Document 4). A technique for determining whether a hacking message is used by using the periodicity of a message in CAN communication has been proposed Literature 5].

그러나 상기 선행기술들은 메시지를 암호화하여 송수신하기 때문에, 암호화 또는 복호화하기 위한 연산을 수행해야 하고, 또한, 암호화 통신을 위하여 암호화키 또는 비밀키를 생성하거나 교환해야 한다는 문제점이 있다. 이와 같은 암호화 연산을 위하여 연산 시간이 소요되기 때문에, 메시지의 송수신 시간이 지연될 수 있는 문제점이 있다.However, since the above-mentioned prior art encrypts and transmits a message, an operation for encrypting or decrypting the message must be performed, and an encryption key or a secret key must be generated or exchanged for encryption communication. Since a computation time is required for such an encryption operation, there is a problem that the transmission and reception time of a message may be delayed.

한국등록특허 제10-1651648호(2016.08.29.공고)Korean Registered Patent No. 10-1651648 (Announced 2016.08.29) 한국공개특허 제10-2011-0057348호(2011.06.01.공개)Korean Patent Laid-Open No. 10-2011-0057348 (published on June 1, 2011) 한국등록특허 제10-1413427호(2014.07.01.공고)Korean Registered Patent No. 10-1413427 (Announced 2014.07.01) 한국공개특허 제10-2016-0093764호(2016.08.09.공개)Korean Patent Publication No. 10-2016-0093764 (published on Aug. 20, 2016) 한국등록특허 제10-1472896호(2014.12.16.공고)Korean Registered Patent No. 10-1472896 (issued October 16, 2014)

본 발명의 목적은 상술한 바와 같은 문제점을 해결하기 위한 것으로, 동일 메시지 ID 를 갖는 수신 메시지들의 수신 시간의 차이와 기준 주기를 비교하는 주기 연산을 이용하여, 수신된 메시지가 비정상 메시지인지 여부를 탐지할 수 있는 CAN 통신 기반 해킹공격 탐지 방법 및 시스템을 제공하는 것이다.An object of the present invention is to solve the above-mentioned problems, and it is an object of the present invention to provide a method and apparatus for detecting whether or not a received message is an abnormal message by using a periodic operation for comparing a reception time difference of received messages having the same message ID with a reference period A CAN communication based hacking attack detection method and system.

또한, 본 발명의 다른 목적은 CAN 버스로부터 수신되는 메시지를 필터링하되, 유효한 수신용 ID(ID)를 가지는 메시지만 수신하도록 필터링하는, CAN 통신 기반 해킹공격 탐지 방법 및 시스템을 제공하는 것이다.It is another object of the present invention to provide a CAN communication based hacking attack detection method and system for filtering a message received from a CAN bus, but filtering only a message having a valid receiving ID.

또한, 본 발명의 다른 목적은 CAN 버스로 전송하려는 메시지를 필터링하되, 유효한 송신용 ID(ID)를 가지는 메시지만 전송하도록 필터링하는, CAN 통신 기반 해킹공격 탐지 방법 및 시스템을 제공하는 것이다.It is another object of the present invention to provide a CAN communication-based hacking attack detection method and system for filtering a message to be transmitted on a CAN bus, but filtering only a message having a valid transmission ID (ID).

본 발명의 일 실시예에 따르면, CAN 통신 기반 비정상 메시지 탐지 방법에 있어서, 수신 메시지의 수신 시간을 획득하는 단계; 동일한 메시지 ID 를 가지는 수신 메시지들의 수신 시간의 차이와, 대응하는 메시지 ID 의 기준 주기를 비교하는 주기 연산을 수행하는 수신 필터 단계; 상기 주기 연산의 결과, 상기 수신 시간의 차이가 상기 기준 주기보다 작은 경우 상기 수신 메시지를 비정상 메시지라 판단하고, 큰 경우 상기 수신 메시지가 정상 메시지라 판단하는 비정상 메시지 탐지 단계; 상기 비정상 메시지를 차단하는 차단 단계; 를 포함하는 CAN 통신 기반 해킹공격 탐지 방법이 제공된다.According to an embodiment of the present invention, there is provided a method of detecting an abnormal communication message based on CAN communication, comprising: obtaining a reception time of a received message; A reception filter step for performing a periodic operation for comparing a difference in reception time of received messages having the same message ID with a reference period of a corresponding message ID; An abnormal message detection step of determining that the received message is an abnormal message when the difference in the reception time is smaller than the reference period as a result of the periodic operation and determining that the received message is a normal message if the difference is larger than the reference period; A blocking step of blocking the abnormal message; A CAN communication based hacking attack detection method is provided.

본 발명에 있어서, 상기 수신 메시지의 수신 시간을 획득하는 단계는, 마이크로 컨트롤러가 인터럽트 신호를 발생시켜 측정한 수신 메시지의 수신 시간을 획득하거나, 혹은 CAN 컨트롤러가 내부 모듈을 이용하여 측정한 수신 메시지의 수신 시간을 획득할 수 있다.In the present invention, the step of acquiring the reception time of the reception message may include acquiring the reception time of the reception message measured by generating the interrupt signal by the microcontroller, or acquiring the reception time of the reception message measured by the CAN controller using the internal module The reception time can be obtained.

본 발명에 있어서, 상기 수신 필터 단계는, 동일한 메시지 ID를 가지고 가장 최근에 수신한 적어도 3개의 수신 메시지의 수신 시간의 차이와, 해당 메시지 ID의 주기를 비교하며, 상기 가장 최근에 수신한 적어도 3개의 수신 메시지 중에서 첫번째 수신 시간과 3번째 수신 시간의 차이가 해당 메시지 ID의 기준 주기 보다 작으면, 상기 적어도 3개의 수신 메시지 중 적어도 1개의 수신 메시지를 비정상 메시지로 판단할 수 있다.In the present invention, the reception filter step compares the difference between the reception time of the latest received message having the same message ID and the cycle of the corresponding message ID, If the difference between the first reception time and the third reception time is smaller than the reference period of the corresponding message ID, at least one reception message among the at least three reception messages may be determined as an abnormal message.

본 발명에 있어서, 상기 주기 연산의 결과를 이용하여 탐지 점수 값을 보정하는 탐지 점수 학습부; 를 포함하고, 상기 탐지 점수 학습부는, 메시지가 수신될 때마다 상기 주기 연산을 수행하며, 상기 주기 연산의 결과, 상기 수신 시간의 차이가 상기 기준 주기보다 작은 경우 상기 탐지 점수를 기설정된 값만큼 증가시키고, 큰 경우 상기 탐지 점수를 기설정된 값만큼 감소시키며, 상기 차단 단계는 상기 탐지 점수가 일정 값 이상일 때 수신 메시지가 비정상 메시지라 판단할 수 있다.In the present invention, a detection score learning unit for correcting a detection score value using a result of the periodic calculation; Wherein the detection score learning unit performs the periodic operation every time a message is received, and when the difference in the reception time is smaller than the reference period as a result of the periodic operation, the detection score learning unit increases the detection score by a predetermined value And if the detection score is larger than a predetermined value, the received message is determined to be an abnormal message.

본 발명에 있어서, 상기 메시지 ID 의 기준 주기 및 학습된 탐지 점수 중 적어도 하나 이상은 보호 메모리에 저장되고, 상기 보호 메모리는 ROM(Read Only Memory) 또는, 플래시메모리의 비휘발성 메모리일 수 있다.In the present invention, at least one of the reference period of the message ID and the learned detection score is stored in the protection memory, and the protection memory may be a ROM (Read Only Memory) or a nonvolatile memory of a flash memory.

또한, 상술한 본 발명의 방법을 실현시키기 위해 컴퓨터 판독 가능한 기록 매체에 기록된 프로그램이 제공된다.A program recorded on a computer-readable recording medium for realizing the above-described method of the present invention is also provided.

본 발명의 다른 실시예에 따르면, CAN 컨트롤러 및 마이크로프로세서를 포함하는 CAN 통신 기반 비정상 메시지 탐지 시스템에 있어서, 수신 메시지의 수신 시간을 획득하는 수신 시간 측정부; 동일한 메시지 ID 를 가지는 수신 메시지들의 수신 시간의 차이와, 대응하는 메시지 ID 의 기준 주기를 비교하는 주기 연산을 수행하는 수신 필터부; 상기 주기 연산의 결과, 상기 수신 시간의 차이가 상기 기준 주기보다 작은 경우 상기 수신 메시지를 비정상 메시지라 판단하고, 큰 경우 상기 수신 메시지가 정상 메시지라 판단하는 비정상 메시지 탐지부; 를 포함하는 CAN 통신 기반 비정상 메시지 탐지 시스템이 제공된다.According to another embodiment of the present invention, there is provided a CAN communication-based abnormal message detection system including a CAN controller and a microprocessor, the system comprising: a reception time measuring unit for obtaining a reception time of a received message; A reception filter unit for performing a periodic operation for comparing a difference between reception times of reception messages having the same message ID and a reference period of a corresponding message ID; An abnormal message detection unit for determining that the received message is an abnormal message when the difference in the reception time is smaller than the reference period as a result of the periodic operation and determining that the received message is a normal message if the difference is larger than the reference period; A CAN communication-based abnormal message detection system is provided.

상술한 바와 같이, 본 발명에 따른 CAN 통신 기반 해킹공격 탐지방법 및 시스템에 의하면, 자동차 CAN 버스에 연결된 전자식 제어장치(Electric Control Unit, ECU)가 CAN 버스로부터 수신(Receive)한 CAN 메시지들 중에서 비정상 메시지(해킹 공격 메시지, 악성 메시지)를 탐지하거나 차단할 수 있는 효과가 얻어진다.As described above, according to the CAN communication-based hacking attack detection method and system according to the present invention, an electronic control unit (ECU) connected to an automobile CAN bus detects abnormality among CAN messages received from a CAN bus A message (a hacking attack message, a malicious message) can be detected or blocked.

또한, 본 발명에 따른 CAN 통신 기반 해킹공격 탐지방법 및 시스템에 의하면, 해커에게 제어권한을 탈취당한 전자식 제어장치(ECU)가 자동차 CAN 버스에 공격(비정상) 메시지를 전송(Transmit)하는 해킹공격의 도구로 악용되는 것을 차단할 수 있는 효과가 얻어진다. 특히, 알려진 공격기법들 뿐만 아니라 알려지지 않은 형태의 수신된 공격메시지 탐지나 차단이 가능하다.According to the method and system for detecting a hacking attack based on CAN communication according to the present invention, it is possible to prevent a hacking attack in which an electronic control unit (ECU), which has been hijacked by a hacker, has transmitted an attack (abnormal) It is possible to prevent the abuse by the tool. In particular, it is possible to detect or block unknown attack messages as well as known attack methods.

또한, 본 발명에 따른 CAN 통신 기반 해킹공격 탐지방법 및 시스템에 의하면, CAN 버스에 연결된 전자식 제어장치(ECU)에 직접 탐지 및 차단 시스템을 구비함으로써, 반도체 형태로 내장된 안전한 CAN통신 환경을 제공할 수 있고, 이로 인해, 자동차 통신 국제표준 규격을 준수하여 기존 자동차 내부 네트워크에 변경 없이 적용할 수 있는 효과가 얻어진다.In addition, according to the method and system for detecting a hacking attack based on CAN communication according to the present invention, by providing a direct detection and blocking system in an electronic control unit (ECU) connected to a CAN bus, a secure CAN communication environment built in a semiconductor form is provided Therefore, it is possible to apply the present invention to the internal network of the existing automobile without any change in accordance with the international standard for automobile communication.

또한, 본 발명에 따른 CAN 통신 기반 해킹공격 탐지방법 및 시스템에 의하면, CAN 버스에 연결된 전자식 제어장치(ECU)에 연결 혹은 임베디드되어 전자식 제어 장치를 제어할 수 있는 프로세서에 의해 전송 메시지 혹은 수신 메시지를 필터링하는 것이 가능하다.In addition, according to the method and system for detecting a hacking attack based on CAN communication according to the present invention, a processor capable of controlling an electronic control device connected or embedded in an electronic control unit (ECU) It is possible to filter.

도 1은 본 발명을 실시하기 위한 전체 시스템의 구성에 대한 블록도이다.
도 2a 및 도 2b 는 본 발명의 일실시예에 따른 CAN 컨트롤러의 구성에 대한 블록도이다.
도 3은 본 발명의 일실시예에 따른 CAN 메시지의 송수신 메시지에 대한 구성도이다.
도 4 는 본 발명의 일 실시예에 따른 필터값 설정 방법을 시계열적으로 나타낸 도면이다.도 5 는 본 발명의 일 실시예에 따른 전송 필터부가 전송 데이터를 필터링하는 구성을 설명하기 위한 도면이다..
도 6a 및 도 6b 은 본 발명의 일 실시예에 따른 수신필터부가 수신 메시지를 필터링하는 구성을 설명하기 위한 도면이다.
도 7, 도 8a 및 도 8b 는 본 발명의 일 실시예에 따른 수신 데이터를 필터링하는 방법을 시계열적으로 나타낸 도면이다.
도 9 및 도 10 은 본 발명의 방법이 보조 제어기에 의해 수행되는 실시예를 설명하기 위한 도면이다.
1 is a block diagram of a configuration of an overall system for implementing the present invention.
2A and 2B are block diagrams of a configuration of a CAN controller according to an embodiment of the present invention.
3 is a configuration diagram of a transmission / reception message of a CAN message according to an embodiment of the present invention.
FIG. 4 is a diagram illustrating a method of setting a filter value according to an embodiment of the present invention in a time-series manner. FIG. 5 is a diagram illustrating a configuration for filtering transmission data according to an embodiment of the present invention. .
6A and 6B are views for explaining a configuration in which a reception filter unit filters a received message according to an embodiment of the present invention.
FIGS. 7, 8A and 8B are time-series views illustrating a method of filtering received data according to an embodiment of the present invention.
9 and 10 are views for explaining an embodiment in which the method of the present invention is performed by an auxiliary controller.

이하, 본 발명의 실시를 위한 구체적인 내용을 도면에 따라서 설명한다.DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, the present invention will be described in detail with reference to the drawings.

또한, 본 발명을 설명하는데 있어서 동일 부분은 동일 부호를 붙이고, 그 반복 설명은 생략한다.In the description of the present invention, the same parts are denoted by the same reference numerals, and repetitive description thereof will be omitted.

먼저, 본 발명을 실시하기 위한 전체 시스템 구성의 일례를 도 1을 참조하여 설명한다.First, an example of the overall system configuration for implementing the present invention will be described with reference to FIG.

도 1에서 도시한 바와 같이, 본 발명을 실시하기 위한 전체 시스템은 CAN 네 트워크의 구성으로서, 데이터 송수신을 위한 CAN 버스(50), CAN 버스(50)에 연결된 다수의 제어기(10)로 구성된다. 이때, 본 발명의 CAN 네트워크는 단순히 일반적인 CAN 네트워크에서 더 나아가, 확장형 CAN(Extended CAN) 및 CAN-FD(CAN with Flexible Data-Rate)에까지 확장 적용될 수 있다.As shown in FIG. 1, the overall system for implementing the present invention comprises a CAN network 50 for transmitting and receiving data, and a plurality of controllers 10 connected to a CAN bus 50 . At this time, the CAN network of the present invention can be extended not only to a general CAN network but also to an extended CAN (Extended CAN) and a CAN-Flexible Data-Rate (CAN) FD.

CAN 버스(50)는 데이터 전송을 위한 통신 라인으로서, 바람직하게는, 연선(Twisted pair wire)으로 구성된다. 이때, 연선을 구성하는 2개의 선은 서로 다른 신호(CAN_H, CAN_L)에 의해 구동된다. CAN 버스(50)상의 전송 속도는 버스의 길이에 따라 달라질 수 있다.The CAN bus 50 is a communication line for data transmission, and is preferably composed of a twisted pair wire. At this time, the two lines constituting the twisted pair are driven by different signals (CAN_H, CAN_L). The transmission speed on the CAN bus 50 may vary depending on the length of the bus.

또한, CAN 버스(50)는 송신 라인(Tx)과 수신 라인(Rx)으로 구분되고, 각 제어기(10)는 송신 라인(Tx)으로 메시지를 전송하고 수신 라인(Rx)으로부터 메시지를 수신한다. 특히, 모든 제어기(10)는 CAN 버스(50)의 공통 송수신 라인(Tx, Rx)에 연결되어, 메시지를 송수신한다.Further, the CAN bus 50 is divided into a transmission line Tx and a reception line Rx, and each controller 10 transmits a message to the transmission line Tx and receives the message from the reception line Rx. In particular, all the controllers 10 are connected to the common transmission and reception lines Tx and Rx of the CAN bus 50 to transmit and receive messages.

다수의 제어기(ECU, Electronic Control Unit)(10) 또는 제1 내지 제N 제어기(10)는 CAN 버스(50)에 소정의 CAN 커넥터를 통해 연결될 수 있으며, 이론적으로 하나의 CAN 네트워크에 연결될 수 있는 최대 제어기의 개수는 2032이다.A plurality of controllers (ECUs) 10 or first to Nth controllers 10 may be connected to the CAN bus 50 via a predetermined CAN connector and may theoretically be connected to one CAN network The maximum number of controllers is 2032.

제어기(ECU)(10)는 스마트폰, 인터넷, 교통정보시스템 등의 외부 통신망과 연결되어 보안 위험성에 직접적으로 노출된 제어기들과, 외부 통신망과 직접적인 연결이 없어 상대적으로 안전한 제어기들로 구분될 수 있다.The controller (ECU) 10 can be divided into controllers that are directly exposed to security risks connected with external communication networks such as a smart phone, the Internet, and a traffic information system, and relatively safe controllers because there is no direct connection with an external communication network have.

전자의 제어기(10)들은 멀티미디어 캔(CAN)으로서, 텔레매틱스나 네비게이션 등에 관련된 제어기들이다. 이들 제어기들은 스마트폰, 인터넷, 교통정보시스템 등의 외부 통신망과 연결되어, 데이터 통신을 수행한다. 따라서 이들 제어기(10)들은 외부 단말 또는 시스템에서 접근이 가능한 제어기이다.The former controllers 10 are multimedia can (CAN), controllers related to telematics, navigation and the like. These controllers are connected to an external communication network such as a smart phone, the Internet, and a traffic information system to perform data communication. Thus, these controllers 10 are controllers accessible from an external terminal or system.

반면, 후자의 제어기들은 주로 종래 전형적인 제어기로서, 차량 내부 시스템을 제어하기 위한 제어기들이다. 예를 들어, 엔진, 트랜스미션 등 파워트레인에 관련된 제어기들; 제동장치, 조향장치, 에어백 등 샤시에 관련된 제어기들; 클러스터, 도어, 윈도우 등 바디에 관련된 제어기들이다. 통상 이들을 각각 P-CAN, C-CAN, B-CAN 등으로 부르기도 한다.On the other hand, the latter controllers are mainly conventional conventional controllers, and are controllers for controlling the in-vehicle system. For example, controllers related to powertrain such as engine, transmission, etc .; Controllers associated with the chassis such as braking devices, steering devices, airbags, etc.; Clusters, doors, windows, and so on. These are usually referred to as P-CAN, C-CAN, and B-CAN, respectively.

한편, 각 제어기(10)는 CAN 트랜시버(transceiver)(20), CAN 컨트롤러(30) 및 마이크로컨트롤러(CPU)(40)로 구성된다. CAN 트랜시버(20)는 소정 CAN 커넥터를 통해 CAN 버스(50)와 연결되며, 제어기의 물리 계층을 구성한다. CAN 트랜시버(20)는 CAN 버스(50)의 장애를 감지하고 이를 관리하는 기능 및 메시지의 송수신 기능을 제공할 수 있다.Each controller 10 includes a CAN transceiver 20, a CAN controller 30, and a microcontroller (CPU) 40. The CAN transceiver 20 is connected to the CAN bus 50 via a predetermined CAN connector and constitutes the physical layer of the controller. The CAN transceiver 20 can provide functions of detecting and managing the failure of the CAN bus 50 and transmitting and receiving a message.

CAN 컨트롤러(controller)(30)는 CAN 프로토콜 메시지를 송수신하고 수신된 메시지에 대한 메시지 필터링 기능을 수행한다. 또한, CAN 컨트롤러(30)는 재전송 제어를 위한 메시지 버퍼 및 마이크로컨트롤러(40)와의 인터페이스 기능을 제공한다.The CAN controller 30 transmits and receives a CAN protocol message and performs a message filtering function on the received message. In addition, the CAN controller 30 provides a message buffer for retransmission control and an interface function with the microcontroller 40.

마이크로컨트롤러(40)는 CPU가 탑재될 수 있으며, 상위 계층 프로토콜을 제공하고 다양한 응용들을 제공할 수 있다.The microcontroller 40 can be equipped with a CPU, can provide an upper layer protocol and can provide various applications.

도 2 a 및 도 2b 는 본 발명의 일 실시예에 따른 CAN 컨트롤러(30)의 내부 구성을 나타낸 블럭도이다.2A and 2B are block diagrams illustrating an internal configuration of the CAN controller 30 according to an embodiment of the present invention.

도 2a 와 도 2b 의 실시예는 모두 CAN 컨트롤러(30)의 내부 구성을 나타내기 위한 도면으로서, 수신 메시지를 측정하는 구성에 대해서만 차이점이 존재한다. 따라서, 도 2a 및 도 2b 의 설명에서 반복되는 설명은 생략하기로 한다.The embodiments of FIGS. 2A and 2B are diagrams for illustrating the internal configuration of the CAN controller 30, but there is a difference only in the configuration for measuring a received message. Therefore, repeated description in the description of Figs. 2A and 2B will be omitted.

도 2a 에서 보는 바와 같이, 본 발명에 따른 CAN 컨트롤러(30)는 전송할 데이터를 임시로 저장하는 전송버퍼부(31), 전송데이터를 필터링하는 전송필터부(32), 필터링 값을 설정하는 필터값 설정부(33), 수신 메시지를 필터링하는 수신 필터부(35), 및, 수신 메시지를 임시로 저장하는 수신버퍼부(36)로 구성된다. 또한, 추가적으로 필터값을 저장하는 보호메모리(38)를 더 포함하여 구성된다.2A, the CAN controller 30 according to the present invention includes a transmission buffer unit 31 for temporarily storing data to be transmitted, a transmission filter unit 32 for filtering transmission data, a filter value A setting unit 33, a reception filter unit 35 for filtering the reception message, and a reception buffer unit 36 for temporarily storing the reception message. It further comprises a protection memory 38 for additionally storing filter values.

본 발명의 일 실시예에 따르면, CAN 버스로부터 수신 메시지를 감지하는 경우 마이크로컨트롤러(40)는 Rx(수신) 인터럽트 메시지를 발생할 수 있고, Rx 인터럽트 메시지를 수신한 수신 시간 측정부(41)는 내부 타이머 혹은 클럭 정보에 기반하여 수신 메시지의 수신 시간을 측정하고, 측정된 수신 시간을 수신 필터부(35)로 전달할 수 있다. 비록 도 2a 에서는 설명의 편의를 위해 수신 시간 측정부(41)가 마이크로컨트롤러(40) 외부 구성인 것으로 도시되었지만, 수신 시간 측정부(41)는 마이크로컨트롤러(40)에 포함되는 구성일 수 있다.According to an embodiment of the present invention, when detecting a reception message from the CAN bus, the microcontroller 40 can generate an Rx (reception) interrupt message, and the reception time measurement unit 41, which receives the Rx interrupt message, The reception time of the received message may be measured based on the timer or the clock information and the measured reception time may be transmitted to the reception filter unit 35. [ Although the reception time measuring unit 41 is shown as an external configuration of the microcontroller 40 in FIG. 2A for the sake of convenience, the reception time measuring unit 41 may be included in the microcontroller 40.

전송버퍼부(31)는 버퍼를 구비하여 전송할 데이터를 버퍼에 임시로 저장한다. 특히, 마이크로컨트롤러(40)는 전송할 데이터(또는 전송 데이터)를 전송버퍼부(31)의 버퍼에 저장한다.The transmission buffer unit 31 has a buffer and temporarily stores data to be transmitted in the buffer. In particular, the microcontroller 40 stores the data (or transmission data) to be transmitted in the buffer of the transmission buffer unit 31. [

도 3 은 본 발명의 일 실시예에 따른 전송 데이터의 구조를 설명하기 위한 것이다.FIG. 3 illustrates a structure of transmission data according to an embodiment of the present invention.

도 3 에서 보는 바와 같이, 전송데이터는 CAN 헤더(210) 부분과, 데이터 프레임 부분인 CAN 페이로드(220)로 구성된다. CAN 페이로드(220)에는 전송하고자 하는 정보가 기록된다. 예를 들어, 엔진 제어기(ECU)(10)인 경우, 엔진의 현재 상태에 대한 데이터 등이 CAN 페이로드(220) 필드에 기록된다. 상기와 같은 메시지의 규격은 CAN 프로토콜에 의해 정의된 규격을 따른다.As shown in FIG. 3, the transmission data is composed of a CAN header 210 part and a CAN payload part 220 which is a data frame part. The CAN payload 220 records information to be transmitted. For example, in the case of the engine controller (ECU) 10, data on the current state of the engine and the like are recorded in the CAN payload 220 field. The standard of the message conforms to the standard defined by the CAN protocol.

또한, 전송데이터의 CAN 헤더(210) 부분에는 메시지 ID(ID)(211) 필드가 있고, 해당 필드에는 해당 메시지의 ID가 기록된다. 메시지 ID(ID)는 메시지의 식별자로서, 메시지의 종류를 나타낸다. 예를 들어, 엔진의 RPM을 전송하는 메시지는 주기적으로 전송되는데, 이때, RPM 전송 메시지는 동일한 메시지 ID(ID)를 갖는다. 즉, 메시지를 수신하는 제어기(10)는 메시지 ID(ID)를 통해 해당 메시지가 어떤 데이터를 가지고 있는지를 확인한다.In the CAN header 210 of the transmission data, there is a message ID (ID) field 211, and the ID of the message is recorded in the corresponding field. The message ID (ID) is an identifier of the message, and indicates the type of the message. For example, a message that transmits an RPM of an engine is periodically transmitted, wherein the RPM transmission message has the same message ID (ID). That is, the controller 10 receiving the message confirms what data the corresponding message has via the message ID (ID).

전송버퍼부(31)는 상기와 같이 헤더(210)와 페이로드(220)로 구성된 전송데이터를 순차적으로 버퍼에 저장하고, 마이크로컨트롤러(40)에 의해 수신된 순서로 저장하였다가 수신된 순서대로 CAN 트랜시버(20)를 통해 전송한다.The transmission buffer unit 31 sequentially stores the transmission data composed of the header 210 and the payload 220 in the buffer and stores the transmission data in the order received by the microcontroller 40, Via the CAN transceiver 20.

다음으로, 전송필터부(32)는 전송데이터 내의 메시지 ID(211)를 필터링하여, 필터값에 포함된 메시지 ID를 가지는 전송데이터만 전송하게 한다. 즉, 전송필터부(32)는 전송이 허가된 메시지 ID에 대한 화이트 리스트(white list)를 보유하고, 상기 화이트 리스트 내의 메시지 ID를 가지는 전송데이터만 전송한다. Next, the transmission filter unit 32 filters the message ID 211 in the transmission data, and transmits only the transmission data having the message ID included in the filter value. That is, the transmission filter unit 32 holds a white list of the message IDs permitted to be transmitted, and transmits only the transmission data having the message IDs in the white list.

즉, 전송필터부(32)는 전송데이터의 메시지ID를 화이트 리스트와 대비하여 필터링을 수행한다.That is, the transmission filter unit 32 performs filtering by comparing the message ID of the transmission data with the whitelist.

다음으로, 필터값 설정부(33)는 전송필터부(32)의 필터값, 즉, 화이트 리스트를 설정한다. 필터값을 설정하는 모드는 2가지 모드로 구성되며, 하나는 보호기능 모드이고, 다른 하나의 모드는 관리자 모드(또는 테스트 모드)이다.Next, the filter value setting unit 33 sets the filter value of the transfer filter unit 32, that is, the white list. The mode for setting a filter value is composed of two modes, one is a protection function mode and the other is an administrator mode (or a test mode).

관리자 모드인 경우, 필터값 설정부(33)는 마이크로컨트롤러(40)에 의한 직접 지시에 의하여, 필터값 또는 화이트 리스트를 설정한다. 즉, 필터값 설정부(33)는 허용되는 메시지ID 리스트(또는 화이트 리스트)를 마이크로컨트롤러(40)로부터 수신받아, 수신받은 메시지 ID들을 전송필터부(32)의 필터값으로 설정한다.In the manager mode, the filter value setting unit 33 sets a filter value or a white list according to a direct instruction from the microcontroller 40. [ That is, the filter value setting unit 33 receives the allowed message ID list (or white list) from the microcontroller 40, and sets the received message IDs as filter values of the transmission filter unit 32.

보호기능 모드인 경우, 필터값 설정부(33)는 보호메모리(38)에 저장된 메시지ID 리스트 또는 화이트 리스트를 가져와서 전송필터부(32)의 필터값으로 설정한다. 바람직하게는, CAN 컨트롤러(30)가 전원이 온(On)되어 처음 시작하면(또는 부팅하면), 필터값 설정부(33)는 보호메모리(38)에 저장된 화이트 리스트를 가져와서 필터값으로 설정한다. 또한, 필터값 설정부(33)는 초기에 필터값이 한번 설정되면, 마이크로컨트롤러(40) 등의 명령에 의해 구동 중간에는 필터값을 변경하지 않는다.In the protection function mode, the filter value setting unit 33 fetches the message ID list or the whitelist stored in the protection memory 38, and sets the message ID list or the white list as the filter value of the transmission filter unit 32. Preferably, when the CAN controller 30 is first turned on (or booted), the filter value setting unit 33 fetches the whitelist stored in the protection memory 38 and sets the whitelist to the filter value do. The filter value setting unit 33 does not change the filter value in the middle of driving by the instruction of the microcontroller 40 or the like once the filter value is initially set.

따라서 초기 구동이 될 때에만 보호메모리(38)에서 가져와서 필터값이 설정되므로, 중간에 악의적인 공격자에 의해 제어기(10)가 해킹되더라도 필터값이 변경되지 않는다. Therefore, since the filter value is set to be taken from the protection memory 38 only when the initial drive is performed, the filter value is not changed even if the controller 10 is hacked by a malicious attacker in the middle.

또한, 필터값 설정부(33)는 수신 필터부(35)의 필터값, 즉, 화이트 리스트를 설정할 수 있다. 앞서 전송필터부(32)의 화이트 리스트를 제1 화이트 리스트라 부르기로 하고, 수신 필터부(35)의 화이트 리스트를 제2 화이트 리스트라 부르기로 한다. 제2 화이트 리스트는 제1 화이트 리스트와 마찬가지로, 수신이 허용된 메시지 ID를 리스트로 가지고 있다.The filter value setting unit 33 can set a filter value of the reception filter unit 35, that is, a white list. The white list of the transmission filter unit 32 will be referred to as a first white list and the white list of the reception filter unit 35 will be referred to as a second white list. The second whitelist, like the first whitelist, has a list of message IDs that are allowed to be received.

필터값 설정부(33)는 제2 화이트 리스트를 보호메모리(38) 또는 마이크로컨트롤러(40)로부터 가져와서, 수신 필터부(35)의 필터링 값으로 설정한다. 또한, 보호기능 모드인 경우, 수신 필터부(35)의 필터값은 초기에 한번 설정되고, 구동 중간에는 변경되지 않는다.The filter value setting unit 33 fetches the second white list from the protection memory 38 or the microcontroller 40 and sets the filtering value to the reception filter unit 35. [ In the protection function mode, the filter value of the reception filter unit 35 is initially set at once, and is not changed in the middle of driving.

또한, 필터값 설정부(33)는 수신 메시지 ID 각각에 대한 기준 주기를 수신 필터부(35)의 수신 시간 테이블의 주기로 설정한다. 이때 설정되는 기준 주기는 각 메시지 ID에 해당하는 메시지가 전송되는 주기로서, 적합한 권한을 가진 전송자에 의해 전송될 때 수신 메시지들은 기준 주기 간격으로 수신될 수 있다. 바람직하게는, 기준 주기는 초기에 한번 설정되고, 구동 중간에는 변경되지 않으며, 필터값 설정부(33)는 보호 메모리(38)로부터 메시지 ID 각각에 대응하는 기준 주기를 획득할 수 있다.The filter value setting unit 33 sets the reference period for each received message ID as the period of the reception time table of the reception filter unit 35. [ The set reference period is a period in which a message corresponding to each message ID is transmitted. When the message is transmitted by a sender having an appropriate authority, the received messages can be received at a reference period interval. Preferably, the reference period is set once at the beginning, and is not changed in the middle of the driving, and the filter value setting unit 33 can obtain the reference period corresponding to each message ID from the protection memory 38. [

다음으로, 보호메모리(38)는 ROM(Read Only Memory), 플래시메모리 등 비휘발성 메모리로서, 필터값 또는 메시지ID 리스트를 저장한다.Next, the protection memory 38 is a non-volatile memory such as a ROM (Read Only Memory) or a flash memory, and stores a filter value or a message ID list.

보호메모리(38)는 필터값 설정부(33)에 대하여 읽기 기능만 허용된 메모리이다. 즉, 필터값 설정부(33) 또는 마이크로컨트롤러(40)는 보호메모리(38)를 직접 접근하여 데이터를 변경하거나 삭제할 수 없다.The protection memory 38 is a memory for which only the read function is allowed for the filter value setting unit 33. [ That is, the filter value setting unit 33 or the microcontroller 40 can not directly access the protection memory 38 to change or delete data.

바람직하게는, 보호메모리(38)는 통상의 비휘발성 메모리로 구성되며, 그 일부의 메모리 공간을 보호영역으로 구분하여 지정될 수 있다. 이 경우, 보호 영역의 메모리에 저장된 데이터만 읽기 기능이 허용되고, 보호 영역 외의 다른 영역에는 데이터를 변경하거나 삭제가 가능하다.Preferably, the protection memory 38 is constituted by a normal nonvolatile memory, and a part of the memory space can be designated as a protection area. In this case, only the data stored in the memory of the protection area is allowed to be read, and data in the area other than the protection area can be changed or deleted.

보호 메모리 또는, 보호된 메모리 영역(보호영역)은 일반적인 비휘발성 메모리(e.g. 플래시 메모리)처럼 메모리 주소값으로 접근이 불가능하며, 보호된 메모리 영역에 대한 읽기/쓰기 접근을 하려면 특수한 접근방법과 패스워드가 필요하다.Protected memory or a protected memory area (protection area) is not accessible as a memory address value, like normal non-volatile memory (eg flash memory), and special access and passwords are required for read / need.

보호된 메모리 또는 보호영역에는 다음과 같은 정보들이 저장된다. 즉, 유효한 송신용 메시지 ID들, 즉, 제1 화이트 리스트이다. 즉, 제1 화이트 리스트에 포함된 메시지 ID들은 "안전한 CAN 컨트롤러(또는 보호기능 모드)"가 적용되는 전자식 제어기에서 CAN 버스에 전송할 수 있는 유효한 CAN ID들이다.The following information is stored in the protected memory or protection area. That is, the valid transmission message IDs, i.e., the first whitelist. That is, the message IDs contained in the first white list are valid CAN IDs that can be transmitted to the CAN bus in the electronic controller to which the " secure CAN controller (or protection mode) "

또한, 제2 화이트 리스트는 “안전한 CAN 컨트롤러(또는 보호기능 모드)"가 적용되는 전자식 제어기(10)에서 CAN 버스(50)로부터 수신할 수 있는 유효한 CAN ID들 의 집합이다.The second white list is also a set of valid CAN IDs that can be received from the CAN bus 50 in the electronic controller 10 to which the " safe CAN controller (or protection mode) "

또한, 바람직하게는, 보호메모리(38)에는 수신용 CAN ID 각각에 대한 기준 주기 및 후술할 학습된 탐지 점수에 대한 정보도 함께 기록된다.Further, preferably, the protection memory 38 also records information on the reference period for each of the receiving CAN IDs and the learned detection score to be described later.

다음으로, 수신 시간 측정부(41)는 CAN 트랜시버(20)로부터 수신된 데이터(이하의 본 명세서에서, 수신 메시지)의 수신 시간을 측정한다. 도 2a 의 실시에에서, 수신 시간 측정부(41)는 마이크로컨트롤러(40)가 발생시킨 Rx 인터럽트 신호를 수신하여 수신 메시지의 수신 시간을 측정할 수 있다. 이때, 수신 시간 측정부(41)는 마이크로 프로세서 내부의 타이머 혹은 클럭 신호에 기초하여 수신 시간을 측정할 수 있으며, 측정된 수신 시간을 수신 필터부(35)로 전달한다.Next, the reception time measurement unit 41 measures the reception time of the data received from the CAN transceiver 20 (hereinafter, the reception message in this specification). 2A, the reception time measuring unit 41 may receive the Rx interrupt signal generated by the microcontroller 40 and measure the reception time of the reception message. At this time, the reception time measuring unit 41 can measure the reception time based on a timer or a clock signal in the microprocessor, and transmits the measured reception time to the reception filter unit 35. [

다음으로, 수신 필터부(35)는 수신 메시지의 메시지 ID에 대하여 필터링을 수행하여, 허용된 메시지 ID 를 갖는 수신 메시지만을 수신버퍼부(36)로 전송하여 버퍼링한다. 구체적으로, 수신 필터부(35)는 수신 메시지 내의 메시지 ID(211)를 필터링하여, 필터값에 포함된 메시지 ID를 가지는 수신 메시지만 수신하게 한다. 즉, 수신 필터부(35)는 수신이 허가된 메시지 ID에 대한 제2 화이트 리스트(white list)를 보유하고, 상기 제2 화이트 리스트 내의 메시지 ID를 가지는 수신 메시지만 수신한다. 즉, 수신 필터부(35)는 수신 메시지의 메시지ID를 제2 화이트 리스트와 대비하여 필터링을 수행한다.Next, the reception filter unit 35 performs filtering on the message ID of the received message, and transmits only the received message having the allowed message ID to the reception buffer unit 36 to buffer the received message. Specifically, the reception filter unit 35 filters the message ID 211 in the received message, and receives only the received message having the message ID included in the filter value. That is, the reception filter unit 35 holds a second white list of the message IDs permitted to be received, and receives only the reception messages having the message IDs in the second white list. That is, the reception filter unit 35 performs filtering by comparing the message ID of the received message with the second white list.

또한, 수신 필터부(35)는 동일한 메시지 ID 를 가지는 수신 메시지들의 수신 시간의 차이와, 대응하는 메시지 ID 의 기준 주기를 비교하는 주기 연산을 수행하여 비정상 메시지 여부를 판단하고, 정상 메시지만을 수신 버퍼부(36)로 전송하여 버퍼링한다. 보다 상세히, 수신 필터부(35)는 수신 메시지에 삽입된 수신 시간을 각 메시지 ID 별로 수신 시간 테이블에 기록한다. 바람직하게는, 연속적으로 수신되는 적어도 3개의 수신 메시지의 수신 시간을 모두 기록하고, 기록된 수신 메시지들의 수신 시간의 차이와 기준 주기를 비교하여, 정상 메시지인지 여부를 판단한다. 이때, 연속적인 3개의 수신 시간은 동일한 메시지 ID를 가지는 수신 메시지의 수신 시간들이다.In addition, the reception filter unit 35 determines whether an abnormal message is generated by performing a periodic operation to compare the difference between the reception times of reception messages having the same message ID and the reference period of the corresponding message ID, (36) and buffers them. More specifically, the reception filter unit 35 records the reception time inserted in the reception message into the reception time table for each message ID. Preferably, all the reception times of at least three consecutively received messages are recorded, and the difference between the reception times of the received messages and the reference period is compared to determine whether the message is a normal message. At this time, the three consecutive reception times are the reception times of the reception message having the same message ID.

본 명세서에서 업급된 수신 메시지들의 수신 주기는 반드시 바로 인접한 수신 메시지들 간의 시간 간격이 아닐 수 있다. 예를 들어, 본 발명의 수신 메시지들의 수신 시간의 차이는 연속적인 3개의 수신 시간 중에서 첫번째 수신 시간과 3번째 수신 시간의 차이일 수 있다. 구체적으로, 수신 필터부(35)는 연속적인 3개의 수신 시간 중에서 첫번째 수신 시간과 3번째 수신 시간의 차이가 기준 주기 보다 작은 경우에는 수신된 적어도 3개의 수신 메시지 중 적어도 1개는 비정상 메시지로 판단한다.The reception period of received messages received in this specification may not necessarily be the time interval between adjacent received messages. For example, the difference in the reception time of the reception messages of the present invention may be the difference between the first reception time and the third reception time among the three consecutive reception times. Specifically, when the difference between the first reception time and the third reception time is shorter than the reference period, the reception filter unit 35 determines that at least one of the received three reception messages is an abnormal message do.

수신 필터부(35)가 ID 필터링 또는 수신 시간 주기 분석을 통해 비정상 메시지를 탐지하는 구체적인 구성에 대해서는 하기의 도 6a 및 도 6b 에서 보다 상세히 살펴보기로 한다.A specific configuration in which the reception filter unit 35 detects an abnormal message through ID filtering or reception time period analysis will be described in more detail with reference to FIGS. 6A and 6B.

다음으로, 수신버퍼부(36)는 수신 메시지를 수신 버퍼에 저장한다. 앞서 수신 필터부(35)에 의해 필터링된 수신 메시지만을 수신 버퍼에 저장한다. 수신버퍼부(36)에 저장된 수신 메시지는 마이크로컨트롤러(40)로 전달된다.Next, the reception buffer unit 36 stores the reception message in the reception buffer. Only the reception message filtered by the reception filter unit 35 is stored in the reception buffer. The received message stored in the reception buffer unit 36 is transmitted to the microcontroller 40.

한편, 도 2b 는 CAN 컨트롤러(30)에서 자체적으로 수신 메시지의 수신 시간을 측정하는 경우의 제어기(10)의 구성을 나타내고 있다.On the other hand, FIG. 2B shows the configuration of the controller 10 when the CAN controller 30 itself measures the reception time of the received message.

도 2b 의 실시예는, 마이크로컨트롤러(40)의 Rx 인터럽트 신호에 의해 수신 메시지의 수신 시간을 측정하는 도 2a 의 실시예와 달리, 수신 메시지의 수신 시간을 CAN 컨트롤러(30)에서 직접 측정하므로, 도 2a 의 수신 시간 측정부(41)의 구성이 생략될 수 있다. 대신, 도 2b 의 실시예에서는 CAN 컨트롤러(30) 내부에 수신 메시지의 수신 시간 측정을 위한 구성이 별도로 구비될 수 있다. 이에 대해서는 후술하는 도 6b 에서 보다 상세히 살펴보기로 한다.2B, since the reception time of the received message is directly measured by the CAN controller 30, unlike the embodiment of FIG. 2A, which measures the reception time of the received message by the Rx interrupt signal of the microcontroller 40, The configuration of the reception time measuring unit 41 of FIG. 2A can be omitted. Instead, in the embodiment of FIG. 2B, a configuration for measuring the reception time of a received message may be separately provided in the CAN controller 30. FIG. This will be described later in more detail with reference to FIG. 6B.

또한, 도 2b 의 실시예는, CAN 컨트롤러(30)에서 자체적으로 수신 메시지의 수신 시간을 측정하는 것 외의 다른 구성들은 도 2a 의 실시예와 동일하므로, 중복되는 구성의 설명에 대해서는 생략하기로 한다.In the embodiment of FIG. 2B, other configurations are the same as those of FIG. 2A except that the reception time of the reception message is measured by the CAN controller 30 itself, so the description of the redundant configuration is omitted .

도 4 는 본 발명의 일 실시예에 따른 필터값 설정 방법을 시계열적으로 나타낸 도면이다.4 is a time-series diagram illustrating a method of setting a filter value according to an exemplary embodiment of the present invention.

도 4에서 보는 바와 같이, 먼저, CAN 컨트롤러(30) 또는 필터값 설정부(33)는 보호기능 모드가 활성화되었는지를 판단한다(S10). 보호기능 모드 활성화 여부 판단은 CAN 통신이 초기화하는 단계에서 수행된다.As shown in FIG. 4, first, the CAN controller 30 or the filter value setting unit 33 determines whether the protection function mode is activated (S10). The determination whether or not the protection function mode is activated is performed in a step of initializing the CAN communication.

보호기능 모드가 활성화된 상태이면, 보호메모리(38) 또는 보호메모리(38) 내의 보호 영역에 저장된 화이트 리스트를 가져와서, 전송 필터값 또는 수신 필터값으로 설정한다(S20). 화이트 리스트는 전송 또는 수신이 허용되는 메시지 ID(ID)들의 목록이다. 바람직하게는, 화이트 리스트는 전송 필터용과 수신 필터용으로 따로 구분되고, 전송 필터값과 수신 필터값은 서로 구분되어 설정된다.If the protection function mode is activated, the white list stored in the protection area in the protection memory 38 or the protection memory 38 is fetched and set as a transmission filter value or a reception filter value (S20). The whitelist is a list of message IDs (IDs) that are allowed to be transmitted or received. Preferably, the white list is divided into a transmission filter and a reception filter separately, and a transmission filter value and a reception filter value are set separately from each other.

만약, 보호기능 모드가 활성화되지 않으면, 관리자 모드 또는 테스트 모드로서, 전송 필터값 또는 수신 필터값이 마이크로컨트롤러(40)의 지시에 따라 설정될 수 있다(S30). 구체적으로, 마이크로컨트롤러(40)의 지시에 따라 SPI(Serial Peripheral Interface) 통신을 통해 필터값을 수신하여, 전송 필터값 또는 수신 필터값을 설정한다. 또는 다른 예로서, 제어기(10)에 구비된 레지스터를 이용하여, 레지스터(미도시)에 필터값(또는 화이트 리스트)을 임시로 저장하고, 레지스터에 저장된 값으로 전송 필터값 또는 수신 필터값을 설정한다.If the protection function mode is not activated, the transmission filter value or the reception filter value may be set according to an instruction of the microcontroller 40, as an administrator mode or a test mode (S30). Specifically, the microprocessor 40 receives the filter value through SPI (Serial Peripheral Interface) communication according to an instruction from the microcontroller 40, and sets a transmission filter value or a reception filter value. Alternatively, a filter value (or white list) is temporarily stored in a register (not shown) using a register provided in the controller 10, and a transmission filter value or a reception filter value is set as a value stored in the register do.

도 5 는 본 발명의 일 실시예에 따른 전송 필터부가 전송 데이터를 필터링하는 구성을 설명하기 위한 도면이다. 5 is a view for explaining a configuration in which a transmission filter unit filters transmission data according to an embodiment of the present invention.

도 5에서 보는 바와 같이, 본 발명에 따른 전송필터부(32)는 전송 데이터를 임시로 저장하는 전송 레지스터(321), 다수의 필터가 기록된 전송필터(322), 다수의 필터 중 하나를 선택하여 출력하는 다중화기(Mux)(323), 전송필터값과 전송 레지스터(321)를 대비하는 비교기(324)로 구성된다. As shown in FIG. 5, the transmission filter unit 32 according to the present invention includes a transmission register 321 for temporarily storing transmission data, a transmission filter 322 in which a plurality of filters are recorded, And a comparator 324 for comparing the transmission filter value with the transmission register 321. The multiplexer 323 multiplexes the transmission filter value with the transmission register 321,

즉, 전송 레지스터(321)에는 전송버퍼부(31)로부터 가져온 전송데이터가 임시로 저장된다. 또한, 전송필터(322)는 다수의 필터값, 또는, 화이트 리스트가 저장되고, 다중화기(323)에 의해 하나의 필터값만 선택된다. 비교기(324)는 전송 레지스터(321)의 전송데이터 중 메시지 ID와 필터값을 대비하여 필터링을 수행한다. 비교기(324)의 결과는 전송 레지스터(321)를 제어하여, CAN 트랜시버(20)로 전송하게 하거나, 차단하도록 제어한다.That is, in the transfer register 321, transfer data fetched from the transfer buffer unit 31 is temporarily stored. In addition, the transmission filter 322 stores a plurality of filter values or a whitelist, and only one filter value is selected by the multiplexer 323. The comparator 324 performs filtering by comparing the message ID and the filter value in the transmission data of the transmission register 321. The result of the comparator 324 controls the transmission register 321 to be transmitted to the CAN transceiver 20 or blocked.

특히, 전송필터(322)는 앞서 초기화 할 때 설정되며, 필터값들은 전송할 수 있는 유효한 메시지 ID들이다. 따라서 비교기(324)에 의해, 적어도 동일한 결과가 나오는 경우에만, 전송 레지스터(321)의 전송 데이터가 CAN 트랜시버(20)로 전송하게 한다. 따라서 전송필터(322)의 어느 필터값과도 동일하다는 결과 나오지 않으면, 전송 데이터가 CAN 트랜시버(20)로 전송되지 않는다. 즉, 유효하지 않은 메시지 ID를 가지므로, 해당 전송데이터는 차단된다.In particular, the transport filter 322 is set at the time of initialization, and the filter values are valid message IDs that can be transmitted. Thus, the comparator 324 causes the transfer data of the transfer register 321 to be transferred to the CAN transceiver 20 only if at least the same result is obtained. Therefore, if the result of the determination is the same as any filter value of the transmission filter 322, the transmission data is not transmitted to the CAN transceiver 20. That is, since it has an invalid message ID, the corresponding transmission data is blocked.

도 6a 및 도 6b 은 본 발명의 일 실시예에 따른 수신필터부가 수신 메시지를 필터링하는 구성을 설명하기 위한 도면이다.6A and 6B are views for explaining a configuration in which a reception filter unit filters a received message according to an embodiment of the present invention.

먼저, 도 6a 는 도 2a 의 실시예에 계속하여, 마이크로컨트롤러(40)가 Rx 인터럽트 신호를 발생시켜 수신 시간을 측정하는 경우의 수신 필터부(35)의 세부 구성을 나타내고 있다.First, FIG. 6A shows the detailed configuration of the reception filter unit 35 when the microcontroller 40 generates the Rx interrupt signal to measure the reception time, following the embodiment of FIG. 2A.

도 6a 에서 보는 바와 같이, 수신 필터부(35)는 수신 시간의 차이 및 주기를 대비하는 주기연산 회로부(352), 수신필터 및 주기연산 결과를 이용하여 비정상 메시지 여부를 탐지하는 비정상 메시지 탐지부(353), 주기 연산 결과에 학습 알고리즘을 적용하는 탐지 점수 학습부(354), 수신이 허용된 ID 를 기록하는 ID 필터 테이블(358) 및 수신 시간을 기록하는 수신 시간 테이블(359)을 포함하여 구성된다. 구체적으로, ID 필터 테이블(358)은 수신이 허용된 수신 ID 필터를 기록하는 저장공간으로 구성되고, 수신 시간 테이블(359)는 메시지 ID, 기준 주기, 수신 시간을 기록하는 저장공간으로 구성된다. 바람직하게는, ID 필터 테이블(358) 및 수신 시간 테이블(359)은 2차원 레지스터 또는 메모리, 캐시 등으로 구성될 수 있다.As shown in FIG. 6A, the reception filter unit 35 includes a cyclic operation circuit unit 352 that compares the difference in reception time and a cycle, an abnormal message detection unit that detects an abnormal message using a reception filter and a cyclic operation result 353), a detection score learning section (354) for applying a learning algorithm to the result of periodic calculation, an ID filter table (358) for recording IDs allowed to be received, and a reception time table (359) do. Specifically, the ID filter table 358 is configured as a storage space for recording the reception ID filter allowed to be received, and the reception time table 359 comprises a storage space for recording the message ID, the reference period, and the reception time. Preferably, the ID filter table 358 and the reception time table 359 may be comprised of a two-dimensional register, memory, cache, or the like.

먼저, ID 필터 테이블(358)은 수신 메시지를 수신하여 테이블에 저장된 수신이 허용된 수신 ID 필터와 수신 메시지의 ID 값을 비교하여 수신 메시지를 필터링한다. 이때, ID 필터 테이블(358)의 수신이 허용된 수신 ID 필터는 보호메모리(38)로부터 획득된 것일 수 있다.First, the ID filter table 358 receives the received message and compares the ID value of the received message with the received ID filter allowed to be received stored in the table, thereby filtering the received message. At this time, the reception ID filter which is allowed to receive the ID filter table 358 may be obtained from the protection memory 38.

또한, 수신 시간 테이블(359)은 보호 메모리(38)로부터 획득한 수신 메시지의 기준 주기를 포함할 수 있다. 이때, 기준 주기는 정상 메시지들이 수신되었을 때 수신 메시지간의 시간 차로 기대되는 값일 수 있다. 더불어, 수신 시간 테이블(359)에는 수신 시간 측정부(41)가 측정한 수신 시간이 삽입된 수신 메시지에 기초하여 수신 메시지의 수신 시간이 기록될 수 있다. 상술한 바와 같이, 본 발명의 일 실시예에 따른 마이크로컨트롤러(40)는 제어기(10)가 CAN 버스로부터 메시지를 수신하였을 때 Rx 인터럽트 신호를 발생시킬 수 있으며, Rx 인터럽트 신호의 발생에 의해 수신 시간 측정부(41)는 수신 메시지의 수신 시간을 측정하여 수신 필터부(35)에 제공할 수 있다.The reception time table 359 may also include a reference period of the received message obtained from the protection memory 38. [ In this case, the reference period may be a value expected by a time difference between received messages when normal messages are received. In addition, the reception time of the reception message may be recorded in the reception time table 359 based on the reception message in which the reception time measured by the reception time measurement unit 41 is inserted. As described above, the microcontroller 40 according to an embodiment of the present invention can generate an Rx interrupt signal when the controller 10 receives a message from the CAN bus, The measuring unit 41 may measure the reception time of the reception message and provide the measured reception time to the reception filter unit 35. [

이때, 수신 시간은 적어도 3개의 필드를 갖는다. 각 필드는 수신 시간을 저장한다. 바람직하게는, 수신 시간의 필드는 적어도 3개의 시프트 레지스터로 구성되어, 해당 메시지 ID의 수신 메시지가 수신될 때마다 저장된 값이 앞쪽으로 시프트된다. 즉, 가장 늦게 수신된 1번째 수신 시간은 버려지고, 2번째 수신 시간이 1번째 시프트 레지스터로 이동하고, 3번째 데이터가 2번째 시프트 레지스터로 이동한다. 그리고 마지막 시프트 레지스터에는 최근의 수신 시간이 기록된다.At this time, the reception time has at least three fields. Each field stores the reception time. Preferably, the field of the reception time consists of at least three shift registers, and the stored value is shifted forward as the received message of the corresponding message ID is received. That is, the first reception time received last is discarded, the second reception time is shifted to the first shift register, and the third data is shifted to the second shift register. And the last receive register stores the latest receive time.

다음으로, 주기연산 회로부(352)는 수신 시간 테이블(359)에 기록된 기준 주기 및 적어도 3개의 수신 메시지들의 수신 시간의 차이를 대비하고, 그 결과 값을 출력하는 회로이다. 바람직하게는, 주기연산 회로부(352)는 1번째 수신 시간과 3번째 수신 시간의 차이를 연산하고, 연산된 수신 시간 차이가 주기 보다 작은지 여부를 대비하여 그 결과를 출력한다. 한편, 주기연산 회로부(352)는 수신 시간의 차이와 기준 주기의 비교를 연산하기 위해 감산기를 구비한다.Next, the periodic operation circuit unit 352 compares the difference between the reception period of the reference period and at least three reception messages recorded in the reception time table 359, and outputs the resultant value. Preferably, the periodic operation circuit 352 calculates the difference between the first reception time and the third reception time, and outputs the result in comparison with whether the calculated reception time difference is smaller than the period. On the other hand, the periodic operation circuit unit 352 includes a subtracter for calculating a comparison between the difference of the reception time and the reference period.

본 발명의 CAN 통신 제어 시스템은 실시간 운영 체제 기반으로서, 제어기(10)의 전자 제어 관련 CAN 메시지들은 주기적으로 송신될 수 있다. 이때, 하나의 제어기(10)에 복수개의 CAN ID 들이 할당될 수 있으며, 그 중 전자 제어 관련 CAN ID 를 갖는 메시지들은 주기적으로 관련 정보를 갱신하여 CAN 버스에 송신될 수 있다. 따라서, 해킹 공격에 의한 악성 메시지와 같은 비정상 메시지는 정상 메시지와 주기적인 관점에서 충돌이 발생할 가능성이 높다. 이러한 점을 고려하여, 주기연산 회로부(352)는 수신 메시지들의 수신 시간 차이를 기설정된 주기와 비교할 수 있다. 본 발명에서는 수신 메시지들의 수신 시간의 차이가 기준 주기보다 작은 경우 주기 연산 결과가 차단 조건을 만족하였으며, 수신 메시지가 비정상 메시지라 판단한다.The CAN communication control system of the present invention is based on a real-time operating system, and the electronic control related CAN messages of the controller 10 can be periodically transmitted. At this time, a plurality of CAN IDs may be assigned to one controller 10, and messages having an electronic control related CAN ID may be periodically transmitted to the CAN bus by updating related information periodically. Therefore, an abnormal message such as a malicious message caused by a hacking attack is highly likely to collide with a normal message periodically. In consideration of this point, the periodic operation circuit 352 can compare the reception time difference of the received messages with a predetermined period. In the present invention, when the difference in the reception time of the received messages is smaller than the reference period, the cyclic operation result satisfies the blocking condition, and the received message is determined to be an abnormal message.

보다 상세히, 주기 연산 회로부(352)는 특정 CAN ID 에 대해 3개의 메시지가 순차적으로 수신되었을 때 수신된 순서에 따라 수신 시간을 T1, T2, T3(T3가 가장 최근에 수신된 메시지의 수신 시간)이라 설정하고, [T3-T1] 의 값을 연산할 수 있다. 또한, 주기 연산 회로부(352)는 [T3-T1 < 해당 CAN ID에대한 기설정된 주기] 인지 여부를 판단할 수 있으며, 해당 수학식을 만족시키는 경우 주기 연산 결과가 차단 조건을 만족하였다고 볼 수 있다.More specifically, the periodic operation circuit unit 352 calculates the reception times T1, T2, and T3 (the reception time of the most recently received message T3) according to the order in which three messages are sequentially received for a specific CAN ID, , And the value of [T3-T1] can be calculated. In addition, the periodic operation circuit 352 can determine whether or not [T3-T1 < a predetermined cycle with respect to the corresponding CAN ID]. If the equation is satisfied, the cycle operation result can be regarded as satisfying the cutoff condition .

다음으로, 비정상 메시지 탐지부(353)는 수신된 데이터의 메시지 ID를 추출하고, 추출된 메시지 ID가 수신 시간 테이블(359)에 존재하는지를 검색한다. 비정상 메시지 탐지부(353)는 추출된 메시지 ID가 수신 시간 테이블(359)에 존재하지 않으면, 수신 메시지를 차단한다.Next, the abnormal message detection unit 353 extracts the message ID of the received data, and searches whether or not the extracted message ID exists in the reception time table 359. If the extracted message ID does not exist in the reception time table 359, the abnormal message detection unit 353 blocks the received message.

또한, 비정상메시지 탐지부(353)는 주기연산 회로부(352)의 연산결과에 따라 수신 메시지를 수신버퍼부(36)에 전송하거나 차단한다. 즉, 주기연산 회로부(352)의 수신 메시지들의 수신 시간의 차이가 기준 주기보다 작은 것으로 나오는 경우, 수신 메시지를 차단한다. 그리고 작지 않은 것으로 결과가 나오면, 수신 메시지를 수신버퍼부(36)로 전송한다.The abnormal message detection unit 353 transmits or blocks the received message to the reception buffer unit 36 in accordance with the operation result of the periodic operation circuit unit 352. That is, when the difference in the reception time of the reception messages of the periodic operation circuit 352 is smaller than the reference period, the reception message is blocked. When the result is not small, it transmits the received message to the reception buffer unit 36.

일 실시예에서, [T3-T1 < 해당 CAN ID에대한 기설정된 주기] 인 경우, 즉 주기 연산 결과가 차단 조건을 만족하는 경우, 비정상 메시지 탐지부(353)는 비정상 메시지가 발생되었다고 판단할 수 있다. 혹은, 비정상 메시지 탐지부(353)는 비록 주기 연산 회로부(352)의 주기 연산 결과가 차단 조건을 만족하더라도, 바로 해당 수신 메시지를 비정상 메시지라 판단하지 않고, 후술하는 탐지 점수 학습부(354)의 탐지 점수 결과에 따라 비정상 메시지가 발생되었다고 판단할 수 있다.In one embodiment, when [T3-T1 <predetermined period for the corresponding CAN ID], that is, when the cyclic operation result satisfies the blocking condition, the abnormal message detection unit 353 can determine that the abnormal message has occurred have. Alternatively, even if the cyclic operation result of the periodic operation circuit unit 352 satisfies the cutoff condition, the abnormal message detection unit 353 does not determine that the received message is an abnormal message, It can be determined that an abnormal message has occurred according to the detection score result.

한편, 본 발명의 다른 일 실시예에서는, 비정상 메시지 탐지부(353)는 추출된 메시지 ID가 수신 시간 테이블(359)에 수신 ID 필터로서 존재하는 경우에만, 해당 메시지에 대해 수신 시간으로 필터링을 수행하도록 주기연산 회로부(352)를 제어할 수 있다. 즉, 비정상 메시지 탐지부(353)는 수신 메시지가 ID 필터링을 통과한 경우에만 주기 연산 회로부(352)에 의한 수신 시간 필터링이 이루어지도록 제어할 수 있다.On the other hand, in another embodiment of the present invention, the abnormal message detection unit 353 performs filtering on the message at the reception time only when the extracted message ID exists as the reception ID filter in the reception time table 359 The periodic operation circuit unit 352 can be controlled. That is, the abnormal message detection unit 353 can control the reception time filtering by the periodic operation circuit unit 352 only when the received message passes the ID filtering.

또한, 본 발명의 일 실시예에 따르면, CAN 컨트롤러(30)는 탐지 점수 학습부(354)를 추가적으로 포함할 수 있다. 탐지 점수 학습부(354)는 주기 연산 회로부(352)의 주기 연산 결과에 추가적으로 탐지 학습 알고리즘을 적용할 수 있다.Also, according to an embodiment of the present invention, the CAN controller 30 may additionally include a detection score learning unit 354. [ The detection score learning unit 354 can further apply a detection learning algorithm to the period calculation result of the period calculation circuit unit 352. [

이와 관련하여, 상술한 바와 같은 주기 연산 회로부(352)에 의한 주기 연산 결과가 설정된 차단 조건을 만족할 때마다 해당 메시지를 비정상 메시지로 판단하기에는 어려움이 존재한다. 임베디드 환경의 특성 상 정상적인 경우에도 노이즈 등으로 메시지들의 수신 주기가 잘못될 수 있기 때문이다. 따라서, 본 발명에서는 주기 연산에서 더 나아가 보다 정확하게 비정상 메시지를 탐지할 수 있는 탐지 점수 학습 알고리즘을 사용할 수 있다.In this regard, there is a difficulty in judging a corresponding message as an abnormal message whenever the cyclic operation result by the cyclic operation circuit unit 352 as described above satisfies the set cutoff condition. Because of the characteristics of the embedded environment, the reception period of messages may be incorrect due to noise or the like even in the normal case. Therefore, in the present invention, it is possible to use a detection point learning algorithm that can more accurately detect an abnormal message in the periodic calculation.

보다 상세히, 탐지 점수 학습부(354)는 주기 연산 회로부(352)의 주기 연산 결과가 차단 조건을 만족시킬 때마다, 해당 CAN ID 에 대한 탐지 점수를 기설정된 값만큼 증가시킨다. 만족시키지 않는 경우, 해당 CAN ID 에 대한 탐지 점수를 기설정된 값만큼 감소시킨다. 이와 같은 방법으로 메시지를 수신할 때마다 탐지 점수가 조정될 수 있으며, 탐지 점수가 기설정된 값 이상이 되는 경우 확정적으로 비정상 메시지가 수신된 것으로 판단할 수 있다.More specifically, the detection score learning unit 354 increases the detection score for the corresponding CAN ID by a preset value every time the cycle calculation result of the cycle calculation circuit unit 352 satisfies the cutoff condition. If not satisfied, the detection score for the corresponding CAN ID is reduced by a predetermined value. In this way, the detection score can be adjusted every time a message is received. If the detection score is greater than a predetermined value, it can be determined that an abnormal message has been received definitively.

비정상 메시지가 수신된 것으로 판단되면, 비정상 메시지 탐지부(353)는 해당 CAN ID 에 대한 수신을 차단하고, 일정 기간 동안 혹은 영구히 해당 CAN ID 의 메시지를 수신하지 않거나, 고장 상태에서 최소한의 기능만을 동작하도록 설계된(예를 들어, 림프홈 모드) 특정 상태로 동작하게 할 수 있다.If it is determined that the abnormal message has been received, the abnormal message detection unit 353 blocks reception of the corresponding CAN ID, and does not receive the message of the corresponding CAN ID for a predetermined period or permanently, (For example, a limp home mode).

한편, 탐지 점수 학습부(354)가 산출한 탐지 점수는 비휘발성 메모리에 저장될 수 있다. 이는, 제어기(10)자체의 문제로 인해 제어기(10)가 리셋되더라도 학습된 탐지 점수가 사라지지 않고 반영되도록 하기 위함이다. 특히, 탐지 점수가 저장되는 비휘발성 메모리 영역은 보호 메모리(38) 영역일 수 있다.On the other hand, the detection score calculated by the detection score learning unit 354 can be stored in the nonvolatile memory. This is so that even if the controller 10 is reset due to a problem of the controller 10 itself, the learned detection score is not lost but reflected. In particular, the non-volatile memory area in which the detection score is stored may be a protected memory 38 area.

또한, 도 6b 의 실시예는 도 2b 의 실시예에 계속하여, CAN 컨트롤러(30)가 직접 수신 시간을 측정하는 경우의 수신 필터부(35)의 내부 구성을 나타낸 도면이다.6B is a diagram showing the internal configuration of the reception filter unit 35 when the CAN controller 30 directly measures the reception time, following the embodiment of FIG. 2B.

도 6b 에 도시된 바와 같이, CAN 컨트롤러(30)는 수신 시간 측정부(351)를 포함하며 수신 메시지의 수신 시간을 직접 측정하고, 이로부터 수신 시간 테이블(359)에 기록할 수 있다. 본 발명의 일 실시예에서, 수신 시간 삽입부(34)는 타임 트리거링(Time Triggering) 방식을 이용하여 수신 시간을 측정할 수 있다. 구체적인 일 실시예에서, 수신 필터부(35)는 캔 컨트롤러(30) 내의 TTCAN(Time Triggered Controller Area Network) 모듈을 이용하여 수신 시간을 측정할 수 있다. 수신 시간 측정부(351)는 측정된 수신 시간을 수신 시간 테이블(359)에 전달한다.As shown in FIG. 6B, the CAN controller 30 includes a reception time measurement unit 351 and can directly measure the reception time of the reception message and record the reception time in the reception time table 359 from this. In one embodiment of the present invention, the reception time insertion unit 34 may measure the reception time using a time triggering method. In one specific embodiment, the receive filter unit 35 can measure the receive time using a Time Triggered Controller Area Network (TTCAN) module in the can controller 30. The reception time measurement unit 351 transfers the measured reception time to the reception time table 359. [

도 2a 및 도 6a 의 실시예와 같이 마이크로컨트롤러(40)가 수신 시간을 측정하는 방법을 사용하는 경우, 일반적인 마이크로컨트롤러(40)에서 용이하게 구현 가능하다는 장점이 존재하지만, 마이크로컨트롤러(40)의 성능에 따라 실제 메시지를 수신한 시점과 Rx 인터럽트 신호에 의해 측정된 수신 시간에 다소 차이가 존재할 수 있다. 이에 반해, 도 2b 및 도 6b 의 실시예와 같이 CAN 컨트롤러(30)에서 직접 수신 시간을 측정하는 경우, CAN 컨트롤러(30) 내부에 별도로 수신 시간 측정을 위한 모듈인 수신 시간 측정부(351)가 필요하지만, 마이크로컨트롤러(40)에 의존적이지 않으므로 부하 등에 영향을 받지 않고, Rx 인터럽트 신호에 의한 방식보다 측정 시간이 정확하다는 장점이 존재한다.2A and FIG. 6A, when the microcontroller 40 uses the method of measuring the reception time, there is an advantage that it can be easily implemented in a general microcontroller 40, Depending on the performance, there may be a slight difference in the reception time measured by the Rx interrupt signal and the point of time when the actual message is received. On the other hand, when the direct reception time is measured by the CAN controller 30 as in the embodiment of FIGS. 2B and 6B, a reception time measurement unit 351, which is a module for measuring reception time separately, is provided inside the CAN controller 30 However, since it is not dependent on the microcontroller 40, there is an advantage that the measurement time is more accurate than the method using the Rx interrupt signal without being affected by the load or the like.

본 발명의 일 실시예에 따르면, 도 2b 및 도 6b 의 실시예를 기본으로 하되, CAN 컨트롤러(30) 내부에 수신 시간 측정부(351)의 기능을 하는 모듈이 포함되어 있지 않은 경우에 도 2a 및 도 6a 의 실시예를 이용하여 수신 메시지의 수신 시간을 측정할 수 있다.According to an embodiment of the present invention, when the module functioning as the reception time measuring unit 351 is not included in the CAN controller 30 based on the embodiment of FIGS. 2B and 6B, And the receiving time of the received message can be measured using the embodiment of FIG. 6A.

도 7, 도 8a 및 도 8b 는 본 발명의 일 실시예에 따른 수신 데이터를 필터링하는 방법을 시계열적으로 나타낸 도면이다. 이하에서는, 본 발명의 일실시예에 따른 수신 메시지를 필터링하는 방법을 도 7, 도 8a 및 도 8b 을 참조하여 보다 구체적으로 설명한다.FIGS. 7, 8A and 8B are time-series views illustrating a method of filtering received data according to an embodiment of the present invention. Hereinafter, a method for filtering a received message according to an embodiment of the present invention will be described in more detail with reference to FIGS. 7, 8A and 8B.

먼저, 도 7 은 수신 시간 필터링으로 수신 메시지를 필터링하는 시계열적 단계들을 도시하고 있다. 보다 상세히, 먼저 CAN 컨트롤러(30)는 수신 메시지를 수신한다(S110). 다음으로, 수신 메시지를 수신한 후 CAN 컨트롤러(30)는 수신 시간 테이블에 수신 시간을 기록한다 (S120). 이때, 발명의 실시예에 따라 CAN 컨트롤러(30)는 마이크로컨트롤러(40)가 측정한 시간을 수신 메시지와 함께 획득하거나, 혹은 CAN 컨트롤러(30)가 직접 수신 메시지의 수신 시간을 측정한다. 또한, 수신 시간 테이블의 수신 시간 시프트 레지시터는 시프트되어, 가장 오래된 수신 시간은 버려지고, 현재 수신 시간이 최근 수신 시간으로 기록된다.First, FIG. 7 shows the steps in a time series for filtering received messages with receive time filtering. More specifically, the CAN controller 30 receives the reception message (S110). Next, after receiving the reception message, the CAN controller 30 records the reception time in the reception time table (S120). At this time, according to the embodiment of the present invention, the CAN controller 30 acquires the time measured by the microcontroller 40 together with the received message, or the CAN controller 30 directly measures the receiving time of the received message. Also, the reception time shift register of the reception time table is shifted, the oldest reception time is discarded, and the current reception time is recorded as the latest reception time.

또한, CAN 컨트롤러(30)는, 해당 메시지 ID의 수신필터의 수신 시간의 차이를 계산하고, 계산된 시간 차이 수신 시간 테이블의 기준 주기를 대비한다(S130). 바람직하게는, 1번째 수신 시간과 3번째 수신 시간의 차이(Δt)를 구하고, 구한 차이와 기준 주기(T)를 대비한다.Further, the CAN controller 30 calculates the difference in the reception time of the reception filter of the message ID and compares the calculated reference time of the time difference reception time table (S130). Preferably, the difference (? T) between the first reception time and the third reception time is obtained, and the obtained difference is compared with the reference period (T).

수신 시간 차이(Δt)가 기준 주기(T) 보다 작으면, 해당 수신 메시지는 차단된다(S160). CAN 통신 프로토콜에 의하여, 제어기가 데이터를 송신할 때 최소한 주기 시간 이내에 1회의 데이터를 송신하도록 규정하고 있다. 따라서 3번째 수신 시간과 1번째 수신 시간의 사이에는 주기 시간 보다 길어야 한다. 만약 1번째 수신 시간과 3번째 수신 시간의 차이가 주기 보다 작다면, 비정상 메시지가 중간에 끼어든 것으로 볼 수 있다. 즉, 1, 2, 3번째 메시지 중 적어도 1개는 비정상 메시지일 수 있다. 따라서 CAN 컨트롤러(30)는 비정상 메시지가 수신된 것으로 판단하여, 수신된 데이터를 차단하거나, 비정상 메시지가 탐지되었음을 경고한다.If the reception time difference? T is smaller than the reference period T, the reception message is blocked (S160). According to the CAN communication protocol, the controller is required to transmit data at least once within the cycle time when transmitting data. Therefore, the period between the third reception time and the first reception time must be longer than the cycle time. If the difference between the first reception time and the third reception time is less than the period, it can be considered that the abnormal message is interrupted in the middle. That is, at least one of the first, second, and third messages may be an abnormal message. Accordingly, the CAN controller 30 determines that an abnormal message has been received, blocks the received data, or warns that an abnormal message has been detected.

마지막으로, 수신 시간의 차이가 기준 주기 보다 큰 경우에는 수신 메시지를 수신버퍼로 전송한다(S150).Finally, when the difference in the reception time is larger than the reference period, the reception message is transmitted to the reception buffer (S150).

도 7 과 같이 수신 시간 필터링만을 이용하여 수신 메시지를 필터링하는 것은, 후술하는 도 8a 및 도 8b 의 실시예와 달리 CAN 네트워크에 존재하는 모든 CAN 메시지들을 수신 ID 필터링 없이 모두 수신 주기 기반으로 모니터링할 수 있으므로, 개별 제어기(10) 수준이 아닌 CAN 버스(50)에 연결되는 보안 게이트웨이에 적용될 수 있다.As shown in FIG. 7, unlike the embodiments of FIGS. 8A and 8B described later, all the CAN messages existing in the CAN network can be monitored based on the reception period without receiving ID filtering. So that it can be applied to a security gateway connected to the CAN bus 50 rather than the level of the individual controller 10.

다음으로, 도 8a 및 8b 는 수신 ID 필터링 및 수신 시간 필터링을 함께 수행하는 경우의 시계열적 방법을 도시한 도면이다.Next, Figs. 8A and 8B are views showing a time-series method when receiving ID filtering and reception time filtering are performed together.

도 8a 에서 보는 바와 같이, 먼저, CAN 컨트롤러(30)는 수신 메시지를 수신한다(S210).As shown in FIG. 8A, first, the CAN controller 30 receives a reception message (S210).

다음으로, CAN 컨트롤러(30)는 수신 메시지로부터 메시지 ID를 추출하여, ID 필터 테이블(358)에 매칭되는 수신 ID 필터가 있는지를 검색한다(S220). 메시지 ID는 수신 메시지의 CAN 헤더에 저장된 데이터로서, 메시지의 식별자에 대한 정보이다. 즉, 수신 메시지(200)의 CAN 헤더(210)로부터 메시지 ID를 추출한다. 그리고 추출된 메시지 ID와 매칭되는 수신 ID 필터를 검색한다.Next, the CAN controller 30 extracts the message ID from the received message and searches the ID filter table 358 for a matching ID filter (S220). The message ID is data stored in the CAN header of the received message, and is information on the identifier of the message. That is, the message ID is extracted from the CAN header 210 of the received message 200. And retrieves a received ID filter that matches the extracted message ID.

다음으로, 매칭된 수신 ID 필터가 ID 필터 테이블(358)에 존재하지 않으면, 해당 수신 메시지를 차단한다(S260). 즉, ID 필터 테이블(358)은 수신이 허용된 메시지 ID의 화이트 리스트이므로, 해당 화이트 리스트에 메시지 ID가 존재하지 않으면, 해당 수신 메시지는 허용된 메시지가 아니다. 따라서 수신 메시지는 차단된다.Next, if the matched reception ID filter is not present in the ID filter table 358, the reception message is blocked (S260). That is, the ID filter table 358 is a whitelist of the message IDs that are allowed to be received. Therefore, if the message ID does not exist in the corresponding white list, the received message is not an allowed message. Therefore, the received message is blocked.

한편, 수신 메시지를 수신한 후 CAN 컨트롤러(30)는 수신 시간 테이블에 수신 시간을 기록한다 (S230). 이하의 수신 시간 필터링과 관련하여 도 7 과 중복되는 설명은 생략하기로 한다.On the other hand, after receiving the reception message, the CAN controller 30 records the reception time in the reception time table (S230). Hereinafter, a description overlapping with FIG. 7 will be omitted in connection with the reception time filtering.

다음으로, CAN 컨트롤러(30)는, 해당 메시지 ID의 수신필터의 수신 시간의 차이를 계산하고, 계산된 시간 차이 수신 시간 테이블의 기준 주기를 대비한다(S240). 바람직하게는, 1번째 수신 시간과 3번째 수신 시간의 차이(Δt)를 구하고, 구한 차이와 기준 주기(T)를 대비한다. 수신 시간 차이(Δt)가 기준 주기(T) 보다 작으면, 해당 수신 메시지는 차단된다(S260).Next, the CAN controller 30 calculates the difference in the reception time of the reception filter of the message ID and compares the calculated reference time of the time difference reception time table (S240). Preferably, the difference (? T) between the first reception time and the third reception time is obtained, and the obtained difference is compared with the reference period (T). If the reception time difference? T is smaller than the reference period T, the reception message is blocked (S260).

마지막으로, 수신 메시지의 ID 와 매칭되는 수신 ID 필터가 ID 필터 테이블(358)에 존재하거나, 수신 시간의 차이가 기준 주기 보다 큰 경우에는 수신 메시지를 수신버퍼로 전송한다(S250). If the ID filter table 358 matches the ID of the received message or if the difference in the received time is greater than the reference period, the received message is transmitted to the receiving buffer in operation S250.

도 8b 는 본 발명의 다른 일 실시예에 따른 수신 데이터를 필터링하는 방법을 시계열적으로 나타낸 도면이다. 도 8 에서 보는 바와 같이, 먼저, CAN 컨트롤러(30)는 수신 메시지를 수신한다(S110).8B is a time-series diagram illustrating a method of filtering received data according to another embodiment of the present invention. As shown in FIG. 8, first, the CAN controller 30 receives a reception message (S110).

도 8b 를 참조하면, ID 필터링 단계(S320) 및 수신 시간 필터링 단계(S330 및 S340)는 도 8a 와 동일하지만, 도 8b 의 경우 매칭되는 수신 ID신 필터가 존재하는 경우에만 수신 시간 필터링이 수행된다는 점에서 차이점이 존재한다. 즉, 도 8b 는 도8a 의 변형예로써, ID 필터링 단계(S320)를 통과한 메시지들에 대해서만 수신 시간 필터링을 행하는 구성을 기재하고 있다.8B, the ID filtering step S320 and the reception time filtering steps S330 and S340 are the same as in FIG. 8A. However, in the case of FIG. 8B, the reception time filtering is performed only when there is a matching reception ID new filter There is a difference in point. That is, FIG. 8B is a modification of FIG. 8A, which illustrates a configuration in which reception time filtering is performed only on messages that have passed the ID filtering step S320.

이상에서는 CAN 컨트롤러(30)를 중심으로 본 발명을 설명하였다. 한편, 본 발명의 다른 실시예에서는, 상술한 명세서에서 설명된 CAN 컨트롤러(30)의 동작과 관련된 방법이 일 실시예으로서 구현될 수 있다. 즉, 본 발명의 다른 실시예에 따르면, 본 명세서에서 설명된 CAN 컨트롤러(30)의 동작들은 시계열적 단계를 가지는 방법으로서 구현될 수 있으며, 이때 방법의 수행 주체는 반드시 CAN 컨트롤러(30)가 아닐 수도 있다. 예를 들어, 도 4, 도 7 및 도 8a, 8b 에서 설명된 각 단계들을 수행하는 방법이 본 발명의 일 실시예가 될 수 있고, 이때 각 단계들을 수행하는 방법은 CAN 컨트롤러(30)가 아닌 다른 장치에 의해서도 수행될 수 있다.The present invention has been described above with the CAN controller 30 as the center. Meanwhile, in another embodiment of the present invention, a method related to the operation of the CAN controller 30 described in the above description can be implemented as an embodiment. In other words, according to another embodiment of the present invention, the operations of the CAN controller 30 described herein can be implemented as a method having a time series step, wherein the execution subject of the method is not necessarily the CAN controller 30 It is possible. For example, a method of performing the steps described in FIGS. 4, 7 and 8A and 8B may be an embodiment of the present invention. Device. &Lt; / RTI &gt;

이때, 본 발명의 다른 실시예에 따른 방법을 수행하는 주체는 제어기(10)에 내장된 프로세서일 수 있으며, 이때 프로세서에 저장된 명령들은 본 발명의 실시예에 따라 제어기(10) 및 CAN 컨트롤러(30)를 제어할 수 있으므로, 이 경우 자동차뿐만 아니라 건설 중장비, 농업 트랙터 등 CAN 통신을 사용하는 다양한 분야의 전자식 제어기에 적용 가능하다는 장점이 있다. 혹은 본 발명의 다른 실시예에 따른 방법을 수행하는 주체는 제어기(10)에 H/W 형태의 커넥터 타입으로 연결되는 보조 제어기일 수 있으며, 이 경우 보조 제어기를 제어기(10)에 연결하기만 하면 되므로 H/W 혹은 S/W 측면의 변경이 불필요하다는 장점이 존재한다. 혹은 본 발명의 다른 실시예에 따른 방법을 수행하는 주체는 CAN 컨트롤러(30) 내부에 내장되는 반도체 장치이고, 반도체 장치의 S/W 가 본 발명의 방법을 수행하도록 설계될 수 있다. 혹은 본 발명의 다른 실시예에 따른 방법을 수행하는 주체는 CAN 버스에 연결되는 보안 게이트웨이(gateway)일 수 있으며, 이 경우 보안 게이트웨이는 개별 제어기에 연결되지 않고 연결된 CAN 버스 네트워크의 모든 CAN 메시지들을 수신 주기 필터링으로 필터링할 수 있다.At this time, the subject performing the method according to another embodiment of the present invention may be a processor embedded in the controller 10, wherein the commands stored in the processor are transmitted to the controller 10 and the CAN controller 30 ), It is advantageous that it can be applied not only to automobiles but also to electronic controllers of various fields using CAN communication such as construction heavy equipment and agricultural tractor. Alternatively, the subject performing the method according to another embodiment of the present invention may be a sub-controller connected to the controller 10 in the form of a connector of the H / W type, in which case only by connecting the sub-controller to the controller 10 Therefore, there is an advantage that it is unnecessary to change the H / W or S / W aspect. Alternatively, the subject performing the method according to another embodiment of the present invention is a semiconductor device embedded in the CAN controller 30, and the S / W of the semiconductor device can be designed to perform the method of the present invention. Alternatively, the subject performing the method according to another embodiment of the present invention may be a security gateway connected to the CAN bus, in which case the security gateway receives all CAN messages of the connected CAN bus network It can be filtered by periodic filtering.

도 9 및 도 10 은 본 발명의 방법이 보조 제어기에 의해 수행되는 실시예를 설명하기 위한 도면이다.9 and 10 are views for explaining an embodiment in which the method of the present invention is performed by an auxiliary controller.

도 9 를 참조하면, 제어기(10)에는 보조 제어기(100)가 연결되어 있다. 보조 제어기(100)는 제어기(10)를 본 발명의 방법에 따라 제어하도록 하는 명령이 저장된 프로세서를 포함할 수 있다. 또한, 도 10 에 도시된 바와 같이, 보조 제어기(100)는 프로세서(130)를 포함할 수 있으며, 프로세서(130)는 필터값 설정부(133), 전송 필터부(132) 및 수신 필터부(135)를 포함할 수 있고, 이는 각각 도 2b 에 도시된 CAN 컨트롤러(30)의 필터값 설정부(33), 전송 필터부(32) 및 수신 필터부(35)와 동일한 역할을 수행할 수 있다. 보다 구체적인 예로서, 도 7 의 S120 단계(수신 메시지의 메시지 ID 와 매칭되는 ID 필터링 테이블을 검색)는, 도 9 및 도 10 의 실시예에서는 보조 제어기(10)의 수신 필터부(135)가 수신 메시지의 메시지 ID 와 매칭되는 ID 필터링 테이블을 검색하거나, 혹은 제어기(10)를 제어하여 상기 단계를 수행하도록 제어하는 것일 수 있다.Referring to FIG. 9, the controller 10 is connected to an auxiliary controller 100. The auxiliary controller 100 may include a processor for storing the instructions for controlling the controller 10 in accordance with the method of the present invention. 10, the auxiliary controller 100 may include a processor 130. The processor 130 may include a filter value setting unit 133, a transmission filter unit 132, and a reception filter unit And may perform the same functions as the filter value setting unit 33, the transmission filter unit 32, and the reception filter unit 35 of the CAN controller 30 shown in FIG. 2B, respectively . As a more specific example, in the embodiment of FIGS. 9 and 10, the reception filter unit 135 of the sub-controller 10 receives the reception ID of the received message in step S120 (retrieving the ID filtering table matched with the message ID of the received message) Retrieving an ID filtering table matching the message ID of the message, or controlling the controller 10 to perform the step.

본 발명의 명세서(특히 특허청구범위에서)에서 “상기”의 용어 및 이와 유사한 지시 용어의 사용은 단수 및 복수 모두에 해당하는 것일 수 있다. 또한, 본 발명에서 범위(range)를 기재한 경우 상기 범위에 속하는 개별적인 값을 적용한 발명을 포함하는 것으로서(이에 반하는 기재가 없다면), 발명의 상세한 설명에 상기 범위를 구성하는 각 개별적인 값을 기재한 것과 같다. 마지막으로, 본 발명에 따른 방법을 구성하는 단계들에 대하여 명백하게 순서를 기재하거나 반하는 기재가 없다면, 상기 단계들은 적당한 순서로 행해질 수 있다. 반드시 상기 단계들의 기재 순서에 따라 본 발명이 한정되는 것은 아니다. 본 발명에서 모든 예들 또는 예시적인 용어(예들 들어, 등등)의 사용은 단순히 본 발명을 상세히 설명하기 위한 것으로서 특허청구범위에 의해 한정되지 않는 이상 상기 예들 또는 예시적인 용어로 인해 본 발명의 범위가 한정되는 것은 아니다. 또한, 당업자는 다양한 수정, 조합 및 변경이 부가된 특허청구범위 또는 그 균등물의 범주 내에서 설계 조건 및 팩터에 따라 구성될 수 있음을 알 수 있다.The use of the terms &quot; above &quot; and similar indication words in the specification of the present invention (particularly in the claims) may refer to both singular and plural. In addition, in the present invention, when a range is described, it includes the invention to which the individual values belonging to the above range are applied (unless there is contradiction thereto), and each individual value constituting the above range is described in the detailed description of the invention The same. Finally, the steps may be performed in any suitable order, unless explicitly stated or contrary to the description of the steps constituting the method according to the invention. The present invention is not necessarily limited to the order of description of the above steps. The use of all examples or exemplary language (e.g., etc.) in this invention is for the purpose of describing the present invention only in detail and is not to be limited by the scope of the claims, It is not. It will also be appreciated by those skilled in the art that various modifications, combinations, and alterations may be made depending on design criteria and factors within the scope of the appended claims or equivalents thereof.

이상 설명된 본 발명에 따른 실시예는 다양한 컴퓨터 구성요소를 통하여 실행될 수 있는 프로그램 명령어의 형태로 구현되어 컴퓨터 판독 가능한 기록 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능한 기록 매체는 프로그램 명령어, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 컴퓨터 판독 가능한 기록 매체에 기록되는 프로그램 명령어는 본 발명을 위하여 특별히 설계되고 구성된 것이거나 컴퓨터 소프트웨어 분야의 당업자에게 공지되어 사용 가능한 것일 수 있다. 컴퓨터 판독 가능한 기록 매체의 예에는, 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체, CD-ROM 및 DVD와 같은 광기록 매체, 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical medium), 및 ROM, RAM, 플래시 메모리 등과 같은, 프로그램 명령어를 저장하고 실행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령어의 예에는, 컴파일러에 의하여 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용하여 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드도 포함된다. 하드웨어 장치는 본 발명에 따른 처리를 수행하기 위하여 하나 이상의 소프트웨어 모듈로 변경될 수 있으며, 그 역도 마찬가지이다.The embodiments of the present invention described above can be implemented in the form of program instructions that can be executed through various computer components and recorded in a computer-readable recording medium. The computer-readable recording medium may include program commands, data files, data structures, and the like, alone or in combination. The program instructions recorded on the computer-readable recording medium may be those specifically designed and configured for the present invention or may be those known and used by those skilled in the computer software arts. Examples of computer-readable media include magnetic media such as hard disks, floppy disks and magnetic tape, optical recording media such as CD-ROM and DVD, magneto-optical media such as floptical disks, medium, and hardware devices specifically configured to store and execute program instructions, such as ROM, RAM, flash memory, and the like. Examples of program instructions include machine language code, such as those generated by a compiler, as well as high-level language code that can be executed by a computer using an interpreter or the like. The hardware device may be modified into one or more software modules for performing the processing according to the present invention, and vice versa.

이상에서 본 발명이 구체적인 구성요소 등과 같은 특정 사항과 한정된 실시예 및 도면에 의하여 설명되었으나, 이는 본 발명의 보다 전반적인 이해를 돕기 위하여 제공된 것일 뿐, 본 발명이 상기 실시예에 한정되는 것은 아니며, 본 발명이 속하는 기술분야에서 통상적인 지식을 가진 자라면 이러한 기재로부터 다양한 수정과 변경을 꾀할 수 있다.While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed embodiments, but, on the contrary, Those skilled in the art will appreciate that various modifications and changes may be made thereto without departing from the scope of the present invention.

따라서, 본 발명의 사상은 상기 설명된 실시예에 국한되어 정해져서는 아니 되며, 후술하는 특허청구범위뿐만 아니라 이 특허청구범위와 균등한 또는 이로부터 등가적으로 변경된 모든 범위는 본 발명의 사상의 범주에 속한다고 할 것이다.Accordingly, the spirit of the present invention should not be construed as being limited to the above-described embodiments, and all ranges that are equivalent to or equivalent to the claims of the present invention as well as the claims .

10 : 제어기 20 : CAN 트랜시버
30 : CAN 컨트롤러 31 : 전송버퍼부
32 : 전송필터부 33 : 필터값 설정부
34 : 수신 시간 삽입부 35 : 수신필터부
36 : 수신버퍼부 38 : 보호메모리
40 : 마이크로컨트롤러
10: controller 20: CAN transceiver
30: CAN controller 31: transmission buffer section
32: transmission filter unit 33: filter value setting unit
34: reception time insertion section 35: reception filter section
36: Receive buffer unit 38: Protected memory
40: Microcontroller

Claims (7)

CAN 통신 기반 해킹공격 탐지 방법에 있어서,
수신 메시지의 수신 시간을 획득하는 단계;
동일한 메시지 ID 를 가지는 수신 메시지들의 수신 시간의 차이와, 대응하는 메시지 ID 의 기준 주기를 비교하는 주기 연산을 수행하는 수신 필터 단계;
상기 주기 연산의 결과, 상기 수신 시간의 차이가 상기 기준 주기보다 작은 경우 상기 수신 메시지를 비정상 메시지라 판단하고, 큰 경우 상기 수신 메시지가 정상 메시지라 판단하는 비정상 메시지 탐지 단계;
상기 비정상 메시지를 차단하는 차단 단계;
를 포함하는 CAN 통신 기반 해킹공격 탐지 방법.
In a CAN communication-based hacking attack detection method,
Obtaining a reception time of a received message;
A reception filter step for performing a periodic operation for comparing a difference in reception time of received messages having the same message ID with a reference period of a corresponding message ID;
An abnormal message detection step of determining that the received message is an abnormal message when the difference in the reception time is smaller than the reference period as a result of the periodic operation and determining that the received message is a normal message if the difference is larger than the reference period;
A blocking step of blocking the abnormal message;
A CAN communication based hacking attack detection method.
제 1 항에 있어서,
상기 수신 메시지의 수신 시간을 획득하는 단계는,
마이크로 컨트롤러가 인터럽트 신호를 발생시켜 측정한 수신 메시지의 수신 시간을 획득하거나, 혹은 CAN 컨트롤러가 내부 모듈을 이용하여 측정한 수신 메시지의 수신 시간을 획득하는, CAN 통신 기반 해킹공격 탐지 방법.
The method according to claim 1,
Wherein the step of acquiring the reception time of the reception message comprises:
A CAN communication based hacking attack detection method, wherein a microcontroller obtains a reception time of a received message measured by generating an interrupt signal or acquires a reception time of a reception message measured by a CAN controller using an internal module.
제 1 항에 있어서,
상기 수신 필터 단계는, 동일한 메시지 ID를 가지고 가장 최근에 수신한 적어도 3개의 수신 메시지의 수신 시간의 차이와, 해당 메시지 ID의 주기를 비교하며,
상기 가장 최근에 수신한 적어도 3개의 수신 메시지 중에서 첫번째 수신 시간과 3번째 수신 시간의 차이가 해당 메시지 ID의 기준 주기 보다 작으면, 상기 적어도 3개의 수신 메시지 중 적어도 1개의 수신 메시지를 비정상 메시지로 판단하는 것을 특징으로 하는, CAN 통신 기반 해킹공격 탐지 방법.
The method according to claim 1,
Wherein the reception filter step compares the difference between the reception times of the at least three received messages having the same message ID and the most recently received message with the cycle of the corresponding message ID,
If at least one of the at least three received messages is determined to be an abnormal message if the difference between the first received time and the third received time among the at least three received messages is smaller than the reference period of the corresponding message ID And detecting the CAN communication based hacking attack.
제 1 항에 있어서,
상기 주기 연산의 결과를 이용하여 탐지 점수 값을 보정하는 탐지 점수 학습부; 를 포함하고,
상기 탐지 점수 학습부는, 메시지가 수신될 때마다 상기 주기 연산을 수행하며, 상기 주기 연산의 결과, 상기 수신 시간의 차이가 상기 기준 주기보다 작은 경우 상기 탐지 점수를 기설정된 값만큼 증가시키고, 큰 경우 상기 탐지 점수를 기설정된 값만큼 감소시키며,
상기 차단 단계는 상기 탐지 점수가 일정 값 이상일 때 수신 메시지가 비정상 메시지라 판단하는, CAN 통신 기반 해킹공격 탐지 방법.
The method according to claim 1,
A detection point learning unit for correcting a detection point value using a result of the periodic operation; Lt; / RTI &gt;
The detection score learning unit performs the periodic operation every time a message is received and increases the detection score by a preset value when the difference of the reception time is smaller than the reference period as a result of the periodic operation, Decreasing the detection score by a predetermined value,
Wherein the blocking step determines that the received message is an abnormal message when the detection score is equal to or greater than a predetermined value.
제 4 항에 있어서,
상기 메시지 ID 의 기준 주기 및 학습된 탐지 점수 중 적어도 하나 이상은 보호 메모리에 저장되고, 상기 보호 메모리는 ROM(Read Only Memory) 또는, 플래시메모리의 비휘발성 메모리인 것을 특징으로 하는, CAN 통신 기반 해킹공격 탐지 방법.
5. The method of claim 4,
Wherein at least one of the reference period of the message ID and the learned detection score is stored in a protection memory, and the protection memory is a ROM (Read Only Memory) or a nonvolatile memory of a flash memory. Attack detection method.
CAN 컨트롤러 및 마이크로프로세서를 포함하는 CAN 통신 기반 비정상 메시지 탐지 시스템에 있어서,
수신 메시지의 수신 시간을 획득하는 수신 시간 측정부;
동일한 메시지 ID 를 가지는 수신 메시지들의 수신 시간의 차이와, 대응하는 메시지 ID 의 기준 주기를 비교하는 주기 연산을 수행하는 수신 필터부;
상기 주기 연산의 결과, 상기 수신 시간의 차이가 상기 기준 주기보다 작은 경우 상기 수신 메시지를 비정상 메시지라 판단하고, 큰 경우 상기 수신 메시지가 정상 메시지라 판단하는 비정상 메시지 탐지부;
를 포함하는 CAN 통신 기반 해킹공격 탐지 시스템.
A CAN communication-based abnormal message detection system including a CAN controller and a microprocessor,
A reception time measuring unit for obtaining a reception time of a received message;
A reception filter unit for performing a periodic operation for comparing a difference between reception times of reception messages having the same message ID and a reference period of a corresponding message ID;
An abnormal message detection unit for determining that the received message is an abnormal message if the difference in the reception time is smaller than the reference period as a result of the cyclic operation and determining that the received message is a normal message if the difference is larger than the reference period;
A CAN communication based hacking attack detection system.
제1 항 내지 제 5 항 따른 방법을 실현시키기 위해 컴퓨터 판독 가능한 기록 매체에 기록된 프로그램.A program recorded on a computer-readable recording medium for realizing the method according to any one of claims 1 to 5.
KR1020170076811A 2017-06-16 2017-06-16 Method and System for detecting hacking attack based on the CAN protocol KR101972457B1 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
KR1020170076811A KR101972457B1 (en) 2017-06-16 2017-06-16 Method and System for detecting hacking attack based on the CAN protocol
PCT/KR2018/006756 WO2018230988A1 (en) 2017-06-16 2018-06-15 Can communication based hacking attack detection method and system
US16/715,437 US11522878B2 (en) 2017-06-16 2019-12-16 Can communication based hacking attack detection method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020170076811A KR101972457B1 (en) 2017-06-16 2017-06-16 Method and System for detecting hacking attack based on the CAN protocol

Publications (2)

Publication Number Publication Date
KR20180137306A true KR20180137306A (en) 2018-12-27
KR101972457B1 KR101972457B1 (en) 2019-04-25

Family

ID=64953137

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170076811A KR101972457B1 (en) 2017-06-16 2017-06-16 Method and System for detecting hacking attack based on the CAN protocol

Country Status (1)

Country Link
KR (1) KR101972457B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102248287B1 (en) * 2019-12-23 2021-05-06 고려대학교 산학협력단 Device and method for estimating a node of vehicle network
KR102469399B1 (en) * 2021-09-10 2022-11-21 숭실대학교산학협력단 Attack detection system of can network, attack detection method of can network and computer program stored in a recording medium to execute the method

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20220046881A (en) 2020-10-08 2022-04-15 현대자동차주식회사 A scheduling method for communication message
KR102391791B1 (en) 2021-12-24 2022-04-28 쌍용자동차 주식회사 Active vehicle cyber hacking countermeasure apparatus and method
KR102411797B1 (en) 2021-12-24 2022-06-22 쌍용자동차 주식회사 Hardware-based vehicle cyber security system

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050066062A1 (en) * 2001-09-13 2005-03-24 Florian Hartwich Method and device for determining time in a bus system and corresponding bus system
KR20110057348A (en) 2009-11-24 2011-06-01 한국전자통신연구원 Can communication security apparatus and can communication security method
JP2013168865A (en) * 2012-02-16 2013-08-29 Hitachi Automotive Systems Ltd In-vehicle network system
KR101413427B1 (en) 2012-12-18 2014-07-01 주식회사 유라코퍼레이션 Apparatas and method for security message transmission and reception of vehicle network
JP5609363B2 (en) * 2010-07-21 2014-10-22 トヨタ自動車株式会社 Architecture for self-healing computer systems
KR101472896B1 (en) 2013-12-13 2014-12-16 현대자동차주식회사 Method and apparatus for enhancing security in in-vehicle communication network
US20150358351A1 (en) * 2013-01-28 2015-12-10 Hitachi Automotive Systems, Ltd. Network device, and data sending and receiving system
KR20160093764A (en) 2015-01-29 2016-08-09 주식회사 아나스타시스 Secure communication system of ecu utilizing otp rom
KR101651648B1 (en) 2016-04-28 2016-08-29 인포뱅크 주식회사 Data communication method for vehicle, Electronic Control Unit and system thereof
KR101714520B1 (en) * 2015-10-30 2017-03-09 현대자동차주식회사 In-Vehicle Network Attack Detection Method and Apparatus
JP2017085663A (en) * 2015-10-09 2017-05-18 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America Security device, attack detection method and program

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050066062A1 (en) * 2001-09-13 2005-03-24 Florian Hartwich Method and device for determining time in a bus system and corresponding bus system
KR20110057348A (en) 2009-11-24 2011-06-01 한국전자통신연구원 Can communication security apparatus and can communication security method
JP5609363B2 (en) * 2010-07-21 2014-10-22 トヨタ自動車株式会社 Architecture for self-healing computer systems
JP2013168865A (en) * 2012-02-16 2013-08-29 Hitachi Automotive Systems Ltd In-vehicle network system
KR101413427B1 (en) 2012-12-18 2014-07-01 주식회사 유라코퍼레이션 Apparatas and method for security message transmission and reception of vehicle network
US20150358351A1 (en) * 2013-01-28 2015-12-10 Hitachi Automotive Systems, Ltd. Network device, and data sending and receiving system
KR101472896B1 (en) 2013-12-13 2014-12-16 현대자동차주식회사 Method and apparatus for enhancing security in in-vehicle communication network
KR20160093764A (en) 2015-01-29 2016-08-09 주식회사 아나스타시스 Secure communication system of ecu utilizing otp rom
JP2017085663A (en) * 2015-10-09 2017-05-18 パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America Security device, attack detection method and program
KR101714520B1 (en) * 2015-10-30 2017-03-09 현대자동차주식회사 In-Vehicle Network Attack Detection Method and Apparatus
KR101651648B1 (en) 2016-04-28 2016-08-29 인포뱅크 주식회사 Data communication method for vehicle, Electronic Control Unit and system thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Techincal communications. CAN, Automotive Diagnostic Command Set User Manual. National Intruments, 2009.12. 페이지 1-1 - 6-140 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102248287B1 (en) * 2019-12-23 2021-05-06 고려대학교 산학협력단 Device and method for estimating a node of vehicle network
KR102469399B1 (en) * 2021-09-10 2022-11-21 숭실대학교산학협력단 Attack detection system of can network, attack detection method of can network and computer program stored in a recording medium to execute the method

Also Published As

Publication number Publication date
KR101972457B1 (en) 2019-04-25

Similar Documents

Publication Publication Date Title
KR101972457B1 (en) Method and System for detecting hacking attack based on the CAN protocol
US11985150B2 (en) Cybersecurity on a controller area network in a vehicle
US11522878B2 (en) Can communication based hacking attack detection method and system
US11063970B2 (en) Attack detection method, attack detection device and bus system for a motor vehicle
US10764326B2 (en) Can controller safe against can-communication-based hacking attack
Jo et al. A survey of attacks on controller area networks and corresponding countermeasures
Jo et al. Mauth-can: Masquerade-attack-proof authentication for in-vehicle networks
US9866570B2 (en) On-vehicle communication system
KR102524204B1 (en) Apparatus and method for intrusion response in vehicle network
JP7071510B2 (en) Systems and methods that provide security to the in-vehicle network
JP2022125099A (en) Fraud detection server and method
KR101966345B1 (en) Method and System for detecting bypass hacking attacks based on the CAN protocol
Boudguiga et al. A simple intrusion detection method for controller area network
Otsuka et al. CAN security: Cost-effective intrusion detection for real-time control systems
JP2014236248A (en) Electronic control device and electronic control system
US20200014758A1 (en) On-board communication device, computer program, and message determination method
Studnia et al. Security of embedded automotive networks: state of the art and a research proposal
US20220182404A1 (en) Intrusion path analysis device and intrusion path analysis method
Souma et al. Counter attacks for bus-off attacks
KR101825711B1 (en) A CAN controller secured from hacking attack based on the CAN protocol
Kim et al. Shadowauth: Backward-compatible automatic can authentication for legacy ecus
KR101995903B1 (en) Device for verifying status and detecting anomaly of vehicle and system having the same
EP3729739B1 (en) Message authentication based on a physical location on a bus
Carsten et al. A system to recognize intruders in controller area network (can)
KR20180039586A (en) A CAN controller secured from hacking attack based on the CAN protocol

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E90F Notification of reason for final refusal
E701 Decision to grant or registration of patent right