What are Layered Architectures & Protocol Stacks

Introduction to Layered Architectures

An approach to organizing computer networks is via layered architectures.

Layered architectures are advantageous to address the topic at progressively higher levels of abstraction while developing a big, complicated system. As a result, systems may be made up of layers, each of which completes a particular set of duties.

Layered architectures enable us to discuss certain, clearly defined components of bigger systems, which provides modularity. This facilitates modifying implementation-level specifics and finding issues.

Let’s take an Analogy of the Postal System

Before delving into the various network layer stack models, let’s have a look at an intriguing analogy.

An Analogy of Posting Letter
  • The written letter is placed in an envelope, sealed, and placed in a mailbox for the mailman to collect.
  • The letter is picked up by the mailman and delivered to the post office for shipping.
  • The letter is sorted and sent by the neighborhood post office.
  • The mail is transported to the recipient’s neighborhood post office by vehicles, such as a bus, ship, or airplane. It’s possible that this is a chain of transportation methods.
  • On the recipient’s end, the letter is obtained at the neighborhood post office.
  • A mailman delivers the letter from the post office to the recipient’s address.
  • Reading the letter

There are certain things here that are parallel to computer networking, as you’ll see. Here are a few instances when it is the case.

Layers As Services To One Another: Vertical Layers

Each layer helps the one above it in some way. In addition, the layer above is not worried about the specifics of how the layer below provides its services. The term for this is an abstraction. The layers are able to interact vertically with one another in this manner.

Vertical Layers in Postal System

Each layer in our example of the postal system is responsible for the one above it. The mailman, for instance, offers services to both senders and recipients. They deliver mail to homes and collect dropped letters from mailboxes.

Furthermore, the sender’s only concern is that their mail will finally reach the recipient after being written, placed in an envelope, stamped, and dropped through a letterbox. It is meaningless and unimportant to senders whether it is conveyed by air, railroad trains, or pick-up trucks. Thus, layer 4’s performance is unrelated to the layers above it, which is what is meant by abstraction.

Vertical Layers in Networks

Computer networks are also conceptually organized into layers, each of which provides services to the layers above and below it.

For instance, the application layer is the top layer in the majority of layered models. End-user applications are nearly generally implemented in software and reside at the application layer, which also includes the web and email. Additionally, an outgoing message begins its trip at the application layer.

The underlying layer assists the application layer by receiving messages from the higher layer for delivery to the destination and delivering messages intended for the top layer. Additionally, since the application layer abstracts, it is unconcerned with the implementation specifics of the layers below.

Layers Talk to Each Other Through Their Parallels, It Has Horizontal Layers

Remember that the receiving end has a counterpart for every layer at the sending end.

Horizontal Layers in Postal System

The letter writer and recipient seem to be in constant contact when using the postal system as an illustration. Unaware of the labor-intensive work done at the lower tiers, the writer writes as the reader reads. The post office next to the sender is also in contact with another post office.

They assist in delivering the letter. There could be many hops at the base layer. For instance, letters from a box are picked up by a bicycle and delivered to the post office. The letters are then packaged and sent to an airport by a pickup truck.

The postage is flown by the airport to a separate airport. A pickup vehicle transports the postage from the airport to a post office, and delivery then takes place. Although there may be many horizontally, we only ever perceive the sender and the recipient.

Horizontal Layers in Networks

When it comes to computer networks, this makes more sense. Applications running at the application layer, for instance, transmit and receive data from the network.

A chat application on one end system may be in communication with a chat app on another end system thanks to the parallel application layer on each end system. There seems to be direct or horizontal communication between these programs at the application layer. The layer underneath them is unknown to them.

Horizontal Layers in Networks

Layers Develop Separately

In this approach, any lower layer offers certain services on top of which the higher layer might base additional services.

The top layer may develop to provide many services, such as moving from text-based email to attachments, the internet, dynamic websites, interactive games, interactive video conferencing, and more, all taking place in the top layer over the same infrastructure.

Independent Evolution in Postal System

  • The material sent, for instance, may not always be a letter; it might alternatively be a package.
  • It may be placed in a box or an envelope.
  • It may be picked up, delivered to the post office, or placed in a drop box.
  • The recipient end might be a house, an office, or a post office box.

Independent Evolution in Networks

Whether it’s an mp3 file or a word document, the apps under the application layer may transmit and receive nearly any kind of data.

Encapsulation & Decapsulation

To the message originating from above, each layer adds its own header, which is then removed by the entity receiving the message on the other end. Each header contains information that is necessary for passing the message to the layer above.

Encapsulating and decapsulating the header are two different concepts. Check out the illustration below to understand how this works.

Since we haven’t yet presented these levels, we haven’t given them names, but the basic concept is shown.

Encapsulation and decapsulation

Gaurav Karwayun is the founder and editor in chief of CodeIntelligent. He has over 10+ Years of Experience in the software industry. He has experience working in both service and product-based companies. He has vast experience in all popular programming languages, DevOps, Cloud Computing, etc. Follow him on Twitter.

Leave a Comment