DHCP protocol flows are different with, getting a new address and getting the previously assigned address. Figure2 shows the first case:
- DHCP client broadcasts a DhcpDiscover. The client may specify preference of a lease and/or an IP address.
- DHCP server receiving the DhcpDiscover may return DhcpOffer or may not return (Many servers may receives the DhcpDiscover). If a server decides to respond, server puts an available address into yiaddr field and broadcasts the DhcpOffer. At this point, there is no agreement of an assignment between the server and the client.
- Client gets one or more DhcpOffers and chooses one server from them. The client puts the IP address of the server into the Server identifier option of a DhcpRequest and broadcasts it to a server.
- The server checks the Server identifier option. If it does not match with its own address, the server considers it as an implicit decline. The selected server sends the DhcpAck (if its address is available) or the DhcpNak (for example, the address is already assigned to another client).
- The client that gets the DhcpAck starts using the IP address. If it gets DhcpNak, it restarts from step 1.
- The client finds a problem with the assigned address of DhcpAck, it sends DhcpDecline to the server, and restarts from step 1.
- The client can release the address before its lease expires by DhcpRelease. This process is not absolutely required.
沒有留言:
張貼留言