hook declined to update refs_抓包工具packet capture

hook declined to update refs_抓包工具packet capture发包工具TRexstateless使用笔记https://github.com/cisco-system-traffic-generator/trex-coreLinux运行优化forfilein`find/sys/devices/system/cpu/-namescaling_governor`;doechoperformance>$file;doneec…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

发包工具 TRex stateless 使用笔记

https://github.com/cisco-system-traffic-generator/trex-core

Linux 运行优化

for file in `find /sys/devices/system/cpu/ -name scaling_governor`; do echo performance > $file; done

echo never > /sys/kernel/mm/transparent_hugepage/defrag

echo never > /sys/kernel/mm/transparent_hugepage/enabled

echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag

sysctl -w vm.swappiness=0

sysctl -w vm.zone_reclaim_mode=0

systemctl stop irqbalance

trex 初始化

trex 需安装Python2/3, 如使用busybox等自定义文件系统需配置python路径:

export PATH=/sdd/python-2.7.15/bin:$PATH

cd /sdd/trex-v2.53

发包示例:

./t-rex-64 –cfg mlx5-02.yaml -m 10 -d 60 -f cap2/imix_64_fast.yaml

./t-rex-64 –cfg mlx5-02.yaml -m 10 -d 60 -f ipv6.yaml –ipv6 –no-ofed-check

配置单口发包, 修改mlx5-02.yaml interfaces :

### Config file generated by dpdk_setup_ports.py ###

– version: 2

interfaces: [’07:00.0′, “dummy”]

port_info:

– dest_mac: e8:68:19:c7:94:f2

src_mac: 50:6b:4b:d3:cf:74

platform:

master_thread_id: 0

latency_thread_id: 8

dual_if:

– socket: 0

threads: [1,2,3,4,5,6,7,9,10,11,12,13,14,15]

tw:

buckets: 1024

levels: 3

bucket_time_usec: 20.0

配置双口发包, 添加接口bus-info到配置文件:

### Config file generated by dpdk_setup_ports.py ###

– version: 2

interfaces: [’07:00.0′, ’07:00.1′]

port_info:

– dest_mac: e8:68:19:c7:94:f2

src_mac: 50:6b:4b:d3:cf:74

– dest_mac: e8:68:19:c7:94:f2

src_mac: 50:6b:4b:d3:cf:75

注:

Mellanox CX-5 网卡Trex 2.53默认只能在CentOS7.4系统运行. 可通过修改 dpdk_setup_ports.py 屏蔽相关的检查代码即可.

trex startup

启动TRex服务端进入 stateless 模式, 可配置-c指定CPU.

./t-rex-64 –cfg mlx5-02.yaml –ipv6 –no-ofed-check -i

启动TRex客户端

./trex-console -s 127.0.0.1

help(帮助命令,显示所支持的命令,如:发包命令start,停止发包stop,图形化显示命令tui)

cmd -h (对于每条命令,加上-h或—help可以显示具体的帮助信息)

start

启动TX任务

trex>start -h

usage: start [-h] [-p PORTS [PORTS …] | -a] [–total] [–force] -f FILE

[-d TIME] [-t T1=VAL[,T2=VAL …]] [-m MULT] [-n]

[–pin | –core_mask CORE_MASK [CORE_MASK …]] [–sync]

Start selected traffic on specified ports on TRex

optional arguments:

-h, –help show this help message and exit

-p PORTS [PORTS …], –port PORTS [PORTS …]

A list of ports on which to apply the command

-a Set this flag to apply the command on all available

ports

–total traffic will be divided between all ports specified

–force Set if you want to stop active ports before appyling

command.

-f FILE File path to use

-d TIME Set duration time for job.

-t T1=VAL[,T2=VAL …]

Sets tunables for a profile. Example: ‘-t

fsize=100,pg_id=7′

-m MULT, –multiplier MULT

Multiplier should be passed in the following format:

[number][| bps | kbps | mbps | gbps | pps |

kpps | mpps | % ]. no suffix will provide an absoulute

factor and percentage will provide a percentage of the

line rate. examples ‘-m 10’, ‘-m 10kbps’, ‘-m

10kbpsl1′, ‘-m 10mpps’, ‘-m 23% ‘ ‘-m 23%’ : is 23% L1

bandwidth ‘-m 23mbps’: is 23mbps in L2 bandwidth

(including FCS+4) ‘-m 23mbpsl1’: is 23mbps in L1

bandwidth

-n, –dry Dry run – no traffic will be injected

–pin Pin cores to interfaces – cores will be divided

between interfaces (performance boot for symetric

profiles)

