Neighbor information table generation method and device, electronic equipment and medium

By improving the packet processing between the host and network devices in a smart network interface card (NIC) environment, the problem of the mismatch between the number of virtual NICs and physical optical ports is solved, enabling accurate generation of neighbor information tables and improving the efficiency of network management and troubleshooting.

CN121814711APending Publication Date: 2026-04-07CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In a flexible bare-metal server environment with smart NICs, the mismatch between the number of virtual NICs and physical optical ports makes it impossible to establish a one-to-one correspondence between LLDP packets sent and received between the host and network devices. This lack of intuitiveness and accuracy affects operation and maintenance diagnosis and network management.

Method used

The host sends a first host message containing the local device ID and local port ID to the smart network card. The smart network card converts the port ID to generate a second host message and sends it to the network device. The network device generates a first neighbor information table, which contains the neighbor device ID, neighbor port ID, local device ID, and local port ID.

Benefits of technology

It enables accurate recording of connection relationships between network devices and hosts, improves the accuracy and availability of the neighbor information table, and provides a reliable data foundation for network management and troubleshooting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121814711A_ABST
    Figure CN121814711A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a neighbor information table generation method and device, electronic equipment and a readable storage medium, and the method comprises the steps: transmitting a first host message to an intelligent network card from an elastic network card through a host, the message comprising a local equipment ID field and a local port ID field; replacing a local port ID field in the received first host message with corresponding optical port identification information through the intelligent network card to generate a second host message; and the second host message is sent to the network equipment connected with the corresponding optical port through the intelligent network card, so that the network equipment generates a first neighbor information table based on the received message information, the table comprises a neighbor equipment ID, a neighbor port ID, a local equipment ID and a local port ID, and the connection relationship between the network equipment and the host is completely recorded. According to the embodiment of the invention, port information conversion processing is carried out on the host message through the intelligent network card, the accuracy and availability of the neighbor information table are improved, and a reliable data basis is provided for network management and troubleshooting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of home appliance technology, and in particular to a method, apparatus, electronic device, and readable storage medium for generating a neighbor information sheet. Background Technology

[0002] With the rapid development and widespread application of cloud computing technology, more and more enterprises and individual users are choosing to deploy their core business to the cloud. Among these applications, mission-critical systems and high-performance computing place higher demands on computing performance and security. To meet this need, data centers have introduced bare-metal servers, which retain the high performance and security isolation advantages of physical servers while offering the flexibility and elasticity of virtualized resources. Users can independently select hardware specifications and operating systems through a control panel, enabling convenient resource provisioning and deployment.

[0003] However, in flexible bare-metal server environments employing smart NICs, the number of NICs recognized by the host is determined by the virtualization logic of the smart NICs and can be flexibly configured according to user needs, ranging from a single NIC to hundreds. In contrast, the actual physical optical ports of a smart NIC are typically only two to four. This mismatch between the number of virtual NICs and physical optical ports means that, under the existing mechanism, a one-to-one correspondence cannot be established between LLDP packets sent and received between the host and network devices. Neighbor information obtained from either the server or network side lacks intuitiveness and accuracy, significantly complicating operation and maintenance diagnostics and network management. Summary of the Invention

[0004] In view of the above problems, embodiments of the present invention are proposed to provide a method, apparatus, electronic device and readable storage medium for generating a neighbor information table that overcomes or at least partially solves the above problems.

[0005] In a first aspect, embodiments of the present invention provide a method for generating a neighbor information table, applied to a server, the server including a host and a smart network interface card (NIC), the smart NIC including multiple optical ports, at least one optical port being connected to at least one network device, the host being equipped with multiple flexible NICs, the method comprising: The host sends a first host message from its elastic network interface card (NIC) to the smart NIC. The first host message includes a local device ID field and a local port ID field. The value of the local device ID field is the host ID, and the value of the local port ID field is the elastic network interface card (NIC) ID. The local port ID field of the first host packet is modified by the smart network card to generate a second host packet; the local port ID field of the second host packet is the optical port ID; The smart network interface card (NIC) sends the second host message to the network device connected to the optical port, so that the network device generates a first neighbor information table based on the second host message. The first neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. In each entry of the first neighbor information table, the value of the neighbor device ID field is the host ID, the value of the neighbor port ID field is the optical port ID of the smart NIC, the value of the local device ID field is the network device ID, and the value of the local port ID field is the port ID of the network device.

[0006] Optionally, the step of modifying the local port ID field of the first host packet using the smart network interface card to generate the second host packet includes: The smart network card receives the first host message, generates multiple first host messages corresponding to the multiple optical ports, and modifies the value of the local port ID field in the multiple first host messages to the corresponding optical port ID to generate multiple second host messages.

[0007] Optionally, sending the second host message to the network device connected to the optical port via the smart network card includes: The smart network interface card (NIC) stores the multiple second host packets in a local cache. When the first sending condition is met, the plurality of second host messages in the cache are sent to the network devices that are connected to the plurality of optical ports one by one.

