What happens when we go to a website - 0. Acquire my IP

“Host1” under “Router1” tries to acquire IP.

  1. If Host1’s ip is cached in local, Host1 use it.
  2. If not, Host1 broadcasts discover packet to local network(hosts under Router1) with its mac address:
    I'm Host1 and I want to find DHCP server
    
  3. If any DHCP server under Router1 takes broadcast packet, it picks available ip in its ip pool,
    and broadcasts offer packet (if discover packet’s broadcast flag is 1)
    or unicasts offer packet (if discover packet’s broadcast flag is 0) to local network:
    I'm DHCP server "DHCP1" with ip address "dhcp_ip1", and I can give you an ip. Would you like to take it?
    DNS address is "dns_addr1" and you can use this ip until ...
    
  4. Host1 picks one dhcp server and sends request packet:
    Hello DHCP1 I'd like to take the ip.
    
  5. DHCP1 unicast or broadcast network information packt for Host1
  6. If Host1 takes the packet, done.

Note that hosts usually take primary / secondary DNS’ information. If primary does not work, it uses secondary.

References

https://d2.naver.com/helloworld/59361 http://americanopeople.tistory.com/115 https://www.netmanias.com/ko/post/blog/5348/dhcp-ip-allocation-network-protocol/understanding-the-basic-operations-of-dhcp