Crates.io | rust_ofp |
lib.rs | rust_ofp |
version | 0.2.1 |
source | src |
created_at | 2016-12-30 20:02:36.343571 |
updated_at | 2017-01-30 15:40:45.375436 |
description | Rust OpenFlow 0x01 Protocol and Controller Framework |
homepage | |
repository | https://github.com/baxtersa/rust_ofp |
max_upload_size | |
id | 7861 |
size | 81,718 |
rust_ofp
aims to implement the OpenFlow1.0 protocol, for purposes of prototyping SDN systems in Rust. In the future, this may grow to support other OpenFlow specifications (namely 1.3), and others protocols entirely.
I'm drawing heavily on inspiration and code structure from the frenetic-lang project, due to my familiarity with it. I hope that Rust will enable a more natural implementation of the low-level protocol than OCaml + CStructs, and true parallelism will allow for higher controller performance and a simpler event loop.
See my blog post on the crate here!
rust_ofp
is composed of a Rust library implementing the OpenFlow 1.0 protocol, and a rust_ofp_controller
binary that currently acts as little more than an echo server for SDN configurations. It can be built and run by the normal means for Rust projects.
cd path/to/rust_ofp
cargo build
cargo run
I'm performing all correctness evaluation in mininet for the time being. Mininet offers quick feedback, as much scalability as I need for now, and should properly support OpenFlow 1.0 (and other protocols). There is no reason correctness in mininet shouldn't transfer to physical hardware as well, and maybe one day I'll get around to testing out that hypothesis.
Anyway, testing the controller binary is pretty straightforward, assuming mininet is installed. In one terminal
cd path/to/rust_ofp
cargo run
In another terminal
sudo mn --controller=remote
The terminal running rust_ofp_controller
will occasionally print some things out, logging a rough idea of the types of messages it receives, and behaviors it performs.
The mininet terminal should launch an interactive shell with the typical mininet utilities.
Currently, the test executable for rust_ofp
implements MAC learning, so as hosts ping eachother, the controller installs forwarding rules on switches rather than routing all packets through the controller.
Travis CI automatically uploads source documentation generated by cargo doc
.
Some parts of the OpenFlow 1.0 standard remain unimplemented. Notably, rust_ofp
does not currently implement the following message codes:
OFPT_VENDOR
OFPT_GET_CONFIG_REQUEST/OFPT_GET_CONFIG_REPLY
OFPT_SET_CONFIG
OFPT_PORT_MOD
OFPT_STATS_REQUEST/OFPT_STATS_REPLY
OFPT_QUEUE_GET_CONFIG_REQUEST/OFPT_QUEUE_GET_CONFIG_REPLY
The current controller executable is a minimal wrapper around the protocol that doesn't dynamically handle any rule configuration. Future goals for the controller include:
DROP
on launch.