OSI reference model (data flow)

OSI reference model (data flow)

Each communication layer communicates peer-to-peer with the same layer using layer-specific PDUs.

PDU (Protocol Data Unit) is the unit of data handled by each layer.

The flow of data communication in the OSI reference model is shown in the figure below.

OSI Data Flow

The data on the source PC is

Application Layer → Presentation Layer → Session Layer → Transport Layer → Network Layer → Data Link Layer → Physical Layer

And the data is passed from the upper layer to the lower layer.

At the final physical layer, it is encoded into a bit pattern of ‘0’ and ‘1’ and flows as an electrical signal on the cable.

And when it reaches the destination PC, from now on,

Physical Layer → Data Link Layer → Network Layer → Transport Layer → Session Layer → Presentation Layer → Application Layer

Data is passed from the lower layer to the upper layer.

When passing data from the upper layer to the lower layer, control information called “header” is added and passed.

PDUs

For example, assume TCP/IP is used as the communication protocol.

 When the data comes down to the transport layer, it adds information such as port number, sequence number, acknowledgment number, etc. and passes it to the network layer.

Port number: A number that identifies an application. 20 and 21 for FTP, 80 for WWW.
Sequence number: A number that indicates the sequence of the segment.

In the network layer, information such as the source IP address and destination IP address is added and passed to the data link layer.

The data link layer adds information such as the MAC address and passes it to the physical layer.

The physical layer encodes it into a bit pattern of ‘0’ and ‘1’ suitable for media transmission.

The PDUs handled by each layer have names, as shown in the table below.

layerPDU name
application layer
presentation layer
session layer
data
transport layersegment
network layerpacket
data link layerflame
physical layerbit

data encapsulation

The data to be sent is

Application Layer → Presentation Layer → Session Layer → Transport Layer → Network Layer → Data Link Layer → Physical Layer

And the data is passed from the upper layer to the lower layer.

Encapsulation

When data is passed from the upper layer to the lower layer, control information called “header” is added and passed.

For example, assume TCP/IP is used as the communication protocol.

 When the data comes down to the transport layer, it adds information such as port number, sequence number, acknowledgment number, etc. and passes it to the network layer.

In the network layer, information such as the source IP address and destination IP address is added and passed to the data link layer.

 In addition to information such as the MAC address, the data link layer also adds information called a trailer to check for errors that occur during transmission and passes it to the physical layer.

The physical layer encodes it into a bit pattern of ‘0’ and ‘1’ suitable for media transmission.

Adding control information in each layer in this way is called “encapsulation”.

Data decapsulation

And when it reaches the destination PC, from now on,

Physical Layer → Data Link Layer → Network Layer → Transport Layer → Session Layer → Presentation Layer → Application Layer

Data is passed from the lower layer to the upper layer.

Data decapsulation

 The ‘0’s and ‘1’s received at the physical layer are passed to the data link layer into frames, stripped of the frame header and frame trailer, and passed to the network layer.

The network layer strips off the network header and passes it to the transport layer.

Below, each layer removes the control information handled by each layer and passes it to the upper layer.

Removing the control information handled by each layer in this way is called “decapsulation.”

Hierarchical structure of headers

The data to be sent is

Application Layer → Presentation Layer → Session Layer → Transport Layer → Network Layer → Data Link Layer → Physical Layer

When passing data from the upper layer to the lower layer, control information called “header” is added and passed.

Encapsulation

When passing data from the upper layer to the lower layer, control information called “header” is added and passed.

 The contents described in the header include, for example, “sender’s address”, “destination’s address”, and “what to do if the parcel does not arrive”.

The device that receives the data looks at the content of this header and processes it according to the protocol processing.

 Each layer protocol basically encapsulates the original header and data together without destroying or rewriting the received header, adds its own header, and passes it down to the layer below.