Skip to content

Simple userspace packet processing for educational purposes πŸŽ“

License

Notifications You must be signed in to change notification settings

ixy-languages/ixy.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c69c60f Β· Feb 13, 2021

History

54 Commits
Jan 17, 2019
Feb 13, 2021
Jan 17, 2019
Nov 25, 2018
Jan 16, 2019
Jan 7, 2019
Jan 17, 2019
May 29, 2018
Jun 23, 2018
Jan 17, 2019
Dec 21, 2018
Jun 23, 2018
Jan 12, 2019
Jan 16, 2019
Jun 3, 2018
Jan 16, 2019
Jun 11, 2018
Jun 23, 2018
Jan 16, 2019
Dec 21, 2018
Jan 17, 2019

Repository files navigation

ixy.py

MIT licensed

ixy.py is a Python rewrite of the ixy userspace network driver. It is designed to be readable, idiomatic Python code. It supports Intel 82599 10GbE (ixgbe family) and Virtio NICs.

Build instructions

Install python3.6 or higher.

From source:

# Install Python 3.7.2 (To be adapted accordingly for the version of choice)
PYTHON_VERSION=3.7.2
PYTHON_DIR="Python-$PYTHON_VERSION"
wget "https://www.python.org/ftp/python/$PYTHON_VERSION/$PYTHON_DIR.tgz"
tar xvf "$PYTHON_DIR.tgz"
rm "$PYTHON_DIR.tgz"
cd $PYTHON_DIR
./configure --enable-optimizations
make -j8
sudo make altinstall
cd ..
rm -fr $PYTHON_DIR

Install pip

wget https://bootstrap.pypa.io/get-pip.py
python3.7 get-pip.py
rm -f get-pip.py

Create a virtual environment

python3.7 -m venv venv
source venv/bin/activate

Install cython

pip install cython

or (from the project directory)

pip install -r <path-to-project-directory>/requirements-dev.txt

Install ixypy

pip install <path-to-project-directory>

Enable hugepages

sudo ./setup-hugetables.sh

Run one of the sample applications in the following way:

python ixy-fwd.py <pci_1> <pci_2>

or

python ixy-pktgen.py <pci>

Disclaimer

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

Other languages

Check out the other ixy implementations

Profiling

cProfile

cProfile

Pystats

Flamegraph

Linux perf

FlameGraph