Network Fundamentals


OSI Model

Mnemonic: Please Do Not Throw Salami Pizza Away (Layer 7 → 1)

Layer Name Function Examples
7 Application User apps (HTTP, FTP, email) HTTP, DNS, SMTP, POP3
6 Presentation Data translation (encryption/compression) JPEG, PNG, MPEG, Unicode
5 Session Manages connections (start/stop sessions) NFS, RPC
4 Transport Reliable data delivery (TCP/UDP) TCP (safe), UDP (fast)
3 Network Logical addressing & routing IP, ICMP, IPSec
2 Data Link MAC addressing & local delivery Ethernet (802.3), WiFi (802.11)
1 Physical Raw bit transmission (cables, signals) Fiber, Copper, Radio

Encapsulation

How data travels down OSI layers:

  1. Application: User data (e.g., email) → Formatted as HTTP/FTP.
  2. Transport: Adds TCP/UDP header → Creates segment/datagram.
  3. Network: Adds IP header → Creates packet.
  4. Data Link: Adds MAC header/trailer → Creates frame.
  5. Physical: Converts to bits → Sent via cable/WiFi.

image


Core Protocols

1. DHCP (Dynamic Host Configuration Protocol)

  • Purpose: Auto-assigns IP, subnet, DNS, gateway.
  • Port: UDP 67 (server), 68 (client).
  • DORA Process:
    1. Discover: Client broadcasts “Need IP” (0.0.0.0255.255.255.255).
    2. Offer: Server responds with IP offer.
    3. Request: Client accepts.
    4. Ack: Server confirms.

image


2. ARP (Address Resolution Protocol)

  • Purpose: Maps IP → MAC address.
  • Process:
    • Request: “Who has 192.168.1.1?” (Broadcast: ff:ff:ff:ff:ff:ff).
    • Reply: “192.168.1.1 is at 44:df:65:d8:fe:6c”.

image


3. ICMP (Internet Control Message Protocol)

  • Purpose: Network troubleshooting (ping, traceroute).
  • Commands:
    ping <IP> -c 4       # Stop after 4 packets
    traceroute google.com # Path to destination
    

4. DNS (Domain Name System)

  • Purpose: Resolves example.com93.184.215.14.
  • Record Types:
    • A: IPv4 address.
    • AAAA: IPv6 address.
    • CNAME: Alias (www.example.comexample.com).
    • MX: Mail server.
  • Tools:
    nslookup example.com  # Query DNS
    whois example.com     # Domain ownership
    

5. HTTP/HTTPS

Feature HTTP (Port 80) HTTPS (Port 443)
Security Plaintext Encrypted (TLS)
Methods GET, POST, PUT, DELETE Same + TLS

image


6. FTP (File Transfer Protocol)

  • Port: 21 (control), 20 (data).
  • Commands:
    • USER, PASS: Login.
    • RETR: Download.
    • STOR: Upload.

image


7. SMTP (Email Sending)

  • Port: 25 (unencrypted), 465/587 (encrypted).
  • Commands:
    • HELO: Start session.
    • MAIL FROM: Sender.
    • RCPT TO: Recipient.
    • DATA: Email content.

image


8. POP3/IMAP (Email Retrieval)

POP3 (Port 110) IMAP (Port 143)
Downloads & deletes Syncs across devices

image


Secure Protocols (TLS/SSL)

  • HTTPS: HTTP + TLS (Port 443).
  • SSH: Encrypted remote access (Port 22).
  • SMTPS: SMTP + TLS (Port 465/587).

image

:> Ibha

Hello, I’m [redacted]


2025-06-21