# OSI Model vs TCP/IP Model — All Layers Explained Simply

Source: https://skills101.in/learn/computer-networks/osi-and-tcp-ip-models — Skills101 free tutorial (Computer Networks). Updated 2026-11-09.

Networking is split into **layers**. Each layer does one job and talks only to the layers just above and below it. This makes networks easier to build and debug ("is it a cable problem or a DNS problem?").

![The 7 OSI layers (application, presentation, session, transport, network, data link, physical) next to the 4 TCP/IP layers (application, transport, internet, network access), with example protocols](https://skills101.in/learn-img/computer-networks/osi-tcpip.svg)

## 1. The OSI model (7 layers)

| # | Layer | Job | Protocols / examples | Unit | Device |
|---|---|---|---|---|---|
| 7 | **Application** | services for apps | HTTP, HTTPS, DNS, SMTP, FTP | data | — |
| 6 | **Presentation** | format, encrypt, compress | TLS/SSL, JPEG, UTF-8 | data | — |
| 5 | **Session** | open, manage, close sessions | sockets, RPC | data | — |
| 4 | **Transport** | process-to-process delivery, reliability, ports | **TCP, UDP** | segment | — |
| 3 | **Network** | logical addressing, routing | **IP**, ICMP | packet | router |
| 2 | **Data link** | node-to-node delivery, MAC, error detection | Ethernet, Wi-Fi (802.11), ARP | frame | switch |
| 1 | **Physical** | bits as signals | cables, fibre, radio | bit | hub, repeater |

**Remember (top → down):** **A**ll **P**eople **S**eem **T**o **N**eed **D**ata **P**rocessing.

## 2. The TCP/IP model (4 layers) — what the internet really uses

| TCP/IP layer | Matches OSI layers | Protocols |
|---|---|---|
| **Application** | 7, 6, 5 | HTTP, DNS, SMTP, TLS |
| **Transport** | 4 | TCP, UDP |
| **Internet** | 3 | IP, ICMP |
| **Network access** (link) | 2, 1 | Ethernet, Wi-Fi |

**OSI** is a teaching/reference model; **TCP/IP** is the practical model the internet is built on.

## 3. Encapsulation: wrapping data layer by layer

![Application data gets a TCP header to become a segment, then an IP header to become a packet, then an Ethernet header and trailer to become a frame](https://skills101.in/learn-img/computer-networks/encapsulation.svg)

When you send a message:

1. **Application** creates the data (an HTTP request).
2. **Transport** adds a TCP header (source and destination **ports**) → **segment**.
3. **Network** adds an IP header (source and destination **IP addresses**) → **packet**.
4. **Data link** adds an Ethernet/Wi-Fi header (MAC addresses) and a trailer (error check) → **frame**.
5. **Physical** sends the bits.

The receiver removes the headers in reverse order — **decapsulation**.

## 4. Three kinds of addresses (and which layer uses each)

| Address | Layer | Identifies | Example |
|---|---|---|---|
| **Port** | Transport | an application on a device | 443 (HTTPS), 22 (SSH), 3306 (MySQL) |
| **IP address** | Network | a device on the internet | 142.250.183.14 |
| **MAC address** | Data link | a network card on the local link | 3C:22:FB:1A:9E:07 |

IP addresses get you to the right **network and device**; MAC addresses get you across each **local hop**; ports get you to the right **program**.

## Common mistakes

- Putting TCP at the network layer (it's transport) or IP at the transport layer (it's network).
- Saying "the internet uses the OSI model". It uses TCP/IP; OSI is the reference.
- Mixing up segment (transport), packet (network) and frame (data link).

## Quick recap

- OSI 7 layers: Application, Presentation, Session, Transport, Network, Data link, Physical.
- TCP/IP 4 layers: Application, Transport, Internet, Network access.
- Units: data → segment → packet → frame → bits.
- Port (app) · IP (device across networks) · MAC (card on local link).


Practice quiz and free certificate: https://skills101.in/learn/computer-networks/osi-and-tcp-ip-models