Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

trema/routing_switch

Open more actions menu

Repository files navigation

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

About

Layer 2 routing switch with virtual slicing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
Morty Proxy This is a proxified and sanitized view of the page, visit original site.