views:

53

answers:

3

Hello all.

Suppose a client sends a number of datagrams to a server through my application. If my application on the server side stops working and cannot receive any datagrams, but the client still continues to send more data grams to the server through UDP protocol, where are those datagrams going? Will they stay in the server's OS data buffer (or something?)

I ask this question because I want to know that if a client send 1000 datagrams (1K each) to a PC over the internet, will those 1000 datagrams go through the internet (consuming the bandwidth) even if no one is listening to those data?

If the answer is Yes, how should I stop this happening? I mean if a server stops functioning, how should I use UDP to get to know the fact and stops any further sending?

Thanks

+1  A: 

I ask this question because I want to know that if a client send 1000 datagrams (1K each) to a PC over the internet, will those 1000 datagrams go through the internet (consuming the bandwidth) even if no one is listening to those data?

Yes

If the answer is Yes, how should I stop this happening? I mean if a server stops functioning, how should I use UDP to get to know the fact and stops any further sending?

You need a protocol level control loop i.e. you need to implement a protocol to take care of this situation. UDP isn't connection-oriented so it is up to the "application" that uses UDP to account for this failure-mode.

jldupont
Thanks for your reply. So If the server is on internet running nothing, and I use a udpclient to send, say 100MB data to it, the OS on the server will still receive it? and I will still consuming 100MB data bandwidht to the server?
Jack
yes unless you have something in between that filters those out of course. That's one way to generate a Denial Of Service...
jldupont
Thanks. So If I really send UDP data 100MB to some server, if that server's OS detects the sending, and if no one in the server receives it, it will generate DoS?
Jack
Nothing is free in our universe ;-) Resources are consumed for no purpose in this case yes. Hence, depending on your point of view, it could be considered a DoS: there will be less resources available for "valuable" communications by other clients.
jldupont
A: 

UDP itself do not provide facilities to determine if message is successfully received by a client or not. You need you TCP to establish reliable connection and after it sends data over UDP.

shuvalov
A: 

The lowest overhead solution would be a keep-alive type thing like jdupont suggested. You can also change to use tcp, which provides this facility for you.

Andrew B