Skip to main content

Computer Networking: Encapsulation and Decapsulation

TCP/IP Model vs. OSI Model

TCP/IP Model

The sender sends from Layer 4 down to Layer 1
The recipient receives on Layer 1 up to Layer 4

TCP/IP was developed in the 1970s, and has four layers

 _____________________________________
|     |/////////////////////////|   ^ |
| |   |-------------------------| R | |
| |   |  4  | APPLICATION       | E | |
| | S |_____|___________________| C | |
| | E |  3  | TRANSPORT         | I | |
| | N |_____|___________________| P | |
| | D |  2  | INTERNET          | I | |
| | E |_____|___________________| E | |
| | R |  1  | NETWORK           | N | |
| |   |_____|___________________| T | |
| V   |/////////////////////////|   | |
'-------------------------------------'


encapsulation-example.png

Example shows how multiple segments of networking data are nested to form a complete Ethernet frame
https://tldp.org/LDP/tlk/net/net.html

OSI Model

The sender sends from Layer 7 down to Layer 1
The recipient receives on Layer 1 up to Layer 7

OSI was developed in the 1980s, and has seven layers
Computer networking is a complex topic, with many technologies, parts, and protocols that make all the magic happen.
By breaking up the many parts of computer networking into more layers, we are abstracting the problem into smaller chunks. And, breaking a problem into smaller chunks makes it much simpler to engineer solutions and fix issues as the needs arise. 

 _____________________________________
|     |/////////////////////////|     |
| |   |-------------------------|   ^ |
| |   |  7  | APPLICATION       |   | |
| |   |_____|___________________|   | |
| |   |  6  | PRESENTATION      | R | |
| | S |_____|___________________| E | |
| | E |  5  | SESSION           | C | |
| | N |_____|___________________| I | |
| | D |  4  | TRANSPORT         | P | |
| | E |_____|___________________| I | |
| | R |  3  | NETWORK           | E | |
| |   |_____|___________________| N | |
| |   |  2  | DATA LINK         | T | |
| |   |_____|___________________|   | |
| |   |  1  | PHYSICAL          |   | |
| V   |_____|___________________|   | |
|     |/////////////////////////|     |
'-------------------------------------'

OSI Model Visualization

Common TCP and UDP Ports

Well-Known TCP/IP Port Numbers, Service Names & Protocols [Comprehensive Reference] (meridianoutpost.com)

Encapsulation Visualization

WildPackets Protocol Family Encapsulations (lmi.net)