# Cybersecurity and Medical Imaging: A Simulation-Based Approach to DICOM Communication
## 3 Methodology
### Association Establishment between AE and PACS  
In the diagram provided in Figure 2, the deployment of a simulation on Host 1 is illustrated. The main process, labeled _\"Association\"_, is associated with the AE within the simulation. The AE serves as a representation of a device or node within the network, denoted as \(AE\). Similarly, the Orthanc PACS server is represented as \(PACS\). The initiation of communication between these entities is facilitated by the following method, establishing a connection for seamless data exchange, as defined in Equation (4).  
\[association\_successfull=associate(AE,PACS) \tag{4}\]  
The success of this initiation is captured by the variable association_successful, indicating whether or not the association process was successful. Data transmission, which involves the exchange of medical images and related information, can be visually represented as a flow using directional arrows. This abstraction aids in understanding the dynamic exchange between different components of the system. The connectivity and integrity of the communication link are monitored using the function presented in Equation (5), allowing the verification outcome to be defined as Equation (6).  
\[status=check\_status(modality,PACS) \tag{5}\]  
\[association\_successful=associate(AE,PACS) \tag{6}\]  
Data processing and release encompasses a sequence of operations applied to DICOM data, and fulfills specific tasks within the system. The established communication link between the AE and PACS is vital for seamless data exchange and successful execution of communication operations. Figure 2 visualizes the connection between the simulation and the PACS server, showcasing the flow of DICOM data and communication within the simulated environment. This connection enables the transmission of DICOM images and associated information from the simulation to the PACS server, mimicking real-world scenarios and facilitating the exploration and understanding of DICOM communication and PACS integration.  
The simulation involves processing a dataset and initiating a request. The Association process reads the dataset and performs various operations. A status check is applied to verify the connection of the DICOM modality to the PACS server hosted on Host 2. If the connectivity is confirmed, the Association process sends the processed data to the PACS server. After the data transmission is successful, the Association process releases the connection. Overall, the diagram showcases the flow of data processing and communication between Host 1, the Association process, and the PACS server on Host 2.  
To establish a connection with the PACS server, the AE utilizes the _associate()_ method from the _Pynetdicom_ library. This method serves as a way for the AE to initiate an association with the PACS server, enabling communication between them.  
The _associate()_ method requires several input parameters, including the IP address and port number of the PACS server, as well as the AE title associated with the PACS server. When this method is invoked, the AE triggers the association process. If the process is successful, it results in the creation of a communication link between the AE and the PACS server. When this association has been successfully established, the AE gains the ability to effectively interact with the PACS server.  
This interaction encompasses various tasks, such as sending and retrieving medical images and the associated data. By leveraging the established connection, the AE can transmit DICOM data objects to the PACS server.