Introduction to libp2p | Lesson 4 of 6

libp2p in the OSI Model

So where does libp2p fit into the current web? The web is built on a complex system of networking protocols, some of which are familiar to end users, like HTTP and ethernet, and some of which are only familiar to networking specialists.

Usually, we look at the OSI Model (Open Systems Interconnection Model) to understand which layer a protocol tries to tackle.

But the truth is, the OSI Model as well as the TCP/IP Model are just conceptual models. The actual implementations in the current web do not follow these models exactly, and are much less tidy, e.g. the TCP/IP Protocol Suite shown above.

In the end, these models have some shortcomings:

  • Actions are repeated through multiple layers (repeated work) because data can go through authentication multiple times or discovery multiple times; it's very inefficient!
  • Information is hidden between layers, missing significant improvement opportunities, and some protocols have been created with these opportunities in mind by trying to put together as many layers as possible into a single protocol module, such as the QUIC protocol.

libp2p set out to do something different when it became apparent that following these rigid conceptual models was not ideal - others were already breaking them. By allowing users to select and configure just the pieces of a network stack that they need, libp2p has created a new way to maintain and upgrade applications with a secure, reliable, and modular network stack.

Take the quiz!

Where does libp2p fit into the OSI Model?

Oops, you haven't selected the right answer yet!