FD.io/VPP — 常用指令集合
目录
文章目录
- 目录
- 前言
- System Level
- Interface
- Add NIC into VPP as Interface
- Interface State
- Hardware Interface State
- Interface MTU
- Interface Promiscuous Mode(混杂模式)
- Interface 类型
- Sub Interface(VLAN 子接口)
- loopback Interface
- memif Interface
- vhost-user Interface
- Tap Interface
- veth Interface
- pipe Interface
- bond Interface
- Trace pkts
- Trace the path if pkt loss
- Trace path for 500 pkts per thread in vpp node
- Pcap
- tcpdump 800 pkts for tx or rx into /tmp/XXX.pcap
- tcpdump dispatch
- DPDK 参数设置
前言
- 官方文档 Debug CLI:https://docs.fd.io/vpp/20.09/d5/d57/clicmd.html
System Level
# 查看版本
show version# 查看线程运行情况
show threads# 查看插件加载情况
show plugin# 查看 CPU 亲和
show cpu affinity# 查看内存运行情况
show memory verbose# 查看 CPU 运行情况
show run# 查看图节点
show vlib graph# 设置日志级别
# class 有 vfio、fib、mfib、igmp、dhcp、nat、tap 等
# level\syslog-level 有 EMERG、ALERT、CRIT、ERR、WARNING、NOTICE、INFO、DEBUG、DISABLED 等
set logging class <class> [rate-limit <int>] [level <level>] [syslog-level <level>]
Interface
Add NIC into VPP as Interface
since NIC should be managed by dpdk PMD rather than kernel, we should ifconfig down this NIC, and unbind kernel driver with dpdk-devbind tool in linux terminal.
$ lspci
...
00:07.0 Ethernet controller: Intel Corporation Ethernet Virtual Function 700 Series (rev 01)
00:08.0 Ethernet controller: Intel Corporation Ethernet Virtual Function 700 Series (rev 01)
00:09.0 Ethernet controller: Intel Corporation Ethernet Virtual Function 700 Series (rev 01)
00:0a.0 Ethernet controller: Intel Corporation Ethernet Virtual Function 700 Series (rev 01)$ ip a
...
11: ens10: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000link/ether fa:16:3e:b2:1e:98 brd ff:ff:ff:ff:ff:ff
12: ens8: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000link/ether fa:16:3e:34:c5:5b brd ff:ff:ff:ff:ff:ff
13: ens9: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000link/ether fa:16:3e:78:0b:00 brd ff:ff:ff:ff:ff:ff
14: ens7: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000link/ether fa:16:3e:88:79:52 brd ff:ff:ff:ff:ff:ff# fa:16:3e:b2:1e:98 => ens10 => 00:0a.0 => N3
# fa:16:3e:78:0b:00 => ens9 => 00:09.0 => N4
# fa:16:3e:34:c5:5b => ens8 => 00:08.0 => N6
# fa:16:3e:88:79:52 => ens7 => 00:07.0 => N9$ ifconfig ens10 down
$ ifconfig ens9 down
$ ifconfig ens8 down$ /root/upf-astri/build-root/install-vpp-native/external/sbin/dpdk-devbind --bind=vfio-pci 00:0a.0
$ /root/upf-astri/build-root/install-vpp-native/external/sbin/dpdk-devbind --bind=vfio-pci 00:09.0
$ /root/upf-astri/build-root/install-vpp-native/external/sbin/dpdk-devbind --bind=vfio-pci 00:08.0
$ /root/upf-astri/build-root/install-vpp-native/external/sbin/dpdk-devbind -s# NOTE: UPF 通过编辑 startup.conf 纳管 interfaces。
then restart VPP, switch vpp cli to check if the NIC found and link status.
show hardware-interfaces brief
Interface State
显示网络层面的逻辑信息,类似:ifconfig。
# 查看指定接口的信息
show interface [address|addr|features|feat] [<interface> [<interface> [..]]]# 查看该接口使能了那些 features。
show int GigabitEthernet3c/0/0 features # 设置指定接口的状态信息
set interface state <interface> [up|down|punt|enable].# 查看 Ingress 接口清单
show interface rx-placement
Hardware Interface State
显示操作系统层面的物理信息,包括:驱动,物理 Link 连通性状态等。
# 查看硬件接口统计信息
show hardware-interfaces [brief|verbose|detail] [bond] [<interface> [<interface> [..]]] [<sw_idx> [<sw_idx> [..]]].# EXAMPLE
show hardware-interfaces
show hardware-interfaces brief
show hardware-interfaces GigabitEthernet7/0/0 2 verbose# 清除硬件接口统计信息
clear hardware-interfaces [<interface> [<interface> [..]]] [<sw_idx> [<sw_idx> [..]]]# EXAMPLE
clear hardware-interfaces
clear hardware-interfaces GigabitEthernet7/0/0 2
Interface MTU
# 设置接口的 MTU
set interface mtu [packet|ip4|ip6|mpls] <value> <interface>
Interface Promiscuous Mode(混杂模式)
# 设置接口是否开启混杂模式
set interface promiscuous [on|off] <interface>
Interface 类型
Sub Interface(VLAN 子接口)
# 创建指定接口的子接口
create sub-interfaces GigabitEthernet7/0/0 100# 删除指定接口的子接口
delete sub-interface GigabitEthernet7/0/0.100
loopback Interface
create loopback interface mac 00:0c:29:1f:ce:07 instance 100
delete loopback interface intfc loop100
memif Interface
VPP 支持在同一个 Linux 主机中运行多个 Instance,并且 Instance 之间可以使用 memif 来进行通信。
memif 是一种高性能的 Direct Memory Interface(直连内存接口),VPP instnace 通过 memif 提供的 Control Channel 的 Socket file 来进行内存的共享。
create memif id 0 /run/vpp/contiv/memif1.sock
create interface memif id 0 socket-id 1 master mode ip secret vpp123
set int state memif0 up
set int ip address memif0 192.168.1.1/24
delete interface memif memif1/0
delete memif socket id 0
vhost-user Interface
# 创建 vhost 接口
create vhost socket /tmp/sock2.sock server# 查看 vhost 接口
show vhost-user [<interface> [<interface> [..]]] [descriptors]
Tap Interface
# NOTE:Linux Host 必须先创建好 Tap 接口
# 创建 Tap 接口,name 参数必须对应 Linux Host 上的接口为 host。
create tap id 10 host-if-name host
set int state tap10 up
set int ip address tap10 192.168.100.100/24
veth Interface
# NOTE:Linux Host 必须先创建好 veth 接口
# 创建 veth 接口,name 参数必须对应 Linux Host 上的接口为 vpp1out。
create host-interface name vpp1out
pipe Interface
pipe 接口,是 VPP 内建的、类似于 veth 的接口,用于连接 VRF。instance 为 Number,最大支持 16384。
pipe create [instance <instance>]
pipe delete <interface># EXAMPLE
# 创建 pipe100 接口,两端为 pipe100.0、pipe100.1 分别接入不同的 VRF。
pipe create instance 100
bond Interface
# 创建 bond 接口
create bond mode lacp load-balance l34# 删除 bond 接口
delete bond BondEthernet0# 为 bond 接口添加 Slave 接口
bond add BondEthernet0 TenGigabitEthernet3d/0/0# 为 bond 接口删除 Slave 接口
bond del TenGigabitEthernet3d/0/0 # 查看 bond 接口详情
show bond details# 设置 bond 接口的权重
set interface bond BondEthernet weight 100
Trace pkts
Trace the path if pkt loss
- check the pkt lost in witch vpp node with cmd ‘trace’
- check the pkt lost in witch step in upf plugin by open the log
- compare detail info bewteen pkt’s 5 tuple and session’s pdr, far
- tcpdump the pkt if needed.
Trace path for 500 pkts per thread in vpp node
追踪 pkt 流经的图节点,以及在每个节点上的操作,在 pkt 接收端执行。
trace add dpdk-input 500
show trace max 500
clear trace
Pcap
tcpdump 800 pkts for tx or rx into /tmp/XXX.pcap
pcap helptrace pcap trace [rx] [tx] [drop] [off] [max <nn>] [intfc <interface>|any][file <name>] [status] [max-bytes-per-pkt <nnnn>][filter][preallocate-data][free-data]# Step1 列出 VPP 纳管的 Network interfaces。
show interface address# Step2 选择要抓包的 Network interface 并开启 pcap 抓包。
pcap trace tx rx intfc VirtualFunctionEthernet0/6/0 max 10000 file XX-rxtx.pcap# Step3 查看当前抓包的状态。
pcap trace tx rx status# Step4 抓完包之后,记得一定要关闭。
pcap trace off
tcpdump dispatch
Dispatch 抓包模式会把 VPP 的 Dispatch Trace 也抓包到 pcap 中。
pcap dispatch trace on max 500
pcap dispatch trace off
DPDK 参数设置
# 设置此接口的 rx/tx 队列的大小。
set dpdk interface descriptors TenGigabitEthernet6/0/0 tx/rx 1024
FD.io/VPP — 常用指令集合相关推荐
- FD.io/VPP — Overview
目录 文章目录 目录 FD.io VPP FD.io 官网:https://fd.io FD.io(Fast data – Input/Output)是 Linux 基金会下属的一个开源项目,成立于 ...
- FD.io VPP软件架构(一):vppinfra(基础结构层)
FD.io VPP:用户文档 软件架构 vppinfra(基础结构层) RToax 2020年9月 VPP /软件架构 Software Architecture fd.io vpp实现是第三代矢量数 ...
- FD.io VPP 20.09版本正式发布:往期VPP文章回顾+下载地址+相关链接
目录 下载RPM/DEB包 往期文章回顾与推荐 FD.io是一些项目和库的集合,基于DPDK并逐渐演化,支持在通用硬件平台上部署灵活可变的业务.FD.io为软件定义基础设施的开发者提供了一个通用平台, ...
- FD.io VPP环境下运行用户应用程序教程
FD.io VPP环境下运行用户应用程序教程 RToax 2020年9月 相关文章:<FD.io VPP利用iperf3进行UDP灌包测试-英特尔X520万兆网卡> 1. VPP简介 VP ...
- FD.io VPP:用户文档:VPP RPM包的构建与离线安装
VPP RPM包的构建与离线安装 RToax 2020年9月 要开始使用VPP进行开发,您需要获取所需的VPP源代码,然后构建软件包. 1. 设置代理 如果你的服务器本地可以连接互联网,则跳过设置代理 ...
- FD.io VPP基本介绍:理解向量包处理(VPP)
FD.io VPP:用户文档 向量包处理器 RToax 2020年9月 1. 什么是向量包处理器(VPP) FD.io的矢量包处理器(VPP)是一个快速,可扩展的2-4层多平台网络协议栈.它在Linu ...
- FD.io VPP:CentOS7下构建自己的VPP RPM包
FD.io VPP:用户文档 构建VPP RToax 2020年9月 要开始使用VPP进行开发,您需要获取所需的VPP源代码,然后构建软件包. 1. 设置代理 如果你的服务器本地可以连接互联网,则跳过 ...
- FD.io VPP利用iperf3进行UDP灌包测试-英特尔X520万兆网卡
FD.io VPP:用户文档 iperf3灌包测试 RToax 2020年9月 架构 1. VPP环境配置与启动 1.1. 安装VPP环境 略 1.2. VPP配置文件 启动配置文件startup-i ...
- FD.io VPP:探究分段场景下vlib_buf在收发包的处理(dpdk_plugin.so)、rte_mbuf与vlib_buf 关系
Table of Contents rte_mbuf.vlib_buf 关系及内存分布 使用dpdk-收包接口函数 使用dpdk 发包接口函数 总结 参考阅读 在使用vpp老版本copy报文的时候,经 ...
最新文章
- CBitmapButton的使用(转)
- Google 全球员工围攻 Google!
- pytorch list转tensor_PyTorch 52.PyTorch常用代码段合集
- python batch_size_python 實現動態 batch size,多張圖片如何堆疊轉成指針
- html5游戏制作入门系列教程(三)
- mysql优化-面试题
- java+jvm+log_java8添加并查看GC日志(ParNew+CMS)
- 50行python代码自动生成文章_如何通过50行Python代码获取公众号全部文章
- [Ubuntu 10.04]Firefox中Flash汉字乱码问题的解决
- warning: malformed '#pragma pack(pop[, id])' - ignored
- 面试题之Servlet工作原理
- 汇编语言学习笔记(【汇编语言】小甲鱼零基础汇编)
- pom文件中的dependencyManagement和dependency
- mac 删除ABC输入法
- unable to resolve column. This inspection performs unresolved sql references check.
- html编辑器如何设置滚动字幕,使用Axure RP为网页添加滚动字幕的具体操作步骤
- 法律硕士毕业论文应该怎么写?
- SHA256加密-前端 中 HMAC-SHA256的base64加密 和 md5加密
- 【抖音视频剪辑】台词找影片素材,剪视频必备
- WSTMall微信版
热门文章
- c ef框架-mysql_.net EF框架 MySql實現實例
- C什么k什么_G、D、C、Z、T、K、L、Y,这些字母和火车级别有什么关系
- db2和mysql性能_关于DB2数据库的性能分析记录
- 如何用photoshop做24色环_如何用Photoshop给照片添加印章水印,内附印章模板素材...
- webapi控制器怎么接收json_一个秒杀系统的登录系统到底是怎么工作的
- PHP多台服务实现单点登录,如何在多台服务器上共享Session(PHP/JSP/ASP.NET)以及单点登录(SSO)...
- 脑电分析系列[MNE-Python-4]| MNE中数据结构Evoked及其对象创建
- IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python
- VR教育进入新加坡课堂
- 自制树莓派“防松鼠神器”在Reddit火了,13行代码就能让AI替你护食,成本300+元...