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 PDFInfo
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40052—High-speed IEEE 1394 serial bus
- H04L12/40104—Security; Encryption; Content protection
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40052—High-speed IEEE 1394 serial bus
- H04L12/40058—Isochronous transmission
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/14—Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
- H04L63/1408—Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
- H04L63/1416—Event detection, e.g. attack signature detection
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40215—Controller Area Network CAN
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40267—Bus for use in transportation systems
- H04L2012/40273—Bus 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
Description
본 발명은 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.
본 발명의 목적은 상술한 바와 같은 문제점을 해결하기 위한 것으로, 동일 메시지 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 버스(50)는 데이터 전송을 위한 통신 라인으로서, 바람직하게는, 연선(Twisted pair wire)으로 구성된다. 이때, 연선을 구성하는 2개의 선은 서로 다른 신호(CAN_H, CAN_L)에 의해 구동된다. CAN 버스(50)상의 전송 속도는 버스의 길이에 따라 달라질 수 있다.The
또한, CAN 버스(50)는 송신 라인(Tx)과 수신 라인(Rx)으로 구분되고, 각 제어기(10)는 송신 라인(Tx)으로 메시지를 전송하고 수신 라인(Rx)으로부터 메시지를 수신한다. 특히, 모든 제어기(10)는 CAN 버스(50)의 공통 송수신 라인(Tx, Rx)에 연결되어, 메시지를 송수신한다.Further, the
다수의 제어기(ECU, Electronic Control Unit)(10) 또는 제1 내지 제N 제어기(10)는 CAN 버스(50)에 소정의 CAN 커넥터를 통해 연결될 수 있으며, 이론적으로 하나의 CAN 네트워크에 연결될 수 있는 최대 제어기의 개수는 2032이다.A plurality of controllers (ECUs) 10 or first to
제어기(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
반면, 후자의 제어기들은 주로 종래 전형적인 제어기로서, 차량 내부 시스템을 제어하기 위한 제어기들이다. 예를 들어, 엔진, 트랜스미션 등 파워트레인에 관련된 제어기들; 제동장치, 조향장치, 에어백 등 샤시에 관련된 제어기들; 클러스터, 도어, 윈도우 등 바디에 관련된 제어기들이다. 통상 이들을 각각 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
CAN 컨트롤러(controller)(30)는 CAN 프로토콜 메시지를 송수신하고 수신된 메시지에 대한 메시지 필터링 기능을 수행한다. 또한, CAN 컨트롤러(30)는 재전송 제어를 위한 메시지 버퍼 및 마이크로컨트롤러(40)와의 인터페이스 기능을 제공한다.The
마이크로컨트롤러(40)는 CPU가 탑재될 수 있으며, 상위 계층 프로토콜을 제공하고 다양한 응용들을 제공할 수 있다.The
도 2 a 및 도 2b 는 본 발명의 일 실시예에 따른 CAN 컨트롤러(30)의 내부 구성을 나타낸 블럭도이다.2A and 2B are block diagrams illustrating an internal configuration of the
도 2a 와 도 2b 의 실시예는 모두 CAN 컨트롤러(30)의 내부 구성을 나타내기 위한 도면으로서, 수신 메시지를 측정하는 구성에 대해서만 차이점이 존재한다. 따라서, 도 2a 및 도 2b 의 설명에서 반복되는 설명은 생략하기로 한다.The embodiments of FIGS. 2A and 2B are diagrams for illustrating the internal configuration of the
도 2a 에서 보는 바와 같이, 본 발명에 따른 CAN 컨트롤러(30)는 전송할 데이터를 임시로 저장하는 전송버퍼부(31), 전송데이터를 필터링하는 전송필터부(32), 필터링 값을 설정하는 필터값 설정부(33), 수신 메시지를 필터링하는 수신 필터부(35), 및, 수신 메시지를 임시로 저장하는 수신버퍼부(36)로 구성된다. 또한, 추가적으로 필터값을 저장하는 보호메모리(38)를 더 포함하여 구성된다.2A, the
본 발명의 일 실시예에 따르면, 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
전송버퍼부(31)는 버퍼를 구비하여 전송할 데이터를 버퍼에 임시로 저장한다. 특히, 마이크로컨트롤러(40)는 전송할 데이터(또는 전송 데이터)를 전송버퍼부(31)의 버퍼에 저장한다.The
도 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 헤더(210) 부분에는 메시지 ID(ID)(211) 필드가 있고, 해당 필드에는 해당 메시지의 ID가 기록된다. 메시지 ID(ID)는 메시지의 식별자로서, 메시지의 종류를 나타낸다. 예를 들어, 엔진의 RPM을 전송하는 메시지는 주기적으로 전송되는데, 이때, RPM 전송 메시지는 동일한 메시지 ID(ID)를 갖는다. 즉, 메시지를 수신하는 제어기(10)는 메시지 ID(ID)를 통해 해당 메시지가 어떤 데이터를 가지고 있는지를 확인한다.In the
전송버퍼부(31)는 상기와 같이 헤더(210)와 페이로드(220)로 구성된 전송데이터를 순차적으로 버퍼에 저장하고, 마이크로컨트롤러(40)에 의해 수신된 순서로 저장하였다가 수신된 순서대로 CAN 트랜시버(20)를 통해 전송한다.The
다음으로, 전송필터부(32)는 전송데이터 내의 메시지 ID(211)를 필터링하여, 필터값에 포함된 메시지 ID를 가지는 전송데이터만 전송하게 한다. 즉, 전송필터부(32)는 전송이 허가된 메시지 ID에 대한 화이트 리스트(white list)를 보유하고, 상기 화이트 리스트 내의 메시지 ID를 가지는 전송데이터만 전송한다. Next, the
즉, 전송필터부(32)는 전송데이터의 메시지ID를 화이트 리스트와 대비하여 필터링을 수행한다.That is, the
다음으로, 필터값 설정부(33)는 전송필터부(32)의 필터값, 즉, 화이트 리스트를 설정한다. 필터값을 설정하는 모드는 2가지 모드로 구성되며, 하나는 보호기능 모드이고, 다른 하나의 모드는 관리자 모드(또는 테스트 모드)이다.Next, the filter
관리자 모드인 경우, 필터값 설정부(33)는 마이크로컨트롤러(40)에 의한 직접 지시에 의하여, 필터값 또는 화이트 리스트를 설정한다. 즉, 필터값 설정부(33)는 허용되는 메시지ID 리스트(또는 화이트 리스트)를 마이크로컨트롤러(40)로부터 수신받아, 수신받은 메시지 ID들을 전송필터부(32)의 필터값으로 설정한다.In the manager mode, the filter
보호기능 모드인 경우, 필터값 설정부(33)는 보호메모리(38)에 저장된 메시지ID 리스트 또는 화이트 리스트를 가져와서 전송필터부(32)의 필터값으로 설정한다. 바람직하게는, CAN 컨트롤러(30)가 전원이 온(On)되어 처음 시작하면(또는 부팅하면), 필터값 설정부(33)는 보호메모리(38)에 저장된 화이트 리스트를 가져와서 필터값으로 설정한다. 또한, 필터값 설정부(33)는 초기에 필터값이 한번 설정되면, 마이크로컨트롤러(40) 등의 명령에 의해 구동 중간에는 필터값을 변경하지 않는다.In the protection function mode, the filter
따라서 초기 구동이 될 때에만 보호메모리(38)에서 가져와서 필터값이 설정되므로, 중간에 악의적인 공격자에 의해 제어기(10)가 해킹되더라도 필터값이 변경되지 않는다. Therefore, since the filter value is set to be taken from the
또한, 필터값 설정부(33)는 수신 필터부(35)의 필터값, 즉, 화이트 리스트를 설정할 수 있다. 앞서 전송필터부(32)의 화이트 리스트를 제1 화이트 리스트라 부르기로 하고, 수신 필터부(35)의 화이트 리스트를 제2 화이트 리스트라 부르기로 한다. 제2 화이트 리스트는 제1 화이트 리스트와 마찬가지로, 수신이 허용된 메시지 ID를 리스트로 가지고 있다.The filter
필터값 설정부(33)는 제2 화이트 리스트를 보호메모리(38) 또는 마이크로컨트롤러(40)로부터 가져와서, 수신 필터부(35)의 필터링 값으로 설정한다. 또한, 보호기능 모드인 경우, 수신 필터부(35)의 필터값은 초기에 한번 설정되고, 구동 중간에는 변경되지 않는다.The filter
또한, 필터값 설정부(33)는 수신 메시지 ID 각각에 대한 기준 주기를 수신 필터부(35)의 수신 시간 테이블의 주기로 설정한다. 이때 설정되는 기준 주기는 각 메시지 ID에 해당하는 메시지가 전송되는 주기로서, 적합한 권한을 가진 전송자에 의해 전송될 때 수신 메시지들은 기준 주기 간격으로 수신될 수 있다. 바람직하게는, 기준 주기는 초기에 한번 설정되고, 구동 중간에는 변경되지 않으며, 필터값 설정부(33)는 보호 메모리(38)로부터 메시지 ID 각각에 대응하는 기준 주기를 획득할 수 있다.The filter
다음으로, 보호메모리(38)는 ROM(Read Only Memory), 플래시메모리 등 비휘발성 메모리로서, 필터값 또는 메시지ID 리스트를 저장한다.Next, the
보호메모리(38)는 필터값 설정부(33)에 대하여 읽기 기능만 허용된 메모리이다. 즉, 필터값 설정부(33) 또는 마이크로컨트롤러(40)는 보호메모리(38)를 직접 접근하여 데이터를 변경하거나 삭제할 수 없다.The
바람직하게는, 보호메모리(38)는 통상의 비휘발성 메모리로 구성되며, 그 일부의 메모리 공간을 보호영역으로 구분하여 지정될 수 있다. 이 경우, 보호 영역의 메모리에 저장된 데이터만 읽기 기능이 허용되고, 보호 영역 외의 다른 영역에는 데이터를 변경하거나 삭제가 가능하다.Preferably, the
보호 메모리 또는, 보호된 메모리 영역(보호영역)은 일반적인 비휘발성 메모리(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
또한, 바람직하게는, 보호메모리(38)에는 수신용 CAN ID 각각에 대한 기준 주기 및 후술할 학습된 탐지 점수에 대한 정보도 함께 기록된다.Further, preferably, the
다음으로, 수신 시간 측정부(41)는 CAN 트랜시버(20)로부터 수신된 데이터(이하의 본 명세서에서, 수신 메시지)의 수신 시간을 측정한다. 도 2a 의 실시에에서, 수신 시간 측정부(41)는 마이크로컨트롤러(40)가 발생시킨 Rx 인터럽트 신호를 수신하여 수신 메시지의 수신 시간을 측정할 수 있다. 이때, 수신 시간 측정부(41)는 마이크로 프로세서 내부의 타이머 혹은 클럭 신호에 기초하여 수신 시간을 측정할 수 있으며, 측정된 수신 시간을 수신 필터부(35)로 전달한다.Next, the reception
다음으로, 수신 필터부(35)는 수신 메시지의 메시지 ID에 대하여 필터링을 수행하여, 허용된 메시지 ID 를 갖는 수신 메시지만을 수신버퍼부(36)로 전송하여 버퍼링한다. 구체적으로, 수신 필터부(35)는 수신 메시지 내의 메시지 ID(211)를 필터링하여, 필터값에 포함된 메시지 ID를 가지는 수신 메시지만 수신하게 한다. 즉, 수신 필터부(35)는 수신이 허가된 메시지 ID에 대한 제2 화이트 리스트(white list)를 보유하고, 상기 제2 화이트 리스트 내의 메시지 ID를 가지는 수신 메시지만 수신한다. 즉, 수신 필터부(35)는 수신 메시지의 메시지ID를 제2 화이트 리스트와 대비하여 필터링을 수행한다.Next, the
또한, 수신 필터부(35)는 동일한 메시지 ID 를 가지는 수신 메시지들의 수신 시간의 차이와, 대응하는 메시지 ID 의 기준 주기를 비교하는 주기 연산을 수행하여 비정상 메시지 여부를 판단하고, 정상 메시지만을 수신 버퍼부(36)로 전송하여 버퍼링한다. 보다 상세히, 수신 필터부(35)는 수신 메시지에 삽입된 수신 시간을 각 메시지 ID 별로 수신 시간 테이블에 기록한다. 바람직하게는, 연속적으로 수신되는 적어도 3개의 수신 메시지의 수신 시간을 모두 기록하고, 기록된 수신 메시지들의 수신 시간의 차이와 기준 주기를 비교하여, 정상 메시지인지 여부를 판단한다. 이때, 연속적인 3개의 수신 시간은 동일한 메시지 ID를 가지는 수신 메시지의 수신 시간들이다.In addition, the
본 명세서에서 업급된 수신 메시지들의 수신 주기는 반드시 바로 인접한 수신 메시지들 간의 시간 간격이 아닐 수 있다. 예를 들어, 본 발명의 수신 메시지들의 수신 시간의 차이는 연속적인 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
수신 필터부(35)가 ID 필터링 또는 수신 시간 주기 분석을 통해 비정상 메시지를 탐지하는 구체적인 구성에 대해서는 하기의 도 6a 및 도 6b 에서 보다 상세히 살펴보기로 한다.A specific configuration in which the
다음으로, 수신버퍼부(36)는 수신 메시지를 수신 버퍼에 저장한다. 앞서 수신 필터부(35)에 의해 필터링된 수신 메시지만을 수신 버퍼에 저장한다. 수신버퍼부(36)에 저장된 수신 메시지는 마이크로컨트롤러(40)로 전달된다.Next, the
한편, 도 2b 는 CAN 컨트롤러(30)에서 자체적으로 수신 메시지의 수신 시간을 측정하는 경우의 제어기(10)의 구성을 나타내고 있다.On the other hand, FIG. 2B shows the configuration of the
도 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
또한, 도 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
도 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
보호기능 모드가 활성화된 상태이면, 보호메모리(38) 또는 보호메모리(38) 내의 보호 영역에 저장된 화이트 리스트를 가져와서, 전송 필터값 또는 수신 필터값으로 설정한다(S20). 화이트 리스트는 전송 또는 수신이 허용되는 메시지 ID(ID)들의 목록이다. 바람직하게는, 화이트 리스트는 전송 필터용과 수신 필터용으로 따로 구분되고, 전송 필터값과 수신 필터값은 서로 구분되어 설정된다.If the protection function mode is activated, the white list stored in the protection area in the
만약, 보호기능 모드가 활성화되지 않으면, 관리자 모드 또는 테스트 모드로서, 전송 필터값 또는 수신 필터값이 마이크로컨트롤러(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
도 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
즉, 전송 레지스터(321)에는 전송버퍼부(31)로부터 가져온 전송데이터가 임시로 저장된다. 또한, 전송필터(322)는 다수의 필터값, 또는, 화이트 리스트가 저장되고, 다중화기(323)에 의해 하나의 필터값만 선택된다. 비교기(324)는 전송 레지스터(321)의 전송데이터 중 메시지 ID와 필터값을 대비하여 필터링을 수행한다. 비교기(324)의 결과는 전송 레지스터(321)를 제어하여, CAN 트랜시버(20)로 전송하게 하거나, 차단하도록 제어한다.That is, in the
특히, 전송필터(322)는 앞서 초기화 할 때 설정되며, 필터값들은 전송할 수 있는 유효한 메시지 ID들이다. 따라서 비교기(324)에 의해, 적어도 동일한 결과가 나오는 경우에만, 전송 레지스터(321)의 전송 데이터가 CAN 트랜시버(20)로 전송하게 한다. 따라서 전송필터(322)의 어느 필터값과도 동일하다는 결과 나오지 않으면, 전송 데이터가 CAN 트랜시버(20)로 전송되지 않는다. 즉, 유효하지 않은 메시지 ID를 가지므로, 해당 전송데이터는 차단된다.In particular, the
도 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
도 6a 에서 보는 바와 같이, 수신 필터부(35)는 수신 시간의 차이 및 주기를 대비하는 주기연산 회로부(352), 수신필터 및 주기연산 결과를 이용하여 비정상 메시지 여부를 탐지하는 비정상 메시지 탐지부(353), 주기 연산 결과에 학습 알고리즘을 적용하는 탐지 점수 학습부(354), 수신이 허용된 ID 를 기록하는 ID 필터 테이블(358) 및 수신 시간을 기록하는 수신 시간 테이블(359)을 포함하여 구성된다. 구체적으로, ID 필터 테이블(358)은 수신이 허용된 수신 ID 필터를 기록하는 저장공간으로 구성되고, 수신 시간 테이블(359)는 메시지 ID, 기준 주기, 수신 시간을 기록하는 저장공간으로 구성된다. 바람직하게는, ID 필터 테이블(358) 및 수신 시간 테이블(359)은 2차원 레지스터 또는 메모리, 캐시 등으로 구성될 수 있다.As shown in FIG. 6A, the
먼저, 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
또한, 수신 시간 테이블(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
이때, 수신 시간은 적어도 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
본 발명의 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
보다 상세히, 주기 연산 회로부(352)는 특정 CAN ID 에 대해 3개의 메시지가 순차적으로 수신되었을 때 수신된 순서에 따라 수신 시간을 T1, T2, T3(T3가 가장 최근에 수신된 메시지의 수신 시간)이라 설정하고, [T3-T1] 의 값을 연산할 수 있다. 또한, 주기 연산 회로부(352)는 [T3-T1 < 해당 CAN ID에대한 기설정된 주기] 인지 여부를 판단할 수 있으며, 해당 수학식을 만족시키는 경우 주기 연산 결과가 차단 조건을 만족하였다고 볼 수 있다.More specifically, the periodic
다음으로, 비정상 메시지 탐지부(353)는 수신된 데이터의 메시지 ID를 추출하고, 추출된 메시지 ID가 수신 시간 테이블(359)에 존재하는지를 검색한다. 비정상 메시지 탐지부(353)는 추출된 메시지 ID가 수신 시간 테이블(359)에 존재하지 않으면, 수신 메시지를 차단한다.Next, the abnormal
또한, 비정상메시지 탐지부(353)는 주기연산 회로부(352)의 연산결과에 따라 수신 메시지를 수신버퍼부(36)에 전송하거나 차단한다. 즉, 주기연산 회로부(352)의 수신 메시지들의 수신 시간의 차이가 기준 주기보다 작은 것으로 나오는 경우, 수신 메시지를 차단한다. 그리고 작지 않은 것으로 결과가 나오면, 수신 메시지를 수신버퍼부(36)로 전송한다.The abnormal
일 실시예에서, [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
한편, 본 발명의 다른 일 실시예에서는, 비정상 메시지 탐지부(353)는 추출된 메시지 ID가 수신 시간 테이블(359)에 수신 ID 필터로서 존재하는 경우에만, 해당 메시지에 대해 수신 시간으로 필터링을 수행하도록 주기연산 회로부(352)를 제어할 수 있다. 즉, 비정상 메시지 탐지부(353)는 수신 메시지가 ID 필터링을 통과한 경우에만 주기 연산 회로부(352)에 의한 수신 시간 필터링이 이루어지도록 제어할 수 있다.On the other hand, in another embodiment of the present invention, the abnormal
또한, 본 발명의 일 실시예에 따르면, CAN 컨트롤러(30)는 탐지 점수 학습부(354)를 추가적으로 포함할 수 있다. 탐지 점수 학습부(354)는 주기 연산 회로부(352)의 주기 연산 결과에 추가적으로 탐지 학습 알고리즘을 적용할 수 있다.Also, according to an embodiment of the present invention, the
이와 관련하여, 상술한 바와 같은 주기 연산 회로부(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
보다 상세히, 탐지 점수 학습부(354)는 주기 연산 회로부(352)의 주기 연산 결과가 차단 조건을 만족시킬 때마다, 해당 CAN ID 에 대한 탐지 점수를 기설정된 값만큼 증가시킨다. 만족시키지 않는 경우, 해당 CAN ID 에 대한 탐지 점수를 기설정된 값만큼 감소시킨다. 이와 같은 방법으로 메시지를 수신할 때마다 탐지 점수가 조정될 수 있으며, 탐지 점수가 기설정된 값 이상이 되는 경우 확정적으로 비정상 메시지가 수신된 것으로 판단할 수 있다.More specifically, the detection
비정상 메시지가 수신된 것으로 판단되면, 비정상 메시지 탐지부(353)는 해당 CAN ID 에 대한 수신을 차단하고, 일정 기간 동안 혹은 영구히 해당 CAN ID 의 메시지를 수신하지 않거나, 고장 상태에서 최소한의 기능만을 동작하도록 설계된(예를 들어, 림프홈 모드) 특정 상태로 동작하게 할 수 있다.If it is determined that the abnormal message has been received, the abnormal
한편, 탐지 점수 학습부(354)가 산출한 탐지 점수는 비휘발성 메모리에 저장될 수 있다. 이는, 제어기(10)자체의 문제로 인해 제어기(10)가 리셋되더라도 학습된 탐지 점수가 사라지지 않고 반영되도록 하기 위함이다. 특히, 탐지 점수가 저장되는 비휘발성 메모리 영역은 보호 메모리(38) 영역일 수 있다.On the other hand, the detection score calculated by the detection
또한, 도 6b 의 실시예는 도 2b 의 실시예에 계속하여, CAN 컨트롤러(30)가 직접 수신 시간을 측정하는 경우의 수신 필터부(35)의 내부 구성을 나타낸 도면이다.6B is a diagram showing the internal configuration of the
도 6b 에 도시된 바와 같이, CAN 컨트롤러(30)는 수신 시간 측정부(351)를 포함하며 수신 메시지의 수신 시간을 직접 측정하고, 이로부터 수신 시간 테이블(359)에 기록할 수 있다. 본 발명의 일 실시예에서, 수신 시간 삽입부(34)는 타임 트리거링(Time Triggering) 방식을 이용하여 수신 시간을 측정할 수 있다. 구체적인 일 실시예에서, 수신 필터부(35)는 캔 컨트롤러(30) 내의 TTCAN(Time Triggered Controller Area Network) 모듈을 이용하여 수신 시간을 측정할 수 있다. 수신 시간 측정부(351)는 측정된 수신 시간을 수신 시간 테이블(359)에 전달한다.As shown in FIG. 6B, the
도 2a 및 도 6a 의 실시예와 같이 마이크로컨트롤러(40)가 수신 시간을 측정하는 방법을 사용하는 경우, 일반적인 마이크로컨트롤러(40)에서 용이하게 구현 가능하다는 장점이 존재하지만, 마이크로컨트롤러(40)의 성능에 따라 실제 메시지를 수신한 시점과 Rx 인터럽트 신호에 의해 측정된 수신 시간에 다소 차이가 존재할 수 있다. 이에 반해, 도 2b 및 도 6b 의 실시예와 같이 CAN 컨트롤러(30)에서 직접 수신 시간을 측정하는 경우, CAN 컨트롤러(30) 내부에 별도로 수신 시간 측정을 위한 모듈인 수신 시간 측정부(351)가 필요하지만, 마이크로컨트롤러(40)에 의존적이지 않으므로 부하 등에 영향을 받지 않고, Rx 인터럽트 신호에 의한 방식보다 측정 시간이 정확하다는 장점이 존재한다.2A and FIG. 6A, when the
본 발명의 일 실시예에 따르면, 도 2b 및 도 6b 의 실시예를 기본으로 하되, CAN 컨트롤러(30) 내부에 수신 시간 측정부(351)의 기능을 하는 모듈이 포함되어 있지 않은 경우에 도 2a 및 도 6a 의 실시예를 이용하여 수신 메시지의 수신 시간을 측정할 수 있다.According to an embodiment of the present invention, when the module functioning as the reception
도 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 컨트롤러(30)는, 해당 메시지 ID의 수신필터의 수신 시간의 차이를 계산하고, 계산된 시간 차이 수신 시간 테이블의 기준 주기를 대비한다(S130). 바람직하게는, 1번째 수신 시간과 3번째 수신 시간의 차이(Δt)를 구하고, 구한 차이와 기준 주기(T)를 대비한다.Further, the
수신 시간 차이(Δ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
마지막으로, 수신 시간의 차이가 기준 주기 보다 큰 경우에는 수신 메시지를 수신버퍼로 전송한다(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
다음으로, 도 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 컨트롤러(30)는 수신 메시지로부터 메시지 ID를 추출하여, ID 필터 테이블(358)에 매칭되는 수신 ID 필터가 있는지를 검색한다(S220). 메시지 ID는 수신 메시지의 CAN 헤더에 저장된 데이터로서, 메시지의 식별자에 대한 정보이다. 즉, 수신 메시지(200)의 CAN 헤더(210)로부터 메시지 ID를 추출한다. 그리고 추출된 메시지 ID와 매칭되는 수신 ID 필터를 검색한다.Next, the
다음으로, 매칭된 수신 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 컨트롤러(30)는, 해당 메시지 ID의 수신필터의 수신 시간의 차이를 계산하고, 계산된 시간 차이 수신 시간 테이블의 기준 주기를 대비한다(S240). 바람직하게는, 1번째 수신 시간과 3번째 수신 시간의 차이(Δt)를 구하고, 구한 차이와 기준 주기(T)를 대비한다. 수신 시간 차이(Δt)가 기준 주기(T) 보다 작으면, 해당 수신 메시지는 차단된다(S260).Next, the
마지막으로, 수신 메시지의 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
도 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
이때, 본 발명의 다른 실시예에 따른 방법을 수행하는 주체는 제어기(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
도 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
본 발명의 명세서(특히 특허청구범위에서)에서 “상기”의 용어 및 이와 유사한 지시 용어의 사용은 단수 및 복수 모두에 해당하는 것일 수 있다. 또한, 본 발명에서 범위(range)를 기재한 경우 상기 범위에 속하는 개별적인 값을 적용한 발명을 포함하는 것으로서(이에 반하는 기재가 없다면), 발명의 상세한 설명에 상기 범위를 구성하는 각 개별적인 값을 기재한 것과 같다. 마지막으로, 본 발명에 따른 방법을 구성하는 단계들에 대하여 명백하게 순서를 기재하거나 반하는 기재가 없다면, 상기 단계들은 적당한 순서로 행해질 수 있다. 반드시 상기 단계들의 기재 순서에 따라 본 발명이 한정되는 것은 아니다. 본 발명에서 모든 예들 또는 예시적인 용어(예들 들어, 등등)의 사용은 단순히 본 발명을 상세히 설명하기 위한 것으로서 특허청구범위에 의해 한정되지 않는 이상 상기 예들 또는 예시적인 용어로 인해 본 발명의 범위가 한정되는 것은 아니다. 또한, 당업자는 다양한 수정, 조합 및 변경이 부가된 특허청구범위 또는 그 균등물의 범주 내에서 설계 조건 및 팩터에 따라 구성될 수 있음을 알 수 있다.The use of the terms " above " 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)
수신 메시지의 수신 시간을 획득하는 단계;
동일한 메시지 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.
상기 수신 메시지의 수신 시간을 획득하는 단계는,
마이크로 컨트롤러가 인터럽트 신호를 발생시켜 측정한 수신 메시지의 수신 시간을 획득하거나, 혹은 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.
상기 수신 필터 단계는, 동일한 메시지 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.
상기 주기 연산의 결과를 이용하여 탐지 점수 값을 보정하는 탐지 점수 학습부; 를 포함하고,
상기 탐지 점수 학습부는, 메시지가 수신될 때마다 상기 주기 연산을 수행하며, 상기 주기 연산의 결과, 상기 수신 시간의 차이가 상기 기준 주기보다 작은 경우 상기 탐지 점수를 기설정된 값만큼 증가시키고, 큰 경우 상기 탐지 점수를 기설정된 값만큼 감소시키며,
상기 차단 단계는 상기 탐지 점수가 일정 값 이상일 때 수신 메시지가 비정상 메시지라 판단하는, 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 >
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.
상기 메시지 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.
수신 메시지의 수신 시간을 획득하는 수신 시간 측정부;
동일한 메시지 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.
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)
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)
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)
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 |
-
2017
- 2017-06-16 KR KR1020170076811A patent/KR101972457B1/en active IP Right Grant
Patent Citations (11)
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)
Title |
---|
Techincal communications. CAN, Automotive Diagnostic Command Set User Manual. National Intruments, 2009.12. 페이지 1-1 - 6-140 * |
Cited By (2)
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 |