So, guys, now going forward in this lecture video, we will going to understand the properties of
user datagram protocol abbreviated as UDP.
UDP is another most important and famous transport layer protocol after TCP, which is used to facilitate
data communication between the processes running on different machines in the network.
Now this course is all about TCP protocol.
Therefore, it is also desirable to understand properties of user datagram protocol, which is actually
a twin protocol of TCP.
So user datagram protocol is a very simple and straightforward protocol for data exchange between the
process.
The essence of user datagram protocol is that it works on sand and forget principle.
Now what does that mean?
This simple three words actually encapsulate many things.
So for example, you have a sending machine in the network and you have a receiving machine in the network.
Now, since this course is all about TCP, which is a transport layer protocol, and we know that transport
layer protocol is used to facilitate data exchange between the processes and not between the machines.
So throughout this course, when I say that's is a sender, it means that I talk about a process which
is running on the sending machine.
Simply when I say that R is the receiver, it simply means that I am talking about some process which
is running on the receiving machine, right?
So implicitly I mean that there is a sending process and receiving process running on sending machine
and receiving machine.
Now let us try to understand what does that send and forget model means.
So UDP protocol do not maintain any state of the peer it is communicating with.
Now what does that mean?
So let us try to understand it with the help of an example.
Suppose in the TCP IP stack, at the application layer you are running some application, right?
And suppose in the transport layer, the protocol that is running is UDP.
Right.
So the application sends the following information to the transport layer.
The application says that hit UDP protocol.
Please send data to application a running on the receiving machine are.
So here the data is any application specific data which only application understand A is an application
which is running on the receiving machine.
Or if you have done any socket programming then you would know that applications are identified using
port numbers.
So it means that there is some application a which is running on the receiving machine and this application
is listening on some port number, for example, 80.
So the sending process which is running on the sending machine is need to know the recipient application
port number, right?
So this is the sending application in our case.
And of course, the application also needs to specify the specification of the receiving machine, which
is nothing but the IP address of the receiving machine.
This IP address uniquely identifies the receiving machine in the network.
So you can see that the combination of the port number and IP address uniquely identifies the recipient
process running in the network.
So you can see that application needs to convey the data which it wants to send to the recipient process
as well as the specification of the recipient process.
When the UDP protocol receives all these three information, the UDP protocol simply dispatches the
data in the network.
The same is true with the TCP protocol also.
Now, the point I'm trying to make here is that that UDP protocol do not maintain any state of the peer
it is communicating with.
It means that on the sending machine as the transport layer after it has sent the data to the recipient,
the transport layer that is the UDP protocol completely forgets the specification of the recipient process.
So UDP protocol.
Do not remember who it was communicating with after sending the data.
This property is called Connectionless.
That is UDP protocol is a Connectionless protocol and UDP protocol also forgets that it has actually
send any data.
This property is called stateless protocol.
Right?
So every request which comes from the application to the UDP protocol to send data is treated as a fresh
request by the UDP protocol running in the transport layer.
UDP protocol.
Do not keep any history of the data that it has sent to the recipient process when requested by the
sending application.
Right.
And UDP protocol also do not remember the specification of the recipient process.
That is it.
Do not remember the port number or IP address of the recipient machine and recipient process after it
has sent the data.
So I hope you understand that what exactly mean by connectionless and stateless protocol.
So we discussed that UDP is a Connectionless protocol because UDP protocol on the sending side forgets
the recipient specification after sending the data.
The second property of a protocol being a connectionless protocol is that that even before sending a
data, the protocol do not even bother to say hello to the recipient process.
That is, as soon as the UDP protocol receives the data from the application, the UDP protocol do not
even bother to check whether the recipient process a running on the machine ah is even alive or not.
It do not even bother to check whether there exists any such process or not.
It do not even bother to check whether the recipient process a running on the recipient machine ah is
in a position to receive the data or not.
So because of these two reasons, the UDP protocol is a connectionless protocol.
In other words, the UDP protocol is actually a very careless protocol.
UDP protocol gives no respect to the recipient process.
It do not bother whether the recipient process is ready to receive data or not.
And after UDP protocol has actually sent the data on the network.
The UDP protocol immediately forgets the identity of the recipient process as well as it also forgets
that it has actually sent any data.
So going forward.
Going forward.
UDP protocol sends data in chunks or discrete individual units called datagrams.
So you can see that here the UDP protocol running in the transport layer on the sending machine sends
the data in discrete units called datagrams.
So these packets are called datagrams.
So, for example, suppose the sending process wants to send 1000 bytes of data.
The UDP protocol.
The UDP protocol creates individual units called datagrams.
And supposing the first datagram, it encapsulates 600 bytes of application data and in the second datagram,
suppose it encapsulates 400 bytes of application data.
Right after the UDP protocol has created these datagrams, then UDP protocol dispatches these datagrams
on the network.
Note that each datagram one and two is completely independent from each other.
The datagram two is not related to datagram one in any way and datagram one is not related to datagram
two in any way.
Each datagram is treated as an individual, independent, discrete individual unit of data.
So we have just discussed three important properties of UDP protocol.
UDP protocol is a Connectionless protocol.
UDP protocol is a stateless protocol, and UDP protocol is a datagram based protocol.
And when we summarize all these three properties of UDP protocol, simply put together UDP protocol
works on sand and forget model.
So in the remaining section of the course when we will be discussing about TCP in detail and when we
encounter any properties of a TCP protocol which needs a comparison with the UDP protocol, we will
revisit the comparison between TCP and UDP.
Again, because at that point of time in the course since you have learned the property of a TCP protocol
in detail, you will be able to understand that how TCP protocol actually differs from UDP protocol
in terms of its goals and functioning.
So going further, the TCP protocol on the other hand, is completely opposite to UDP.
The TCP protocol is connection oriented protocol.
TCP protocol is stateful protocol, and TCP protocol is bit oriented protocol.
Now let us try to understand these terms in the context of TCP.