Same layer and adjacent layer interactions

Lesson

When we look at data in a network we can look ‘horizontally’ at a single layer in the network stack or ‘vertically’ as data moves up and down the stack between adjacent layers.

Same Layer Interaction

Same layer interaction is when we look at communication between two devices using a single protocol at a single layer. It allows us to abstract away higher and lower layers to focus on the services provided by the given layer.

For example we might look at same-layer interaction between a web browser and a web server at the application layer, ignoring how the lower layers are transporting the data. Another example is looking at the route an IP packet takes across a network – addresses and routing – without needing to know what physical media is used or what application layer protocol is being transported.

Adjacent Layer Interaction

On a given network device, it will likely provide some form of network stack. On a switch this could just support the Link Layer, on a router it could be the Link Layer and the Internet Layer or on a computer you would support all layers of the TCP/IP network stack. Each layer provides a service to the layer above it. For example at the transport layer, TCP provides error recover. Adjacent-layer interaction is the passing of data between adjacent layers in the network stack.

Encapsulation

As data is passed to a lower adjacent layer, that layer will add its own header (and possibly also a trailer) before passing it to the layer below. This process of wrapping up higher layer data in a header and/or trailer is called encapsulation. The higher layer data being encapsulated is often referred to as the payload or 'client data'.

When the data is passed back up the stack, each layer pops off its respective header / trailer – this is called decapsulation or de-encapsulation.

Protocol Data Units

At each layer, we refer to the combination of header/trailer and the data being encapsulated as a Protocol Data Unit (PDU).

In TCP/IP, each layer has specific terminology for a PDU:


Questions

Test your knowledge with these questions.

Adjacent layer interaction occurs as data moves up or down the networking stack of a device. Each layer provides services to the layer above. For example when a web server uses the destination TCP port to pass the payload to an appropriate application.

Same layer interaction occurs when peers communicate at the same layer, using the same protocol. For example a web browser making an HTTP request and a web server replying with an HTTP response.

Encapsulation is the addition of a header, and possibly also a trailer, to data received from the layer above.

De-encapsulation, or decapsulation, is the removal of a layer’s corresponding header (and trailer if present) as data is passed up the networking stack to the layer above.

Segment is the term for a PDU at the transport layer.

Packet is the term for a PDU at the network / internet layer.

Frame is the term for a PDU at the link layer.

Adjacent layer interaction.

Segment

Encapsulation

Decapsulation or de-encapsulation.

Other Lessons

Learn more by checking out these related lessons

Ethernet at the Data-Link Layer

lesson

View

Summary of the TCP/IP Model

lesson

View

TCP: The Transmission Control Protocol

lesson

View

UDP: User Datagram Protocol

lesson

View

Courses

This lesson is part of the following courses.

Computer Networking Foundations

course

View