The OSI Model
The mighty OSI model. You will hear network engineers speak in layers, “oh I found a layer 2 issue and I fixed that.” This is a common occurrence while working in cyber and working with those people. So, what is this cryptic language and what do they mean when they say “Always remember to start with that layer 1!”
The OSI is a 7-layer model that helps define important protocols and functions that align with those layers. For most protocols, you can fit them neatly into those seven layers. Those layers are:
- Physical
- Data Link
- Network
- Transport
- Session
- Presentation
- Application
Mnemonic Device
Most people use a mnemonic device using the first letter of each layer. I PERSONALLY made up one a long time ago in the beginning of my career that no one uses which is: People Do Not Treat Some People Alright. It’s stupid but it helps me remember Physical DataLink Network Transport Session and Application. The one that I heard most coming up in the field was Please Do Not Throw Sausage Pizza Away. That one never stuck. Pick one that works for you!
The Assembly Line
The best way I have heard the OSI Model described is an assembly line for networking and applications. If you are building a generator (I worked in a generator factory during college so we will use what I know) I didn’t care about what the person was doing to my left. I only cared that they did their part of the assembly. I mounted the sides with insulation, they mounted the back plate. As long as the previous layer put that back plate on, I could put my side plates on. The OSI Model also doesn’t care what the other layers are doing, only thing they care about is they do it right.
One difference in the assembly line analogy is that on the assembly line, you are not usually tearing down that generator when the user receives the generator. In networking, once all seven layers get to the other user/server/system it is torn back down in the reverse sequence that it was built for the data to be retrieved.
I DIGRESS.
Are There Other Models?
This is not the only model that identifies how traffic is built and sent. There are others, the most famous second model is the TCP/IP model. Which I will make another blog about. I don’t see most people use that model, that I know. We usually speak in the layers of the OSI.
The Layers Explained
Physical
Let’s get PHYSICAL PHYSICAL. Okay now that I got that out of my system… Let’s roll.
The physical layer is the layer that makes your information MOVE through the world. It is any energetic impulse that sends data. This could be electricity over a copper cable, light through a fiber cable, or radio waves passed back and forth from satellites.
Copper Cables
Copper cables send electrical impulses riding on the copper wire inside of the jacket covering it. The most common cable you will see in today’s network is, probably, the CAT 6 Unshielded Twisted Pair (UTP) cable. These are the cables that plug into the back of your computer that transfer the data in your home. There is also the standard cable TV cable the coaxial cable, which is what most homes still use to bring in internet into the home via their cable company.
Fiber Optic Cables
Fiber optic cables send light impulses through the glass that is inside of the jacket covering it. It is becoming more popular in homes as it is expanded to rural areas. It usually provides a higher bandwidth than copper to the home.
The two main Fiber Cables:
Multi-Mode Fiber
It uses LED (light emitting diode) to send the light through the cable. This supports multiple lights at once, allowing sending and receiving to happen at the same time. This could cause issues known as modal distortion where signals sent at the same time don’t arrive at the same time.
Single-Mode Fiber
It uses lasers to send the light through the cable. Fixes the modal distortion from multi-mode fiber as it only allows one light signal.
Device
The device associated with this layer is the Hub. It doesn’t care about anything just moves what it sees on the wire to all of the ports it has.
Data Link
The data link layer is the first and the last stop before getting put into whatever impulse the connecting medium is using. This is how the network determines which computer gets which traffic.
You can think of this as your local post office. How does the post office know what house to send your bills? You have a specific unique address assigned to you. Likewise, your computer has a specific unique address assigned to it. This address is the MAC Address and it is how layer 2 works. The data link layer works with frames of data. We will break down that language later.
MAC Address
The MAC (Media Access Control) Address is the unique address that is assigned to each interface. It is always a unique number. The MAC address comprises 12 Hexadecimal numbers/letters. For example, 00-40-05-52-F8-9A. The MAC Address breaks down as two sets of 6. The first 6 numbers are the company’s unique number, if you looked up the first 6 numbers of the above MAC you would see the company as ANI. The last 6 are unique to that device from that company. This is often called the physical address of the device.
NIC (Network Interface Card)
The NIC is the mailbox that receives and gives the data to the user. This is where the MAC Address that the network uses is burned into.
Device
When thinking of layer 2 devices, think of layer 2 switches.
Network
The network layer is how data makes it from your network to any other network in the world. When considering the post office analogy, this would be the zip code, kind of. Once you send a piece of mail, the post office will use the zip code to determine where in the world it needs to go to be processed and sent to the correct user.
This layer works on the IP (Internet Protocol) which is how networks are numbered. There are two versions of IPs, IPv4 and IPv6. Which are called the logical number of a device. Each device is assigned an IP that is tied to its MAC Address. The network layer works with packets of data.
IPv4
They are a 32-bit number broken into four groups of 8-bit numbers that range from 0 to 255. It is the traditional way addresses are used in networks. It is easier to understand, maybe it is just being more familiar with IPv4 for me to say it is easier than IPv6.
IPv6
They are a 128-bit number broken into eight 16-bit hexadecimal. It was created in response to IPv4 being “used up.” It was believed early on in the internet age that IPv4 would run out of IP addresses, and we needed something to change. IPv6 was created and is theorized to be enough to cover any device getting a unique IPv6 internet routable IP address.
Quickly after identifying the issue with IPv4, there were smart people that started coming up with “fixes” other than IPv6. Things such as subnetting, where you can break down IP addresses into smaller chunks allowing for more uses. Natting, which allows people to have a few or one Public IPv4 addresses for their entire network by converting Private IPs to Public IPs to route on the internet.
Devices
The device at this layer is the Router. It works at the IP level.
Transport
Let’s continue with the post office analogy, when you have a lot of things to send to someone what do you do? Well, you break it up into separate envelopes or separate boxes to ship it. It makes life easier for everyone, especially the post office, so they aren’t carrying a 1000lb box. Same thing for the network. We need to break up the data that is sent for better efficiency. This is what the Transport layer is designed to do. Efficiently break up data into network friendly packets by labeling them in their desired order. The transport layer works on building segments of data, or datagrams of data depending on which transport protocol it’s using.
TCP (Transmission Control Protocol)
TCP in the simplest form, is traffic that cares about what order it is received in. The TCP can identify and resend segments if it sees it is missing one. For example, if you call someone you wouldn’t want to use TCP. Imagine someone talking and the phone cuts out one word, you don’t want that word to come back around and interrupt them when they are talking a sentence later, it wouldn’t make sense. However, if you are sending credit card data, you want to use TCP because if you only send 8 numbers to your credit card, it wouldn’t work.
UDP (User Datagram Protocol)
UDP simply doesn’t care about your data. It sends it out there and if you get it, you get it. Wait WHAT?!? It doesn’t care if the other side receives it? No, not really. Think of it, when you are streaming a video from Netflix, are you really going to know that you’re missing one pixel of data in that video? Probably not, but you would care if it buffered every time a single pixel segment didn’t get you in the correct time.
Session
The session layer is responsible for handling which segments go to which application. If you are on your computer the chances of you ONLY using ONE session are pretty rare. We open up Word, then Firefox, then Steam, and xyz. We have multiple sessions open at one time and the session layer tracks the segments coming and going to each application session.
Presentation
We are almost there! The purpose of the presentation layer is to translate between the other layers and the application layer in a format that is USABLE.
Application
WE MADE IT. This is the application, simple. Well, not exactly it is the code that is used to make everything network friendly. If you want to go to a website, you need a web browser application that can speak in the language such as HTTP for websites, to present the data into that application.
Encapsulation
Wrapping this all up, how does this look? How does each layer work with each other? Starting at the application layer and ending with the physical layer, we need to encapsulate each layer into the next layer. The end result is the frame that gets sent across the wire to the next destination.
- Application, Presentation, Session – Builds the data
- Transport Layer – Adds the Segment Header
- Network Layer – Adds the Packet Header
- Data Link Layer – Adds the Frame Header and Trailer
- The Physical Layer sends those 1’s and 0’s over the wire
Leave a Reply