David Davis explains how the seven layers of the OSI Model can help you as a Cisco administrator. Get a brief overview of the OSI model and learn why it is more than just a textbook concept -- understanding it will help you every day of your career.
What is the OSI model?
The OSI model is a hierarchical model of how different devices, protocols, and applications can interoperate to provide a network. The OSI (open systems interconnect) model was created by the International Standards Organization (ISO).
The applications and protocols that make up the network reside at different layers of the OSI model. Those layers are:
- Layer 7 – Application
- Layer 6 – Presentation
- Layer 5 – Session
- Layer 4 – Transport
- Layer 3 – Network
- Layer 2 – Data Link
- Layer 1 – Physical
- All People Seem To Need Data Processing
- Please Do Not Throw Sausage Pizza Away
- Phew Dead Ninja Turtles Smell Particularly Awful
A common question is, “What application or protocol resides at each of the layers?” Here is a general overview:Layer 7 - Application The application layer is where the protocols and services that make up your application reside. Examples of what is located here are: Telnet, File Transfer Protocol (FTP), and Simple Mail Transfer Protocol (SMTP). Layer 6 - Presentation The presentation layer "presents" the session layer data to the application. Examples of what is located here are: encryption (like IPSec), ASCII, and JPG. Layer 5 - Session This layer is responsible for initiating and terminating network connections. Examples of the session layer are Remote Procedure Call (RPC) functions and the login portion of a SQL session. Layer 4 - Transport TCP and UDP work at the transport layer. TCP provides the reliable, in-order delivery of your data, as well as error correction, sequencing, and windowing (flow control). Additionally, TCP at the transport layer provides source and destination port numbers that are commonly associated with applications. For example, TCP port 25 is SMTP, 23 is telnet, 22 is SSH, 80 is HTTP, and so on. These port numbers are very important if you are configuring an ACL (see my article, "What you need to know about Cisco IOS access-list filtering") or studying for a certification test like the CCNA. Data at the transport layer is called a segment. Layer 3 - Network The network layer is where the "IP" part of "TCP/IP" happens. IP is responsible for addressing in the network. Because IP works at layer 3, you could also say that routing and routers work at layer 3. Any data at layer 3 is called a packet. Layer 2 - Data Link If you think about a WAN, there are many protocols that work at layer 2 (like PPP and Frame-Relay). However, if you just look at the LAN, the most well-known protocol associated with layer 2 is Ethernet. The Ethernet protocol uses MAC addresses to identify unique devices on the network. Any data at layer 2 is called a frame. Ethernet switches work at layer 2 to switch Ethernet packets. To do this, they keep a MAC address table or CAM table -- mapping MAC addresses to switch ports. Layer 1 - Physical The physical layer provides the actual connection between devices. Ethernet cables and fiber optic cables work at layer 1. Data goes through the cables via electricity or light. That data is now represented as a bit (a one or a zero).
How does the OSI model help you on a practical basis?
While most of us know the OSI model, I believe that most of us do not make the very helpful connection between the OSI model and the daily, real-world tasks and troubleshooting that a Cisco admin must perform.
Most of us think of the OSI model as some kind of arcane textbook concept that must be learned for the exam and can then be forgotten. On the contrary, I believe it can be extremely helpful to Cisco admins on a day-to-day basis. Here are four ways the OSI model can help you, as a Cisco admin:
Understanding the network "big picture"
There are many new Cisco admins out there who may understand how to unlock a switch port or how to configure IP addressing, but they don’t see, really, how the network functions. By understanding the OSI model, you can see the "big picture" of how the network really works.
You can understand how bits are sent as electrical signals across copper wires; how those are reassembled into frames by Ethernet in layer 2; how the frames are switched to the right destination; how that PC disassembles the frame and packet to verify that it is the right destination IP; how it breaks up the segment at the transport layer, responds with an acknowledgement (ACK), and sends the data up to the session, presentation, and application layers; and how every tiny communication requires this whole process to happen many times per second.
Configure ACLs for traffic filtering and QoS
By understanding the OSI model you will better be able to configure Cisco IOS ACLs. Those ACLs can them be used to filter traffic or provide for router services on that traffic -– like QoS. By knowing that the transport layer is where TCP is and that port numbers are used to identify applications, you will understand more clearly how to create ACLs that define that traffic. You will also create better ACLs when you keep in mind the different protocols that could be in use at the transport layer. For example, you might want an ACL that defines UDP or ICMP (ICMP actually functions at layer 3, network).
Once you create the proper ACL, you can then take action on that traffic by filtering it or providing QoS for it. (See my articles "Cisco IOS access lists: 10 things you should know" and "What you need to know about Cisco IOS access-list filtering.")
What is also interesting is that BGP works at layer 4 (transport) because it uses TCP; however, OSPF, IGMP, and ICMP all work at layer 3 (network). Also, ARP works between layers 2 and 3 as it maps MAC addresses to IP addresses.
Prepare for certification
Certainly, any entry-level certification will require you to learn about the OSI model and answer some questions about it. For example, the CCENT/CCNA and Network+ certifications all require that you understand the OSI model. I believe that this all comes back again to "knowing the big picture."
Troubleshooting the network
Once you understand the OSI model, you will be a much better network troubleshooter. For example, in my article "Choosing a network troubleshooting methodology," I cover how to use the OSI model to troubleshoot the network either by starting at the top or the bottom or by using the "divide and conquer" approach.
- If your Ethernet cable is disconnected, at what layer is your problem to be found? Answer: layer 1.
- If your ACL is dropping your TCP data, where is the trouble? Answer: layer 4.
- If your IPSec is misconfigured, where is the problem? Answer: layer 4.
By understanding the OSI model, you will be able to do a lot more than pass your certification test. The OSI model may have been designed to help vendors ensure that their network products interoperate with others, but it is here to help Cisco admins, like us, visualize how the network works and troubleshoot it when it doesn’t.
For more information on the OSI model, see Cisco’s Internetworking Technology Handbook.
David Davis has worked in the IT industry for twelve years and holds several certifications, including CCIE, MCSE+I, CISSP, CCNA, CCDA, and CCNP. He currently manages a group of systems/network administrators for a privately owned retail company and performs networking/systems consulting on a part-time basis.
Want to learn more about router and switch management? Automatically sign up for our free Cisco Routers and Switches newsletter, delivered each Friday!