RTES Communication - Overview of the DNP3 protocol

This section is to rpovide to our RTES users a basic understanding of the DNP3 protocol:
to facilitate its implementation with RTES used as a master or remote
to interpret the data stream on the protocol analyzer and trouble shoot simple commuinication problems.

This section is not an official DNP3 document and must not be used for any other purpose than stated above.

Message structure

A DNP3 message consists of a byte (octet) stream divided in 3 sections: Transport Header, Application Header and Objects are divided into 16 -byte segments, each segment is followed by a 2-byte crc calculated on the preceding 16 bytes.

Message Header

Byte

Name

Description

1 Start 1 Sync character: 0x05
2 Start 2 Sync character : 0x64
3 Size Number of bytes to follow - excluding the crc's
4 Control Byte Bit 7 : DIR - Direction
  • 0=remote
  • 1=master
Bit 6 : PRM - Primary
  • Always set to 1, except for Data Link Function Codes ACK, NACK and LINK STATUS REPLY.
Bit 5 : FCB - Frame control bit
  • Master station alternates 1/0 at each message to the same remote.
  • Remote expects consecutive messages from same master to have different FCB's.
  • When a master sends a 'Reset Link' to a remote, the next message has FCB=1.
  • A remote always sets this bit to 0.
Bit 4 : FCV - Frame control valid
  • Set by Master to 1 if FCB is valid
  • A remote sets this bit to 1 if its receive buffer is full
Bit 3-0 : FC - Link Function Code
  • The interpretation of these 4 bits depends on the status of PRM and FCV
  • List of valid Control Bytes from a master:
    • 0x80 / 0x90 ACK
    • 0x81 NACK
    • 0x8B / 0x9B Link Status Reply
    • 0xC0 / 0xE0 Link Reset
    • 0xC1 / 0xE1 Reset User Process
    • 0xD2 / 0xF2 Test Link
    • 0xD3 / 0xF3 Confirmed Data
    • 0xC4 / 0xE4 Unconfirmed Data
    • 0xC9 / 0xE9 Link Status Request
  • List of valid Control Bytes from a remote:
    • 0x00 / 0x10 ACK
    • 0x01 NACK
    • 0x0B / 0x1B Link Status Reply
    • 0x40 / 0x60 Link Reset
    • 0x41 / 0x61 Reset User Process
    • 0x52 / 0x62 Test Link
    • 0x53 / 0x73 Confirmed Data
    • 0x44 / 0x64 Unconfirmed Data
    • 0x49 / 0x69 Link Status Request
5-6 Destination Two-byte address of the destination LSB-MSB
7-8 Source Two-byte address of the originator LSB-MSB
9-10 CRC 16-bit cyclic redundancy check LSB-MSB

Transport Header (TH)

Bit 7 - FIN - This bit is set ehen the frame is the last one of a complete message
Bit 6 - FIR - This bit is set when the frame is the first one of a new message
Bit 5-0 - Sequence - This 6 bit number is incremented at every frame. It may start at any number and rolls over at 63.

Application Header

AC - Application control byte.

FC - Function code.

The following function codes are supported by the RTES DNP3 driver

Messages originating from a remote include a 2-byte IIN (Internal Indicators)

IIN - LSB

IIN - MSB

Objects

Each object definition consists of an object header, address/range and optional data.
The object header consists of

The [group, variation] define the variables being exchanged. RTES supports the following variables

The Qualifier defines how the range of the variable(s) is specified.
Qualifiers supported by RTES - DNP3 are: