DoIP Messages

class doipclient.messages.AliveCheckRequest

Alive check request - Table 27

class doipclient.messages.AliveCheckResponse(source_address)

Alive check resopnse - Table 28

property source_address

Source address (SA)

Description: “Contains the logical address of the client DoIP entity that is currently active on this TCP_DATA socket”

Values: From Table 13

  • 0x0000 = ISO/SAE reserved

  • 0x0001 to 0x0DFF = VM specific

  • 0x0E00 to 0x0FFF = Reserved for addresses of client

  • 0x1000 to 0x7FFF = VM Specific

  • 0x8000 to 0xE3FF = Reserved

  • 0xE400 to 0xE3FF = VM defined functional group logical addresses

  • 0xF000 to 0xFFFF = Reserved

class doipclient.messages.DiagnosticMessage(source_address, target_address, user_data)

Diagnostic Message - see Table 21 “Payload type diagnostic message structure”

Description: Wrapper for diagnostic (UDS) payloads. The same message is used for TX and RX, and the ECU will confirm receipt with either a DiagnosticMessageNegativeAcknowledgement or a DiagnosticMessagePositiveAcknowledgement message

property source_address

Source address (SA)

Description: “Contains the logical address of the sender of a diagnostic messag (e.g. the client DoIP entity address).”

Values: From Table 13

  • 0x0000 = ISO/SAE reserved

  • 0x0001 to 0x0DFF = VM specific

  • 0x0E00 to 0x0FFF = Reserved for addresses of client

  • 0x1000 to 0x7FFF = VM Specific

  • 0x8000 to 0xE3FF = Reserved

  • 0xE400 to 0xE3FF = VM defined functional group logical addresses

  • 0xF000 to 0xFFFF = Reserved

property target_address

Target address (TA)

Description: “Contains the logical address of the receiver of a diagnostic message (e.g. a specific server DoIP entity on the vehicle’s networks).”

Values: From Table 13

  • 0x0000 = ISO/SAE reserved

  • 0x0001 to 0x0DFF = VM specific

  • 0x0E00 to 0x0FFF = Reserved for addresses of client

  • 0x1000 to 0x7FFF = VM Specific

  • 0x8000 to 0xE3FF = Reserved

  • 0xE400 to 0xE3FF = VM defined functional group logical addresses

  • 0xF000 to 0xFFFF = Reserved

property user_data

User data (UD)

Description: Contains the actual diagnostic data (e.g. ISO 14229-1 diagnostic request), which shall be routed to the destination (e.g. the ECM).

Values: Bytes/Bytearray

class doipclient.messages.DiagnosticMessageNegativeAcknowledgement(source_address, target_address, nack_code, previous_message_data=bytearray(b''))

A negative acknowledgement of the previously received diagnostic (UDS) message.

Indicates that the previously received diagnostic message was rejected. Reasons could include a message being too large, incorrect logical addresses, etc.

See Table 25 - “Payload type diagnostic message negative acknowledgment structure”

class NackCodes(value)

Diagnostic message negative acknowledge codes (See Table 26)

property nack_code

NACK code

Indicates the reason the diagnostic message was rejected

property previous_message_data

Previous diagnostic message data

An optional copy of the diagnostic message which is being acknowledged.

property source_address

Source address (SA)

Description: “Contains the logical address of the (intended) receiver of the previous diagnostic message (e.g. a specific server DoIP entity on the vehicle’s networks).”

Values: From Table 13

  • 0x0000 = ISO/SAE reserved

  • 0x0001 to 0x0DFF = VM specific

  • 0x0E00 to 0x0FFF = Reserved for addresses of client

  • 0x1000 to 0x7FFF = VM Specific

  • 0x8000 to 0xE3FF = Reserved

  • 0xE400 to 0xE3FF = VM defined functional group logical addresses

  • 0xF000 to 0xFFFF = Reserved

property target_address

Target address (TA)

Description: “Contains the logical address of the sender of the previous diagnostic message (i.e. the client DoIP entity address).”

Values: (See source_address)

class doipclient.messages.DiagnosticMessagePositiveAcknowledgement(source_address, target_address, ack_code, previous_message_data=bytearray(b''))

A positive acknowledgement of the previously received diagnostic (UDS) message.

“…indicates a correctly received diagnostic message, which is processed and put into the transmission buffer of the destination network.”

See Table 23 - “Payload type diagnostic message acknowledgement structure”

property ack_code

ACK code

Values: Required to be 0x00. All other values are reserved

