Data sequencing assigns ordering information to transmitted data so the receiver can identify the expected order. TCP uses sequence numbers and acknowledgments; during connection establishment, each host chooses a random initial sequence number. section 22.2.1
TCP segments arriving out of order
A TCP receiver acknowledges each segment by indicating the sequence number of the next segment it expects. This lets TCP track missing or reordered data and support reliable delivery through retransmission when an acknowledgment is not received. section 22.2.1
UDP does not provide data sequencing. Its header has no sequence number, so UDP cannot restore messages that arrive out of order; it also provides neither acknowledgment nor retransmission. section 22.2.2
