Encapsulation is the process of wrapping data with protocol headers as it moves down the network stack. Application data becomes a TCP segment, which becomes an IP packet, which becomes an Ethernet frame. Each layer adds its own header without understanding the layers above or below.
Encapsulation is the layered wrapping of data as it passes through the network stack. An HTTP response body is wrapped in an HTTP header, then in a TCP segment header (adding ports and sequence numbers), then in an IP packet header (adding addresses and TTL), then in an Ethernet frame header (adding MAC addresses) and trailer (FCS). Each layer treats everything above it as opaque payload. This layering enables protocol independence – TCP works the same whether it carries HTTP, SSH, or SMTP. De-encapsulation happens at the receiver as each layer strips its header and passes the payload upward. VPN tunneling adds an extra encapsulation layer – an IP packet inside another IP packet – which reduces the effective MTU by the size of the tunnel headers.
Packet
A packet is a unit of data transmitted over a network. Each packet contains a header (source/destination addresses, protocol info, sequence numbers) and a payload (the actual data). IP packets are limited by MTU – typically 1500 bytes on Ethernet. Larger messages are split into multiple packets.
Frame
A frame is a Layer 2 (data link) unit of data that includes a header with MAC addresses, the payload (an IP packet), and a trailer with error-checking CRC. Ethernet frames have a maximum size of 1518 bytes. Frames are addressed by MAC, not IP – they do not cross router boundaries.
MTU (Maximum Transmission Unit)
MTU is the largest packet size a network link can carry without fragmentation. Ethernet MTU is 1500 bytes. If a packet exceeds the path MTU, it is fragmented (IPv4) or dropped with ICMP Packet Too Big (IPv6). Path MTU Discovery (PMTUD) finds the lowest MTU along a route.