Minggu, 13 Oktober 2024

Encapsulation and Decapsulation

The final item we need to discuss before we move on from the OSI Model is Encapsulation and Decapsulation. These terms refer to how data is moved through the layers from top to bottom when sending and from bottom to top when receiving.

As data is passed from layer to layer, each layer adds the information it needs to achieve its goal before the complete datagram is converted into 1s and 0s and sent over the wire. As an example:

  • Layer 4 will add a TCP header which will include the Source and Destination ports
  • Layer 3 will add an IP header which will include the Source and Destination IP addresses
  • Layer 2 will add an Ethernet header that will include the Source and Destination MAC addresses
  • On the receiving side, each layer removes the header from the data and passes it back up the stack to the Application layer.

Note that this is just an example. The headers to be added will depend on the underlying communication protocol. For example, a UDP header might be added at Layer 4, or an IPv6 header might be added at Layer 3.

Aside from that, it's important to understand that when data is sent over the wire, it gets passed down the stack and each layer adds its own header to help it reach its destination. On the receiving end, the headers are stripped one by one, layer by layer, as the data is sent back to the Application layer.

This article categorizes various network functions into various layers of the OSI model. While it is important to understand how packets move through a network, the OSI model itself is not a strict requirement as much as it is a conceptual model - not every protocol will fit perfectly within one layer of the OSI model.

Tidak ada komentar:

Posting Komentar