PXE guiding method based on secondary DHCP

By pre-leasing an idle IP address on the PXE server and performing two DHCP processes, the problem of PXE boot method launching across VLANs in complex network environments is solved, which simplifies operation steps and reduces the risk of startup abnormalities, and realizes convenient network boot .

CN119211198APending Publication Date: 2024-12-27HANGZHOU EBOYLAMP ELECTRONICS CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411257007.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-09
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing PXE boot method is difficult to achieve network boot across VLANs in complex network environments, and requires manual configuration of multiple parameters, resulting in risk of startup exceptions and high operational complexity.

Method used

Using the PXE boot method based on secondary DHCP, the client performs two DHCP processes to obtain network configuration parameters and boot information through the PXE server, simplifies the network boot process and avoids relying on DHCP relay and manual configuration.

Benefits of technology

It enables the booting of cross-VLAN without DHCP relay in complex network environments, reducing operation steps, improving convenience, and reducing the risk of startup abnormalities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211198A_ABST
    Figure CN119211198A_ABST
Patent Text Reader

Abstract

The invention discloses a secondary DHCP (Dynamic Host Configuration Protocol)-based PXE guide method, which comprises the following steps of: establishing a PXE guide environment which comprises a PXE client, a PXE server and a DHCP main server which are positioned in the same local area network; executing preorder DHCP work for leasing an idle IP address from the DHCP master server through a second DHCP client in the PXE server to serve as an IP address pool of a DHCP server in the PXE server; executing DHCP (Dynamic Host Configuration Protocol) guiding work which comprises two DHCP processes; the PXE client analyzes the returned third provision packet to determine PXE boot information, a TFTP client in the PXE client initiates a file transmission request and downloads a startup file from a TFTP server in the PXE server according to the PXE boot information, and the PXE client completes boot according to the returned startup file. According to the method, the convenience of a network guiding process can be improved, and the equipment starting abnormal risk is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the fields of UEFI technology and computer booting technology, and in particular relates to a PXE booting method based on secondary DHCP. Background Art

[0002] With the rapid development of computer technology and computer networks, UEFI (Unified Extensible Firmware Interface) firmware supports more and more media types for booting and starting, usually allowing computers to obtain data from the network rather than local storage devices to perform operating system installation or booting. PXE (Preboot Execution Environment) technology can be used to implement network booting, automatic deployment of operating systems, remote installation of software, etc. Its working principle is as follows: the client sends a request message to the server. After receiving the request message, the server returns a message containing operating system installation options, boot file path and boot file name. The returned message is called a response message. The client downloads the corresponding boot file according to the boot file path and boot file name in the response message and loads the boot program (grubxx.efi) therein. The boot program will guide the computer (client) to load the operating system. At this time, the UEFI firmware enters RT (runtime) mode and downloads the boot configuration file (grub.cfg) through the boot program. Then the operating system root file system will be mounted and the system boot will be executed. In this process, the PXE environment is always in an operational state to provide necessary services when needed.

[0003] The prior art usually uses the PXE boot method to install and deploy the operating system and software. For example, the device to be booted is generally connected to the same local area network and a PXE server such as a DHCP server and a TFTP server is deployed. DHCP (Dynamic Host Configuration Protocol) refers to the Dynamic Host Configuration Protocol, and its main function in PXE is to obtain network parameters and startup parameters. TFTP (Trivial File Transfer Protocol) refers to the Trivial File Transfer Protocol. The path and name of the boot file to be booted usually depend on the opt67 (Bootfile-Name, boot file name) and opt128 (TFTP Server IP address, TFTP server IP address) information of the provided package returned by the DHCP server. If the boot information changes (such as changes in the path and name of the boot file to be booted, etc.), the prior art usually requires reconfiguring the DHCP master server. If the network environment is complex, it is also necessary to configure a DHCP relay service on the DHCP master server. Alternatively, when the boot information changes, there are technical methods to automatically modify the DHCP server information through service delivery. There are also methods to achieve connecting to different TFTP servers through load balancing configuration on the DHCP server, or to perform PXE booting on the wide area network. However, these technologies require dedicated servers such as out-of-band servers and proxy servers to forward data and deliver services. It can be seen that the existing technology has the following disadvantages:

