- [Narrator] The main purpose of the Host-to-Host Layer
or Transport Layer is to shield the upper layer applications
from the complexities of the network.
This layer says to the upper layers,
just give me your data stream with any instructions
and I'll begin the process of getting
your information ready to send.
In this graphic we can see a TCP Header,
just remember TCP takes large blocks of information
from an application, and breaks them into segments.
It numbers and sequences each segment
so the destination's TCP stack can put the segments
back into the order the application intended.
After this segments are sent on the transmitting host,
TCP waits for an acknowledgement
of the receiving end's TCP Virtual Circuit Session.
Re-transmitting, any segments set aren't acknowledged.
Now since the upper layers just entered data stream
at the protocols into the Transport layer,
I'll use this graphic to demonstrate how TCP segments
the data stream and prepares it for the internet layer.
So taking a look at this we can see,
that our port numbers, right here's my source port number
and my destination port number.
These define my virtual circuit, right,
the source port is part of my virtual circuit
and the destination port is the processor service
that I'm using for example.
This could be something like 23, for Telnet
or 22, for SSH
and that tells the receiving host
what application process we're using.
Now for reliable communication we have sequencing,
acknowledgements and also,
our window size which is my flow control.
Now looking at UDP, we can see that clearly,
that's way more efficient than TCP,
but it doesn't have the reliability
that the TCP Header provides us.
There's no sequencing, acknowledgements or flow control.
We have our source and destination port numbers
and we don't create a virtual circuit so these are always
the same numbers source and destination.
The UDP length Header field and then we have a checksum.
Now, the one thing that's included in both Headers
is the Checksum that's run on the entire segment
on both TCP and UDP,
also we have our port numbers.
So those are the only things that are the same
with TCP and UDP.
The Transport Layer, just summarize,
the Transport Host-to-Host layer.
TCP is considered Reliable cause it creates
a virtual circuit so it's connection-oriented,
provides sequencing.
UDP is connectionless and does not provide any sequencing,
but it's very good because there's no overhead
so for VOIP or video streaming, we're going to use UDP.
Because reordering segments are useless
in applications like this.
So again, to look at our three-way handshake again,
which we've already done, but check this out.
So remember the host sends a SYN, SYN/ACK,
ACK and then our session's established
and this is called a three-way handshake.
Now TCP and UDP must use port numbers
to communicate with the upper layers because these are
what keep track of different
conversations crossing the network simultaneously.
Originating-source port numbers are dynamically assigned
by the source host and will equal
some number starting at 1024.
Port numbers 1023 and below
are defined in RFC 3232
which discusses what we call well known port numbers.
Virtual circuits that don't use any application
with a well known port number are assigned port numbers
randomly from a specific range instead.
These port numbers identify the source
and destination application from the process
in the TCP segment.
So taking a look at this example here,
at the Network Layer we have our routed protocol
of IPv6 or IP version 4,
TCP or UDP is used and the application developer decides,
that's not you, on which protocol to use
at the Transport Layer or Host-to-Host Layer.
So these are some examples of what use TCP.
For example FTP, and it's well known port number for FTP
or File Transfer Protocol's 21.
Secure Shell is 22, Telnet is 23,
HTTP is 80 and 443 for HTTPS.
Now, we have a couple of UDPs listed over here,
TFTP uses a connectionless protocol, the transport protocol
that's Trivial File Transfer Protocol.
Simple Network Management Protocol and,
but DNS, notice uses both TCP and UDP,
User Datagram Protocol.
When you query a website by typing in www.lamlee.com
for example, we need to resolve that name
so we go to DNS and that's a query,
that's a name look up isn't it?
But to do zone transfers and update between DNS Servers
so all of them have the same information,
we'll use TCP so it's reliable.