Co-Authored By:

Asked by: Maiane Rohirse
technology and computing computer networkingWhy do we need TCP and UDP?
Subsequently, one may also ask, why would you use UDP over TCP?
UDP can be used in applicationsthatrequire lossless data transmission when the applicationisconfigured to manage the process of retransmittinglostpackets and correctly arranging received packets. This approachcanhelp to improve the data transfer rate of largefilescompared to TCP.
Secondly, what is difference between UDP and TCP?
TCP (Transmission Control Protocol) isconnectionoriented, whereas UDP (User Datagram Protocol)isconnection-less. This means that TCP tracks all datasent,requiring acknowledgment for each octet (generally). Becauseofacknowledgments, TCP is considered a reliable datatransferprotocol.
The main advantages for UDP arethatdatagram boundaries are respected, you can broadcast, and itisfast. The main disadvantage is unreliability andthereforecomplicated to program at the application level. TCPand UDPuse the same addressing scheme.