TCP: How are the seq / ack numbers generated?
问题 I am currently working on a program which sniffs TCP packets being sent and received to and from a particular address. What I am trying to accomplish is replying with custom tailored packets to certain received packets. I've already got the parsing done. I can already generated valid Ethernet, IP, and--for the most part--TCP packets. The only thing that I cannot figure out is how the seq / ack numbers are determined. While this may be irrelevant to the problem, the program is written in C++