Reputation: 687
Read a lot of specifications and still can't get a simple thing.
All UDS requests encapsulated in ISO-TP packets, which are encapsulated in simple CAN frames, so ECU constantly receives a stream of frames from CAN bus.
How does ECU decide that this CAN frame is a part of any high-level protocol?
For example, I've sent Security request to ECU, CAN frame data will look like this
02 27 01
How does ECU determine that this is not just a chunk of data but a part of the protocol?
I wasn't able to find any relation to ISO/OSI stack when high-level protocols "talk to each other" using headers, so we know how to decode data packets.
Upvotes: 1
Views: 6890
Reputation: 612
If we are talking about Diagnostic on CAN, then to be able to say whether this communication is using UDS protocol you need to know:
The only way to be sure that the communication you are observing is diagnostic communication is basing on OEM (e.g. Toyota, FIAT) requirements. So basically, you need to get some piece of documentation or get an access to their standards about diagnostic communication. Those information are either public or have leaked for older car models.
If you have an option to observe diagnostic (UDS) communication, then you would be able to figure out most of the previously mentioned variables/parameters.
In every diagnostic communication you will see Tester Present and Diagnostic Session Control services being used. So you can look for:
Tester Present requests will have following data
might be one byte here 02 3E 00 might be data padding here
might be one byte here 02 3E 80 might be data padding here
Tester Present response will have following data
might be one byte here 02 7E 00 might be data padding here
Diagnostic Session Control request will have following data
might be one byte here 02 10 XX might be data padding here
Diagnostic Session Control response will have following data
might be one byte here 02 50 XX or 06 50 XX YY ZZ WW VV might be data padding here
Just sending blindly requests (e.g. Tester Present) and hoping for a response. If we assume Normal Fixed Addressing format (which is most likely to be used), this is relatively possible to figure out.
Upvotes: 0
Reputation: 11
UDS via CAN is specified in the DoCAN ISO-15765-2 part and describe the network and transport layer for a functional (broadcast) and physical (p2p) communication between ECUs or better control functions.
Normal CAN id's don't implement any network functionalities like a addressing. For that purpose the SAE J1939 network layer is used. In a J1939 network each CAN client has a address and each functionality a parameter group (PGN). All of this is encoded in a 29bit CAN ID. For example the CAN ID 0x18EF8081. This will transport a message from the CAN client 0x81 to 0x80 via the PGN 0xEF, 0x18 is the priority.
In UDS over CAN the PGNs 0xDA (physical) and 0xDB (functional) are used for all communications. With that information's you can implement a CAN ID filter which match only the PGN part of the CAN ID.
Upvotes: 1
Reputation: 137442
The CAN message IDs that are used for specific protocols are defined per system.
In most cases the OBD-II will be sent over CAN ID 7DFh for the query and higher IDs for responses from different modules, but even that might be different on specific car models.
One way of figuring out the CAN IDs that are used for UDS-based communication is to send simple tester-present (SID 3Eh) messages and watching for CAN IDs which seems to have an appropriate response.
Upvotes: 2