Diagnostic session (DiagnosticSessionControl 0x10)
UDS DiagnosticSessionControl (0x10) switches an ECU between default, extended and programming session. Bytes, timing parameters and what to validate.
Updated This page as Markdown
In short
A diagnostic session is the mode a UDS server runs in, selected with DiagnosticSessionControl (0x10). The request 10 03 enters the extended session, the positive response 50 03 carries the P2 and P2* timing. Default (01), programming (02) and extended (03) are standard. Each session enables a different set of services, so session handling decides which functions a tester can reach.
What is a diagnostic session?
A diagnostic session is the operating mode of a UDS server, and DiagnosticSessionControl (0x10) is the service that selects it. Every ECU starts in the default session after power-up. The tester switches to another session to reach services that are not available by default.
A normal exchange looks like this:
| Direction | Bytes | Meaning |
|---|---|---|
| Request | 10 03 | enter extendedDiagnosticSession |
| Positive response | 50 03 00 32 01 F4 | P2server_max 50 ms, P2*server_max 5000 ms |
| Negative response | 7F 10 22 | conditionsNotCorrect, e.g. vehicle speed not zero |
Other typical negative responses are 7F 10 12 (subFunctionNotSupported), 7F 10 13 (incorrectMessageLengthOrInvalidFormat) and 7F 10 7E (subFunctionNotSupportedInActiveSession, for example programming session requested from default session when the ECU requires the extended session first). With the suppressPosRspMsgIndicationBit set, 10 83, the ECU switches without answering.
Where is it defined?
ISO 14229-1:2020 defines DiagnosticSessionControl (0x10) in the Diagnostic and communication management functional unit, together with ECUReset, TesterPresent and CommunicationControl. The standard lists the session types, the response parameter record and the rule that a session change resets session-dependent states, such as an unlocked security level. The transport underneath on CAN is ISO 15765-2.
What it means in practice
The session is the first gate in a diagnostic design. Which services and data identifiers answer in which session is defined by the OEM diagnostic specification, usually in an ODX or CDD file. In validation, engineers check:
- every service is available only in the sessions the specification lists, and answers
7F xx 7F(serviceNotSupportedInActiveSession) elsewhere; - allowed and forbidden session transitions, for example programming only from extended;
- wrong length (
10alone or10 03 00) gives NRC 0x13; - the S3 timeout returns the ECU to default session and drops every state that belongs to the old session;
- the timing values in the response match the specification.
We regularly see services reachable in the default session that the specification places in the extended session. That is a configuration error, and it is easy to miss without a full sweep per session.
How AutoST tests it
AutoST enumeration discovers the sessions an ECU accepts, including extended and programming, and then sweeps every service ID from 0x00 to 0xFE in each session, classifying the answer. The result is a session-by-service matrix that you can compare against your diagnostic specification. The programming session is tested last and can be skipped, because some ECUs get stuck in it.
FAQ
Frequently asked questions
Which sessions does ISO 14229-1 define?
The standard defines defaultSession (0x01), programmingSession (0x02), extendedDiagnosticSession (0x03) and safetySystemDiagnosticSession (0x04). Values from 0x40 to 0x5F are reserved for vehicle manufacturers and 0x60 to 0x7E for system suppliers, so many ECUs add their own sessions.
What do the four bytes after 50 03 mean?
They are the session parameter record: two bytes P2server_max in milliseconds and two bytes P2*server_max in units of 10 ms. 00 32 01 F4 means 50 ms and 5000 ms.
Why does the ECU fall back to default session on its own?
In any non-default session the S3 server timer runs. If no request or TesterPresent arrives before it expires, the ECU returns to the default session, as the standard requires.
Sources
- ISO 14229-1:2020 Road vehicles, Unified diagnostic services (UDS), Part 1: Application layer, Diagnostic and communication management functional unit, DiagnosticSessionControl (0x10)
- ISO 15765-2 Road vehicles, Diagnostic communication over CAN (DoCAN), Part 2: Transport protocol and network layer services
Related pages
- GlossaryUDS (Unified Diagnostic Services)UDS (ISO 14229) is the diagnostic protocol of most automotive ECUs: sessions, services, DIDs and SecurityAccess. What it defines and why it is the first attack surface.
- GlossaryTesterPresent (0x3E)UDS TesterPresent (0x3E) keeps a non-default session alive. Request and response bytes, the suppress bit, the S3 server timer, and the session bugs it exposes.
- GlossaryProgramming Session (0x10 0x02)The UDS programming session (10 02) is the diagnostic mode for reflashing an ECU. How it is entered, which services it unlocks and why it is the most sensitive one.
- PlatformKnow every door into the ECU.AutoST enumerates an ECU over UDS: diagnostic endpoints, sessions, all 255 services and readable DIDs, plus XCP/CCP discovery. Risky services are flagged automatically.
- InsightsECU reset and session handling bugs, and how to test themHow to test UDS session and reset handling: session fallback, S3 timeout, security state after reset, TesterPresent keeping a session alive, and what each result means.
- Free toolsUDS Message DecoderPaste UDS bytes from a trace and see what they mean: service, sub-function, session, DIDs, routine identifier, SecurityAccess level or NRC, per ISO 14229-1.
