The AES Encryption Plugin is an extension to Ramulator 2.0, a modern, modular, and extensible cycle-accurate DRAM simulator. This plugin integrates the Advanced Encryption Standard (AES) into the memory controller of Ramulator 2.0 to enhance the security of DRAM-based memory systems against hardware attacks such as Rowhammer and Cold Boot. The plugin includes a custom scheduler designed to optimize performance by reducing encryption overhead, achieving a significant reduction in encryption cycles (~40% optimisation).
The plugin leverages Ramulator 2.0’s modular architecture, extending its memory controller interface to incorporate AES encryption and a performance-optimized scheduler. It is implemented in C++ and tested on Ubuntu/WSL using the Ramulator 2.0 simulation environment.
- AES Encryption Integration: Implements AES encryption at the memory controller level to protect data against hardware-based attacks like Rowhammer and Cold Boot.
- Custom Scheduler: Includes a performance-optimized scheduler that reduces encryption overhead by ~40% (from ~750 to ~450 cycles per operation).
- Modular Design: Built using Ramulator 2.0’s extensible interface and implementation framework, allowing seamless integration and easy modification.
- YAML Configuration: Configurable via a human-readable YAML file (
example_config_aes.yaml
) for specifying encryption parameters and scheduler settings. - Tested Workloads: Evaluated using memory traces (e.g.,
aestest.trace
) to demonstrate performance improvements in simulated environments.
The AES Encryption Plugin requires the following dependencies, which are automatically handled by Ramulator 2.0’s build system (CMake):
- Ramulator 2.0: The base simulator, available at CMU-SAFARI/ramulator2.
- C++20 Compiler: Tested with
g++-12
andclang++-15
. - External Libraries:
argparse
,spdlog
,yaml-cpp
(automatically downloaded by CMake).
Ensure you have a C++20-capable compiler (g++-12
or clang++-15
) and CMake installed. The plugin is designed to work on Ubuntu/WSL or compatible Linux environments.
-
Clone the Repository:
git clone https://github.com/aminatpwk/ramulator2-AES cd ramulator2-AES
-
Build Ramulator 2.0 with the Plugin:
mkdir build cd build cmake .. make -j cp ./ramulator2 ../ramulator2 cd ..
This will produce the
ramulator2
executable and thelibramulator.so
dynamic library, both including the AES Encryption Plugin.
The plugin can be used in standalone mode with Ramulator 2.0’s memory-trace parser frontend. To run a simulation with the AES Encryption Plugin:
-
Prepare the Configuration File:
- Use the provided
example_config_aes.yaml
file to configure the plugin. A sample configuration snippet:MemorySystem: DRAM: standard: DDR4 timing: nRCD: 15 Controller: impl: AESEncryption scheduler: FRFCFS
- Use the provided
-
Run the Simulation:
./ramulator2 -f ./example_config_aes.yaml
ramulator2/
├── ext/ # External libraries (argparse, spdlog, yaml-cpp)
├── src/
│ ├── dram_controller/
│ │ ├── plugins/
│ │ │ ├── aes_encryption.cpp # AES encryption implementation
│ │ │ ├── aes_scheduler.cpp # Custom scheduler implementation
│ │ ├── aes_encryption.h # AES encryption interface
│ │ ├── CMakeLists.txt # Component-level CMake configuration
│ ├── ...
├── example_config_aes.yaml # Sample configuration file
├── aestest.trace # Sample memory trace for testing
├── CMakeLists.txt # Project-level CMake configuration
The AES Encryption Plugin follows Ramulator 2.0’s modular design, using interfaces and implementations for extensibility.
To add a new encryption algorithm or scheduler:
- Create a new
.cpp
file insrc/dram_controller/plugins/
(e.g.,new_encryption.cpp
). - Define the implementation class, inheriting from the
AESEncryption
interface andImplementation
base class:#include "aes_encryption.h" #include "base/base.h" namespace Ramulator { class NewEncryption : public IAESEncryptionPlugin, public Implementation { RAMULATOR_REGISTER_IMPLEMENTATION(IAESEncryptionPlugin, NewEncryption, "NewEncryption", "A new encryption implementation.") public: void encrypt_data(uint8_t* data, size_t size) override { // Implement new encryption logic } }; } // namespace Ramulator
- Update
src/dram_controller/CMakeLists.txt
to include the new file:target_sources(ramulator PRIVATE plugins/new_encryption.cpp)
- Specify the new implementation in the YAML configuration:
MemorySystem: Controller: impl: NewEncryption
To add a new component (e.g., a new security interface):
- Create a new directory under
src/
(e.g.,src/security_component/
). - Define the interface in a
.h
file (e.g.,security_interface.h
):#include "base/base.h" namespace Ramulator { class SecurityIfce { RAMULATOR_REGISTER_INTERFACE(SecurityIfce, "SecurityInterface", "Interface for security components.") public: virtual void secure_data(uint8_t* data, size_t size) = 0; }; } // namespace Ramulator
- Add the implementation in
src/security_component/impl/
and update the correspondingCMakeLists.txt
. - Register the new component in
src/CMakeLists.txt
:add_subdirectory(security_component)
The plugin has been verified using Ramulator 2.0’s memory-trace parser with the provided aestest.trace
file. The implementation achieves a ~40% reduction in encryption cycles (from ~750 to ~450 cycles per operation) with the custom scheduler.
To verify the plugin:
- Run the simulation with the provided trace:
./ramulator2 -f ./example_config_aes.yaml
- Compare the output statistics (e.g., encryption cycles, latency) with the baseline configuration to confirm performance improvements.
- The plugin is currently tested in a simulated environment (Ramulator 2.0) and not on real hardware.
- Performance may vary depending on workload characteristics (e.g., memory-intensive applications).
- The plugin assumes AES as the primary encryption algorithm; alternative algorithms require additional implementations.
This plugin is developed as part of the thesis work titled "Implementing Encryption as an Architectural Approach to Securing Memory Systems" by Amina Sokoli, under the supervision of Dr. Ina Papadhopulli at the Polytechnic University of Tirana. We thank the Ramulator 2.0 team for providing an extensible and robust simulation framework.