property previous_message_data

Previous diagnostic message data

An optional copy of the diagnostic message which is being acknowledged.

property source_address

Source address (SA)

Description: “Contains the logical address of the (intended) receiver of the previous diagnostic message (e.g. a specific server DoIP entity on the vehicle’s networks).”

Values: From Table 13

  • 0x0000 = ISO/SAE reserved

  • 0x0001 to 0x0DFF = VM specific

  • 0x0E00 to 0x0FFF = Reserved for addresses of client

  • 0x1000 to 0x7FFF = VM Specific

  • 0x8000 to 0xE3FF = Reserved

  • 0xE400 to 0xE3FF = VM defined functional group logical addresses

  • 0xF000 to 0xFFFF = Reserved

property target_address

Target address (TA)

Description: “Contains the logical address of the sender of the previous diagnostic message (i.e. the client DoIP entity address).”

Values: (See source_address)

class doipclient.messages.DiagnosticPowerModeRequest

Diagnostic power mode information request - Table 8

class doipclient.messages.DiagnosticPowerModeResponse(diagnostic_power_mode)

Diagnostic power mode information response - Table 9

class DiagnosticPowerMode(value)

Diagnostic power mode - See Table 9

property diagnostic_power_mode

Diagnostic power mode

Description: “Identifies whether or not the vehicle is in diagnostic power mode and ready to perform reliable diagnostics.

class doipclient.messages.DoIPMessage

Base class for DoIP messages implementing common features like comparison, and representation

class doipclient.messages.DoipEntityStatusRequest

DoIP entity status request - Table 10

class doipclient.messages.EntityStatusResponse(node_type, max_concurrent_sockets, currently_open_sockets, max_data_size=None)

DoIP entity status response. Table 11

property currently_open_sockets

Currently open TCP_DATA sockets (NCTS)

Description: “Number of currently established sockets.”

Values: 0 to 255

property max_concurrent_sockets

Max. concurrent TCP_DATA sockets (MCTS)

Description: “Represents the maximum number of concurrent TCP_DATA sockets allowed with this DoIP entity, excluding the reserve socket required for socket handling.”

Values: 1 to 255

property max_data_size

Max. data size (MDS)

Description: “Maximum size of one logical request that this DoIP entity can process.”

Values: 0 to 4GB

property node_type

Node type(NT)

Description: “Identifies whether the contacted DoIP instance is either a DoIP node or a DoIP gateway.”

Values:

  • 0x00: DoIP gateway

  • 0x01: DoIP node

  • 0x02 .. 0xFF: reserved

class doipclient.messages.GenericDoIPNegativeAcknowledge(nack_code)

Generic header negative acknowledge structure. See Table 18

class NackCodes(value)

Generic DoIP header NACK codes. See Table 19

property nack_code

Generic DoIP header NACK code

Description: “The generic header negative acknowledge code indicates the specific error, detected in the generic DoIP header, or it indicates an unsupported payload or a memory overload condition.”

class doipclient.messages.ReservedMessage(payload_type, payload)

DoIP message whose payload ID is reserved either for manufacturer use or future expansion of DoIP protocol

property payload

Raw payload bytes

property payload_type

Raw payload type (ID)

class doipclient.messages.RoutingActivationRequest(source_address, activation_type, reserved=0, vm_specific=None)

Routing activation request. Table 46

class ActivationType(value)

See Table 47 - Routing activation request activation types

property activation_type

Activation type

Description: “Indicates the specific type of routing activation that may require different types of authentication and/or confirmation.”

property reserved

Reserved - should be 0x00000000

property source_address

Source address (SA)

Description: “Address of the client DoIP entity that requests routing activation. This is the same address that is used by the client DoIP entity when sending diagnostic messages on the same TCP_DATA socket.”

Values: From Table 13

  • 0x0000 = ISO/SAE reserved

  • 0x0001 to 0x0DFF = VM specific

  • 0x0E00 to 0x0FFF = Reserved for addresses of client

  • 0x1000 to 0x7FFF = VM Specific

  • 0x8000 to 0xE3FF = Reserved

  • 0xE400 to 0xE3FF = VM defined functional group logical addresses

  • 0xF000 to 0xFFFF = Reserved

property vm_specific

Reserved for VM-specific use

class doipclient.messages.RoutingActivationResponse(client_logical_address, logical_address, response_code, reserved=0, vm_specific=None)

Payload type routing activation response.

class ResponseCode(value)

See Table 48

property client_logical_address

