Code Monkey home page Code Monkey logo

routing_switch's Introduction

Routing Switch

Build Status Code Climate Coverage Status Dependency Status

This is a layer 2 switch application with virtual slicing function. The slicing function allows us to create multiple layer 2 domains. This is similar to MAC-based VLAN but there is no limitation on VLAN ID space.

Prerequisites

  • Ruby 2.0.0 or higher (RVM).
  • Open vSwitch (apt-get install openvswitch-switch).

Install

git clone https://github.com/trema/routing_switch.git
cd routing_switch
bundle install --binstubs

Play

To run without virtual slicing, run lib/routing_switch.rb as follows:

./bin/trema run lib/routing_switch.rb -c trema.conf

To run with virtual slicing support, run lib/routing_switch.rb with -- --slicing options as follows:

./bin/trema run lib/routing_switch.rb -c trema.conf -- --slicing

In another terminal, you can create virtual slices with the following command:

./bin/slice add foo

Then add hosts to the slice with the following command:

./bin/slice add_host --mac 11:11:11:11:11:11 --port 0x1:1 --slice foo

REST API

To start the REST API server:

./bin/rackup

Supported APIs

Read this for details.

Description Method URI
Create a slice POST /slices
Delete a slice DELETE /slices
List slices GET /slices
Shows a slice GET /slices/:slice_id
Add a port to a slice POST /slices/:slice_id/ports
Delete a port from a slice DELETE /slices/:slice_id/ports
List ports GET /slices/:slice_id/ports
Shows a port GET /slices/:slice_id/ports/:port_id
Adds a host to a slice POST /slices/:slice_id/ports/:port_id/mac_addresses
Deletes a host from a slice DELETE /slices/:slice_id/ports/:port_id/mac_addresses
List MAC addresses GET /slices/:slice_id/ports/:port_id/mac_addresses
Shows a MAC address GET /slices/:slice_id/ports/:port_id/mac_addresses/:mac_address

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.