[0008] Optionally, the method further includes: The first network device message sent by the network device is received through the optical port of the smart network card; the first network device message includes a local device ID field and a local port ID field, the value of the local device ID field is the network device ID, and the value of the local port ID field is the network device port ID; The first network device packet is processed by the smart network card to generate the second network device packet; the value of the local port ID field of the second network device packet is a mapping from the ID of the corresponding optical port to the network device port ID; The second network device message is sent to the host via the smart network card; The host generates a second neighbor information table based on the second network device message. The second neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. In each entry of the second neighbor information table, the value of the neighbor device ID field is the network device ID, the value of the neighbor port ID field is the mapping from the optical port of the smart network card to the network device port ID, the value of the local device ID field is the host ID, and the value of the local port ID field is the host's elastic network card ID.

[0009] Optionally, the step of processing the first network device packet through the smart network interface card to generate the second network device packet includes: The smart network interface card is used to copy the first network device packet to generate a copy of the first network device packet. The local port ID field of the first network device packet copy is modified by the smart network card to generate the second network device packet.

[0010] Optionally, the method further includes: The smart network interface card (NIC) generates a third neighbor information table based on the first network device message. The third neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. In each entry of the third neighbor information table, the value of the neighbor device field is the network device ID, the value of the neighbor port ID field is the network device port ID, the value of the local device ID field is the host ID, and the value of the local port ID field is the optical port ID of the smart NIC.

[0011] Optionally, sending the second network device message to the host via the smart network card includes: The smart network card stores the packets from the second network device in a local cache. When the second sending condition is met, the second network device message in the cache is sent to the host.

[0012] Secondly, embodiments of the present invention provide an apparatus for generating a neighbor information table, applied to a server. The server includes a host and a smart network interface card (NIC). The smart NIC includes multiple optical ports, at least one of which is connected to at least one network device. The host is equipped with multiple flexible NICs. The apparatus includes: The first host message sending module is used to send a first host message from the host's elastic network interface card (NIC) to the smart NIC via the host; the first host message includes a local device ID field and a local port ID field; the value of the local device ID field is the host ID, and the value of the local port ID field is the elastic NIC ID; The second host packet generation module is used to modify the local port ID field of the first host packet through the smart network card to generate a second host packet; the local port ID field of the second host packet is an optical port ID; The first neighbor information table generation module is used to send the second host message to the network device connected to the optical port through the smart network card, so that the network device generates a first neighbor information table based on the second host message. The first neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. The value of the neighbor device ID field in each entry of the first neighbor information table is the host ID, the value of the neighbor port ID field is the optical port ID of the smart network card, the value of the local device ID field is the network device ID, and the value of the local port ID field is the port ID of the network device.

[0013] Optionally, the second host message generation module includes: The second host message generation submodule is used to receive the first host message through the smart network card, generate multiple first host messages corresponding to the multiple optical ports, and modify the value of the local port ID field in the multiple first host messages to the corresponding optical port ID to generate multiple second host messages.

[0014] Optionally, the first neighbor information table generation module includes: The second host message storage submodule is used to store the plurality of second host messages in a local cache through the smart network card; The second host message sending submodule is used to send the plurality of second host messages in the cache to the network devices that are connected to the plurality of optical ports one by one when the first sending condition is met.

[0015] Optionally, the device further includes: The first network device message sending module is used to receive a first network device message sent by the network device through the optical port of the smart network card; the first network device message includes a local device ID field and a local port ID field, the value of the local device ID field is the network device ID, and the value of the local port ID field is the network device port ID; The second network device packet generation module is used to process the first network device packet through the smart network card to generate the second network device packet; the value of the local port ID field of the second network device packet is a mapping from the ID of the corresponding optical port to the network device port ID; The second network device message sending module is used to send the second network device message to the host through the smart network card; The second neighbor information table generation module is used to generate a second neighbor information table for the host based on the second network device packet. The second neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. In each entry of the second neighbor information table, the value of the neighbor device ID field is the network device ID, the value of the neighbor port ID field is the mapping from the optical port of the smart network card to the network device port ID, the value of the local device ID field is the host ID, and the value of the local port ID field is the host's elastic network card ID.

[0016] Optionally, the second network device packet generation module includes: The first network device packet copy generation submodule is used to copy the first network device packet through the smart network card to generate a first network device packet copy; The second network device packet generation submodule is used to modify the local port ID field of the first network device packet copy through the smart network card to generate the second network device packet.

[0017] Optionally, the device further includes: The third neighbor information table generation module is used to generate a third neighbor information table for the smart network card based on the first network device message. The third neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. In each entry of the third neighbor information table, the value of the neighbor device field is the network device ID, the value of the neighbor port ID field is the network device port ID, the value of the local device ID field is the host ID, and the value of the local port ID field is the optical port ID of the smart network card.

[0018] Optionally, the second network device message sending module includes: The second network device packet storage submodule is used to store the second network device packets in a local cache through the smart network card; The second network device message sending submodule is used to send the second network device message in the cache to the host when the second sending condition is met.

[0019] Thirdly, embodiments of the present invention provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the neighbor information table generation method as described in the first aspect.

[0020] Fourthly, embodiments of the present invention provide a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the neighbor information table generation method as described in the first aspect.

[0021] The embodiments of the present invention have the following advantages: In this embodiment of the invention, a host sends a first host message from an elastic network interface card (NIC) to a smart NIC. This message includes a local device ID field and a local port ID field. The smart NIC replaces the local port ID field in the received first host message with the corresponding optical port identification information to generate a second host message. The smart NIC then sends the second host message to the network device connected to the corresponding optical port. The network device generates a first neighbor information table based on the received message information. This table includes neighbor device IDs, neighbor port IDs, local device IDs, and local port IDs, completely recording the connection relationships between network devices and hosts. This embodiment of the invention improves the accuracy and usability of the neighbor information table by performing port information conversion processing on the host message through the smart NIC, providing a reliable data foundation for network management and troubleshooting. Attached Figure Description

