Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
The situation:
I am working on a tool that simulates a device, based on its actual network data that I captured earlier with WireShark.
The captured data is from a production device that I need to recreate in a debug enviroment.
What I need is a way to read packets from the trace file and in a sort of 'real time', and then handle and alter the packets and resend it, as if the device was present in my debug environment.
The problem:
I am using the (2nd) example from the page
github.com/PcapDotNet/Pcap.Net/wiki/Pcap.Net-Tutorial-Handling-offline-dump-files
.
This example shows Pcap.Net using OffLinePacketDevice to read the dump file and handle the packets.
My problem is that the packets do not get handled in a timed fashion. The trace holds several minutes of data, but is processed in a few seconds.
I have tried this example before and then it seemed to react just as I expected.
So, my question is: Should the behavior be automatically timed?
If so, then I broke something (but what?).
If not, then I have to add some sleep mechanism (not too difficult).
Anyone?
You can use Pcap.Net's Send Buffer to send packets while respecting their timestamps.
So you read the packets from the offline dump, alter them, insert them to a Send Buffer and transmit them.
Links:
Reading packets from offline dump
Generating packets (code in the send packets guide)
Sending packets using a Send Buffer
Thanks for contributing an answer to Stack Overflow!
-
Please be sure to
answer the question
. Provide details and share your research!
But
avoid
…
-
Asking for help, clarification, or responding to other answers.
-
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our
tips on writing great answers
.