[0004] 1) The prior art has a relatively mature application in the production environment because its network environment is fixed and the operating system (OS) to be booted is usually a fixed image. However, in the debugging environment of the computer and its hardware equipment industry, there is usually not only one set of PXE environment (including different image types and different subnet topologies in the same local area network). According to the prior art solution, to achieve normal boot startup, each PXE environment (DHCP server, TFTP server) and PXE client (device to be booted) must be in an independent network;

[0005] 2) If a PXE environment is deployed in a large switching network, when the boot file information needs to be changed, the provision package information in the DHCP master server needs to be modified, and the boot file path and boot file name need to be set on the DHCP master server. The systemic risk to other devices in the network environment is immeasurable;

[0006] 3) Large switching networks usually use VLAN (Virtual Local Area Network) to isolate broadcast domains. When deploying PXE services in this environment, if the server and the device to be booted are not in the same VLAN, the traditional PXE method will not be able to successfully obtain the correct provisioning package. According to the existing technology, the relay server address can only be set on the DHCP master server by configuring the DHCP relay method. The device to be booted will make a selection after receiving the provisioning package. At the same time, VLAN needs to be configured in the UEFI network protocol stack for file downloading. The DHCP relay method will also affect all devices in the network and is complex to implement;

[0007] 4) Even in the same broadcast domain, when the PXE server is not on the same host, some parameters (such as the name of the boot file, the IP address of the TFTP server, the local IP address, the subnet mask, and the gateway) need to be manually configured to successfully boot. Using this technology to boot requires the user to have a wealth of computer network knowledge and knowledge of the PXE boot principle of UEFI firmware and understand the current network topology and server deployment environment. Finally, the above parameters need to be manually entered. Errors and omissions will result in failure to successfully boot. Summary of the invention

[0008] The purpose of the present invention is to solve the above problems and propose a PXE boot method based on secondary DHCP, which can simplify the network boot process to improve convenience and avoid abnormal risks of device startup.

[0009] To achieve the above object, the technical solution adopted by the present invention is:

[0010] The present invention provides a PXE boot method based on secondary DHCP, comprising the following steps:

[0011] S1, establishing a PXE boot environment, the PXE boot environment includes a PXE client, a PXE server and a DHCP master server in the same local area network, the PXE client is configured with at least a first DHCP client and a TFTP client, and the PXE server is configured with at least a second DHCP client, a DHCP server and a TFTP server;

[0012] S2, executing a pre-sequence DHCP work, where the pre-sequence DHCP work is used to lease a preset number of idle IP addresses from the DHCP master server through the second DHCP client in the PXE server as an IP address pool of the DHCP server in the PXE server;

[0013] S3, perform the DHCP boot work, the DHCP boot work includes two DHCP processes, specifically:

[0014] The first DHCP process:

[0015] Using a first DHCP client in the PXE client to send a second discovery packet to the DHCP master server, and obtain a returned second offer packet, the second offer packet including first network configuration parameters allocated by the DHCP master server to the PXE client, the first network configuration parameters including an IP address, a subnet mask, a default gateway, and a DNS address;

[0016] Implementing network communication of the PXE client according to the first network configuration parameter in the returned second providing package;

[0017] After completing the lease of the IP address in the third offer packet, the PXE client uses the second network configuration parameter in the returned third offer packet to perform network communication, and sends a release packet to the DHCP primary server through the first DHCP client in the PXE client, obtains the returned second response packet, and actively releases the IP address in the second offer packet occupied by the temporary lease to the DHCP primary server;

[0018] Second DHCP process:

[0019] After the network communication of the PXE client is realized according to the first network configuration parameter in the returned second providing package, the first DHCP client in the PXE client actively unicasts and sends a third discovery package to the DHCP server in the PXE server to obtain the returned third providing package, wherein the third providing package includes the second network configuration parameter and PXE boot information, the second network configuration parameter includes an IP address, a subnet mask, a default gateway, and a DNS address, the IP address in the second network configuration parameter is an idle IP address selected by the DHCP server in the PXE server in the IP address pool, and the PXE boot information includes a startup file name, a startup file path, and an IP address of a TFTP server;

