So now let us discuss the one of the most important property of a TCP protocol that is reliable data
delivery.
So the main reason why TCP has been designed and one of the most widely standard protocol in use today
is because it guarantees reliable data delivery, right?
Other transport protocols such as UDP works on send and forget principle.
We have already had a short discussion about send and forget principle of UDP.
There is no feedback mechanism from recipient which tells the sender to retransmit lost data and this
is what send and forget principle is.
So let us see how UDP protocol works.
With the help of an example.
Suppose you have a send a process which is sending data to the receiver process using UDP protocol.
So the transport layer protocol in use is UDP.
So as soon as the application on the sending machine has data to send to the recipient process, it
just simply send the data.
There are no preliminaries check between the sender and the receiver, whether they are even willing
to participate in the communication or not.
The sender do not even check whether the receiver exists or not.
Secondly, the sender do not even check whether the receiver is in a state to participate in communication
or not.
All sender does is that as soon as the sending process has a data to send, the UDP protocol receives
the data from the sending process and simply dispatch the data onto the network and forgets.
We have already discussed about sand and forget principle of UDP in detail.
Right.
So you can see that the sending process has send UDP datagram one, then UDP datagram two and suppose
it is a lossy network on which communication is being happening.
So let us assume that the UDP datagram three has been lost in the network.
Now, since this UDP datagram has been lost in the network, there is no way for the sending process
to know that the UDP datagram that it sent on the network has been lost or not and there is no way the
recipient UDP protocol would know that whether sending process has in fact sent any UDP datagram three
or not.
The recipient process would never know about UDP datagram three during the entire course of communication
and sending UDP can continue to send more UDP datagrams thereafter.
So this is called UDP send and forget scheme.
And this scheme do not promise any reliable data delivery.
So you can see that there is no mutual agreement either between the sender and the receiver.
If they really want to participate in the UDP communication or not.
Sender has no way to determine if UDP Datagram three has been delivered or not, and if it is lost in
the network, then it is lost forever.
So it simply means that UDP protocol is designed to be used for applications which are insensitive towards
packet losses.
So going forward, contrary to the sand and forget scheme of UDP protocol, TCP works on feedback mechanism
to implement reliable delivery of data.
Remember network layer of the TCP IP stack or OSI model that is L3 routing also works on send and forget
scheme.
It means that the packet lost during L3 routing is lost forever and because network layer, that is
L3 routing works on send and forget principle, there was a need to design a new protocol which works
on top of L3 routing that is in the transport layer which could mask or compensate the sand and forget
scheme of L3 routing and could implement reliable data delivery on top of L3 routing.
So you can see that we have a network layer of the TCP IP stack, right?
And on top of that we have a transport layer running TCP protocol.
Now network layer works on send and forget scheme.
The TCP protocol implements its feedback mechanism.
So while the packet is on the course of its journey from sending machine to receiving machine in the
network, and we know that the packet covers its journey from sending machine to receiving machine using
L3 routing.
And if the packet gets lost during the course of its journey, then TCP protocol will take care to compensate
for this packet loss.
It means that TCP protocol adds an additional layer of reliable delivery to the underlying network layer
of TCP IP stack.
In fact, I will put together how TCP protocol and network layer works together in order to implement
reliable communication between the sending process and receiving process.
So going forward, it is the TCP recipient responsibility to send feedback message to the TCP sender
when TCP recipient receives the data segment from the TCP sender.
These feedbacks are called acks in TCP terms.
Ack stands for acknowledgment.
So TCP sender starts the timer when it sends a segment.
When I say segment, it means data segment before expiration of this timer.
If the TCP sender receives an Ack from TCP recipient, then TCP sender assumes the data segment that
it has sent has been successfully delivered to the TCP recipient.
This timer is called retransmission timer and is set for each data segment.
The TCP sender sends so need not worry, we will going to understand this point with the help of an
example in the next lecture video.
Similarly, the next point says that if TCP sender do not receive from the recipient and retransmission
timer expires, TCP sender assumes that the data segment that it had sent earlier has been lost somewhere
in the network and therefore it retransmits the same data segment again to the recipient.
In addition to retransmission of the data segment, the TCP sender takes certain action to avoid further
congestion because TCP sender assumes that data segment has been lost in the network because probably
the network is congested.
Right.
Or the second reason could be that the receiver is probably overwhelmed.
That is, receiver is not able to process the data at the rate which sender is sending to it.
So whenever the TCP sender detects that its retransmission timer has been expired, the TCP sender assumes
that the data segment that it had sent has been lost in the network, and TCP sender assumes that the
data segment has been lost in the network.
Probably because the network is congested or receiver is probably overwhelmed.
Now let us try to understand these two points with the help of a diagram in the next lecture.
We.