OSI Model – Practical Networking .net (2024)

This article is a part of aserieson Packet Traveling — everything that happens in order to get a packet from here to there. Use the navigation boxes to view the rest of the articles.

Packet Traveling

  • OSI Model
  • Key Players
  • Host to Host Communication
  • Host to Host through a Switch
  • Host to Host through a Router
  • Packet Traveling – Series Finale

The Open Systems Interconnect model (OSI Model) explains all the individual functions that are necessary for the Internet to work.

It is a set of seven independent functions which combine to accomplish the end-goal of Computer to Computer communication.

Much like a car is composed of independent functions which combine to accomplish the end-goal of moving the car forward: A battery powers the electronics, an alternator recharges the battery, an engine rotates a driveshaft, an axle transfers the driveshaft’s rotation to the wheels, and so on and so forth.

Each individual part can be independently replaced or worked on, and as long as each individual part is functioning properly, the car moves forward.

The OSI model is divided into seven different layers, each of which fulfills a very specific function. When combined together, each function contributes to enables full computer to computer data communication.

OSI Model – Practical Networking .net (1)

In the rest of this article, we will look at each of the individual layers of the OSI model and their individual responsibility.

OSI Layer 1 – Physical

The Physical layer of the OSI model is responsible for the transfer of bits — the 1’s and 0’s which make up all computer code.

This layer represents the physical medium which is carrying the traffic between two nodes. An example would be your Ethernet cableor Serial Cable. But don’t get too caught up on the word “Physical” — this layer was named in the 1970s, long before wireless communication in networking was a concept. As such, WiFi, despite it not having a physical, tangible presence, is also considered a Layer 1 protocol.

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” can vary with each medium. In the case of Ethernet, bits are transferred in the form of electric pulses. In the case of Wifi, bits are transferred in the form of radio waves. In the case of Fiber, bits are transferred in the form of pulses of light.

OSI Model – Practical Networking .net (2)

Aside from the physical cable, Repeatersand Hubs also operate at this layer.

A Repeater simply repeats a signal from one mediumto the other, allowing a series of cables to be daisy chained together and increase the range a signal can travel beyond the single cable limit. These are commonly used in large WiFi deployments, where a single WiFi network is “repeated” throughout multiple access-points to cover a larger range.

A Hub is simply a multi-port Repeater. If four devices are connectedto a single Hub, anything sent by one device gets repeated to the other three.

OSI Layer 2 – Data Link

The Data Link layer of the OSI model is responsible for interfacing with the Physical layer. Effectively, Layer 2 is responsible for putting 1’s and 0’s on the wire, and pulling 1’s and 0’s from the wire.

The Network Interface Card (NIC) that you plug your Ethernet wire into handles the Layer 2 functionality. It receives signals from the wire, and transmits signals on to the wire.

Your WiFi NIC works the same way, receiving and transmitting radio waves which are then interpreted as a series of 1’s and 0’s.

Layer 2 will then group together those 1’s and 0’s into chunks known as Frames.

There is an addressing system that exists at Layer 2 known as the Media Access Control address, or MAC address. The MACaddress uniquely identifies each individualNIC. Each NIC is pre-configured with a MACaddress by the manufacturer; in fact, it is sometimes referred to as the Burned In Address (BIA).

OSI Model – Practical Networking .net (3)

Aside from your NIC, a Switch also operates at this layer. A Switch’s primary responsibilityis to facilitate communicationwithinNetworks (this idea will be expanded upon in a later article in this series).

The overarching function ofthe Data Link layeris to deliver packets from one NIC to another. Or to put it another way, the roleof Layer 2 is to deliver packets from hop to hop.

OSI Layer 3 – Network

The Network layer of the OSI model is responsible for packet delivery fromend to end.

It does this by using another addressing scheme that can logically identify every nodeconnected to the Internet. This addressing scheme is known as the Internet Protocol address, or the IP Address.

It is considered logical because an IP address is not a permanent identification of a computer. Unlike the MAC address which is considered a physical address, the IP address is not burned into any computer hardware by the manufacturer.

OSI Model – Practical Networking .net (4)Routers are Network Devices that operate at Layer 3 of the OSI model. A Router’s primary responsibility is to facilitate communication between Networks. As such, a Router creates a boundary between two networks. In order to communicate with any device not directly in your network, a router must be used.

OSI Model – Layer 2 vs. Layer 3

The interaction and distinction between Layer 2 and Layer 3 is crucial to understanding how data flows between two computers. For example, if we already have a unique L2 addressing scheme on every NIC (like MAC addresses), why do we need yet another addressing scheme at L3 (like IP addresses)? Or vice versa?

The answer is that both addressing schemes accomplish different functions:

  • Layer 2 uses MAC addresses and is responsible for packet delivery from hop to hop.
  • Layer 3 uses IP addressesand is responsible for packet delivery from end to end.

