Giter Site home page Giter Site logo

dtalayco / air_iri Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opennetworkingfoundation/pif-air-iri-archive

0.0 1.0 0.0 523 KB

A proposed Protocol Independent Forwarding intermediate representation and switch simulator

License: Apache License 2.0

Makefile 1.79% Python 98.21%

air_iri's Introduction

AIR and IRI: An IR and Implementation

This repository contains code related to ongoing work under the aegis of Protocol Independent Forwarding (PIF).

See the Doxygen generated documentation, and in particular the AIR and IRI readme files (under Related Pages).

Getting Started

See the Detailed Getting Started below for installing dependencies.

AIR

AIR, which just stands for An Intermediate Representation, is a high level framework for describing network forwarding processing logic and composing that logic into a functioning switch.

AIR uses YAML for its specification, both for the metalanguage specification and for the specification of a switch instance.

Here is a high level diagram showing how AIR and IRI relate.

AIR and IRI

Default AIR metalanguage

The following types are defined in air_meta.yml.

TODO: Only a few of these are documented currently.

  • value_set : A run time managed container of values that may be referenced, for example, by parser states for checking if a select value is in a given set.
  • value_map : A run time managed container that is implemented as a key-value map.
  • table :
    • match_on : A map from field references to match types (exact, ternary, valid, lpm) which forms the key for the table lookup.
    • allowed_actions : This attribute is ignored by AIR and IRI currently, but allows the protocol designer to call out the actions that are allowed to be referenced by entries in this table.
  • header
  • metadata
  • action
  • parse_state
  • parser
  • control_flow
  • traffic_manager
  • processor_layout

IRI

IRI is a simple Python based implementation of the AIR framework. It accepts an instance of an AIR switch specification and instantiates a switch conforming to the logic described.

IRI uses the OFTest framework data plane implementation. This allows the switch to use ethernet, virtual ethernet, TCP sockets or UDP sockets as the port interfaces.

Dependencies

  • Python 2.7+ (but may not be Python 3 compatible)
  • pydot and yaml for graphical tools and parsing

The port abstraction uses the Python VPI module which is distributed in conjunction with OFTest and BigCode infrastructure:

NOTE: pcap as a means of controlling veths is not yet working

  • This should work, but is having trouble; suggest NOT installing python-pypcap

For documentation:

  • Doxygen
  • doxypy

For coverage:

  • Python coverage: sudo pip install coverage (requires pip)

Initial Goals

  • Fixed length headers
  • Header stacks
  • Very simple queuing model
    • Strict and round_robin disciplines
    • No queue length limits
    • No multicast support

Next Steps

  • Variable length headers (as per IPv4 options)
  • Support weighted and/or deficit round robin disciplines
  • Support tail dropping in queuing
  • Counters for queues
  • Multicast

Future Goals

  • TLV parsing
  • Support custom queuing disciplines

Detailed Getting Started

This section assumes Ubuntu as the base install.

Install Required Packages

  • You should be able to check out repositories from github.

    • If you can't, first run: sudo apt-get install git
    • See github.com for getting a log in ID
  • Download the IR repo

  • Run the install script to get the required packages:

    • cd air_iri/tools
    • sudo ./install_pkgs.sh
    • This should have installed the following
      • Install Python: sudo apt-get install python-all
      • Install Python development: sudo apt-get install python-dev
      • Install libpcap: sudo apt-get install libpcap-dev
      • Install swig: sudo apt-get install swig
      • Install pkg-config: sudo apt-get install pkg-config
      • Install tools for debian: sudo apt-get install python-stdeb devscripts
      • Install Python yaml tools: sudo apt-get install python-yaml
      • Install Python graphical tools: sudo apt-get install python-pydot
      • Install Scapy: sudo apt-get install python-scapy
      • Install Doxygen: apt-get install doxygen
      • Install Doxygen python preprocessor: apt-get install doxypy

You may need to update the Python package if it is installed, but outdated.

Run AIR/IRI Unit Tests

  • cd air_iri
  • make test

Set Up The Data Plane

  • Create veth ports
    • cd air_iri
    • sudo tools/veth_setup.sh

Note: Support for Virtual Port Interfaces will be coming

Run the IRI Switch

  • Start the switch
    • cd air_iri
    • make start-l3

You should see output like the following.

~/pkg/air_iri$ START_YML=l3.yml make start

sudo PYTHONPATH=.:submodules/oftest/src/python ./start.py -v l3.yml
INFO:root:Creating IRI switch instance
INFO:root:Starting dataplane
WARNING:dataplane:Missing pypcap, VLAN tests may fail. See README for installation instructions.
INFO:root:Adding port veth0
INFO:root:Adding port veth2
INFO:root:Adding port veth4
INFO:root:Adding port veth6
INFO:root:Starting IRI Switch instance ichiban
INFO:root:Opening AIR input file: l3.yml
INFO:root:Creating parser parser
... (more debug output)
INFO:root:IR switch ichiban running
  • Send packets to the switch
    • You can do this by running the basic OFTest instance
    • cd air_iri/submodules/oftest
    • sudo ./oft pktact.PacketOnly --verbose

Roadmap

This is an unorganized list of things to work on going forward

  • Controller interface
    • Support OpenFlow interface
    • Generate table update APIs
    • Expose table update APIs through Thrift
  • Manifest: A manifest would be a list of files that should be aggregated into a single YAML input before being processed. This would centralize the control and order of file inclusion and replace the need for processing "include", "import" or "require" directives in the source files themselves.
  • Templating for output. There is currently a templates branch which has some initial code for processing tenjin template files.

air_iri's People

Contributors

dtalayco avatar bmackcrane avatar

Watchers

 avatar

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.