Skip to content

mod_stat

Alexey Sintsov edited this page May 9, 2016 · 19 revisions

This module is designed for CAN traffic sniffing and analyses. Module receives CAN frame from PIPE and saves it in the memory

init parameters

uds_shift - optional. default value is 8.

This parameter tells module which offset should be used for UDS response ID. By default response ID on UDS request is +8 to ID of UDS request. For other vendors it can be other value, for example for VW it could be 0x6a.

meta_file - optional. no values by default.

Path to a META file that will be used for this traffic. META file describes already known things in the traffic. File format (and possible features):

{ 'description':{ (1337,'00FF'):'action 1 description', (1337,'0000'):'action 2 description } }

1337 - CAN frame ID '00FF' - regex for CAN frame data

So all frames 1337:3:00FF11 - will be commented as 'action 1 description'

action parameters

None.

user commands

Print current table - cmd:p parameters:none

Print all sniffed frames in short table. Example of output:

BUS     ID   LENGTH MESSAGE          ASCII    DESCR     COUNT
Default 318  3      080009                              6545 
Default 318  3      080018                              7069 
Default 1359 8      0146443435313823 .FD4518# VIN value 141  
Default 1359 8      033034313535000c .04155.. VIN value 124  
Default 1359 8      0000000004000013          VIN value 198  
Default 1359 8      02323232424e323a .222BN2: VIN value 184  
Default 749  1      12                                  59   
Default 749  1      33                                  60   
Default 749  1      25                                  70   

DESCR field will be set only if META data exists for that ID.

Analyses of captured traffic - cmd:a parameters:<UDS|ISO|FRAG|ALL(defaut)>,[buffer index]

Analyzing of captured traffic. If no parameters then all analyzing methods will be executed:

FRAG - mod_stat will try to find control/index byte to fragment all chain. By default it could detect situations when same chain of data sending in the loop and first byte is index. Like in the example in print table section. The output will be:

De-Fragmented frames (using loop-based detection):

	ID 1036 and length 28
		Data: 0000000400001346443435313823323232424e323a3034313535000c
		ASCII: .......FD4518#222BN2:222BN2..

ISO - mod_stat will try to find messages that have been sent in ISO-TP (ISO 15765-2) format and print those UDS - mod_stat will try to find UDS services(ISO 14229-1:2013) based on sniffed requests and responses (over ISO-TP)

buffer index - which buffer use. If not set then ALL buffers will be parsed.

** - UDS shift value** - cmd:u params: [shift value] Used by previous command. Same thing as uds_shift in init section.

Enable/Disable Diff mode - F

When DIFF mode is enabled, you collect sniffed frames into different buffer. Then actions 'print diff' and 'print diff (ne ID only)' available. Usecase: https://asintsov.blogspot.de/2016/05/cantoolz-iso-tp-and-diff-updates.html

Switch sniffing to a new buffer - cmd:D, parameters:[name]

Switch sniffing CAN frames to a new buffer. You can name it if you want. Each buffer has uniq. index value which user should use if he wants to work with data from that buffer.

Print Diff between two buffers - cmd:I parameters: [buffer index 1], [buffer index 2], [uniq values max]

Doing diff between two buffer with following indexes. If indexes not set, then last two buffers will be used. If last parameter(uniq values max) is set (number), then results of the diff will be filtered by only those ID that have not more then 'uniq values max' different values.

Print Diff between two buffers (new ID only) - cmd:N parameters:[buffer index 1], [buffer index 2]

Doing diff between two buffer with following indexes. If indexes not set, then last two buffers will be used. This diff is based only on Arbitration ID.

Clean table - cmd:c

Free memory and clean all saved frames.

Meta-data: add description for ID - cmd:i, parameters: ID, regex, description

Add comment for chosen CAN frame ID as META data

Load meta-data - cmd:l, parameters: filename

Load META data from the file

Save meta-data - cmd:z, parameters: filename

Save current META data to file

Dump ALL in replay format - cmd:r, parameters: filename, index

Save CAN framesfrom all buffers or only from buffer with chosen index in replay format. Later you can share this file with colleagues or replay by yourself without having a car via [gen_replay]https://github.com/eik00d/CANToolz/wiki/gen_replay) module

Dump STAT in CSV format - cmd:d, parameters: filename, index

Save statistics table (like you see when you do 'print table') into CSV file.

Clone this wiki locally