- High performance and memory safety through Rust
- Support for OpenFlow 1.0 and 1.3
- Asynchronous operation with Tokio
- Built-in example controllers
- Command-line interface for quick testing
- Mininet integration for network emulation
- Install Rust and Cargo:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Install Tenjin:
cargo install tenjin_sdn
- Run the example controller:
tenjin run
- Add Tenjin to your project:
cargo add tenjin_sdn
- Add Tokio for async support:
cargo add tokio
- Use in your code:
use tenjin_sdn::{example, openflow::ofp13::ControllerFrame13};
#[tokio::main]
async fn main() {
let controller = example::Controller13::new();
controller.listener("127.0.0.1:6633");
}
- if you would like to create your own Controller, you need to install etherparse.
cargo add etherparse
# Run default controller (OpenFlow 1.3)
tenjin run
# Run OpenFlow 1.0 controller
tenjin run ctrl10
# Run on specific ports
tenjin run --port 6653
tenjin run --port 6653,6633
For more options:
tenjin run --help
sudo mn --controller=remote,ip=127.0.0.1 --mac --switch=ovsk,protocols=OpenFlow13 --topo=tree,2
sudo mn --controller=remote,ip=127.0.0.1 --mac --switch=ovsk,protocols=OpenFlow10 --topo=tree,2
For faster compilation, you can install only the features you need:
cargo install tenjin_sdn --no-default-features
To include example controllers, add the example
feature:
cargo install tenjin_sdn --no-default-features -F example
Using cargo-binstall for pre-compiled binaries:
cargo binstall tenjin_sdn