A full duplex.
Communication is established.
UDP is another protocol of transport layer Layer four used primarily for establishing low latency and
loss, tolerating connections between applications on the Internet.
TCP has emerged as a dominant protocol used for the bulk of internet connectivity owing to its services
for breaking large data sets into individual packets, checking for and resending lost packets and reassembling
packets into the correct sequence.
But these additional services come at a cost in terms of additional data overhead and delays called
latency.
In contrast, UDP just sends the packets, which means that it has a much lower bandwidth overhead and
latency, but packets can be lost or received out of order as a result, owing to the different paths
individual packets traverse between sender and receiver.
So UDP uses a simple connectionless communication model with a minimum of protocol mechanism.
It has no handshaking dialogues and thus exposes the user's program to any unreliability of the underlying
network.
There is no guarantee of delivery, ordering or duplicate protection.
UDP is suitable for purposes where error checking and correction are either not necessary or are performed
in the application.
UDP is an ideal protocol for network applications in which perceived latency is critical, such as gaming
voice and video communications, which can suffer some data loss without adversely affecting perceived
quality.
In addition, since its transaction oriented suitable for simple query response protocols such as the
domain name system or the network time protocol, the UDP header is pretty simple.
It consists of four fields, each of which is two bytes 16 bits.
The use of the fields checksum and source port is optional in IPV four.
Are you surprised to hear that the source port is optional?
But don't be because as you know, UDP packet does not expect to get a reply in general.
And again, since UDP doesn't care about the errors, the checksum field is again optional.
Source port identifies the sender's port and the destination port identifies the receiver's port as
well.
And the length field specifies the length of the UDP header and data in bytes.
So now's a good time to compare the two protocols UDP and TCP.
As a brief summary.
Most services on the internet use either TCP or UDP, which are carried end to end across the network
using IP, either IPV four or IPV six.
The transmission control protocol, TCP and user datagram protocol UDP are very different.
TCP is a connection oriented protocol which tries to ensure reliable in-order delivery of packets.
If packets are lost, TCP automatically retransmits them if they arrive out of order.
TCP will resequence them before handing them up to an application.
UDP is connectionless.
The UDP software makes no attempt to associate streams of packets together.
So as far as UDP is concerned, each packet is completely independent, unrelated to other packets.
No attempt is made by UDP for retransmission or resequencing.
If a packet is lost via UDP, it's up to the higher layer application to resend it.