Answers:
您可以使用wireshark打开转储文件,以使用其过滤器和统计信息来获取所需的文件。要查看有关过滤的说明,请参阅wireshark论坛上的以下页面:https : //ask.wireshark.org/questions/9805/measure-the-total-translated-byte-in-a-time-interval
没错,文件大小不能反映传输的数据量:pcap格式包含额外的元数据。
获取实际数据大小的一个不错的工具是使用capinfos,它是wireshark-common
软件包的一部分。
输出示例,请注意数据大小值:
$ capinfos plop.pcap
File name: plop.pcap
File type: Wireshark/tcpdump/... - pcap
File encapsulation: Linux cooked-mode capture
File timestamp precision: microseconds (6)
Packet size limit: file hdr: 262144 bytes
Number of packets: 2049
File size: 335 kB
Data size: 302 kB
Capture duration: 88.022993 seconds
First packet time: 2017-08-22 09:48:45.233556
Last packet time: 2017-08-22 09:50:13.256549
Data byte rate: 3442 bytes/s
Data bit rate: 27 kbps
Average packet size: 147.88 bytes
Average packet rate: 23 packets/s
SHA1: 51ce5b43206995385ef7f95948848cf6a869367e
RIPEMD160: fe861b6f16816d952c7a6c88bec63cb30246d125
MD5: 5ee593b0a5631c42cfebdc20ff0086e7
Strict time order: False
Number of interfaces in file: 1
Interface #0 info:
Encapsulation = Linux cooked-mode capture (25/113 - linux-sll)
Capture length = 262144
Time precision = microseconds (6)
Time ticks per second = 1000000
Number of stat entries = 0
Number of packets = 2049