S
S
Senture2019-11-06 17:13:20
C++ / C#
Senture, 2019-11-06 17:13:20

UDP transmission of packets in the correct order, how adequate is my idea?

Good day!
I will say right away, I tried to google but found only information in the form of "TCP vs UDP" and stuff like that, but I know that it is somewhere.
I am writing an application using the UDP protocol, and as far as I know, when sending packets via the UDP protocol, they may not arrive in the correct order, it became necessary to deliver the packets in the correct order, it’s all the same to the lost packets, the main thing is that the order is correct.
Actually, if you do this:
At the moment of breaking the data into blocks, number each block at the beginning (for example, like this: block1 "1; message"; block2 "2; communication") and when receiving packets, arrange them in ascending order, for example:
The server sends to the client packages (numbers I denote packages and their correct position): 1..2...3..4..5..6..7
The client receives: 2..3..6..4..7
When receiving packets:
2 - ok
3 - ok
6 - ok
4 - skip, because a packet with newer information has already been received
7 - ok
As far as this is adequate and maybe there are simpler methods how to tie one of the qualities of TCP to UDP, maybe there is some framework (I write in C # ).
PS Thank you all!
PPS Please do not suggest using other protocols besides UDP.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2019-11-06
@Senture

SCTP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question