# Cyber5 Gym: An Integrated Framework for 5G Cybersecurity Training
## 4 Cyber5 Gym Architecture  
The Cyber5 Gym system presents a comprehensive architecture designed to facilitate cybersecurity training in 5G networks. The architecture of our framework is founded on a Docker-based virtualization framework, designed to create a lightweight yet efficient emulation environment for both 5G network components and cybersecurity scenarios. At its core, the system employs Open5 GS for simulating core network functionalities and UERANSIM for the radio access network (RAN) emulation, thereby facilitating a detailed and comprehensive representation of 5G network operations. Docker containers ensure an easily replicable setup and flexible adaptation to a wide range of training requirements. To enhance the realism of cybersecurity training, the 5 Greply tool has been incorporated for the accurate emulation of attack scenarios, including but not limited to SMC-Reply and DoS attacks. This inclusion further enriches the training environment with practical, hands-on experience in identifying, responding to, and mitigating potential security threats within a 5G context. Further details of these key components include:  
1. **Virtualization with Docker**: Docker, an open-source container platform, excels in orchestrating a lightweight virtual environment conducive to code execution, application migration, and enhanced project collaboration. Docker notably surpasses Virtual Machines (VMs) in execution and startup efficiency, demonstrating at least a fifty percent enhancement in performance [41; 42]. The containerization technique inherent in Docker not only streamlines scalable, on-demand service delivery but also significantly curtails IT operational expenses. In contrast, VMs, conceptualized as software constructs within a host environment, offer extensive operating system functionalities appropriate for a broad spectrum of software applications, yet their efficiency is comparatively subdued when placed against Docker containerized approach. Thus, Docker is employed to create a virtualized environment, hosting different network elements, attack emulations, and countermeasures, offering a realistic and adaptable training environment. 2. **Open5 GS and UERANSIM**: Open5 GS [15], an open-source software, implements the core functionalities of the Core Network and Evolved Packet Core (EPC), enabling the creation of private and commercial network solutions. UERANSIM [16], a 5G RAN emulation tool, simulates 5G base stations (gNodeB) and UE for network protocol testing and scenario emulation. These components are crucial for providing a genuine 5G network emulation environment, essential for hands-on cybersecurity training. 3. **5 Greplay [10]**: The 5 Greplay [10], is an open-source 5G network traffic fuzzer designed to evaluate 5G components by replaying and modifying 5G network traffic and injecting network scenarios into a target, which can be a 5G core service (e.g., AMF, SMF) or a RAN network (e.g., gNodeB). We have utilized 5 Greplay for recreating attack scenarios, enhancing the training experience with realistic cyberattack emulations. 4. **Shell Scripts**: The Shell scripts are designed to ensure efficient task coordination and execution across the master and trainee systems, streamlining the operational workflow as shown in the Algorithms 1 and 2. These scripts are also critical in managing the Docker containers, ensuring efficient deployment, configuration, and interaction of network elements. Script Automation streamlines network operations by eliminating the need for manual instantiation of components such as instances, volumes, security groups, floating IPs, and images. This efficiency is manifested through a YAML-formatted text file, which enables the automation of dynamic resource management using shell scripts. A salient feature of this framework is its capacity for one-click execution via a single script, simplifying the deployment and administration of intricate network configurations. This includes the facilitation of a 5G network emulation across all hosts.