# OSI Model vs TCP/IP Model

## OSI Model (7 Layers)

| Layer | Name | Function | Example Protocols |
|-------|------|----------|-------------------|
| 7 | Application | User-facing services | HTTP, DNS, FTP, SMTP |
| 6 | Presentation | Data formatting, encryption | SSL/TLS, JPEG |
| 5 | Session | Session management | NetBIOS, RPC |
| 4 | Transport | End-to-end communication | TCP, UDP |
| 3 | Network | Logical addressing, routing | IP, ICMP, ARP |
| 2 | Data Link | MAC addressing, framing | Ethernet, Wi-Fi |
| 1 | Physical | Bits over wire/wireless | Cables, hubs, signals |

## TCP/IP Model (4 Layers)

| TCP/IP Layer | Maps to OSI Layers | Protocols |
|---|---|---|
| Application | 5, 6, 7 | HTTP, DNS, FTP |
| Transport | 4 | TCP, UDP |
| Internet | 3 | IP, ICMP |
| Network Access | 1, 2 | Ethernet, Wi-Fi |

## Encapsulation (Top-Down)
When data is sent, each layer wraps the data from the layer above:

```
Application Data
  → [TCP Header | Application Data]          (Segment)
    → [IP Header | TCP Header | Data]         (Packet)
      → [Ethernet Header | IP Header | ... | Ethernet Trailer]  (Frame)
        → 010101... (Bits)
```

## De-encapsulation (Bottom-Up)
At the receiving end, each layer strips its own header and passes the rest up.

## Observed in
- Activity 2.4.8 — Use of TCP/IP Protocols and OSI Model in Packet Tracer
- Activity 2.7.1 — Examining Packets (encapsulation walkthrough)
