InternetUser
InternetUser

Reputation: 43

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?

Upvotes: 1

Views: 3637

Answers (3)

A TCP protocol is oriented to the correct transmission of data, for this it makes a connection before sending data called ‘Three way handshake’ in which by means of three packets it makes a synchronisation and recognition between transmitter and receiver which ensures that the data path will be carried out, however this process will cause a considerable delay in the sending of data that can cause the receiver to listen to or receive data with a considerable delay and even with messages being mixed up.

However, UDP, despite skipping the connection stage and therefore ensuring a higher data transmission speed, also has the disadvantage of not guaranteeing that the data being sent will arrive correctly at its destination, which is necessary in the operation of real-time systems.

Upvotes: 0

Moth
Moth

Reputation: 96

As stated before UDP is used over TCP for Real Time Services(RTS), mainly because of how simple a packet of UDP is compared to TCP as the latter puts more emphasis on error correction and reliability.

TCP packets are bigger compared to UDP packets and much more carefully transmitted in order to maintain their integrity, where a receiver acknowledges each and every packet of TCP that is sent which is great when sending sensitive data but it will become a bottleneck in an RTS where state is to be kept as updated as possible and usually data transmitted is 100-1000 KB/s and loosing few KBs won't wreck your service when its implemented with UDP.

Upvotes: 1

JeffUK
JeffUK

Reputation: 4241

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

Upvotes: 8

Related Questions