On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTKernel-32
RTFiles-32
RTIP-32
RTIP-32 Programming Manual
Introduction
TCP/IP Networking
Programming with RTIP-32
Demo Programs
PPP
DHCP Client
DHCP Server
DHCP Client/Server Interaction
DHCP Messages
FTP Client
FTP Server
TFTP Client
TFTP Server
Telnet Client
Telnet Server
Web Server
SNMP Agent
POP3 Client
SMTP Client
SNTP Client
SMB Server
SMB Client
SMB3 Server
SMB3 Client
WLAN Driver
RTIP-32 Reference Manual
RTPEG-32
RTUSB-32
|
DHCP Client/Server Interaction
DHCP configuration is accomplished through the following sequence of steps:
- The DHCP client broadcasts a DHCPDISCOVER message on the local subnet.
- All servers on the subnet receive the DHCPDISCOVER message1. If the servers have any IP addresses available, they broadcast a DHCPOFFER message. The use of "serial numbers" in the packets lets the client know that a certain DHCPOFFER corresponds to a certain DHCPDISCOVER.
- The DHCP client receives all DHCPOFFER messages. Different servers may offer the client different network parameters. The client selects the best DHCPOFFER, and throws away the rest. The client then broadcasts a DHCPREQUEST message, filling in the "server identifier" field of the DHCPREQUEST with the IP address of the server whose DHCPOFFER it has chosen.
- The servers all receive the DHCPREQUEST. They all look to see if their IP address is in the "server identifier" field of the message. If a server does not find its IP address there, it knows the client has rejected its DHCPOFFER. If the server does find its IP address there, it can proceed in one of two ways. If the IP address is still available, and everything is going well, the server broadcasts a DHCPACK to the client. If there is some sort of trouble, the server sends a DHCPNAK instead.
- The client receives either a DHCPACK or a DHCPNAK from the server it selected. If the client receives a DHCPACK, then all is well, and it has now obtained an IP address and network parameters. If the client receives a DHCPNAK, it can either give up or it can restart the process by sending another DHCPDISCOVER. If, for some reason, the client receives a DHCPACK but is still not satisfied, it can broadcast a DHCPDECLINE to the server.
Whenever a DHCP client obtains an IP address from a server, there is a lease time associated with that IP address which determines how long a client is allowed to use the IP address. It is the client's responsibility to keep track of the time; the server sends no notification once the lease has expired.
If the client wishes to extend an existing lease, it can broadcast another DHCPREQUEST to the server, with the "lease time" field of the message set to whatever lease time the client wishes to have. Client/server interaction then proceeds as in step 4 above.
If the client no longer needs the IP address, it may broadcast a DHCPRELEASE message to the server. The server then considers the IP address to be free again, and may lease it to other clients.
DHCP Server
DHCP Messages
|