dpdk加速网络协议栈ANS用户手册
文章介绍了如何编译,配置,使用加速网络协议栈ANS。详情参见 https://github.com/ansyun/dpdk-ans
ANS User Guide
LIST
1. Compile ANS.2
1.1. Compile DPDK.2
1.2. Generate ANS static libs.3
1.3. Compile ANS.3
2. ANS Startup.4
3. ANS Configuration.6
3.1. Configure IP.8
3.2. Configure route.8
3.3. Configure neigh.9
3.4. Configure link.9
3.5. Show IP statistics.9
3.6. Configure ACL.10
3.7. Configure log.11
1. Compile ANS
1.1. Compile DPDK
Ø Create work directory
# mkdir work
Ø Download DPDK package to work directory
# wget http://dpdk.org/rel/dpdk-17.05.2.tar.xz
Ø Uncompressing DPDK package
# xz -d dpdk-17.05.2.tar.xz
# tar xvf dpdk-17.05.2.tar
Ø Compile all DPDK libs
# make config T=x86_64-native-linuxapp-gcc
# make install T=x86_64-native-linuxapp-gcc
All DPDK libs are copied to x86_64-native-linuxapp-gcc/lib/directory.
For detail steps, please refer to DPDK website.
(http://dpdk.org/doc/guides/linux_gsg/index.html).
Notes: should choice DPDK version based on ANS version.
1.2. Generate ANS static libs
Ø Set DPDK environment
# export RTE_SDK=/home/work/dpdk-17.05
# export RTE_TARGET=x86_64-native-linuxapp-gcc
Ø Set ANS environment
# export RTE_ANS=/home/work/dpdk-ans
Ø Clone ANS from github
# git clone https://github.com/ansyun/dpdk-ans.git
Ø Generate librte_ans/librte_anssock/librte_anscli
# ./ install_deps.sh
librte_ans is generated in librte_ans directory.
librte_anssock is generated in librte_anssock directory.
librte_anscli is generated in librte_anscli directory.
1.3. Compile ANS
# cd dpdk-ans/ans
# make
Notes: If compile ans failed,shall upgrade your gcc and binutils version.
2. ANS Startup
Ø Run dpdk-setup.sh script to set DPDK environment. Need choice [16],[18], [19], [22].
root@ubuntu:~/dpdk-17.02# ./usertools/dpdk-setup.sh
----------------------------------------------------------
RTE_SDK exportedas /root/dpdk-17.02
----------------------------------------------------------
----------------------------------------------------------
Step 2: Setuplinuxapp environment
----------------------------------------------------------
[16] Insert IGB UIO module
[17] Insert VFIO module
[18] Insert KNI module
[19] Setup hugepage mappings for non-NUMA systems
[20] Setup hugepage mappings for NUMA systems
[21] Display current Ethernet/Crypto device settings
[22] Bind Ethernet/Crypto device to IGB UIO module
[23] Bind Ethernet/Crypto device to VFIO module
[24] Setup VFIO permissions
----------------------------------------------------------
[27] List hugepage info from /proc/meminfo
----------------------------------------------------------
Step 5: Uninstalland system cleanup
----------------------------------------------------------
[28] Unbind devices from IGB UIO or VFIO driver
[29] Remove IGB UIO module
[30] Remove VFIO module
[31] Remove KNI module
[32] Remove hugepage mappings
[33] Exit Script
Ø ANS startup parameters
root@ubuntu:~/dpdk-ans/ans# ./build/ans --help
EAL: Detected 12 lcore(s)
Usage: ./build/ans [options]
EAL common options:
-c COREMASK Hexadecimal bitmask of cores to run on
-l CORELIST List of cores to run on
The argument format is <c1>[-c2][,c3[-c4],...]
where c1, c2, etc are core indexes between 0 and 128
--lcoresCOREMAP Map lcore set to physical cpuset
The argument format is
'<lcores[@cpus]>[<,lcores[@cpus]>...]'
lcores and cpus list are grouped by '(' and ')'
Within the group, '-' is used for range separator,
',' is used for single numberseparator.
'( )' can be omitted for single element group,
'@' can be omitted if cpus and lcores have the same value
--master-lcoreID Core ID that is used as master
-n CHANNELS Number of memory channels
-m MB Memory to allocate (see also--socket-mem)
-r RANKS Force number of memory ranks (don'tdetect)
-b,--pci-blacklist Add a PCI device in black list.
Prevent EAL from using this PCI device. The argument
format is <domain:bus:devid.func>.
-w,--pci-whitelist Add a PCI device in white list.
Only use the specified PCI devices. The argument format
is <[domain:]bus:devid.func>. This option can be present
several times (once per device).
[NOTE: PCI whitelist cannot be used with -b option]
--vdev Add a virtual device.
The argument format is<driver><id>[,key=val,...]
(ex: --vdev=net_pcap0,iface=eth2).
-dLIB.so|DIR Add a driver or driverdirectory
(can be used multiple times)
--vmware-tsc-map Use VMware TSCmap instead of native RDTSC
--proc-type Type of this process(primary|secondary|auto)
--syslog Set syslog facility
--log-level Set default log level
-v Display version informationon startup
-h, --help This help
EAL options for DEBUG use only:
--huge-unlink Unlinkhugepage files after init
--no-huge Use malloc instead of hugetlbfs
--no-pci Disable PCI
--no-hpet Disable HPET
--no-shconf No shared config (mmap'd files)
EAL Linux options:
--socket-mem Memory to allocate on sockets (commaseparated values)
--huge-dir Directory where hugetlbfs is mounted
--file-prefix Prefix forhugepage filenames
--base-virtaddr Base virtual address
--create-uio-dev Create/dev/uioX (usually done by hotplug)
--vfio-intr Interrupt mode for VFIO(legacy|msi|msix)
--xen-dom0 Support running on Xen dom0 withouthugetlbfs
-p PORTMASK:hexadecimal bitmask of ports to configure
-P : enablepromiscuous mode
--config(port,queue,lcore): rx queues configuration
--no-numa:optional, disable numa awareness
--enable-kni:optional, disable kni awareness
--enable-jumbo: enablejumbo frame which max packet len is PKTLEN in decimal (64-9600)
Ø ANS startup example
# ./build/ans -c 0x4 -n 1 --base-virtaddr=0x2aaa2aa0000-- -p 0x1 --config="(0,0,2)"
EAL: Detected 12 lcore(s)
EAL: 128 hugepages of size 2097152 reserved, but nomounted hugetlbfs found for that size
EAL: Probing VFIO support...
EAL: PCI device 0000:06:00.0 on NUMA socket -1
EAL: probedriver: 8086:10fb net_ixgbe
EAL: PCI device 0000:06:00.1 on NUMA socket -1
EAL: probedriver: 8086:10fb net_ixgbe
EAL: PCI device 0000:07:00.0 on NUMA socket -1
EAL: probedriver: 8086:10fb net_ixgbe
EAL: PCI device 0000:07:00.1 on NUMA socket -1
EAL: probedriver: 8086:10fb net_ixgbe
param nb 1 ports 1
port id 0
3. ANS Configuration
Ø Compile anscli
# make
Ø Run anscli
# ./build/anscli
EAL: Detected 12 lcore(s)
EAL: WARNING: Address Space Layout Randomization (ASLR)is enabled in the kernel.
EAL: This maycause issues with mapping memory into secondary processes
ans>
Notes:should run ans processbefore run anscli
Ø anscli help
ans> help
ip addr add IFADDR dev STRING
ip addr del IFADDR dev STRING
ip addr show
ip route add DESTIP via NEXTHOP
ip route del DESTIP
ip route show
ip link show
ip neigh show
ip stats show
acl add index NUMBER srcaddr IPADDR dstaddr IPADDRsrcportstart NUMBER srcportend NUMBER dstportstart NUMBER dstportend NUMBERprotocol NUMBER dev IFACE
index - ACL ruleindex [1 - 2048], large index has high priority.
srcaddr - sourceIP subnet address, 0.0.0.0/0 match all IP, [ip-address/mask]
dstaddr -destination IP subnet address, 0.0.0.0/0 match all IP, [ip-address/mask]
srcportstart -source port start [0...65535]
srcportend -source port end [0...65535]
dstportstart -destination port start [0...65535]
dstportend -destination port start [0...65535]
protocol - IPprotocol, 0 match all protocol, [0...255]
iface - inputinterface name, 'any' match all iface
drop|accept|bypass - drops or accepts or bypass all packets that matchthe rule
note: match ACLrule at PREROUTING.
bypass:forward packets to kernel.
acl del index NUMBER
index - ACL ruleindex [1 - 2048]
acl show
log level set [emerg | alert | crit | err | warning |notice | info | debug]
help
quit
3.1. Configure IP
Ø Add IP
ans> ip addr add 10.10.10.10/24 dev eth0
Add IP address successfully
ans>
Ø Delete IP
ans> ip addr del 10.10.10.10/24 dev eth0
Del IP address successfully
ans>
Ø Show IP
ans> ip addr show
eth0: mtu 1500
link/ether08:00:27:de:5d:8e
inet addr:10.0.0.2/24
ans>
3.2. Configure route
Ø Add route
ans> ip route add 20.0.0.0/24 via 10.0.0.20
Add routing successfully
ans>
Ø Delete route
ans> ip route del 20.0.0.0/24
Del routing successfully
ans>
Ø Show route
ans> ip route show
ANS IP routing table
10.0.0.0/24 viadev eth0 src 10.0.0.2
10.10.0.0/24 via10.0.0.5 dev eth0
ans>
3.3. Configure neigh
Ø Show arp table
ans> ip neigh show
ANS IP neigh table
10.0.0.11 deveth0 lladdr 08:00:27:82:ca:ad REACHABLE
ans>
3.4. Configure link
Ø Show link status
ans> ip link show
eth0: port 0 state UP speed 1000Mbpsfull-duplex mtu 1500
link/ether 08:00:27:de:5d:8e
RXpackets:29 errors:0 dropped:0
TXpackets:4 errors:0 dropped:0
RXbytes:5433 TX bytes:312
ans>
3.5. Show IP statistics
ans> ip stats show
Total packets received :33
Checksum bad :0
Packet too short :0
Notenough data :0
IPheader length < data size :0
IPlength < ip header length :0
Fragments received :0
Frags dropped (dups, out of space) :0
Fragments timed out :0
Packets forwarded :0
Packets fast forwarded :0
Packets rcvd for unreachable dest :0
Packets forwarded on same net :0
Unknown or unsupported protocol :0
Datagrams delivered to upper level :31
Total ip packets generated here :3
Lostpackets due to nobufs, etc. :0
Total packets reassembled ok :0
Datagrams successfully fragmented :0
Output fragments created :0
Don't fragment flag was set, etc. :0
Error in option processing :0
Packets discarded due to no route :0
IPversion != 4 :0
Total raw ip packets generated :0
IPlength > max ip packet size :0
Multicasts for unregistered grps :0
Nomatch gif found :0
Invalid address on header :0
Packets filtered :0
ans>
3.6. Configure ACL
Ø Add acl rule
ans> acl add index 100 srcaddr10.10.10.0/24 dstaddr 20.20.20.0/24 srcportstart 0 srcportend 65535dstportstart 0 dstportend 65535 protocol 0 iface any drop
Add ACL rule successfully
ans>
Ø Delete acl rule
ans> acl del index 100
Delete ACL rule successfully
ans>
Ø Show acl rule
ans> acl show
ACL rule 100:
Source subnet address :10.10.10.0/24
Destination subnet address : 20.20.20.0/24
Source port range : 0 -65535
Destination port range : 0 -65535
IPprotocol : 0
Interfacename : any
Action : drop
ans>
3.7. Configurelog
Ø Enable debug log
ans> log level set debug
Set log level successfully
ans>
Ø Disable debug log
ans> log level set info
Set log level successfully
ans>
dpdk加速网络协议栈ANS用户手册相关推荐
- dpdk 网络协议栈 vpp OvS DDos SDN NFV 虚拟化 高性能专家之路
DPDK核心代码 public void string main(String agrs[]){//获取课程vx 80407290 } 一.什么是DPDK 对于用户来说,它可能是一个性能出色的包数据处 ...
- 手写网络协议栈-协议封装,netmap,dpdk网卡数据抓取,柔性数组
今夜只有一个话题,手写网络协议栈,保证大家都能学会 1. 协议头的封装 2. netmap/dpdk的原理 3. 柔性数组的使用 视频讲解如下,点击观看: 手写网络协议栈-协议封装,netmap,dp ...
- 【Linux服务器开发系列】手写一个用户态网络协议栈,瞬间提升你网络功底丨netmap/dpdk的实现
手写一个用户态网络协议栈,瞬间提升你网络功底 1. 网卡基础架构 2. netmap/dpdk的实现 3. 网络协议栈实战 [Linux服务器开发系列]手写一个用户态网络协议栈,瞬间提升你网络功底丨n ...
- DPDK加速FPGA支持,强强联手助力数据中心网络加速
背景 DPDK在专注数据面报文处理的同时,一直紧跟网络发展的脉搏以开放的姿态融合不断涌现的各种新的网络设备.从最初的普通网卡,到集成虚拟化和交换功能的高级网卡,再到各种网络SoC(片上系统)设备,到现 ...
- 《深入浅出DPDK》读书笔记(十四):DPDK应用篇(DPDK与网络功能虚拟化:NFV、VNF、IVSHMEM、Virtual BRAS“商业案例”)
Table of Contents DPDK应用篇 DPDK与网络功能虚拟化 157.网络功能虚拟化 13.1.1起源 158.发展 159.OPNFV与DPDK NFV的部署 160.NFV的部署 ...
- linux内核网络协议栈--监控和调优:接收数据(十五)
译者序 本文翻译自 2016 年的一篇英文博客 Monitoring and Tuning the Linux Networking Stack: Receiving Data.如果能看懂英文,建议阅 ...
- 阿里云张毅萍:构建边缘云全站加速网络体系
简介:2021年6月9日,亚太内容分发大会暨CDN峰会在北京举行,阿里云边缘云网络高级技术专家张毅萍受邀参会,分享了阿里云在构建边缘云全站加速网络体系的实践,基于边缘云节点支撑各种应用协议的分层传输加 ...
- Linux网络协议栈:中断下半部处理
<Linux中断处理:上半部和下半部> <Linux网络协议栈:中断下半部处理> 目录 数据包上送 网络中断下半部处理 总结 推荐阅读 在<Linux网络协议栈:网络包接 ...
- TCP/IP网络协议栈面试经典题目
目录 面试官:看你简历说精通TCP和IP,那我们来讨论下网络模型和TCP.IP协议,讲下你的理解先 面试官:看你画的图,TCP有自己的首部结构,这都有哪些字段,最好说说它们的作用 面试官:那TCP和U ...
- Linux网络协议栈:网络包接收过程
目录 一 Linux网络收包总览 二 Linux启动 2.1 创建ksoftirqd内核线程 2.2 网络子系统初始化 2.3 协议栈注册 2.4 网卡驱动初始化 2.5 启动网卡 三 迎接数据的到来 ...
最新文章
- 智能车竞赛技术报告 | 智能车视觉 - 天津大学 - 北洋钽星
- 如何停止一个正在运行的线程?
- Python安装MySQL模块
- Tomcat 安装与使用
- MET 3P5: 工业工程
- 9.1定时器 小时分秒
- dbms_random.seed
- 云原生数据库风起云涌,华为云GaussDB破浪前行
- Redis数据安全与性能保障——redis读书笔记4
- 【方案分享】抖音平台新媒体百问百答:平台规则、爆款涨粉、运营技巧、内容变现.pdf(附下载链接)...
- 院友故事丨联培博士陈冬冬:顶会百发百中?博导关系?我的PhD经验之谈
- Python图像的基本操作
- 统一软件开发过程(RUP)的概念和方法
- Textpattern Solutions: PHP-Based Content Management Made Easy
- excel透视表(pivot table)
- 火萤视频壁纸(让你的桌面丰富多彩)
- 强网杯-强网先锋辅助
- html代码向左居右对齐
- 误差向量幅度(EVM)
- postgresql之repmgr
热门文章
- XML解析—开源XOM类库
- Linux下配置DNS(Domain Name System)服务器
- 【量化笔记】量价关系分析
- f5 gtm 工作原理_F5 LTM工作原理.ppt
- 成员在类中的偏移量 类成员指针
- mysql localhost无法连接
- 天正双击墙体不能编辑_如何提高天正CAD画图速度?不妨试试以下几个技巧
- 【ZYNQ】从入门到秃头10 DDS增强版实验ADDA测试(基于ALINX 7020 AN108)
- 叶罗丽用计算机对话,叶罗丽小剧场:王默和水王子秀恩爱,俩人的对话也太搞笑了...
- 行亦谦ACM自闭之旅第七周