在 Linux 上编译运行并测试 LwIP 协议栈性能


应用的编译与启动

$ git clone https://github.com/lwip-tcpip/lwip.git
$ cd lwip
# 在 linux lwip默认使用 tap0 作为网络接口
$ sudo ./contrib/ports/unix/setup-tapif
$ cp ./contrib/examples/example_app/lwipcfg.h.example ./contrib/ports/unix/example_app/lwipcfg.h
$ cd ./contrib/ports/unix/example_app
$ vim lwipcfg.h # 去掉`#define USE_DHCP 0` 和`#define USE_AUTOIP 0`的注释,并将`LWIP_LWIPERF_APP`的宏定义为 1
$ mkdir build && cd build
$ cmake -DLWIP_DIR=/path/to/your/lwip/repo ..
$ make
$ sudo ./example_app

iperf 性能测试

另开一个 shell,执行以下命令

$ iperf -c 192.168.1.200


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM