## 4 Software and Architecture Orchestration in CPS Environments  
A widely acknowledged description of a cyber-physical system entails the integration of computing and communication capabilities for the reliable, safe, secure, efficient, and real-time monitoring or control of entities in the physical world. The utilization of CPS technologies extends to the formation of situation-aware environments. It frequently involves establishing safety or mission-critical ecosystems and services, showcasing heightened capabilities and performance [40].  
CPSs consist of tangible devices governed by cyber components and address diverse networking technologies to establish a robust and adaptable infrastructure for collecting and disseminating information in cyber-physical environments. Additionally, to support and make these environments autonomous, configurable, and flexible, CPSs will address other technologies such as middleware to facilitate cross-layer interactions; information-collecting and receiving devices, in very heterogenous network scenarios for content communication; and a multitude of platforms engaged in processing and storing information, to deal with a large set of applications utilizing information for various purposes.  
CPS generally comprises three primary elements: sensors, aggregators, and actuators. Nevertheless, confronted with heightened system complexity, a significant hurdle for CPS involves establishing a balance between flexibility and heterogeneity while upholding Quality of Service (QoS) standards. Similarly, with the onset of Industry 4.0 and the manifold dimensions of IoT and IIoT, the focus revolves around the utilization of Cyber-Physical Systems (CPSs). In essence, these are intricate architectures in which cyber-components exert remote control over physical entities or processes.  
From the literature review, it can be concluded that in recent developments, the application of Software-Defined Networking (SDN) to CPS has emerged to attain optimal resource allocation and ensure Quality of Service. This gives rise to a form of CPS known as SDN-assisted CPS [11].  
Consequently, Software-Defined Networking (SDN) finds application in CPS, where it oversees the foundational infrastructure and regulates network traffic through controllers or application programming interfaces [41]. SDN facilitates the separation of network control from the data plane, delivering a flexible and time-efficient control capability, or supports centralized SDN controller architecture to allow for the management of network and system resources in real-time, whether in a cloud computing scenario or an edge computing scenario [37].  
More recently, research and applications have included security issues, namely blockchain [11] and network function virtualization (NFV) solutions and their functionalities [42], to address the fact that WSNs support smart grid applications, which must be accomplished with new technical challenges such as RT and QoS constraints. Nonetheless, prevailing software-defined approaches for conventional WSNs predominantly address device and communication challenges from the vantage point of sensing and communication layers, lacking alignment with the systematic control demands of a CPS. Two crucial unresolved issues persist. Firstly, a viable systemic architecture is imperative for a software-defined CPS, necessitating global virtualization management and closed-loop control bridging the cyber side and physical side in a CPS. Secondly, the extension of the lifetime of a software-defined CPS remains an open challenge, requiring consideration of virtual resource optimization and the distinctive features introduced by SDN [42; 43].