What Happens When You Connect to a Network?

The invisible conversation between your computer and your router

You plug in a LAN cable or click on your WiFi name, type your password, and you're online. It feels instant. But in that split second, your computer and router have a whole conversation. Let's listen in.

Step 1

Your Computer Wakes Up on the Network

The moment your computer connects to a network, it has a problem: it doesn't have an address yet. It's like moving to a new street with no house number - nobody can send you mail.

Your computer temporarily assigns itself a link-local addressA temporary self-assigned IP in the range 169.254.x.x. It only works on your local network and can't reach the internet. (something like 169.254.x.x). This is just a placeholder - it can't reach the internet with this address.

Now it needs to find someone who can give it a proper address.

Step 2

"Hello, Is Anyone There?" - The DHCP Discovery

Your computer sends out a broadcastA message sent to ALL devices on the network at once. Think of it as shouting in a room instead of whispering to one person. message to every device on the network. It's essentially shouting:

"Hey everyone! I just joined this network. Is there a DHCPDynamic Host Configuration Protocol - a service that automatically assigns IP addresses to devices. Your home router has one built in, so every device gets a unique address without you having to set anything up. More Info… server here that can give me an address?"

This broadcast uses UDPUser Datagram Protocol - a fast way to send messages without waiting for confirmation. Like dropping a letter in a postbox vs making a phone call. DHCP has to use it because your computer doesn't have a proper address yet to establish a two-way connection. More Info… because your computer can't establish a proper two-way connection yet - it doesn't even have an address!

Step 3

The Router Responds: "Welcome! Here's Your Info"

Your home router has a built-in DHCP server. It hears the broadcast and responds with a care package containing everything your computer needs:

  1. IP AddressA unique number that identifies your device on the network, like a house address. For example: 192.168.1.15. No two devices on the same network can have the same IP. More Info… (e.g., 192.168.1.15) - Your device's unique address on this network
  2. Subnet MaskTells your computer which IP addresses are on the same local network. Usually 255.255.255.0 in home networks, meaning any device with an IP starting with the same first three numbers is local. (e.g., 255.255.255.0) - Tells your computer which addresses are "neighbours"
  3. GatewayThe IP address of your router on the local network side. Your computer sends all internet-bound traffic to this address. Think of it as the front door of your house - all outgoing and incoming post goes through it. More Info… (e.g., 192.168.1.1) - The door to the internet (your router's address)
  4. DNS ServerA server that translates website names (like google.com) into IP addresses (like 142.250.80.46). Without DNS, you'd have to memorise number addresses for every website. More Info… - The internet's phone book, so your computer can find websites by name

Why is DHCP needed? Imagine if every device just picked its own IP address. Two devices might accidentally choose the same number, causing a conflict - neither would work properly. DHCP acts as a central authority, ensuring every device gets a unique address.

Step 4

You're on the Network!

Your computer now has a private IP addressAn IP address that only works within your local home network. Typically starts with 192.168, 10.0, or 172.16. Devices on the internet can't see this address directly. More Info… like 192.168.1.15. But here's the thing - this address only works inside your home network. Websites on the internet don't see this address. They see your router's public IP addressThe IP address assigned to your router by your Internet Service Provider. This is the address websites see when you visit them. All devices in your home share this single public IP. More Info… instead.

Your device also has a MAC addressA unique hardware identifier burned into your network card at the factory. Like a serial number for your device's network hardware. Works only on the local network - websites can't see it. More Info… - a permanent hardware fingerprint that helps identify it on the local network. Unlike your IP (which can change), your MAC address is baked into the hardware.

Step 5

You Open a Website

You type google.com into your browser. Here's what happens in milliseconds:

  1. Your computer asks the DNS serverThe DNS address your router gave you in Step 3. It translates 'google.com' into an IP address like 142.250.80.46. More Info…: "What's the IP address for google.com?"
  2. DNS responds: "It's 142.250.80.46"
  3. Your computer creates a request and sends it to the gatewayYour router, acting as the bridge between your home network and the internet. More Info… (your router)
  4. Your router forwards it out through the WANWide Area Network - the 'outside' connection on your router that connects to your ISP and the wider internet. More Info… port to your ISP and onto the internet
  5. Google's server receives the request and sends the webpage back through the same path

All of this happens in a fraction of a second. Your home network is a small LANLocal Area Network - the network inside your home, connecting your devices to each other and to the router. More Info…, your router is the bridge, and the internet is the vast network of networks on the other side.

Now You Know!

In just five steps, you've learned the entire journey from plugging in a cable to loading a website. Each concept along the way has its own detailed page if you want to dive deeper: