Keywords: encapsulation, decapsulation
When a computer sends a request to another computer (e.g., requesting a web page via HTTP), the data flows through the network stack by undergoing encapsulation and decapsulation processes across the TCP/IP layers.
Encapsulation
Encapsulation is the process in which each lower layer wraps the data from the upper layer with its own header (and sometimes trailer). This prepares the data for transmission over the network.
The process happens as follows:
- At the Application Layer, the original data (e.g., an HTTP request) is generated.
- At the Transport Layer, the data becomes a segment (TCP) or a datagram (UDP) by adding a transport-layer header.
- At the Internet Layer, an IP header is added, and the data becomes a packet.
- At the Link Layer, a frame header and trailer are added, forming a frame that is transmitted over the physical medium (e.g., Ethernet, Wi-Fi).
Decapsulation
Decapsulation is the reverse process that occurs at the receiving end. As the data moves up the stack, each layer removes its corresponding header/trailer and passes the remaining payload to the upper layer.
- The Link Layer receives the frame and removes the frame header and trailer.
- The Internet Layer receives the resulting packet and removes the IP header.
- The Transport Layer processes the segment/datagram, verifies it, and removes the transport header.
- Finally, the Application Layer receives the actual message (the Protocol Data Unit of this layer).
The final output is delivered to the user or application that initiated the request.
Importance of Header Information
During decapsulation, if a header does not contain protocol information, the receiving system cannot determine which upper-layer protocol should process the payload.
- For example, at the Internet Layer (Layer 3), the header must include the protocol type (e.g., TCP or UDP) so that the packet can be passed to the correct Transport Layer (Layer 4).
- Similarly, the Transport Layer header must indicate which Application Layer protocol (e.g., HTTP, DNS) should handle the segment.
To prevent misrouting, the encapsulation process must always include protocol identifiers in the headers.
'Computer Science > Network' 카테고리의 다른 글
Load Balancer (0) | 2025.07.25 |
---|---|
PDU (0) | 2025.07.25 |
TCP/IP 4-layer model (0) | 2025.07.19 |
Network Bottleneck (0) | 2025.07.19 |
Throughput (0) | 2025.07.17 |