Ask Your Question
0

Is it possible to replace a PCAP's timestamps with the timestamps in an ERSPAN header?

asked 2025-08-25 19:19:57 +0000

Nevarcds gravatar image

ERSPAN Type III headers contain hardware timestamps of when the packet actually traversed the capture device.

Wireshark correctly displays this timestamps, but is it possible to "rewrite" the PCAP timestamps with the ERSPAN timestamps?

We care far more about when a packet transited the ERSPAN source device than when it arrived at the packet capture endpoint.

edit retag flag offensive close merge delete

Comments

Chuckc gravatar imageChuckc ( 2025-08-25 22:56:58 +0000 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2025-08-26 06:22:12 +0000

Guy Harris gravatar image

We care far more about when a packet transited the ERSPAN source device than when it arrived at the packet capture endpoint.

And somebody debugging issues with the ERSPAN mechanism might care about the time stamps when the ERSPAN packet is transmitted or received.

What might be useful 1) a mechanism in Wireshark by which a packet can change the displayed time stamps in the time stamp column and the frame part of the packet details and 2) per-protocol preferences to control whether a dissector should override the capture file timestamp or not.

(And what might be useful in libpcap is a way to receive the GRE packets from a machine using ERSPAN and de-encapulate them, so you just directly to an ERSPAN capture in tcpdump or Wireshark or....)

edit flag offensive delete link more
0

answered 2025-08-25 22:43:40 +0000

Chuckc gravatar image

updated 2025-08-26 00:10:02 +0000

Looks like you could do it with a lua script.
WSDG 12.11.5.5. frameinfo.time:

12.11.5.5. frameinfo.time
Mode: Retrieve or assign.
The packet timestamp as an NSTime object.
Note: Set the FileHandler.time_precision to the appropriate wtap_file_tsprec value as well.

FileHandler and FrameInfo examples in Wiki/Lua/Examples A pcap FileShark script

Would take a pass to extract the timestamps and store to file or perhaps a lua table.
Then reopen the file in Frame mode and update the timestamps.

(sample capture erspan_type_III.cap attached to 13400: Improve CISCO ERSPAN Dissector)

Here is a script that reads a text file with list of packets to filter/keep:
using tshark with huge display filters
If the timestamps are stored in an ASCII file could read them in similar to reading packet list above.

(Timestamps more uniform in 5244: Add Dissector for ERSPAN Type-III Header pcap)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2025-08-25 19:19:57 +0000

Seen: 386 times

Last updated: Aug 26