Automotive
UDS diagnostic services and security access
The request and response structure of ISO 14229, the services worth knowing by number, why a negative response is often more useful than a positive one, and what seed and key does and does not protect.
Standards referencedISO 14229-1ISO 14229-3ISO 15765-2ISO 15765-4
Generic OBD gives you a fixed, small, emissions-related vocabulary. Everything else a modern vehicle can be asked — read this configuration byte, run this actuator, write this variant coding, replace this software — travels on a different protocol.

The shape of the conversation
Every exchange is a request from the tester and a response from the ECU.
A read of data identifier 0x1001 from an ECU addressed at 0x7E0:
| Direction | CAN ID | Bytes | Meaning |
|---|---|---|---|
| Request | 0x7E0 |
03 22 10 01 |
length 3, service 0x22, identifier 10 01 |
| Response | 0x7E8 |
05 62 10 01 XX YY |
length 5, 0x22 + 0x40, echoed identifier, two data bytes |
Three things are worth memorising from that.
The positive response is the request plus 0x40. 0x22 becomes 0x62, 0x27 becomes 0x67,
0x31 becomes 0x71. You can read a trace in that direction without a lookup table.
The response address is the request address plus 8. 0x7E0 and 0x7E8 are the conventional
pair for the engine controller, and each controller has its own.
The identifier is echoed. Several reads may be outstanding at once, and the service byte alone would not tell you which response belonged to which request.
The negative response, which is the useful one
A rejection always takes the same three-byte form — 7F, the service that was rejected, and one
code saying why.
| Code | Means | What you do about it |
|---|---|---|
0x11 |
Service not supported | This ECU does not implement it at all |
0x13 |
Incorrect message length | Your request is malformed |
0x22 |
Conditions not correct | Right request, wrong moment — engine running, vehicle moving |
0x31 |
Request out of range | The identifier does not exist here |
0x33 |
Security access denied | Unlock first |
0x78 |
Response pending | Not a failure — wait, it is working on it |
0x78 catches people out. It is not an error — it means the operation will take longer than the
response timeout, so the ECU is asking for more time. A flash routine may send dozens of them.
The services worth knowing by number
| SID | Service | Used for |
|---|---|---|
0x10 |
DiagnosticSessionControl | Change session — almost always the first message |
0x11 |
ECUReset | Reboot, hard or soft |
0x14 |
ClearDiagnosticInformation | Erase stored codes |
0x19 |
ReadDTCInformation | Read codes, with status and snapshot data |
0x22 |
ReadDataByIdentifier | Read anything the manufacturer has defined |
0x27 |
SecurityAccess | Seed and key |
0x2E |
WriteDataByIdentifier | Configuration, coding, calibration values |
0x31 |
RoutineControl | Start, stop or poll an ECU-side routine |
0x34 0x36 0x37 |
RequestDownload, TransferData, RequestTransferExit | Flashing, in that order |
0x3E |
TesterPresent | Keeps a non-default session alive |
Sessions and security
Sessions
An ECU is normally in the default session, where only safe reads are available. The tester
changes that with 0x10.
- Default — read data, read codes. Nothing that changes behaviour.
- Extended — routine control, configuration writes, actuator tests.
- Programming — erase and download.
A non-default session must be kept alive with periodic 0x3E TesterPresent. If the messages stop,
the ECU falls back to default and any unlock is lost. That is deliberate — an abandoned session
must not leave a vehicle sitting unlocked.
Seed and key
- Tester requests a seed.
- ECU generates a fresh random seed and returns it.
- Tester computes a key from the seed using a secret algorithm.
- ECU computes the same function and compares.
The secret is the algorithm, never a transmitted value. Because the seed is new each time, a recorded exchange cannot be replayed, and repeated failures trigger a mandatory delay.
Messages longer than a frame
A CAN frame carries eight bytes. Most real requests are longer, so a transport layer sits underneath.
- Single frame — payload fits, the first byte is the length.
- First frame — the start of a long message, declaring the total length.
- Flow control — the receiver replies saying how many frames it will accept before the next flow control and how fast to send them.
- Consecutive frames — the rest, each carrying a rolling sequence number.
The flow control step is the one that surprises people. The receiver sets the pace, not the sender. An ECU busy with something else will legitimately slow a flash down, and a tool that ignores the requested separation time will produce corrupted transfers that look like hardware faults.
What to take away
- OBD standardises a small emissions vocabulary. UDS standardises the grammar and leaves the vocabulary to the manufacturer.
- Positive response equals request plus
0x40; response address equals request address plus 8. - A negative response is three bytes, and the third one separates five quite different problems.
0x78means wait, not fail.- Services are gated by session, and a non-default session dies if TesterPresent stops.
- Seed and key stops casual access and identifies nobody. The algorithm is shared across the fleet, so one leak affects all of it.
- On CAN, the receiver sets the pace of a long transfer, not the sender.
Next, what to do when the protocol says everything is fine and the vehicle disagrees — oscilloscope and CAN waveform diagnosis.
Check your understanding
10 questions. Nothing is recorded — this is just for you.