–core_mask CORE_MASK [CORE_MASK …]

Core mask – only cores responding to the bit mask will

be active

–sync Run the traffic with syncronized time at adjacent

ports. Need to ensure effective ipg is at least 1000

usec.

示例:

start -f stl/bench.py -t size=64,vm=cached —p 0 -m 100%

IPv6 SYN-FLOOD

start -m 100% -p 0 –force -f stl/syn_attack.py

IPv6 UDP

start -m 100% -p 0 –force -f stl/imix_ipv6.py

IPv6 SYN-FLOOD

start -m 100% -p 0 –force -f stl/syn_ipv6.py

stop

停止TX任务

stop -a

tui 查看实时动态统计

实时全局统计 & 端口统计

tui

quit

stats 查看当前统计

trex>stats -h

usage: stats [-h] [–port PORTS [PORTS …] | -a]

[-g | -p | –ps | -s | -l | –lh | -c | -m | -x | –xz]

Show various statistics

optional arguments:

-h, –help show this help message and exit

–port PORTS [PORTS …]

A list of ports on which to apply the command

-a Set this flag to apply the command on all available

ports

-g Fetch only global statistics

-p Fetch only port statistics

–ps Fetch only port status data

-s Fetch only streams stats

-l Fetch only latency stats

–lh Fetch only latency histogram

-c Fetch only CPU utilization stats

-m Fetch only MBUF utilization stats

-x Fetch xstats of port, excluding lines with zero values

–xz, –zx Fetch xstats of port, including lines with zero values

示例

获取端口统计

stats –ps

获取端口状态

stats -p

获取全局统计

stats -g

参考

TRex upcoming Stateful scalable TCP support

TRex Stateless GUI v3.2

How TRex is used by Mellanox

Trex Blog

Trex

Comparing TRex Advanced Stateful performance to Linux NGINX

TRex Community

TRex Stateless support

TRex Stateless Python API

Mellanox support

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/196712.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 漏扫工具 nessus_黑客漏洞扫描工具

    漏扫工具 nessus_黑客漏洞扫描工具零基础学黑客,搜索公众号:白帽子左一原文地址:https://blog.csdn.net/wwl012345/article/details/96998187一、Nessus简单介绍Nessus是全球使用人数最多的系统漏洞扫描与分析软件,这是一个免费、威力强大、更新频繁并简易使用的远端系统安全扫描程序,功能十分强大。二、Nessus安装下载软件包的时候一定要找一个网速很好并且稳定的地方,最好不要使用热点,这是前人之鉴。(1):下载软件包进入官网下载https://www.tenable.c

    2022年10月19日
    4
  • pycharm更新pip失败_更新pip版本失败

    pycharm更新pip失败_更新pip版本失败在pycharm中创建一个新的虚拟环境,发现pip等级过低,pip-V使用正常的pip升级命令python-mpipinstall–upgradepip报如下错误解决办法easy_install-Upip…

    2022年8月25日
    10
  • PyCharm下如何使用Git「建议收藏」

    PyCharm下如何使用Git「建议收藏」添加SSH公钥任何基于Git的在线代码托管平台都需要配置电脑的SSH公钥以GitHub为例,在个人设置里面找到对应的位置,点击添加按钮,将电脑用户目录下的.ssh文件夹里的id_rsa.pub文件里面的值复制输入进去,设置一个名字就添加成功了利用PyCharm克隆项目打开PyCharm,如果你原来有项目的话,依次点击左上角的File->CloseProject,如果没有直接…

    2022年8月27日
    5
  • 计算机网络基础知识点总结

    计算机网络基础知识点总结1.计算机网络体系结构2.各层的作用和支持的协议3.物理层传输数据的基本单位:比特流0和1数据传输系统:源系统(源点、发送器)–>传输系统–>目的系统(接收器、终点)通道:单向通道(单工通道):只有一个方向通信,没有反方向交互,如广播双向交替通信(半双工通信):通信双方都可发消息,但不能同时发送或接收双向同时通信(全双工通信):通信双方可以同时发送和…

    2022年5月27日
    45
  • 打开python 报R6034 错误

    打开python 报R6034 错误我只在Python3和python2同时在anaconda3下安装出现的问题,后来移除python2也不起作用,找到了这个方法,解决的问题。6034指的是:”AnapplicationhasmadeanattempttoloadtheCruntimelibraryincorrectly.Pleasecontacttheapplication’ssuppor…

    2025年8月3日
    4
  • ArcEngine 中的-2147467259错误

    ArcEngine 中的-2147467259错误ArcEngine中因数据不合规导致的-2147467259错误

    2022年7月13日
    28

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号