[0022] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart of the steps of a method for generating a neighbor information table provided in an embodiment of the present invention; Figure 2 This is a flowchart of another method for generating a neighbor information table provided in an embodiment of the present invention; Figure 3 This is a flowchart illustrating the specific steps of a method for generating a neighbor information table according to an embodiment of the present invention. Figure 4 This is a flowchart of the steps of another method for generating a neighbor information table provided in an embodiment of the present invention; Figure 5 This is a flowchart of the steps of another method for generating a neighbor information table provided in an embodiment of the present invention; Figure 6 This is a flowchart illustrating the specific steps of another method for generating a neighbor information table provided in an embodiment of the present invention. Figure 7 This is a structural block diagram of a neighbor information table generation device provided in an embodiment of the present invention. Detailed Implementation

[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] The terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0026] With the development and maturation of data center technology, more and more enterprises and individuals are migrating their businesses to the cloud, and bare metal servers have gained widespread application in the cloud computing field due to their unique performance advantages. This server form factor retains the high performance and security isolation characteristics of physical machines while also possessing the elastic supply capability of cloud resources, making it particularly suitable for mission-critical business scenarios with high requirements for computing power performance and security.

[0027] In scenarios where the host sends LLDP protocol messages, the smart NIC forwards protocol messages from a large number of virtual NICs to the uplink service switch through a limited number of optical ports. This causes the switch to learn neighbor information that does not match the physical topology. Under the existing mechanism, the port identifiers carried in the LLDP protocol messages sent by the host on each virtual NIC are virtual NIC information. After these messages are forwarded to the service switch from the limited optical ports by the smart NIC through a load balancing algorithm, the switch learns neighbor entries, where the displayed neighbor port identifiers are completely inconsistent with the actual physical connection ports. More seriously, the smart NIC's load balancing strategy may cause protocol messages from the same virtual NIC to be sent out from different physical ports, causing the neighbor information learned by the switch to fluctuate continuously, making it impossible to form a stable topology view.

[0028] The same problem exists in scenarios where service switches actively send protocol packets. In existing technologies, after LLDP protocol packets sent by service switches through fixed physical ports reach the smart NIC, the smart NIC's strategy for forwarding these packets to the host directly affects the neighbor information table generated on the host side. Since the host side still uses virtual NIC information to identify local ports, it is difficult for maintenance personnel to establish a correspondence between these virtual identifiers and actual physical connections. In addition, under the current architecture, the smart NIC operating system itself cannot generate a complete neighbor information table, resulting in personnel with only smart NIC maintenance permissions being unable to obtain accurate network topology information. Even if modifications are made to allow the smart NIC to maintain neighbor information simultaneously, inconsistencies in information still exist because the smart NIC and the NIC that receives the protocol packets on the host are different.

[0029] The existing LLDP protocol implementation mechanisms exhibiting these problems in smart NIC environments severely impact operational efficiency and quality. Therefore, there is an urgent need for a new neighbor information discovery and management solution that adapts to the characteristics of smart NIC architecture, ensuring accurate, stable, and intuitive network topology information is provided even in virtualized NIC environments, thus offering reliable support for operational management.

[0030] Figure 1 This is a flowchart of the steps of a method for generating a neighbor information table provided in an embodiment of the present invention; like Figure 1 As shown in the figure, the step flow of a method for generating a neighbor information table provided by an embodiment of the present invention may specifically include the following steps: Step 101: The host sends a first host message from the host's elastic network interface card (NIC) to the smart NIC; the first host message includes a local device ID field and a local port ID field; the value of the local device ID field is the host ID, and the value of the local port ID field is the elastic NIC ID; This invention is applied to a server, wherein the server includes a host and a smart network interface card (NIC), and the smart NIC includes multiple optical ports, wherein the multiple optical ports are connected to multiple network devices respectively, and the host is equipped with multiple flexible NICs.

[0031] In this embodiment of the invention, the server adopts an architecture design that separates the host and the smart network interface card (NIC). The host communicates with the smart NIC through a virtualized elastic NIC. When it is necessary to establish a network device neighbor discovery, the host actively generates a first host message. This message contains the standard neighbor discovery protocol format and fills in the host's identity information in specific fields. Among them, the local device ID field is filled with the host's unique identifier (host ID), which is used to uniquely identify the server in the network; the local port ID field is filled with the identifier of the source elastic NIC (elastic NIC ID), which accurately identifies the virtual port from which the message was sent.

[0032] By clearly identifying the host ID and elastic NIC ID, the traceability of packet origin is ensured, enabling the smart NIC to accurately identify the origin of service flows. This provides a key input for mapping from virtual networks to physical networks and lays the technical foundation for network isolation and quality management in multi-tenant environments.

[0033] Step 102: Modify the local port ID field of the first host packet using the smart network card to generate a second host packet; the local port ID field of the second host packet is the optical port ID; In this embodiment of the invention, after the smart network interface card (NIC) receives the first host message from the host, it performs a crucial address translation operation. The packet processing engine embedded in the smart NIC parses the received message, identifies the local port ID field, and replaces the original elastic NIC ID with the physical identifier of the actual transmitting optical port, such as the optical port ID.