Logical address of client DoIP entity

Description: “Logical address of the client DoIP entity that requested routing activation.”

Values: From Table 13

  • 0x0000 = ISO/SAE reserved

  • 0x0001 to 0x0DFF = VM specific

  • 0x0E00 to 0x0FFF = Reserved for addresses of client

  • 0x1000 to 0x7FFF = VM Specific

  • 0x8000 to 0xE3FF = Reserved

  • 0xE400 to 0xE3FF = VM defined functional group logical addresses

  • 0xF000 to 0xFFFF = Reserved

property logical_address

Logical address of DoIP entity

Description: “Logical address of the responding DoIP entity.”

Values: See client_logical_address

property reserved

Reserved value - 0x00000000

property response_code

Routing activation response code

Description: “Response by the DoIP gateway. Routing activation denial results in the TCP_DATA connection being reset by the DoIP gateway. Successful routing activation implies that diagnostic messages can now be routed over the TCP_DATA connection.

property vm_specific

Reserved for VM-specific use

Description: “Available for additional VM-specific use.”

class doipclient.messages.VehicleIdentificationRequest

Vehicle identification request message. See Table 2

class doipclient.messages.VehicleIdentificationRequestWithEID(eid)

Vehicle identification request message with EID. See Table 3

property eid

EID

Description: “This is the DoIP entity’s unique ID (e.g. network interface’s MAC address) that shall respond to the vehicle identification request message.”

class doipclient.messages.VehicleIdentificationRequestWithVIN(vin)

Vehicle identification request message with VIN. See Table 4

property vin

VIN

Description: “This is the vehicle’s identification number asspecified in ISO 3779. This parameter is only present if the client DoIP entity intends toidentify the DoIP entities of an individual vehicle, the VIN of which is known to the client DoIP entity.”

Values: ASCII

class doipclient.messages.VehicleIdentificationResponse(vin, logical_address, eid, gid, further_action_required, vin_gid_sync_status=None)

Payload type vehicle announcement/identification response message Table 5

class FurtherActionCodes(value)

Further Action Code Values (Table 6)

  • 0x00 = No further action required

  • 0x01 = Reserved

  • 0x10 = Routing activation required to initiate central security

  • 0x11..0xff = available for additional VM-specific use

class SynchronizationStatusCodes(value)

VIN/GID synchronization status code values (Table 7)

  • 0x00 = VIN and/or GID are synchronized

  • 0x01 = Reserved

  • 0x10 = Incomplete: VIN and GID are not synchronized

  • 0x11..0xff = Reserved

property eid

EID

Description: “This is a unique identification of the DoIP entities in order to separate their responses even before the VIN is programmed to, or recognized by, the DoIP devices (e.g. during the vehicle assembly process). It is recommended that the MAC address information of the DoIP entity’s network interface be used (one of the interfaces if multiple network interfaces are implemented).”

Values: “Not set” values are 0x00 or 0xff.

property further_action_required

Further action required

Description: “This is the additional information to notify the client DoIP entity that there are either DoIP entities with no initial connectivity or that a centralized security approach is used.”

property gid

GID

Description: “This is a unique identification of a group of DoIP entities within the same vehicle in the case that a VIN is not configured for that vehicle… If the GID is not available at the time of transmission of this message, this shall be indicated using the specific invalidity” (“not set”) value of 0x00 or 0xff.

property logical_address

Logical Address

Description: “This is the logical address that is assigned to the responding DoIP entity (see 7. 8 for further details). The logical address can be used, for example, to address diagnostic requests directly to the DoIP entity.”

Values: From Table 13

  • 0x0000 = ISO/SAE reserved

  • 0x0001 to 0x0DFF = VM specific

  • 0x0E00 to 0x0FFF = Reserved for addresses of client

  • 0x1000 to 0x7FFF = VM Specific

  • 0x8000 to 0xE3FF = Reserved

  • 0xE400 to 0xE3FF = VM defined functional group logical addresses

  • 0xF000 to 0xFFFF = Reserved

property vin

VIN

Description: “This is the vehicle’s VIN as specified in ISO 3779. If the VIN is not configured at the time of transmission of this message, this should be indicated using the invalidity value {0x00 or 0xff}… In this case, the GID is used to associate DoIP nodes with a certain vehicle…”

Values: ASCII

property vin_sync_status

VIN/GID sync. status

Description: “This is the additional information to notify the client DoIP entity that all DoIP entities have synchronized their information about the VIN or GID of the vehicle”