Giter Club home page Giter Club logo

ixy.swift's Introduction

ixy.swift

ixy.swift is a Swift rewrite of the ixy userspace network driver. It supports Intel 82599 10GbE NICs (ixgbe family).

Features

  • Driver for Intel 82599 NICs
  • 100% Swift
  • No dependencies except the standard Swift libraries

Links

Build instructions

Currently, only Swift 4.2 has been tested. Installation on debian-stretch can be done using the setup script:

./setup/setup-swift-debian-stretch.sh
source setup/setup-swift-paths.sh

It is also necessary to setup hugepages:

sudo ./setup/setup-hugetlbfs.sh

This project uses the Swift Package Manager. It is divided into the ixy library and the app executable.

To build and run the app:

cd app
swift build

This will automatically build all the necessary components, including the ixy library.

Usage

The app project builds an executable with 3 possible commands: forward, simple, and ping.

The binary can be either run using the swift package manager (which builds the project if it's out-of-date) or by directly executing the binary. The following examples all use swift run app, but there are multiple ways to execute the app.

Command(s) Configuration Description
swift run app [...] Debug Builds and runs the app
./.build/debug/app [...] Debug Runs the app (requires swift build)
swift run -c release app [...] Release Builds and runs the app
./.build/release/app [...] Release Runs the app (requires swift build -c release)

Forward

swift run app fwd [device1] [device2]
swift run app forward [device1] [device2]

Forwards data from device1 (PCI Address) to device2 (PCI Address). For example:

swift run app forward 0000:01:00.0 0000:03:00.0
swift run app fwd 01:00.0 03:00.0

Simple

swift run simple [device]

Listens to packets on the device (PCI Address) and prints their content similar to hexdump. Examples:

swift run app simple 01:00.0

Ping

swift run app ping [device]
swift run app pktgen [device]

Sends dummy packets on the device (PCI Address) and prints how many packets were received. Examples:

swift run app ping 03:00.0

Internals

An overview over Swift language features used in this project can be found here.

This project is split into two parts: the app and the ixy library. The app contains the command line argument parsing and basic logic of the commands, while the ixy library handles the abstraction of the NIC.

There is also a branch containing C implementations of specific functions (see Performance Evaluation for more details) named 'c_ixy_standins'.

The code should be sufficiently documented using comments. A good place to start is Device.swift in the ixy library project.

Performance Evaluation

A small performance evaluation with other available ixy versions (C, Rust, Go, C#) can be found here.

License

ixy.swift is licensed under the MIT license.

Disclaimer

ixy.swift is not production-ready. Do not use it in critical environments or on any systems with data you don't want to lose!

Other languages

Check out the other ixy implementations.

ixy.swift's People

Contributors

thomasguenzel avatar egdeeno avatar ackxolotl 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.