[0020] The first DHCP client in the PXE client unicasts the second request packet again to the DHCP server in the PXE server, obtains the returned third response packet, and completes the lease of the IP address in the third provision packet;

[0021] S4. The PXE client parses the returned third providing package to determine the PXE boot information. The TFTP client in the PXE client initiates a file transfer request and downloads a startup file from the TFTP server in the PXE server according to the PXE boot information. The PXE client completes the boot according to the returned startup file.

[0022] Preferably, the second DHCP client in the PXE server leases a preset number of idle IP addresses from the DHCP master server as the IP address pool of the DHCP server in the PXE server, specifically by the second DHCP client in the PXE server performing the following operations:

[0023] S21, actively sending a first discovery packet to the DHCP primary server, and obtaining a returned first offer packet, wherein the first offer packet includes an idle IP address in the DHCP primary server for which a lease is requested;

[0024] S22, confirming the returned first providing packet and sending a first request packet to the DHCP primary server;

[0025] S23, obtaining the returned first response packet, and completing the lease of an idle IP address in the first providing packet;

[0026] S24. Repeat steps S21 to S23 until a preset number of idle IP addresses are leased, completing the IP address pool cache.

[0027] Preferably, before executing the boot DHCP work, the PXE client is enabled and the UDP configuration initialization and the ARP table cache update are completed.

[0028] Preferably, the ARP table is a mapping table for storing IP addresses to MAC addresses.

[0029] Preferably, the IP address in the second network configuration parameter is different from the IP address in the first network configuration parameter.

[0030] Preferably, the PXE server is also configured with an NFS server, and the PXE boot information further includes the IP address of the NFS server.

[0031] Preferably, after the PXE client completes the booting according to the returned startup file, the PXE client also releases the acquired IP address of the third provided package to the PXE server through the PXE client, and exits the PXE booting environment after the release is completed.

[0032] Preferably, the second DHCP client in the PXE server periodically sends a third request packet to the DHCP primary server before the lease expires, obtains a returned fourth response packet, and completes the renewal of the IP address in the IP address pool.

[0033] Compared with the prior art, the present invention has the following beneficial effects:

[0034] The present invention solves the problem of having to rely on the provision package of the DHCP master server in the network environment to obtain the startup information, solves the problem that it can only be used in the same broadcast domain and cannot be used across VLANs when no DHCP relay is added, and improves the method of only being able to modify the Option parameters of the DHCP master server when modifying the startup file information, thereby avoiding the problem of causing abnormal startup risks of other devices in the network. Specifically: firstly, the second DHCP client in the PXE server needs to lease a preset number of idle IP addresses from the DHCP master server in the current network in advance as a dedicated address pool to avoid conflicts and renew the lease regularly; then the PXE client (device to be booted) Compared with the prior art, the boot DHCP work includes two DHCP processes. The first one is to apply for a legal IP address from the DHCP master server in the current network in a broadcast form, to achieve temporary communication through the first network configuration parameters, and to obtain information from the DHCP server in the PXE server in the network for the second time. That is, after receiving the second provide packet, the PXE client initiates a second Discover request (third discovery packet) to the PXE server in a unicast form through the currently obtained IP address. The interaction process between the first DHCP client in the PXE client and the DHCP server in the PXE server performs two DHCP unicast communications. In the two DHCP processes of booting DHCP work, network configuration parameters are first obtained through the DHCP master server and then PXE boot information is obtained from the specified PXE server. Only the PXE server address needs to be set to start the boot through the specified PXE boot environment with one click, which simplifies the network boot process. For example, after setting a known PXE server address in the UEFI firmware configuration interface in the debugging environment, the network boot startup item is entered. Without configuring the DHCP relay service, the UEFI firmware can automatically connect to the PXE server under different VLANs to obtain the startup file and complete the boot. When the boot file path, startup file name and other information to be booted change, only the Option parameter on the PXE server specified in the UEFI firmware needs to be modified, and the DHCP master server does not need to be modified to take effect. In a complex network environment, the user does not need to be proficient in the UEFI and PXE boot startup principles. Only one parameter (the IP address of the PXE server) can be used to connect and correctly boot the startup system. This method has obvious advantages when booting and installing the operating system. In a large network environment, the operation steps can be reduced to improve convenience. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a flow chart of the PXE booting method based on secondary DHCP of the present invention;

