> DHCP is a protocol at the application layer, so it must depend on the IP protocol in the network layer. But the IP protocol requires assignment of IP addresses to network interfaces, which is the job of DHCP. Do DHCP and IP depend on each other, and therefore require the existence of each other in advance? How does this cyclic dependency work?

It's not a _hard_ dependency; IP existed for a long time before DHCP (or BOOTP, or RARP). Hosts can have their IP address configured manually or in any other ways<sup>1</sup> without DHCP.

But DHCP on IPv4 works in a somewhat unusual way &ndash; unlike other (normal) UDP-based protocols, a DHCP client is allowed to send packets from the "zero" address `0.0.0.0` while the host doesn't yet have a valid IP address.

The DHCP client software achieves this by using "raw sockets" where it manually builds whole IP packets (adding the UDP header and the IP header) instead of letting the OS add the usual lower-layer processing. So although _technically_ the protocol is transported inside UDP/IP, it does not actually depend on the operating system's IP stack working at all.

On IPv6 the situation is different as every IPv6-capable interface automatically has a "link-local" IPv6 address (the <code>fe80:&hellip;</code> address), so the host can just use that to send and receive its DHCPv6 packets &ndash; or ICMPv6 Router Solicitations, or anything else needed for configuration.

---

<sup>1</sup> (Some link types have their own configuration mechanisms: for example, anything that uses PPP &ndash; like PPPoE or PPTP VPNs or oldschool dial-up &ndash; will use PPP-integrated configuration instead of DHCP. Mobile networks also do their own thing.)