README 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. DHCP (Dynamic Host Configuration Protocol) Examples
  2. ===================================================
  3. 1. WiredDHCP
  4. ------------
  5. This scenario introduces how DHCP works when multiple hosts and a single DHCP
  6. server are present. At random startup times, the clients request IP addresses
  7. from the server, which serves them from its address pool.
  8. client[0], client[1], ..., client[9] receive the addresses 192.168.1.100 through
  9. 192.168.1.109, respectively. The lease time is configured to be relatively low
  10. (1000s), causing the clients to periodically renew their addresses.
  11. 2. WirelessDHCP
  12. ---------------
  13. This is a real-life example where wireless hosts are configured by the
  14. DHCP server while the rest of the network (all wired interfaces) are
  15. configured manually using the IPv4NetworkConfigurator.
  16. Once the wireless clients associate with the AccessPoint, they send
  17. out a DHCPREQ and receive their own IP addresses along with the
  18. gateway address. At t=3s the clients start pinging the 'remote' server
  19. verifying whether the received IP and gateway address is correct.
  20. 3. RebootingDHCP
  21. ----------------
  22. This scenario demonstrates how DHCP works when a client or a server reboots.
  23. The client starts DHCP initialization at 0.5s, and receives IP address
  24. 192.168.1.100 shortly after.
  25. The client shuts down at 60s and reboots at 70s. The behavior implemented
  26. in DHCPClient is that the client remembers its last assigned IP address
  27. after the reboot, and if the address has not expired yet, then DHCP will
  28. start up in the INIT-REBOOT state and tries to reallocate this old IP address.
  29. In this example, the client's old lease has not expired yet (the lease time
  30. in this scenario is 150s), thus the client will successfully renew it.
  31. The server shuts down at 80s and reboots at 90s, and loses its lease database.
  32. When client reaches T1 timeout at 145s (T1 = 0.5*leaseTime), it tries to
  33. extend its current lease. This request will be rejected by the server, because
  34. it no longer knows about the client. After the refusal, the client restarts
  35. the whole DHCP process, and asks for a new address. The server will offer the
  36. first available address from its pool, which is again 192.168.1.100 since there
  37. are no other clients in the network.