The Open Systems Interconnection Model (OSI model) explains all the independent functions needed to work on the Internet.
It is composed of 7 independent functions, realizing the ultimate goal of computer to computer communication.
Just as a car is made up of individual functions that combine to achieve the ultimate goal of driving the car forward: the battery powers the electronics, the generator charges the battery, the engine turns the spindle, the shaft transfers the spindle’s rotation to the wheels, and so on.
Each individual part can be replaced or operated independently, and as long as each individual part works properly, the car can move forward.
The OSI model is divided into seven distinct layers, each of which performs a very specific function. When combined, each feature contributes to complete computer-to-computer data communication.
In the remainder of this article, we’ll look at each individual layer of the OSI model and their respective responsibilities.
OSI Layer 1 – Physical layer
The physical layer of the OSI model is responsible for the transmission of bits — the ones and zeros that make up all computer code.
This layer represents the physical medium that carries the traffic between the two nodes. An example is your Ethernet cable or serial cable. But don’t worry too much about the word “physical” — this layer was named in the 1970s, long before the concept of wireless communication in networks. Thus, WiFi is considered a Tier 1 protocol even though it has no physical, physical presence.
Simply put, layer 1 is anything that carries 1’s and 0’s between two nodes.
The actual format of the data on the “wire” may vary for each medium. In the case of Ethernet, the bits are transmitted as electrical pulses. In the case of WiFi, bits are transmitted as radio waves. In the case of optical fibers, bits are transmitted as pulses of light.
In addition to physical cables, Repeaters and hubs also operate on this layer.
Repeaters simply forward signals from one medium to another, allowing a series of cables to be connected in series and increasing the range of signals that can be transmitted beyond the limits of a single cable. These are typically used for large WiFi deployments, where a single WiFi network is “repeated” in multiple access points to cover a larger area.
A Hub is just a multiport repeater. If four devices are connected to a hub, any information sent by one device is repeated to the other three devices.
OSI Layer 2 – data link layer
The DATA link layer of the OSI model interfaces with the physical layer. In fact, L2 is responsible for putting the ones and zeros on the cable and pulling them out of the cable.
Network interface card (NIC) of an Ethernet cable Handle L2. It receives signals from the cable and transmits them to the cable.
Your WiFi card works in the same way, receiving and transmitting radio waves and then interpreting them as a series of ones and zeros.
L2 calls these blocks of 1s and 0s frames.
L2** There is an addressing system called a media access control address or MAC address.A MAC address uniquely identifies each individual NIC **. Each NIC is preconfigured with a MAC address by the manufacturer; In fact, it is sometimes called Burned In Address (BIA).
In addition to network adapters (nics), switches also run on this layer. The primary responsibility of a Switch is to facilitate communication within a network (a concept that will be elaborated further in a later article in this series).
The primary function of the data link layer is to transfer packets from one network card to another. Or to put it another way, L2 is used to move packets from one hop to another.
OSI Layer 3 – network layer
The network layer of the OSI model is responsible for end-to-end packet transmission.
It does this by using another addressing scheme that logically identifies every node connected to the Internet. This addressing scheme is called the Internet Protocol address or IP address.
It is considered logical because an IP address is not a permanent identification of a computer. Unlike MAC addresses, which are considered physical addresses, IP addresses are not burned into any computer hardware by the manufacturer.
A router is a network device running on OSI model L3. The main responsibility of a router is to facilitate communication between networks. Therefore, the router creates a boundary between the two networks. In order to communicate with any device not on your network, you must use a router.
OSI model – Data link layer vs. network layer
The interactions and differences between L2 and L3 layers are critical to understanding how data flows between the two computers. For example, if we already have a unique L2 addressing scheme (such as MAC addresses) on each network adapter (NIC), why do we need another L3 addressing scheme (such as IP addresses)? And vice versa?
The answer is that the two addressing schemes implement different functions:
- Layer L2 uses MAC addresses and is responsible for passing packets from one hop to another.
- Layer L3 uses IP addresses and is responsible for end-to-end packet transfer.
When a computer has data to send, it encapsulates it in an IP packet header, which contains information such as the source and destination IP addresses of both ends of the communication.
The IP header and data are then further encapsulated in the MAC address header, which includes information such as the source and destination MAC addresses of the current “hop” on the path to the final destination.
Here’s an illustration that illustrates the point:
Note that between each router, the MAC address header is stripped and regenerated to reach the next hop. The first computer-generated IP header was stripped only by the final computer, so the IP header handles “end-to-end” delivery, whereas each of the four different MAC headers involved in the animation handles “skip” delivery.
OSI layer 4 – transport layer
The TRANSPORT layer of the OSI model is responsible for distinguishing network streams.
At any given time on a user’s computer, an Internet browser may be open, streaming music may be playing, and the Messenger chat app may be running. Each of these applications sends and receives data from the Internet, all of which arrives at the computer’s network card (NIC) in the form of 1s and 0s.
Something must exist to tell which ones and zeros belong to Messenger, browser, or streaming music. That “thing” is level 4: L4 does this by using an addressing scheme called port numbers.
Specifically, there are two ways to distinguish network flows. They are called transmission Control Protocol (TCP) or User Datagram Protocol (UDP).
TCP and UDP each have 65,536 port numbers, and unique application flows are identified by source and destination ports (along with their source and destination IP addresses).
TCP and UDP have different strategies for how data flows are transmitted, and their differences and inner workings are interesting and important, but unfortunately beyond the scope of this series of articles. They will be the subject of future articles or series.
In summary, if L2 is responsible for skip delivery and L3 for end-to-end delivery, then L4 can be said to be responsible for service-to-service delivery.
OSI layers 5, 6 and 7
The OSI model’s session, presentation, and application layers (facilitated by layers 1-4) are the final processing steps before the data transmitted over the network is displayed to the end user.
From a pure network engineering perspective, the differences between layers 5, 6, and 7 are not particularly obvious. In fact, there is another popular Internet communication model, called the TCP/IP model, which combines these three layers into one.
This distinction becomes even more important if you are involved in software engineering. But that’s not the focus of this series, and we won’t delve into the differences between these layers.
Many network engineers simply refer to these layers as L5-7 or L5+ or L7. We’ll do the same for the rest of this series.
Encapsulation and unencapsulation
The last item we need to discuss before we move on to the OSI model is encapsulation and unencapsulation. These terms refer to how data is moved from top to bottom when sent and from bottom to top when received.
As data is passed from one layer to another for processing, each layer adds the information needed to accomplish its goals before the complete datagrams are converted to ones and zeros and sent over the cable. Such as:
- L4 adds a TCP header that includes the source and destination ports
- L3 adds an IP packet header that contains the source IP address and destination IP address
- L2 will add an Ethernet header that includes the source and destination MAC addresses
At the receiving end, each layer strips the header from the data and passes it up the stack to the application layer. Here’s how it works:
Please note that this is just an example. The headers to be added will depend on the underlying communication protocol. For example, UDP headers might be added to L4, or IPv6 headers might be added to L3.
Either way, it’s important to understand that as data is sent over the cable, it passes down the stack, and each layer adds its own header to help it achieve its goal. At the receiving end, when data is sent back to the application layer, the packet header is stripped layer by layer.
This paper classifies different network functions into different layers of the OSI model. While crucial to understanding how packets move around the network, the OSI model is not a strict requirement in itself, but rather a conceptual model — not every protocol fits perfectly into a single layer of the OSI model.
Translation of the OSI Model