| Attack Vector | Threat | Affected Layer | Mitigation |
|---|---|---|---|
| OBD port sniffing | Passive capture of all vehicle frames | L2 (Ethernet) | MACsec encryption on OBD-facing port |
| OBD port injection | Attacker injects malicious Ethernet frames | L2 | MACsec authentication; port isolation VLAN |
| Compromised IVI ECU | IVI sends malicious SOME/IP to ADAS | L3/L7 | Firewall at gateway; IPsec tunnel between domains |
| Remote OTA hijack | Malicious firmware delivered via Ethernet | L7 | TLS 1.3 for all OTA connections; code signing |
| DoIP remote exploit | Attacker gains UDS access remotely | L7 (DoIP) | TLS 1.3 mandatory for remote DoIP; authentication 0x29 |
| gPTP spoofing | Fake grandmaster disrupts time sync | L2 | 802.1AS authenticated gPTP (802.1AS-2020 annex P) |
Automotive Ethernet Threat Model
MACsec: IEEE 802.1AE Layer-2 Security
Standard Ethernet frame:
[Dst MAC][Src MAC][EtherType][Payload]
MACsec protected frame:
[Dst MAC][Src MAC][SecTAG: 0x88E5][Encrypted Payload][ICV: 16 bytes]
SecTAG (8 bytes):
├── EtherType: 0x88E5 (MACsec)
├── TCI: Tag Control Information (version, ES, SC, E, C bits)
├── AN: Association Number (key index 0–3)
├── SL: Short Length (for less-than-full-padding frames)
└── PN: Packet Number (replay attack detection)
ICV: Integrity Check Value (16 bytes, GCM-AES-128 or GCM-AES-256)
Covers: SecTAG + encrypted payload; detected modification → frame dropped
Key agreement: MKA (MACsec Key Agreement, IEEE 802.1X-2020)
Pre-shared key (PSK) or certificate-based per IEEE 802.1X EAP-TLS
Overhead: 32 bytes per frame (8 SecTAG + 16 ICV + 8 IV)
Latency: hardware MACsec: <1 µs; software MACsec: 5–20 µs
AUTOSAR: SecOc (Secure On-board Communication) for CAN/Eth at PDU level
MACsec: hardware-level; transparent to software above L2IPsec for Inter-Domain ECU Communication
| Aspect | MACsec | IPsec | TLS 1.3 |
|---|---|---|---|
| Layer | L2 (Ethernet frame) | L3 (IP packet) | L4-L7 (TCP/UDP payload) |
| Scope | Point-to-point (one hop) | End-to-end (across routers) | End-to-end (application) |
| Overhead | 32 bytes/frame | ~50 bytes/packet (ESP + IV + ICV) | ~50 bytes (record header + MAC) |
| Key management | MKA (802.1X) | IKEv2 | TLS handshake |
| Automotive use | Switch port protection, V2X | Inter-domain tunnels (ADAS↔Cloud) | DoIP remote, OTA, V2X |
| Hardware support | Integrated in automotive MACs | Dedicated crypto engine | Requires SW stack + crypto |
Summary
Automotive Ethernet security is layered: MACsec at L2 protects each physical link segment from eavesdropping and injection; IPsec tunnels protect inter-domain communication across L3 routing; TLS 1.3 protects application layer communication with remote servers. ISO/SAE 21434 and UNECE R155 require a TARA (Threat Analysis and Risk Assessment) that maps each threat to a mitigation — the three-layer security model satisfies most attack vectors identified in TARA. The most critical immediate requirement is TLS 1.3 for remote DoIP connections — plain-text DoIP over the internet is a production-blocking vulnerability.
🔬 Deep Dive — Core Concepts Expanded
This section builds on the foundational concepts covered above with additional technical depth, edge cases, and configuration nuances that separate competent engineers from experts. When working on production ECU projects, the details covered here are the ones most commonly responsible for integration delays and late-phase defects.
Key principles to reinforce:
- Configuration over coding: In AUTOSAR and automotive middleware environments, correctness is largely determined by ARXML configuration, not application code. A correctly implemented algorithm can produce wrong results due to a single misconfigured parameter.
- Traceability as a first-class concern: Every configuration decision should be traceable to a requirement, safety goal, or architecture decision. Undocumented configuration choices are a common source of regression defects when ECUs are updated.
- Cross-module dependencies: In tightly integrated automotive software stacks, changing one module's configuration often requires corresponding updates in dependent modules. Always perform a dependency impact analysis before submitting configuration changes.
🏭 How This Topic Appears in Production Projects
- Project integration phase: The concepts covered in this lesson are most commonly encountered during ECU integration testing — when multiple software components from different teams are combined for the first time. Issues that were invisible in unit tests frequently surface at this stage.
- Supplier/OEM interface: This is a topic that frequently appears in technical discussions between Tier-1 ECU suppliers and OEM system integrators. Engineers who can speak fluently about these details earn credibility and are often brought into critical design review meetings.
- Automotive tool ecosystem: Vector CANoe/CANalyzer, dSPACE tools, and ETAS INCA are the standard tools used to validate and measure the correct behaviour of the systems described in this lesson. Familiarity with these tools alongside the conceptual knowledge dramatically accelerates debugging in real projects.
⚠️ Common Mistakes and How to Avoid Them
- Assuming default configuration is correct: Automotive software tools ship with default configurations that are designed to compile and link, not to meet project-specific requirements. Every configuration parameter needs to be consciously set. 'It compiled' is not the same as 'it is correctly configured'.
- Skipping documentation of configuration rationale: In a 3-year ECU project with team turnover, undocumented configuration choices become tribal knowledge that disappears when engineers leave. Document why a parameter is set to a specific value, not just what it is set to.
- Testing only the happy path: Automotive ECUs must behave correctly under fault conditions, voltage variations, and communication errors. Always test the error handling paths as rigorously as the nominal operation. Many production escapes originate in untested error branches.
- Version mismatches between teams: In a multi-team project, the BSW team, SWC team, and system integration team may use different versions of the same ARXML file. Version management of all ARXML files in a shared repository is mandatory, not optional.
📊 Industry Note
Engineers who master both the theoretical concepts and the practical toolchain skills covered in this course are among the most sought-after professionals in the automotive software industry. The combination of AUTOSAR standards knowledge, safety engineering understanding, and hands-on configuration experience commands premium salaries at OEMs and Tier-1 suppliers globally.