Search code examples
dicomdcmtk

Incorrect received value callingPresentationAddress in dcmqrscp under Windows


TL;DR:

When I run dcmqrscp under Windows 7 x64 (official current 3.6.2 binaries), the server does not recognize IP of incoming echoscu clients. Instead the value of callingPresentationAddress is set to www or name_of_localhost, depending on the ethernet interface, by which the connection is associated.

Full description

The content of dcmqrscp config file:

NetworkTCPPort  = 11113
MaxPDUSize      = 16384
MaxAssociations = 16
HostTable BEGIN

archive = (ARCHIVE, localhost, 11113)
client1 = (CLIENT1, 146.147.51.82, 12345)
client2 = (CLIENT2, www, 12345)
clients = client1, client2
HostTable END

AETable BEGIN
ARCHIVE   c:/tmp/dcm   RW (100, 1024mb)   clients
AETable END

I connect to the server from Debian machine on 145.146.51.82:

echoscu -d 146.147.51.30 11113 -aec ARCHIVE -aet CLIENT1

Output of the server is as below:

D: $dcmtk: dcmqrscp v3.6.2 2017-07-14 $
D: 
D: setting network send timeout to 60 seconds
D: setting network receive timeout to 60 seconds
D: PDU Type: Associate Request, PDU Length: 205 + 6 bytes PDU header
(...)
D: Parsing an A-ASSOCIATE PDU
I: Association Received (www:CLIENT1 -> ARCHIVE)
D: Parameters:
D: ====================== BEGIN A-ASSOCIATE-RQ =====================
(...)
D: ======================= END A-ASSOCIATE-RQ ======================
D: Peer www:CLIENT1 is not not permitted to access ARCHIVE (see configuration file)
I: Refusing Association (BadAEService)

If I switch calling AE of echoscu to CLIENT2, the answer is positive. This is because of the line in config file client2 = (CLIENT2, www, 12345)

If echoscu is run from the same Windows machine, instead of localhost or 127.0.0.1, the value of callingPresentationAddress is name_of_localhost. This issue was described in this question.

In the opposite direction (echoscu at Windows, dcmqrscp at Debian) everything is correct:

Association Received (146.147.51.30:CLIENT1 -> ARCHIVE)

I suspect that the problem is related to wrong configuration of my Windows, but I have no idea how I should fix it.


Solution

  • If a hostname is associated with the IP address of the system connecting to the dcmqrscp (either locally or by a corresponding entry to the DNS), this hostname is used to match against the hostname specified in the "HostTable" section of the configuration file. If this hostname lookup is not available (or disabled by dcmqrscp's option -dhl), the IP address is used instead. This might not be very intuitive but as far as I know has never changes over the last 20 + x years (or so).

    See documentation in dcmqrcnf.txt for details.