## The OSI Model

The **Open Systems Interconnection** model describes how data moves from one computer to another. It has 7 Layers.
"**P**lease **D**o **N**ot **T**hrow **S**ausage **P**izza **A**way"

### The Layers (Bottom Up)
1.  **Physical (Layer 1)**: The cables, fiber optics, and radio waves (WiFi). Bits (0s and 1s).
    *   *Device*: Hub, Cable.
    *   *Attack*: Wiretapping, Jamming.
2.  **Data Link (Layer 2)**: MAC Addresses (Physical usage). Switches operate here.
    *   *Unit*: Frame.
    *   *Attack*: ARP Spoofing.
3.  **Network (Layer 3)**: IP Addresses (Logical usage). Routers operate here.
    *   *Unit*: Packet.
    *   *Attack*: Ping Flood.
4.  **Transport (Layer 4)**: TCP/UDP. Ports. Reliability.
    *   *Unit*: Segment.
    *   *Attack*: SYN Flood (DoS).
5.  **Session (Layer 5)**: Establishing and ending connections (Sessions).
6.  **Presentation (Layer 6)**: Encryption (SSL/TLS) and formatting (JPEG/ASCII).
7.  **Application (Layer 7)**: The software you use (HTTP, DNS, SMTP).

### Interaction
When you click a link:
*   **Encapsulation**: Data goes DOWN the stack (L7 -> L1) adding headers at each layer.
*   **Decapsulation**: Data goes UP the stack (L1 -> L7) stripping headers.