[0036] Figure 2 This is a flow chart of steps S2 to S4 of the present invention. DETAILED DESCRIPTION

[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0038] It should be noted that, unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art in the technical field of this application. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0039] Some of the terms involved in this application are explained as follows:

[0040] PXE client: refers to the hardware device loaded with UEFI firmware to be booted (referred to as the boot device).

[0041] PXE server: generally refers to the service environment used for PXE booting. In the present invention, it specifically refers to the service environment where the second DHCP process in the DHCP booting work of the PXE client is located. The PXE server includes at least two parts: DHCP service and TFTP service.

[0042] Relationship between DHCP server and PXE server: DHCP server is used to provide dynamic network parameters to PXE client, such as IP address and boot file information, including boot file name and boot file path, etc. PXE server is a broad concept, which includes multiple services required by PXE environment, for example, DHCP service, TFTP service, NFS service, NTP service, etc. These services are usually deployed on the same host, so this host is called PXE server. In some network environments, these services may also be distributed and deployed on different hosts. Then, the host cluster deployed with these PXE services is usually called PXE server (cluster), or PXE service environment. The unified term used in this application is "PXE server".

[0043] Unicast DHCP: This is the second DHCP process that guides DHCP work. Specifically, unicast DHCP means that the DHCP message (such as D.discover3, R.request2) sent by the DHCP server in the PXE server and the first DHCP client in the PXE client is sent to a single DHCP client, rather than broadcasting to all DHCP clients in the network. In the unicast DHCP process, the DHCP server will send a specific DHCP Offer to the DHCP client requesting an IP address to provide the network configuration information required by the client.

[0044] DHCP Offer: describes the network configuration information provided by the DHCP server to the DHCP client. When the DHCP client sends a DHCP Discover packet to the DHCP server to request network configuration parameters, the DHCP server will respond with an Offer packet, which contains the IP address, subnet mask, default gateway, DNS address and other information requested by the DHCP client. This information is used to configure the network connection of the DHCP client and allows the DHCP client to automatically obtain other required network configuration parameters, such as MAC address, time synchronization, etc. It is usually included in a DHCP Response message and sent to the DHCP client. After receiving the DHCP Offer message (Offer packet), the DHCP client can automatically configure its own network connection based on this information.

[0045] like Figure 1-2 As shown, a PXE boot method based on secondary DHCP includes the following steps:

[0046] S1. Establish a PXE boot environment, which includes a PXE client, a PXE server, and a DHCP master server in the same local area network. The PXE client is configured with at least a first DHCP client and a TFTP client, and the PXE server is configured with at least a second DHCP client, a DHCP server, and a TFTP server.

[0047] In one embodiment, the ARP table is a mapping table for storing IP addresses to MAC addresses.

[0048] In one embodiment, the PXE server is also configured with an NFS server, and the PXE boot information also includes the IP address of the NFS server. It is easy to understand that the PXE server can also configure other services according to actual needs, such as NTP (Network Time Protocol) service.

[0049] S2. Execute a pre-sequence DHCP work, where the pre-sequence DHCP work is used to lease a preset number of idle IP addresses from the DHCP main server through the second DHCP client in the PXE server as an IP address pool of the DHCP server in the PXE server.

[0050] In one embodiment, the second DHCP client in the PXE server leases a preset number of idle IP addresses from the DHCP master server as the IP address pool of the DHCP server in the PXE server, specifically, the second DHCP client in the PXE server performs the following operations:

[0051] S21, actively sending a first discovery packet to the DHCP primary server, and obtaining a returned first offer packet, wherein the first offer packet includes an idle IP address in the DHCP primary server for which a lease is requested;

[0052] S22, confirming the returned first providing packet and sending a first request packet to the DHCP primary server;

[0053] S23, obtaining the returned first response packet, and completing the lease of an idle IP address in the first providing packet;

[0054] S24. Repeat steps S21 to S23 until a preset number of idle IP addresses are leased, completing the IP address pool cache.

