The process of sending and receiving data between layers

2025. 7. 21. 21:49·Computer Science/Network

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:

  1. At the Application Layer, the original data (e.g., an HTTP request) is generated.
  2. At the Transport Layer, the data becomes a segment (TCP) or a datagram (UDP) by adding a transport-layer header.
  3. At the Internet Layer, an IP header is added, and the data becomes a packet.
  4. 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.

  1. The Link Layer receives the frame and removes the frame header and trailer.
  2. The Internet Layer receives the resulting packet and removes the IP header.
  3. The Transport Layer processes the segment/datagram, verifies it, and removes the transport header.
  4. 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
'Computer Science/Network' 카테고리의 다른 글
  • Load Balancer
  • PDU
  • TCP/IP 4-layer model
  • Network Bottleneck
JTB
JTB
웹/앱 개발 정보를 공유하고 있습니다.
  • JTB
    JTechBlog
    JTB
  • 전체
    오늘
    어제
    • All About Programming;) N
      • Computer Science
        • Terminology and Concepts
        • Network
        • Operating System
        • Database
        • Data Structure
      • Frontend
        • Javascript Essentials
        • Perfomance Optimization
        • JS Patterns
        • Next.js
        • Flutter
      • Backend
        • Node.js
      • DevOps
        • Docker & Kubernetes
      • Coding Test N
        • LeetCode N
        • Programmers
      • Tech Books & Lectures
        • Javascript_Modern JS Deep d..
        • Network_IT 엔지니어를 위한 네트워크 입문
      • Projects
        • PolyLingo_2025
        • Build Your Body_2024
        • JStargram_2021
        • Covid19 Tracker_2021
        • JPortfolio_2021
      • BootCamp_Codestates
        • TIL
        • TILookCloser
        • Pre Tech Blog
        • IM Tech Blog
        • Daily Issues and DeBugging
        • First Project
        • Final Project
        • Sprint Review
        • Good to Know
        • Socrative Review
        • HTML & CSS
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

    • 글쓰기
    • 관리
  • 공지사항

  • 인기 글

  • 태그

    How memory manage data
    Threads and Multithreading
    Network
    js pattern
    커리어
    testing
    Operating System
    polylingo
    Binary Tree BFS
    딥다이브
    Time complexity and Space complexity
    need a database
    스코프
    structure of os
    mobile app
    leetcode
    자바스크립트 딥다이브
    Data Structure
    JavaScript
    indie hacker
    프론트엔드 성능 최적화 가이드
    DOM
    이벤트
    VoiceJournal
    Shared resources
    모던 자바스크립트 Deep Dive
    database
    CPU scheduling algorithm
    TCP/IP
    자바스크립트
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.5
JTB
The process of sending and receiving data between layers
상단으로

티스토리툴바