CS 101 › Lesson 7 of 8

The Internet & Networking

Lesson 7 · OKSTEM College · Associate of Science in Computer Science

The Internet & Networking

The Internet is a global network of networks — billions of devices interconnected by standardized protocols. Every web request, email, and video call relies on these protocols working together.

The OSI Model — click any layer to learn what it does

The 7-layer OSI model is a framework for understanding how network communication works. Data travels down the stack on the sender and up the stack on the receiver — each layer adds or removes its own header.

Mnemonic (top→bottom): All People Seem To Need Data Processing

🌐 Layer 7 — Application HTTP · SMTP · DNS · FTP

What it does: Provides the interface between the network and the software the user actually interacts with. This is where your web browser, email client, and DNS resolver live.

Real protocols:

  • HTTP/HTTPS — fetches web pages. When you type a URL, your browser sends an HTTP GET request here.
  • SMTP — sends email between mail servers.
  • DNS — translates domain names (google.com) into IP addresses (142.250.80.46).
  • FTP/SFTP — transfers files between computers.

What happens here: The application formats a request (e.g., "GET /index.html HTTP/1.1") and hands it to Layer 6 for processing.

🔐 Layer 6 — Presentation TLS · SSL · JPEG · ASCII

What it does: Translates between the application\'s data format and a format suitable for network transmission. Handles encryption, compression, and encoding.

Real examples:

  • TLS/SSL — encrypts HTTPS traffic so your passwords can\'t be intercepted. The padlock in your browser is this layer working.
  • JPEG / PNG compression — reducing image size before sending.
  • ASCII / UTF-8 encoding — converting text characters to bytes.

In practice: In modern TCP/IP implementations, Layers 5 and 6 are typically handled within the application layer (Layer 7). TLS, for example, sits between the app and TCP.

🤝 Layer 5 — Session Session management · Authentication

What it does: Manages the opening, maintaining, and closing of communication sessions between applications. Handles authentication and reconnection.

Real examples:

  • Login sessions — when you log in to a website, a session token is created at this layer to remember you across multiple requests.
  • Video calls — maintaining a continuous stream of data requires session management to handle pauses and reconnections.
  • APIs with auth tokens — the concept of a "session" that expires after inactivity.

In practice: Like Layer 6, Layer 5 functionality is usually implemented within the application in TCP/IP networks. The concept is important even if the OSI boundaries aren\'t strictly observed.

📦 Layer 4 — Transport TCP · UDP

What it does: Provides end-to-end communication between processes on different hosts. Handles segmentation (breaking data into chunks), reassembly, flow control, and error recovery.

TCP vs UDP:

  • TCP (Transmission Control Protocol) — reliable, ordered, connection-based. Every segment is acknowledged; missing ones are retransmitted. Used for web, email, file transfer — anything where you can\'t afford to lose data.
  • UDP (User Datagram Protocol) — fast, connectionless, no guarantees. Used for video streaming, gaming, DNS — where speed matters more than perfection.

Port numbers: Layer 4 introduces port numbers, which tell the receiving computer which application should get the data. HTTP = port 80, HTTPS = 443, DNS = 53, SSH = 22.

🗺️ Layer 3 — Network IP · ICMP · Routing

What it does: Routes packets from the source host to the destination host across multiple networks. This is where IP addresses live.

Key concepts:

  • IP addresses — every device on the internet has one (IPv4: 192.168.1.1, IPv6: 2001:db8::1). Layer 3 uses these to route packets.
  • Routers — devices that operate at Layer 3. They read the destination IP, look up the best route, and forward the packet — often through dozens of routers between you and a server.
  • ICMP — the ping command uses ICMP at Layer 3 to test connectivity.

Best-effort: IP is "best-effort" — it will try to deliver packets but makes no guarantees. Lost packets are handled by Layer 4 (TCP) or tolerated by the app (UDP).

🔗 Layer 2 — Data Link Ethernet · Wi-Fi · MAC addresses

What it does: Handles node-to-node delivery within a single network (one "hop"). Packages bits into frames and uses MAC addresses to identify devices on the local network.

Key concepts:

  • MAC address — a hardware address burned into your network card (e.g., AA:BB:CC:DD:EE:FF). Used to identify devices on the same local network segment.
  • Ethernet — the most common wired LAN standard. Defines how frames are structured and how devices share a wire.
  • Switches — Layer 2 devices. They read MAC addresses to forward frames only to the correct port — more efficient than hubs (Layer 1) which broadcast to everyone.
  • ARP — Address Resolution Protocol. Translates IP addresses to MAC addresses so Layer 3 packets can be wrapped in Layer 2 frames.
Layer 1 — Physical Cables · Fiber · Radio waves

What it does: Transmits raw bits (1s and 0s) over a physical medium. This layer deals with voltage levels, light pulses, or radio frequencies — pure physics.

Physical media:

  • Copper cable (Cat5e/Cat6) — electrical signals. Standard Ethernet cables in offices. Up to 10 Gbps over short distances.
  • Fiber optic — light pulses through glass. Used for long-distance internet backbone. Can carry terabits per second across oceans.
  • Wi-Fi (802.11) — radio waves. Your router broadcasts at 2.4 GHz or 5 GHz frequencies.
  • 5G cellular — millimeter wave radio. Your phone connects to towers that connect to fiber.

What Layer 1 doesn\'t know: The physical layer has no concept of addresses, errors, or meaning. It just converts bits to signals and back. All the intelligence lives in layers above.

TCP vs UDP

TCP (Transmission Control Protocol): connection-oriented, guaranteed delivery, ordered, error-checked. Used for HTTP, email, file transfer.

UDP (User Datagram Protocol): connectionless, best-effort, low latency. Used for live video, gaming, DNS queries.

DNS & HTTP

When you type okstem.org into a browser:

  1. Your browser queries DNS to resolve the domain to an IP address.
  2. Your OS opens a TCP connection to that IP on port 443 (HTTPS).
  3. TLS handshake establishes an encrypted channel.
  4. Your browser sends an HTTP GET request.
  5. The server returns an HTTP 200 response with HTML.
  6. The browser parses HTML, fetches CSS/JS, and renders the page.

IP addresses: IPv4 uses 32-bit addresses (e.g., 192.168.1.1). We're running out — IPv6 uses 128-bit addresses, providing 3.4×10³⁸ unique addresses.

Lab — HTTP Request Journey

Knowledge Check

Which OSI layer is responsible for routing packets between networks?

TCP differs from UDP in that TCP

DNS is used to

HTTPS uses TLS to provide

IPv6 was introduced primarily because

← PreviousNext →