VPP(Vector Packet Processing)配置工具
前言
- VPP提供了一个配置工具,让用户可以简单快捷地配置VPP。用户可以通过一些简单的命令配置VPP,功能包括安装及一些基本配置和测试用例。
使用
- 先安装一个python的pip模块,使用pip安装VPP的配置工具。
- 如果不确定要如何配置,可以选择默认值:y ,而对于数字,如果问题中有形如[1024]的样子,则1024就是默认值。
在Ubuntu系统下安装运行
- 安装pyhton的pip
$ sudo -H bash
# apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-pip is already the newest version (8.1.1-2ubuntu0.4).
- 安装VPP-config
# pip install vpp-config
Collecting vpp-config
Downloading vpp_config-17.10.5-py2.py3-none-any.whl (52kB)
Requirement already satisfied: pyyaml in /usr/local/lib/python2.7/dist-packages (from vpp-config)
Requirement already satisfied: netaddr in /usr/local/lib/python2.7/dist-packages (from vpp-config)
Installing collected packages: vpp-config
Successfully installed vpp-config-17.10.5
- 然后启动配置工具
# vpp-config
Welcome to the VPP system configuration utility
These are the files we will modify:
/etc/vpp/startup.conf
/etc/sysctl.d/80-vpp.conf
/etc/default/grub
Before we change them, we'll create working copies in /usr/local/vpp/vpp-config/dryrun
Please inspect them carefully before applying the actual configuration (option 3)!
What would you like to do?
1) Show basic system information
2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)
and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml
3) Full configuration (WARNING: This will change the system configuration)
4) List/Install/Uninstall VPP.
5) Execute some basic tests.
9 or q) Quit
Command:
对于Developers
修改代码很简单。编辑并调试根目录中的代码。为了做到这一点,我们需要一个脚本,将文件复制或数据到适当的地方。这是他们最终与点安装。对于Ubuntu,这是/ usr / local / vpp / vpp-config。对于Centos / usr / vpp / vpp-config。我提供了一个能够正确复制相关文件的脚本(./scripts/cp-data.sh)。我还提供了一个清理环境的脚本。这使开发人员可以从头开始。这些是在此环境中运行实用程序的步骤。这些脚本旨在从根目录运行。
./scripts/clean.sh
./scripts/cp-data.sh
./vpp_config.py
当该实用程序使用pip安装时,wrapper scripts / vpp-config被写入/ usr / local / bin。但是,在本地调试此脚本的起点是./vpp_config.py。通过从根目录执行./vpp_config.py来运行该实用程序。
代码中的起点位于vpp_config.py中。大部分工作都在./vpplib中的文件中完成
上传到Pypi
$ sudo -H bash
# cd vpp_config
# python setup.py sdist bdist_wheel
# twine upload dist/*
示例
# vpp-config
Welcome to the VPP system configuration utility
These are the files we will modify:
/etc/vpp/startup.conf
/etc/sysctl.d/80-vpp.conf
/etc/default/grub
Before we change them, we'll create working copies in /usr/local/vpp/vpp-config/dryrun
Please inspect them carefully before applying the actual configuration (option 3)!
What would you like to do?
1) Show basic system information
2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)
and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml
3) Full configuration (WARNING: This will change the system configuration)
4) List/Install/Uninstall VPP.
5) Execute some basic tests.
9 or q) Quit
Command: 1
==============================
NODE: DUT1
CPU:
Model name: Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz
CPU(s): 32
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 2
NUMA node0 CPU(s): 0-7,16-23
NUMA node1 CPU(s): 8-15,24-31
CPU max MHz: 3600.0000
CPU min MHz: 1200.0000
SMT: Enabled
VPP Threads: (Name: Cpu Number)
Grub Command Line:
Current: BOOT_IMAGE=/boot/vmlinuz-4.4.0-97-generic root=UUID=d760b82f-f37b-47e2-9815-db8d479a3557 ro
Configured: GRUB_CMDLINE_LINUX_DEFAULT=""
Huge Pages:
Total System Memory : 65863484 kB
Total Free Memory : 56862700 kB
Actual Huge Page Total : 1024
Configured Huge Page Total : 1024
Huge Pages Free : 1024
Huge Page Size : 2048 kB
Devices:
Devices with link up (can not be used with VPP):
0000:08:00.0 enp8s0f0 I350 Gigabit Network Connection
Devices bound to kernel drivers:
0000:90:00.0 enp144s0 VIC Ethernet NIC
0000:8f:00.0 enp143s0 VIC Ethernet NIC
0000:84:00.0 enp132s0f0,enp132s0f0d1 Ethernet Controller XL710 for 40GbE QSFP+
0000:84:00.1 enp132s0f1,enp132s0f1d1 Ethernet Controller XL710 for 40GbE QSFP+
0000:08:00.1 enp8s0f1 I350 Gigabit Network Connection
0000:02:00.0 enp2s0f0 82599ES 10-Gigabit SFI/SFP+ Network Connection
0000:02:00.1 enp2s0f1 82599ES 10-Gigabit SFI/SFP+ Network Connection
No devices bound to DPDK drivers
VPP Service Status:
Not Installed
==============================
安装VPP
-显示并未安装
VPP Service Status:
Not Installed
==============================
- 现在可以安装VPP
What would you like to do?
1) Show basic system information
2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)
and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml
3) Full configuration (WARNING: This will change the system configuration)
4) List/Install/Uninstall VPP.
5) Execute some basic tests.
9 or q) Quit
Command: 4
There are no VPP packages on node localhost.
Do you want to install VPP [Y/n]? y
INFO:root: Local Command: ls /etc/apt/sources.list.d/99fd.io.list.orig
INFO:root: /etc/apt/sources.list.d/99fd.io.list.orig
INFO:root: Local Command: rm /etc/apt/sources.list.d/99fd.io.list
INFO:root: Local Command: echo "deb [trusted=yes] https://nexus.fd.io/content/repositories/fd.io.ubuntu.xenial.main/ ./
" | sudo tee /etc/apt/sources.list.d/99fd.io.list
INFO:root: deb [trusted=yes] https://nexus.fd.io/content/repositories/fd.io.ubuntu.xenial.main/ ./
.......
演练
- 安装完VPP后我们可以进行演练。会创造一个配置文件并放入dryrun目录中,这些文件应该被检查以确保在真正应用前有效。
What would you like to do?
1) Show basic system information
2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)
and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml
3) Full configuration (WARNING: This will change the system configuration)
4) List/Install/Uninstall VPP.
5) Execute some basic tests.
9 or q) Quit
Command: 2
These device(s) are currently NOT being used by VPP or the OS.
PCI ID Description
----------------------------------------------------------------
0000:86:00.0 82599ES 10-Gigabit SFI/SFP+ Network Connection
0000:86:00.1 82599ES 10-Gigabit SFI/SFP+ Network Connection
Would you like to give any of these devices back to the OS [Y/n]? y
Would you like to use device 0000:86:00.0 for the OS [y/N]? y
Would you like to use device 0000:86:00.1 for the OS [y/N]? y
These devices have kernel interfaces, but appear to be safe to use with VPP.
PCI ID Kernel Interface(s) Description
------------------------------------------------------------------------------------------
0000:90:00.0 enp144s0 VIC Ethernet NIC
0000:8f:00.0 enp143s0 VIC Ethernet NIC
0000:84:00.0 enp132s0f0,enp132s0f0d1 Ethernet Controller XL710 for 40GbE QSFP+
0000:84:00.1 enp132s0f1,enp132s0f1d1 Ethernet Controller XL710 for 40GbE QSFP+
0000:08:00.1 enp8s0f1 I350 Gigabit Network Connection
0000:02:00.0 enp2s0f0 82599ES 10-Gigabit SFI/SFP+ Network Connection
0000:02:00.1 enp2s0f1 82599ES 10-Gigabit SFI/SFP+ Network Connection
0000:86:00.0 enp134s0f0 82599ES 10-Gigabit SFI/SFP+ Network Connection
0000:86:00.1 enp134s0f1 82599ES 10-Gigabit SFI/SFP+ Network Connection
Would you like to use any of these device(s) for VPP [y/N]? y
Would you like to use device 0000:90:00.0 for VPP [y/N]?
Would you like to use device 0000:8f:00.0 for VPP [y/N]?
Would you like to use device 0000:84:00.0 for VPP [y/N]?
Would you like to use device 0000:84:00.1 for VPP [y/N]?
Would you like to use device 0000:08:00.1 for VPP [y/N]?
Would you like to use device 0000:02:00.0 for VPP [y/N]?
Would you like to use device 0000:02:00.1 for VPP [y/N]?
Would you like to use device 0000:86:00.0 for VPP [y/N]? y
Would you like to use device 0000:86:00.1 for VPP [y/N]? y
These device(s) will be used by VPP.
PCI ID Description
----------------------------------------------------------------
0000:86:00.0 82599ES 10-Gigabit SFI/SFP+ Network Connection
0000:86:00.1 82599ES 10-Gigabit SFI/SFP+ Network Connection
Would you like to remove any of these device(s) [y/N]?
These device(s) will be used by VPP, please rerun this option if this is incorrect.
PCI ID Description
----------------------------------------------------------------
0000:86:00.0 82599ES 10-Gigabit SFI/SFP+ Network Connection
0000:86:00.1 82599ES 10-Gigabit SFI/SFP+ Network Connection
Your system has 32 core(s) and 2 Numa Nodes.
To begin, we suggest not reserving any cores for VPP or other processes.
Then to improve performance try reserving cores as needed.
How many core(s) do you want to reserve for processes other than VPP? [0-16][0]?
How many core(s) shall we reserve for VPP workers[0-4][0]? 2
Should we reserve 1 core for the VPP Main thread? [y/N]? y
How many active-open / tcp client sessions are expected [0-10000000][0]?
How many passive-open / tcp server sessions are expected [0-10000000][0]?
There currently 1024 2048 kB huge pages free.
Do you want to reconfigure the number of huge pages [y/N]? y
There currently a total of 1024 huge pages.
How many huge pages do you want [1024 - 19414][1024]? 8192
应用配置
- 配置文件检查完毕后,我们可以用option3来应用。缺省值并不会改变这个指令,如果选择更改grub这个命令行选项,则需要重启。
What would you like to do?
1) Show basic system information
2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)
and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml
3) Full configuration (WARNING: This will change the system configuration)
4) List/Install/Uninstall VPP.
5) Execute some basic tests.
9 or q) Quit
Command: 3
We are now going to configure your system(s).
Are you sure you want to do this [Y/n]? y
These are the changes we will apply to
the huge page file (/etc/sysctl.d/80-vpp.conf).
1,2d0
< vm.nr_hugepages=1024
4,7c2,3
< vm.max_map_count=3096
---
> vm.nr_hugepages=8192
> vm.max_map_count=17408
8a5
> kernel.shmmax=17179869184
10,15d6
< kernel.shmmax=2147483648
Are you sure you want to apply these changes [Y/n]?
These are the changes we will apply to
the VPP startup file (/etc/vpp/startup.conf).
---
>
> main-core 8
> corelist-workers 9-10
>
> scheduler-policy fifo
> scheduler-priority 50
>
67,68c56,66
< # dpdk {
---
> dpdk {
>
> dev 0000:86:00.0 {
> num-rx-queues 2
> }
> dev 0000:86:00.1 {
> num-rx-queues 2
> }
> num-mbufs 25600
>
124c122
< # }
---
> }
Are you sure you want to apply these changes [Y/n]?
The configured grub cmdline looks like this:
GRUB_CMDLINE_LINUX_DEFAULT="isolcpus=8,9-10 nohz_full=8,9-10 rcu_nocbs=8,9-10"
The current boot cmdline looks like this:
BOOT_IMAGE=/boot/vmlinuz-4.4.0-97-generic root=UUID=d760b82f-f37b-47e2-9815-db8d479a3557 ro
Do you want to keep the current boot cmdline [Y/n]?
Show System (after the configuration)
When we show the system information after the system is configured notice that the VPP workers and the VPP main core is on the correct Numa Node. Notice also that VPP is running and the interfaces are shown.
What would you like to do?
1) Show basic system information
2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)
and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml
3) Full configuration (WARNING: This will change the system configuration)
4) List/Install/Uninstall VPP.
5) Execute some basic tests.
9 or q) Quit
Command: 1
==============================
NODE: DUT1
CPU:
Model name: Intel(R) Xeon(R) CPU E5-2667 v3 @ 3.20GHz
CPU(s): 32
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 2
NUMA node0 CPU(s): 0-7,16-23
NUMA node1 CPU(s): 8-15,24-31
CPU max MHz: 3600.0000
CPU min MHz: 1200.0000
SMT: Enabled
VPP Threads: (Name: Cpu Number)
vpp_main : 8
vpp_wk_1 : 10
vpp_wk_0 : 9
vpp_stats : 0
Grub Command Line:
Current: BOOT_IMAGE=/boot/vmlinuz-4.4.0-97-generic root=UUID=d760b82f-f37b-47e2-9815-db8d479a3557 ro
Configured: GRUB_CMDLINE_LINUX_DEFAULT="isolcpus=8,9-10 nohz_full=8,9-10 rcu_nocbs=8,9-10"
Huge Pages:
Total System Memory : 65863484 kB
Total Free Memory : 42048632 kB
Actual Huge Page Total : 8192
Configured Huge Page Total : 8192
Huge Pages Free : 7936
Huge Page Size : 2048 kB
Devices:
Total Number of Buffers: 25600
Devices with link up (can not be used with VPP):
0000:08:00.0 enp8s0f0 I350 Gigabit Network Connection
Devices bound to kernel drivers:
0000:90:00.0 enp144s0 VIC Ethernet NIC
0000:8f:00.0 enp143s0 VIC Ethernet NIC
0000:84:00.0 enp132s0f0,enp132s0f0d1 Ethernet Controller XL710 for 40GbE QSFP+
0000:84:00.1 enp132s0f1,enp132s0f1d1 Ethernet Controller XL710 for 40GbE QSFP+
0000:08:00.1 enp8s0f1 I350 Gigabit Network Connection
0000:02:00.0 enp2s0f0 82599ES 10-Gigabit SFI/SFP+ Network Connection
0000:02:00.1 enp2s0f1 82599ES 10-Gigabit SFI/SFP+ Network Connection
Devices bound to DPDK drivers:
0000:86:00.0 82599ES 10-Gigabit SFI/SFP+ Network Connection
0000:86:00.1 82599ES 10-Gigabit SFI/SFP+ Network Connection
Devices in use by VPP:
Name Socket RXQs RXDescs TXQs TXDescs
TenGigabitEthernet86/0/0 1 2 1024 3 1024
TenGigabitEthernet86/0/1 1 2 1024 3 1024
VPP Service Status:
active (running)
==============================
测试用例
设置IP地址
- vpp配置好后我们可以把ip地址加入到这些已经配置好的接口上。一旦完成,你可以试着ping一下,然后一个运行脚本会创建: /usr/local/vpp/vpp-config/scripts/set_int_ipv4_and_up for Ubuntu and /usr/vpp/vpp-config/scripts/set_int_ipv4_and_up for Centos。
用这个脚本以后可以用来配置IP地址。
What would you like to do?
1) Show basic system information
2) Dry Run (Will save the configuration files in /usr/local/vpp/vpp-config/dryrun for inspection)
and user input in /usr/local/vpp/vpp-config/configs/auto-config.yaml
3) Full configuration (WARNING: This will change the system configuration)
4) List/Install/Uninstall VPP.
5) Execute some basic tests.
9 or q) Quit
Command: 5
What would you like to do?
1) List/Create Simple IPv4 Setup
9 or q) Back to main menu.
Command: 1
These are the current interfaces with IP addresses:
TenGigabitEthernet86/0/0 Not Set dn
TenGigabitEthernet86/0/1 Not Set dn
Would you like to keep this configuration [Y/n]? n
Would you like add address to interface TenGigabitEthernet86/0/0 [Y/n]?
Please enter the IPv4 Address [n.n.n.n/n]: 30.0.0.2/24
Would you like add address to interface TenGigabitEthernet86/0/1 [Y/n]? y
Please enter the IPv4 Address [n.n.n.n/n]: 40.0.0.2/24
A script as been created at /usr/local/vpp/vpp-config/scripts/set_int_ipv4_and_up
This script can be run using the following:
vppctl exec /usr/local/vpp/vpp-config/scripts/set_int_ipv4_and_up
What would you like to do?
1) List/Create Simple IPv4 Setup
9 or q) Back to main menu.
Command: 1
These are the current interfaces with IP addresses:
TenGigabitEthernet86/0/0 30.0.0.2/24 up
TenGigabitEthernet86/0/1 40.0.0.2/24 up
Would you like to keep this configuration [Y/n]?
VPP(Vector Packet Processing)配置工具的更多相关文章
- VPP(Vector Packet Processing)浅析
VPP简介 VPP(Vector Packet Processing)是思科旗下的一款可拓展的开源框架,提供容易使用的.高质量的交换.路由功能 特点:高性能.运行在普通的cpu上. 优点:高性能.技术 ...
- Fast Packet Processing - A Survey
笔记是边读边写的旁注,比较乱,没有整理就丢上来了. 可以说不仅要说fast packet process servey,也同时是一篇packet process的综述了.packet processi ...
- Reading Fast Packet Processing A Survey
COMST 2018 主要内容 这是一篇有关快速包转发的综述,先介绍了包转发的有关基础知识和背景,具体介绍了包转发的主流方法,对这些方法进行了细致详尽的比较,最后介绍了最新的方法和未来的研究方向. 包 ...
- 物联网框架ServerSuperIO(SSIO)更新、以及增加宿主程序和配置工具,详细介绍
一.更新内容 1.修改*Server类,以及承继关系.2.增加IRunDevice的IServerProvider接口继承.3.修复增加COM设备驱动可能造成的异常.4.修复网络发送数据可能引发的异常 ...
- CYQ.Data.Orm.DBFast 新增类介绍(含类的源码及新版本配置工具源码)
前言: 以下功能在国庆期就完成并提前发布了,但到今天才有时间写文介绍,主要是国庆后还是选择就职了,悲催的是上班的地方全公司都能上网,唯独开发部竟不让上网,是个局域网. 也不是全不能上,房间里有三台能上 ...
- SharePoint 2013 表单认证使用ASP.Net配置工具添加用户
前 言 上面一篇博客,我们了解到如何为SharePoint 2013配置表单身份认证,但是添加用户是一个麻烦事儿:其实,我们还可以用Asp.Net的配置工具,为SharePoint 2013添加表单用 ...
- WCF配置工具及服务调试工具
配置工具 C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\SvcConfigEditor.exe WCF调试客户端工具 C:\Program F ...
- virtenv 0.8.6 发布,虚拟桌面配置工具 - 开源中国社区
virtenv 0.8.6 发布,虚拟桌面配置工具 - 开源中国社区 virtenv 0.8.6 发布,virtenv 是一个用 QT4 开发的应用,用来配置和启动基于 LXC 的虚拟桌面环境.该容器 ...
- 『集群』002 Slithice 集群配置工具 的使用
Slithice 集群配置工具 的使用 Slithice集群配置工具 主界面 在测试 Slithice 的 Demo 中,我配置了 7个服务端: 一个 WCF 的 中央服务端: 两个 WCF 的 成员 ...
随机推荐
- Struts2 (四) — 拦截器
一.拦截器 1.概述 1.1什么是拦截器 在struts2中,拦截器(Interceptor)是用来动态拦截Action执行的对象. 拦截器有点类似以前Servlet阶段的Filter(过滤器 ...
- Java 集合:迭代器(Iterator, Iterable)
Iterator接口 public interface Iterator<E> { boolean hasNext(); E next(); void remove(); } 访问元素前需 ...
- 第九天- 文件操作 r w a 文件复制/修改
文件操作简介:使用python来读写文件是非常简单的操作.我们使用 open() 函数来打开一个文件,获取到文件句柄.然后通过文件句柄就可以进行各种各样的操作了.根据打开⽅方式的不同能够执行的操作也会 ...
- html和css入门 (二)
CSS基础 什么是CSS 简单来说,层叠样式表(Cascading Style Sheet)是一种专门用来控制界面外观风格的文档. CSS发展历史 1996年 CSS 1.0 规范面世,其中加入了字体 ...
- UOJ#54 BZOJ3434 [WC2014]时空穿梭
题目描述 小 X 驾驶着他的飞船准备穿梭过一个 \(n\) 维空间,这个空间里每个点的坐标可以用 \(n\) 个实数表示,即 \((x_1,x_2,\dots,x_n)\). 为了穿过这个空间,小 X ...
- C++ Knowledge series 1
Programming language evolves always along with Compiler's evolvement. 1. The C++ Object Model: Strou ...
- Spring面试 IOC和AOP的理解
spring 的优点?1.降低了组件之间的耦合性 ,实现了软件各层之间的解耦 2.可以使用容易提供的众多服务,如事务管理,消息服务等 3.容器提供单例模式支持 4.容器提供了AOP技术,利用它很容易实 ...
- 通过注解实现Spring 声明式事务管理
小Alan接着上一篇Spring事务管理入门与进阶做一些补充,如果对Spring事务管理还不了解的可以看看上一篇文章. 实例 在我们开始之前,至少有两个数据库表是至关重要的,在事务的帮助下,我们可以实 ...
- restframework类继承图
- 基于yaf框架和uploadify插件,做的一个导入excel文件,查看并保存数据的功能
思路: 1.首先,页面前端,上传附件,提交给后台,并带一个随机性的参数(可以用时间戳): 2.后端接收附件,做一系列的逻辑处理,无误后,将对应的文件存储在上传的目录下: 3.然后前端,上传附件成功后, ...