DevOps Networking Essentials
Networking Basics
Models for Communication
Computer networks can seem complex, but they follow a set of rules, much like a postal service. To make sense of these rules, experts created conceptual frameworks called models. These models break down the process of sending information from one computer to another into smaller, manageable steps called layers.
The most famous conceptual model is the Open Systems Interconnection (OSI) model. It has seven layers, each with a specific job. Think of it as a detailed, seven-step guide for sending a package. While it's great for understanding theory, it's not what the modern internet actually uses.
| Layer | Name | Function |
|---|---|---|
| 7 | Application | The layer you interact with (e.g., web browser, email client) |
| 6 | Presentation | Translates data into a standard format, handles encryption |
| 5 | Session | Manages the conversation, or session, between two computers |
| 4 | Transport | Ensures data is sent and received correctly and in order |
| 3 | Network | Handles addressing and routing to find the best path |
| 2 | Data Link | Manages communication between devices on the same network |
| 1 | Physical | The actual hardware: cables, Wi-Fi signals, etc. |
The internet actually runs on a simpler, more practical model called the TCP/IP model. It combines some of the OSI layers into four broader categories. It's the real-world blueprint for how your computer sends a request to a website and gets a webpage back.
The Core Protocols
Within the TCP/IP model, a few key protocols do most of the heavy lifting. A protocol is simply a set of rules for communication. The most important ones are IP, TCP, and UDP.
Internet Protocol (IP): Think of IP as the part of the postal service that deals only with addresses. Its job is to stamp every packet of data with a destination address and a return address. It's responsible for routing the packet across the internet to get it to the right neighborhood, but it doesn't worry about whether it actually arrives or what condition it's in.
Once a packet arrives at the correct computer, the Transport layer takes over. Here, we have two main choices for how to handle the delivery: TCP and UDP.
| Protocol | Analogy | Use Case | Key Features |
|---|---|---|---|
| TCP | Certified Mail | Web browsing, email, file transfers | Reliable, ordered, connection-oriented, error-checked |
| UDP | Postcard | Video streaming, online gaming, DNS | Fast, lightweight, connectionless, no delivery guarantee |
Transmission Control Protocol (TCP) is the reliable option. Before sending data, it establishes a connection with the receiver in a process called a three-way handshake. It then numbers each data packet, sends them, and waits for confirmation that they arrived safely and in the right order. If a packet gets lost, TCP resends it. This makes it perfect for things where accuracy is critical, like loading a webpage or sending an email.
User Datagram Protocol (UDP) is the fast, no-frills option. It just sends the data packets and hopes for the best. There's no handshake, no confirmation, and no re-sending lost packets. This might sound bad, but it's great for real-time applications where speed is more important than perfect accuracy. A few dropped pixels in a video stream or a split-second of lag in a game is better than waiting for a lost packet to be resent.
Addresses on the Network
Every device on the internet needs a unique address, just like every house on a street. This is its IP address. The most common format you'll see is IPv4, which looks like four numbers separated by periods.
Example IPv4 Address:
192.168.1.101
Each of the four numbers, called an octet, can range from 0 to 255. This address serves two purposes: it identifies the network the device is on, and it identifies the specific device (or host) on that network. But how does a computer know which part of the address is the network and which part is the host?
That's where the subnet mask comes in. It's another set of four numbers that looks like an IP address (e.g., 255.255.255.0). By applying the mask, a device can figure out its network address.
This process of using a subnet mask to divide a larger network into smaller, more manageable pieces is called subnetting. It's like taking a large city (a big network) and dividing it into zip codes (subnets). This helps organize traffic, improve performance, and enhance security by keeping data within the right 'neighborhood' unless it's specifically meant to go elsewhere.
Which of the following best describes the relationship between the OSI model and the TCP/IP model?
You are developing a live video streaming application where speed is critical and a few lost frames are acceptable. Which transport protocol would be the most suitable choice?
Understanding these models, protocols, and addressing schemes is the first step to mastering how the internet works.