Network card network configuration method and device, storage medium and electronic equipment
By directly configuring the network parameters of the Smart NIC at the hardware level through the BMC, the problem of low network configuration efficiency of NICs in large-scale server clusters is solved, and efficient and secure network initialization and management are achieved.
Patent Information
- Application Number
- CN202511320223.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-16
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-09-16
AI Technical Summary
In large-scale server clusters, static IP address configuration of smart network cards is inefficient and has a high error rate. In particular, it cannot be effectively configured without an operating system or network services, affecting the efficiency and security of network configuration.
The hardware address of the target network card is obtained through the baseboard management controller (BMC), the network address is determined, and the register value is directly written into the register of the network card, bypassing the operating system and driver to implement hardware-level network parameter configuration.
It improves the efficiency and security of network card configuration, reduces configuration errors, enhances system stability and resource utilization, and is suitable for large-scale automated deployment scenarios.
Smart Images

Figure CN120825469A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network configuration, and in particular to a method and device for configuring a network card network, a storage medium, and an electronic device. Background Art
[0002] During the deployment and network initialization of large-scale server clusters, automated testing and configuration become key steps in ensuring network stability and improving operational efficiency. SmartNICs, with their powerful data processing and network management capabilities, have become a core component in data center technology architectures. They perform network management and data processing tasks at the hardware level, reducing host load and improving network efficiency and security.
[0003] However, with the increasing complexity of data center networks, efficiently and securely configuring these smart network cards in batches, especially their static IP addresses, has become a challenge. Related art network card configuration methods often require loading specific drivers and configuring them within the operating system. In large-scale server clusters, such as those with 256 cards, configuring static IP addresses via network protocols like SSH / Telnet can significantly increase the time and error rate. Furthermore, in situations such as system crashes, network configuration becomes impossible, impacting network configuration efficiency. This means that related art network card configuration methods suffer from low efficiency. Summary of the Invention
[0004] The present application provides a method and device for configuring a network card network, a storage medium, and an electronic device, so as to at least solve the problem of low efficiency of the method for configuring a network card network in the related art.
[0005] The present application provides a method for configuring a network card network, comprising: obtaining a target hardware address corresponding to a target network card, wherein the target hardware address is used to indicate the target network card;
[0006] Determining a target network address of the target network card based on the hardware address, and determining a first register value according to the target network address, wherein the target network address is used to indicate a digital label of the target network card, and the first register value is used to indicate the target network address;
[0007] The first register value is written into a register of the target network card, wherein the register of the target network card is used to set network parameters of the target network card.
[0008] The present application also provides a network card network configuration device, comprising: a hardware address acquisition module, configured to acquire a target hardware address corresponding to a target network card, wherein the target hardware address is used to indicate the target network card;
[0009] a network address determination module, configured to determine a target network address of a target network card based on the hardware address, and to determine a first register value according to the target network address, wherein the target network address is used to indicate a digital label of the target network card, and the first register value is used to indicate the target network address;
[0010] The register writing module is used to write the first register value into the register of the target network card, wherein the register of the target network card is used to set the network parameters of the target network card.
[0011] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned methods for configuring a network card network when executing the computer program.
[0012] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for configuring a network card network are implemented.
[0013] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned network card network configuration methods when executed by a processor.
[0014] This application obtains a target hardware address corresponding to a target network card, where the target hardware address indicates the target network card; determines a target network address of the target network card based on the hardware address, and determines a first register value based on the target network address, where the target network address indicates a digital label of the target network card and the first register value indicates the target network address; and writes the first register value into a register of the target network card, where the register of the target network card is used to set network parameters for the target network card. A server's baseboard management controller (BMC) can obtain the hardware address of the target network card in the server, thereby determining the network address of the target network card in the server and obtaining the corresponding first register value based on the network address. The BMC can directly write the first register value into the register via the configuration space, thereby implementing network configuration for the network card through the hardware side. This eliminates the need for the server's operating system and driver to implement network configuration, expands the use cases for network configuration, and improves configuration efficiency. This addresses the technical issue of low efficiency in current network card network configuration methods, achieving the technical effect of improving network configuration efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0016] Figure 1 is a schematic diagram of a hardware environment for an optional method for configuring a network card network according to an embodiment of the present application;
[0017] Figure 2 is a flowchart of an optional method for configuring a network card network according to an embodiment of the present application;
[0018] Figure 3 is a schematic diagram of an optional method for configuring a network card network according to an embodiment of the present application;
[0019] Figure 4 is a schematic diagram of another optional method for configuring a network card network according to an embodiment of the present application;
[0020] Figure 5 This is a structural block diagram of an optional network card network configuration device according to an embodiment of the present application. DETAILED DESCRIPTION
[0021] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0022] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0023] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0024] According to one aspect of the embodiment of the present application, a method for configuring a network card network is provided. As an optional implementation, the above-mentioned method for configuring a network card network can be applied to, but is not limited to, Figure 1 The network card network configuration system in the hardware environment shown in FIG. The network card network configuration system may include, but is not limited to, a baseboard management controller (BMC) 102 , an out-of-band management network port 104 , a high-speed switch (PCIe switch) 106 , a network card 1 108 , a network card 2 110 , and a network card 3 112 .
[0025] Specifically, the BMC and PCIe switch are connected via the motherboard's internal PCIe bus (x1 or x4), with the BMC acting as the root-complex. NC-SI or RGMII out-of-band channels can also be used, depending on the motherboard implementation. The PCIe switch and network adapters (NIC 1, NIC 2, and NIC 3) each connect as a PCIe endpoint to the switch's downstream port. The switch supports SR-IOV, which allows multiple virtual functions (VFs) to be created for each physical function (PF) for concurrent configuration. Administrators can access the server through the IPMI tool (out-of-band management network port) through the system.
[0026] The baseboard management controller (BMC) 102 can be an independent microcontroller integrated into the server motherboard (common examples include the ASPEED AST2500 / AST2600 and Nuvoton NPCM7xx). It has its own ARM / RISC-V core, RAM, Flash, and MAC. Even if the main CPU is shut down or the operating system crashes, the BMC remains operational. The AST2600 features a 4-lane PCIe Gen2 interface, allowing it to be used as a root-complex PCIe switch.
[0027] The high-speed switch (PCIe switch) 106 can be a high-speed switch chip (Broadcom PEX8900, Microchip Switchtec, Intel IFS series), which expands one upstream port into N downstream ports, each with an independent PCIe configuration space. This can expand a single BMC PCIe port to ≥ 256 downstream ports, corresponding to 256 network cards.
[0028] Network card 1 108 , network card 2 110 , and network card 3 112 are merely examples, and the specific number of network cards is not limited.
[0029] The embodiment of the present application provides a method for configuring a network card network. Figure 2 This is a flowchart of an optional method for configuring a network card network according to an embodiment of the present application; the method for configuring a network card network can be executed by a BMC, such as Figure 2 As shown, the configuration method of the network card network includes:
[0030] Step S202, obtaining a target hardware address corresponding to the target network card, wherein the target hardware address is used to indicate the target network card;
[0031] It should be noted that the target network card refers to a specific network interface card (NIC) that needs to be configured or managed, and may refer to a smart network card based on a DPU (Data Processing Unit). The target hardware address usually refers to a MAC address, a hardware address that uniquely identifies a network interface and is used for communication and identification purposes below the network layer. In the automated testing system and method, the target hardware address is used to clearly indicate the specific network card that needs to be operated. MAC address, Media Access Control Address, Media Access Control Address, is a unique identifier assigned to a network interface controller (NIC) and is used to identify and address devices in a local area network (LAN). BMC, Baseboard Management Controller, Baseboard Management Controller, is a microprocessor located on the server motherboard that is used to monitor and manage the system hardware status and provide remote management capabilities.
[0032] In an alternative embodiment, during the configuration or management process, the automation system first needs to identify the specific network interface card. To do this, it needs to obtain the MAC address of the network interface card. The MAC address, as a unique identifier of the network interface, helps the automation system locate the target network interface card and perform operations on it.
[0033] The BMC plays a crucial role in automated configuration, especially in out-of-band management without operating system intervention. It not only monitors server health but also initializes and configures network hardware. When batch configuring SmartNICs (VFs) and other SmartNICs, the BMC obtains the MAC address of each VF on the SmartNIC through some means.
[0034] In an optional implementation, the SmartNIC typically stores the MAC address information for each VF. The BMC can retrieve this MAC address information by directly accessing the SmartNIC's PCIe configuration space or a specific management interface. Specifically, the BMC can directly query the SmartNIC's hardware registers, such as the MAC address register, to obtain the hardware address of the target VF.
[0035] In some cases, MAC addresses may be preconfigured in the BMC's memory before deployment, or stored in a database accessible to the BMC, such as a MAC-IP mapping database. In this mode, the BMC does not need to directly access the SmartNIC's hardware registers, but instead retrieves the target VF's MAC address information from its own storage. This approach is particularly useful when offline configuration or pre-planning of the network is required.
[0036] Regardless of the method used, the BMC acquires the MAC address at the hardware level and is independent of the operating system. This means that even without an operating system or network services, the BMC can still effectively identify and configure the VF on the SmartNIC, enabling automated batch testing and configuration, greatly improving the efficiency and security of large-scale network device management in data centers. In this way, the BMC becomes a bridge between network hardware and automated configuration systems, ensuring effective management and control of SmartNICs in any environment.
[0037] Step S204, determining a target network address of the target network card based on the hardware address, and determining a first register value according to the target network address, wherein the target network address is used to indicate a digital label of the target network card, and the first register value is used to indicate the target network address;
[0038] It's important to note that the target network address refers to the IP address of the target network card. This digital label uniquely identifies network devices at the network layer and is a key parameter in network communications. The first register value refers to the hardware control register value inside the SmartNIC that stores and represents the target network address (i.e., IP address). These values can be read or written using specific hardware instructions to complete network address configuration.
[0039] In an optional implementation, the corresponding IP address is determined from the known hardware address (MAC address) and further converted into a recognizable value in the SmartNIC hardware control register, namely the first register value. This ensures that each target NIC obtains and stores the correct IP address, enabling initial network configuration without operating system intervention.
[0040] In an optional embodiment, the target network address (IP address) corresponding to each target network card's hardware address (MAC address) is determined based on a predefined MAC-IP mapping table. This typically requires a mapping database or algorithm that associates MAC addresses with pre-defined IP addresses. The determined target network address (IP address) is then converted into a register value at the SmartNIC hardware level, namely the first register value. This conversion process involves converting the IP address from the common dotted decimal format (e.g., 192.168.1.10) to a hexadecimal data format that can be accepted and stored by the network card's hardware control registers.
[0041] This approach allows for direct hardware-level operations, bypassing dependencies on the operating system and network services, enabling efficient initialization and network address configuration for Smart NICs. This is particularly critical for large-scale automated testing and deployment in data center environments. Furthermore, this approach enhances the stability and security of NIC configuration, reducing errors and the risk of configuration failures.
[0042] Step S206: writing the first register value into the register of the target network card, wherein the register of the target network card is used to set the network parameters of the target network card.
[0043] It should be noted that the first register value refers to network configuration parameters that have been converted into a format understandable by the hardware. For example, the IPv4 address 192.168.1.100 / 24 is converted to the hexadecimal register value 0xC0A80164, and the MTU (Maximum Transmission Unit) value 9000 is converted to the register value 0x2328. The registers of the target NIC can be hardware units within the SmartNIC that store and control network parameters. For example, control registers 0xA000 to 0xA003 are used to store IPv4 addresses, and 0xB010 is used to set the MTU size.
[0044] In an optional implementation, during the automated configuration process, the encoded network parameters (i.e., the first register value) are written to specific hardware registers to directly set the network parameters of the network card at the hardware level. This direct writing to the hardware registers bypasses the operating system, enabling a more direct and efficient configuration method.
[0045] Example 1:
[0046] Assuming that automated batch configuration of DPU-based smart network cards is being performed, the following is an embodiment of steps S202 to S206:
[0047] Step S202: Obtain the MAC address of the target network card;
[0048] The BMC uses ipmitool to read the MAC address control register of the Smart NIC using the IPMI raw command to obtain the MAC address of each VF, for example, 00:1B:44:11:22:33.
[0049] Step S204: converting network parameters into register values;
[0050] For network parameters that need to be configured, such as the IP address 192.168.1.100 / 24, convert it to the hexadecimal register value 0xC0A80164; MTU9000 is also converted to 0x2328.
[0051] Step S206: Write the network parameters into the target register.
[0052] The BMC uses the ipmitool tool and the IPMI raw command to write 0xC0A80164 to control registers 0xA000 to 0xA003 and 0x2328 to the MTU control register 0xB010.
[0053] In this embodiment, the BMC serves as the core component of automated configuration. It obtains the target network card's MAC address from the hardware layer (step S202), then converts network parameters into register values (step S204). Finally, by directly writing these values into hardware registers (step S206), network parameter configuration is achieved without operating system intervention. This allows for zero-touch initialization of the Smart NIC, making it particularly suitable for large-scale automated deployment scenarios in cloud computing data centers.
[0054] The present application obtains a target hardware address corresponding to a target network card, where the target hardware address indicates the target network card; determines a target network address of the target network card based on the hardware address, and determines a first register value based on the target network address, where the target network address indicates a digital label of the target network card and the first register value indicates the target network address; and writes the first register value into a register of the target network card, where the register of the target network card is used to set network parameters for the target network card. A server's baseboard management controller (BMC) can obtain the hardware address of the target network card in the server, thereby determining the network address of the target network card in the server and obtaining the corresponding first register value based on the network address. The BMC can directly write the first register value into the register via the configuration space, thereby implementing network configuration for the network card through the hardware side. This eliminates the need to implement network configuration through the server's operating system and driver, expands the use cases for network configuration, and improves configuration efficiency. This method addresses the technical issue of low efficiency in current network card network configuration methods, achieving the technical effect of improving network configuration efficiency. The BMC not only improves configuration efficiency but also enhances configuration security and stability, as hardware-level operations are not affected by operating system crashes or other software issues. In addition, since configuration operations are performed directly at the hardware level, CPU resource usage is reduced, further improving the overall performance and resource utilization of the data center.
[0055] In an optional embodiment, determining the target network address of the target network card based on the hardware address, and determining the first register value according to the target network address, includes one of the following:
[0056] 1) searching for a target network address in an address mapping table based on the target network address, and generating a first register value according to the target network address, wherein the target network address is used to indicate a correspondence between a hardware address of at least one network card and a network address;
[0057] 2) Receive first configuration information sent by the network configuration module, and determine a first register value from the first configuration information.
[0058] It should be noted that the address mapping table is a database or list that records the correspondence between MAC addresses and IP addresses, making it possible to find the IP address that a network card should have based on its MAC address. This is a key data structure for implementing automated network configuration. The network configuration module refers to the software module responsible for generating or sending network configuration information. It may be located on the management server in the data center and is responsible for overall network planning and resource allocation tasks. The first configuration information contains the network parameters of the target network card, such as IP address, subnet mask, MTU, etc. These parameters will be converted into register values and written directly into the hardware.
[0059] In an optional implementation, the BMC can find the corresponding IP address information in a pre-established address mapping table based on the MAC address of the target network card, and then convert these network parameters (such as IP address, subnet mask and MTU) into corresponding register values, namely the first register value, to directly configure the network card hardware.
[0060] In an optional embodiment, the BMC receives first configuration information sent by a network configuration module. In this case, the specific network configuration details (such as the IP address, subnet mask, and MTU) are not determined by the BMC itself, but are sent by a dedicated network configuration module. After receiving this configuration information, the BMC directly extracts the required network parameters from it and converts them into first register values for subsequent hardware write operations.
[0061] In alternative implementations, whether receiving configuration information through an address mapping table or from a network configuration module, the core goal is to ensure that the SmartNIC obtains the correct network parameters, which are stored in specific control registers in a format that the hardware can understand. This approach frees the NIC from operating system dependency, enabling network parameter settings to be completed through out-of-band management channels even when the server is powered off or the system is not booted. This is particularly important for automated batch deployments in hyperscale data centers.
[0062] In an optional implementation manner, after obtaining the target hardware address corresponding to the target network card, at least one of the following is further included:
[0063] 1) Writing a second register value corresponding to the target hardware address into a register of the target network card, wherein the second register value is used to indicate the target hardware address;
[0064] 2) writing the third register value into the register of the target network card, wherein the third register value is used to indicate the number of bits of the subnet mask of the target network card;
[0065] 3) Writing the fourth register value into the register of the target network card, wherein the fourth register value is used to indicate the maximum value of the transmission data of the target network card.
[0066] It should be noted that the second register value refers to the representation of the MAC address in the SmartNIC hardware control register, that is, the register value used to store the MAC address at the hardware level. The third register value is the hardware control register value used to indicate the number of subnet mask bits in the network configuration, which directly determines the range and mode of network communication. The fourth register value is used to set the hardware control register value of the MTU (maximum transmission unit). The MTU determines the maximum packet size that the NIC can transmit at one time, affecting the efficiency and compatibility of network transmission.
[0067] In an optional embodiment, after obtaining the hardware address (ie, MAC address) of the target network card, the automated configuration process further includes at least one of the following:
[0068] Convert the MAC address from common binary or hexadecimal format to a control register value that can be recognized by the hardware, and write it to the hardware register of the SmartNIC through direct hardware access (such as IPMI instructions or PCIe bus access) to ensure that the MAC address configuration at the hardware level is correct.
[0069] The number of bits in the subnet mask is converted into a hardware control register value and written directly into the register of the Smart NIC to ensure that the NIC can understand and execute the network segmentation rules and process data packets correctly.
[0070] Convert the MTU size to a hardware control register value and write it to the relevant registers of the Smart NIC to ensure that the NIC sends and receives data according to the set maximum transmission unit size, thereby optimizing network transmission efficiency and compatibility.
[0071] In an optional implementation, once the MAC address of the target network card is obtained, the next step involves converting other key network parameters of the network card, such as the MAC address itself, the number of subnet mask bits, and the MTU (maximum transmission unit) size, into hardware-readable register values and writing them directly into the hardware control registers of the network card. This process ensures that even if the operating system is not started or the network service is unavailable, the network card can still obtain all necessary network parameters, thus achieving complete offline pre-configuration.
[0072] Example 2:
[0073] Assume that the NIC is configured with MAC 00:1B:44:11:22:33. Convert the ip addr command parameters to the NIC control register values:
[0074] For example, 192.168.1.100 / 24 → register 0xA000-0xA003 = 0xC0A80164;
[0075] MTU 9000 → Register 0xB010 = 0x2328;
[0076] Execute ipmitool -H out of band<BMC_IP> raw 0x30 0xC3\\;
[0077] 00 1B 44 11 22 33\\ # MAC address;
[0078] C0 A8 01 64\\ # IP address 192.168.1.100;
[0079] 18\\ # Subnet mask 24 bits;
[0080] 00 00 23 28 # MTU9000;
[0081] Specifically:
[0082] 0x30 is an IPMI domain identifier, and 0xC3 is a custom IPMI command used to write network configuration.
[0083] 00 1B 44 11 22 33 is the MAC address of the target network card, expressed in hexadecimal form.
[0084] C0 A8 01 64 is the converted hexadecimal register value of the IPv4 address 192.168.1.100.
[0085] 18 is the register value of the 24-bit subnet mask expressed in hexadecimal.
[0086] 00 00 23 28 is the hexadecimal register value after MTU9000 conversion.
[0087] 0x30 0xC3 can be a command to write the network card configuration. An IPMI message can be up to 16 bytes. To improve throughput during batch concurrency, a 16-byte value can be set. As shown above, the values at byte offsets 0–5 are 00 1B 44 11 2233, indicating the target network card's MAC address, used to uniquely locate multiple cards. The values at byte offsets 6–9 are C0 A8 01 64, indicating the IPv4 address, used to indicate 192.168.1.100. The value at byte offset 10 is 18, indicating the subnet mask length. The values at byte offsets 13–14 are 23 28, indicating the MTU. The value at byte offset 15 is 00, indicating the CRC8 checksum, which will be explained later.
[0088] Through the above-mentioned implementation of the present application, not only the MAC address, but also all network parameters including the number of subnet mask bits and MTU are directly configured into the hardware control register of the smart network card, realizing true hardware-level configuration, improving the efficiency, accuracy and security of the configuration, and is particularly suitable for large-scale automated deployment scenarios in data centers.
[0089] In an optional embodiment, before searching for the target network address in the address mapping table based on the target network address, it includes: obtaining a preset network address set and a candidate hardware address corresponding to each of at least one candidate network card, wherein the preset network address set is used to indicate the network address corresponding to each of at least one candidate network card; and generating an address mapping table by matching at least one candidate hardware address with the network address in the preset network address set one by one.
[0090] It should be noted that the preset network address set can be a predefined list of IP addresses for allocation to candidate network cards to ensure the consistency and predictability of network configuration. Candidate network cards can be smart network cards to be configured or tested. The "candidate" here indicates that they are network cards that may be assigned specific IP addresses in the future. The candidate hardware address can be the MAC address of the candidate network card, that is, the physical layer address of each network card, which is used to uniquely identify the device in communications below the network layer. The address mapping table establishes a table or database of the correspondence between candidate hardware addresses and network addresses in the preset network address set. It is the basis for realizing automated network configuration.
[0091] In an optional implementation, before using the target network address (i.e., IP address) to search for the hardware address (MAC address), the system needs to first obtain a preset network address set and the MAC addresses of each candidate network card, and establish a MAC-IP mapping table based on this information to ensure that each MAC address has a corresponding IP address.
[0092] Creating a reliable MAC-IP mapping table is a critical step in automating batch configuration of Smart NICs. It ensures that each NIC has a unique IP address and provides the necessary data foundation for subsequent out-of-band operations.
[0093] In an optional embodiment, the system collects the hardware addresses (MAC addresses) of all candidate network cards and pre-planned network addresses (IP addresses). For example, there are two candidate network cards in the system, whose MAC addresses are 00:11:22:33:44:55 and 00:11:22:33:44:56, and the pre-planned network address set includes 192.168.1.10 / 24 and 192.168.1.11 / 24.
[0094] Next, the system maps the MAC address of each candidate network card to its preset IP address to generate a mapping table. In this example, the mapping table is as follows:
[0095] MAC Address|Network Address;
[0096] 00:11:22:33:44:55|192.168.1.10 / 24;
[0097] 00:11:22:33:44:56|192.168.1.11 / 24;
[0098] In an optional embodiment, the address mapping table is encrypted using the AES-256 encryption standard to ensure security. This ensures that even if the mapping table is accessed without authorization, its contents cannot be easily deciphered. The encrypted mapping table is stored in a secure area within the BMC, such as Flash or secure RAM.
[0099] After the mapping table is established and improved, the system also needs to divide VLANs (virtual local area networks) and plan gateways to ensure connectivity and security in different network environments (such as the external network and the internal network). For example, the system can divide 192.168.1.0 / 24 into the external network VLAN and specify the external network gateway as 192.168.1.1; and divide 172.23.1.0 / 24 into the internal network VLAN and specify the internal network gateway as 172.23.1.1.
[0100] The above-described implementation of this application ensures that network configuration and management of smart network cards can be completed without operating system intervention, greatly improving the speed and security of large-scale network device deployment in data center environments. Creating encrypted MAC-IP mapping tables and planning VLANs and gateways not only prevents configuration information leakage but also ensures effective management and isolation of network traffic, avoiding potential security threats and resource abuse.
[0101] In an optional embodiment, after obtaining the target hardware address corresponding to the target network card, it includes: receiving second configuration information sent by the network configuration module, wherein the second configuration information is used to indicate configuration information of at least one reference network card, and the at least one reference network card includes the target network card; determining the register value of the reference network address corresponding to each reference network card according to the second configuration information; and writing the register value of at least one reference network address into the register of the corresponding reference network card.
[0102] It should be noted that the network configuration module is the system component responsible for network planning and configuration information generation. It typically runs on a management server in a data center and is used to coordinate and manage the configuration operations of large-scale network devices. The second configuration information contains the configuration details of multiple reference network cards, including but not limited to the IP address, subnet mask, and MTU. This information is generated by the network configuration module and sent to the BMC. The reference network card refers to the Smart NIC that requires network parameter configuration, including all network cards that require network initialization, including the target network card. The register value of the reference network address is the network address of the reference network card (such as the IP address) converted into a format readable by the Smart NIC hardware control registers, namely a hexadecimal value. For example, 192.168.1.200 is converted to 0xC0A801C8.
[0103] The information sent by the network configuration module contains the configuration requirements of all reference network cards. The BMC needs to parse this information, determine the network address register value of each network card, and then configure the network parameters by directly writing into the hardware register.
[0104] In an optional embodiment, after receiving the second configuration information from the network configuration module, the BMC extracts configuration parameters for all reference network cards, such as the IP address, subnet mask, and MTU, from the second configuration information. Based on the configuration parameters, the BMC converts the network address into a hexadecimal register value, which is then written directly into the hardware control registers of the SmartNIC. The BMC uses specific IPMI protocol commands, using the ipmitool tool, to write the register value of the reference network address into the corresponding register of each reference network card.
[0105] In small-scale network deployments, the BMC can use traditional routing configuration methods to implement initial configuration of smart network cards: before configuring new network parameters, the BMC needs to first clear any old routes that conflict with the new configuration to avoid network confusion. Based on the second configuration information, the BMC configures routing rules for both internal and external network segments for each network card to adapt to the access requirements of different network environments. The BMC uses ipmitool to concurrently configure multiple network cards through IPMI raw instructions, reducing manual intervention and improving efficiency. For example, a loop structure is used to batch configure network cards. To prevent configuration loss due to server restart, the BMC will write the configuration instructions to the / etc / rc.local script to ensure that these network configuration instructions are automatically executed when the system starts.
[0106] Example 3:
[0107] In small-scale deployment scenarios, such as configuring the network for a relatively small server cluster (e.g., 10 or fewer servers), a more concise traditional routing configuration method can be used. This method focuses on using IPMI (Intelligent Platform Management Interface) commands for batch, concurrent hardware-level network configuration, while ensuring that the configuration information remains valid after server restarts. The following is a detailed analysis of this configuration process:
[0108] Before making a new configuration, you first need to clear any old routing rules that may exist on the server to avoid conflicts between the old and new rules and resulting in network configuration confusion. This step ensures a clean network configuration environment and makes the subsequent configuration process smoother.
[0109] For servers that support dual or multiple network cards, you need to configure their respective network rules, including but not limited to the IP address, subnet mask, gateway, and MTU (Maximum Transmission Unit). These rules ensure that each network card can independently access the preset network environment, thereby achieving network redundancy and load balancing.
[0110] IPMI provides a standard management interface that allows the management system to control the server hardware out-of-band. In this application, hardware-level network configuration is achieved through IPMI batch configuration instructions. The specific instructions are as follows:
[0111] for i in range(10):
[0112] ipmitool -H<BMC_IP> raw 0x30 0xC4 \\;
[0113] $(mac[i]) $(ip[i]) $(mask[i]) $(mtu[i]);
[0114] ipmitool is a tool for sending IPMI commands, which can remotely control the hardware status of the server, including network configuration.
[0115] -H<BMC_IP> Specify the BMC IP address of the target server. The BMC is a microprocessor in the server that monitors the server's health and receives and executes IPMI commands from the management platform.
[0116] In raw 0x30 0xC4, raw indicates sending a raw IPMI message, 0x30 is the BMC network function group code, and 0xC4 is a specific command code used to set network configuration information (such as IP address, subnet mask, etc.).
[0117] $(mac[i]), $(ip[i]), $(mask[i]), $(mtu[i]): These variables represent the MAC address, IP address, subnet mask, and MTU value of the i-th network card of the server to be configured. By traversing the script, network configuration can be performed simultaneously on multiple servers in the cluster, greatly improving configuration efficiency.
[0118] After completing the network configuration, to ensure that the configuration information persists across server restarts, the configuration instructions need to be persistently stored. The most common approach is to write the above IPMI configuration instructions into the server's startup script, typically in the / etc / rc.local file. This way, each time the server restarts, these configuration instructions are re-executed, restoring the network configuration information and maintaining server network connectivity and correctness.
[0119] For small-scale server clusters, using IPMI commands for hardware-level network configuration is an efficient and straightforward approach. Through prior preparation, including removing potentially conflicting routes and establishing clear network rules, coupled with the concurrent execution of IPMI commands, network configuration for multiple servers can be quickly completed. Finally, by incorporating key configuration commands into the server's startup scripts, configuration persistence and network continuity across system reboots are ensured, providing a stable and reliable network foundation for small-scale deployments.
[0120] In an optional implementation, for automated batch deployments in hyperscale data centers, the BMC and network configuration module adopt a more efficient approach: using PXE (Preboot eXecution Environment) technology to boot the server over the network, with the TFTP server providing the pxelinux.0 boot file, which then guides the server into the Kickstart configuration process. The network configuration module generates a Kickstart response file (ks.cfg) for each server, pre-populating partition information, a list of installed packages, and network parameter configuration for the Smart NIC. Based on the configuration information in the ks.cfg file, the BMC simultaneously writes network parameters for multiple reference NICs, significantly improving the efficiency of large-scale deployments. Similar to small-scale deployments, the BMC writes configuration commands to the / etc / rc.local file to ensure that the network configuration automatically takes effect after the server restarts.
[0121] Example 4:
[0122] When deploying servers in batches of 50 or more nodes in a data center or enterprise network, traditional manual configuration or logging in to configure each server individually is inefficient and prone to errors. The following is a detailed explanation of this solution:
[0123] Set up a DHCP / TFTP server;
[0124] The Dynamic Host Configuration Protocol (DHCP) server is responsible for automatically assigning IP addresses to server nodes on the network, providing the necessary network communication capabilities for PXE booting. During the initial stages of a large-scale deployment, each node needs to obtain a temporary IP address to download boot files and configuration information. The DHCP server must be configured to assign a specific IP address pool and boot information pointing to the pxelinux.0 file on a TFTP server. This is typically achieved by editing the DHCP server's configuration file (such as dhcpd.conf) to ensure that each node automatically obtains the necessary information upon booting.
[0125] A TFTP (Trivial File Transfer Protocol) server is used to transfer small files, such as the boot file pxelinux.0, across a network. During the PXE boot process, the server node needs to download pxelinux.0 from the TFTP server to begin the automated configuration process. Place the pxelinux.0 boot file and the Kickstart file (ks.cfg), along with any other necessary boot images (such as the kernel and initial ramdisk), on the TFTP server. Configure the TFTP server to serve these files to specific MAC addresses or IP address ranges.
[0126] Generate a Kickstart response file;
[0127] The Kickstart file (ks.cfg) is a text file that contains all the configuration information needed to automate the installation of a Linux operating system. It allows administrators to pre-define the partition structure, software package installation list, system settings (such as the root password and time zone), and network configuration (including IP parameters for multiple network cards). The ks.cfg file should specifically list all server network parameters, including static IP addresses, subnet masks, default gateways, and VLAN information. It can also include the server's partition layout and required software packages, enabling fully automated system installation and configuration.
[0128] Parallel configuration execution;
[0129] When the server nodes start, they obtain temporary IP addresses from the DHCP server through PXE and download the boot file pxelinux.0 from the TFTP server. The pxelinux.0 file instructs the server to download the Kickstart answer file and begin the automated installation and configuration process.
[0130] The instructions in the Kickstart file are executed by the bootloader, automatically installing the selected Linux distribution and setting up the server's hardware partitions, installation software packages, and network configuration based on the configuration information in the ks.cfg file. For servers with multiple network cards, Kickstart will automatically assign IP addresses based on pre-set parameters.
[0131] Using PXE and TFTP servers, you can provide boot files and Kickstart configurations to multiple server nodes simultaneously. This means the entire deployment process can be carried out in parallel on multiple servers, significantly reducing the time required for large-scale deployments.
[0132] To ensure that the configuration persists across system reboots, the network configuration must be written to persistent storage. This is typically accomplished in a Kickstart file using commands such as "ifdown ens1f0" and "ifup ens1f0." However, for greater control and compatibility, the configuration steps can also be written to / etc / rc.local or a corresponding system initialization script. Writing network configuration instructions to a system startup script like / etc / rc.local ensures that the configuration is automatically reapplied upon each system reboot, preventing network configuration loss after reboot and improving system stability and ease of maintenance.
[0133] Through the above-mentioned implementation methods of this application, the large-scale automated batch deployment solution in this application, through PXE+Kickstart technology, realizes seamless integration from network infrastructure construction to automated installation and configuration of server nodes. Starting from the construction of DHCP and TFTP servers, to the generation of detailed Kickstart response files, and then to the parallel execution of configuration, the solution ensures the high efficiency and reliability of static IP pre-configuration of BF3 smart network cards in an environment without network connection. By persisting configuration information, the configuration persistence after system restart is further guaranteed, reducing the operation and maintenance workload, and improving the efficiency and security of large-scale data center network deployment.
[0134] In an optional embodiment, after writing the first register value to the register of the target network card, it includes: obtaining a reference register value of a target position in the register of the target network card, wherein the target position is used to indicate the position of the register of the target network card where the first register value is written; determining the target network address according to the address mapping table and the target hardware address, and generating the first register value according to the target network address; and determining that the configuration of the target network card is completed when the first register value and the reference register value are the same.
[0135] It should be noted that the reference register value of the target location is in the hardware control registers of the SmartNIC, which are predefined locations for storing specific network parameters. For example, the registers used to store IP addresses may be marked as 0xA000 to 0xA003, while the register storing MTU may be 0xB010.
[0136] In an optional embodiment, an important check is performed after the first register value (i.e., the hardware value corresponding to the network parameter, such as the register value of the IP address) is written - reading the reference register value of the target position in the register of the target network card and comparing it with the expected first register value to confirm whether the configuration is successful.
[0137] When configuring a Smart NIC at the hardware level, writing network parameters is only the first step; ensuring these parameters are correctly set is crucial. After writing the first register value to the target NIC's control register, the system proceeds with the following steps: Using a specific IPMI command (such as ipmitool raw 0x30 0x00), the system reads the target location's value in the NIC's control register as a reference register value. Based on a pre-established address mapping table and the target NIC's hardware address (MAC address), the system regenerates the first register value, representing the hardware representation of the network parameters. The read reference register value is compared with the generated first register value. If they match, the target NIC's network parameters are successfully configured. If not, the system re-executes the configuration command until the correct configuration is achieved.
[0138] Example 5:
[0139] Suppose you are configuring a Smart NIC on a server with a hardware address (MAC address) of 00:11:22:33:44:55. According to the address mapping table, the network parameters to be configured are 192.168.1.10 / 24 and an MTU of 9000. Registers 0xA000 to 0xA003 of the target NIC should already be written with the IP address register value 0xC0A8010A, while register 0xB010 should be written with the MTU register value 0x2328. The BMC uses the ipmitool tool, using the raw command, to read register values 0xA000 to 0xA003 and register 0xB010 as reference values. Based on the address mapping table and the target hardware address 00:11:22:33:44:55, the IP address register value 0xC0A8010A and the MTU register value 0x2328 are recalculated. The read register value is compared with the regenerated first register value. If the values 0xA000 to 0xA003 are equal to 0xC0A8010A and the value 0xB010 is equal to 0x2328, the system can confirm that the network parameter configuration of the target network card is successful.
[0140] In an optional implementation, during the automated batch configuration of smart network cards, a CRC32 checksum mechanism can be used to check the integrity of the configuration data to ensure the accuracy of the network parameter configuration. Specifically, after the network parameters (such as IP address, subnet mask, MTU, etc.) are converted into hardware control register values and written to the hardware control registers of the network card through the BMC, the system will read the values of these registers again and calculate a new checksum using the CRC32 algorithm. This newly generated checksum is compared with the previously calculated and stored checksum. If the two match, it indicates that the configuration data was not damaged or changed during the writing process and the configuration was successful; if they do not match, it indicates that there may be an error in the configuration process and a retry or troubleshooting is required.
[0141] During hardware-level configuration of Smart NICs, especially in large-scale automated deployments, every step of the data transmission and hardware writing process can introduce unexpected errors and data corruption. CRC32 calculates and compares checksums to verify data integrity immediately after configuration completion, which is crucial for promptly detecting and correcting configuration errors. Especially in complex environments with unstable networks or multipath configurations, CRC32 provides additional security, ensuring that NIC configurations remain accurate and consistent even under harsh conditions.
[0142] Suppose that when configuring a server's Smart NIC, parameters such as the IP address, subnet mask, and MTU are written as a series of register values into the NIC's hardware control registers. To ensure the accuracy of these configuration values, the system uses a CRC32 checksum: the IP address 192.168.1.100 is converted to the register value 0xC0A80164, the subnet mask 255.255.255.0 (24 bits) is converted to 0x00000018, and the MTU 9000 is converted to 0x00002328. These values are then written to the corresponding registers using the ipmitool tool. Before writing the configuration, the system calculates a CRC32 checksum based on these register values, such as 0x1B90C4C5, and stores it in a secure location, such as the BMC's memory. After the configuration is complete, the system reads all register values from the hardware control registers and recalculates the checksum using the same CRC32 algorithm. The newly calculated CRC32 checksum is then compared with the previously stored checksum. If they are consistent, it indicates that the configuration data has not changed during the transmission and writing process, and the configuration is successful. Conversely, if the checksum does not match, it means that an error occurred during the configuration process, which may be a hardware write failure, a data transmission error, or a hardware failure. At this time, the system will start the retry mechanism and attempt to reconfigure until it succeeds or the maximum number of retries is reached.
[0143] The above-described implementation of the present application ensures the accuracy of hardware configuration, effectively avoiding configuration errors or omissions even in complex data center environments, and ensuring the normal operation and management of network equipment. Through CRC32 verification, the automated testing system can effectively identify data integrity issues during the configuration process, ensuring that each configuration parameter is accurately written to the hardware control register of the Smart NIC, thereby improving the configuration success rate and the network stability of the entire data center.
[0144] In an optional embodiment, after writing the first register value to the register of the target network card, the method includes: when the first register value is written to the register of the target network card, reading a check value at a preset position of the register of the target network card; when the check value indicates that the configuration of the target network card is completed, determining that the configuration of the target network card is completed; when the check value indicates that the configuration of the target network card fails, adding one to the check failure value and reading the check value; when the check failure value is greater than a preset failure value, determining that the configuration of the target network card fails.
[0145] It should be noted that the checksum value is a hardware register value used to monitor the configuration status during the SmartNIC configuration process. By reading this value, you can determine whether the configuration is complete or whether any errors occurred during the configuration process. The preset location is a specific register location in the SmartNIC hardware that stores configuration status information, such as bit 0 of register 0xD000, which is used to monitor configuration success. The preset failure value can be the maximum number of consecutive checksum failures allowed by the system. If this number is exceeded, the NIC configuration is considered a failure. For example, three retries are allowed.
[0146] In an optional embodiment, after writing the first register value (i.e., the hardware representation of the network configuration parameters), the system reads the value of a preset location in the target network card via an IPMI command to monitor the configuration status. If the read checksum indicates that the configuration was successful (for example, the value of bit 0 of 0xD000 is 1), the system determines that the configuration process of the target network card has been completed. If the checksum indicates that the configuration failed, the system increments a failure counter and then reads the updated checksum value, repeating this process until the failure counter exceeds the preset failure value.
[0147] After hardware-level network configuration is complete, ensuring configuration accuracy and NIC availability is crucial. By reading bit 0 of the SmartNIC hardware status register 0xD000, the system can monitor the configuration status, a key monitoring point. If configuration is successful, bit 0 should be set to 1 (or another predefined value indicating success). However, configuration may fail on the first attempt due to network conditions, hardware response time, or other unforeseen factors.
[0148] In an optional implementation, the raw command of the ipmitool tool is used to read the value of 0xD000 bit 0, that is, ipmitool -H<BMC_IP> Raw 0x30 0xD0, where 0xD0 is an example read command code, is used to read bit 0 of status register 0xD000. If bit 0 is 1, the configuration is considered successful; if it is 0, the configuration is considered unsuccessful. In the event of a configuration failure, the system will record the failure and automatically retry after a 15-second timeout, up to three times. If bit 0 is still 0 after three retries, the target network card configuration is determined to have failed.
[0149] It should be noted that RSA-2048 certificates can be used for bidirectional authentication between the BMC and the SmartNIC, ensuring security and reliability during data exchange. A dynamic key decryption mechanism is used during the encrypted transmission of the MAC-IP mapping table, ensuring that even if the mapping table is eavesdropped on by an unauthorized third party, its contents cannot be easily decrypted or tampered with, thus enhancing the security of network devices during automated batch configuration.
[0150] RSA is a widely used public-key encryption algorithm. A 2048-bit RSA certificate is a digital certificate generated using the RSA algorithm and consisting of a 2048-bit key pair (public and private keys). A digital certificate is used to verify the identity of a network communication entity. It contains a public key, which can be used in conjunction with the entity's private key for encryption and decryption, ensuring data transmission security. In secure network communication, both parties must verify each other's identity. Between the BMC and the SmartNIC, this means the BMC must verify the SmartNIC's identity using the SmartNIC's public key, and the SmartNIC must verify the BMC's identity using the BMC's public key. During data transmission, dynamic keys are used for encryption and decryption. Dynamic keys refer to the use of new encryption keys for each data exchange, rather than fixed keys. This means that even if a key is intercepted, it cannot be used to decrypt subsequent data packets.
[0151] In an optional embodiment, in a large-scale automated testing system in a data center, the communication security between the BMC and the smart network card is extremely important because it is directly related to the accuracy of the network configuration and the overall security of the network equipment. The BMC and the smart network card each hold a digital certificate consisting of a corresponding public key and private key. These certificates use the RSA algorithm and have a key length of 2048 bits, providing high-strength encryption protection. At the beginning of each communication, the BMC uses the public key of the smart network card to authenticate the identity of the smart network card. At the same time, the smart network card also uses the public key of the BMC to verify the legitimacy of the BMC, ensuring that only authenticated parties can exchange data, effectively preventing unauthorized access attempts. During the configuration process, the MAC-IP mapping table will be encrypted and transmitted, and the private key held by the BMC is used to decrypt the mapping table. Moreover, the key used for each decryption is dynamic, which means that even if the key is leaked, it will not pose a security threat to subsequent communications because the next data packet will be encrypted with a new key.
[0152] The above-described implementation of the present application ensures that, even if the initial configuration fails during the hardware-level configuration process, an automatic retry mechanism can be used to attempt to restore the configuration. This improves the reliability of the configuration process and reduces the need for manual intervention, making it very suitable for large-scale automated network equipment deployment in data centers. Through two-way authentication and dynamic decryption mechanisms, communication security and data integrity are effectively guaranteed when configuring network equipment. Even in data centers with complex and changing network environments, the network equipment configuration process can be protected from illegal interference, enhancing the system's overall security protection capabilities.
[0153] In an optional embodiment, obtaining a target hardware address corresponding to a target network card includes: determining at least one virtual network card corresponding to the target network card; obtaining a virtual hardware address corresponding to each of the at least one virtual network cards, wherein the virtual hardware address is used to indicate the virtual network card; determining a target network address of the target network card based on the hardware address, and determining a first register value according to the target network address, including: searching an address mapping table for a virtual network address corresponding to each of the at least one virtual network cards based on the at least one virtual hardware address, and generating at least one virtual register value according to the at least one virtual network address; writing the first register value into a register of the target network card includes: writing at least one virtual register value into a register of each corresponding virtual network card.
[0154] It's important to note that a virtual network function (VF) appears as a virtual network interface in the host operating system. It's typically created from a physical network card (such as the BF3 SmartNIC) using SR-IOV technology or virtualization software. Each VF can be independently assigned an IP address, enabling isolated and parallel execution of network functions. The virtual hardware address refers to the MAC address of the virtual network card. It identifies different virtual network interfaces within the host and ensures proper routing of network traffic. The virtual network address, the IP address assigned to the virtual network card, is an identifier at the network layer used to locate and identify it in network communications. The virtual register value converts the virtual network address into a format understandable by the SmartNIC hardware control registers. This is then written directly to the hardware to configure the network parameters of the virtual network card.
[0155] In an optional embodiment, detailed steps are provided for virtualizing and configuring a Smart NIC using IPMI out-of-band batch management via the BMC. First, the system determines the list of virtual NICs created by the target NIC and obtains the MAC addresses of these virtual NICs. Subsequently, the system searches or determines the virtual network address corresponding to each virtual hardware address based on a pre-established address mapping table and generates corresponding virtual register values. Finally, these virtual register values are written to the corresponding virtual NIC hardware control registers, completing the network parameter configuration for the virtual NIC.
[0156] In an optional embodiment, the system uses the SR-IOV virtualization capability of the Smart NIC to create multiple virtual network cards (VFs) for each physical network card. For example, the target network card may create five VFs, each with independent hardware resources and network addresses. The host operating system or BMC control reads the hardware address (MAC address) of each VF, which will be used for subsequent configuration operations. Based on the MAC address of each VF, the corresponding virtual network address is searched in the address mapping table. For example, the virtual network address corresponding to 00:11:22:33:44:55 is 192.168.1.10 / 24. The found virtual network address is converted into a value recognizable by the hardware control register. For example, 192.168.1.10 / 24 is converted into 0xA000 = 0xC0A8010A and 0xA001 = 0x00000018 (24-bit subnet mask). Using IPMI raw commands, the BMC writes the virtual register values of each VF to the corresponding hardware control registers, enabling offline, batch virtual network card initialization. To ensure that the written configuration parameters remain valid after a system restart, you can add relevant configuration commands to system startup scripts such as / etc / rc.local to achieve configuration persistence.
[0157] Figure 3Schematic diagram of an optional method for configuring a network card network according to an embodiment of the present application; Figure 3 As shown, the network card in the server (for example Figure 3 Network card 1 and network card 2 in the can realize the functions of multiple virtual network cards (such as Figure 3 Virtual network cards (VF1-VF8) support virtual machine operations and provide network card-like functionality. During network configuration for a server's network card, if the server's network card uses SR-IOV virtualization to create multiple virtual network cards (VFs) for each physical network card, network configuration can be performed directly for multiple virtual network cards.
[0158] Through the above-mentioned implementation mode of the present application, through this series of automated batch configuration operations, not only the physical network card can be initialized and configured, but the multiple virtual network cards created can also have independent network configurations, thereby meeting the needs of efficient utilization and flexible allocation of network resources in the data center environment, and is particularly suitable for cloud computing scenarios that require high-concurrency network communication and resource isolation.
[0159] In an optional embodiment, before determining at least one virtual network card corresponding to the target network card, it includes: inputting a first indication bit into the virtual register of the target network card, wherein the first indication bit is used to instruct the target network card to create a virtual network card; generating at least one virtual hardware address according to the target network address; and writing the virtual hardware addresses into the registers of the respective corresponding virtual network cards.
[0160] It should be noted that the first indication bit is a signal bit or parameter used to trigger the smart network card to create a virtual network card. By writing into the virtual register, it will start the process of creating the virtual network card.
[0161] Before determining at least one virtual network card corresponding to the target network card, the system triggers the creation of the virtual network card by writing a first indication bit to the target network card's virtual register. Subsequently, based on the target network card's hardware address, the system generates a set of virtual hardware addresses associated with it for subsequent virtual network card configuration. Finally, these virtual hardware addresses are written to the control register of each newly created virtual network card, completing the initial configuration of the virtual network card.
[0162] In an optional implementation, creating a virtual network interface card (VF) is a key step in improving resource utilization and network flexibility. The BMC writes a specific first indication bit to the target NIC's virtual register, initiating the VF creation process. For example, by setting bits 0 to 1 of register 0x1000, the BF3 NIC is instructed to begin creating and initializing VF resources. Based on the hardware address information of the target NIC (i.e., the physical NIC PF), a set of network addresses for the VF is generated. This may involve address planning and allocation to ensure that each VF has a unique and non-conflicting network identifier. Once the VF is created, the BMC writes the generated virtual hardware address to the corresponding control register of each VF, completing the initialization of the VF's network parameters. This ensures that each VF can independently conduct network communications, unaffected by the status of the physical NIC or other VFs.
[0163] Figure 4 Schematic diagram of another optional method for configuring a network card network according to an embodiment of the present application; Figure 4 As shown in the figure, a physical network card can be divided into multiple virtual network cards, and virtual network cards can be managed through the root network card (PF). Before using the network card, the BMC can create multiple virtual network cards (VF1-VF4) through PF. This process can also be achieved by bypassing the server's operating system and driver.
[0164] Through the above-described implementation of the present application and this process, the BMC ensures that each virtual network card is initialized and configured according to its specific network address information, thereby providing independent network communication capabilities and improving the flexibility and utilization of data center network resources. Furthermore, the use of IPMI instructions for hardware-level operations avoids dependence on the operating system and network services, enhancing the stability and security of the configuration process.
[0165] It's important to note that as data centers continue to expand, the number of network devices is growing exponentially. Smart NICs, the last mile of network connectivity, have a significant impact on the performance and service quality of the entire data center. Traditional fault detection and repair rely on regular manual inspections or passive alarm responses, which are labor-intensive, time-consuming, and often cause service interruptions. Therefore, developing a system that can proactively predict Smart NIC failures and automatically repair them is crucial.
[0166] In an optional implementation, historical performance data and fault logs for Smart NICs (Smart Network Interface Cards) within the data center are collected, including but not limited to metrics such as network throughput, packet loss rate, CPU utilization, and temperature. Machine learning algorithms (such as support vector machines, random forests, or deep neural networks) are used to analyze this historical data and build a fault prediction model. This model is trained to identify fault precursors. A real-time monitoring module is deployed on the Smart NIC to continuously collect key performance indicators and status information. The trained machine learning model is used to analyze the real-time monitoring data and predict the probability of failure over the next period of time. When the prediction model determines that the failure probability exceeds a threshold, the system automatically issues an alert. A self-healing process is initiated, automatically adjusting the network configuration and load balancing policy based on the fault type and predicted severity, or triggering hardware self-healing mechanisms (such as automatic restart and hardware redundancy switching). IPMI commands and SR-IOV virtualization technology are introduced to ensure that fault self-healing operations can be executed through out-of-band channels even in the event of host operating system anomalies or network fluctuations. After the fault is healed, the system collects performance data changes before and after the fault and uses them as feedback to feed into the model. The model is continuously adjusted and optimized to more accurately predict future fault trends and improve the success rate of self-healing.
[0167] This solution significantly reduces the incidence of network failures through early prediction and automated repair, improving data center service quality and user experience. Reducing the need for manual intervention and automating fault handling saves maintenance personnel time and effort, reducing operating costs. The self-healing system enables Smart NICs to maintain optimal operating conditions even without human intervention, enhancing their availability and reliability in complex data center environments.
[0168] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0169] The embodiment of the present application also provides a network card network configuration device, Figure 5 This is a structural block diagram of an optional network card network configuration device according to an embodiment of the present application, such as Figure 5 As shown, the device includes:
[0170] The hardware address acquisition module 502 is used to acquire a target hardware address corresponding to a target network card, wherein the target hardware address is used to indicate the target network card;
[0171] a network address determination module 504 configured to determine a target network address of a target network card based on the hardware address, and to determine a first register value according to the target network address, wherein the target network address is used to indicate a digital label of the target network card, and the first register value is used to indicate the target network address;
[0172] The register writing module 506 is configured to write the first register value into the register of the target network card, wherein the register of the target network card is used to set the network parameters of the target network card.
[0173] Optionally, the above-mentioned network address determination module 504 is also used to: search for the target network address in the address mapping table based on the target network address, and generate a first register value according to the target network address, wherein the target network address is used to indicate the correspondence between the hardware address and the network address of at least one network card; receive the first configuration information sent by the network configuration module, and determine the first register value from the first configuration information.
[0174] Optionally, the above-mentioned network address determination module 504 is also used to: obtain a preset network address set and a candidate hardware address corresponding to each of at least one candidate network card, wherein the preset network address set is used to indicate the network address corresponding to each of at least one candidate network card; and generate an address mapping table by matching at least one candidate hardware address with a network address in the preset network address set one by one.
[0175] Optionally, the above-mentioned hardware address acquisition module 502 is also used to: write the second register value corresponding to the target hardware address into the register of the target network card, wherein the second register value is used to indicate the target hardware address; write the third register value into the register of the target network card, wherein the third register value is used to indicate the number of bits of the subnet mask of the target network card; write the fourth register value into the register of the target network card, wherein the fourth register value is used to indicate the maximum value of the transmission data of the target network card.
[0176] Optionally, the above-mentioned hardware address acquisition module 502 is also used to: receive second configuration information sent by the network configuration module, wherein the second configuration information is used to indicate the configuration information of at least one reference network card, and the at least one reference network card includes the target network card; determine the register value of the reference network address corresponding to each reference network card according to the second configuration information; and write the register value of at least one reference network address into the register of the corresponding reference network card.
[0177] Optionally, the above-mentioned network address determination module 504 is also used to: obtain a reference register value of a target position in the register of the target network card, wherein the target position is used to indicate the position of the register of the target network card where the first register value is written; determine the target network address according to the address mapping table and the target hardware address, and generate a first register value according to the target network address; and determine that the configuration of the target network card is completed when the first register value and the reference register value are the same.
[0178] Optionally, the register writing module 506 is further configured to: when writing the first register value to the register of the target network card, read a check value at a preset position of the register of the target network card; when the check value indicates that the configuration of the target network card is complete, determine that the configuration of the target network card is complete; when the check value indicates that the configuration of the target network card fails, add one to the check failure value and read the check value; when the check failure value is greater than a preset failure value, determine that the configuration of the target network card fails.
[0179] Optionally, the hardware address acquisition module 502 is further used to: determine at least one virtual network card corresponding to the target network card; obtain the virtual hardware address corresponding to each of the at least one virtual network cards, wherein the virtual hardware address is used to indicate the virtual network card; the network address determination module 504 is further used to: search the address mapping table for the virtual network address corresponding to each of the at least one virtual network cards based on the at least one virtual hardware address, and generate at least one virtual register value according to the at least one virtual network address; and write the at least one virtual register value into the register of the corresponding virtual network card.
[0180] Optionally, the above-mentioned hardware address acquisition module 502 is also used to: input a first indication bit into the virtual register of the target network card, wherein the first indication bit is used to instruct the target network card to create a virtual network card; generate at least one virtual hardware address according to the target network address; and write the virtual hardware address into the register of each corresponding virtual network card.
[0181] For the description of the features in the embodiment corresponding to the network card network configuration device, please refer to the relevant description of the embodiment corresponding to the network card network configuration method, which will not be repeated here.
[0182] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned embodiments of the network card network configuration method.
[0183] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps of any of the above-mentioned network card network configuration method embodiments when running.
[0184] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0185] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the computer program implements the steps of any of the above-mentioned network card network configuration method embodiments.
[0186] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps in any of the above-mentioned network card network configuration method embodiments.
[0187] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0188] The above is a detailed introduction to the configuration method and device of a network card network, a storage medium, and an electronic device provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A method for configuring a network card network, characterized in that: include: Obtaining a target hardware address corresponding to a target network card, wherein the target hardware address is used to indicate the target network card; Determining a target network address of the target network card based on the hardware address, and determining a first register value according to the target network address, wherein the target network address is used to indicate a digital label of the target network card, and the first register value is used to indicate the target network address; The first register value is written into a register of the target network card, wherein the register of the target network card is used to set network parameters of the target network card.
2. The method according to claim 1, characterized in that Determining the target network address of the target network card based on the hardware address, and determining the first register value according to the target network address, includes one of the following: searching the target network address in an address mapping table based on the target network address, and generating the first register value according to the target network address, wherein the target network address is used to indicate a correspondence between a hardware address of at least one network card and a network address; Receive first configuration information sent by a network configuration module, and determine the first register value from the first configuration information.
3. The method according to claim 2, characterized in that Before searching the target network address in the address mapping table based on the target network address, the method includes: Obtaining a preset network address set and a candidate hardware address corresponding to each of at least one candidate network card, wherein the preset network address set is used to indicate the network address corresponding to each of the at least one candidate network card; At least one candidate hardware address is matched one-to-one with a network address in the preset network address set to generate the address mapping table.
4. The method according to claim 3, characterized in that After obtaining the target hardware address corresponding to the target network card, the method further includes at least one of the following: Writing a second register value corresponding to the target hardware address into a register of the target network card, wherein the second register value is used to indicate the target hardware address; Writing a third register value into a register of the target network card, wherein the third register value is used to indicate the number of bits of the subnet mask of the target network card; Writing a fourth register value into a register of the target network card, wherein the fourth register value is used to indicate a maximum value of transmission data of the target network card.
5. The method according to claim 2, characterized in that After obtaining the target hardware address corresponding to the target network card, the method includes: Receive second configuration information sent by the network configuration module, wherein the second configuration information is used to indicate configuration information of at least one reference network card, and the at least one reference network card includes the target network card; Determine, according to the second configuration information, register values of reference network addresses corresponding to the reference network cards; Writing a register value of at least one of the reference network addresses into a register of a corresponding reference network card.
6. The method according to claim 2, characterized in that After writing the first register value into the register of the target network card, the method further includes: Obtaining a reference register value of a target position in a register of the target network card, wherein the target position is used to indicate a position of the register of the target network card where the first register value is written; Determine the target network address according to the address mapping table and the target hardware address, and generate the first register value according to the target network address; When the first register value is identical to the reference register value, it is determined that the configuration of the target network card is complete.
7. The method according to claim 1, characterized in that After writing the first register value into the register of the target network card, the method further includes: When the first register value is written into the register of the target network card, a check value at a preset position of the register of the target network card is read; If the check value indicates that the configuration of the target network card is complete, determining that the configuration of the target network card is complete; In the case where the check value indicates that the target network card configuration fails, the check failure value is increased by one, and the check value is read; When the verification failure value is greater than a preset failure value, it is determined that the target network card configuration fails.
8. The method according to any one of claims 1 to 7, characterized in that The obtaining of the target hardware address corresponding to the target network card includes: Determine at least one virtual network card corresponding to the target network card; Obtaining a virtual hardware address corresponding to each of the at least one virtual network card, wherein the virtual hardware address is used to indicate the virtual network card; Determining the target network address of the target network card based on the hardware address, and determining a first register value according to the target network address, includes: Searching an address mapping table for a virtual network address corresponding to each of the at least one virtual network cards based on at least one of the virtual hardware addresses, and generating at least one virtual register value according to the at least one virtual network address; Writing the first register value into the register of the target network card includes: At least one of the virtual register values is written into a register of the corresponding virtual network card.
9. The method according to claim 8, characterized in that Before determining at least one virtual network card corresponding to the target network card, the method includes: Inputting a first indication bit into a virtual register of the target network card, wherein the first indication bit is used to instruct the target network card to create the virtual network card; generating at least one virtual hardware address according to the target network address; The virtual hardware addresses are written into the registers of the corresponding virtual network cards.
10. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the method for configuring a network card network as claimed in any one of claims 1 to 9 when executing the computer program.
Citation Information
Patent Citations
Network address management method of Feiteng server blade system
CN105812190A
Automatic IP address configuration device and method based on BMC
CN107659677A
Software and hardware collaborative RDMA network card SR-IOV parameterization configuration method
CN120321117A
System and method for network card switchovers in an IP network
US20040146062A1
Efficient network device failover management for virtual machines
US20230418648A1
Cited By
Communication method and device of multi-network card chip, storage medium and electronic device
CN121644517A