This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
common-tools-tcp-burst/README.md
2019-07-10 17:54:02 +08:00

77 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
Version Maintenance : LiJia(lijia01@iie.ac.cn)
Create Time : 2013-06-06
Latest Time : 2018-06-12
tcpburst-2.1:
支持vxlan封装格式, 将已有的pcap包内容封装在vxlan数据包内, 用于模拟测试串联模式下的平台处理流量情况.
tcpburst-2.0:
支持marsio发包接口.
tcpburst-1.2:
20161214, 增加对GRE, 6over4, IPinIP等隧道协议的支持.
tcpburst-1.1
修改流放大部分算法.
tcpburst-1.0:
基于标准tcpreplay增加基于TCP或UDP流的放大功能可用于大流量包回放、性能测试等.
修改背景:
标准的tcpreplay读包速率受硬盘传输速度影响一般最高在600Mbps左右.
本程序在tcpreplay的基础上针对上述瓶颈做了一些修改:
每读到一个TCP或UDP包原始包原样转发然后对其IP地址进行修改后再次发送N个包
这样捕包时会得到不同四元组、但应用层数据相同的流,达到流量放大目的.
功能介绍:
例:
原始TCP流 1.1.1.1:12345<-->10.10.10.10:80
假设流放大倍数=4则新回放的包中包含如下TCP流:
1.1.1.1:12345<-->10.10.10.10:80
2.1.1.1:12345<-->9.10.10.10:80
3.1.1.1:12345<-->8.10.10.10:80
4.1.1.1:12345<-->7.10.10.10:80
5.1.1.1:12345<--->6.10.10.10:80
使用说明:
configure
make
make install
在标准tcpreplay基础上新增加了2个参数:
-m, --stream-multiple=num Replay streams at a given multiple流放大倍数;
-d, --packet-distance=num The distance between raw packet and fake replay packet原始包与虚假回放包的间距.
packet-distance的作用:
假设原始流CPU近似占用率如下:
cpu
20| /\
15| / \
10| / \ /\
05| / \ / \
0|--/--------\/----\-----time
设参数stream-multiple=4, packet-distance=0 CPU近似占用率(注意纵坐标的变化!!!):
cpu
80| /\
40| / \
60| / \ /\
20| / \ / \
0|--/--------\/----\-----time
(因为只改变了四元组,应用层数据是相同的,包间距=0的话即同样的应用层数据会在短时间内重复处理N次)
设参数stream-multiple=4, packet-distance=100有可能会得到这样的CPU占用率:
cpu
40| /\/\/\/\/\/\/\/\/\/\/
30|
20|
10|
0|---------------------- time
所以,使用流放大功能的话,强烈推荐加-d选项合理设置packet-distance的值
*/