I'm carrying out an experiment to test the mechanism behind DHCP. In this topology, I disable the link between the switch and the router. However, the computer still request IP address successfully. How the DHCP server can recognize the broadcast address sent by the computer?
Basic DHCP has no relation to a router.
- A DHCP client broadcasts a Discovery message.
- One or more DHCP servers reply with a DHCP Offer (unicast).
- The client selects one of the offers and broadcasts a DHCP Request for the offered address (the broadcast inform additional servers that their offer isn't selected).
- The DHCP server Acknowledges the requested address and the client can use it.
Generally, the DHCP client and the server (or relay agent) must share a broadcast domain (same simple switch or same VLAN).
A router isn't used unless a DHCP relay agent routes the request to a remote DHCP server.
DHCP fallows DORA process
Firstly when we enable DHCP on Client machine .. client will trigger broadcast message in network searching for DHCP server ..
DHCP server respond back to client with unicast packet offering free ip address , subnet mask and gateway and dns server ips
Client chosse this ip address with request received from DHCP server and acknowledge the dhcp server after receiving ip ..
It depends on the setup of the DHCP server and client computer as far as the network
- If they exist on the same VLAN broadcast traffic is used at layer 2 (switching) and no router is needed
- If they exist on a different Subnet, The router VLAN interface for the client computer's VLAN would need to be set up with a helper address pointing to the DHCP server
In case 1, removing the router would do noting to stop DHCP because it is handled at the VLAN (layer 2)level
In case 2, removing the router after the client has been configured would not effect the client until a reboot (in which a new DHCP request would be sent to the server)