## 10 Results and Discussion
### Discussion
\begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt}} \hline \hline
**Role** & **Responsibility** \\ \hline Healthcare Data Providers (Hospitals, Clinics, Laboratories) & Ensure data quality, integrity, and compliance with health regulations. \\ \hline Smart Contract Developers & Design, develop, and maintain the GBG-RPL framework’s smart contracts and ensure the security and scalability of the blockchain infrastructure. \\ \hline Data Scientists and Analysts & Optimize algorithms for the GBG-RPL framework and generate reports and visualizations for healthcare stakeholders. \\ \hline Smart Contract Auditors & Review and audit the smart contracts of the GBG-RPL framework to identify and rectify security vulnerabilities. \\ \hline Healthcare Regulators & Monitor the implementation of the GBG-RPL framework to ensure compliance with healthcare regulations and data protection laws. \\ \hline Healthcare Providers (Doctors, Nurses, and Caregivers) & Use the insights from the GBG-RPL framework to improve patient care. \\ \hline Patients and Healthcare Consumers & Provide feedback on the usability and relevance of the index. \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Roles and responsibilities in smart healthcare CPS. nodes [110]. The proposed framework distributes the computational load, improving the overall system performance while enhancing the fault tolerance and resilience. 2. The proposed framework uses a layered architecture with a fog layer and a device layer [111]. The proposed framework prevents resource bottlenecks since all the trust calculation, analysis, and data storage are shifted to the fog layer, and the network underneath works efficiently. In addition, securing the communications within the smart healthcare CPS is a paramount concern, necessitating the deployment of a robust set of security protocols [112]. In this complex ecosystem where the seamless exchange of sensitive healthcare data is pivotal, various protocols come into play to ensure the integrity, confidentiality, and authenticity of information during transit. The various security protocols for smart healthcare CPSs are described in Table 10.  
The integration of the GBG-RPL framework into existing smart healthcare CPSs requires a systematic approach to ensure compatibility, functionality, and minimal disruption [119]. This integration involves careful planning, customization, and validation to ensure a seamless and effective deployment [4]. A step-by-step approach would help to navigate the complexities of integration, providing a solid foundation for enhanced trust management in healthcare data within the CPS [120]. A logical sequence of step-by-step approaches to the integration of GBG-RPL into smart healthcare CPSs is given in Table 11.  
This research focused on the prevention of blackhole and greyhole attacks in smart healthcare CPSs using the Gini index and blockchain. The proposed mechanism consisted of two layers: the device layer and the fog layer. The Gini index and blockchain were implemented in the fog layer, where all trust-related calculations were performed. The model was implemented on the Cooja simulator. Several performance and efficiency parameters were evaluated in order to assess the proposed mechanism. Included in these parameters were the attack-detection rate, average residual energy, packet loss ratio, energy consumption, number of nodes, and end-to-end delay. Both the GBG-RPL and BCPS-RPL mechanisms demonstrated a consistent increase in attack-detection rate over time. Nevertheless, the GBG-RPL mechanism consistently displayed a greater attack-detection rate, indicating its effectiveness in detecting and mitigating blackhole and greyhole attacks. Mean residual energy quantified the CPS energy levels over time. Both mechanisms' energy consumption decreased over time, with the GBG-RPL mechanism consistently consuming less energy than the BCPS-RPL mechanism. This demonstrates the energy effectiveness of the GBG-RPL mechanism to maintain the CPS's energy resources.