从捕获的数据包中删除尾部时间戳
我有一个通过特殊交换机捕获的数据包,该交换机在 FCS 之前附加时间戳。这些通常被称为“预告片时间戳”。
然而,这样做后,数据包末尾的FCS
并未更新。因此,当我将数据包捕获加载到wireshark中时,所有数据包都被报告为具有不正确的帧检查序列。
是否有像 editcap
等这样的实用程序,我可以用它来从 pcap
中删除每个数据包的最后 x
字节?
I have a packet capture captured through a special switch that appends timestamps just before FCS. These are generally referred as "trailer timestamps".
However, after doing so, the FCS
at the end of the packet is not updated. Hence, when i load the packet capture into wireshark, all the packets are reported as having incorrect frame check sequence.
Is there a utility like editcap
etc.. that i can use to remove, say, last x
bytes of each packet from a pcap
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,
editcap
可以删除每个数据包的最后x
字节。从editcap
手册页:< strong>示例:删除每个数据包的最后 4 个字节
当然,这样做将导致每个数据包都显示为:
...这当然是一个误导性消息,因为 Ethertype 没有被截断,只是作为 FCS 的以太网帧在这种情况下已被删除。尽管如此,这是一个相当无害的指示,因此该解决方案可能适合您的需求。
或者,您可以更简单地禁用以太网校验和验证。通过
Edit -> 执行此操作首选项->协议 ->以太网->如果可能,验证以太网校验和:取消选择 ->好的。
Yes,
editcap
can remove the lastx
bytes of each packet. From theeditcap
man page:Example: Remove the last 4 bytes of each packet
Of course doing this will then result in each packet being indicated with:
... which is of course a misleading message as the Ethertype isn't truncated, just the Ethernet frame as the FCS has been removed in this case. Nonetheless, this is a rather harmless indication and so this solution may fit your needs.
Alternatively, you could more simply just disable Ethernet checksum validation. Do this via
Edit -> Preferences -> Protocols -> Ethernet -> Validate the Ethernet checksum if possible:deslect -> OK
.请在 Wireshark 问题列表;专门处理带有捕获开关拖车的帧可能是有意义的。
Please file an issue for this on the Wireshark issue list; it might make sense to treat frames with capture-switch trailers specially.
我使用 https://github.com/seladb/PcapPlusPlus 编写了自己的应用程序
基本上你可以使用 pcapplusplus并迭代每个 RawPacket 并执行类似的操作
I wrote my own application using https://github.com/seladb/PcapPlusPlus
Basically you can use pcapplusplus and iterate over each RawPacket and do something like