mscdex / cap

A cross-platform binding for performing packet capturing with node.js
MIT License
361 stars 45 forks source link

How do I regenerate the seq number to replay captured traffic? #99

Open ghost opened 4 years ago

ghost commented 4 years ago

I'm using Microsoft Windows 10, and I would like to capture some specific tcp packets and replay the captured traffic. But I failed to compile tcpreplay on my pc because of this issue. Also tried ubuntu with wsl 2, but failed to excute tcpreplay because of this issue

Now I found cap and it works perfectly on capturing traffic, But when I tried use c.send to replay captured tcp traffic, it results to tcp spurious retransmission in wireshark and seems not sent by the client or received by the server.

After searching on the Internet, it seems that I should change the original seq/ack number so that I can replay the captured tcp traffic, but how do i generate the seq/ack number, does cap support to replay captured traffic?

Any help would be grateful.