Network Real Trace Analysis 2015年12月10日
2024-10-17 01:05:08
了解网络中真实的流量,国内很难找到巨人的肩膀。
WAND是新西兰waikato 大学计算机系的研究小组,主要做网络测量,大规模网络流量捕获,网络分析。还做专业的分析软件。
libtrace是其开源的分析软件项目。
它可以读写流量。这些流量也放在他们网站上提供下载。
libtrace 有大量的可执行程序,在linux下编译运行。 例如,流统计报告tracereport.
- traceanon
- traceconvert
- tracediff
- traceends
- tracefilter
- tracemerge
- tracepktdump
- tracereplay
- tracereport
- tracertstats
- tracesplit
- tracesplit_dir
- tracestats
- tracesummary
- tracetop
- tracetopends
- ToolTricks
使用tracereport工具里的参数选项-F可以统计流数目。tracereport工具有如下子选项。
tracereport
[ -f bpf | --filter=bpf ]
[ -e | --error ]
[ -F | --flow ]
[ -P | --protocol ]
[ -p | --port ]
[ -T | --tos ]
[ -t | --ttl ]
[ -O | --tcpoptions ]
[ -o | --synoptions ]
[ -n | --nlp ]
[ -d | --direction ]
[ -C | --ecn ]
[ -s | --tcpsegment ]
求trace1的流数量
linux# tracereport -F erf:trace1.erf.gz
.erf.gz是流的后缀名,进过.gz压缩,是erf的包数据格式。
主要算法由/libtrace/tools/tracereport/Flow_report.c/ flow_per_packet()函数完成
void flow_per_packet(struct libtrace_packet_t *packet)
{
struct libtrace_ip *ip = trace_get_ip(packet);
struct fivetuple_t ft;
if (!ip)
return;
ft.ipa=ip->ip_src.s_addr;
ft.ipb=ip->ip_dst.s_addr;
ft.porta=trace_get_source_port(packet);
ft.portb=trace_get_destination_port(packet);
ft.prot = 0;
if (!SET_CONTAINS(flowset,ft)) {
SET_INSERT(flowset,ft);
flow_count++;
}
}
每读取一个包就会调用一次此函数。
结构体 libtrace_ip 表示数据包ip。
得到ip内容。
判断是否是已经出现过的流,否则flow_count++;
统计值就在flow_count里。
==========完=========
2015年12月10日
原文链接:http://www.pandaroll.cn/research/research1.html
最新文章
- parted在2T以上硬盘上分区操作
- 图像卷积、相关以及在MATLAB中的操作
- highcharts的简单使用
- Java中的异常
- PHP JAVA Bridge桥的最新使用
- POJ 2031 Building a Space Station (最小生成树)
- Python分析NGINX LOG版本二
- Android之自定义AlertDialog无法监听控件
- Internship
- spring-junit的标注总结
- 自制证书搭建https服务
- NLTK学习笔记(八):文法--词关系研究的工具
- C#进行CAD二次开发环境配置
- Mac 下 Chrome多个Tab之间切换
- ActiveMQ的使用
- iOS开发之获取文件的md5值
- RPA 介绍
- E - Elevator
- leetcode — path-sum-ii
- 从此web开发so easy!
热门文章
- c语言符号常量与常变量的区别?
- C++题目(论述类)
- Java [Leetcode 167]Two Sum II - Input array is sorted
- BZOJ3887 [Usaco2015 Jan] Grass Cownoisseur 【tarjan】【DP】*
- ubuntu下Python的安装和使用
- SmartSql 动态仓储
- 在iOS中使用ZBar扫描二维码
- Tree的两种存储形式
- 移动端base.css
- CSU1632Repeated Substrings(后缀数组/最长公共前缀)