Giter Site home page Giter Site logo

ipgen's Introduction

ipgen

ipgen-screenshot

ipgen is an Interactive Packet GENerator.

It is implemented using fast I/O frameworks like netmap and AF_XDP. It can interactively output packets of various sizes and rates, and measure how many have been dropped.

Features

  • Packet generation utilizing fast I/O frameworks
    • netmap on FreeBSD
    • AF_XDP on Linux
  • Benchmarking based on RFC 2544
  • Curses based interactive UI
  • Packet pacing based on H/W feature (kernel patch required)
  • Scenario based packet generation via a script
  • Web based traffic viewer
  • Flow list based packet generation for RSS

Supported OSes and drivers

  • FreeBSD 13 and 14
    • Drivers that support netmap should work
    • em, igb, ixg and ixl are tested
  • Ubuntu Linux 22.04 and Fedora Linux 39
    • Drivers that support AF_XDP should work
    • igb and ixgbe are tested

Build

FreeBSD

pkg install gmake perl libevent

git clone [email protected]:iij/ipgen.git
cd ipgen
gmake depend && gmake && sudo gmake install

Linux

# Ubuntu
apt install libbsd-dev clang libssl-dev libevent-dev libbpf-dev bmake
# Linux
dnf install bmake libevent-devel libxdp-devel libbpf-devel openssl-devel clang libbsd-devel ncurses-devel

git clone https://github.com/iij/ipgen.git
cd ipgen
make depend && make && sudo make install

Packet Pacing and Kernel patches

ipgen can be used with stock kernels of FreeBSD and Linux. However, it packet generation is bursty, i.e., it tries to send packets at once as much as possible. The behavior may be undesired for DUT.

Modern network interfaces support packet pacing features, e.g., IPG and PAP. Unfortunately, the features are not available on stock kernels and you need to patch a used driver if you want to use the feature.

The patch/ directory contains some patches for the features.

Caveat

On linux, ipgen with AF_XDP uses only the 1st hardware queue on a network adapter, so if the network adapter uses multiple hardware queues ipgen with AF_XDP doesn't work correctly.

You can check if your network adapter, say eth0, uses multiple queues by ethtool -l eth0. If so you can change the number of using queues to just one by:

ethtool -L eth0 combined 1

Usage

Please refer to the following presentation materials.

ipgen: Interactive Packet Generator for performance measurement

ipgen's People

Contributors

brian90013 avatar hrs-allbsd avatar msaitoh avatar ozaki-r avatar ryo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ipgen's Issues

Race condition on sequencecheck

There is a race condition on sequencecheck between the main thread and the receiver thread. The main thread calls seqcheck_clear() on RFC2544_RESETTING while the receiver thread calls seqcheck_receive(). seqcheck_receive() tries to update sequence counters and seqcheck_clear() resets its counters. Unfortunately seqcheck_clear() makes a pointer sc_parent NULL transiently in its process, so seqcheck_receive() can touch the NULL pointer and cause a segmentation fault.

We know that a segmentation fault stemming from the race condition occurs on FreeBSD 13.

We probably have to synchronize the threads on RFC2544_RESETTING to avoid the race condition.

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.