今天是10/15/2016,如果时间太久请移步https://github.com/p4lang/behavioral-model参考最新信息。
BMv2是一个交换机模拟引擎,和p4-factory不同,不依靠代码生成,而是根据p4c-bm编译生成的JSON动态生效。
安装:
===================================================
因为之前安装了p4-factory,所以相关软件可能已经安装好,如果缺东西,请参考github
还是ubuntu1404:
git clone https://github.com/p4lang/behavioral-model.git
cd behavioral-model
./autogen.sh
./configure --with-pdfixed
make
[b]sudo make install[/b]
sudo ldconfig
#注意内存要够大,我的vm 1.5G内存要切换到runlevel 1才编译成功。
#make install 会安装bm开头的命令和simple_switch,用于启动bmv2, 编译switch项目必须
#运行simple_switch, 如果提示libruntimestubs.so.0找不到,需要运行sudo ldconfig
启动:
=======================================================
启动BMv2参考前面文章安装p4c-bm, 然后执行:
tools/veth_setup.sh
p4c-bm --json simple_router.json targets/simple_router/simple_router.p4 //生成JSON文件
[b]sudo[/b] targets/simple_router/simple_router [b]--log-console[/b] -i 0@veth2 -i 1@veth4 simple_router.json
[quote]T
BMv2是一个交换机模拟引擎,和p4-factory不同,不依靠代码生成,而是根据p4c-bm编译生成的JSON动态生效。
安装:
===================================================
因为之前安装了p4-factory,所以相关软件可能已经安装好,如果缺东西,请参考github
还是ubuntu1404:
git clone https://github.com/p4lang/behavioral-model.git
cd behavioral-model
./autogen.sh
./configure --with-pdfixed
make
[b]sudo make install[/b]
sudo ldconfig
#注意内存要够大,我的vm 1.5G内存要切换到runlevel 1才编译成功。
#make install 会安装bm开头的命令和simple_switch,用于启动bmv2, 编译switch项目必须
#运行simple_switch, 如果提示libruntimestubs.so.0找不到,需要运行sudo ldconfig
启动:
=======================================================
启动BMv2参考前面文章安装p4c-bm, 然后执行:
tools/veth_setup.sh
p4c-bm --json simple_router.json targets/simple_router/simple_router.p4 //生成JSON文件
[b]sudo[/b] targets/simple_router/simple_router [b]--log-console[/b] -i 0@veth2 -i 1@veth4 simple_router.json
[quote]T