[0034] By converting port identifiers through smart network interface cards, a precise mapping from virtual network interfaces to physical network ports is achieved, solving the problem of invisible network topology in virtualized environments and providing technical support for fine-grained management in software-defined networks.

[0035] Step 103: The second host message is sent to the network device connected to the optical port via the smart network card, so that the network device generates a first neighbor information table based on the second host message. The first neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. In each entry of the first neighbor information table, the value of the neighbor device ID field is the host ID, the value of the neighbor port ID field is the optical port ID of the smart network card, the value of the local device ID field is the network device ID, and the value of the local port ID field is the port ID of the network device.

[0036] In this embodiment of the invention, the smart network interface card (NIC) sends a second host message to a directly connected network device through a designated physical optical port. Upon receiving the message, the network device parses the device ID and port ID information within it and generates or updates a first neighbor information table based on a standard neighbor discovery protocol mechanism. In this table, the network device records the host ID from the message as the neighbor device ID, records the smart NIC's optical port ID as the neighbor port ID, and simultaneously fills its own device ID and receiving port ID into the local device ID and local port ID fields, respectively.

[0037] By establishing accurate neighbor information entries, automatic discovery and maintenance of the physical network topology are achieved. Network devices, through parsing and converting the message information, can correctly record the connection relationships with the server, forming a complete network topology view.

[0038] In this embodiment of the invention, a host sends a first host message from an elastic network interface card (NIC) to a smart NIC. This message includes a local device ID field and a local port ID field. The smart NIC replaces the local port ID field in the received first host message with the corresponding optical port identification information to generate a second host message. The smart NIC then sends the second host message to the network device connected to the corresponding optical port. The network device generates a first neighbor information table based on the received message information. This table includes neighbor device IDs, neighbor port IDs, local device IDs, and local port IDs, completely recording the connection relationships between network devices and hosts. This embodiment of the invention improves the accuracy and usability of the neighbor information table by performing port information conversion processing on the host message through the smart NIC, providing a reliable data foundation for network management and troubleshooting.

[0039] Figure 2 This is a flowchart of another method for generating a neighbor information table provided in an embodiment of the present invention.

[0040] like Figure 2 As shown, the steps of another method for generating a neighbor information table provided in this embodiment of the invention may specifically include the following steps: Step 201: The host sends a first host message from the host's elastic network interface card (NIC) to the smart NIC; the first host message includes a local device ID field and a local port ID field; the value of the local device ID field is the host ID, and the value of the local port ID field is the elastic NIC ID; In this embodiment of the invention, the host sends an initial first host message to the smart network interface card (NIC) through its configured elastic NIC. This message uses a standard network discovery protocol format, but embeds specific host identification information in key fields. Specifically, the local device ID field carries the host's globally unique identifier, used to accurately identify the compute node within the network domain; the local port ID field records the elastic NIC instance ID that initiated the message, precisely identifying the logical exit point in the virtualization environment. This design ensures that the smart NIC can clearly distinguish communication flows from different virtual NICs on the same host, providing a foundation for subsequent multipath processing and load balancing.

[0041] In some examples, such as Figure 3 The flowchart shown below illustrates the specific steps of a method for generating a neighbor information table according to an embodiment of the present invention. These steps may include the following: The host actively sends host packets to the elastic network interface card (NIC) processing module of the smart NIC through its own elastic NIC port; the LLDPDU packets are sent to the LLDP agent by the elastic NIC processing module; after receiving the LLDPDU packets, the elastic NIC LLDP processing submodule sends them to the port of the service switch through the optical port.

[0042] Step 202: Receive the first host message through the smart network card, generate multiple first host messages corresponding to the multiple optical ports, and modify the value of the local port ID field in the multiple first host messages to the corresponding optical port ID to generate multiple second host messages; the local port ID field of the second host message is the optical port ID; In this embodiment of the invention, after receiving the first host packet, the packet processing module of the smart network interface card (NIC) performs intelligent packet copying and conversion operations. The smart NIC obtains the number of active physical optical ports on the NIC based on the local optical port list, creates a corresponding number of packet copies, and differentiates the local port ID field of each copy by replacing the original elastic NIC ID with the physical identifier of the specific outbound optical port.

[0043] In some embodiments, the smart network interface card (NIC) is deployed with an LLDP agent; wherein the LLDP agent includes an elastic NIC processing submodule; the LLDP agent of the smart NIC receives host packets and sends them to the elastic NIC processing submodule; the elastic NIC processing submodule reads the local optical port list, which records optical port information, and determines the number of optical ports based on the optical port list; based on the first host packet, it generates multiple second host packets corresponding to the number of optical ports, wherein the value of the local port field in the first host packet is modified to the corresponding optical port ID in the optical port list; the multiple second host packets are sent to a buffer; after the timer expires, the multiple second host packets in the buffer are sent to the network devices connected to the optical ports through the multiple optical ports respectively.

[0044] By leveraging the parallel processing capabilities of smart network interface cards (NICs), efficient mapping from a single virtual port to multiple physical ports is achieved, significantly improving the efficiency and coverage of network topology discovery.

