βœ’οΈ INTERLUDE/2023 Autonomous Driving & Network Study

[2μ£Όμ°¨] CAN ν†΅μ‹ μ˜ 이해: CAN Protocol 및 톡신 μ‹œμŠ€ν…œ & CAN Dos Attack

A Lim Han 2023. 4. 5. 12:02

# CAN ν†΅μ‹ μ˜ 이해: CAN Protocol 및 톡신 μ‹œμŠ€ν…œ & CAN Dos Attack

 

 

# CANκ³Ό CAN 톡신

- CAN (Controller Area Network)

: μ°¨λŸ‰ 및 μ‚°μ—…μš© μ œμ–΄ μ‹œμŠ€ν…œμ—μ„œ μ‚¬μš©λ˜λŠ” 톡신 ν”„λ‘œν† μ½œλ‘œ, 각 λͺ¨λ“ˆ κ°„ 데이터 톡신에 μ΄μš©λœλ‹€. CAN ν”„λ‘œν† μ½œμ„ μ΄μš©ν•œ 톡신은 데이터 전솑을 μœ„ν•΄ 총 2개의 전솑선(CAN-Tx & CAN-Rx)으둜 μ§„ν–‰λ˜λŠ”λ°, 이둜 인해 높은 μ‹ λ’°μ„±κ³Ό μ•ˆμ „μ„±μ„ 보μž₯ν•  수 μžˆλ‹€.

 

+ 참고 자료

: https://www.engineersgarage.com/can-protocol-understanding-the-controller-area-network-protocol/

 

CAN protocol: Understanding the controller area network

Controller Area Network or CAN protocol is a method of communication between various electronic devices like engine management systems, active suspension, ABS, gear control, lighting control, air conditioning, airbags, central locking etc embedded in an a

www.engineersgarage.com

 

 

 

 

# CAN Protocol의 상세와 νŠΉμ§•

- CAN Protocol의 νŠΉμ§•

고속 톡신 λΉ λ₯Έ 데이터 전솑 지원
였λ₯˜ 볡ꡬ 및 κ²€μΆœ κΈ°λŠ₯ 지원 데이터 전솑 쀑 였λ₯˜ λ°œμƒ μ‹œ 였λ₯˜ 식별 및 μˆ˜μ • κΈ°λŠ₯ 지원
λ©€ν‹° λ§ˆμŠ€ν„° 톡신 λ‹€μˆ˜μ˜ λ””λ°”μ΄μŠ€μ˜ λ™μ‹œ 데이터 전솑 지원
적은 μ „λ ₯ μ†ŒλΉ„ 배터리 수λͺ… μ—°μž₯ 및 μ €μ „λ ₯ μ†ŒλΉ„ 지원
μš°μ„  μˆœμœ„ 기반 톡신 λ©”μ‹œμ§€ μš°μ„ μˆœμœ„ 기반의 톡신 처리 지원
신뒰적이고 μ•ˆμ •μ μΈ 톡신 μ—¬λŸ¬ λ°©λ©΄μ—μ„œ 높은 μ‹ λ’°μ„± κ°€μ§„ 톡신 지원

 

+ 참고 자료

: https://scienceon.kisti.re.kr/commons/util/originalView.do?cn=CFKO200634741466208&oCn=NPAP08116964&dbt=CFKO&journal=NPRO00290005 

 

원문보기 - ScienceON

 

scienceon.kisti.re.kr

 

 

 

- CAN Protocol의 ꡬ성

CAN λ©”μ„Έμ§€μ˜ ꡬ성도

 

 CAN ν”„λ‘œν† μ½œμ€ ν‘œμ€€ν™”λœ νŠΉμ„± μž„ν”Όλ˜μŠ€λ₯Ό κ°€μ§€κ³  μžˆλŠ” μŒμ„  케이블을 톡해 데이터λ₯Ό μ „μ†‘ν•˜λŠ”λ°, 이둜 인해 각쒅 μ™ΈλΆ€ λ…Έμ΄μ¦ˆμ— κ°•ν•œ μ‰΄λ“œλ‘œ λ³΄ν˜Έλ°›μ„ 수 μžˆλ‹€. 또 CAN 톡신 ν”„λ‘œν† μ½œμ—μ„œλŠ” ν”„λ ˆμž„μ΄ λ°μ΄ν„°μ˜ 전솑 λ‹¨μœ„μ΄λ‹€. ν•˜λ‚˜μ˜ ν”„λ ˆμž„μ€ 총 6κ°€μ§€ μš”μ†Œλ‘œ κ΅¬μ„±λ˜λŠ”λ°, κ·Έ λͺ©λ‘μ€ μ•„λž˜μ™€ κ°™λ‹€.

