6 releases
0.5.0 | Oct 21, 2024 |
---|---|
0.4.0 | Oct 4, 2024 |
0.3.3 | Aug 26, 2024 |
#824 in Command line utilities
172 downloads per month
160KB
4.5K
SLoC
Tenjin SDN
Tenjin is The software-defined networking framework written in Rust, offering high performance and memory safety. It can be used as both a framework and a command line tool.
Menu
- Installation to your project
- Installation as Command line program
- Cli usage
- Run The example controller
- Mininet
Installation to your project
Normal install includes full
feature by default.
cargo add tenjin_sdn
if you pefer to use only needed library with lightweight and faster compile.
some features needed dependencies you might be not using,which can cause slow compilation. Using only features you needed can decrease number of dependencies you need to compile.
cargo install tenjin_sdn --no-default-features
if you need to use example controller, add -F example
flag to command.
Install Tokio
Tenjin is asynchronous,so for using it, you need to make your main function be async by using tokio. install tokio with command below.
cargo add tokio
Installation as Command line program
With Tenjin as cli you can run The example controller with your terminal without writing any code. (see example controller at ./src/example)
Install Rust
first, you need rust
and cargo
to install Tenjin as comand line program. go to official website for installation.
or run this command below. (For macOS, Linux, or another Unix-like OS)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Install Tenjin
after installing rust and cargo, you can use command below to install Tenjin.
cargo install tenjin_sdn
Cli usage
Run Controller by default (Controller13 with OpenFlow 1.3)
tenjin run
Run Controller10 with Openflow 1.0
tenjin run ctrl10
Run with specific port
tenjin run --port 6653
tenjin run --port 6653,6633
Show details of run
command
tenjin run --help
Run The example controller
After you install tenjin_sdn
to your project with feature example
, you can run example controller with this code below.
Openflow 1.3
use tenjin::{example, openflow::ofp13::ControllerFrame13};
fn main() {
let controller = example::Controller13::new();
controller.listener("127.0.0.1:6633");
}
Openflow 1.0
use tenjin::{example, openflow::ofp10::ControllerFrame10};
fn main() {
let controller = example::Controller10::new();
controller.listener("127.0.0.1:6633");
}
Mininet
Mininet is a network emulator to create virtual networks for rapid prototyping of Software-Defined. Using mininet for testing this SDN Framework.
Run Mininet with Openflow 1.3
sudo mn --controller=remote,ip=127.0.0.1 --mac --switch=ovsk,protocols=OpenFlow13 --topo=tree,2
Run Mininet with Openflow 1.0
sudo mn --controller=remote,ip=127.0.0.1 --mac --switch=ovsk,protocols=OpenFlow10 --topo=tree,2
Learning resources
Dependencies
~3–11MB
~114K SLoC