[0055] That is, the above steps S21 to S23 are repeated according to a preset number to complete the IP address pool cache of the DHCP server in the PXE server. The specific preset number can be adjusted according to actual needs.

[0056] In one embodiment, before executing the boot DHCP work, the PXE client is enabled and the UDP configuration initialization and ARP table cache update are completed.

[0057] S3, perform the DHCP boot work, the DHCP boot work includes two DHCP processes, specifically:

[0058] The first DHCP process:

[0059] Using a first DHCP client in the PXE client to send a second discovery packet to the DHCP master server, and obtain a returned second offer packet, the second offer packet including first network configuration parameters allocated by the DHCP master server to the PXE client, the first network configuration parameters including an IP address, a subnet mask, a default gateway, and a DNS address;

[0060] Implementing network communication of the PXE client according to the first network configuration parameter in the returned second providing package;

[0061] After completing the lease of the IP address in the third offer packet, the PXE client uses the second network configuration parameter in the returned third offer packet to perform network communication, and sends a release packet to the DHCP primary server through the first DHCP client in the PXE client, obtains the returned second response packet, and actively releases the IP address in the second offer packet occupied by the temporary lease to the DHCP primary server;

[0062] Second DHCP process:

[0063] After the network communication of the PXE client is realized according to the first network configuration parameter in the returned second providing package, the first DHCP client in the PXE client actively unicasts and sends a third discovery package to the DHCP server in the PXE server to obtain the returned third providing package, wherein the third providing package includes the second network configuration parameter and PXE boot information, the second network configuration parameter includes an IP address, a subnet mask, a default gateway, and a DNS address, the IP address in the second network configuration parameter is an idle IP address selected by the DHCP server in the PXE server in the IP address pool, and the PXE boot information includes a startup file name, a startup file path, and an IP address of a TFTP server;

[0064] The first DHCP client in the PXE client again unicasts the second request packet to the DHCP server in the PXE service end, obtains the returned third response packet, and completes the lease of the IP address in the third provision packet.

[0065] In one embodiment, the IP address in the second network configuration parameter is different from the IP address in the first network configuration parameter. For example, the IP address in the second network configuration parameter is an idle IP address selected by the DHCP server in the PXE server from the IP address pool, and the IP address in the first network configuration parameter is an idle IP address assigned by the DHCP master server.

[0066] S4. The PXE client parses the returned third providing package to determine the PXE boot information. The TFTP client in the PXE client initiates a file transfer request and downloads a startup file from the TFTP server in the PXE server according to the PXE boot information. The PXE client completes the boot according to the returned startup file.

[0067] In one embodiment, after the PXE client completes the booting according to the returned startup file, the PXE client also releases the acquired IP address of the third providing package to the PXE server through the PXE client, and exits the PXE booting environment after the release is completed.

[0068] In one embodiment, the second DHCP client in the PXE server periodically sends a third request packet to the DHCP master server before the lease expires, obtains the returned fourth response packet, and completes the renewal of the IP address in the IP address pool. For example, the second DHCP client in the PXE server sends a third request packet (R.request3) to the DHCP master server, and the DHCP master server replies with a fourth response packet (A.ask4) to complete the renewal of the IP address.

[0069] This method is mainly implemented on the UEFI firmware (i.e., PXE client), and is described in detail below:

[0070] When the UEFI firmware boots to the DXE (Driver Execution Environment) stage, the driver (UefiPxeBcDxe) will be loaded. The driver provides the PXE basic code protocol (PxeBc) for accessing the PXE server for network booting. The following introduces the various protocol interfaces and implementations provided by the driver, such as Figure 2 As shown, where:

[0071] The PXE client boot process is as follows:

[0072] The EfiPxeBcStart function in EFI_PXE_BASE_CODE_PROTOCOL is the entry function for the start of PXE client boot. When PXE boot starts, it will initialize UDP configuration (UDP Configure) and enable cache update of ARP (AddressResolution Protocol) table (Enable ARP cache update). ARP table is a mapping table that stores IP address to MAC address. It is used to convert between network layer addressing (i.e. IP address) and data link layer addressing (i.e. MAC address).

