0
votes

Although there are similar questions, I was not able to find one that will summarize the different options of data transfer protocols and their pros and cons in matters of speed, security and reliability.

As a developer I have created a web service that on the Server Side generates one single file with the size ranging from 500Mb to 5Gb. I am examining the different options that I have for transferring the file to the client side.

As far as I know, the two most prominent solutions in the Transport Layer are TCP and UDP, with TCP offering more reliable transfer with a cost on time and UDP sacrificing reliability for speed.

In the Application Layer I know that implementations of UDP, offering reliable transfers exist, like RUDP and UDT.

It is very important to mention protocols that can be used without asking from the client to make installations or special configurations in order to take the data from the Server Side.

My questions are:

  1. Does any application layer protocol based on UDP working out of the box on the client side, like HTTP or FTP?

  2. Does any protocol based on TCP offers similar speeds with the UDP ones?

  3. Do the UDP protocols offer a secure way of transferring Data like Https?

The objectives are

  1. Deliver the data without any missing package
  2. Deliver the data with a secure(encrypted) way

For the implementation i am currently using JAX-WS and Glassfish as application Server.

1

1 Answers

1
votes

Your entire question reads like you've already decided that TCP is "too slow" and that UDP is your saviour. Your question is missing important details:

  1. Does it matter that the file is received as it is sent?
  2. What technologies / frameworks did you use for the web service?
  3. What technologies / frameworks can you use at the client side?
  4. Are you currently actually having any problems with transfer speeds? Whose fault is this, your serialization's, your code's, your network's or TCP's?

As for 1, if yes, then forget UDP. TCP is relatively slow because it guarantees data delivery in order (as long as the connection exists), something you'll never get using UDP. See Which socket programming is best (TCP/UDP)?

For 2 and 3, some of your problems may be solved by applying different serializers, formatters or transports, but that totally depends on how you've implemented your service and client.

For 4, I don't believe TCP is too slow. Once the window is large enough and it's up to speed, it'll use all available bandwidth when fed with appropriately-sized data. See for example UDP vs TCP, how much faster is it?.

Now for your questions:

Does any application layer protocol based on UDP working out of the box on the client side, like HTTP or FTP?

Depends on your box.

Does any protocol based on TCP offers similar speeds with the UDP ones?

Yes, for example video streaming protocols, where losses are manageable.

Do the UDP protocols offer a secure way of transferring Data like Https?

TCP and UDP are transports, they don't care what you transport. Security is layered on top of that, see for example Datagram Transport Layer Security.