DBC - CAN Database

A DBC file (CAN database) is an ASCII-based, human-readable text format used primarily in the automotive industry. It defines how raw CAN frames (messages) are structured and how to interpret their data as meaningful signals like engine RPM, vehicle speed, or battery voltage.

Key Context

  • Standardized Description
    DBC files define the structure of CAN messages, including message IDs, lengths, and transmitters.
  • Human-Readable Format
    They translate raw hexadecimal CAN data into interpretable physical values.
  • Created by Vector Informatik
    The format is proprietary, developed by Vector, and has become the de facto standard.
  • Editable Format
    Plain text, DBC files can be edited manually or generated via tools.

Structure of a DBC File

Messages (BO_)

BO_ <ID> <Name>: <DLC> <Transmitter>

Defines a CAN message with:

  • ID: Unique arbitration identifier
  • Name: Descriptive label for human readability
  • DLC: Number of data bytes (0–8 for classic CAN, up to 64 for CAN FD)
  • Transmitter: The ECU that sends this message

Signals (SG_)

SG_ <Name> [<mux>?] : <StartBit>|<Length>@<Endian><Sign> (<Scale>,<Offset>) [<Min>|<Max>] "<Unit>" <Receiver>

Specifies a signal with:

  • Bit position and length: Where the signal starts in the payload
  • Endianess: Intel (@1) or Motorola (@0) bit ordering
  • Signedness: + (unsigned), - (signed)
  • Scaling and offset: Transforms raw bits to physical units
  • Bounds and units: Min, max values and associated units
  • Receiver(s): Target ECUs

Value Tables (VAL_)

VAL_ <MessageID> <SignalName> <RawValue> "<Label>" ... ;

Creates human-readable enums, useful for states or flags.

Comments & Attributes

  • CM_ BO_ <ID> "message comment"
  • CM_ SG_ <MessageName> <SignalName> "signal comment"Used to document message and signal behavior.

Example DBC Snippet

BO_ 256 EngineStatus: 8 EngineECU
SG_ EngineSpeed : 0|16@1+ (0.125,0) [0|8000] "rpm" Dashboard,Logger
SG_ OilTemp      : 16|8@0- (1,-40) [-40|215] "°C" Dashboard
SG_ StatusFlag   : 24|2@1+ (1,0) [0|3] "" EngineECU,Dashboard
VAL_ 256 StatusFlag 0 "OK" 1 "WARN" 2 "ERROR" 3 "FAULT";
CM_ BO_ 256 "Engine status message"
CM_ SG_ 256 EngineSpeed "Engine rotational speed"

Technical Explanation: Signal Decoding Workflow

  1. Read CAN Frame:Example frame: 0x100 [8] 00 3C 00 01 00 00 00 00
  2. Locate Message by ID:Match 0x100 to EngineStatus in the DBC file.
  3. Extract Signal:
    • EngineSpeed starts at bit 0, 16 bits, little-endian.
    • Raw bytes: 00 3C0x3C00 → 15360 (raw)
  4. Apply Scaling:
    • Scale: 0.125
    • Physical value: 15360 * 0.125 = 1920 rpm
  5. Display or Store:
    • Store in log, display on dashboard, or transmit over diagnostics.

How Penzzer Enhances DBC-Based Testing

Penzzer automates structured testing of DBC-enabled systems:

  1. DBC-Aware Input Derivation
    • Parses DBC to identify messages, signals, value ranges, and mappings.
  2. Structured Fuzzing
    • Exhaustively tests all signals with boundary values, invalid data types, malformed messages.
  3. Response Monitoring
    • Observes CAN responses, reboots, diagnostic trouble codes, error frames.
  4. Coverage Analysis
    • Logs signal coverage, uncaptured states, edge-case behaviors.
  5. Security Insight
    • Identifies unintended behavior, message injection vulnerabilities, protocol mishandling.
  6. CI/CD Integration
    • Hooks into build/test pipelines for regression and security testing.

Real-World Case Studies

1. Automated Reverse Engineering of Instrument Clusters

A university research team used CAN fuzzing to discover undocumented messages in instrument clusters from cars and trucks. They used RGB sensors to monitor dashboard responses while sending structured and brute-force messages.

  • Identified response-triggering messages without prior DBCs.
  • Discovered unexpected error-handling behavior.
  • Validated CAN signal-to-display relationships.

2. Fuzz Testing ECUs for Security Auditing

OEMs used CAN-based fuzzing to test the robustness of ECUs to malformed signals. One study showed a 38% increase in anomaly detection using fuzzing compared to manual testing.

3. Kvaser & Intrepid Tool Integration

Commercial toolsets support fuzzing by letting users mutate known-good DBC-based messages, generating malformed or edge-case signals to monitor system behavior.

Use Case Deep Dive: Infotainment ECU Validation

Scenario: An automotive supplier is developing an infotainment system for a new vehicle model. The system integrates navigation, audio, and vehicle status display.

Challenge: Ensure the ECU interprets CAN messages correctly, avoids crashes, and displays valid data under edge-case input conditions.

Solution using Penzzer:

  1. Import DBC Files
    • Messages include VehicleSpeed, FuelLevel, BatteryStatus.
  2. Generate Signal Tests
    • Create inputs covering min/max, negative values, type violations.
  3. Run Structured Fuzzing
    • Inject CAN frames with modified signals over the vehicle’s test bench.
  4. Observe Behavior
    • Monitor screen updates, error messages, performance logs.
  5. Findings:
    • FuelLevel accepted values > 100%, causing visual glitch.
    • VehicleSpeed signed vs. unsigned misinterpretation led to display of -32768 km/h.
  6. Mitigation:
    • Apply software bounds checking on all inputs.
    • Validate signal configuration in DBC matches actual decoding logic.

Outcome: Robustness and resilience improved, regressions prevented during future firmware updates.

Want to hear more about Penzzer?

Leave your details and we'll reach out shortly.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Don't miss these stories: