## 6 Conclusions  
This study broadens our insights into the sustainability and security challenges intrinsic to inverter-based MGs, specifically in cyber-physical systems. Through the meticulous integration of OPAL-RT, ns3, and Docker containers, the developed innovative cyber-physical co-simulation framework uncovers the MG vulnerabilities, emphasizing the importance of exposing the MG control system to cyber threats for ensuring secure and sustainable operation. The experimental results depict the effectiveness of using the secondary controller, eliminating the steady-state error of the system's frequency and fortifying the MG's flexibility for scalable future expansions. Notably, the proposed ns3-based communication model emerges as a robust base for assessing the frequency stability of an islanded inverter-based MG under real-time communication delays and DDoS attacks. Real-time simulations demonstrate the impact of changing the communication delay on the frequency transient stability, offering insights into the stability and instability regions and highlighting the adverse effect of heightened delays, causing system destabilization.  
Furthermore, the assessment of the MG's frequency response under the emulated DDoS attack highlights its impact on the MG's performance. It shows that the DDoS attack will impact the system based on the status of the physical system when the attack occurs. In addition, the proposed platform serves as a sustainable tool for examining communication effects on MG control and assessing vulnerability to cyber-attacks, forming a foundation for future studies of various cyber-physical power system applications. These findings offer insights into the vulnerability studies for inverter-based MGs, guiding the design of secure communication networks and resilient control strategies to enhance MG performance. In future work, we aim to develop an adaptive resilient control scheme to enhance the microgrid performance under communication delays and cyber-attacks. This addresses the adaptability limitations of the proposed PI-based conventional control scheme, which relies on fixed gains that cannot adjust under cyber-severe real-time conditions. Additionally, through the implemented cyber-physical platform, we can expand the proposed microgrid system into multi-microgrids with the proper design of their corresponding communication model, addressing the challenges in their operation as cyber-physical systems.  
Conceptualization, O.A., T.-L.N. and O.A.M.; methodology, O.A. and T.-L.N.; software, O.A. and T.-L.N.; validation, O.A.; formal analysis, O.A.; resources, O.A.M.; data curation, O.A.; writing--original draft preparation, O.A.; writing--review and editing, O.A. and O.A.M.; visualization, O.A.; supervision, O.A.M.; project administration, O.A.M.; funding acquisition, O.A.M. All authors have read and agreed to the published version of the manuscript.  
This research was partially supported by a grant from the US Department of Energy grant #DE-NA0004016 and the National Science Foundation grant #2113880.  
Data Availability Statement: Data is contained within the article.  
Figure 22: The MG’s frequency response with/without the DDoS attack (\(t_{attack}\) = 37 s).