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 |
+--------------------------------------------------+
- DSS is the lowest layer — it wraps every message in a 6-byte header with length, type, and correlation ID
- DDM objects live inside DSS frames — they carry commands (EXCSAT, ACCSEC, etc.) and their parameters as nested TLV structures
- FD:OCA defines how result set data (column values) is encoded within DDM reply objects
Sections¶
- DSS Framing — The wire frame format
- DDM Objects — Command and reply message structure
- Connection Flow — The 4-step handshake sequence
- Query Flow — How SELECT, INSERT, UPDATE, DELETE work
- Data Encoding — FD:OCA, type system, EBCDIC
- Code Points — Reference table of all DRDA code points
Reference Materials¶
Specifications¶
- DRDA Volume 1: Architecture — Overall protocol flows
- DRDA Volume 2: FD:OCA — Result set data encoding
- DRDA Volume 3: DDM — Command/reply message format
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