SOF Identifier Control Field
EOF Data Field CRC

 

 μœ„μ—μ„œ μ–ΈκΈ‰λ˜μ—ˆλ“―μ΄, CAN 톡신 ν”„λ‘œν† μ½œμ—μ„œλŠ” λ©”μ‹œμ§€λ₯Ό μ‹λ³„ν•˜λŠ” μš©λ„λ‘œ μ‹λ³„μžλ₯Ό μ΄μš©ν•œλ‹€. 이 μ‹λ³„μž(Identifier)은 11 λ˜λŠ” 29λΉ„νŠΈμ˜ 길이λ₯Ό κ°€μ§€κ³  μžˆλ‹€. μ‹λ³„μžλŠ” κ°€μ§€λŠ” λΉ„νŠΈμ˜ 길이미닀 λ‹€λ₯Έ 이름을 κ°€μ§€λŠ”λ°, 11λΉ„νŠΈ μ‹λ³„μžλŠ” SID, 29λΉ„νŠΈ μ‹λ³„μžλŠ” Extended CAN( = EID )λΌλŠ” λͺ…μΉ­μœΌλ‘œ λΆˆλ¦°λ‹€. 또 였λ₯˜ κ²€μΆœ 및 볡ꡬ κΈ°λŠ₯을 μ§€μ›ν•˜κΈ° μœ„ν•΄ CAN 톡신은 CRC 처리 기법을 μ‚¬μš©ν•œλ‹€. CRCλŠ” Cyclic Redundancy Check의 μ•½μžλ‘œ, 데이터 전솑 쀑 였λ₯˜ λ°œμƒ μ‹œ ν”„λ ˆμž„ μž¬μ „μ†‘ 및 λ°μ΄ν„°μ˜ 신뒰성을 보μž₯ν•˜κΈ° μœ„ν•œ 기법이닀.

 

+ 참고 자료

: http://www.fescaro.com/kr/insight/blog.php#content

 

