A modular, host-testable automotive diagnostics stack modelling:
CAN transport → ISO-TP segmentation/reassembly → UDS diagnostics → ECU simulation
This release is simulation-first and test-driven. It demonstrates protocol-layer architecture, defensive validation, deterministic behaviour, ECU/tester interaction, integration testing, reproducible CMake builds, and host-side tooling.
Scope: This is a host-side engineering model. It does not claim physical CAN transceiver validation, OEM interoperability, formal ISO conformance certification, production automotive cybersecurity certification, or vehicle-level validation.
| Area | Implementation |
|---|---|
| Language | C11 |
| Build | CMake |
| Test | CTest + deterministic C test executable |
| Transport | CAN frame model + virtual CAN bus |
| Segmentation | ISO-TP single/multi-frame + flow control |
| Diagnostics | UDS session, services, DTC, security |
| Simulation | Virtual CAN bus + ECU + tester |
| Tooling | C and Python host utilities |
| CI | GitHub Actions |
| Release | v1.0.0 |
| Verified direct tests | 13/13 passed |
| License | MIT |
Diagnostic Tester
/ Client
|
v
+-------------------------+
| UDS Layer |
| Sessions | Services |
| DTC | Security |
+-----------+-------------+
|
v
+-------------------------+
| ISO-TP Layer |
| SF | MF | Flow Control |
+-----------+-------------+
|
v
+-------------------------+
| CAN Layer |
| Frame | Bus | Filtering |
+-----------+-------------+
|
v
+---------------------------------------+
| Virtual CAN Bus / ECU Simulation |
| ECU Simulator + Tester Environment |
+---------------------------------------+
- Clear CAN / ISO-TP / UDS layer boundaries.
- Portable C11 implementation.
- Deterministic host-side behaviour.
- Defensive input validation.
- Explicit error/result handling.
- Reproducible CMake builds.
- Automated CTest verification.
- Unit and integration coverage.
- Separate ECU simulation from protocol logic.
- Small executable demonstrations.
- Host tooling separated from the core library.
- Documentation that states both capabilities and limitations.
- CI validation on pushes and pull requests.
- CAN frame representation and validation.
- Standard identifier handling.
- Payload length validation.
- Virtual FIFO-style bus.
- Identifier filtering.
- Deterministic host-side transport simulation.
- Single-frame transmission.
- Multi-frame transmission.
- Flow-control handling.
- Segmentation and reassembly.
- Transport validation and error-path tests.
The ISO-TP implementation is an educational/host-testable model, not a certified ISO 15765-2 implementation.
- Diagnostic session handling.
- Diagnostic service processing.
- DTC handling.
- Deterministic security-access state handling.
- Request/response processing.
- Error/negative-path behaviour.
- Virtual CAN transport.
- ECU simulation.
- Tester interaction.
- Deterministic request/response behaviour.
- CAN/ISO-TP/UDS integration testing.
Can-UDS-Automotive-Stack/
├── .github/
│ ├── workflows/
│ ├── ISSUE_TEMPLATE/
│ └── pull_request_template.md
├── cmake/
├── docs/
│ ├── architecture/
│ ├── design/
│ ├── protocol/
│ └── testing/
├── examples/
│ ├── can_demo/
│ ├── isotp_demo/
│ └── uds_demo/
├── include/
│ ├── can/
│ ├── common/
│ ├── ecu/
│ ├── isotp/
│ └── uds/
├── simulator/
│ ├── ecu/
│ ├── tester/
│ └── virtual_bus/
├── src/
│ ├── can/
│ ├── common/
│ ├── ecu/
│ ├── isotp/
│ └── uds/
├── tests/
│ ├── can/
│ ├── ecu/
│ ├── integration/
│ ├── isotp/
│ ├── test_vectors/
│ └── uds/
├── tools/
│ ├── log_analyzer/
│ ├── python/
│ └── uds_client/
├── screenshots/
├── CMakeLists.txt
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── PROJECT_INFO.md
├── SECURITY.md
└── VERSION
| Component | Responsibility |
|---|---|
| CAN frame | Representation and validation |
| CAN bus | Virtual transport |
| CAN filter | Identifier filtering |
| Common result/error | Deterministic error model |
| ISO-TP | Segmentation, reassembly, flow control |
| UDS | Diagnostic request/response processing |
| UDS session | Diagnostic session state |
| UDS DTC | Diagnostic trouble-code handling |
| UDS security | Deterministic test security behaviour |
| ECU | ECU configuration/simulation state |
| Virtual bus | Simulation transport environment |
| UDS tester | Tester-side interaction |
| Log analyzer | Host-side log utility |
| UDS client | Small host client API |
Clean Release build:
rm -rf build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config ReleaseCTest:
ctest --test-dir build --output-on-failureVerified:
100% tests passed, 0 tests failed out of 1
Direct deterministic test executable:
./build/can_uds_tests.exeVerified:
[PASS] CAN frame
[PASS] CAN bus
[PASS] CAN filter
[PASS] ISO-TP SF
[PASS] ISO-TP MF
[PASS] ISO-TP FC
[PASS] ISO-TP errors
[PASS] UDS session
[PASS] UDS services
[PASS] UDS DTC
[PASS] UDS security
[PASS] ECU
[PASS] UDS/CAN integration
ALL TESTS PASSED (13/13)
CTest exposes the complete deterministic suite as one aggregate test target; the executable reports the individual 13 passing test groups.
./build/can_demo.exe
./build/isotp_demo.exe
./build/uds_demo.exeVerified outputs:
CAN demo: virtual bus ready (0 pending)
ISO-TP demo: 2 frames / rc=0
UDS demo: SID 0x62, length 7
python -m py_compile tools/python/can_log_analyzer.py tools/python/trace_parser.py tools/python/uds_test_runner.pyThe verified Python utilities use the standard library only.
The release contains seven evidence images:
screenshots/01_build.pngscreenshots/02_tests.pngscreenshots/03_can_demo.pngscreenshots/04_isotp_demo.pngscreenshots/05_uds_demo.pngscreenshots/06_uds_client.pngscreenshots/07_log_analyzer.png
They document software execution only and are not physical-hardware validation.
docs/architecture/module_boundaries.md— module responsibilities.docs/architecture/system_architecture.md— system architecture.docs/design/error_handling.md— error/result behaviour.docs/design/state_machines.md— state-machine behaviour.docs/protocol/can.md— CAN model.docs/protocol/isotp.md— ISO-TP model.docs/protocol/uds.md— UDS model.docs/testing/test_matrix.md— test matrix.docs/testing/test_strategy.md— verification strategy.
- CMake 3.16+
- C11-capable compiler
- Ninja or another CMake generator
- Python 3
- Git
- CTest
Verified Windows environment: MinGW GCC 16.1.0 with Ninja.
git clone https://github.com/prasanth-vedula/Can-UDS-Automotive-Stack.git
cd Can-UDS-Automotive-Stack
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
ctest --test-dir build --output-on-failureThe security-access implementation is deliberately deterministic for testing. It is not a production authentication algorithm.
This repository is not:
- an OEM security implementation;
- a secure key-management system;
- a vehicle cybersecurity solution;
- evidence of ISO/SAE 21434 or UNECE R155/R156 compliance;
- a production ECU authentication mechanism.
See SECURITY.md.
The release does not claim:
- physical CAN-controller/transceiver testing;
- real vehicle-bus interoperability;
- OEM-specific diagnostic interoperability;
- production ECU timing validation;
- formal ISO 15765-2 conformance;
- formal ISO 14229 conformance;
- automotive functional-safety certification;
- production cybersecurity certification;
- hardware-in-the-loop validation.
- CAN frame/bus/filtering model.
- ISO-TP single/multi-frame and flow control.
- UDS sessions, services, DTC and deterministic security model.
- ECU and tester simulation.
- CAN/ISO-TP/UDS integration testing.
- CMake + CTest.
- GitHub Actions CI.
- C and Python tooling.
- Architecture/protocol/testing documentation.
- Seven release-evidence screenshots.
- Repository governance and MIT licensing.
- Additional UDS services.
- More complete ISO-TP timing/state handling.
- Timeout modelling.
- Expanded negative-response matrix.
- Hardware CAN adapter abstraction.
- Hardware-in-the-loop support.
- Additional protocol vectors.
- Coverage reporting.
- Static analysis.
- Sanitizer builds.
- Cross-platform CI.
Future items are not represented as completed features.
Determinism — repeatable host-side behaviour.
Modularity — independently understandable protocol layers.
Defensive design — malformed inputs and error paths are explicitly tested.
Traceability — documentation maps architecture to implementation areas.
Verification — CTest and direct executable results provide repeatable evidence.
Reproducibility — CMake provides a clean build path.
Transparency — simulation and compliance limitations are explicitly documented.
Before submitting changes:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
ctest --test-dir build --output-on-failureUpdate tests and documentation when behaviour changes. See CONTRIBUTING.md.
MIT License. See LICENSE.
Vedula China Venkata Prasanth
B.Tech — Electronics and Communication Engineering
Lendi Institute of Engineering and Technology
Vizianagaram, Andhra Pradesh, India
Email: vprasanth302@gmail.com
GitHub: https://github.com/prasanth-vedula
https://github.com/prasanth-vedula/Can-UDS-Automotive-Stack
Release: v1.0.0
Status: Stable for the documented host-simulation scope.