'모종의 음모/CAN'에 해당되는 글 5건

  1. 2025.02.19 candump, cansend와 vcan
  2. 2024.01.09 can invader
  3. 2023.10.31 CAN(controller area network)
  4. 2023.10.30 mcp2515 can
  5. 2015.01.23 CAN 통신 우선순위
모종의 음모/CAN2025. 2. 19. 16:35

 

$ modprobe vcan
modprobe: ERROR: could not insert 'vcan': Operation not permitted

$ sudo modprobe vcan
sudo ip link add dev vcan0 type vcan

$ ifconfig
br-638c83b169eb: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.18.0.1  netmask 255.255.0.0  broadcast 172.18.255.255
        ether 02:42:d5:e6:f1:21  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:40:63:97:cb  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enxf8e43b9b776b: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.220.108  netmask 255.255.0.0  broadcast 192.168.255.255
        inet6 fe80::81f4:65ad:f7cc:2f2c  prefixlen 64  scopeid 0x20<link>
        ether f8:e4:3b:9b:77:6b  txqueuelen 1000  (Ethernet)
        RX packets 3619726  bytes 2156366501 (2.1 GB)
        RX errors 0  dropped 106170  overruns 0  frame 0
        TX packets 1452518  bytes 317915291 (317.9 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 160829  bytes 14028478 (14.0 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 160829  bytes 14028478 (14.0 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlo1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.220.107  netmask 255.255.0.0  broadcast 192.168.255.255
        inet6 fe80::104b:d69c:878f:cfaa  prefixlen 64  scopeid 0x20<link>
        ether 8c:55:4a:28:25:bc  txqueuelen 1000  (Ethernet)
        RX packets 809871  bytes 90255020 (90.2 MB)
        RX errors 0  dropped 99865  overruns 0  frame 0
        TX packets 53067  bytes 6125665 (6.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

$ ifconfig -a
br-638c83b169eb: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.18.0.1  netmask 255.255.0.0  broadcast 172.18.255.255
        ether 02:42:d5:e6:f1:21  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:40:63:97:cb  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enxf8e43b9b776b: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.220.108  netmask 255.255.0.0  broadcast 192.168.255.255
        inet6 fe80::81f4:65ad:f7cc:2f2c  prefixlen 64  scopeid 0x20<link>
        ether f8:e4:3b:9b:77:6b  txqueuelen 1000  (Ethernet)
        RX packets 3620125  bytes 2156544266 (2.1 GB)
        RX errors 0  dropped 106183  overruns 0  frame 0
        TX packets 1452676  bytes 317938700 (317.9 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 160841  bytes 14030154 (14.0 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 160841  bytes 14030154 (14.0 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vcan0: flags=128<NOARP>  mtu 72
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlo1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.220.107  netmask 255.255.0.0  broadcast 192.168.255.255
        inet6 fe80::104b:d69c:878f:cfaa  prefixlen 64  scopeid 0x20<link>
        ether 8c:55:4a:28:25:bc  txqueuelen 1000  (Ethernet)
        RX packets 809990  bytes 90270371 (90.2 MB)
        RX errors 0  dropped 99877  overruns 0  frame 0
        TX packets 53074  bytes 6126348 (6.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

$ sudo ifconfig vcan0 up
$ ifconfig
br-638c83b169eb: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.18.0.1  netmask 255.255.0.0  broadcast 172.18.255.255
        ether 02:42:d5:e6:f1:21  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:40:63:97:cb  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enxf8e43b9b776b: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.220.108  netmask 255.255.0.0  broadcast 192.168.255.255
        inet6 fe80::81f4:65ad:f7cc:2f2c  prefixlen 64  scopeid 0x20<link>
        ether f8:e4:3b:9b:77:6b  txqueuelen 1000  (Ethernet)
        RX packets 3620430  bytes 2156573250 (2.1 GB)
        RX errors 0  dropped 106197  overruns 0  frame 0
        TX packets 1452764  bytes 317953427 (317.9 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 160841  bytes 14030154 (14.0 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 160841  bytes 14030154 (14.0 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vcan0: flags=193<UP,RUNNING,NOARP>  mtu 72
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 1000  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlo1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.220.107  netmask 255.255.0.0  broadcast 192.168.255.255
        inet6 fe80::104b:d69c:878f:cfaa  prefixlen 64  scopeid 0x20<link>
        ether 8c:55:4a:28:25:bc  txqueuelen 1000  (Ethernet)
        RX packets 810099  bytes 90278671 (90.2 MB)
        RX errors 0  dropped 99889  overruns 0  frame 0
        TX packets 53074  bytes 6126348 (6.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[링크 : https://ola-page.tistory.com/66]

 

 

 

$ candump 
candump - dump CAN bus traffic.

Usage: candump [options] <CAN interface>+
  (use CTRL-C to terminate candump)

Options:
         -t <type>   (timestamp: (a)bsolute/(d)elta/(z)ero/(A)bsolute w date)
         -H          (read hardware timestamps instead of system timestamps)
         -c          (increment color mode level)
         -i          (binary output - may exceed 80 chars/line)
         -a          (enable additional ASCII output)
         -S          (swap byte order in printed CAN data[] - marked with '`' )
         -s <level>  (silent mode - 0: off (default) 1: animation 2: silent)
         -l          (log CAN-frames into file. Sets '-s 2' by default)
         -L          (use log file format on stdout)
         -n <count>  (terminate after reception of <count> CAN frames)
         -r <size>   (set socket receive buffer to <size>)
         -D          (Don't exit if a "detected" can device goes down.
         -d          (monitor dropped CAN frames)
         -e          (dump CAN error frames in human-readable format)
         -x          (print extra message infos, rx/tx brs esi)
         -T <msecs>  (terminate after <msecs> without any reception)

Up to 16 CAN interfaces with optional filter sets can be specified
on the commandline in the form: <ifname>[,filter]*

Filters:
  Comma separated filters can be specified for each given CAN interface:
    <can_id>:<can_mask>
         (matches when <received_can_id> & mask == can_id & mask)
    <can_id>~<can_mask>
         (matches when <received_can_id> & mask != can_id & mask)
    #<error_mask>
         (set error frame filter, see include/linux/can/error.h)
    [j|J]
         (join the given CAN filters - logical AND semantic)

CAN IDs, masks and data content are given and expected in hexadecimal values.
When the can_id is 8 digits long the CAN_EFF_FLAG is set for 29 bit EFF format.
Without any given filter all data frames are received ('0:0' default filter).

Use interface name 'any' to receive from all CAN interfaces.

Examples:
candump -c -c -ta can0,123:7FF,400:700,#000000FF can2,400~7F0 can3 can8

candump -l any,0~0,#FFFFFFFF
         (log only error frames but no(!) data frames)
candump -l any,0:0,#FFFFFFFF
         (log error frames and also all data frames)
candump vcan2,12345678:DFFFFFFF
         (match only for extended CAN ID 12345678)
candump vcan2,123:7FF
         (matches CAN ID 123 - including EFF and RTR frames)
candump vcan2,123:C00007FF
         (matches CAN ID 123 - only SFF and non-RTR frames)

 

$ cansend vcan0
cansend - send CAN-frames via CAN_RAW sockets.

Usage: cansend <device> <can_frame>.

<can_frame>:
 <can_id>#{data}          for 'classic' CAN 2.0 data frames
 <can_id>#R{len}          for 'classic' CAN 2.0 data frames
 <can_id>##<flags>{data}  for CAN FD frames

<can_id>:
 3 (SFF) or 8 (EFF) hex chars
{data}:
 0..8 (0..64 CAN FD) ASCII hex-values (optionally separated by '.')
{len}:
 an optional 0..8 value as RTR frames can contain a valid dlc field
<flags>:
 a single ASCII Hex value (0 .. F) which defines canfd_frame.flags

Examples:
  5A1#11.2233.44556677.88 / 123#DEADBEEF / 5AA# / 123##1 / 213##311223344 /
  1F334455#1122334455667788 / 123#R / 00000123#R3

 

아래는 데이터 출력 포맷 확인용

인터페이스 / CAN id / 길이 / 데이터(페이로드 길이)

receive send
$ candump vcan0
  vcan0  111   [5]  01 02 03 04 05
$ cansend vcan0 111#010203.04.05
  vcan0  112   [5]  01 02 03 04 05 $ cansend vcan0 112#010203.04.05
  vcan0  112   [0]  $ cansend vcan0 112#
  vcan0  112  [00] $ cansend vcan0 112##1
  vcan0  112  [01]  23 $ cansend vcan0 112##123
  vcan0  112   [0]  remote request $ cansend vcan0 112#R
  vcan0  112   [3]  remote request $ cansend vcan0 112#R3

 

받는 쪽에서 CAN id 제한할 경우, 112를 받도록 설정했기에 113은 무시된다.

   
$ candump vcan0,112:FF $ cansend vcan0 111#R3
  vcan0  112   [3]  remote request $ cansend vcan0 112#R3
  $ cansend vcan0 113#R3
  vcan0  112   [5]  01 02 03 04 05 $ cansend vcan0 112#010203.04.05
  vcan0  112   [6]  01 02 03 04 05 06 $ cansend vcan0 112#010203.04.0506
  vcan0  112   [7]  01 02 03 04 05 06 07 $ cansend vcan0 112#010203.04.0506.07
  vcan0  112   [0]  remote request $ cansend vcan0 112#R
$ cansend vcan0 112#R10
$ cansend vcan0 112#R100
  vcan0  112   [1]  remote request $ cansend vcan0 112#R1
  vcan0  112   [2]  remote request $ cansend vcan0 112#R2
  vcan0  112   [8]  remote request $ cansend vcan0 112#R8

 

그나저나 mask 라는데 이해가 안되네..

123 = 0x7B & 0x7F0 하면 0x7B가 되어야 하니 16개에 대해서 받아들여야 할 거 같은데 왜 119에서 130 까지 12개 받아들여 질까?

$ candump vcan0,123:7F0
  vcan0  120   [0]  remote request
  vcan0  121   [0]  remote request
  vcan0  122   [0]  remote request
  vcan0  123   [0]  remote request
  vcan0  124   [0]  remote request
  vcan0  125   [0]  remote request
  vcan0  126   [0]  remote request
  vcan0  127   [0]  remote request
  vcan0  128   [0]  remote request
  vcan0  129   [0]  remote request
$ cansend vcan0 119#R
$ cansend vcan0 120#R
$ cansend vcan0 121#R
$ cansend vcan0 122#R
$ cansend vcan0 123#R
$ cansend vcan0 124#R
$ cansend vcan0 125#R
$ cansend vcan0 126#R
$ cansend vcan0 127#R
$ cansend vcan0 128#R
$ cansend vcan0 129#R
$ cansend vcan0 130#R

'모종의 음모 > CAN' 카테고리의 다른 글

can invader  (0) 2024.01.09
CAN(controller area network)  (0) 2023.10.31
mcp2515 can  (0) 2023.10.30
CAN 통신 우선순위  (0) 2015.01.23
Posted by 구차니
모종의 음모/CAN2024. 1. 9. 11:29

렉서스랑 토요타 차량 두가지 종류가 타이어 옆으로 해서 헤드라이트의 커넥터에 접근이 가능하도록

물리보안적인 측면에서 허술하게 만들어져 발생한 사건으로 보인다.

can이라서 접근성이 좋지 않아 이정도인데

현재~근미래에 can에서 ethernet으로 전환하게 되면 너무 손쉽게 뚫리지 않을까 걱정된다.

기본적으로 통신은 보안채널로 하게 되려나?

 

렉서스 차량 99대와 토요타 랜드크루저 92대가 도난

[링크 : https://v.daum.net/v/1OAq5WD7kL]

 

 

+

BroadR-Reach

 

BroadR-Reach technology is an Ethernet physical layer standard designed for automotive connectivity applications

[링크 : https://en.wikipedia.org/wiki/BroadR-Reach]

 

 

[링크 : https://m.blog.naver.com/lecroykorea/221105708892]

[링크 : https://m.blog.naver.com/lecroykorea/221065291291]

[링크 : https://m.blog.naver.com/lecroykorea/221069260339]

'모종의 음모 > CAN' 카테고리의 다른 글

candump, cansend와 vcan  (0) 2025.02.19
CAN(controller area network)  (0) 2023.10.31
mcp2515 can  (0) 2023.10.30
CAN 통신 우선순위  (0) 2015.01.23
Posted by 구차니
모종의 음모/CAN2023. 10. 31. 23:15

TJA1050 입력 전압을 보는데  dominant / recessive란게 나와서 보니

[링크 : https://www.nxp.com/docs/en/data-sheet/TJA1050.pdf]

 

CAN은 H 와 L 라인의 전위차로 0과 1을 구분한다고 한다.

0이  dominant 라는데 어째 0과 1이 반대인 느낌이다?

아무튼 3.3V면 bus state가 recessive로 잡힌다는건가?

[링크 : https://m.blog.naver.com/lagrange0115/221941482740]

 

[링크 : https://ww1.microchip.com/downloads/en/DeviceDoc/MCP2515-Stand-Alone-CAN-Controller-with-SPI-20001801J.pdf]

'모종의 음모 > CAN' 카테고리의 다른 글

candump, cansend와 vcan  (0) 2025.02.19
can invader  (0) 2024.01.09
mcp2515 can  (0) 2023.10.30
CAN 통신 우선순위  (0) 2015.01.23
Posted by 구차니
모종의 음모/CAN2023. 10. 30. 19:11

아두이노나 라즈베리 CAN HAT 은 3~4만원은 해서 구매하기 부담스러웠는데

MCP2515 라는 녀석은 CAN to SPI 라고 해야하나?

CAN 통신을 독립적으로 수행해주는 원칩 솔루션이 있으니 다음에 사봐야겠다.

 

[링크 : http://itempage3.auction.co.kr/DetailView.aspx?itemno=B509249430] 3700

[링크 : http://itempage3.auction.co.kr/DetailView.aspx?itemno=C297097222] 2700

 

차량에 OBD 연결하기도 한다는데 의외로 2.54mm 핀 헤더와 잘 맞는듯?

[링크 : https://clemencyking.tistory.com/26]

 

보드가 8MHz와 16Mhz가 있다는데

크리스탈은 4 / 8 / 20 MHz 권장인가?

HS SPI의 경우 10Mbps 라는데 아무래도 클럭 멀티플라이어가 없다면

20MHz를 넣어줘야 HS SPI 로 작동하게 될 것 같긴하네.

[링크 : https://ww1.microchip.com/downloads/en/DeviceDoc/MCP2515-Stand-Alone-CAN-Controller-with-SPI-20001801J.pdf]

'모종의 음모 > CAN' 카테고리의 다른 글

candump, cansend와 vcan  (0) 2025.02.19
can invader  (0) 2024.01.09
CAN(controller area network)  (0) 2023.10.31
CAN 통신 우선순위  (0) 2015.01.23
Posted by 구차니
모종의 음모/CAN2015. 1. 23. 08:48

dominant - logical 0 / actively driven to a voltage

recessive - logical 1/ passively return


왜이리 어려운 단어를 썼나 했더니

전기적으로 신호를 설계해서

0과 1이 충돌되면 0이 우세(우성)하게 판결되어 1을 씹어먹는다.

그래서 0 이 우선권을 가지고 데이터를 전송하여 "실시간 전송" 성격에 적합하다는 말씀(?)


CAN data transmission uses a lossless bit-wise arbitration method of contention resolution. This arbitration method requires all nodes on the CAN network to be synchronized to sample every bit on the CAN network at the same time. This is why some call CAN synchronous. Unfortunately the term synchronous is imprecise since the data is transmitted without a clock signal in an asynchronous format.
The CAN specifications use the terms "dominant" bits and "recessive" bits where dominant is a logical 0 (actively driven to a voltage by the transmitter) and recessive is a logical 1 (passively returned to a voltage by a resistor). The idle state is represented by the recessive level (Logical 1). If one node transmits a dominant bit and another node transmits a recessive bit then there is a collision and the dominant bit "wins". The means there is no delay to the higher priority message, and the node transmitting the lower priority message automatically attempts to re-transmit six bit clocks after the end of the dominant message. This makes CAN very suitable as a real time prioritized communications system.

[링크 : http://en.wikipedia.org/wiki/CAN_bus#Data_transmission]


dominant / 우성의

[링크 : http://endic.naver.com/enkrEntry.nhn?sLn=kr&entryId=7371ab1c34a84fab8bc699af491763d4&query=dominant]


recessive / 열성의

[링크 : http://endic.naver.com/enkrEntry.nhn?sLn=kr&entryId=087f00309f264a60ab6d787e5792a02a&query=recessive]

'모종의 음모 > CAN' 카테고리의 다른 글

candump, cansend와 vcan  (0) 2025.02.19
can invader  (0) 2024.01.09
CAN(controller area network)  (0) 2023.10.31
mcp2515 can  (0) 2023.10.30
Posted by 구차니