tcpnetwork-programmingudpreal-time

TCP for real-time systems


I am new to networking and trying getting some basic concepts. I will really appreciate if someone can tell me why using TCP in real-time systems is a bad idea? What makes UDP preferable for real-time systems?


Solution

  • In short TCP is designed to achieve perfect transmission above all else. You will get exactly what has been sent, in the exact order it was sent, or you will get nothing at all.

    The problem with this is that TCP will get hung up trying to re-transmit data until it is received properly, but in a real-time system, the data it's trying to re-transmit is useless because it's already out of date; AND the data you actually want has to wait for the data you don't want to clear the stack, before it can be sent.

    This article explains it much more eloquently