Seastar compile, run on Ubuntu with DPDK

Introduction

  • Searstar is a high-performance userspace TCP stack, which can run with/out DPDK. We can refer to it at https://github.com/scylladb/seastar

  • Several similar projects: mTCP from KAIST, F-Stack from Tencent. All of them have well-written codebase.

Compile

  • Env: Ubuntu 16.04 with kernel 4.4.0-131, gcc/g++-7.
  1. Clone the repo: https://github.com/scylladb/seastar

  2. Checkout a stable version: cd seastar; git checkout remotes/origin/seastar-18.08-branch -b seastar-18.08

  3. Install dependencies: sudo ./install-dependencies.sh

  4. Configure compilation: ./configure.py --mode release --enable-dpdk . You might encounter configuration fail. You should upgrade the version of libboost, install yaml and fmt. An example output:

  5. Build the project: ninja. An example output:

Run an example app

  • Use apps/httpd as the example.

  • Run seastar-httpd on server S1; and on S2, use wget command to test whether it works well.

  • S1: Use DPDK’s dpdk-devbind.py to bind a NIC (XL710, 40G in my server) to ‘igb_uio’ driver. Then, running httpd with sudo ./build/release/apps/httpd/httpd --network-stack native --dpdk-pmd --dhcp 0 --host-ipv4-addr 192.168.11.4 --netmask-ipv4-addr 255.255.255.0 --collectd 0 --smp 2. You can change the ip address (192.168.11.4) with your own setting, and the number of CPU cores in --smp 2.

  • S2: First, run ping 192.168.11.4 to test arp. After httpd process in S1 is started. you will get


    Otherwise,
  • S2: Then, use wget to test http function - wget http://192.168.11.4:10000. You will get