0

Why sequence numbering in TCP uses packet size. why it can't be packet number. if a packet with seq number 10 is sent with 100 bytes then seq number of next packet will be 111. why it cant be like, 10 ,11,12 etc Any specific reason other than packet loss

sruthy
  • 115
  • 1
  • 2
  • 9

2 Answers2

1

It's a byte number because it's a byte stream protocol, basically.

user207421
  • 305,947
  • 44
  • 307
  • 483
0

This is lot more complicated than simple arithmetic and choosing numbers in sequence. Generally for security reasons ISN (initial sequence numbers) are generated using advanced pseudo-random mechanisms.

There are also mechanisms like SYN cookie for example that are coding TCP session parameters inside ISN. So besides using "random" numbers there are lot of different algorithms to choose appropriate sequence number.

What is more each operating system has its own method of generating ISN. As mentioned above all this is for security reasons to not allow potential attacker to guess sequence number of TCP packets.

codewarrior
  • 1,269
  • 1
  • 9
  • 14