[0045] Step 203: Store the plurality of second host packets in the local cache using the smart network card; In this embodiment of the invention, multiple second host packets that have completed port identifier translation are temporarily stored in the high-performance buffer of the smart network interface card. This buffer employs a multi-queue management mechanism, maintaining an independent transmission queue for each optical port to ensure the isolation and order of packet forwarding. The buffer management system monitors the depth and status of each queue in real time and implements dynamic memory allocation strategies to prevent the blocking of a single queue from affecting overall forwarding performance.

[0046] The intelligent cache management mechanism not only ensures the reliability of packet forwarding, but also provides underlying support for load balancing of network traffic.

[0047] Step 204: When the first sending condition is met, the plurality of second host messages in the cache are sent to the network devices that are connected to the plurality of optical ports one by one, so that the network devices generate the first neighbor information table of the network devices according to the second host messages.

[0048] The first neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field; in each entry of the first neighbor information table, the value of the neighbor device ID field is the host ID, the value of the neighbor port ID field is the optical port ID of the smart network card, the value of the local device ID field is the network device ID, and the value of the local port ID field is the port ID of the network device.

[0049] In this embodiment of the invention, the first sending condition includes, but is not limited to: the buffer queue reaching a preset threshold, a timer timeout triggering, or receiving an external control command. When any of the sending conditions is met, the smart network card's scheduler will extract the corresponding second host packets from each buffer queue in parallel and send them to the directly connected network devices through the corresponding physical optical ports. After receiving these packets, the network devices will parse the device ID and optical port ID information, establish or update the corresponding entries in their neighbor information tables, and accurately record the physical connection topology between themselves and the server host.

[0050] In some embodiments, a first neighbor information table may be as shown in the following table:

[0051] In this embodiment of the invention, the host sends a first host message from the elastic network interface card (NIC) to the smart NIC. This message includes a local device ID field and a local port ID field, where the local device ID field records the host identifier and the local port ID field records the elastic NIC identifier. After receiving the first host message, the smart NIC generates multiple first host messages corresponding to multiple optical ports, and modifies the local port ID field value in these messages to the corresponding optical port identifier, generating multiple second host messages. The smart NIC stores the multiple second host messages in a local cache. When a first sending condition is met, the multiple second host messages in the cache are sent to the network devices connected to the multiple optical ports one by one. The network devices generate a first neighbor information table based on the received second host messages. This table includes neighbor device ID, neighbor port ID, local device ID, and local port ID fields, completely recording the connection relationship between the network devices and the host.

[0052] Figure 4 This is a flowchart of another method for generating a neighbor information table provided in an embodiment of the present invention.

[0053] like Figure 4The flowchart shown in this embodiment of the invention illustrates another method for generating a neighbor information table, which may specifically include the following steps: Step 301: Receive a first network device message sent by the network device through the optical port of the smart network card; the first network device message includes a local device ID field and a local port ID field, wherein the value of the local device ID field is the network device ID, and the value of the local port ID field is the network device port ID; In this embodiment of the invention, the smart network interface card (NIC) receives a first network device message from a directly connected network device through its physical optical port. This message uses a standard network layer discovery protocol format, where the local device ID field carries a globally unique identifier for the network device, accurately identifying the network device sending the message; the local port ID field records the specific physical port number from which the message was sent, precisely indicating the message's exit location on the network device.

[0054] By accurately receiving discovery messages from network devices, a topology discovery channel is established from the network side to the server side, ensuring that the smart network card can accurately identify the source device and specific physical path of the message, providing complete input information for subsequent address translation and forwarding processing.

[0055] Step 302: The first network device packet is processed by the smart network card to generate a second network device packet; the value of the local port ID field of the second network device packet is the mapping from the ID of the corresponding optical port to the network device port ID; In this embodiment of the invention, after receiving a first network device packet, the smart network interface card (NIC) performs a crucial address mapping and translation operation. The NIC's packet processing engine parses the received packet, identifies the network device port ID information within it, and establishes a mapping relationship between it and the physical identifier of the receiving optical port. The translated packet forms a second network device packet, which retains the network device ID information of the original packet, but the port identifier has been converted from the physical port of the network device to the logical identifier of the smart NIC's receiving optical port.

[0056] Step 303: Send the second network device message to the host through the smart network card; In this embodiment of the invention, the smart network interface card can forward the processed second network device packets to the host system through an LLDP proxy.

[0057] Step 304: The host generates a second neighbor information table based on the second network device message. The second neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. In each entry of the second neighbor information table, the value of the neighbor device ID field is the network device ID, the value of the neighbor port ID field is the mapping from the optical port of the smart network card to the network device port ID, the value of the local device ID field is the host ID, and the value of the local port ID field is the host's elastic network card ID.

[0058] In this embodiment of the invention, after parsing the second network device packet, the host establishes or updates a second neighbor information table based on the device identifier and port mapping information contained therein. In this table, the host records the network device ID in the packet as the neighbor device ID, records the mapping relationship between the smart NIC optical port and the network device port as the neighbor port ID, and fills its own host ID and the elastic NIC ID that received the packet into the local device ID and local port ID fields, respectively. The neighbor table entries formed in this way completely record the end-to-end connection path from the network device to the host, realizing bidirectional topology discovery and maintenance.

