Git Product home page Git Product logo

sudohalt / net-next-nuse Goto Github PK

View Code? Open in Web Editor NEW

This project forked from libos-nuse/net-next-nuse

0.0 1.0 0.0 786.16 MB

Network Stack in Userspace

License: Other

Makefile 0.27% XSLT 0.01% Assembly 2.05% C 96.09% Shell 0.03% Awk 0.01% TeX 0.01% Perl 0.12% Scala 0.01% Python 0.04% Vim Script 0.01% Objective-C 0.38% C++ 0.97% Objective-C++ 0.01% Bison 0.02% UnrealScript 0.01% Scilab 0.01%

net-next-nuse's Introduction

NUSE (Network Stack in Userspace) Build Status

HOWTO

Build

 make defconfig ARCH=sim
 make library ARCH=sim OPT=no

for a build with netmap,

make library ARCH=sim OPT=no NETMAP=yes

you should see libnuse-linux.so.

Build with Intel DPDK

You need to build dpdk sdk first.

make dpdk-sdk ARCH=sim DPDK=yes

then build with the SDK for DPDK channel of NUSE.

 make defconfig ARCH=sim
 make library ARCH=sim OPT=no DPDK=yes

Additional DPDK configuration is needed, hugepage setup, make an interface DPDK mode.

 ./dpdk/tools/setup.sh
 sudo ./dpdk/tools/dpdk_nic_bind.py -b igb_uio 0000:02:01.0

Run

At first, please write a configuration file for nuse nuse.conf. Example of nuse.conf is shown below.

# Interface definition.
interface eth0
        address 192.168.0.10
        netmask 255.255.255.0
        macaddr 00:01:01:01:01:01
        viftype TAP

interface p1p1
        address 172.16.0.1
        netmask 255.255.255.0
        macaddr 00:01:01:01:01:02

# route entry definition.
route
        network 0.0.0.0
        netmask 0.0.0.0
        gateway 192.168.0.1

When viftype is TAP, the interface name attached to nuse process is not restricted to be same as physical interfaces of host stack. However, viftype RAW, NETMAP, and DPDK require an interface name must be same as a physical interface of host stack.

The default interface will be raw socket based network i/o.

Then, a wrapper script called nuse takes your application running with NUSE.

 sudo NUSECONF=nuse.conf ./nuse ping 172.16.0.2

And, iperf

 sudo NUSECONF=nuse.conf ./nuse iperf -c 192.168.209.1 -u

should just work fine !

since the LD_PRELOAD with sudo technique requires additional copy and permission changes to the library, the script will automatically conduct such an operation.

Run with DPDK

If you want to use nuse with dpdk, interface names of dpdk on nuse.conf must follow the dpdk%d format. The digit X of dpdkX indicates the dpdk port number. An example is shown below.

nuse1:net-next-nuse % cat nuse-dpdk.conf
interface dpdk0
	address 172.16.0.1
	netmask 255.255.255.0
	macaddr 00:01:01:01:01:01
	viftype DPDK

interface dpdk1
	address 172.16.1.1
	netmask 255.255.255.0
	macaddr 00:01:01:01:01:02
	viftype DPDK


nuse1:net-next-nuse % ./dpdk/tools/dpdk_nic_bind.py --status

Network devices using DPDK-compatible driver
============================================
0000:0a:00.0 'Ethernet 10G 2P X520 Adapter' drv=igb_uio unused=
0000:0a:00.1 'Ethernet 10G 2P X520 Adapter' drv=igb_uio unused=

~ snip ~

This set up means "use PCI 0000:0a:00.0 as dpdk0 and PCI 0000:0a:00.1 as dpdk1".

Tested platform

  • Fedora 19 64bits
  • Ubuntu 13.04 64bits
  • Ubuntu 14.04 64bits

net-next-nuse's People

Contributors

acmel avatar adrianbunk avatar arndb avatar axellin avatar bigguiness avatar broonie avatar bzolnier avatar danvet avatar davem330 avatar dhowells avatar ebiederm avatar gregkh avatar heicarst avatar htejun avatar hverkuil avatar ickle avatar jmberg avatar jmberg-intel avatar joeperches avatar kaber avatar larsclausen avatar linvjw avatar neilbrown avatar olofj avatar ozbenh avatar pmundt avatar ralfbaechle avatar rddunlap avatar tiwai avatar torvalds 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.