Escolar Documentos
Profissional Documentos
Cultura Documentos
Introduction
TCP and UDP works in Transport Layer of OSI Model as well as TCP/IP Model
The function of the Transport Layer is to insure packets have no errors and
TCP
TCP (Transmission Control Protocol) enables two hosts to establish a
connection and exchange streams of data. TCP guarantees delivery of data and also guarantees that packets will be delivered in the same order in which they were sent. Two hosts connect before sending any data, sender lets receiver know that data is on the way; recipient acknowledges receipt of data (ACK) or denies receipt (NACK). The ACKing and NACKing is called handshaking.
It provides reliable packet delivery, packet sequencing and error
control.
Continued
TCP guarantees three things: that your data gets there, that it gets
there in order, and that it gets there without duplication. TCP does Flow Control , Congestion Control and error control.
with information.
Congestion Control: Algorithms to prevent that the sender overloads the
network
Error Control: Algorithms to recover or conceal the effects from packet
losses
we get long delay to continue watching/listening because TCP is retransmitting lost packets and it takes time. For some real time applications, the loss of individual packets may not have a noticeable effect (e.g. video streams/audio stream/gaming/VoIP). TCP cannot conclude a transmission without all data in motion being explicitly acknowledged. That creates much latency in network . Too much latency is not suitable for real time communication.
UDP
UDP is a connectionless, unreliable Transport level service protocol. It
is primarily used for protocols that require a broadcast capability. It provides no packet sequencing, may lose packets, and does not check for duplicates.
It is used by applications that do not need a reliable transport service.
Continued
Packets may travel along different paths depending on the state of the
network. No two packets are guaranteed the same route. Each packet has a time-to-live (TTL) counter, which is updated when it is routed along to the next point in the network. When the timer expires, it will be discarded, and the recipient will not be notified. If a packet does arrive, it will always arrive intact. Packets that are corrupt or only partially delivered are discarded.
applications require less overhead(8 bytes whereas TCP has 20 bytes). They also do not need to be re-sequenced since packets that arrive late or out of order have no value. Real-time applications that demand up-to-the-second or better performance are candidates for UDP, as there are fewer delays due to error checking and flow control of TCP.
UDP does not have allocation of buffers, parameters, sequence #s.
10
the two. For example, a lot of online multiplayer games use TCP for data transfer and UDP for things like a client heartbeat or to send opponent position updates. UDP is a good choice for real-time applications like VoIP to provide small jitter TCP is a good choice when we need reliability , flow control and congestion control.