The DICOM associationhow two devices agree to talk

Before a scanner can send an image, or a viewer can ask a question, the two sides open an association: a short negotiation that fixes who is talking, what they will talk about and how the data is encoded. Every DICOM network exchange starts here.

  • DICOM
  • Network (TCP)
  • Internal action
  • Dashed = reply
DICOM association lifecycleThe calling AE opens a TCP connection, sends A-ASSOCIATE-RQ with presentation contexts, the called AE checks it and answers A-ASSOCIATE-AC, they exchange DIMSE messages in P-DATA-TF, then release the association.Calling AErequester (association initiator)Called AEacceptor, e.g. the PACSTCP connect (port 104 / 11112)1A-ASSOCIATE-RQ2Check the requestAE titles, contexts, limits3A-ASSOCIATE-AC4P-DATA-TF: DIMSE request5P-DATA-TF: DIMSE response6A-RELEASE-RQ7A-RELEASE-RP8

Tip: click an arrow or box in the diagram to jump to that step. Time flows top to bottom.

Step 1 of 8

Open the TCP connection

Core step

What happens

DICOM runs on top of TCP. The calling side opens a normal TCP connection to the IP address and port of the other device. Nothing DICOM-specific has happened yet.

Why it is needed

If this step fails, the problem is the network: a wrong IP address or port, a firewall, or a service that is not running. No DICOM log line will explain it.

Technical details

  • PS3.8: port 104 is the well-known DICOM port (needs privileges on many systems); otherwise use the registered port 11112
  • Port numbers must be configurable: any port works if both sides are set to it
  • TLS can wrap the connection (Secure Transport Connection Profiles)

All steps at a glance

Glossary

AE / AE title
Application Entity: a DICOM application on a device. Its AE title (max 16 characters) is the name other devices use to address it.
Association
A negotiated DICOM connection between two AEs, set up on top of a TCP connection. All DIMSE messages travel inside one.
Presentation context
One SOP Class (abstract syntax) paired with the transfer syntaxes offered for it. Each gets an odd ID (1, 3, 5 ...).
SOP Class
Service-Object Pair class. A UID naming one kind of object plus the service used on it, e.g. CT Image Storage (1.2.840.10008.5.1.4.1.1.2).
Transfer syntax
How a data set is encoded on the wire: byte order, explicit or implicit VR, and the image compression.
DIMSE
DICOM Message Service Element. The set of commands (C-STORE, C-FIND, N-CREATE ...) sent inside an association.
SCU
Service Class User. The side that asks for a service, such as a scanner that wants to store images.
SCP
Service Class Provider. The side that provides the service, such as a PACS that stores images.

Summary

  • An association sits between TCP and the DIMSE messages. It is opened with A-ASSOCIATE-RQ and closed with A-RELEASE-RQ.
  • The caller proposes presentation contexts (SOP Class plus transfer syntaxes). The acceptor accepts each one with exactly one transfer syntax, or refuses it.
  • Wrong AE titles give an A-ASSOCIATE-RJ. A SOP Class or transfer syntax the other side does not know gives a refused context in the A-ASSOCIATE-AC.
  • Calling and called are about who opens the association. SCU and SCP are about who requests and who provides the service. They are independent: in a C-MOVE, the PACS is the SCP first and then calls out as SCU.
  • One association can carry many DIMSE exchanges. Release it properly so the PACS keeps free association slots.

The 8 steps in plain text

  1. Open the TCP connection

    DICOM runs on top of TCP. The calling side opens a normal TCP connection to the IP address and port of the other device. Nothing DICOM-specific has happened yet.

    Why: If this step fails, the problem is the network: a wrong IP address or port, a firewall, or a service that is not running. No DICOM log line will explain it.

  2. A-ASSOCIATE-RQ: propose what to talk about

    The caller sends its request. It states who it is (Calling AE title), who it wants (Called AE title) and a list of presentation contexts: for each SOP Class it needs, the transfer syntaxes it can use.

    Why: Both sides must agree up front on the services and the encoding. This is the check that stops a device from sending data the other side cannot read.

  3. The acceptor checks the request

    The called side decides whether to accept. It looks at the AE titles (many PACS only accept known callers), whether it supports each SOP Class and whether it can use one of the offered transfer syntaxes.

    Why: This is where most "it does not work" cases are decided. A wrong AE title, an unknown SOP Class or no common transfer syntax each give a different, specific refusal.

  4. A-ASSOCIATE-AC: agree on the contexts

    The acceptor replies with the same list of presentation contexts. Each one is marked accepted (with exactly one chosen transfer syntax) or refused (with a reason). The association is now open.

    Why: The caller can only use contexts that were accepted. If the context it needs was refused, it must close the association and fix the configuration, since sending it anyway would fail.

  5. DIMSE request in P-DATA-TF

    Now the real work starts. The caller sends a DIMSE command, for example C-STORE-RQ, split into fragments that fit the maximum PDU length. A command may be followed by a data set, such as the image itself.

    Why: The association is only the envelope. DIMSE is the actual conversation, and P-DATA-TF is the PDU that carries it.

  6. DIMSE response in P-DATA-TF

    The acceptor answers with the matching response command and a status. Steps 5 and 6 can repeat many times on the same association, for instance once per image.

    Why: The status tells the caller whether the request worked. Reusing one association for many messages avoids the cost of negotiating again each time.

  7. A-RELEASE-RQ: ask to close

    When the caller is done it asks to release the association in an orderly way.

    Why: An orderly release lets the acceptor finish anything pending and free its resources. Many PACS limit the number of open associations, so leaving them open can block other devices.

  8. A-RELEASE-RP: closed

    The acceptor confirms the release. The association ends and the TCP connection is closed.

    Why: Both sides now know the session ended cleanly. If something goes wrong at any point, either side can instead send A-ABORT, which ends the association at once without a reply.

Common questions

What is a DICOM association?

A negotiated connection between two DICOM Application Entities. It is created with A-ASSOCIATE on top of a TCP connection, fixes which SOP Classes and transfer syntaxes will be used, and carries DIMSE messages until it is released.

What is the difference between an AE title and a hostname?

The hostname or IP address and port get you to the device (TCP). The AE title selects the DICOM application on that device and is checked during A-ASSOCIATE. Both must match what the other side has configured. AE titles are at most 16 characters and, in practice, are usually case sensitive.

Why was my association rejected?

An A-ASSOCIATE-RJ carries a result (1 permanent, 2 transient), a source (1 service user, 2 ACSE provider, 3 presentation provider) and a reason. Typical service-user reasons are 3 (calling AE title not recognized), 7 (called AE title not recognized) and 2 (application context name not supported). Transient rejections such as "local limit exceeded" can succeed on a retry.

What does a refused presentation context mean?

The association opened, but one proposed context was not accepted. Result 3 means the acceptor does not support that SOP Class (for example it does not store a certain modality). Result 4 means it supports the SOP Class but none of the transfer syntaxes offered, such as an unsupported JPEG 2000 variant.

Which transfer syntax is always available?

Implicit VR Little Endian (1.2.840.10008.1.2) is the default transfer syntax that every DICOM network implementation must support. Explicit VR Little Endian (1.2.840.10008.1.2.1) and the compressed syntaxes are optional.

What is the difference between A-RELEASE and A-ABORT?

A-RELEASE is a polite request and reply: both sides agree to end. A-ABORT ends the association immediately with no reply. It is sent by a side that hit a protocol error, or by the lower layer when the connection is lost.

Try it yourself

← All lessons