TCP: How are the seq / ack numbers generated?

前端 未结 8 2073
刺人心
刺人心 2021-02-01 20:50

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 tai

8条回答
  •  青春惊慌失措
    2021-02-01 21:09

    These values reference the expected offsets of the start of the payload for the packet relative to the initial sequence number for the connection.

    Reference

    Sequence number (32 bits) – has a dual role If the SYN flag is set, then this is the initial sequence number. The sequence number of the actual first data byte will then be this sequence number plus 1. If the SYN flag is not set, then this is the sequence number of the first data byte

    Acknowledgement number (32 bits) – if the ACK flag is set then the value of this field is the next expected byte that the receiver is expecting.

提交回复
热议问题