The TCP/IP stack is a layered framework for organizing data transmitted through the networks.

1_g1GzSjM5-J3aN2wjVz6qKA.png

Application

The first level of the stack handles high-level protocols that define how data should be formatted, processed, and transmitted. It is called the Application layer.

Protocols:

Transport

The transport layer exchange data receipt acknowledgments and retransmit missing packets to ensure that packets arrive in order and without error.

Protocols:

Network

Protocols:

The network layer or internet layer, ****is responsible for logical addressing of IP addresses and routing packets from router to router.

Protocols:

Link

The link layer handles the physical transmission of data. It deals with how data is sent and received over the network hardware (e.g., Ethernet, Wi-Fi).

Protocols:

Encapsulation is the process of data going down the stack, from Application to Link Layer.

Decapsulation is the process of data going up the stack, from Link to Application Layer.

How the TCP/IP Stack Works

  1. Application Layer: An application (a web browser) generates data, such as an HTTP request.
  2. Transport Layer: The data is passed to the Transport Layer, which (using TCP, for instance) breaks it into packets, adds sequence numbers, and ensures reliability.
  3. Internet Layer: The packets are handed to the Internet Layer, which adds the source and destination IP addresses and routes them across networks.
  4. Link Layer: The data is sent over the physical network (wired or wireless) using the Link Layer, which adds MAC addresses and ensures that the data reaches the correct device on the local network.

<aside> 💡

Packets are smaller segments of the larger segment.

</aside>