## Summary This pull request introduces significant enhancements to the AirSpace class within our network simulation software, aimed at improving the realism, configurability, and accuracy of wireless network simulations. These changes include the addition of new enums and attributes, enhancements to the configuration schema, and improvements in bandwidth management and transmission logic. **Additions** - **Enums and Attributes:** - **AirSpaceEnvironmentType Enum**: Defines various environmental settings that affect wireless signal propagation and interference. - **ChannelWidth Enum**: Specifies available channel width options for wireless interfaces. - **Channel Width Attribute**: Added to WirelessNetworkInterface for dynamic adjustments based on the operational environment. - **airspace_key Attribute**: A tuple identifying the frequency and channel width combination for bandwidth management. - **airspace_environment_type Attribute**: Sets the overall environmental context of the airspace, influencing all contained devices. - **Functional Enhancements:** - **SNR and Capacity Calculation Functions**: New functions estimate_snr and calculate_total_channel_capacity have been implemented to compute signal-to-noise ratios and channel capacities dynamically. - **show_bandwidth_load Function**: Provides a visual representation of the current bandwidth load across different channels. - **Dynamic Speed Setting**: The speed attribute of WirelessInterface is now adjusted dynamically based on frequency, channel width, and environment. - **Configuration and Testing:** - **Configuration Schema Update**: The simulation.network config file schema now supports setting the airspace_environment_type. **Changes** - **Interface and Performance Adjustments:** - **NetworkInterface Speed Type**: Changed from int to float for more precise speed definitions. - **Transmission Feasibility Check**: Updated the _can_transmit function in Link to better handle current load and bandwidth capacities. - **WirelessRouter Configurations**: The configure_wireless_access_point function now takes channel_width as an additional parameter. - **Grouping Adjustments**: WirelessNetworkInterfaces are now categorized by both AirSpaceFrequency and ChannelWidth. - **Transmission Logic Overhaul:** - **Interface Adjustments**: Modifying an interface's settings now necessitates its temporary removal from the airspace, followed by a recalculation of its data rate and reintegration under new settings. - **Blocking Overloads**: Strengthened the logic in AirSpace to prevent transmissions that would surpass the available capacity. **Fixes** - **Transmission Permission Logic**: Fixed the can_transmit_frame function to accurately enforce transmission limits based on current network load and available bandwidth. **Conclusion** These updates significantly enhance the fidelity and flexibility of our network simulation tool, enabling more accurate m...
PrimAITE
The ARCD Primary-level AI Training Environment (PrimAITE) provides an effective simulation capability for the purposes of training and evaluating AI in a cyber-defensive role. It incorporates the functionality required of a primary-level ARCD environment, which includes:
-
The ability to model a relevant platform / system context;
-
The ability to model key characteristics of a platform / system by representing connections, IP addresses, ports, traffic loading, operating systems and services;
-
Operates at machine-speed to enable fast training cycles.
PrimAITE presents the following features:
-
Highly configurable (via YAML files) to provide the means to model a variety of platform / system laydowns and adversarial attack scenarios;
-
A Reinforcement Learning (RL) reward function based on (a) the ability to counter the specific modelled adversarial cyber-attack, and (b) the ability to ensure success;
-
Provision of logging to support AI evaluation and metrics gathering;
-
Realistic network traffic simulation, including address and sending packets via internet protocols like TCP, UDP, ICMP, and others
-
Routers with traffic routing and firewall capabilities
-
Support for multiple agents, each having their own customisable observation space, action space, and reward function definition, and either deterministic or RL-directed behaviour
Getting Started with PrimAITE
💫 Installation
PrimAITE is designed to be OS-agnostic, and thus should work on most variations/distros of Linux, Windows, and MacOS. Currently, the PrimAITE wheel can only be installed from GitHub. This may change in the future with release to PyPi.
Windows (PowerShell)
Prerequisites:
- Manual install of Python >= 3.9 < 3.12
Install:
mkdir ~\primaite
cd ~\primaite
python3 -m venv .venv
attrib +h .venv /s /d # Hides the .venv directory
.\.venv\Scripts\activate
pip install primaite-{VERSION}-py3-none-any.whl[rl]
primaite setup
Unix
Prerequisites:
- Manual install of Python >= 3.8 < 3.12
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.10
sudo apt-get install python3-pip
sudo apt-get install python3-venv
Install:
mkdir ~/primaite
cd ~/primaite
python3 -m venv .venv
source .venv/bin/activate
pip install primaite-{VERSION}-py3-none-any.whl[rl]
primaite setup
Developer Install from Source
To make your own changes to PrimAITE, perform the install from source (developer install)
1. Clone the PrimAITE repository
git clone git@github.com:{todo:fill in URL}/PrimAITE.git
2. CD into the repo directory
cd PrimAITE
3. Create a new python virtual environment (venv)
python3 -m venv venv
4. Activate the venv
Unix
source venv/bin/activate
Windows (Powershell)
.\venv\Scripts\activate
5. Install primaite with the dev extra into the venv along with all of it's dependencies
python3 -m pip install -e .[dev,rl]
6. Perform the PrimAITE setup:
primaite setup
Note
It is possible to install PrimAITE without Ray RLLib, StableBaselines3, or any deep learning libraries by omitting the rl flag in the pip install command.
Running PrimAITE
Use the provided jupyter notebooks as a starting point to try running PrimAITE. They are automatically copied to your PrimAITE notebook folder when you run primaite setup.
1. Activate the virtual environment
Windows (Powershell)
.\venv\Scripts\activate
Unix
source venv/bin/activate
2. Open jupyter notebook
python -m jupyter notebook
Then, click the URL provided by the jupyter command to open the jupyter application in your browser. You can also open notebooks in your IDE if supported.
📚 Documentation
Pre requisites
Building the documentation requires the installation of Pandoc
Unix
sudo apt-get install pandoc
Other operating systems
Follow the steps in https://pandoc.org/installing.html
Building the documentation
The PrimAITE documentation can be built with the following commands:
Unix
cd docs
make html
Windows (Powershell)
cd docs
.\make.bat html
Example notebooks
Check out the example notebooks to learn more about how PrimAITE works and how you can use it to train agents. They are automatically copied to your primaite installation directory when you run primaite setup.
