PduApi 2.2.1
PduApi - Toolbox
|
DoIP ISOTP Gateway Version @CMAKE_PROJECT_VERSION@ Copyright 2021 @PDUAPI_COPYRIGHT.
doip_isotp_gw [options]
'doip_isotp_gw' is an implementation of a doip-isotp gateway. On DoIP side it works like a server/ECU and on CAN/ISOTP it works like a tester.
To understand the options and documentation below completly please read the ISO 13400 and ISO 15765-2 first.
-4 IPv4 only. Default is IPv6 and IPv4. -6 IPv6 only. Default is IPv6 and IPv4. Broadcast address 'FF02::1'. -b <blocksize> For messages received from ECU, set the Blocksize in FlowControl Message. Default: 255 Please check this value with the qlen from 'ip link' to avoid dropped can-frames. ensure blocksize is smaller than the 'qlen' value. -c <licfile> License file. Optional parameter for non Demo Version. Default: 'doip_isotp_gw.lic' in executable directory. –direct-connection <ip:port> Works in diretion connection mode. Send Vehicle Response mesage without request. automatically set when use –ota. -e <EID> EID size 6 hex values. Default: MAC address. –disable_fillerbyte Disable filledbyte handling. Default: Enabled. –fillerbyte <hex> Set filled byte. Default: 0x55. –fd <dlc> Use CAN-FD with DLC. 0: classic CAN (default), 8-15 CAN-FD. DLC will be reduced in case messages are shorter. -g <GID> GID size 6 hex values. Default: MAC address. -l <LA> Logical address of DoIP Gateway. Mandatory parameter. -m <normal,extended,fixed,mixed>[:ae] Isotp Address mode.'ae' is set in case of 'Mixed'. –maxsockets <1-255> number of connected sockets. counter after RoutineActRequest. Default: 255 -n <can-name> CAN interface name. Default: 'can0' -p <port> Port. Default is 13400. Not avaible in '–ota' - mode. –portfile <filename> In case of port==0, write the dynamic allocated listen port into <filename>. Could be used to test independent test cases. –padding <Byte> padding value which can be written as hex like 0x55 which is recommended. -q Quiet mode. Do now show header. —ota <ip> Run in a client mode to connect to a DoIP-Switch with address <ip>. Not avaible in Demo Version. A 'Vehicle announcement message(0x0004)' is send over TCP/IP to the server. Behaviour is like describt in '9.2.1 Direct connection scenario'. -r Routing activation Request required. Automatically set by '-s <key>' parameter. Default: false -s <key> Enable security access. Not avaible in Demo Version. See below. –stmin <stmin> stMin for receiving messages from ECU. Default: 0. For possible values please see below. -t <vin sync-status> Report sync status ( values: 0 - Synchronised, 1 - not synchronized) –timeout <sec> Timeout in seconds (decimal) during a message is complete received via TCP. Current default: 10sec This timeout will be enabled, when a incomming message registered and disabled when the message is completly received. If timeout occurs, connection is closed by gateway. –timeout_send <msec> setsockopt( SO_SNDTIMEO). Zero means infinite -v <VIN|ip> VIN size 17 ASCII values. Mandatory parameter. For <ip> the ip address is set to VIN.
This DoIP - Isotp 15765-2 Gateway converts messages between Ethernet and CAN-BUS. The messages are converted between DoIP[ISO 13400-2:2012] and ISOTP[ISO 15765-2 Version 2016] Messages. Multiple DoIP-Tester can connect and send to multiple ECU. Typical usage is the Convertion from UDSonIP to UDSonCAN. +--------------+ | DoIP-Tester |-------------+ +-------+ +--------------+ \ +--| ECU | \ | +-------+ ********************* | +--------------+ UDSonIP ********************* UDSonCAN | +-------+ | DoIP-Tester | -------------> ** DoIP-ISOTP-GW **-------------+--| ECU | +--------------+ Ethernet ********************* CAN-BUS | +-------+ ********************* | / | +-------+ +--------------+ / +--| ECU | | DoIP-Tester |-------------+ | +-------+ +--------------+ | +-- ... ...
a) Extend the distance from your PC/Tester to your CAN-BUS. b) Have access from multiple testers in the network to your CAN-BUS with a single CAN-Adapter c) In '–ota' - mode you can access your CAN-BUS from anywhere in the world. Cloud/Server process is required.
Routing activation request OEM can be used to set individual address mode for each connection separatly.
+-------------------------------------—+ | 2 Byte | SA | +-------------------------------------—+ | 1 Byte | Activation type [0x00,0x01] | +-------------------------------------—+ | 4 Byte | Reserved 0x00000000 | +-------------------------------------—+ | 4 Byte | OEM: DoIP-ISOTP-GW specific* | +-------------------------------------—+
*OEM : 4 Byte DoIP-ISOTP-GW: +-------—+-----------------------------—+ | 1 Byte | CAN Response Format**/*** | +-------—+-----------------------------—+ | 1 Byte | CAN Request Format** | +-------—+-----------------------------—+ | 1 Byte | N_AE [bit 3 in Format**] | +-------—+-----------------------------—+ | 1 Byte | Padding [bit 4,5 in Format**] | +-------—+-----------------------------—+
**Request/Response - Format specification: +-----------—+----------------------------—+ | Bit position | Description | +-----------—+----------------------------—+ | 4,5 | 00 - use default padding | |(Request only)| 10 - use this Padding | | | 11 - not use Padding | +-----------—+----------------------------—+ | 3 | use N_AE extended addressing | +-----------—+----------------------------—+ | 2 | 0 - UUDT *** | | | 1 - USDT | +-----------—+----------------------------—+ | 1 | 0 - 11 bit | | | 1 - 29 bit | +-----------—+----------------------------—+ | 0 | 0 - no FC *** | | | 1 - use FC | +-----------—+----------------------------—+
*** not implemented in Demo Version
The format specifier are identically to the format specifier descript in D-PDU API/ISO 22900.
DOIP Diagnostic messages [0x8001] are forwared to ISOTP 15765-2 messages only. DoIP SA, TA are mapped to the ISOTP Header SA, TA. DoIP SA and TA have 16 bit, but ISOTP 15765-2 has only 8 bit. So only 8 bit are allowed in this DoIP-Gateway. ISOTP N_AE is defined by '-m Mixed:N_AE' option. Every DoIP-Diagnostic message enhances the ISOTP Response table that return messages can find their way back. Closing a TCP/IP connection cleans the response table from it's own entry.
Receive diagnostics message is planned in 'Non Demo Version' up to ~4GB independent of avaible memory.
In NON-Demo-Version this DoIP-ISOTP-Gateway can also work as a multiplexer to multiple CAN adapters by using the address mode 'Mixed'. Then N_AE selects the CAN-Adapter.
8 : 8 Bytes 9 : 12 Bytes 10 : 16 Bytes 11 : 20 Bytes 12 : 24 Bytes 13 : 32 Bytes 14 : 48 Bytes 15 : 64 Bytes
'doip_isotp_gw' supports IPv4 as well as IPv6 per default. In IPv6 doip_isotp_gw is listening on Broadcast address 'FF02::1'.
Only 'Physical' adressing is supported. 'Functional' addressing in Modes 'Fixed' and 'Mixed' are NOT supported.
'stMin' possible values to received ContinousFrames:
0x00 - 0x7F wait time between frames 0-127 msec. 0xF1 - 0xF9 wait time between frames 100-900 usec.
'doip_isotp_gw' has a context switch correction. So the CAN - Frames are send quite accurate within stMin time to the ECU. No further calculation is required.
On Linux 'ip link' is used to handle can interfaces.
Please set hardware paramter like frequence, txquelength, ... manually.
Be sure about 'qlen' should be greater than '-b <blocksize>' parameter to avoid dropping canframes. A value of 'qlen' >= 255 is recommended because of maximum block length.
Only 'mtu 72' can send CAN-FD frames. If you see 'mtu 16' on 'ip link', no CAN-FD is supported by your hardware.
Support of security login in that form that 'Routing activation Request' can return Routing activation response code 0x04 [Routing activation denied due to missing authentification].
Support Diagnostice over th air. Using the parameter –ota <ip>.
This DEMO Version is free to use without any warranty.
In case of error or features request, please report to '@PDUAPI_SUPPORT_EMAIL@' .
This DoIP-ISOTP-Gateway can be adapted to your personal needs. Please contact @PDUAPI_COPYRIGHT.
A minimal example is showned below:
>doip_isotp_gw -l 0x22 -v 12345678901234567
UDP-Broadcast-Send : Vehicle identification request UDP-Recv : Vehicle identification response TCP : Connect to doip_isotp_gw TCP-Send : Routing activation request TCP-Recv : Routine activation response - 0x10 success TCP-Send : UDS Message CAN : Recv UDS using ISOTP 15765-2 TCP-Recv : Diag Message Ack CAN : Send UDS-Response using ISOTP 15765-2 TCP-Recv : UDS Message (UDS Response) TCP-Send : Diag Message Ack TCP : shutdown/close