[0073] Then call the PxeBcDhcp4Dora function to start PXE DHCP work (DORA) through UDPv4. During the PXE DHCP work, the PXE client (here refers to the device running PXE, that is, the device to be booted) will broadcast a Discover request (the second discovery packet, i.e. D.discover2) to the DHCP master server as the first DHCP client, and obtain a unicast reply Offer packet (the second offer packet, i.e. O.offer2). The Offer packet contains the first network configuration parameters (IP address, subnet mask, gateway, DNS address, etc.) allocated by the DHCP master server to the PXE client. The PXE client uses the first network configuration parameters in the Offer message to To communicate within the network, the traditional PXE should respond to the DHCP server with a Request request to confirm the reference to the IP address. The method of the present application does not directly lease the IP address in the Offer packet (O.offer2) returned by the DHCP master server, but temporarily occupies this address for temporary communication, and does not request the address from the DHCP master server. Specifically: of the four steps D\O\R\A in the DHCP work, only the first two steps (D\O, i.e. Discover\Offer) are performed on the DHCP master server, and the last two steps (R\A, i.e. Request\Ask) are not performed. Temporary occupation means using the address for short-term temporary communication without requesting the DHCP master server to use the address. Under normal circumstances, according to the existing technical solution, once leased, it will be used according to the DHCP lease time, which is generally several hours, occupying IP address resources. The technical solution here only uses the first network configuration parameters (IP address, subnet mask, default gateway, DNS address) to obtain secondary unicast (i.e., the interaction between the first DHCP client in the PXE client and the DHCP server in the PXE server) from the DHCP server in the PXE server. This process is generally completed within a few seconds, and then the temporarily occupied IP address is released to the DHCP main server in a timely manner.

[0074] By using the first network configuration parameter assigned by the DHCP master server, the PXE client can now access the network normally (i.e. after receiving the second offer packet (O.offer2) in the first DHCP process). In this configuration state, the first DHCP client in the PXE client actively initiates a Discover packet (third discovery packet, such as D.discover3) again and sends it to the DHCP server of the PXE server in the form of unicast. The PXE server selects an unused IP address in the IP address pool and assigns it to the PXE client and adds the boot information (Boot information, including the boot file name and boot file path) in the PXE boot environment in the Option parameter, and unicasts it to the PXE client in the form of an Offer packet (the third offer packet, such as O.offer3). Then, the PXE server replies to the Request request (the second request packet, such as R.request2) to apply for an address lease for subsequent file transmission. After receiving it, the PXE server replies to the PXE client with the third response packet (A.ask3) to complete the IP address lease. After the lease is completed, the PXE client uses the network configuration information (second network configuration parameter) provided by the PXE server to perform network communication, and at this time promptly sends a release message (R.release) to actively release the previously temporarily occupied IP address to the DHCP master server.

[0075] Then the PXE client enters the subsequent boot process, firstly, the third offer package (O.offer3) obtained in the aforementioned DHCP working process is parsed through the PxeBcDiscoverBootServer function to determine the PXE server environment (such as the IP address of the TFTP server required in the PXE boot information and the IP address of the optional NFS server, etc.), and after the determination is completed, the PxeBcLoadBootFile function is called to download the boot file. At this time, the PXE client, as a TFTP client, calls PXEMtftpprotocol to download the boot file from the PXE server through the TFTP server, and then executes the boot (BoolLoad) according to the downloaded boot file until the boot is successful, and releases the IP address in the third offer package (O.offer3) obtained to the PXE server, and exits the PXE boot environment. The third offer package (O.offer3) is a DHCP Offer option (Option parameter), and the present invention focuses on the name of the boot file and the IP address of the TFTP server. These two parameters are related to the correct boot of the operating system.

[0076] The workflow of the DHCP master server is as follows:

