DNP3 Guide
Connect SCADA RTUs and outstations over DNP3 (TCP, TLS, serial).
Overview
DNP3 (Distributed Network Protocol) is a SCADA protocol widely used to link control centers with RTUs and IEDs across electric, water, and oil & gas utilities. ControlBird provides DNP3 as a dedicated service with two operational roles. The Master role acts as a client: it polls outstations, receives unsolicited events, and issues commands. The Outstation role acts as a server: it listens for master connections, exposes ControlBird entity data as DNP3 points, and emits unsolicited responses.
Each role connects over one of three transports (TCP, serial RS-232/RS-485, or TLS) and binds DNP3 points to ControlBird entity fields through a mapper architecture. You configure everything through the Device Manager application; no service-level configuration files are required.
Master vs. Outstation
Choose Master when ControlBird should poll or command remote field devices. Choose Outstation when ControlBird should present its own data to an upstream SCADA master. A single ControlBird node can run both roles simultaneously with separate controllers.
Transports
| Transport | Master endpoint | Outstation endpoint | Key parameters |
|---|---|---|---|
| TCP | Dnp3MasterEndpoint | Dnp3OutstationEndpoint | Host / ListenAddress, Port |
| Serial | Dnp3MasterSerialEndpoint | Dnp3OutstationSerialEndpoint | SerialPort, BaudRate, DataBits, StopBits, Parity |
| TLS | Dnp3MasterTlsEndpoint | Dnp3OutstationTlsEndpoint | Host / ListenAddress, Port, CertificateEntity, TrustedCertificateEntity |
Serial endpoints support baud rates from 1200 to 115200 (default 9600), data bits 5–8, stop bits One or Two, and parity None, Odd, or Even. All transports share a common set of link-layer and polling parameters.
Master TLS transport
End-to-end TLS is fully supported on the outstation role. On the master role, do not rely on the TLS endpoint for confidentiality over untrusted networks: use a network-layer tunnel or VPN instead.
Entity Model
A DNP3 integration is built from a controller, one endpoint, and one or more mappers. The controller references its endpoints, and mappers bind individual points to ControlBird entity fields.
| Entity | Role | Purpose |
|---|---|---|
Dnp3MasterController | Master | Manages the master connection lifecycle and configuration. |
Dnp3OutstationController | Outstation | Manages the outstation (server) listener and configuration. |
Dnp3Endpoint | Base | Common link-layer and polling configuration for all endpoints. |
Dnp3Mapper | Master | Binds a remote DNP3 point to a ControlBird entity field for reads and commands. |
Dnp3ServerMapper | Outstation | Exposes a ControlBird entity field as a DNP3 point for master reads/writes. |
Link-layer addressing
DNP3 uses 16-bit link-layer addresses to distinguish the master from the outstation on a shared link. The master address defaults to 1 and the outstation address defaults to 1024. Both addresses must match on the two ends of a connection.
Object Groups
DNP3 organizes data into object groups. ControlBird maps each group to an appropriate ControlBird value type. Writable groups can be targeted by master commands; all groups can be read.
| Object group | Access | ControlBird mapping |
|---|---|---|
| BinaryInput | Read-only | Boolean |
| BinaryOutput (CROB) | Writable | Boolean (commandable) |
| DoubleBitBinary | Read-only | Choice (4 states) |
| AnalogInput | Read-only | Float (32- or 64-bit) |
| AnalogOutput | Writable | Float (commandable) |
| Counter | Read-only | Integer (32-bit unsigned) |
| FrozenCounter | Read-only | Integer |
| OctetString | Read-only | String / Blob |
Double-bit binary values map to a choice field with four states: 0 = Intermediate, 1 = DeterminedOff, 2 = DeterminedOn, and 3 = Indeterminate.
Quality flags
Every DNP3 point carries quality flags. ControlBird monitors ONLINE, RESTART, COMM_LOST, REMOTE_FORCED, LOCAL_FORCED, OVER_RANGE, and REFERENCE_ERR. A point is treated as good when ONLINE is set and COMM_LOST is clear.
Mappers and Source Paths
A mapper binds one DNP3 point to one ControlBird entity field. The point is identified by its object group and point index. The SourcePath field uses the notation ObjectGroup:Index: for example, AnalogInput:5 selects analog input point 5.
| Field | Applies to | Description |
|---|---|---|
ObjectGroup | Both | DNP3 object group (e.g., AnalogInput, BinaryOutput). |
PointIndex | Both | DNP3 point number within the group. |
SourcePath | Both | ObjectGroup:Index notation identifying the point. |
TargetEntity | Both | ControlBird entity that receives or supplies the value. |
TargetField | Both | Field on the target entity. |
CommandMode | Master | DirectOperate or SelectBeforeOperate for output points. |
PollIntervalMs | Master | Per-mapper poll interval override. |
EventClass | Outstation | Class1, Class2, or Class3 for unsolicited reporting. |
Command modes
Use DirectOperate for immediate, single-message execution of an output. Use SelectBeforeOperate when the outstation requires the safer two-step select/confirm/operate handshake before acting on a command.
Polling and Events
A DNP3 master combines periodic integrity polls (which request all data) with more frequent event polls (which request only changed data), plus optional unsolicited responses pushed by the outstation. The relevant timing fields on the endpoint are:
| Field | Default | Meaning |
|---|---|---|
IntegrityPollIntervalMs | 60s | How often the master requests all data. |
EventPollIntervalMs | 5s | How often the master requests changed data. |
ResponseTimeoutMs | 5s | How long the master waits for a reply before retrying. |
MinRetryBackoffMs | 1s | Initial backoff after a connection failure. |
MaxRetryBackoffMs | 60s | Maximum backoff for repeated connection failures. |
Unsolicited response classes
Outstations can push events without being polled. Each event is tagged with the class assigned by its mapper's EventClass field: Class 1 (urgent), Class 2 (normal), and Class 3 (background). Enable reporting per class on the endpoint via EnableUnsolicited and the UnsolicitedClass1/2/3 flags, and size the outstation's event queue with EventBufferSize.
Configuration Workflow
All DNP3 entities are created in the Device Manager app. The typical flow is:
- Open Device Manager in the ControlBird UI.
- Create a
Dnp3MasterControllerorDnp3OutstationControllerto pick the role. - Add an endpoint for your transport (TCP, serial, or TLS) using the matching endpoint entity.
- For TLS, link
CertificateEntity(this endpoint's own certificate) andTrustedCertificateEntity(the peer's trusted certificate). See Certificates. - Set the protocol parameters: master/outstation addresses, polling intervals, and response timeout.
- For outstations, enable unsolicited responses per class and set
EventBufferSize. - Create mappers:
Dnp3Mapperfor a master,Dnp3ServerMapperfor an outstation. - In each mapper, set
ObjectGroup,PointIndex, andSourcePath, then bindTargetEntityandTargetField. - For master output mappers, choose a
CommandMode. For outstation mappers, assign anEventClass. - Enable the mappers and endpoint; the service auto-connects based on endpoint type.
For a hands-on introduction to binding a device to Store entities, see walkthrough step 7: Connect a Device.
Examples
Master over TCP
Dnp3MasterEndpoint
Host: 192.168.1.100
Port: 20000
MasterAddress: 1
OutstationAddress: 1024
IntegrityPollIntervalMs: 60000
EventPollIntervalMs: 5000Outstation over serial
Dnp3OutstationSerialEndpoint
SerialPort: /dev/ttyUSB0
BaudRate: 9600
ListenAddress: 0.0.0.0
Port: 20000
EventBufferSize: 100Master mapper: poll an analog input
Dnp3Mapper
ObjectGroup: AnalogInput
PointIndex: 5
SourcePath: AnalogInput:5
TargetEntity: <device entity>
TargetField: <temperature field>Master mapper: command a binary output
Dnp3Mapper
ObjectGroup: BinaryOutput
PointIndex: 0
CommandMode: SelectBeforeOperate
TargetEntity: <relay entity>
TargetField: <state field>Outstation mapper: unsolicited event
Dnp3ServerMapper
ObjectGroup: AnalogInput
PointIndex: 10
EventClass: Class1
TargetEntity: <sensor entity>
TargetField: <value field>Notes
- Logging is configurable per endpoint, with adjustable maximum log file count and size per file.
- The TLS endpoints expose a
SkipCertVerificationflag that bypasses peer certificate validation. Leave it disabled in production, since it removes authentication guarantees.
SkipCertVerification is a security risk
Enabling SkipCertVerification disables peer certificate validation and exposes the connection to man-in-the-middle attacks. Use it only for short-lived local testing, never on a routed or shared network.
Limitations
- The master role does not currently provide end-to-end TLS confidentiality; use a network-layer tunnel or VPN when securing master connections over untrusted networks.
- Common mapper fields such as
DirectionandReadModeare managed automatically and are not set as part of DNP3-specific configuration.