하드웨어/FC_SAN_10G2025. 2. 19. 21:55

G4560 / 4GB / 128GB SATA SSD 에서 테스트 했는데

SSD도 문제가 있나.. 아니면 리눅스도 이제 4GB로는 무리인가.. 부팅도 오래걸리고, 설치도 엄청 오래 걸렸다.

 

최대 설정가능한 MTU는 ip 명령을 통해 확인이 가능하고

$ ip -d link list
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0  allmulti 0 minmtu 0 maxmtu 0 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 tso_max_size 524280 tso_max_segs 65535 gro_max_size 65536 
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 60:45:cb:9d:3a:12 brd ff:ff:ff:ff:ff:ff promiscuity 0  allmulti 0 minmtu 68 maxmtu 9194 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 64000 gso_max_segs 64 tso_max_size 64000 tso_max_segs 64 gro_max_size 65536 parentbus pci parentdev 0000:03:00.0 
3: enp1s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether f4:e9:d4:8c:d6:60 brd ff:ff:ff:ff:ff:ff promiscuity 0  allmulti 0 minmtu 46 maxmtu 9600 addrgenmode eui64 numtxqueues 46 numrxqueues 16 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536 portid f4e9d48cd660 parentbus pci parentdev 0000:01:00.0 
4: enp1s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether f4:e9:d4:8c:d6:62 brd ff:ff:ff:ff:ff:ff promiscuity 0  allmulti 0 minmtu 46 maxmtu 9600 addrgenmode eui64 numtxqueues 46 numrxqueues 16 gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535 gro_max_size 65536 portid f4e9d48cd662 parentbus pci parentdev 0000:01:00.1 


$ sudo ifconfig enp1s0f1 mtu 9600

