Coder Social home page Coder Social logo

qingchen1984 / packetgraph Goto Github PK

View Code? Open in Web Editor NEW

This project forked from outscale/packetgraph

0.0 2.0 0.0 2.49 MB

Packetgraph library is a collection of network bricks you can connect to form a network graph.

License: GNU General Public License v3.0

Shell 0.58% Makefile 0.55% M4 0.21% C 90.98% C++ 0.15% Objective-C 0.05% Perl 7.48%

packetgraph's Introduction

Packetgraph ?

Packetgraph is a library aiming to give the user a tool to build networks graph easily, It's built upon the fast DPDK library.

Build Status packetgraph documentation

The goal of this library is to provide a really EASY interface to build you own DPDK based application using Network Function Virtualization Everyone is free to use this library to build up their own network application.

Once you have created and connected all bricks in you network graph, some bricks will be able to poll a burst of packets (max 64 packets) and let the burst propagate in you graph.

Connections between bricks don't store any packets and each burst will propagate in the graph without any copy.

Each graph run on one core but you can connect different graph using Queue bricks (which are thread safe). For example, a graph can be split on demand to be run on different core or even merged.

If you want a graphical representation of a graph, you can generate a dot output.

Packetgraph features

Available bricks (ipv4/ipv6):

  • switch: a layer 2 switch
  • rxtx: setup your own callbacks to get and sent packets
  • tap: classic kernel virtual interface
  • vhost: allow to connect a vhost NIC to a virtual machine (virtio based)
  • firewall: allow traffic filtering passing through it (based on NPF)
  • diode: only let packets pass in one direction
  • hub: act as a hub device, passing packets to all connected bricks
  • nic: allow passing packets to a NIC of the system (accelerated by DPDK)
  • print: a basic print brick to show packets flowing through it
  • antispoof: a basic mac checking, arp anti-spoofing and ipv6 neighbor discovery anti-spoofing
  • vtep: VXLAN Virtual Terminal End Point switching packets on virtual LANs, can encapsulate packets over ipv4 or ipv6
  • queue: temporally store packets between graph
  • pmtud(ipv4 only): Path MTU Discovery is an implementation of RFC 1191
  • fragment-ip(ipv4 only): fragment and reassemble packets, currently broken(outscale#401)
  • user-dipole: setup your own callback in a dipole brick, to filter or implement your own protocol

A lot of other bricks can be created, check our wall ;)

How should I use Packetgraph ?

Packetgraph usage flow

Examples

To build and run examples, you may first check how to build Packetgraph below and adjust your configure command before make:

$ ./configure --with-examples
$ make

To run a specific example, check run scripts in tests directories:

$ ./examples/switch/run_vhost.sh
$ ./examples/switch/run.sh
$ ./examples/firewall/run.sh
$ ./examples/rxtx/run.sh
$ ./examples/dperf/run.sh
...

Building

You will need to build DPDK before building Packetgraph.

Install needed tools

You may adapt this depending on your Linux distribution:

$ sudo apt-get install automake libtool libpcap-dev libglib2.0-dev libjemalloc-dev

Build DPDK

$ git clone http://dpdk.org/git/dpdk
$ cd dpdk
$ git checkout -b v17.11 v17.11
$ make config T=x86_64-native-linuxapp-gcc

Note: use T=x86_64-native-linuxapp-clang to build with clang

Edit build/.config and be sure to set the following parameters to 'y':

  • CONFIG_RTE_LIBRTE_PMD_PCAP

If you don't want to use some special PMD in DPDK requiring kernel headers, you will have to set the following parameters to 'n':

  • CONFIG_RTE_EAL_IGB_UIO
  • CONFIG_RTE_KNI_KMOD

Once your .config file is read, you can now build dpdk as follows:

$ make EXTRA_CFLAGS='-fPIC'

Finally, set RTE_SDK environment variable:

$ export RTE_SDK=$(pwd)

Build packetgraph

$ git clone https://github.com/outscale/packetgraph.git
$ cd packetgraph
$ ./autogen.sh
$ ./configure
$ make
$ make install

Note: to build with clang, you can use ./configure_clang wrapper instead of ./configure.

Note 2: You need a compiler that support C11 (gcc 4.9 or superior, or clang 3.6 or superior).

Licence

Packetgraph project is published under GNU GPLv3. For more information, check LICENSE file.

Contribute

New to packetgraph ? Want to contribute and/or create a new brick ? Some developer guidelines are available.

Question ? Contact us !

Packetgraph is an open-source project, feel free to chat with us on IRC

server: irc.freenode.org

chan: #betterfly

packetgraph's People

Contributors

benoit-canet avatar jerome-jutteau avatar outscale-mgo avatar outscale-nts avatar outscale-toa avatar

Watchers

 avatar  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.