[0059] This invention embodiment receives a first network device message sent by a network device through the optical port of a smart network interface card (NIC). This message includes a local device ID field and a local port ID field identifying the network device and its port. The smart NIC processes the received first network device message to generate a second network device message, converting the local port ID field value into a mapping relationship between the corresponding optical port ID and the network device port ID. The smart NIC then sends the second network device message to the host. The host generates a second neighbor information table based on the received second network device message. This table includes neighbor device ID, neighbor port ID, local device ID, and local port ID fields, completely recording the bidirectional connection relationship between the network device and the host. This invention embodiment dynamically establishes and transmits the mapping relationship between the optical port and the network device port in the network device message through the smart NIC, enabling the host to accurately perceive the underlying network topology. This achieves bidirectional visual management of the connection relationship between the server and network devices, effectively improving the efficiency of network fault location and topology maintenance.

[0060] Figure 5 This is a flowchart of the steps of another method for generating a neighbor information table provided in an embodiment of the present invention.

[0061] like Figure 5 The flowchart shown in this embodiment of the invention illustrates another method for generating a neighbor information table, which may specifically include the following steps: Step 401: Receive a first network device message sent by the network device through the optical port of the smart network card; the first network device message includes a local device ID field and a local port ID field, the value of the local device ID field is the network device ID, and the value of the local port ID field is the network device port ID; In this embodiment of the invention, the smart network interface card (NIC) receives a first network device message from a network device through its physical optical port. This message uses a standard network discovery protocol format, where the local device ID field carries a globally unique identifier for the network device, accurately identifying the network device sending the message; the local port ID field records the specific physical port number from which the message was sent, precisely indicating the message's exit location on the network device.

[0062] In some examples, the network device has multiple ports, which are connected to the optical ports of the server's smart network card. Multiple first network device packets are sent through these ports. Each first network device packet includes a local device ID field and a local port field. The value of the local device ID field is the network device ID, and the value of the local port field is the port ID of the network device. The LLDP proxy of the smart network card receives the first network device packets. When it is determined that the network device packet was received through the optical port, it sends the network device packet to the optical port processing submodule.

[0063] The standardized message receiving mechanism ensures the accurate collection of network device discovery information, providing a reliable data source for building a complete network topology view.

[0064] In some embodiments, such as Figure 6 The flowchart shown illustrates the specific steps of another method for generating a neighbor information table provided in this embodiment of the invention. These steps may include the following: The service switch sends the first network device message to the smart NIC; the LLDPDU message is sent to the LLDP agent, which then sends the message to the optical port processing submodule of the LLDP agent; after receiving the LLDPDU message, the optical port processing submodule first copies the message to the native LLDP submodule of the smart NIC, and then sends it to the transmit buffer of all elastic NICs, retrieves the devices in the transmit buffer of the elastic NICs, and sends them to the host from the elastic NICs respectively.

[0065] Step 402: Copy the first network device packet using the smart network card to generate a copy of the first network device packet; In this embodiment of the invention, the smart network interface card is deployed with an LLDP proxy and a native LLDP submodule; wherein, the LLDP proxy includes an optical port processing submodule; the native LLDP submodule configures the connected host device ID field as the local device ID field when it starts up; After receiving the first network device packet, the optical port processing submodule copies the first network device packet to generate a second network device packet and sends it to the native LLDP submodule. Step 403: Modify the local port ID field of the first network device packet copy through the smart network card to generate a second network device packet; the value of the local port ID field of the second network device packet is the mapping from the ID of the corresponding optical port to the network device port ID; In this embodiment of the invention, based on the smart network card neighbor information table, the value of the local port ID field in the first network device packet is modified to the mapping from the ID of the corresponding optical port to the network device port ID, and a second network device packet is generated.

[0066] Step 404: Store the second network device packet in the local cache using the smart network card; In this embodiment of the invention, multiple second network device packets are sent to the cache of the smart network card.

[0067] Step 405: When the second sending condition is met, the second network device message in the cache is sent to the host.

[0068] In this embodiment of the invention, the second sending condition may be that after the timer expires, the second network device message in the cache is sent to the host connected to the elastic network card through the elastic network card; Step 406: The host generates a second neighbor information table based on the second network device message. The second neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. In each entry of the second neighbor information table, the value of the neighbor device ID field is the network device ID, the value of the neighbor port ID field is the mapping from the optical port of the smart network card to the network device port ID, the value of the local device ID field is the host ID, and the value of the local port ID field is the host's elastic network card ID.

[0069] In this embodiment of the invention, after receiving a message from a second network device, the host parses the message to generate a host neighbor information table. The neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. In each entry of the neighbor information table, the value of the neighbor device ID field is the network device ID, the value of the neighbor port ID field is the mapping from the optical port of the smart network card to the network device port ID, the value of the local device ID field is the host ID, and the value of the local port ID field is the host's elastic network card ID.

[0070] In some embodiments, a second neighbor information table may be as shown in the following table:

[0071] In some embodiments, while performing step 406, the following steps may also be included: The smart network interface card (NIC) generates a third neighbor information table based on the first network device message. The third neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. In each entry of the third neighbor information table, the value of the neighbor device field is the network device ID, the value of the neighbor port ID field is the network device port ID, the value of the local device ID field is the host ID, and the value of the local port ID field is the optical port ID of the smart NIC.

[0072] In this embodiment of the invention, the native LLDP submodule generates a neighbor information table for the smart network interface card (NIC) based on a copy of the first network device packet and the local optical port list. Multiple entries in the smart NIC neighbor information table include: a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. The neighbor device field in the smart NIC neighbor information table has the value of the network device ID, the neighbor port ID field has the value of the network device port ID, the local device ID field has the value of the host ID, and the local port ID field has the value of the host's elastic NIC ID.

