Skip to content

DRDA Protocol

db2-node implements the IBM DRDA (Distributed Relational Database Architecture) wire protocol. DRDA is an open standard published by The Open Group that defines how clients communicate with DB2 databases over TCP.

This section provides a deep dive into the protocol internals.

Protocol Layers

DRDA communication is structured in layers:

+--------------------------------------------------+
|  Application (SQL queries, results)               |
+--------------------------------------------------+
|  DDM (Distributed Data Management)                |
|  Command/reply objects with code points            |
+--------------------------------------------------+
|  DSS (Data Stream Structure)                      |
|  Framing: length, type, correlation ID             |
+--------------------------------------------------+
|  TCP / TLS Transport                              |
+--------------------------------------------------+
  1. DSS is the lowest layer — it wraps every message in a 6-byte header with length, type, and correlation ID
  2. DDM objects live inside DSS frames — they carry commands (EXCSAT, ACCSEC, etc.) and their parameters as nested TLV structures
  3. FD:OCA defines how result set data (column values) is encoded within DDM reply objects

Sections

Reference Materials

Specifications

Open-Source Implementations

  • Apache Derby — Java DRDA server + client (org.apache.derby.impl.drda)
  • kanrichan/ibm_db — Go DRDA implementation
  • Wireshark DRDA dissector — Filter: drda