Giter VIP home page Giter VIP logo

ixy.go's Introduction

ixy.go

ixy.go is a Go rewrite of the ixy userspace network driver. Check out my thesis Writing Network Drivers in Go or watch the recording of our talk at 35c3 to learn more and check out the other ixy implementations.

ixy.go is designed to be readable, idiomatic Go code with the goal of not only being fast, but also serve as learning material for those interested. We only support the Intel 82599 10GbE NICs (ixgbe family). This is only tested on Debian distributions.

Features

  • just over 1000 lines of Go code for the driver and two sample applications (of which the forwarder is currently not working)
  • simple API to use, see this README
  • almost matches the speed of the C implementation but with the added features of Go (~10% performance loss, depending on batch sizes and CPU speed)

Build instructions

You will need the go compiler. Install using the script provided (ixy.go-install.sh):

sudo ./ixy.go-install.sh

Go is added to PATH by the script but to use it before a restart execute

source ~/.profile

The script downloads the repository to ~/go/src/ixy.go:

cd ~/go/src/ixy.go

If you already have Go installed, just clone the repository instead and continue from here.

Ixy.go uses hugepages. To enable them run:

sudo ./setup-hugetlbfs.sh

To build the binaries, cd into the folders of the respective application and execute

go build

The built binaries are located the respective folders.

Usage

There are two sample applications included in the ixy.go. You can run the packet generator with

sudo ./fwd 0000:AA:BB.C 0000:DD:EE.F

The forwarder does not work yet.

The arguments have to the pci slots of the NIC. They can be looked up by using the lspci command

API

All capitalized variables and functions are exported. This includes the following:

device.go: IxyInterface, IxyDevice, IxyInit, IxyTxBatchBusy

ixgbe.go: ReadStats, RxBatch, TxBatch

memory.go: MemoryAllocateMempool, PktBufAllocBatch, PktBufAlloc, PktBufFree

stats.go: DeviceStats, PrintStats, PrintStatsDiff, StatsInit

Example

fwd and pktgen contain all sample applications included.

Internals

driver/ixgbe.go contains the core logic.

License

ixy.go is licensed under the MIT license.

Disclaimer

ixy.go is not production-ready. Do not use it in critical environments. DMA may corrupt memory.

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.