{{short description|Communication protocol design method}} {{other uses|Encapsulation (disambiguation)}} [[File:UDP encapsulation.svg|thumb|right|upright=1.9|Encapsulation of user data in the Unix-style UDP stack, in which each new layer includes the data from the previous layer, but without being able to <code>identify</code> which part of the data is the header or trailer from the previous layer. This effectively hides (encapsulates) the information from lower layers.<ref>{{cite book|last1=Forouzan|first1=Behrouz A.|title=TCP/IP protocol suite|date=2010|publisher=McGraw-Hill Higher Educations|location=Boston|isbn=978-0073376042|page=23|edition=4th}}<!--|access-date=23 July 2015--></ref>]]

<!-- paragraph specifying the definitions/uses of the main terms --> '''Encapsulation''' is the computer-networking process of concatenating layer-specific headers or trailers with a service data unit (i.e. a payload) for transmitting information over computer networks.<ref name="Conrad et al. (2012)">{{cite book |author1=Eric Conrad |author2=Seth Misenar |author3=Joshua Feldman |title=CISSP Study Guide |date=2012 |publisher=Elsevier |isbn=978-1-59749-961-3 |pages=63–142 |edition=2nd |url=https://www.sciencedirect.com/book/9781597499613/cissp-study-guide |chapter=Domain 2: Telecommunications and Network Security}}</ref><ref name="Odom et al. (2013)">{{cite book|last1=Odom|first1=Wendell|title=Cisco CCENT/ CCNA ICND1 100-101 Official Cert Guide|date=2013|publisher=Pearson Education|isbn=978-1-58714-385-4}}</ref><ref name="Conrad et al. (2023)">{{cite book |vauthors=Conrad E, Misenar S, Feldman J |title=CISSP Study Guide |date=2023 |publisher=Elsevier |edition=4th |isbn=978-0443187353}}</ref> '''Deencapsulation''' (or '''de-encapsulation''') is the reverse computer-networking process for receiving information; it removes from the protocol data unit (PDU) a previously concatenated header or trailer that an underlying communications layer transmitted.<ref name="Odom et al. (2013)"/><ref name="Salva-Garcia et al. (2018)">{{cite journal |vauthors=Salva-Garcia, Alcaraz-Calero, Wang, Qi, Bernabe, Skarmeta |date=2018 |title=5G NB-IoT: efficient network traffic filtering for multitenant IoT cellular networks |journal=Security and Communication Networks |volume=2018 |pages=1–21 |doi=10.1155/2018/9291506 |doi-access=free }}</ref><ref name="Conrad et al. (2023)"/>

<!-- paragraph specifying the main purpose and examples of applications --> Encapsulation and deencapsulation allow the design of modular communication protocols so to logically separate the function of each communications layer, and abstract the structure of the communicated information over the other communications layers.<ref name="Conrad et al. (2012)"/><ref name="Conrad et al. (2023)"/> These two processes are common features of the computer-networking models and protocol suites, like in the OSI model and internet protocol suite.<ref name="Odom et al. (2013)"/> However, encapsulation/deencapsulation processes can also serve as malicious features like in the tunneling protocols.<ref name="dnstunneling">Raman, D., Sutter, B. D., Coppens, B., Volckaert, S., Bosschere, K. D., Danhieux, P., & Buggenhout, E. V. (2012, November). DNS tunneling for network penetration. In International Conference on Information Security and Cryptology (pp. 65-77). Springer, Berlin, Heidelberg.</ref>

The physical layer is responsible for physical transmission of the data, link encapsulation allows local area networking, IP provides global addressing of individual computers, and TCP selects the process or application (i.e., the TCP or UDP port) that specifies the service such as a Web or TFTP server.<ref name="tcpip-encapsulation">{{cite web |url = http://learn-networking.com/tcp-ip/how-encapsulation-works-within-the-tcpip-model |title = How Encapsulation Works Within the TCP/IP Model |date = 2008-01-27 |access-date = 2013-11-22 |website = learn-networking.com | archive-url = https://web.archive.org/web/20120807024653/http://learn-networking.com/tcp-ip/how-encapsulation-works-within-the-tcpip-model |archive-date = 2012-08-07 |url-status = dead}}</ref>

For example, in the IP suite, the contents of a web page are encapsulated with an HTTP header, then by a TCP header, an IP header, and, finally, by a frame header and trailer. The frame is forwarded to the destination node as a stream of bits, where it is decapsulated into the respective PDUs and interpreted at each layer by the receiving node.<ref name="cisco-icnd1">{{cite book|last1=Odom|first1=Wendell|title=Cisco CCENT/ CCNA ICND1 100-101 Official Cert Guide|date=2013|publisher=Pearson Education|isbn=978-1-58714-385-4|pages=Ch. 1}}</ref>

The result of encapsulation is that each lower-layer provides a service to the layer or layers above it, while at the same time each layer communicates with its corresponding layer on the receiving node. These are known as adjacent-layer interaction and same-layer interaction, respectively.<ref name="cisco-icnd1" />

In discussions of encapsulation, the more abstract layer is often called the upper-layer protocol while the more specific layer is called the lower-layer protocol. Sometimes, however, the terms upper-layer protocols and lower-layer protocols are used to describe the layers above and below IP.<ref name="tcpip-encapsulation" />

== See also == * Application-layer framing * Cross-layer optimization * Protocol data unit * Tunneling protocol

==References== {{Reflist}}

== External links == *{{IETF RFC|1983}}: Internet Users' Glossary (contains an entry for encapsulation)

Category:Computer network technology Category:Network protocols Category:Data transmission Category:Packets (information technology)