Learn / Walkthrough

Joining a network

The laptop has just connected to Wi-Fi. Before it can talk to anything, it needs an address. Watch it ask for one, get one, and use it.

  1. Anyone out there?

    Packet 1

    With no address yet, the laptop broadcasts a DHCP Discover from 0.0.0.0 to every device on the network.

    Think about it: Why does it send from 0.0.0.0?

    It doesn't have an address yet. Getting one is the whole point of this exchange.

  2. An offer

    Packet 2

    The router, acting as the DHCP server, offers 192.168.1.24, plus the router and DNS server to use.

  3. Yes, please

    Packet 3

    The laptop formally requests the offered address and names the server it chose.

    Think about it: Why ask again instead of just using the offer?

    Several servers could have made offers. The Request tells all of them which offer was accepted.

  4. It's yours

    Packet 4

    The server confirms with an ACK: the address belongs to the laptop for 24 hours, called the lease.

  5. Finding the router

    Packet 5

    To reach the internet, the laptop needs the router's hardware address, so it asks with ARP.

  6. First lookup

    Packet 7

    The laptop looks up a name using the DNS server it learned from DHCP.

  7. First connection

    Packet 11

    A TCP connection opens to the address DNS returned. The laptop is fully online.