Instructor: Welcome back.
Before we proceed with scanning,
I just want to give a basic overview of TCP and UDP protocol
for anyone that is encountering it for the first time.
We already mentioned what TCP and UDP are.
They are two different protocols used
for sending bits of data
or also known as packets.
TCP and UDP are not the only protocols that are out there.
However, they're the most widely used ones.
Let's talk about TCP first.
So, TCP stands for Transmission Control Protocol
and it is the most commonly used protocol on the internet.
When you load the webpage,
your computer is sending TCP packets
to the web server address asking it,
to send the webpage to you.
Then the web server responds
by sending a stream of TCP packets,
which your web browser stitches together
to form the webpage that you see.
The same happens once you, for example,
click on a link or sign in or post a comment.
Your web browser sends TCP packets
to the web server and the server sends TCP packets back.
However, PCP is not a one way communication.
The remote system sends packets back to acknowledge
that it received your packets.
So, TCP is based on three way handshake.
And as the name says,
three-way handshake is consisted out of three steps.
First one is SYN.
In this step,
the client wants to establish a connection
with the server,
so it sends a segment with SYN
and what SYN stands for is Synchronized Sequence Number,
which informs server
that client wants to start communication,
and with what sequence number
it starts the segments with.
After the SYN step,
comes the SYN/ACK,
which is the second step,
and in this step,
the server responds to the client's request
with SYN/ACK signal bit set.
ACK signifies the response of segment it received
and SYN is the same from the first step.
It signifies with what sequence number
it is going to start this segment with.
In the third and final step,
which is just ACK.
In this step, the client acknowledges the response of server
and they both establish a reliable connection
with which they will start the actual data transfer.
This is just an example of TCP communication
establishing between a client and a server.
Once the data transfer starts, TCP guarantees
the receiver will get the packets
in order by numbering them.
Then, the server sends messages back
to the sender saying it received the messages or packets.
If the sender does not get the correct response
it will resend the packets to ensure the server
got the packets.
All of those packets are also checked for errors.
So, TCP is all about reliability.
Packets sent with TCP are tracked
so no data is lost or corrupted in transit.
That's why once you download the file,
for example over the internet,
your file is working once you run it in your machine
because it is being transferred with TCP.
So, all of the packets will reach their destination
without any errors.
UDP, on the other hand, stands for User Datagram Protocol.
A Datagram is the same thing as a packet of information
and UDP protocol works similarly to TCP
but it throws all the error checking stuff out.
That's why UDP is much faster.
It is used when speed is desirable
and error correction is not necessary.
For example, UDP is frequently used
for live broadcasts and online games.
That's why UDP doesn't really care
whether packets received its destination
and it'll not resend a packet
if it didn't reach the other part.
It will just continue sending other packets.
You cannot ask for those missing packets again with UDP.
And these are just the basics
behind two most known protocols for communication.
Even though many of you probably knew this already
it is good to have a refresher,
since we're going to need this knowledge
once performing scanning.
See you in the next video.