# Cybersecurity and Medical Imaging: A Simulation-Based Approach to DICOM Communication
## 5 Simulation Results and Analysis
### Setting Up Orthanc to Accept Data from the Modality Simulator
```
1#Time|MessageType|Information|(PortNumbers)
2...MultipleTCPflows[TCPsegmentofareassembledPDU]
3
4T_[6]7.671284786|P-DATA,C-STORE-RQI|DICOM:P-DATA,C-STORE-RQID\(\leftrightarrow\) =1|(55822)-->(4242)
5T_[7]7.671830832|P-DATA,X-rayAngiog|DICOM:P-DATA,X-rayAngiographicImageStorageFragment(reassembledin#1394)\(\leftrightarrow\) |(55822)-->(4242)
6T_[8]7.684974645|P-DATA,X-rayAngiog|DICOM:P-DATA,X-rayAngiographicImageStorage|(55822)-->(4242)
7T_[9]7.750206628|P-DATA,CommandID=1|DICOM:P-DATA,CommandID=1(\(\leftrightarrow\) Success)|(55822)--(4242)
```

Listing 13: Association termination. #### 5.4.1 Association Initialization

At the start of the communication, the MODALITY entity initiates the process by sending an A-ASSOCIATE request to Orthanc indicating its intention to establish a DICOM association. This request occurs at time \(T_{1}\), and is represented as Equation (7). \[MODALITY\xrightarrow{\text{A-ASSOCIATE request}}PACS\quad\text{at time }T_{1} \tag{7}\]

In response to the request, Orthanc acknowledges the establishment of the association by sending an A-ASSOCIATE accept message back to MODALITY. This acceptance message occurs at time \(T_{2}\), and is defined by Equation (8). \[MODALITY\xleftarrow{\text{A-ASSOCIATE accept}}PACS\quad\text{at time }T_{2} \tag{8}\]

This includes the establishment of the association, data transmission, successful command execution, and the termination of the connection (Listing 10). **A-ASSOCIATE request. ** The A-ASSOCIATE request is the initial step in establishing a DICOM association between the MODALITY entity and the Orthanc entity. It is sent by the MODALITY device/system to the Orthanc device/system. The request contains information about the supported DICOM services, transfer syntaxes, and other negotiation parameters. **A-ASSOCIATE accept. ** The A-ASSOCIATE accept message is sent by Orthanc in response to the A-ASSOCIATE request from MODALITY. It indicates that Orthanc accepts the association. This message contains negotiated parameters, such as the agreed-upon DICOM services, transfer syntaxes, and other configuration details. #### 5.4.2 Data Transmission

Throughout the communication session, MODALITY sends multiple TCP segments, which are acknowledgments (ACKs), to PACS. These segments are transmitted at different times, denoted as \(T_{3}\), \(T_{4}\), etc., representing a series of communication events. as presented in Equation (9):

\[MODALITY\xrightarrow{\text{TCP segments}}PACS\quad\text{at times }T_{3},T_{4},\ldots, \tag{9}\]where each \(T_{i}\) corresponds to a specific ACK transmitted by MODALITY. A sample of the data transmission in TCP segments is presented in Listing 11. **Multiple TCP flows in between (TCP segment of a reassembled PDU). ** The TCP segments (Listing 11) are acknowledgments (ACK) sent from the AE, namely, MODALITY to Orthanc acknowledging the successful reception of a previous PDU fragment. The \"S\" indicates a TCP segment of a reassembled PDU, suggesting that this is part of the reassembly process involving the fragmented data mentioned previously. #### 5.4.3 Data Reassembly and Storage

As the data transmission continues, MODALITY sends P-DATA messages, specifically, C-STORE-RQ (C-STORE request) messages, to Orthanc for the purpose of storing DICOM objects. Orthanc receives and reassembles the data fragments. The reassembly events occur at times \(T_{6}\), \(T_{7}\), \(T_{8}\), etc., forming the sequence of reception events expressed in Equation (10):

\[ \begin{split}&\text{\sc{PACS}}\xrightarrow{\text{\sc{Reassembled fragments}}}MODALITY\quad\text{at times $T_{6}$, $T_{7}$,$T_{8}$,}\ldots,\end{split}  \tag{10}\]

where each \(T_{i}\) indicates the reception and reassembly of data fragments by Orthanc. Then, MODALITY notifies the successful execution of a command by transmitting a P-DATA message containing the relevant information, including Command ID=1 (Success), to PACS. This message is received by PACS at time \(T_{9}\), as presented in Equation (11). \[