Abstract: With the increasing scale of networks and the growing demand for network mobility, static address allocation for IP management becomes inconvenient for users and increases the workload for network administrators. Dynamic Host Configuration (DHCP) technology effectively solves these problems. This article briefly introduces the working principle of DHCP technology and its application in industrial Ethernet. Practice shows that DHCP technology is of great significance for managing large-scale network systems with high mobility requirements.
Keywords: Industrial Ethernet; DHCP; TCP/IP
1 Introduction
TCP/IP technology successfully constructed the Internet, a high-speed information channel, which has had a significant impact on social development and human production. While this technology has rapidly developed and matured, it has also profoundly influenced the technological development of related fields. Industrial Ethernet based on TCP/IP has been profoundly influenced by TCP/IP technology and has experienced rapid development and widespread application in recent years, becoming a highly anticipated new technology in automation control. The improved industrial Ethernet features real-time performance, stability, versatility, and openness, aligning with the development trend of fieldbus. In addition to its high communication speed, this technology also allows automation equipment to publish web information to the Internet, and users can monitor field data and equipment through web browsers. These new technologies are features that previous fieldbus technologies lacked. Previous fieldbus technologies primarily focused on meeting the requirements of real-time control and interference resistance in industrial environments, and their communication speeds were very low. In contrast, TCP/IP-based industrial Ethernet has broad application prospects and development potential.
DHCP (Dynamic Host Configuration Protocol) is a TCP/IP standard promulgated by the International Organization for Standardization (ISO) to simplify host IP configuration management. The DHCP standard provides an efficient method for using DHCP servers: managing the dynamic allocation of IP addresses and other related configuration information for DHCP-enabled clients on the network. It centrally manages TCP/IP configuration information by automatically assigning IP addresses to computers using the protocol. Compared to manual TCP/IP configuration, DHCP has the following advantages: users do not need to manually enter IP addresses, subnet masks, and default gateway addresses, avoiding communication failures caused by duplicate addresses; and clients do not need to be reconfigured when moving between networks.
DHCP is based on the Bootstrap protocol. It has the ability to reuse network addresses and additional configuration options, and it consists of three parts: DHCP client, DHCP server, and DHCP relay agent. The DHCP server is designated by the administrator and assigns IP addresses and transmits configuration parameters to hosts that require dynamic configuration. The client refers to the host that requests initialization configuration parameters from the server via DHCP. The DHCP client sends a request to the DHCP server, requesting network resource allocation; the DHCP server allocates network resources according to the DHCP client's request. The DHCP relay agent relays requests and relay packets between the DHCP server and the DHCP client. Figure 1 is a schematic diagram of the DHCP model. Compared to TCP/IP networks, DHCP allows clients to be dynamically assigned IP addresses from the DHCP server's IP address database on the local network, aiming to reduce the burden of planning, managing, and maintaining TCP/IP networks. A DHCP server centralizes TCP/IP network settings, dynamically handles workstation IP address configuration, and associates DHCP leases with pre-configured IP addresses. DHCP leases provide a mechanism for automatically and securely allocating and leasing IP addresses on the TCP/IP network, enabling centralized management of IP addresses. This largely eliminates the need for human intervention by network administrators.
2. How DHCP Works
2.1 The IP configuration information exchange process of the DHCP server
DHCP technology is designed to dynamically and flexibly utilize IP addresses, reducing the complexity of TCP/IP network management. It is a client/server protocol. The DHCP server is responsible for the centralized management and allocation of client IP addresses. The IP address database is stored on the server. Clients request and lease IP addresses from the DHCP server. The DHCP server can dynamically and automatically assign IP addresses to clients, or it can assign permanent IP addresses to specific clients. The client's DHCP software searches for DHCP servers on the network and requests an IP address from them.
The process of exchanging IP configuration information with the DHCP server (see Figure 2).
Figure 2. IP configuration information exchange process of the DHCP server.
(1) When a user wants to use TCP/IP, it broadcasts a DHCPDiscover request to find a DHCP server on the network and sends out the DHCP packet through DHCP Relay. If there is a DHCP relay agent on the router, this broadcast packet can also be forwarded to a DHCP server on a remote network. Because the client does not have a U address, the source address can be set to 0.0.0.0, but it includes its hardware address and computer name in the packet, so the DHCP server can respond directly to this machine.
(2) The DHCP server responds to the received DHCP Discover via DHCP offer to determine whether it can provide an IP address for the client. If the DHCP server can provide an IP address for the client, it sends an available IP address from the DHCP database and provides the IP address, subnet mask, and other information to the client using a DHCP Offer packet.
(3) The client obtains the IP address information from the first received data packet, broadcasts a DHCP Request packet to the DHCP server in response, and thus confirms the selection of the IP address. If there are other DHCP servers providing IP addresses, they will receive the corresponding data packets and cancel providing IP addresses; these addresses can still be used.
(4) After the DHCP server's U is approved, it will send a DHCPPack packet to indicate that it accepts the client's request.
2.2 DHCP Protocol and DHCP Server Address Allocation Methods
The propagation protocol used in DHCP is UDP. The hierarchical structure of the DHCP protocol is shown in Figure 3.
Figure 3. Hierarchical Relationship of the DHCP Protocol
(1) The DHCP protocol is composed of Client/Server mode.
(2) UDP (User Datagram Protocol: a member of the TCP/IP family. Unlike IP, UDP does not confirm whether the information has been delivered.)
(3) IP (Internet Protocol): Completes the transmission of information blocks between machines.
(4) Ethernet: A type of local area network that uses CSMA/CD (contention, conflict) control.
The core technology of a DHCP server is the dynamic allocation of IP addresses on a network. Compared to dynamic IP address allocation, the older static IP address allocation method assigned fixed IP addresses, resulting in low utilization for machines that were assigned an IP address but rarely used. A DHCP server can provide three address allocation methods:
① Manual Allocation: This refers to the portion of network management that is manually allocated and managed by network administrators (B00TP management falls into this category);
② Automatic Allocation: This means that once a DHCP workstation successfully leases an IP address from the DHCP server for the first time, that address is permanently assigned to it. This method obviously doesn't offer much advantage.
③ Dynamic Allocation: This refers to the process where, after a DHCP workstation successfully leases an IP address from the DHCP server for the first time, the DHCP server can only temporarily use that address. In other words, the address provided by the DHCP server has a limited time frame, called the lease period. Once the lease expires, the DHCP server will reclaim the address and make it available to other DHCP workstations. Of course, the workstation can also request a new lease to continue using the address when the lease is about to expire.
The biggest advantage of dynamic allocation is that it solves the problem of insufficient IP addresses. In practical applications, we typically configure our local area networks (LANs) as Class C, which can only support a maximum of 254 hosts. If there are 300 hosts on the network, then the IP address shortage will occur.
These three address allocation methods of DHCP servers can ensure that every IP address on the network can be used efficiently, thus solving the problem of insufficient IP addresses to a certain extent, preventing IP address conflicts, and eliminating the need for manual IP address allocation, which can effectively reduce the burden on network administrators.
The DHCP Server and DHCP Relay are typically started with the machine and always run in Daemon mode (they can also be started via command). The DHCP Client also typically starts with the machine (it can also be started via command), and after successfully obtaining an IP address, it runs in Daemon mode, managing the IP address usage time.
3. Advantages of Windows 2000 DHCP Server:
When using DHCP, at least one host running Windows 2000 Server on the entire network must have DHCP software installed, acting as a DHCP server. All other workstations wishing to use DHCP must also support DHCP. When a DHCP workstation starts up, it automatically communicates with the DHCP server, which provides it with an IP address. This address is temporary; when the lease expires, it is returned to the DHCP server and made available to other DHCP workstations. If the original DHCP workstation still needs an IP address, it can lease another IP address from the DHCP server.
DHCP technology is a protocol that operates on top of the TCP/IP protocol and effectively manages Internet addresses (network addresses). It is easy to use and has broad development prospects. The Windows 2000 DHCP server has the following advantages:
(1) Administrators can centrally assign and specify global and subnet-specific TCP/IP parameters for use by the entire network.
(2) Automatically configure TCP/IP for DHCP clients to avoid errors caused by manually setting IP and subnet mask and conflicts caused by assigning an IP address to multiple users.
(3) When a client moves between networks, the old IP address will be released for reuse. When the computer restarts in its new location, the client automatically reconfigures its TCP/IP settings.
(4) Most routers can forward DHCP and BO0IY configuration requests, so no DHCP server is needed on each subnet of the network.
(5) It avoids configuration issues caused by having to manually enter values on each computer. DHCP also helps prevent address conflicts caused by reusing previously assigned U addresses when configuring new computers on the network.
(6) By adopting a lease method, an IP address is requested from the DHCP server when needed and released after use, so that the server IP address can be reused. The lease renewal process also helps to ensure that in situations where client configurations need to be updated frequently (such as users who frequently change locations using mobile or portable computers), these changes can be made efficiently and automatically by communicating directly between the client and the DHCP server.
(7) The DHCP server database of Windows 2000 Server is a dynamic database that is automatically updated when providing or releasing leases to clients, which reduces the difficulty of managing IP addresses. All DHCP client settings and changes are automatically completed by the client and server without manual intervention.
4. Conclusion
Industrial Ethernet has become a major direction for the development of control system networks. With its inherent advantages, it is bound to have excellent application prospects. When studying the application of industrial Ethernet in industrial control scenarios, we should fully utilize existing mature technologies and available new technologies in information networks to improve the network availability of industrial Ethernet and accelerate its research and application in my country. Applying the DHCP protocol to industrial Ethernet solutions simplifies the IP address allocation problem in TCP/IP Ethernet and has enormous development potential; its application areas will undoubtedly continue to expand.
References:
[1] IETF. Dynamic Host Configuration Protocol (EB) RFC2131.1997.
[2] Zheng Wenbo. Control Network Technology. Tsinghua University Press, 2001.
[3] Lu Yu. Dynamic IP address management using DHCP technology. [J]. China Cable Television, 2003 09/10 (64-67).