There are already some questions regarding this, but I want to ask something very specific that does not seem to be covered by the others. So, I'm aware that the same UDP port (server) can be used by different users - the server stills knows where to deliver the appropriated packages. However, since the UDP port on the server is exactly the same for both users, does this mean that some delay can occur? For instance, if at exact same time 5 users want to use the same server socket and the connection is UDP based, then there will be a delay because the socket can't deal with the 5 connections at the same time. Is this correct? I know that, in practice, this would only happen with a great amount of connection, given that processing time of an UDP connection is faster than TCP, but it could potentially happen. Or am I wrong?
Asked
Active
Viewed 1,101 times
0
-
"... given that processing time of an UDP connection is faster than TCP" - what makes you believe that this is the case - whatever "processing time of an XXX connection" is in the first place? Also, what makes you think that the performance is different between 1 socket for 5 users and 5 socket with one for each user - at least if the same number of threads/processes are used to handle the input? – Steffen Ullrich Sep 04 '17 at 15:08
-
Isn't UDP simpler in general, given that it has a lot less functionalities? This is more of a theoretical question. In theory, 1 UDP socket for a big number of users (5 as an example) will still be faster than 5 TCP sockets? Or, say, an infinite number of users really. Won't that cause UDP to be even less reliable than already is? – GWasp Sep 04 '17 at 15:12
-
UDP is a bit simpler than TCP but the complexity is usually in the application protocol, network layer etc so that the CPU time spend in TCP vs. UDP is not that important compared to the rest of the time spend. But, if your protocol is very simple and does not need reliability or bandwidth management than UDP might be useful. – Steffen Ullrich Sep 04 '17 at 15:14
-
I think the question is a bit too theoretical. If you start to make it more practical then you will see that real applications have requirements regarding reliability and/or latency and/or bandwidth management and then you pick the protocol which best fits the requirements. It would not make sense if you choose UDP because you think it is smaller but then have to add some or all the features of TCP on top of it because your application requires it. Thus depending on the actual requirements one UDP socket can be better than 5 TCP sockets or maybe not. – Steffen Ullrich Sep 04 '17 at 15:20