Layer four or the transport layer insurers end to end communication reliability and flow control.
This layer performs message segmentation where it accepts a message from the higher layers in the OSA
model.
In other words from the session layer above it splits the message into smaller units.
If they are not small enough already and then passes the smaller units down to the network layer for
sending the transport layer at the receiver will reassemble the message.
Add to this layer this layer also handles transportation issues between hosts and ensures data transport
reliability.
The two main protocols at this layer are TTP or Transmission Control Protocol and UDP or user data gram
protocol DCP provides reliability.
It establishes maintains and terminates virtual circuits between devices so two end systems will go
through what's called the TTP three way handshake to establish a connection between each other.
Packets are sequenced and if packets go missing those packets will be retrained submitted.
Please refer to the TTP and UDP video for much more detail on the processes used by TTP and UDP UDP.
On the other hand does not provide reliability if packets are dropped they are lost and higher layer
protocols at the application layer would need to ensure reliability.
So UDP dozen to re transmit lost packets DCP would however flow control may also be implemented at the
transport layer flow control will manage a data transmission between devices to ensure that the transmitting
device does not send more data than the receiving device can process.
As an example you could have a iPhone receiving traffic from a powerful server the server has much more
speed processing power and perhaps a very high speed interface.
The server could send so much traffic that the iPhone is overwhelmed so the receiving device.
In this example the iPhone can tell The transmitting device.
In other words the server to back off or slow down when no message buffers are available.
Session Multiplex thing also takes place at this layer.
This allows for the multiple axing of several message streams or sessions into one logical link and
this layer will keep track of which message belongs to which session UDP on the other hand does not
give us that kind of reliability UDP is normally used for applications such as voice over IP or VOIP
which does not require retransmission of packets.
In some cases such as with VoIP or voice over IP re transmitting packets would be irrelevant and thus
applications would use UDP when retransmission is not required.
UDP is also more lightweight and has less overhead than TTP UDP does not use sequencing or provide other
reliability mechanisms that you get in TTP.
One of the well-known analogies to differentiate between TTP and UDP is to think of TTP as a telephone
call.
When I phone you I get an acknowledgement from you that it's you speaking because you would typically
say hello it's David speaking.
So you're going to at least say hello and then probably mention your name.
If I give you a piece of information over the telephone such as a string of numbers you may repeat that
back to me to ensure that you got the information correctly.
So as an example if I told you that someone's telephone number is triple 5 1 2 1 2 you would repeat
that back to me you would say the number is triple 5 1 2 1 2 and that ensures that both of us know that
you got the information correctly.
That's a very similar mechanism to TTP where all information that is transmitted is acknowledged.
So there is an acknowledgement of receipt of information.
If the information is not received properly it's to summited.
The analogy for UDP is that it's like a postal service.
If I want to give you someone's telephone number I write it on a piece of paper put it in an envelope
and then I mail it to you.
But in this case there's no guarantee that the piece of mail will actually reach you.
And in the same way there's no reliability in UDP.