P
P
pixik2015-04-07 14:02:11
css
pixik, 2015-04-07 14:02:11

What will happen when receiving udp packets if the client program does not process them?

Good time!
There was a question, there is a server and the client. The client is streaming UDP packets to the server, but the stream is heavy. there is some processing going on on the server. What if during the processing time a lot of packets have accumulated in the server buffer and they are constantly supplemented?
Please advise a source where you can read about such problems, or maybe some friendly advice :)
Thank you all :)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrew, 2015-04-07
@pixik

If your process fundamentally (statistically) does not have time to process such a stream, you still have to drop these packets (either this will happen in the socket buffer at the OS level ( smallvoid.com/article/winnt-winsock-buffer.html ), or you in the application (receiving a packet without processing) - decide for yourself).
If the stream from clients is uneven and you are not in time only at some local times, and the average server speed is sufficient, then write all packets to your application (for example, cyclic) buffer (at least a few megabytes) - this is a very fast operation; and then read by the handler process. (Unless, of course, the processing delay does not affect your domain goals).

S
ShamblerR, 2015-04-07
@ShamblerR

UDP packets, unlike tcp, simply disappear; their presence at another point in time is simply unnecessary, they do not have a parity bit, nothing for retransmission, so that all that can be done with them is to merge into dev zero.

A
Alexander Rulev, 2015-04-07
@Rulexec

Be careful with your UDP protocols. You need a congestion control to regulate the rate at which packets are sent from one side to the other.
The client can send to the server, in principle, as much as he likes, if the provider gives him only a couple of megabits. But if the server “spits” something with its 100-gigabit channel to one client, it will be pretty bad (the packets will be dropped on the way to the client, and most of what will reach will still be dropped, well, the network will not like this very much).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question