[0077] The DHCP master server is a general DHCP server in the network and does not need to be specially configured (i.e., the parameters are generally configured in advance by the network administrator. Such parameters are not members of the PXE server in the PXE process of the present invention, so no special configuration is required). It can only provide key information such as IP address, subnet mask, default gateway, DNS (domain name resolution server) address, etc. There is no need to reflect the parameters related to PXE boot. When the DHCP master server receives the Discover request (first discovery packet, D.discover1) broadcast initiated by the second DHCP client in the PXE server, it unicasts and responds to the Offer packet (first offer packet, i.e., O.offer1) to allocate an idle IP address in the IP address pool to it. The first offer packet (O.offer1) contains the basic network parameters in the current network (IP address, subnet mask, default gateway, DNS (domain name resolution server) address, etc.). When receiving the Request request (first request packet, i.e., R.request1) broadcast initiated by the PXE server, it unicasts and responds to it (first response packet, i.e., A.ask1) to establish an IP address lease.

[0078] When the DHCP master server receives the Discover request (second discovery packet, i.e. D.discover2) broadcast initiated by the first DHCP client in the PXE client, it unicasts a response to the Offer packet (second offer packet, i.e. O.offer2) to allocate a free IP address in the IP address pool to it. The second offer packet (O.offer2) contains the basic network parameters in the current network (key information such as IP address, subnet mask, default gateway, DNS (Domain Name Resolution Server) address, etc.). When the DHCP master server receives the Release request (release packet, i.e. R.release) broadcast initiated by the first DHCP client in the PXE client, it unicasts a response (second response packet, such as A.ask2) to it to release the IP address lease.

[0079] The PXE server workflow is as follows:

[0080] First, the second DHCP client in the PXE server actively broadcasts a Discover request (the first discovery packet, i.e., D.discover1) to the DHCP master server in the network, and after receiving the response Offer packet (the first offer packet, i.e., O.offer1) unicasted back by the DHCP master server, it confirms and broadcasts a Request request (the first request packet, i.e., R.request1) to the DHCP master server. When the response (the first answer packet, i.e., A.ask1) unicasted back by the DHCP master server is received, an IP address lease is established. This process is repeated according to a preset number to complete the IP address pool cache of the DHCP server in the PXE server, and the preset number of idle IP addresses requested for the lease are used as the subsequent dedicated addresses of the PXE client.

[0081] When the DHCP server in the PXE server receives the Discover request (third discovery packet, i.e. D.discover3) unicasted by the first DHCP client in the PXE client during the second DHCP process, it unicasts to respond with an Offer packet (third offer packet, such as O.offer3) and allocates a free IP address in the IP address pool and PXE boot information to it. The third offer packet (O.offer3) contains the basic network parameters in the current network (key information such as IP address, subnet mask, default gateway, DNS (Domain Name Resolution Server) address) and PXE boot information (boot file name, boot file path, TFTP server IP address, and optionally also NFS server IP address). When the Request request (second request packet, R.request2) unicasted by the PXE client is received again, it unicasts to respond (third response packet, i.e. A.ask3) to establish an IP address lease. The secondary unicast transmission process in the second DHCP process is completed.

[0082] The TFTP server in the PXE server is started when the PXE server environment is initialized. When the TFTP server in the PXE server receives a transmission request initiated by the TFTP client in the PXE client, it provides a TFTP-based file transfer service to the client.

[0083] It should be noted that the subnet mask, default gateway, DNS address in the first network configuration parameter and the subnet mask, default gateway, DNS address in the second network configuration parameter are all allocated by the DHCP master server, that is, the first network configuration parameter is directly given by the DHCP master server to the PXE client, and the second network configuration parameter is directly given by the DHCP master server to the PXE server. They will be automatically allocated according to the network environment. The subnet mask, default gateway, and DNS address of the two can be the same or different.

[0084] It should be understood that, although the steps in each flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0085] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0086] The above-described embodiments only express the more specific and detailed embodiments described in this application, but they cannot be understood as limiting the scope of the patent application. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of this application, which all belong to the protection scope of this application. Therefore, the protection scope of the patent application shall be based on the attached claims.

Claims