[링크: https://unix.stackexchange.com/questions/552107/how-to-get-maximum-supported-mtu-size-for-interface]

 

위는 MTU 1500

아래는 MTU 9600 로 설정하고 테스트 했는데

커널 내부 전송이었는지 10G NIC 인데 40G가 나오고 난리.. -_-

아무튼 MTU가 커지니 좀 안정적으로 40G 이상 나오는 것 정도로 정리되는데

$ iperf3 -s
-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
Accepted connection from 192.168.0.1, port 46302
[  5] local 192.168.0.1 port 5201 connected to 192.168.0.1 port 46304
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  5.09 GBytes  43.7 Gbits/sec                  
[  5]   1.00-2.00   sec  4.58 GBytes  39.4 Gbits/sec                  
[  5]   2.00-3.00   sec  3.87 GBytes  33.2 Gbits/sec                  
[  5]   3.00-4.00   sec  4.58 GBytes  39.4 Gbits/sec                  
[  5]   4.00-5.00   sec  4.47 GBytes  38.4 Gbits/sec                  
[  5]   5.00-6.00   sec  4.80 GBytes  41.3 Gbits/sec                  
[  5]   6.00-7.00   sec  4.78 GBytes  41.0 Gbits/sec                  
[  5]   7.00-8.00   sec  3.46 GBytes  29.8 Gbits/sec                  
[  5]   8.00-9.00   sec  2.80 GBytes  24.1 Gbits/sec                  
[  5]   9.00-10.00  sec  3.33 GBytes  28.6 Gbits/sec                  
[  5]  10.00-10.00  sec   768 KBytes  23.8 Gbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec  41.8 GBytes  35.9 Gbits/sec                  receiver
$ iperf3 -c 192.168.0.1
Connecting to host 192.168.0.1, port 5201
[  5] local 192.168.0.1 port 46304 connected to 192.168.0.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  5.09 GBytes  43.7 Gbits/sec    0   1.62 MBytes       
[  5]   1.00-2.00   sec  3.34 GBytes  28.7 Gbits/sec    3   3.31 MBytes       
[  5]   2.00-3.00   sec  3.86 GBytes  33.2 Gbits/sec    0   4.12 MBytes       
[  5]   3.00-4.00   sec  4.58 GBytes  39.3 Gbits/sec    0   4.12 MBytes       
[  5]   4.00-5.00   sec  4.47 GBytes  38.4 Gbits/sec    0   4.12 MBytes       
[  5]   5.00-6.00   sec  4.80 GBytes  41.3 Gbits/sec    0   4.12 MBytes       
[  5]   6.00-7.00   sec  4.75 GBytes  40.8 Gbits/sec    0   4.12 MBytes       
[  5]   7.00-8.00   sec  3.45 GBytes  29.6 Gbits/sec    0   4.12 MBytes       
[  5]   8.00-9.00   sec  2.79 GBytes  23.9 Gbits/sec    0   4.12 MBytes       
[  5]   9.00-10.00  sec  3.32 GBytes  28.6 Gbits/sec    2   4.12 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  41.8 GBytes  35.9 Gbits/sec    5             sender
[  5]   0.00-10.00  sec  41.8 GBytes  35.9 Gbits/sec                  receiver

iperf Done.
-----------------------------------------------------------
Server listening on 5201 (test #4)
-----------------------------------------------------------
Accepted connection from 192.168.0.1, port 39920
[  5] local 192.168.0.1 port 5201 connected to 192.168.0.1 port 39926
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  4.99 GBytes  42.8 Gbits/sec                  
[  5]   1.00-2.00   sec  5.43 GBytes  46.6 Gbits/sec                  
[  5]   2.00-3.00   sec  5.30 GBytes  45.5 Gbits/sec                  
[  5]   3.00-4.00   sec  5.39 GBytes  46.3 Gbits/sec                  
[  5]   4.00-5.00   sec  5.31 GBytes  45.6 Gbits/sec                  
[  5]   5.00-6.00   sec  5.21 GBytes  44.7 Gbits/sec                  
[  5]   6.00-7.00   sec  5.39 GBytes  46.3 Gbits/sec                  
[  5]   7.00-8.00   sec  5.35 GBytes  46.0 Gbits/sec                  
[  5]   8.00-9.00   sec  5.37 GBytes  46.1 Gbits/sec                  
[  5]   9.00-10.00  sec  5.61 GBytes  48.2 Gbits/sec                  
[  5]  10.00-10.00  sec   512 KBytes  17.4 Gbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec  53.4 GBytes  45.8 Gbits/sec                  receiver

$ iperf3 -c 192.168.0.1
Connecting to host 192.168.0.1, port 5201
[  5] local 192.168.0.1 port 39926 connected to 192.168.0.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  4.99 GBytes  42.8 Gbits/sec    0   1.12 MBytes       
[  5]   1.00-2.00   sec  5.41 GBytes  46.4 Gbits/sec    0   1.19 MBytes       
[  5]   2.00-3.00   sec  5.30 GBytes  45.5 Gbits/sec    0   1.37 MBytes       
[  5]   3.00-4.00   sec  3.92 GBytes  33.7 Gbits/sec    0   1.37 MBytes       
[  5]   4.00-5.00   sec  4.99 GBytes  42.9 Gbits/sec    0   1.37 MBytes       
[  5]   5.00-6.00   sec  5.21 GBytes  44.7 Gbits/sec    0   3.18 MBytes       
[  5]   6.00-7.00   sec  5.39 GBytes  46.3 Gbits/sec    0   3.18 MBytes       
[  5]   7.00-8.00   sec  5.35 GBytes  46.0 Gbits/sec    0   3.18 MBytes       
[  5]   8.00-9.00   sec  5.35 GBytes  46.0 Gbits/sec    0   3.18 MBytes       
[  5]   9.00-10.00  sec  5.62 GBytes  48.2 Gbits/sec    0   3.18 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  53.4 GBytes  45.8 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  53.4 GBytes  45.8 Gbits/sec                  receiver

iperf Done.

 

-P 1 혹은 옵션 없이 하면 50% 정도 먹고

 

-P 4로 4 프로세스 사용하도록 하면 100%은 찍는데

물리 cpu가 2개에 HT 4개인 녀석이라, 40GBps 를 초과하진 못한다.

[링크: https://www.reddit.com/r/homelab/comments/11v94kz/new_10g_network_iperf_3_maxing_out_at_6_gbitssec/]

'하드웨어 > FC_SAN_10G' 카테고리의 다른 글

BCM957810A1008G 10g linux 로그  (0) 2025.02.23
10g with cat 8 S-FTP 케이블  (0) 2025.02.23
10g nic 테스트, link unstable  (0) 2025.02.22
BCM957810A1008G 10G nic 도착  (0) 2025.02.11
10G FCoE CEE?  (0) 2025.02.03
Posted by 구차니
모종의 음모/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' 카테고리의 다른 글

DeviceNet CAN  (0) 2025.04.01
linux can 테스트(가상 CAN IF)  (0) 2025.02.18
can-utils(cansend, candump)  (0) 2025.02.18
can invader  (0) 2024.01.09
CAN(controller area network)  (0) 2023.10.31
Posted by 구차니

서버 메인보드에서 NCSI 라는 명칭이 나오길래 찾아보는 중

서버 보드에 관리용 포트로 보이는게 두개 있는데

하나는 IPMI 라고 bios에서 써있고

다른 하나는 NCSI 라고 써있다.

 

[링크 : https://www.lr-link.com/newsdetail/654.html]

'하드웨어 > Server Case & board' 카테고리의 다른 글

xeon phi  (0) 2025.01.03
보드에 ECC/reg 장착하기  (0) 2024.04.09
구형 시스템 메모리 클럭 제한  (0) 2024.04.05
supermicro 구형 IPMI iKVM 접속  (0) 2024.04.01
xeon에 non-ecc가 가능한가?  (0) 2024.03.31
Posted by 구차니

윈도우에서 USB 카드리더를 통해서 읽으려는데 이런 에러가 발생한다.

"smart card resource manager is not running"

 

보안 정책을 바꾸어주고

Local:
Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options / Interactive logon: Smart card removal behvior (select any option other than "no action")

[링크 : https://github.com/actions/runner-images/discussions/9893

 

smart card service / smart card remove 등을 기동하도록 해주면 된다는데

Press the Windows + R keys on your keyboard to open the Run window. Type services. msc and hit Enter.
In the services find the Smart Card service > right-click then click start.

[링크 : https://answers.microsoft.com/en-us/windows/forum/all/smart-card-resource-manager-not-running-solution/bf1b13de-a66a-413a-b62f-22b46344a92e

 

일단 해결은 안됨.

Posted by 구차니
모종의 음모/CAN2025. 2. 18. 16:44

실 장비가 있으면 좋겠지만 없어도

가상 can(virtual can) 장치를 추가해서 테스트 할 수 있다.

 

$ sudo ip link add dev vcan0 type vcan
$ sudo ifconfig vcan0 up

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

[링크 : https://hn-log.tistory.com/168] CANable

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

DeviceNet CAN  (0) 2025.04.01
candump, cansend와 vcan  (0) 2025.02.19
can-utils(cansend, candump)  (0) 2025.02.18
can invader  (0) 2024.01.09
CAN(controller area network)  (0) 2023.10.31
Posted by 구차니
모종의 음모/CAN2025. 2. 18. 16:43

cansend는 보내고

candump는 받는 녀석이다.

 

$ cansend can0 canid#userdata

로 하면 특정 canid로 보낼 수 있고

$ cansend --help
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

 

candump 에서는 아래와 같이 하면 특정 id로만 확인할 수 있다.

$ candump can0,canid 

$ candump --help
candump: invalid option -- '-'
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)

 

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

candump, cansend와 vcan  (0) 2025.02.19
linux can 테스트(가상 CAN IF)  (0) 2025.02.18
can invader  (0) 2024.01.09
CAN(controller area network)  (0) 2023.10.31
mcp2515 can  (0) 2023.10.30
Posted by 구차니

결국은(?) password_file을 지정해서 mosquitto_passwd 명령을 통해 계정을 추가해주면 끝 인듯

 

1. password.txt 이름으로 비어있는 파일을 생성하여 Mosquitto가 설치된 폴더에 저장
2. 계정 추가
C:\mosquitto>mosquitto_passwd -b password.txt admin password

3. mosquitto.conf 파일 수정
allow_anonymous false
password_file C:\Program Files\mosquitto\password.txt

[링크 : https://hays99.tistory.com/189]

[링크 : https://mosquitto.org/man/mosquitto_passwd-1.html]

 

+

2025.02.21

"Program Files" 때문에 공백이 있어서 "로 묶어 줘야 할 줄 알았는데, 해주면 안되도록 구현이 되어있나 보다.

C:\Program Files\mosquitto>mosquitto -c mosquitto.conf -v
1740101165: mosquitto version 2.0.20 starting
1740101165: Config loaded from mosquitto.conf.
1740101165: Error: Unable to open pwfile ""C:\Program Files\mosquitto\password.txt"".
1740101165: Error opening password file ""C:\Program Files\mosquitto\password.txt"".

 

'프로그램 사용 > mosquitto' 카테고리의 다른 글

mosquitto qos  (0) 2025.04.18
mosquitto service for windows  (0) 2025.02.18
CC2531 zigbee - mqtt  (0) 2025.01.07
ubuntu MQTT(mosquito)  (0) 2024.05.23
mosquitto - MQTT broker  (0) 2019.05.15
Posted by 구차니

윈도우 10에 연결해보니 아래와 같이 나오는데

 

일단 제조사는 Advanced Card Systems Ltd 이고

 

 

SDK를 받아 실행하는데 목록에 안뜬다.. 왜지?

[링크 : https://www.ravirajtech.com/downloads/ACR1252/SDK/]

 

코드를 뒤져보니

"ACR122" 로 검색하는 소스라 ACR1252 와는 매칭되지 않아 안뜨는거 아닌가 생각된다.

수정하고 리빌드 해봐야하나..

Posted by 구차니
Programming/golang2025. 2. 18. 14:27

리눅스에서 일반실행파일을 systemctl에 등록해서 실행하는것과 다르게

윈도우에서는 윈도우 서비스 api를 통해서 구동을 해야 정상적으로 구동된다.

 

일반적인 네트워크 echo 프로그램을 빌드해서 실행해보니

서비스 등록 문제 없음

서비스 실행 -> 실행중 -> 중지됨 으로 어느정도 시간이 지난후 멈춰버린다.

[링크 : https://pkg.go.dev/golang.org/x/sys/windows/svc]

 

[링크 : http://golang.site/go/article/116-윈도우즈-서비스-프로그램]

[링크 : http://www.toughman.pe.kr/2020/09/gogolang-언어로-윈도우즈-서비스-프로그램-만들기/]

'Programming > golang' 카테고리의 다른 글

golang 정적웹 파일 포함하기  (0) 2025.11.24
go vet (golang 정적분석)  (0) 2025.10.02
golang tcp socket timeout 주기(listen, read)  (0) 2024.04.08
golang reflect  (0) 2024.02.20
golang echo i18n  (0) 2024.02.19
Posted by 구차니
Microsoft/Windows2025. 2. 18. 12:01

심심해서(?) go로 작성한 echo 서버를 크로스빌드하고 서비스 등록했는데

"시작중"이 뜨다가 "종료됨"으로 떠버린다.

프로그램이 서비스로 작동하기 위해서는 일반적인 프로그램을 실행하면 안되는건가 싶기도 한데..

 

빌드는 아래와 같이 하고

$ go mod ninit
$ go mod init echo
$ go mod tidy
$ GOOS=windows go build

[링크 : https://github.com/venilnoronha/tcp-echo-server]

[링크 : https://dadev.tistory.com/entry/GO-Windows-macOS-및-Linux용-Go-프로그램을-교차-컴파일하는-방법]

 

한번 그냥 실행해서 방화벽 예외 추가해주고, 관리자 권한의 콘솔에서 아래와 같이 입력해주면 끝

C:\Windows\system32>sc create "echo service" binPath= "c:\echo\echo.exe 9000 hello"
[SC] CreateService 성공

C:\Windows\system32>sc delete "echo service"
[SC] DeleteService 성공

[링크 : https://blog.naver.com/battle50/220311915822]

 

특이하게도 옵션 이름에 =가 붙어야 해서 =" 하면 안된다.

C:\Windows\system32>sc create "echo service" binPath ="c:\echo\echo.exe 9000 hello"
설명:
        레지스트리 및 서비스 데이터베이스에 서비스 항목을 만듭니다.
사용법:
        sc <서버>create [서비스 이름] [binPath= ] <옵션1> <옵션2>...

옵션:
참고: 옵션 이름은 등호(=)를 포함합니다.
      등호와 값 사이에는 공백이 한 칸 있어야 합니다.
 type= <own|share|interact|kernel|filesys|rec|userown|usershare>
       (default = own)
 start= <boot|system|auto|demand|disabled|delayed-auto>
       (default = demand)
 error= <normal|severe|critical|ignore>
       (default = normal)
 binPath= <.exe 파일에 대한 BinaryPathName>
 group= <LoadOrderGroup>
 tag= <yes|no>
 depend= <종속성(슬래시(/)로 구분)>
 obj= <AccountName|ObjectName>
       (default = LocalSystem)
 DisplayName= <표시 이름>
 password= <암호>

 

테스트는 리눅스에서 아래와 같이 테스트 하면 끝. telnet에서 ctrl-c,d,z를 다 패스시키니

ctrl-[ 를 이용해서 메뉴로 나와 종료해야 한다.

$ telnet 192.168.220.253 9000
Trying 192.168.220.253...
Connected to 192.168.220.253.
Escape character is '^]'.

hello 
d
hello d
^]
telnet> quit
Connection closed.

[링크 : https://superuser.com/questions/486496/how-do-i-exit-telnet]

Posted by 구차니