Introduction
It is assumed that the user reading this article is aware of the ISO OSI model of networks. This article would provide a basic understanding of the ISO OSI model that is used for automotive communication purposes, especially for vehicle diagnostics.
There have been many protocols that have been introduced in the automotive diagnostics space over many years and here is a good summary of the protocols with the layers that they belong to.
It is not as complicated as it looks at the first instance as you would be working not on all of them based on the aggregate ECU you are working on. Once the basic need for this layered architecture is clear, you would be able to navigate across any of these protocol stacks yourself with ease.
For the purpose of our deep dive discussion, we have taken examples from UDS on CAN.
Deep Dive
Let us take the example of two simple UDS diagnostics commands that is being communicated between an external tester and ECU over CAN line.
Command Set 1 (Read DTC Command):
• Tester to ECU: 19 02 AF
• ECU to Tester: 59 02 FF 06 15 00 AF 00 00 00 23 01 08 00 AF 21 76 00 AF 21 76 00 AF 09 16 00 AF 15 02 00 AF 21 22 00 AF 21 27 00 AF 15 06 00 AF 01 13 00 23 01 18 00 AF
See the traffic on CAN Bus for this request and response below:
We will now try to analyse this communication step by step. Flow of Request from Tester to ECU is illustrated below:
Flow of Response from ECU to Tester is illustrated below:
Application Layer:
If you observe, the request from the application layer of the tester starts with 1902FF (which is what is specified in UDS protocol standard – ISO 14229). Note that there is no bar on the length of the message you can push from this layer to the subsequent layer.
Transport Layer:
Here is where the ISO TP protocol ISO 15765 comes into picture (as we are using the CAN physical layer). As CAN protocol can take a maximum of 8 bytes per frame, this layer disassembles the request from application layer into 8 bytes each and feeds them into the lower layers for CAN communication. Read the ISO 15765 article for more details on how this layer operates.
Datalink Layer
Datalink layer adds CAN related headers and footers to this frame (coming from transport layer) and sends it to the physical layer for transmission on CAN lines.
Command Set 2 (Write VIN):
• Tester to ECU: 2E F1 90 4D 44 32 4A 50 43 58 4C 36 4C 43 30 37 33 33 30 37
• ECU to Tester: 6E F1 90
See the traffic on CAN Bus for this request and response below:
We will now try to analyse this communication step by step. Flow of Request from Tester to ECU is illustrated below:
Flow of Response from ECU to Tester is illustrated below:
For more information about the ISO OSI models and to practically learn this topic, you are welcome to subscribe to our YouTube channel or book for a training session on Automotive Diagnostics.