DEV Community

Diana
Diana

Posted on

Networking 101: The Concepts Explained Simply 🌐

Why Networking Feels Intimidating (But Shouldn't)

I'll be honest, networking used to make my eyes glaze over. IP addresses, ports, subnets... it felt like learning another language.

But once I found the right mental model, it clicked. So if you don't know what an IP address is or how it works, that's completely fine. By the end of this post, you'll understand how devices find each other on a network, and you'll have the foundation you need for topics like cloud computing, Kubernetes, or just understanding how the internet works.

Let's start from scratch.

An IP Address Is Just a Street Address 🏘️

Keith Barker has an easy breakdown in his video "Take 5 Minutes now to learn about IP addresses" that inspired the analogy I'm about to use. If you want to go even deeper, his "Subnet Saturday #1: IPv4 Basics" is a more detailed walkthrough of how IP addresses actually work.

Here's the core idea:

Think about your home address. It has two parts:

  • The street name: tells you which neighborhood you're in
  • The house number: tells you which specific house on that street

An IP address works the same way:

  • The network portion: this is the "street name," identifying which network you're on
  • The host portion: this is the "house number," identifying the specific device on that network

For example, take the IP address 192.168.1.25:

  192.168.1  .  25
  ─────────     ──
  Street Name   House Number
  (Network)     (Host)
Enter fullscreen mode Exit fullscreen mode

Every device on a network needs its own unique address, just like every house on a street needs its own number. Two houses can't have the same number on the same street, and two devices can't have the same IP address on the same network.

Ports: The Doors on Each House πŸšͺ

Now, each house (device) can have multiple doors. These are ports. Different doors lead to different services:

  • Door 80: the front door (web traffic / HTTP)
  • Door 443: the secure front door (HTTPS)
  • Door 22: the back door for maintenance (SSH)

So a full address to reach a specific service looks like this:

  192.168.1.25:80
  ─────────────  ──
  House Address   Door Number
  (IP Address)    (Port)
Enter fullscreen mode Exit fullscreen mode

How a Request Finds the Right Device πŸ—ΊοΈ

So when you type something like 192.168.1.25:80 into a browser, how does the request actually get to the right place? The network reads the address just like a mail carrier delivers a letter:

How a request finds the right device

Think of it like a mail carrier delivering a package:

  1. Read the street name: "Which neighborhood is this going to?" That's the network portion
  2. Find the right house: "Which house on this street?" That's the host portion
  3. Knock on the right door: "Which service do they want?" That's the port

Local vs. External IP Addresses: Private Streets vs. Public Highways 🏑🌍

Not all IP addresses are created equal. There are two kinds:

Local (Private) IP Addresses: These are like street addresses inside a gated community. They only work within that community. Devices on your home WiFi network talk to each other using private IPs like 192.168.1.x or 10.0.0.x. If you tried to give someone outside your network that address, they wouldn't be able to find you, it's a private street that doesn't exist on any public map.

External (Public) IP Addresses: This is like your community's main gate address, the one that shows up on a public map. It's the address the outside world uses to reach your network. Your internet provider gives you one, and it's how websites know where to send data back to you.

Your Home Network (Gated Community):
  πŸ“± Phone     β†’ 192.168.1.10  (Private β€” only works inside)
  πŸ’» Laptop    β†’ 192.168.1.25  (Private β€” only works inside)
  πŸ–₯️ Desktop   β†’ 192.168.1.30  (Private β€” only works inside)

Your Router (The Main Gate):
  🌐 Public IP β†’ 73.45.123.89  (Public β€” the outside world uses this)
Enter fullscreen mode Exit fullscreen mode

Your router translates between the two. When your laptop requests a website, the router swaps the private address for the public one on the way out, and swaps it back on the way in. The outside world only ever sees the public address.

How Does the Response Find Its Way Back? πŸ“¬

You might be wondering, when a website sends data back, how does it know where to send it? Every request includes a return address, just like a letter. The website reads the return address and sends the response right back.

But here's the thing, your laptop might be talking to many websites at the same time. You've got a browser, Netflix, Slack, all running at once. How does your router know which response goes to which app?

Remember ports? Your laptop uses a different port number for each connection. Think of it as each app getting its own temporary mailbox:

Your Laptop right now:
  🌐 Browser tab 1  β†’ mailbox 52431 β†’ talking to dev.to
  🌐 Browser tab 2  β†’ mailbox 52432 β†’ talking to google.com
  🎬 Netflix         β†’ mailbox 52433 β†’ talking to netflix.com
  πŸ’¬ Slack           β†’ mailbox 52434 β†’ talking to slack.com
Enter fullscreen mode Exit fullscreen mode

When a response comes back, your router checks which mailbox (port) it's addressed to and forwards it to the right app. That's how one device can have dozens of connections running at the same time without anything getting mixed up.

localhost: Talking to Yourself πŸͺž

You might have seen localhost or 127.0.0.1 before. This is a special address that means "this machine, right here." It's not even a street address, it's like knocking on your own front door.

When developers say "run it on localhost," they mean "run it on your own computer, and access it from your own computer." Nothing goes across the network. It's completely internal to your machine.

localhost = 127.0.0.1 = "myself"

You β†’ localhost:3000 β†’ Your own machine, door 3000
Enter fullscreen mode Exit fullscreen mode

You'll run into this all the time when developing locally, running a web app on localhost:3000, a database on localhost:5432, etc. It just means those services are running on your own machine and you're accessing them from your own machine.

DNS: Names Instead of Numbers πŸ“–

Remembering IP addresses like 192.168.1.25 is annoying. That's why DNS (Domain Name System) exists, it's like a phone book that translates human-friendly names into IP addresses.

You already use DNS every day:

  • You type google.com β†’ DNS translates it to 142.250.80.46
  • You type dev.to β†’ DNS translates it to an IP address behind the scenes

You never have to memorize the actual numbers. DNS handles that for you.

This concept shows up everywhere in tech. Cloud platforms, container orchestration tools like Kubernetes, and internal company networks all use their own private DNS so that services can find each other by name instead of by IP address. The idea is always the same: names are easier to remember than numbers, so let a phone book handle the translation.

Putting It All Together πŸ—ΊοΈ

Let's trace a real request from start to finish. You type dev.to in your browser, here's what happens:

Putting it all together - tracing a request from browser to server

Every concept we covered plays a role:

  1. DNS translates the name to an IP address
  2. Your router translates your private IP to a public one
  3. The network portion of the IP routes the request to the right network
  4. The host portion finds the right device
  5. The port delivers the request to the right service

What's Next? 🎯

Now that you understand how devices find each other on a network, you have the foundation for some really powerful topics:

  • Cloud computing: Understanding public vs. private networks is key to how cloud infrastructure works
  • Kubernetes networking: Containers need to find each other too, and they use all the concepts we just covered (IP addresses, DNS, ports, private networks)
  • Web development: Every API call, every database connection, every deployment involves networking

In my next post, I'll take these exact concepts and show you how they apply inside a Kubernetes cluster, where Pods get their own IP addresses, Services act as stable phone book entries, and Ingress controllers manage traffic from the outside world. If you're new to Kubernetes, check out my intro post first: Kubernetes: Making Sense of the Madness. Stay tuned! πŸ‘‡

Additional Resources πŸ“š

Further Reading:

Top comments (0)