sequence number

Sequence numbers are in reliable network protocols ( such as TCP ) is used (that is, a data current) to realize a complete transmission in the correct sequence and without duplicates. Further applications are sequence numbers in databases and operating systems for securing Atomic operations.

Sequence numbers are a trivial form of the logical clock: it provides a means can be sorted with the messages according to their causality. However, only one actor is taken into account - is the causality for the entire system of all communication partners decisive ( as in many Reliable Multicast protocols ), so complex logical clocks must be used as the Lamport clock or vector clocks.

General scheme

From the sequence number of the preceding packets, the receiver, which sequence number should have the next incoming packet white. When a message is received with a lower sequence number, it will be rejected because it was received before. When a message is received with a higher sequence number, so this and all following messages will be stored with even higher sequence number in a buffer. Only when the message has been received with the correct sequence number, the message from the buffer to be processed.

Comes within a certain time no message with the desired sequence number, the sender is asked to send this message again. If after a certain number of questions are still not at the desired message, then cut off communication with an error message.

Calculation of the sequence number space

Since you want to keep the overhead low by the sequence numbers in the packet header, it determines the size of the sequence number space by the following formula: . Explanation of the parameters:

  • N denotes the number of bits of the sequence number space
  • MPL the Maximum Packet Lifetime in seconds
  • T in a retransmission is performed, the maximum time
  • A is the maximum time before the receiver after receiving the data sends an acknowledgment
  • R is the maximum transmission rate of the transmitter (packets / second).
723212
de