When a computerhas data to send, it encapsulates it in aIP header which will include information like the Sourceand Destination IP addresses of the two “ends” of the communication.

The IP Header and Data arethen further encapsulated in a MAC address header, which will include information like the Source and Destination MAC address of the current “hop” in the path towards the final destination.

Here is an illustration to drive this point home:

Notice between each Router, the MAC address header is stripped and regeneratedto get it to the next hop. The IP header generated by the first computeris only stripped off by the final computer, hence the IP header handled the “end to end” delivery, and each of the fourdifferent MAC headers involved in this animation handled the “hop to hop” delivery.

OSI Layer 4 – Transport

The Transport layer of the OSI model is responsible for distinguishing network streams.

At any given time on a user’s computer there might be an Internet browser open, while music is being streamed, while a messenger or chat appis running. Each of these applications are sending and receiving data from the Internet, andall that data is arriving in the form of 1’s and 0’s on to that computer’s NIC.

Something has to exist in order to distinguish which 1’s and 0’s belong to the messenger or the browser or the streaming music.That “something” is Layer 4:

OSI Model – Practical Networking .net (6)

Layer 4 accomplishes this by using anaddressing scheme known as Port Numbers.

Specifically, two methods of distinguishing network streams exist. They are known as the Transmission Control Protocol (TCP), or the User Datagram Protocol (UDP).

Both TCP and UDP have65,536 port numbers (each), and a unique application stream is identified by both a Source and Destination port (in combination with their Source and Destination IP address).

TCP and UDP employ different strategies in how data streams are transferred, and their distinction and inner workings are both fascinating and significant, but unfortunately they are outside the scope of this article series. They will be the topic of a future article or series.

To summarize, if Layer 2 is responsible forhop to hop delivery, and Layer 3 is responsible for end to end delivery, it can be said that Layer 4 is responsible for service to service delivery.

OSI Layer 5, 6, and 7

The Session, Presentation, and Application layers of the OSI model handle the finalsteps before the data transferred through the network (facilitated by layers 1-4) is displayed to the end user.

From a purely Network Engineering perspective, the distinction between Layers 5, 6, and 7 isnot particularly significant. In fact, there is another popular Internet communication model known as the TCP/IP model, which groups these three layers into onesingle encompassing layer.

The distinction would become more significant if you were involved in Software Engineering. But as this is not the focus of this article series, we will not dive deep into the differences between these layers.

Many network engineers simply refer to these layers asL5-7 or L5+ or L7. For the remainder of this series, we will do the same.

Encapsulation and Decapsulation

The last item we need to discuss before we move on from the OSI Model is that of Encapsulation and Decapsulation. These terms refer to how data is moved through the layers from top to bottom when sending and from bottom to top when receiving.

As the data is handed from layer to layer, each layer adds the information it requires to accomplish its goal before the complete datagram is converted to 1s and 0s and sent across the wire. For example:

  • Layer 4 will add a TCP header which would include a Source and Destination port
  • Layer 3 will add an IP header which would include a Source and Destination IP address
  • Layer 2 would add an Ethernet header which would include a Source and Destination MAC address

On the receiving end, each layer strips the header from the data and passes it back up the stack towards theApplication layers. Here is the whole process in action:

Note that this is only an example. The header that will be added will be dependent on the underlying communication protocol. For instance, a UDP header might be added at Layer 4 instead, or an IPv6 header might be added at Layer 3.

Either way, it is important to understand that as data is sent across the wire, it gets passed down the stack and each layer adds its own header to help it accomplish its goal. On the receiving end, the headers get stripped off one at a time, layer by layer, as the data is sent back up to the Application layer.

This article categorizes different network functions into different layers of the OSI model. While essential for understanding how packets move through a network, the OSI model itself is not a strict requirement as much as it is a conceptual model — not every protocol will fit perfectly within a single layer of the OSI model.

Series Navigation

Key Players >>

Related Posts:
Address Resolution Protocol (ARP)
Packet Traveling
The Truth about the OSI Model
Packet Traveling - Series Finale
OSI Model – Practical Networking .net (2024)
Top Articles
Latest Posts
Article information

Author: Errol Quitzon

Last Updated:

Views: 6459

Rating: 4.9 / 5 (59 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Errol Quitzon

Birthday: 1993-04-02

Address: 70604 Haley Lane, Port Weldonside, TN 99233-0942

Phone: +9665282866296

Job: Product Retail Agent

Hobby: Computer programming, Horseback riding, Hooping, Dance, Ice skating, Backpacking, Rafting

Introduction: My name is Errol Quitzon, I am a fair, cute, fancy, clean, attractive, sparkling, kind person who loves writing and wants to share my knowledge and understanding with you.