1

I know that transferring files over UDP is possible even though TCP is preferred.

My question is how does the server know how much the client can handle or vice versa, or any router in between.

TCP uses "window size", since UDP doesn't acknowledge packets that are recived, should a similar thing be implemented in the application layer to control the flow of data, or other techniques are used?

6

My question is how does the server know how much the client can handle or vice versa, or any router in between.

By UDP alone, it doesn't. UDP is "fire and forget" - just send one datagram after the other. If the sender's transmission rate exceeds the path's capacity, excess datagrams are dropped.

When using UDP as transport, the application is required to keep track of the flow (if necessary). How that exactly is done is up to the application layer and off-topic here.

In most cases where you need to transfer larger data sets, TCP is the easiest solution by far. Trying to reinvent it on top of UDP is not a good idea unless you are very familiar with the complexities of congestion control.

1

"TCP uses "window size", since UDP doesn't acknowledge packets that are recieved, should a similar thing be implemented in the application layer to control the flow of data, or other techniques are used?"

You can do that at transport layer with UDP DCCP(Datagram Congestion Control Protocol). The RFC 6773 describes in detail how does the UDP can have a similiar congestion control as TCP. However, the standard UDP uses datagram without congestion controlling. In that case, there's no kind of reliability given at L4. Since you want to tunning and design mechanisms to avoid UDP characteristics, it must be done straight at application (Its not recommended) RFC 5405 RFC 768.

1
  • 1
    UDP doesn't know the path capacity. You can send datagrams as fast as your interface capacity allows.
    – Zac67
    Aug 3 '20 at 10:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.