Block 1 of 3~3 min
Layers and encapsulation
Pipes and local sockets live inside one kernel. A network is a shared medium for bits between machines that may disagree on everything else. Layers solve one problem each and talk only to neighbours. On the way out each wraps the payload in its header (encapsulation); on the way in each strips its own.
The Internet stack the course uses is:
| Layer | Job | Examples |
|---|---|---|
| Application | meaning of bytes | HTTP, DNS |
| Transport | process-to-process | TCP, UDP |
| Network | host-to-host across networks | IP |
| Link | hop on one segment | Ethernet, Wi-Fi |
A full Ethernet frame carrying TCP often holds 1,460 bytes of TCP payload inside 1,518 bytes on the wire (14 B Ethernet + 20 B IP + 20 B TCP + 1460 + 4 B FCS). Numbers vary with options and VLAN tags; the idea is headers stacked around the data.