DPDK的L3fwd实践

2018-03-15  本文已影响0人  严炎2016

L3fwd

https://software.intel.com/en-us/articles/introduction-to-the-dpdk-sample-applications

http://blog.csdn.net/baidu_24553027/article/details/56677857

环境说明(ubuntu17.10)

10.5.39.241的intel X520-DA2

90:e2:ba:88:35:40

90:e2:ba:88:35:41

10.5.39.242的intel X520-DA2

90:e2:ba:88:3f:6c

90:e2:ba:88:3f:6d

90:e2:ba:88:35:40----90:e2:ba:88:3f:6c

90:e2:ba:88:35:41----90:e2:ba:88:3f:6d

在10.5.39.242上

export DPDK_DIR=/root/dpdk/dpdk-17.11

export DPDK_TARGET=x86_64-native-linuxapp-gcc

export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET

mkdir -p /dev/hugepages

mount -t hugetlbfs hugetlbfs /dev/hugepages

modprobe uio

insmod $DPDK_BUILD/kmod/igb_uio.ko

export RTE_SDK=$DPDK_DIR

export RTE_TARGET=$DPDK_TARGET

$DPDK_DIR/usertools/dpdk-devbind.py -b igb_uio 0000:84:00.0 0000:84:00.1

cd /root/dpdk/

./l3fwd -l 1,2,3,4 -n 4 -- -p 0x3 -L --config="(0,0,1)(0,1,2)(1,0,3)(1,1,4)"

在10.5.39.241上

export DPDK_DIR=/root/dpdk/dpdk-17.11

export DPDK_TARGET=x86_64-native-linuxapp-gcc

export DPDK_BUILD=$DPDK_DIR/$DPDK_TARGET

mkdir -p /dev/hugepages

mount -t hugetlbfs hugetlbfs /dev/hugepages

modprobe uio

insmod $DPDK_BUILD/kmod/igb_uio.ko

export RTE_SDK=$DPDK_DIR

export RTE_TARGET=$DPDK_TARGET

$DPDK_DIR/usertools/dpdk-devbind.py -b igb_uio 0000:84:00.0 0000:84:00.1

cd /root/pktgen-3.4.9/

./pktgen  -l 0,2,3,4,5  -n 4 --proc-type auto --socket-mem 1024,1024  --huge-dir /dev/hugepages  --file-prefix pg1  -b 00:09.0 -- -P -T -m '[2:3].0,[4:5].1'

set 0 src ip 1.1.1.241/24

set 0 src mac 02:00:00:00:00:00

set 0 dst ip  2.1.1.242

set 0 dst mac 90:e2:ba:88:3f:6c

start 0

set 1 src ip  2.1.1.242/24

set 1 src mac 02:00:00:00:00:01

set 1 dst ip  1.1.1.241

set 1 dst mac 90:e2:ba:88:3f:6d

start 1

在启动双向转发的情况下

停掉端口1的发包,使用单向转发

stop 1

上一篇 下一篇

猜你喜欢

热点阅读