[0073] In some embodiments, a third-neighbor information table may be as shown in the following table:

[0074] This invention embodiment receives a first network device message sent by a network device through the optical port of a smart network interface card (NIC). This message includes a local device ID field and a local port ID field identifying the network device and its port. The smart NIC copies the first network device message to generate a replica, and modifies the local port ID field in the replica to generate a second network device message. The local port ID field value is converted into a mapping relationship between the corresponding optical port ID and the network device port ID. The smart NIC stores the second network device message in a local cache. When a second sending condition is met, the cached message is sent to the host. The host generates a second neighbor information table based on the received second network device message. This table completely records the connection mapping relationship between the network device and the host. This invention embodiment, through the smart NIC's copying, conversion, and caching of network device messages, achieves multi-level collection and management of network topology information. It ensures accurate perception of network connections at the host layer while maintaining direct connection information at the smart NIC layer, providing complete data support for topology discovery and device management in complex network environments, significantly improving the efficiency and reliability of network operation and maintenance.

[0075] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0076] Figure 7 This is a structural block diagram of a neighbor information table generation device provided in an embodiment of the present invention.

[0077] like Figure 7 As shown in the figure, an embodiment of the present invention provides a neighbor information table generation device, which is applied to a server. The server includes a host and a smart network interface card (NIC). The smart NIC includes multiple optical ports, at least one of which is connected to at least one network device. The host is equipped with multiple flexible NICs and may specifically include the following modules: The first host message sending module 501 is used to send a first host message from the host's elastic network interface card to the smart network interface card through the host; the first host message includes a local device ID field and a local port ID field; the value of the local device ID field is the host ID, and the value of the local port ID field is the elastic network interface card ID; The second host packet generation module 502 is used to modify the local port ID field of the first host packet through the smart network card to generate a second host packet; the local port ID field of the second host packet is an optical port ID; The first neighbor information table generation module 503 is used to send the second host message to the network device connected to the optical port through the smart network card, so that the network device generates a first neighbor information table based on the second host message. The first neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. The value of the neighbor device ID field in each entry of the first neighbor information table is the host ID, the value of the neighbor port ID field is the optical port ID of the smart network card, the value of the local device ID field is the network device ID, and the value of the local port ID field is the port ID of the network device.

[0078] In this embodiment of the invention, the second host message generation module includes: The second host message generation submodule is used to receive the first host message through the smart network card, generate multiple first host messages corresponding to the multiple optical ports, and modify the value of the local port ID field in the multiple first host messages to the corresponding optical port ID to generate multiple second host messages.

[0079] In this embodiment of the invention, the first neighbor information table generation module includes: The second host message storage submodule is used to store the plurality of second host messages in a local cache through the smart network card; The second host message sending submodule is used to send the plurality of second host messages in the cache to the network devices that are connected to the plurality of optical ports one by one when the first sending condition is met.

[0080] In this embodiment of the invention, the device further includes: The first network device message sending module is used to receive a first network device message sent by the network device through the optical port of the smart network card; the first network device message includes a local device ID field and a local port ID field, the value of the local device ID field is the network device ID, and the value of the local port ID field is the network device port ID; The second network device packet generation module is used to process the first network device packet through the smart network card to generate the second network device packet; the value of the local port ID field of the second network device packet is a mapping from the ID of the corresponding optical port to the network device port ID; The second network device message sending module is used to send the second network device message to the host through the smart network card; The second neighbor information table generation module is used to generate a second neighbor information table for the host based on the second network device packet. The second neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. In each entry of the second neighbor information table, the value of the neighbor device ID field is the network device ID, the value of the neighbor port ID field is the mapping from the optical port of the smart network card to the network device port ID, the value of the local device ID field is the host ID, and the value of the local port ID field is the host's elastic network card ID.

[0081] In this embodiment of the invention, the second network device packet generation module includes: The first network device packet copy generation submodule is used to copy the first network device packet through the smart network card to generate a first network device packet copy; The second network device packet generation submodule is used to modify the local port ID field of the first network device packet copy through the smart network card to generate the second network device packet.

[0082] In this embodiment of the invention, the device further includes: The third neighbor information table generation module is used to generate a third neighbor information table for the smart network card based on the first network device message. The third neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. In each entry of the third neighbor information table, the value of the neighbor device field is the network device ID, the value of the neighbor port ID field is the network device port ID, the value of the local device ID field is the host ID, and the value of the local port ID field is the optical port ID of the smart network card.

[0083] In this embodiment of the invention, the second network device message sending module includes: The second network device packet storage submodule is used to store the second network device packets in a local cache through the smart network card; The second network device message sending submodule is used to send the second network device message in the cache to the host when the second sending condition is met.

[0084] In this embodiment of the invention, a host sends a first host message from an elastic network interface card (NIC) to a smart NIC. This message includes a local device ID field and a local port ID field. The smart NIC replaces the local port ID field in the received first host message with the corresponding optical port identification information to generate a second host message. The smart NIC then sends the second host message to the network device connected to the corresponding optical port. The network device generates a first neighbor information table based on the received message information. This table includes neighbor device IDs, neighbor port IDs, local device IDs, and local port IDs, completely recording the connection relationships between network devices and hosts. This embodiment of the invention improves the accuracy and usability of the neighbor information table by performing port information conversion processing on the host message through the smart NIC, providing a reliable data foundation for network management and troubleshooting.

