#sdn #controller #cli #tokio #openflow

bin+lib 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.

9 releases (3 stable)

new 1.0.2 May 8, 2025
1.0.1 Apr 1, 2025
1.0.0 Mar 31, 2025
0.5.0 Oct 21, 2024
0.3.3 Aug 26, 2024

#788 in Command line utilities

Download history 1/week @ 2025-02-01 6/week @ 2025-02-08 7/week @ 2025-02-15 216/week @ 2025-03-29 39/week @ 2025-04-05 4/week @ 2025-04-12 92/week @ 2025-05-03

99 downloads per month

MIT license

250KB
4.5K SLoC

Tenjin SDN

version download license size issue last-commit

Table of Contents

Features

  • 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

Quick Start

As a Command-Line Tool

  1. Install Rust and Cargo:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  1. Install Tenjin:
cargo install tenjin_sdn
  1. Run the example controller:
tenjin run

As a Library

  1. Add Tenjin to your project:
cargo add tenjin_sdn
  1. Add Tokio for async support:
cargo add tokio
  1. 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");
}
  1. if you would like to create your own Controller, you need to install etherparse.
cargo add etherparse

Usage Guide

Command-Line Interface

Basic Usage

# 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

Network Emulation with Mininet

OpenFlow 1.3

sudo mn --controller=remote,ip=127.0.0.1 --mac --switch=ovsk,protocols=OpenFlow13 --topo=tree,2

OpenFlow 1.0

sudo mn --controller=remote,ip=127.0.0.1 --mac --switch=ovsk,protocols=OpenFlow10 --topo=tree,2

Advanced Installation

Minimal Installation

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

Binary Installation

Using cargo-binstall for pre-compiled binaries:

cargo binstall tenjin_sdn

Docker

run the following command to pull and run.

docker run -it --rm --name tenjin ghcr.io/arikato111/tenjin:latest run

or using alias command on Linux.

alias tenjin='docker run -it --rm --name tenjin ghcr.io/arikato111/tenjin:latest'

Dependencies

~5–14MB
~172K SLoC