Skip to main content

An Introduction to Networking and where P4 fits in

·3 mins

NOTE: This is a draft post. It’s been uploaded here for a review by RH.

Networking is an age-old subject. One that people just assume works, and that’s not an incorrect take to have. This is because networking has a standard protocol to follow that does not change and has been battle-tested over the generations. From ARPANET to the current day 5G networks. It’s been quite the number of innovations, one on top of the other.

However, despite all the progress, the fundamentals of networking have seldom changed and still do (in most parts) follow the OSI Model. The OSI reference model consists of 7 layers of protocols and was made to ensure that the computers developed have a common basis for communication.

 OSI Networking Model

The seven layers of the OSI model are as follows,

  • Layer 1: Physical layer
  • Layer 2: Data link layer
  • Layer 3: Network layer
  • Layer 4: Transport layer
  • Layer 5: Session layer
  • Layer 6: Presentation layer
  • Layer 7: Application layer

It’s good to be aware of some networking terminology. Such as if one says “L2/L3”. They are referring to the layers of the OSI model and at which networking layer an individual works on. In the case of L2/L3, we’re pointing at Layer 2, the Data Link Layer and Layer 3, the Network Layer.

The UNIX implementation of the OSI model system is widely adopted and utilized across the computers of today. In it, we club some of the layers together to make a layered model with the following layers:

  1. Application Layer (ftp, http, etc protocols)
  2. Host-to-host Transport Layer (udp, tcp)
  3. Internet Layer (IP and routing)
  4. Network Access Layer (Ethernet, wifi, etc)

Finally, when we get around to the actual encapsulation of the data across these layers, we have a structure that looks like this.

 Data Encapsulation

It may look complex, but it’s exactly what we’ve discussed so far. Let’s compare the both.

 UNIX Data Encapsulation for Networking

And such is the basics of networking. Each layer has been constructed in such a way that when the data is wrapped in one layer in computer A, it can only be unwrapped by the same layer in computer B. Furthermore, each layer has its own methods and functions which we won’t be covering here.

However, if you are interested, it helps to take a look at UNIX Network Programming by W. Richard Stevens, if you wish to have a more comprehensive view of the layers.

Now, where does P4 fit in? #

P4 is a technology that deals with the L2/L3 layer in the OSI Model. To provide some background, we’ll discuss the functioning of the traditional L2/L3 processing architecture before delving into P4.