A question that comes to mind when learning tcp's three-way handshake and four waved hands.
Why randomly generate serial numbers instead of directly starting from 0?
answer:
- Prevent TCP sequence prediction attacks. For
details, please refer to: WIKI TCP sequence prediction attack - Try to avoid data confusion as much as possible (2msl can solve it).
If cs is disconnected, some data may still remain in the network. When cs is connected again, these delayed data will not reach the server until a new connection is established, if all Starting from 0 will greatly increase the probability of data packets overlapping between the new connection and the old connection, causing data confusion.