[0085] As the apparatus embodiment is basically similar to the method embodiment, it is described in a relatively simple manner. For relevant details, please refer to the description of the method embodiment.

[0086] This invention also provides an electronic device, including a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the various processes of the above-described neighbor information table generation method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.

[0087] It should be noted that the electronic devices in the embodiments of the present invention include the mobile electronic devices and non-mobile electronic devices described above.

[0088] This invention also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described neighbor information table generation method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0089] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0090] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0091] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0092] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0093] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0094] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0095] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0096] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0097] The present invention has provided a detailed description of a method, apparatus, electronic device, and computer-readable storage medium for generating a neighbor information table. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for generating a neighbor information table, characterized in that, Applied to a server, the server includes a host and a smart network interface card (NIC), the smart NIC includes multiple optical ports, at least one of which is connected to at least one network device, the host is equipped with multiple flexible NICs, and the method includes: The host sends a first host message from its elastic network interface card (NIC) to the smart NIC. The first host message includes a local device ID field and a local port ID field. The value of the local device ID field is the host ID, and the value of the local port ID field is the elastic network interface card (NIC) ID. The local port ID field of the first host packet is modified by the smart network card to generate a second host packet; the local port ID field of the second host packet is the optical port ID; The smart network interface card (NIC) sends the second host message to the network device connected to the optical port, so that the network device generates a first neighbor information table based on the second host message. The first neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. In each entry of the first neighbor information table, the value of the neighbor device ID field is the host ID, the value of the neighbor port ID field is the optical port ID of the smart NIC, the value of the local device ID field is the network device ID, and the value of the local port ID field is the port ID of the network device.

2. The method according to claim 1, characterized in that, The step of modifying the local port ID field of the first host packet through the smart network card to generate the second host packet includes: The smart network card receives the first host message, generates multiple first host messages corresponding to the multiple optical ports, and modifies the value of the local port ID field in the multiple first host messages to the corresponding optical port ID to generate multiple second host messages.

3. The method according to claim 1, characterized in that, The step of sending the second host message to the network device connected to the optical port via the smart network card includes: The smart network interface card (NIC) stores the multiple second host packets in a local cache. When the first sending condition is met, the plurality of second host messages in the cache are sent to the network devices that are connected to the plurality of optical ports one by one.

4. The method according to claim 1, characterized in that, Also includes: The smart network card receives the first network device message sent by the network device through its optical port. The first network device message includes a local device ID field and a local port ID field, wherein the value of the local device ID field is the network device ID, and the value of the local port ID field is the network device port ID; The smart network interface card (NIC) processes the packets from the first network device to generate packets from the second network device. The value of the ground port ID field in the second network device message is a mapping from the ID of the corresponding optical port to the network device port ID; The second network device message is sent to the host via the smart network card; The host generates a second neighbor information table based on the second network device message. The second neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. In each entry of the second neighbor information table, the value of the neighbor device ID field is the network device ID, the value of the neighbor port ID field is the mapping from the optical port of the smart network card to the network device port ID, the value of the local device ID field is the host ID, and the value of the local port ID field is the host's elastic network card ID.

5. The method according to claim 4, characterized in that, The step of processing the first network device packet through the smart network interface card to generate the second network device packet includes: The first network device packet is copied using the smart network card to generate a copy of the first network device packet. The local port ID field of the first network device packet copy is modified by the smart network card to generate the second network device packet.

6. The method according to claim 4, characterized in that, Also includes: The smart network interface card (NIC) generates a third neighbor information table based on the first network device message. The third neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. In each entry of the third neighbor information table, the value of the neighbor device field is the network device ID, the value of the neighbor port ID field is the network device port ID, the value of the local device ID field is the host ID, and the value of the local port ID field is the optical port ID of the smart network card.

7. The method according to claim 4, characterized in that, The step of sending the second network device message to the host through the smart network card includes: The smart network card stores the packets from the second network device in a local cache. When the second sending condition is met, the second network device message in the cache is sent to the host.

8. A device for generating a neighbor information table, characterized in that, The device is applied to a server, which includes a host and a smart network interface card (NIC). The smart NIC includes multiple optical ports, at least one of which is connected to at least one network device. The host is equipped with multiple flexible NICs. The device includes: The first host message sending module is used to send a first host message from the host's elastic network interface card (NIC) to the smart NIC via the host; the first host message includes a local device ID field and a local port ID field; the value of the local device ID field is the host ID, and the value of the local port ID field is the elastic NIC ID; The second host packet generation module is used to modify the local port ID field of the first host packet through the smart network card to generate a second host packet; the local port ID field of the second host packet is an optical port ID; The first neighbor information table generation module is used to send the second host message to the network device connected to the optical port through the smart network card, so that the network device generates a first neighbor information table based on the second host message. The first neighbor information table includes a neighbor device ID field, a neighbor port ID field, a local device ID field, and a local port ID field. The value of the neighbor device ID field in each entry of the first neighbor information table is the host ID, the value of the neighbor port ID field is the optical port ID of the smart network card, the value of the local device ID field is the network device ID, and the value of the local port ID field is the port ID of the network device.

9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of generating the neighbor information table as described in claims 1-7.

10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of generating the neighbor information table as described in claims 1-7.