OSI Model Layer 5, 6, and 7 -- Session, Presentation, & Application Layers -- what they actually do
50.79k views2335 WordsCopy TextShare
Practical Networking
Plenty of attention is given to L1-L4 of the OSI model... but very little attention is given to the ...
Video Transcript:
[Music] there's a lot of bad information out there about layers 5 six and seven of the OSI model in fact there are many resources out there that describe the OSI model as merely something to memorize I think that's a huge disservice there's a way of understanding The OSI model from a practical perspective as a series of components that all contribute towards making the internet work that's the strategy I took when I published my two videos on the osm those videos focused on layers 1 through 4 the most common request I got in the coms ments of those videos was to continue with lers 56 and 7 so here we [Music] are the OSI model consists of seven different layers that each have a specific responsibility which contribute to the overall goal of networking which is to allow two users to use computers to share data between each other if each layer is doing its responsibility successfully then the goal of networking is attained which means the internet works there are many resources that unpack layers 1 2 3 and four but very few that really pick apart layers 5 six and 7even I call these the Forgotten layers of the OSI model part of that is because the other popular networking models the tcpip models simply combine these layers as a single aggregated application layer now there's good reason for that and you'll understand those reasons towards the end of this video what I want to do in this video is unpack the details of layer 5 6 and 7 and specifically how each of those layers contribute towards the goal of networking before we can understand these layers however we have to understand the layers beneath it specifically you must understand the terms hop to hop end to end and service to service and how each of those apply towards the goal of networking if you're unfamiliar with those terms then please check out my other two videos on the OSI model I promise it'll be the best take on not only understanding The OSI model but also how to explain it to others with that said let's get into the Forgotten layers of the OSI model starting with layer five to understand layer five of The OSI model you have to understand that this model was created long before the days of personal computers or PCS back in those days Computing was done on large massive machines called mainframes and these were often so big that they took up entire rooms the Computing resources on these enormous mainframes were then accessed by people using what is known as dumb terminals which were effectively just a monitor and a keyboard plugged into these main frames no actual processing of data was done on these dump terminals all the actual Computing was done on the mainframes fun fact this was also the model that Linux was created in this is why Linux is often described as a multi-user operating system in any case all the Computing was done on these large mainframes and users would connect to these mainframes using dump Terminals and then those main frames were then connected to other main frames which also had their own set of users using their own set of dump Terminals and here we can Define the problem that layer five is meant to solve notice this blue user is using this Mainframe to speak to this blue user using that main frame at the same time these two green users are also speaking to each other using these two main frames well if both of those main frames are doing all the Computing and sending of the data between each other then the packets that are sent from this main frame to the other are going to have the same layer 2 address like a MAC address the same layer three address like an IP address and even potentially the same layer four addresses like ports which then begs the question how is the data between these two blue users going to be kept separate from the data between these two green users that's where layer five comes into play layer five is there to distinguish between user sessions it allows networking protocols to identify a user independently from their layer 2 layer 3 or layer 4 addresses okay so that makes sense but is layer five simply an artifact of Legacy Computing on these mainframe computers well no you actually use something that I would categorize as a layer five component every day when you're browsing the web let me show you let's say these two blue users are not using main frames to speak to each other and instead this user is actually a web server for the site site. com and this user is simply someone using a mobile phone this mobile phone is currently logged into a Wi-Fi network at this user's house and this phone uses this connection to log into the site site. com but what happens if this user then decides that they want to go to a coffee shop and connect to the Wi-Fi network there since this is a different network they're going to have a new IP address which means this information is going to change and if the website is identifying this us user with layer 1 through 4 information then this user is going to have to log back into the website every time they connect to a new Wi-Fi network because in each case they're going to be getting a new IP address instead since we're using HTTP to access this website HTTP has a functionality known as HTTP cookies these cookies are simply arbitrary text strings that store users specific information that is created by the server what happens is when the user logs into the website the the server generates one of these cookies and sends it to the user this cookie then stays with the user and if this user logs into a new Wi-Fi network with new layer 234 information that user still has the same cookie and the website can still identify this user independent from whatever layer 2 layer three and layer four addresses that that user might maintain so you see HTTP cookies are a perfect example of layer five's responsibilities in the OSI model they allow the network to identify user independently from the layer 2 three and four addresses which then brings us to layer six to understand the presentation layer we're going to simulate a packet arriving on the web server for site.
com recall that every packet is really nothing more than a series of ones and zeros and because of the rest of the layers of the OSI model we know that this packet successfully delivered to the web server arrive to the right Mac address arrive to the right IP address arrive to the right port and arrive to the right user session which now brings us to layer six what layer six does is it tells us how to interpret the ones and zeros there are many ways to interpret those ones and zeros for example should we group those ones and zeros in sets of six bits as base 64 encoding would require this would mean each combination of six bits would turn into a new base 64 character or should we interpret those ones and zeros in groups of four bits this is what heximal would require where each group of four ones and zeros represents a new heximal character or should we interpret those ones and zeros as long numbers or integers if we were to interpret all these ones and zeros as 32-bit numbers this number would be 1 billion in change and this number would be 796 million in change alternatively maybe we're interpreting this as a single large 64 pit number in which case this string of 64 ones and zeros could be translated to this huge number in decimal so you see that's what layer six tells us it tells us what do we do with these ones and zeros now earlier we use HTTP as an example and we can continue to do so HTTP as a protocol uses extended asky encoding extended asy takes all the ones and zeros and groups them into sets of eight bits and interprets each of those eight bits as a different ASE character this combination of ones and zeros translates to the letter G and this combination of ones and zeros translates to the letter e and this combination translates to the letter T and so on and that's what layer six provides it tells us what to do with the received ones and zeros that have been successfully processed through the OSI model and delivered to the right user session which then brings us to layer seven if layer six told us how to interpret the ones and zeros that have been received layer seven will tell us what do we do with the interpreted characters or said another way layer 7 will actually Define the application commands these three bytes of ones and zeros turn into the letters g e and t and the command get in HTTP is the command you would use to fetch a particular web page what you're seeing here is actually the first eight characters of an HTTP request asking for the page simple. HTML using http P 1. 1 from the host packet.