tcpreplay - 使用 tcpreplay 时尽管数据包失败仍继续
问题描述
我正在尝试使用tcpreplay
来发送 pcap 文件的内容。它拒绝发送一些数据包,因为它们太长了。但是,它不会继续处理下一个数据包,而是停止:
$ tcpreplay -i p4p1 multi.pcap
Warning: May need to run as root to get access to all network interfaces.
Warning: Unable to send packet: Error with PF_PACKET send() [444]: Message too long (errno = 90)
Actual: 443 packets (63852 bytes) sent in 0.203486 seconds
Rated: 313790.6 Bps, 2.51 Mbps, 2177.05 pps
Flows: 115 flows, 565.14 fps, 405 flow packets, 39 non-flow
Statistics for network device: p4p1
Successful packets: 443
Failed packets: 1
Truncated packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0
我想跳过失败的数据包并发送其余的。
解决方案
我在处理几个文件时遇到了同样的问题,尤其是流式传输。例子:
~# tcpreplay -i eth1 -t -K facebook_audio2b.pcapng
File Cache is enabled
Warning: Unable to send packet: Error with PF_PACKET send() [1611]: Message
too long (errno = 90)
Actual: 1610 packets (382007 bytes) sent in 0.021233 seconds
Rated: 17991192.9 Bps, 143.92 Mbps, 75825.36 pps
Flows: 71 flows, 3343.85 fps, 94008 flow packets, 84 non-flow
Statistics for network device: eth1
Successful packets: 1610
Failed packets: 1
Truncated packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0
我所以我在 [link] 上关注了 Tcpreplay 网站上的常见问题解答。(https://tcpreplay.appneta.com/wiki/faq.html#packet-length-8892-is-greater-then-mtu-skipping-packet) 说的是:
如果数据包大于 MTU,或者,您可以指定tcpreplay-edit --mtu-trunc
选项 - 数据包将被截断为 MTU 大小,校验和将被固定然后发送。请注意,这可能会影响性能。
它在下一次运行中对我有用:
~# tcpreplay-edit --mtu-trunc -i eth1 -t -K facebook_audio2b.pcapng
File Cache is enabled
Actual: 94092 packets (14586277 bytes) sent in 0.847842 seconds
Rated: 17204003.8 Bps, 137.63 Mbps, 110978.22 pps
Flows: 71 flows, 83.74 fps, 94008 flow packets, 84 non-flow
Statistics for network device: eth1
Successful packets: 94092
Failed packets: 0
Truncated packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0
Ps.:对不起,我的英语
推荐阅读
- javascript - 根据当前部分更改滚动元素背景并优化性能
- .net-core - .NET Core 3.1 API 找不到包含区域代码的共享资源文件
- java - 如何通过在数字前添加一个字母来简化接收整数列表并返回字符串的 lambda 方法?
- reporting-services - SSRS Report Builder 计算字段与 SQL 表(属性值)
- python - 从 kv 文件中的 py 文件调用方法/属性失败
- python - 为什么 my_dict['key3'][0].upper() 有效,而 my_dict['key3'][0].reverse() 无效
- jackrabbit - 如何中断“数据存储垃圾收集”或使其更快?
- macos - MacOS Catalina - 在 Finder 中从根目录显示所有目录
- java - 单击导航视图时如何设置从右侧打开的导航抽屉
- javascript - net::ERR_NAME_NOT_RESOLVED axios