So again protocol at Layer 4 is TCP, which Layer 7 protocol is used.
Notice destination port is 80, 80 is HTTP.
Notice we've got what's called a destination port we could search in Google for port numbers and let's
go to the IANA Website which is the Internet Assigned Numbers Authority and if we search for 80
in that list you can see that HTTP port 80 is World Wide Web
HTTP
Now some protocols such as DNS or domain name server or domain name system as it's sometimes called
uses both TCP and UDP, HTTP generally uses TCP because we want reliability.
So again Layer 3 protocol is IP version 4, Layer 4 protocol is TCP we are indicating the application
that we want to send the data to by the port number.
Think of it as follows, the server is running multiple services and I want you to see these services
and look at the protocols going to the services.
So under services, we've got an HTTP server.
We've also got a TFTP server.
We've got an FTP server and email server and various other servers.
Where should the data go.
It needs to go to the right application.
You're not going to open up a MP3 music file in a word processor.
It's not going to work.
Word, opens word processing files. An application such as a music application gets used to open music
files.
So you need the right application or right service to work with the right data.
So again you use a port number to send the HTTP traffic to the HTTP server you use a port number like 53
to send traffic to a DNS server.
You use Port 21 to send it to FTP server or service 69 to a TFTP service.
You have one physical server running different processes or different applications and you want to send
the data to the correct service or correct server application.
Those applications listen on a specific port number.
So the HTTP server listens and port 80, the FTP server will listen on Port 21, TFTP will listen on Port
69.
So this is indicating to the server that this data needs to go to the application listening on port
80 and here you can see the HTTP request.
So packet gets sent to the server, the server because it's listening on that port will receive the data
and send it to the relevant application.
What you'll also notice here is the source port is 1025.
So let's talk about port numbers in a bit more detail.
A server service will listen on what's called a well-known port number but when you initiate a session
to a well-known port number such as 80 you will use what's called a femoral or random port number.
Now going back to the IANA we told that service names are assigned on a first come first serve basis
as documented in this RFC, service names and port numbers are used to distinguish between services
that run over transport protocols such as TCP, UDP and others.
This is the important part.
These port numbers in the range 0 to 1023 are signed as system port numbers so 80 is in that range.
We have what's called a user port numbers in this range and then we have what are called dynamic or
private port numbers also called ephemeral port numbers.
Again people use different terms.
Is it a router.
Is it a highway or a motorway.
Is it a sneaker.
Is it a trainer or in South Africa.
Is it a tacky, so tacky as a word that comes from Afrikaans.
But we use that as the English word in South Africa.
So is it a tacky.
Is it a trainer.
Like in the UK.
Was it a sneaker in the USA.
Different terms used by different people but dynamic or random port numbers or private port numbers
or ephemeral port numbers are dynamically or randomly used.
Now you'll notice packet tracers actually using a port number in this range 1025 is the source port number
things change over time if I do a search in Google for a femoral port numbers
on Wikipedia.
You can read more detail about how the IANA recommends those port numbers for dynamic or private
ports.
But many Linux kernels use this range BSD used this range.
Windows XP used this range by default.
So 1025 not 1024, Vista,
Windows 7 2008.
You use the IANA on a range, Windows 2003 used this range, basically different operating systems used different
ranges and then we told all versions of Windows since Windows 2000 to allow you to specify a custom
range in that range 1,025 to 65,535.
You can also see that Windows allows you to customize this so you can specify a custom range.
The moral of the story is servers and for the CCNA you only need to worry about some of the well-known port
numbers 80 HTTP, 21 FTP, 69 TFTP and there's a few others.
23 is telnet,
22 is SSH,
Know the well-known protocols, HTTP as an example is 443 you'll get to know these protocols as you work
with networks.
But for the exam study the well-known port numbers and well-known protocols.
So here we can see the PCs using this source port number going to the server.
However what you'll notice and let's show that in the PDU is that the port numbers get swapped round
when the server replies.
So this is the inbound PDU,
This is the PDU from the PC to the server.
Source mac address is the PC, source IP address is the PC, source port number is 1025.
But for the reply that gets reversed round source MAC address is the server,
Destination is the PC, source IP address is the server, destination is the PC, source port number is
80.
Destination Port number is 1025.
So basically for our communication MAC addresses get swapped round, IP addresses get swapped round and
port numbers get swapped round.
So if you talk from your PC to my server on port 80 I'll reply from port 80 to the port number that
you've chosen.
The reason why the PC will choose dynamic port numbers, is if you open up two sessions to my server
your first session may use port number 1025 and your second session may use port number one thousand
twenty six.
They should be randomize but often they're not and that's why hackers can often guess what port number
is going to be used next by application but there you go.
That's an example of layer 2, layer 3 , layer 4 and layer 7.
If we look in the OSI model here they don't show Layer 7 as the protocol here but that's actually the
protocol used in the TCPIP protocol stack.
Again TCPIP model originally 4 layers we now have 5 layers.
So we group layer 5, 6 and 7 together as the application.
But we talk about Layer 7 because of the history with the OSI model.
Okay so that was quite detailed.
I'm hoping that helps you understand a bit about port numbers protocol numbers Ethernet types and so
forth.
In the next video I'm going to show you another protocol.
Let's use email and let's say FTP, spend some time however going through this yourself having a look
at the different protocols.