The DNP3_TG driver closes unexpectedly without an error message after receiving a specific response to a file transfer request.

The DNP3_TG driver closes unexpectedly without an error message after receiving a specific response to a file transfer request.

Summary

The DNP3_TG driver closes without an error message when a specific outstation reports a file size 0xFFFFFFFF in a response to a file open request. In this particular case, the outstation reports 0xFFFFFFFF to indicate not a file size of 4GB but an unknown file size. The driver is no longer running and existing variable values in the runtime will no longer be updated and newly advised variables will remain without value and status.  

Description

The DNP3_TG driver closes without an error message when a specific outstation reports a file size 0xFFFFFFFF in a response to a file open request. In this particular case, the outstation reports 0xFFFFFFFF to indicate not a file size of 4GB but an unknown file size. The driver is no longer running and existing variable values in the runtime will no longer be updated and newly advised variables will remain without value and status.  

Solution

An issue has been addressed in the DNP3_TG driver where the reaction to a file open response with a file size of 0xFFFFFFFF was to attempt to allocate 4 GB of memory for receiving the file in subsequent FILE READ requests. Now a fixed limit of 100 MB is used as a maximum file size that is accepted in a response to a file open request, with a defined file size. When the file size exceeds 100 MB, the file transfer action (read file or read directory) will be cancelled and a file abort is sent to the outstation in order to close the handle. In addition a fixed 32 MB limit is used as a maximum receive buffer when an outstation responds with a file size of 0xFFFFFFFF. When subsequent FILE READ requests retrieve data that is smaller than 32 MB, the file will be saved or the directory contents will be accepted. When subsequent FILE READ requests retrieve data that exceeds 32 MB, the file transfer action will be cancelled and a file abort is sent to the outstation in order to close the handle.

Information

The maximum value for the file size in a response to a file open request is 0xFFFFFFFF (or 4 GB). Such a value would never be used in reality. Firstly because typical file sizes used with DNP3 file transfer are in the KB numbers or low megabtyes numbers. Secondly also due to the fact that inefficient frame sizes in DNP3 would cause file transfer of 4 GB to run for days even on fast links. Some outstations may therefore respond with a size of 0xFFFFFFFF in a response to a file open request, to indicate that the exact file size is not yet known, e.g. due to the fact that a file is currently being written, or that items are currently being added to a directory. This value 0xFFFFFFFF is not yet an accepted value in IEEE Std 1815:2012 for such scenarios, but may be specified as such an indication in a next revision of IEEE Std 1815.  

Issue Number: 36649
Fixed on Date: 6.9.2016
Versions: 7.60 0 BUILD 36068