κΈ°μˆ λΈ”λ‘œκ·Έ - INSIGHT - 페슀카둜(FESCARO) - μžλ™μ°¨ μ†Œν”„νŠΈμ›¨μ–΄ μ „λ¬ΈκΈ°μ—…(μžλ™μ°¨ μ‚¬μ΄λ²„λ³΄μ•ˆ, μ œμ–΄κΈ°,

νŽ˜μŠ€μΉ΄λ‘œλŠ” μžμœ¨μ£Όν–‰μ°¨, μ „κΈ°μ°¨, 컀λ„₯ν‹°λ“œμΉ΄ λ“± 미래차의 λͺ¨λ“  SWμ†”λ£¨μ…˜μ„ μ œκ³΅ν•©λ‹ˆλ‹€. μžλ™μ°¨ μ‚¬μ΄λ²„λ³΄μ•ˆλΆ€ν„° κ²Œμ΄νŠΈμ›¨μ΄ μ œμ–΄κΈ°, V2X, SDVκΉŒμ§€ λ‹€κ°€μ˜€λŠ” 미래차 μ‚°μ—…μ˜ ν˜μ‹ μ„ μ£Όλ„ν•©λ‹ˆλ‹€.

www.fescaro.com

 

 

 

- CAN Protocol의 규격과 버전

: CAN ν”„λ‘œν† μ½œμ€ ISO κ·œκ²©μ— 따라 총 2κ°€μ§€λ‘œ λΆ„λ₯˜λ˜λŠ”λ°, 이듀은 각각 톡신 μ†λ„μ—μ„œ 큰 차이λ₯Ό 보인닀. ISO 11898의 경우 μ•½ 1Mbps μ΄μƒμ˜ 속도λ₯Ό λ‚Ό 수 있고, ISO 11519의 κ²½μš°λŠ” κ³ μž‘ 125kbps의 톡신 속도밖에 μ§€μ›ν•˜μ§€ λͺ»ν•œλ‹€.

 

 ISO 규격뿐만 μ•„λ‹ˆλΌ μœ„μ—μ„œ μ–ΈκΈ‰λ˜μ—ˆλ˜ μ‹λ³„μžμ˜ 길이에 λ”°λΌμ„œλ„ 규격과 버전을 λ‚˜λˆŒ 수 μžˆλ‹€. ν‘œμ€€ CAN의 κ²½μš°λŠ” 2.0A λ²„μ „μœΌλ‘œ 11λΉ„νŠΈμ˜ μ‹λ³„μžμ™€ κ΄€λ ¨λ˜μ–΄ μžˆλ‹€. λ°˜λŒ€λ‘œ ν™•μž₯ CAN의 κ²½μš°λŠ” 2.0B λ²„μ „μœΌλ‘œ, 29λΉ„νŠΈμ˜ μ‹λ³„μžμ™€ 연관이 μžˆλ‹€.

 

+ 참고 자료

https://www.kvaser.com/can-protocol-tutorial/

 

Controller Area Network (CAN BUS) Protocol

What is canbus? Take our free video course to learn about the can bus system, decoding, wiring diagram, analyzer, and the SAE vehicle bus J1939.

www.kvaser.com

 

 

 

 

# CAN 톡신과 λ©”μ‹œμ§€ 좩돌

: CAN ν†΅μ‹ μ—μ„œλŠ” λ©”μ‹œμ§€μ˜ CAN IDκ°€ μž‘μ„μˆ˜λ‘ 더 높은 μš°μ„  μˆœμœ„λ₯Ό κ°€μ§€λ©°, 데이터λ₯Ό μ „μ†‘ν•˜κΈ° μ „ μ‚¬μš©ν•  λ²„μŠ€μ˜ μ‚¬μš© μ—¬λΆ€λ₯Ό λ¨Όμ € κ²€ν† ν•œλ‹€. μ΄λ•Œ ν•„μš”ν•œ λ²„μŠ€κ°€ 이미 λ‹€λ₯Έ μš”μ†Œμ— μ˜ν•΄ μ‚¬μš©λ˜κ³  μžˆλŠ” κ²½μš°μ—λŠ” λ©”μ„Έμ§€ κ°„μ˜ μΆ©λŒμ„ ν”Όν•˜κΈ° μœ„ν•΄ 데이터λ₯Ό μ „μ†‘ν•˜μ§€ μ•ŠλŠ”λ‹€. 만일 λ©”μ‹œμ§€μ˜ 좩돌이 λΆˆκ°€ν”Όν•˜κ²Œ λ°œμƒν•˜μ˜€λ‹€λ©΄, 두 λ©”μ„Έμ§€μ˜ μš°μ„ μˆœμœ„λ₯Ό νŒλ³„ν•˜μ—¬ 더 적은 CAN ID값을 κ°€μ§„ λ©”μ‹œμ§€λ§Œ μ „μ†‘ν•œλ‹€.

 

+ 참고 자료

: https://copperhilltech.com/blog/controller-area-network-can-bus-bus-arbitration/

 

Controller Area Network (CAN Bus) - Bus Arbitration

The following is an excerpt from  A Comprehensible Controller Area Network by Wilfried Voss. Since a serial communication system such as CAN is based on a two-wire connection between nodes in the network, i.e. all nodes are sharing the same physical commu

copperhilltech.com

 

 

 

 

# CAN Dos Attackκ³Ό 톡신 취약점

: CAN ν†΅μ‹ μ—μ„œμ˜ DoS 곡격은 λŒ€λΆ€λΆ„ CAN λ²„μŠ€λ₯Ό 포함함 물리적인 접근을 μš”κ΅¬ν•˜λŠ”λ°, μ΄λŸ¬ν•œ 점을 μ•…μš©ν•  수 μžˆλ‹€. CAN λ²„μŠ€μ— λŒ€ν•΄ λ§Žμ€ 수의 μ•…μ„± 데이터λ₯Ό μ‚½μž…ν•˜κ±°λ‚˜, ν•˜λ‚˜ μ΄μƒμ˜ λ…Έλ“œμ—μ„œ ν†΅μ‹ μ—μ„œμ˜ ν•œκ³„μΉ˜ μ΄μƒμ˜ κ³Όλ‹€ν•œ 데이터 ν”„λ ˆμž„μ„ μƒμ„±ν•˜λŠ” λ°©μ‹μœΌλ‘œμ˜ 곡격이 κ°€λŠ₯ν•˜λ‹€.

 

+ 참고 자료

: https://www.ncsc.gov.uk/collection/denial-service-dos-guidance-collection

 

Denial of Service (DoS) guidance

Guidance to help organisations understand and mitigate DoS attacks.

www.ncsc.gov.uk

 

: https://www.cisa.gov/news-events/news/understanding-denial-service-attacks

 

Understanding Denial-of-Service Attacks | CISA

Denial-of-service attacks don’t just affect websites—individual home users can be victims too. Denial-of-service attacks can be difficult to distinguish from common network activity, but there are some indications that an attack is in progress.

www.cisa.gov

 

 

 

 

# CAN 톡신과 TCP/IP

 

 TCPλŠ” Transmission Control Protocol의 μ•½μžλ‘œ, λ„€νŠΈμ›Œν¬ μƒμ—μ„œ 데이터듀을 μ•ˆμ •μ μœΌλ‘œ μ „μ†‘ν•˜κΈ° μœ„ν•΄ μ‚¬μš©ν•˜λŠ” 인터넷 ν”„λ‘œν† μ½œ μŠ€μœ„νŠΈ(IP suite) 쀑 ν•˜λ‚˜μ΄λ‹€. TCPλŠ” 전솑 계측, 즉 Transport Layerμ—μ„œ μž‘λ™ν•œλ‹€λŠ” νŠΉμ§•μ΄ μžˆλ‹€. 일반적으둜 IP ν”„λ‘œν† μ½œκ³Ό ν•¨κ»˜ μ‚¬μš©λ˜λ©°, μ›Ή λΈŒλΌμš°μ € 및 μ›Ή μ„œλ²„ μ‚¬μ΄μ˜ 데이터 μ „μ†‘μ΄λ‚˜ 이메일 전솑 λ“± λ‹€μ–‘ν•œ 인터넷 μ„œλΉ„μŠ€μ—μ„œ 이용되고 μžˆλ‹€.

 

 IP의 경우 Internet Protocol의 μ•½μžλ‘œ 이 λ˜ν•œ 인터넷 ν”„λ‘œν† μ½œ μŠ€μœ„νŠΈ 쀑 ν•˜λ‚˜μ΄λ‹€. TCP와 μœ μ‚¬ν•˜κ²Œ 인터넷 μƒμ—μ„œ 데이터 νŒ¨ν‚·μ„ μ „μ†‘ν•˜λŠ” 데 μ‚¬μš©λ˜λŠ” ν”„λ‘œν† μ½œμ΄λ‹€. IPλŠ” 데이터 νŒ¨ν‚·μ˜ 경둜λ₯Ό κ²°μ •ν•˜κ³ , νŒ¨ν‚·μ΄ λ¬΄μ‚¬νžˆ λͺ©μ μ§€κΉŒμ§€ 도달할 수 μžˆλ„λ‘ 쀑간 μ§€μ μ—μ„œ λΌμš°νŒ…μ„ μˆ˜ν–‰ν•œλ‹€. IPλŠ” 인터넷 계측(Internet Layer)μ—μ„œ μž‘λ™ν•˜λ©°, μƒμœ„ κ³„μΈ΅μ—μ„œλŠ” TCP, UDP(User Datagram Protocol) λ“±μ˜ ν”„λ‘œν† μ½œλ“€μ΄ μ΄μš©λœλ‹€.

 

 IP, TCP와 CAN은 맀우 μœ μ‚¬ν•˜μ§€λ§Œ 각기 차이점이 μ‘΄μž¬ν•œλ‹€. 주된 차이점은 μš©λ„μ™€ ν”„λ‘œν† μ½œμ˜ μ’…λ₯˜, 에리 처리 및 νŒ¨ν‚· 전솑 방식과 연관이 κΉŠλ‹€. 각 μš”μ†Œλ“€μ˜ 곡톡점과 차이점은 μ•„λž˜ ν‘œμ™€ κ°™λ‹€.

  TCP IP CAN
μ‚¬μš© λΆ„μ•Ό 및 μ˜ˆμ‹œ μ›Ή λΈŒλΌμš°μ € 및 이메일 인터넷 데이터 전솑 μ°¨λŸ‰ λ‚΄λΆ€ 톡신 및 λ‘œλ΄‡ μ œμ–΄
전솑 속도 느림 빠름 빠름
μ—λŸ¬ 처리 μ—λŸ¬ κ²€μΆœ 및 μž¬μ „μ†‘ 지원 μ—λŸ¬ κ²€μΆœ μ—λŸ¬ κ²€μΆœ 및 μž¬μ „μ†‘
νŒ¨ν‚· 전솑 방식 μ—°κ²°ν˜• λΉ„μ—°κ²°ν˜• λΉ„μ—°κ²°ν˜•
ν”„λ‘œν† μ½œ μž‘λ™ 계측 전솑 계측 인터넷 계측 데이터 링크 계측
μš©λ„ λ°μ΄ν„°μ˜ μ•ˆμ „μ  전솑 지원 데이터 νŒ¨ν‚· λΌμš°νŒ… μ°¨λŸ‰ λ‚΄λΆ€ 톡

 

+ 참고 자료

: https://www.techtarget.com/searchnetworking/definition/TCP

 

What is Transmission Control Protocol (TCP)? Definition from SearchNetworking

Explore how Transmission Control Protocol (TCP) works and how it compares to UDP, the OSI model and other protocols.

www.techtarget.com

 

: https://www.fortinet.com/resources/cyberglossary/tcp-ip

 

What is TCP/IP in Networking? | Fortinet

What is Transmission Control Protocol? Learn the meaning of Transmission Control Protocol and how TCP models enable applications and devices. βœ“ Click here!

www.fortinet.com

 

: https://www.hostinger.com/tutorials/tcp-protocol

 

TCP Protocol: Understanding What Transmission Control Protocol Is and How It Works

The TCP protocol is used on top of the IP to ensure reliable packet transmission. Learn what TCP protocol is and how it works in this article.

www.hostinger.com