P4安装

P4安装篇

ubuntu 14.04为例子

一、首先要fork到自己的github里面

源码目录

https://github.com/p4lang/p4factory

然后fork到自己的github里面

接着

git clone git@github.com:peiqiaoWang/p4factory.git

二、模块更新

更新p4factory的模块

git submodule update --init --recursive

大部分错误是出现在这里,会经常出现什么错误,很大一部分原因是因为网络不好,因为是外国网站下的,建议用一下VPN(本人是用手机热点,哭晕)

三、快速安装

1、安装全部的ubuntu 14.04的依赖 运行

./install_deps.sh

2、创建veth interfaces

sudo p4factory/tools/veth_setup.sh

3、采用自动配置文件生成 生成文件

cd p4factory
./autogen.sh
./configure

4、验证安装和测试一下模拟器

cd p4factory/targets/basic_routing/
make bm
sudo ./behavioral-model

5、跑一个小程序,在另一个终端

cd p4factory/targets/basic_routing/
sudo python run_tests.py --test-dir tests/ptf-tests/
posted @ 2016-10-02 23:33  考拉小无  阅读(880)  评论(0编辑  收藏  举报