5
2. DNP3 Protocol Primer
PXM 4/6/8K DNP3 Ethernet Communications User Manual
MN150005EN January 2017 www.eaton.com
2.2 Link Layer Responsibility
The link layer has the responsibility of making the physical
link reliable. It does this by providing error detection and
duplicate frame detection. The link layer sends and receives
packets, which in DNP3 terminology are called frames.
Sometimes transmission of more than one frame is neces-
sary to transport all of the information from one device to
another.
A DNP3 frame consists of a header and data section. The
header specifies the frame size, contains data link control
information and identifies the DNP3 source and destination
device addresses. The data section is commonly called the
payload and contains data passed down from the layers
above.
DNP3 Frame
Header
Data Section
Header
Sync
Length
Link Control Destination Source
CRC
Figure 4. DNP3 Header and Data Sections.
Every frame begins with two sync bytes that help the
receiver determine where the frame begins. The length
specifies the number of octets in the remainder of the
frame, not including CRC check octets. The link control
octet is used for the sending and receiving link layers to
coordinate their activities.
2.2.1 Addressing
The destination address specifies which DNP3 device
should process the data, and the source address identi-
fies which DNP3 device sent the message. Having both
destination and source addresses satisfies at least one
requirement for peer-to-peer communications because the
receiver knows where to direct its responses. 65,520 indi-
vidual addresses are available. Every DNP3 device must
have a unique address within the collection of devices send-
ing and receiving messages to and from each other. Three
destination addresses are reserved by DNP3 to denote an
all-call message; that is, the frame should be processed
by all receiving DNP3 devices. One address is a universal
address, the details of which are not given here, and twelve
addresses are reserved for special needs in the future.
2.2.2 CRC Checks
The data payload in the link frame contains a pair of CRC
octets for every 16 data octets. This provides a high degree
of assurance that communication errors can be detected.
The maximum number of octets in the data payload is 250,
not including CRC octets. (The maximum length link layer
frame is 292 octets if all the CRC and header octets are
counted.)
2.2.3 Link Layer Confirmation
One often hears the term “link layer confirmation” when
DNP3 is discussed. A feature of DNP3’s link layer is the
ability for the transmitter of the frame to request the receiv-
er to confirm that the frame arrived. Using this feature is
optional, and it is often not employed because there are
other methods for confirming receipt of data. It provides
an extra degree of assurance of reliable communications.
If a confirmation is not received, the link layer may retry
the transmission. Some disadvantages to using link layer
confirmation are the extra time required for confirmation
messages and waiting for multiple timeouts when retries
are configured.
2.2.4 Transport Layer
The transport layer has the responsibility of breaking long
application layer messages into smaller packets sized for the
link layer to transmit, and, when receiving, to reassemble
frames into longer application layer messages. In DNP3 the
transport layer is incorporated into the application layer. The
transport layer requires only a single octet overhead to do
its job. Therefore, since the link layer can handle only 250
data octets, and one of those is used for the transport func-
tion, each link layer frame can hold as many as 249 applica-
tion layer octets.
2.2.5 Application Layer Fragments
Application layer messages are broken into fragments.
Maximum fragment size is determined by the size of the
receiving device’s buffer. The normal range is 2048 to 4096
bytes. A message that is larger than one fragment requires
multiple fragments. Fragmenting messages is the responsi-
bility of the application layer.
Note that an application layer fragment of size 2,048 must
be broken into 9 frames by the transport layer, and a frag-
ment size of 4,096 needs 17 frames. Interestingly, it has
been learned by experience that communications are some-
times more successful for systems operating in high noise
environments if the fragment size is significantly reduced.