OSI Model & TCP/IP
The 7-layer OSI model, the 4-layer TCP/IP stack, encapsulation, TCP vs UDP, and the three-way handshake. The foundation for understanding all network communication.
Every application you build runs on a network. Whether you are making an API call, loading a web page, streaming video, or sending a chat message, your data travels through an intricate web of protocols, routers, and cables that span the globe. Understanding how this infrastructure works is not optional for software engineers — it is essential for debugging production issues, designing scalable systems, and making informed architectural decisions.
curl, dig, traceroute, and Wireshark become powerful allies once you understand the underlying protocolsThe internet is a global network of interconnected networks. At its core, it relies on a few fundamental concepts.
Unlike traditional telephone networks that establish a dedicated circuit for each call, the internet uses packet switching. Data is broken into small units called packets, each of which is routed independently through the network.
Sending a message from A to B:
┌───────────────────────────────────────────┐│ Original Message ││ "Hello, this is a network packet demo" │└───────────────────────────────────────────┘ │ ▼ Split into packets ┌─────────┐ ┌─────────┐ ┌─────────┐ │Packet 1 │ │Packet 2 │ │Packet 3 │ │"Hello, │ │"a net- │ │"packet │ │this is "│ │"work " │ │"demo" │ └────┬────┘ └────┬────┘ └────┬────┘ │ │ │ ▼ ▼ ▼ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ Route 1 │ │ Route 2 │ │ Route 1 │ │ (via X) │ │ (via Y) │ │ (via X) │ └──────────┘ └──────────┘ └──────────┘ │ │ │ └────────────┼───────────┘ ▼ Reassembled at destinationKey benefits of packet switching:
Most internet communication follows the client-server model. A client (your browser, mobile app, or CLI tool) sends a request to a server, which processes it and returns a response.
┌──────────┐ ┌──────────┐│ │ 1. Request (HTTP GET) │ ││ Client │ ────────────────────────────► │ Server ││ (Browser)│ │ (Web App)││ │ 2. Response (HTML/JSON) │ ││ │ ◄──────────────────────────── │ │└──────────┘ └──────────┘This simple model scales to complex architectures where servers communicate with other servers, databases, caches, and message queues to fulfill a single client request.
Network communication is organized into layers, where each layer handles a specific responsibility and builds on the layer below it. The two most important models are:
OSI Model TCP/IP Model───────────── ──────────────Application ─┐Presentation ├──────► ApplicationSession ─┘Transport ────────► TransportNetwork ────────► InternetData Link ─┐Physical ─┴─────► Network AccessUnderstanding these layers helps you reason about where problems occur, which tools to use for debugging, and how different protocols interact.
This section covers the networking concepts most relevant to software engineers, organized from foundational protocols to advanced real-time techniques.
OSI Model & TCP/IP
The 7-layer OSI model, the 4-layer TCP/IP stack, encapsulation, TCP vs UDP, and the three-way handshake. The foundation for understanding all network communication.
HTTP & HTTPS
HTTP methods, status codes, headers, cookies, request/response structure, HTTP/1.1 vs HTTP/2 vs HTTP/3, TLS handshake, and certificates. The protocol you use every day.
DNS, CDN & Routing
DNS resolution process, record types, caching and TTL, CDN architecture, IP addressing, subnetting basics, and routing fundamentals. How packets find their way.
WebSockets & Real-Time
Polling, long polling, Server-Sent Events, WebSockets, and gRPC streaming. When and how to implement real-time communication in your applications.
| Week | Topic | Focus |
|---|---|---|
| 1 | OSI Model & TCP/IP | Understand the layer models, TCP vs UDP, and how data flows through the stack |
| 2 | HTTP & HTTPS | Master the protocol that powers the web — methods, status codes, headers, and TLS |
| 3 | DNS, CDN & Routing | Learn how domain names resolve, how content is delivered globally, and how packets are routed |
| 4 | WebSockets & Real-Time | Build real-time features using WebSockets, SSE, and other techniques |
| Concept | Description |
|---|---|
| IP Address | A unique numerical identifier for a device on a network (e.g., 192.168.1.1) |
| Port | A number (0-65535) identifying a specific service on a machine (e.g., HTTP uses port 80) |
| Packet | A small unit of data transmitted over a network, containing headers and payload |
| Protocol | A set of rules governing how data is transmitted and received (e.g., TCP, HTTP, DNS) |
| Bandwidth | The maximum rate of data transfer across a network path |
| Latency | The time delay for data to travel from source to destination |
| Throughput | The actual rate of successful data transfer, which is always less than or equal to bandwidth |
| Firewall | A network security system that monitors and controls incoming and outgoing traffic |
| Load Balancer | A device or service that distributes incoming requests across multiple servers |
| Proxy | An intermediary server that forwards requests between clients and servers |