1. A PXE boot method based on secondary DHCP, characterized in that: The PXE boot method based on secondary DHCP comprises the following steps: S1, establishing a PXE boot environment, wherein the PXE boot environment includes a PXE client, a PXE server, and a DHCP master server in the same local area network, wherein the PXE client is configured with at least a first DHCP client and a TFTP client, and the PXE server is configured with at least a second DHCP client, a DHCP server, and a TFTP server; S2, executing a pre-sequence DHCP work, wherein the pre-sequence DHCP work is used to lease a preset number of idle IP addresses from the DHCP main server through the second DHCP client in the PXE server as an IP address pool of the DHCP server in the PXE server; S3, executing the bootstrap DHCP work, the bootstrap DHCP work includes two DHCP processes, specifically: The first DHCP process: Using a first DHCP client in the PXE client to send a second discovery packet to the DHCP primary server, and obtain a returned second offer packet, wherein the second offer packet includes first network configuration parameters allocated by the DHCP primary server to the PXE client, and the first network configuration parameters include an IP address, a subnet mask, a default gateway, and a DNS address; Implementing network communication of the PXE client according to the first network configuration parameter in the returned second providing package; After completing the lease of the IP address in the third offer packet, the PXE client uses the second network configuration parameter in the returned third offer packet to perform network communication, and sends a release packet to the DHCP primary server through the first DHCP client in the PXE client, obtains the returned second response packet, and actively releases the IP address in the second offer packet occupied by the temporary lease to the DHCP primary server; Second DHCP process: After the network communication of the PXE client is realized according to the first network configuration parameter in the returned second providing packet, the first DHCP client in the PXE client actively unicasts and sends a third discovery packet to the DHCP server in the PXE server to obtain the returned third providing packet, wherein the third providing packet includes the second network configuration parameter and PXE boot information, wherein the second network configuration parameter includes an IP address, a subnet mask, a default gateway, and a DNS address, wherein the IP address in the second network configuration parameter is an idle IP address selected by the DHCP server in the PXE server in the IP address pool, and the PXE boot information includes a startup file name, a startup file path, and an IP address of a TFTP server; The first DHCP client in the PXE client unicasts the second request packet again to the DHCP server in the PXE server, obtains the returned third response packet, and completes the lease of the IP address in the third provision packet; S4. The PXE client parses the returned third providing package to determine the PXE boot information. The TFTP client in the PXE client initiates a file transfer request and downloads a startup file from the TFTP server in the PXE server according to the PXE boot information. The PXE client completes the boot according to the returned startup file.

2. The PXE boot method based on secondary DHCP as claimed in claim 1, characterized in that: The step of leasing a preset number of idle IP addresses from the DHCP main server through the second DHCP client in the PXE server as the IP address pool of the DHCP server in the PXE server is specifically to perform the following operations through the second DHCP client in the PXE server: S21, actively sending a first discovery packet to the DHCP primary server, and obtaining a returned first offer packet, wherein the first offer packet includes an idle IP address in the DHCP primary server for which a lease is requested; S22, confirming the returned first providing packet and sending a first request packet to the DHCP primary server; S23, obtaining the returned first response packet, and completing the lease of an idle IP address in the first providing packet; S24. Repeat steps S21 to S23 until a preset number of idle IP addresses are leased, completing the IP address pool cache.

3. The PXE boot method based on secondary DHCP as claimed in claim 1, characterized in that: Before the execution of the DHCP boot work, the PXE client is enabled and the UDP configuration initialization and ARP table cache update are completed.

4. The PXE boot method based on secondary DHCP as claimed in claim 3, characterized in that: The ARP table is a mapping table for storing IP addresses to MAC addresses.

5. The PXE boot method based on secondary DHCP as claimed in claim 1, characterized in that: The IP address in the second network configuration parameter is different from the IP address in the first network configuration parameter.

6. The PXE boot method based on secondary DHCP as claimed in claim 1, characterized in that: The PXE server is also configured with an NFS server, and the PXE boot information also includes the IP address of the NFS server.

7. The PXE boot method based on secondary DHCP as claimed in claim 1, characterized in that: After the PXE client completes the booting according to the returned startup file, the PXE client also releases the acquired IP address of the third provided package to the PXE server through the PXE client, and exits the PXE booting environment after the release is completed.

8. The PXE boot method based on secondary DHCP as claimed in claim 1, characterized in that: The second DHCP client in the PXE server periodically sends a third request packet to the DHCP main server before the lease expires, obtains the returned fourth response packet, and completes the renewal of the IP address in the IP address pool.

Citation Information

Cited By

  • Pre-boot execution environment boot time optimization method and program product

    CN120528894A