Transcript for:
Understanding the OSI Model Layers

hey everyone welcome back to another video here on tryhackme i'm john and today we'll be taking a look at the room osi model learn about the fundamental networking framework that determines the various stages in which data is handled across a network uh the osa model in general and we'll go into this in just a moment is a network that can be used for troubleshooting and sort of breaking down what actually happens on the cables and furthermore on the actual computer itself when it's trying to talk across these networks that being said let's go ahead and dive right into task one what is the osi model the usi model or open systems interconnection model is an absolute fundamental model used in networking this critical model provides a framework dictating how all network devices will send receive and interpret data one of the main benefits of the osi model is that it devices can have different functions and designs in a network while communicating with other devices so it doesn't matter what the device is as long as it obeys this model it it still works and it couldn't still send and receive data across this network data sent across a network that follows the uniformity of the osi model can be understood by other devices the osi model consists of seven layers that are illustrated in the diagram below each layer has a different set of responsibilities and is arranged from layer 7 to layer 1. at every individual layer that data travels through specific processes take place and pieces of information are added to this data which is what we'll come to discuss in the upcoming tasks within this room however for now we only need to understand that this process is called encapsulation and what the osa model diagram or it looks like in the diagram below and here you can see the seven layers we have physical data link network transport session presentation and application let's go and answer the questions below what is the osi in osi model stand for that is open systems interconnect it might be interconnection there we go how many layers in digits does the osi model have that will be seven layers and we can see them above what is the key term for when pieces of information get added to the data that is in capsulation let's go ahead and move into task 2 layer 7 application layer 7 application the application layer of the osi model is the layer that you will be most familiar with the this familiarity is because the application layer is the layer in which protocols and rules are in place to determine how the user should interact with data sent or received everyday applications such as email clients browsers or file server browsing software such as filezilla provide a friendly graphical user interface or gui for users to interact with data sent or received other protocols include dns domain name system which is how website addresses are translated into ip addresses and you can see just an example of interfacing with an ftp server file transfer protocol what is the name of this layer this is the application layer what is the technical term that is given to the name of software that users interact with that is a graphical user interface and there we go let's move on to task 3 layer 6 presentation layer 6 of the osi model is the layer in which standardization starts to take place because software developer developers can develop any software such as an email client differently the data still needs to be handled in the same way no matter how the software works this layer acts as a translator for data to and from the application layer layer 7. the receiving computer will also understand the data set to the computer in one format destined for another format so for example when you send an email the user or the other user may have another email client uh than what you have but the content of the email will still need to display the same security features such as data encryption like https when visiting a secure site occur at this layer what is the name of this layer that is the presentation layer what is the main purpose that this layer has that is standardization if i can spell it correctly uh not even close wow let's copy that and we're gonna paste instead of me trying to spell things or we're looking for translator rather give me a moment and we're just gonna ignore that i can't spell and it got even worse wow we are getting worse by the second okay perfect let's move on to task four layer five session once data has been correctly translated or formatted from the presentation layer the session layer will begin to create a connection to the other computer that the data is destined for when a connection is established a session is created whilst this connection is active so is the session the session layer layer 5 synchronizes the two computers to ensure that they are on the same page before data is set and received once these checks are in place the session layer will begin to divide up the data sent into smaller chunks of data and begin to send these chunks packets one at a time this dividing up is beneficial because if the connection is lost only the packets that weren't yet sent slash received will have to be sent again not the entire piece of data so think of it as loading a save file in a video game what is worthy of noting is that the sessions are unique meaning that the data cannot travel over different sessions but in fact only across each session that it's specifically destined for let's move into the questions what is the name of this layer it is the session layer what is the technical term for when a connection is set or successfully established uh it should be uh let's see i'm guessing created let's go ahead i'll pause this for just a moment and double check my notes all right there we go so we're specifically looking for the term session so that's saying that the connection has been established and we've created a session what is the technical term for small chunks of data that is packets and there we go let's move into task four layer four or task five rather layer for transport layer 4 of the osi model plays a vital part in transmitting data across the network and can be a little dis or difficult to grasp when data is sent between devices it follows one of the two different protocols that are decided based on upon several factors so we have tcp and udp let's first talk begin with uh tcp the transmission control protocol otherwise known as tcp is a protocol that it's meant for reliability and transport and we'll get into that in just a moment potentially hinted by the name this protocol is designed with reliability and guarantee in mind this protocol reserves a constant connection between the two devices for the amount of time it takes for the data to be sent and received not only this but tcp incorporates error checking into its design error checking is how tcp can guarantee that data sent from the small chunks in the session of layer 5 has been received and reassembled in the same order so we have accuracy of that data being transmitted let's summarize the advantages and disadvantages of tcp in the table below so some advantages again this guarantees the accuracy of the data because we're checking it once it's received on the other side it's capable of synchronizing two devices to prevent each other from being flooded with data and it performs a lot more processes for reliability disadvantages this requires a reliable connection between the two devices if one small chunk of data is not received then the entire chunk of data cannot be used because we have to resend that packet another slow connection can bottleneck another device as the connection will be reserved on the receiving computer the whole time it has to be active tcp is significantly slower than udp because more work has to be done by the devices using this protocol because we're checking things and maintaining that connection tcp is used for situations such as file sharing internet browsing or sending an email this usage is because the services require the data to be accurate and complete and there's really no good in receiving half of a file in the diagram below we can see how a picture of a dog is broken up into smaller pieces of data known as packets from the web server where the computer reconstructs the picture of the dog in the correct order so it's broken up into these packets in theory these would be a lot smaller than this and we can see how it's finally reconstructed at the end point now let's move on to user datagram protocol or udp for short this protocol is not nearly as advanced as its brother the tcp protocol it doesn't boast the many features offered by tcp such as ear checking and reliability in fact any data that gets sent via udp is sent to the computer whether it gets there or not there is no synchronization between the two devices or guarantee just hope for the best and fingers crossed while this sounds dis advantageous it does have its merits which we'll lay out on the table below so it's much faster than tcp a lot of this is kind of the inverse of what we saw with tcp so a lot faster it leaves the application layer uh user software to decide if there's any control over how the packets are actually sent udp doesn't really care it's up to the actual user software to kind of decide that from there and udp doesn't reserve a continuous connection so it doesn't bottleneck the device there disadvantages it doesn't really care if the data is received it's going to send it anyways and it's going to keep on going it is quite flexible to software developers in this sense uh which is good and bad uh it depends on how it's implemented um the biggest thing to think of with udp is something like skype or video calls which udp is perfect for because you're sending a lot of data and maybe you hit a little small hiccup that the video connection doesn't quite uh it might make you sound like a robot for a little bit or things like that but you just wanted to keep moving on because you don't want to see something from you know five minutes in the past suddenly flash on the screen that might be terrifying uh but in this case you wanted to keep moving and it that's the idea with udp you're still you want that data stream to keep continuing uh and with this with it not reserving that connection uh this means that on unstable connections it it might be a bad experience and you've probably seen this before when skype was first coming out that it wasn't always great it wasn't always a great connection and even then sometimes you can see that with streaming services like netflix or other things where sometimes you just hit a rough patch in the internet that a lot of people are on and all of a sudden your connection just doesn't really work that well using the same example as before we can now see that only package 1 and 3 have been received by the computer and you end up with this horribly disfigured dog and you can see how udp can sometimes not always be the best choice udp is useful in situations where there are small pieces of data being sent and we mention here that uh video streaming are really large files where it's okay maybe if you're watching a video on youtube that it's okay if part of the video is pixelated because it'll pick itself up here in just a little bit that happens and that's where udp is really useful let's go ahead and dive into the questions what is the name of this layer gotta double check what layer on transport there we go what does tcp tran uh stand for that is transmission control protocol what does user udp stand for uh that should be user datagram protocol if i have that type correctly protocol guarantees the accuracy of data that will be tcp but protocol doesn't care if the data is received not by the other device that will be udp because we're not actually checking it when it's received what protocol would an application such as an email client use that hopefully is tcp what protocol would an application downloads files use that would be hopefully tcp as well if you want to guarantee that you're receiving all of the data and it's correct and what protocol would an application that streamed video use like the udp all right let's go ahead and move on to task six layer three network the third layer of the osi model the network layer is where the magic of routing and reassembly of data takes place from the small trunks to a larger chunk firstly routing simply determines where the most optimal path in which these chunks of data should be sent so maybe we have multiple routes to our destination routing is going to determine which one is going to be the most ideal or typically the fastest while so some protocols at this layer determine exactly what is optimal or what is the optimal path rather that data should take to reach a device we should only know about their existence at this stage of the networking module briefly these protocols include ospf or open shortest path first rip or and rip rather a routing information protocol rip is really common to see don't worry about this too much you can do different forms of attacks based on this but we won't worry about that at this point just know that they exist the factors that decide what route is taken is decided by the following so what path is the shortest so for example has the least amount of devices that the packet needs to travel across what path is the most reliable so what have packets been lost on that path before and then last which path has the faster faster physical connection so for example if one device is using a copper connection which would be slower than a fiber connection so it's going to take these factors into consideration when determining how it's going to actually send things across at this layer everything is dealt with via ip addresses such as 192.168.1.100. devices such as routers capable of delivering packets using ip addresses are known as layer 3 devices because they are compatible at working at the layer three of the third the osi model rather so again routers are going to be the one or the big one here that live in this layer because that's where you have ip addresses taking place what is the name of this layer it is going to be the network layer will packets take the most optimal route across the network hopefully what does the acronym ospf stand for we're going to go and copy that up here open shortest path first which fairly straightforward what does the acronym rip stand for that is the routing information protocol and we can copy that again what type of addresses are dealt with at this layer that is going to be ip addresses is this is where logical networking takes place and make sure you have plural on that let's move into task 7 layer 2 data link the data length layer focuses on the physical addressing of the transmission it receives a packet from the network layer including the ip address for the remote computer and adds in the physical mac address of the receiving endpoint inside every network enabled computer is a network interface card or a nic which comes with a unique mac address to identify it we talked about this in the previous room mac addresses are sent by the manufacturer and literally burnt into their card and they can't be changed although they can be spoofed in this case when information is sent across a network it's actually the physical address that is used to identify where exactly to send the information additionally it's the job of the data link player to present the data in a format suitable for transmission what is the name of this layer it is the data link layer there we go what is the name of the piece of hardware that all network devices come with that is going to be a network interface card or a nic perfect let's go ahead and move into task 8 layer 1 physical this layer is one of the easiest layers to grasp put simply this layer references the physical components of the hardware used in networking and is the lowest layer that you will find devices use electrical signals to transfer data between each other in a binary numbering system so ones and zeros uh one quick note there is an ongoing networking joke that layer zero exists and it is the human layer so if you have a layer zero problem it's the human that's involved so if you ever see that come up that's without referencing for example ethernet cables connecting devices such as the the diagram below so this will be part of the physical layer let's dive into the questions what is the name of this layer it is the fiscal layer what is the name of the numbering system that is both zeros and ones that is binary what is the name of the cables that are used to connect devices ethernet cables and there we go let's move into task nine practical oversight game can you escape the osi dungeon crime the the levels in the correct order to escape the dungeon and reveal the flag can you beat our staff high score of 19 seconds definitely recommend trying for that for the sake of the video i'm not going to be speedrunning through this i'm going to walk through and explain everything as i do it but that being said let's go ahead and dive right in oh aside dungeon insert coin this is wonderful our hacker has been locked in the dungeon their only chance of freedom is by choosing the correct path based on the osi model use your cursor uh keys to move left and right and the space bar to enter the doors so let's see uh i believe i'm here at the bottom so we're starting with layer one maybe let me go and pause and i will make sure that this is working for me all right there we go i have a 60 keyboard so i have to remember which keys are the arrow keys so first off we have the physical layer so space to enter that door and then we have the data length layer of number two and there we go and then we have the network layer perfect and then we have layer four the transparent layer next we have layer five session and let me go and scroll up just a little bit i've got this zoomed in so that you guys can see next we have layer six the presentation layer and finally we have layer 7 the application layer and there we go perfect well done we've escaped the dungeon in 74.18 seconds wonderful i'm very fast at this game as you can tell let's go ahead and type in our flag osi dungeon escaped and there we go let's go to move into task 10 continue learning with packets and frames continue your learning by joining the packets and frames room we're going to mark that as complete i highly recommend moving on to that room after this video if you want to you can go and continue practicing with the osi game here and i definitely recommend doing that as well as always if you have any questions i will have the try hack me discord and subreddit linked in the video description below but otherwise i'll see you in the next video and until next time happy hacking