now you will learn a lot more by doing rather than just watching me talk about protocols and talk about things so make sure that you download this packet tracer file and try this yourself i'm going to walk you through a scenario and a few scenarios in this video and in subsequent videos and labs but try this yourself you will learn far more by doing than by watching or listening you learn to ride a bicycle by riding you don't learn to ride a bicycle by watching someone else ride a bicycle or watching videos so try this yourself okay so in this example i've got a topology consisting of multiple devices so zooming out i've got a whole bunch of devices but for this initial video we're going to concentrate on this pc which is in our internal network in other words think of this as being at your home or company and then we've got a device that's connected to the internet here so this would be our internet router what we're going to do however is connect to a server in our internal network now at home you may have multiple internet connected devices you could as an example simply open up a web browser on your pc and connect to your internet router as an example if i open up a web browser and connect to an ip address in my network and don't worry too much about ip addresses at this point if you don't understand them basically an ip address is a number that you allocate to a device that allows it to communicate using a protocol which in this example is ip ipv4 in this specific example here i've got a bt home hub so you may have devices at home that you can connect to we're going to mimic that or represent that in packet tracer so on the left here i have some servers running internally i have a internet router which is connecting me to the internet now as a further demonstration here i've got an iphone i could connect to that light that's a hue light using bluetooth and then do something to that light now in your home you may have some devices that are connected via ip as well that light isn't using ip as in normal ip it's using bluetooth so i'm connecting to that light via bluetooth from my iphone and turning it on and off but this light as an example is connected via ip so i can go onto my phone and then i could say okay let's turn that light off so it's gone off turn it on now the way that works is i'm simply connecting to that light via tcp ip you can actually look at the traffic on your home network using an application called wireshock i'll talk about that in a separate video but in this example let's use packet tracer so that we can talk about the same protocols together so on this pc i'm going to open up a desktop and i'm going to open up a web browser now before i connect to a server i'm going to change the packet tracer mode to simulation mode so that we can see the actual packets going across the network on my windows pc i'm going to connect via http to the server on the left which is 10 1 1 100. notice nothing happens but when we go back here we can see that some packets have been created first one is op now on ethernet devices communicate using what's called a mac address a mac address is a burnt in address on a network interface card so i'm connecting from this pc to the server the pc doesn't know the mac address of the server this is the mac address of the pc and we can see that by going to the config of the pc go to first ethernet notice mac address ends in 11.99 so this pc is basically opening or requesting up is address resolution protocol requesting the mac address of the server so it's basically saying who has this ip address so that gets sent to the switch now this is what's called a broadcast frame notice the destination is fs that's a broadcast basically saying who has this ip address if we look at the pdu or protocol data unit what you'll notice is the target mac address is blank target ip address is this now this is a broadcast and a layer 2 switch will flood the broadcast which basically says it sends it out of all ports so it gets sent to this server this server drops the message because it doesn't have the ip address requested by the pc this router will also drop the packet but this server will reply back so the inbound pdu is from the pc to a broadcast address but the reply is now from the server ending in zero zero eight six as its mac address to the pc notice how packet tracer uses seven layers here at the moment it only shows layer one and two here if you look at the inbound pdu however at layer two we have ethernet at layer three we have op and in the outbound pdu that's what we see something similar layer 2 layer 3 arp target ip address is the pc source ip address is the server source mac address is the server and we can see that by looking at the interface notice 0086 is the mac address so what happens now is that gets sent back to the switch and gets sent to the pc so now the pc knows the mac address of the server and can communicate directly to the server notice this is a tcp packet so in tcp before communication takes place they do what's called a three-way handshake they agree on certain parameters such as sequence numbers and how much data they can send and then an http packet is sent into the network so if we look at the actual http and that's the one i want to concentrate on here let's look at the http packet or http message packet tracer shows this very nicely gigabit 104 on the switch receives the frame so this interface receives the frame from the pc we've got layer 1 and layer 2 information here it's going to be forwarded out of gigabit 102 so forwarded to the server but let's look at the inbound pdu and outbound pdu or protocol data unit in a lot of detail source mac address is the pc destination mac address is the server we have a type field how does one layer refer to the layer above it at layer 2 on ethernet it uses a type field this type 0 800 in hexadecimal zero extra means hexadecimal indicates that the higher layer protocol is ipv4 we could have other protocols here like ipv6 so if i go back to a r packet and have a look at that notice the type field is different here 8 0 6 that indicates op so when a device receives a frame at layer 2 it needs to know which protocol to use in other words which protocol stack to use we can see that in windows by going to control panel and if we have a look at our adapter so this is the wireless adapter that i'm currently using and go to properties what you'll notice is we have ipv4 and ipv6 two protocols at layer 3 have been enabled on this pc when the pc receives frames of the wire so when that pc receives data how does it know which protocol stack to use in other words is it an ip version 4 packet or is it an ip version 6 packet it's based on the type field at layer 2. so this serve on the left here when it receives this http packet will know that it needs to use the ipv4 protocol stack if you send ipv4 packets to ipv version 6 it's not going to understand it in the same way that i have an english protocol stack and i have an afrikaans protocol stack i'm much better at english than i'm at offered cons if i say good morning how are you and you use the english protocol stack it's going to make a lot of sense if you speak multiple languages and you hear different languages your mind will just switch to that language very easily but on a pc it needs to know which protocol stack or which language to use so in this example ipv4 is the layer 3 protocol and here we can see ipv4 source and destination ip addresses now same thing again how does it know which protocol is being used at layer 4 ethernet is the layer 2 encapsulation ipv4 is the layer 3 protocol tcp is the layer 4 protocol this number here indicates so it's a 6 in hexadecimal or 6 in decimal indicates that the protocol used at layer 4 is tcp you can find protocol information easily by just searching for ip version 4 protocol numbers and then the iona website gives you a list of protocol numbers so as an example tcp is protocol number six 17 if we scroll down is udp tcp or transmission control protocol is reliable the user datagram protocol or udp is not reliable so again protocol at layer 4 is tcp which a 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 honor 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 ipv4 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 it's 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 in 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 ephemeral or random port number now going back to the iona we told that service names are assigned on a first come first serve basis as documented in this roc 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 assigned as system port numbers so 80 is in that range we have what's called 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 router is it a highway or a motorway is it a sneaker is it a trainer or in south africa is it a tachy so taki is 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 or is 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 trace is 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 ephemeral port numbers on wikipedia you can read more detail about how the iona 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 iono range windows 2003 used this range basically different operating systems used different ranges 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 https 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 pc is 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 around ip addresses get swapped around and port numbers get swapped around 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 1026 they should be randomized but often they're not and that's why hackers can often guess what port number is going to be used next by your 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 tcp ip model originally four layers we now have five layers so we group layer five six and seven together as the application but we talk about layer seven 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 [Music] you