Message processing method and device and related equipment
By pre-configuring the Leaf device identifier and port identifier of the host access in the Leaf-Spine architecture, and performing hash processing based on the device and port identifiers, the problem of traffic imbalance caused by traditional hashing methods is solved, achieving more efficient traffic distribution and performance improvement in AI cluster networks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-03-24
AI Technical Summary
In AI training cluster networks, traditional equivalent multipath hashing methods lead to uneven traffic distribution, resulting in link overload and performance degradation. Existing solutions require server modifications or complex configurations and cannot achieve fine-grained traffic distribution.
In the Leaf-Spine architecture, the Leaf device identifier and port identifier of the host are pre-configured. A mapping table is established through extended route advertisements. The device and port identifiers are combined with hash processing to achieve traffic-aware load balancing.
Without modifying the server, it achieves traffic-aware load balancing for devices with the same destination, improving link utilization and network performance in cross-leaf communication in the AI cluster training network.
Smart Images

Figure CN121728064A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network communication technology, and in particular to a message processing method, apparatus and related equipment. Background Technology
[0002] In large-scale AI (Artificial Intelligence) training cluster networks, a two-layer Leaf-Spine topology architecture is typically employed to achieve high reliability and scalability. Each leaf switch is fully connected (full mesh) to the upper-layer spine switch, and the leaf switches directly connect to servers within the rack. East-west traffic (inter-server communication) in this architecture is forwarded through multiple equivalent paths at the Spine layer to achieve load balancing and redundancy. Because RoCE (Remote Direct Memory Access, a mechanism for implementing Remote Direct Memory Access (RDMA) over Ethernet) provides efficient RDMA transmission over Ethernet, AI cluster backend networks widely deploy RoCE (especially RoCEv2) to meet the low-latency, high-bandwidth requirements of large-scale GPU (Graphics Processing Unit) collaborative training.
[0003] In the networks described above, traditional switches typically use ECMP (Equal-Cost Multi-Path) 5-tuple hashing to distribute traffic: for each flow, a hash value is calculated based on the source / destination IP, port, and protocol to select an equal-cost path. However, AI training flows are characterized by low entropy and concentrated traffic: the number and diversity of flows in training jobs are far lower than in traditional services, and flow patterns are repetitive and predictable. Therefore, random hashing based on 5-tuples often leads to uneven traffic distribution in these scenarios. For example, when multiple large flows fall on the same path, it can overload that link while other equal-cost paths are underutilized. In distributed training clusters, traditional ECMP suffers severe performance degradation due to low flow entropy, requiring expensive measures such as doubling the uplink bandwidth of each rack to partially mitigate the problem. Furthermore, while some existing solutions (such as binding flows to predefined paths or extending ECMP based on queue pairs (QP)) can improve performance, they either rely on specific topologies or host-side software modifications or require complex configurations. For example, enabling "Enhanced ECMP" on the switch and adding the destination QP field to the hash can improve AllReduce performance by up to 40%, but this requires splitting messages into multiple QPs and fine-tuning in the communication library (e.g., NVIDIA Collective Communications Library, NCCL). Therefore, current technology cannot achieve fine-grained traffic distribution to the destination host (or port) without modifying the server. Summary of the Invention
[0004] This application provides a message processing method, apparatus, and related equipment.
[0005] Firstly, this application provides a message processing method applied to a first network device in a Leaf-Spine architecture network. For each host connected to the Leaf device, the method pre-configures the device identifier of the Leaf device to which the host is connected, and the port identifier of the port on the Leaf device used to access the host. The method includes: Receive extended route advertisements sent by Leaf devices in the network, which are used to announce the IP prefixes of their connected hosts. The extended route advertisements also include the device identifier of the Leaf device to which the host is connected and the port identifier of the port on the Leaf device used to access the host. Establish and maintain the mapping relationship in the mapping table between the IP prefix of the host, the device identifier of the Leaf device to which the host is connected, and the port identifier of the port on the Leaf device used to access the host; Receive the message and determine whether there is a target mapping table entry in the mapping table that matches the IP address of the message; If it is determined that there is a target mapping table entry in the mapping table that matches the IP address of the packet, then the packet is forwarded according to the target device identifier and target port identifier included in the target mapping table entry.
[0006] Optionally, the step of determining whether there is a target mapping table entry in the mapping table that matches the IP address of the packet includes: Parse the message to obtain the prefix of the destination IP address; Based on the prefix of the destination IP of the message, determine whether there is a target mapping table entry in the mapping table that matches the prefix of the destination IP of the message.
[0007] Optionally, if there is a mapping entry in the mapping table whose IP prefix is the prefix of the destination IP of the packet, then it is determined that there is a target mapping entry in the mapping table that matches the IP address of the packet.
[0008] Optionally, the step of forwarding the packet based on the target device identifier and target port identifier included in the target mapping table entry includes: Based on the five-tuple of the message, the target device identifier and target port identifier included in the target mapping table entry are hashed to obtain a hash result; The path is selected based on the hash result, and the message is forwarded according to the selected path.
[0009] Optionally, if the first network device is a Leaf device, the method further includes: The network sends an extended route advertisement to the second network device in the network to announce the IP prefix of its connected host, and carries the device identifier of the Leaf device and the port identifier of the port on the Leaf device used to access the host, so that the second network device can establish and maintain the mapping relationship of the IP prefix of the host, the device identifier of the Leaf device and the port identifier of the port on the Leaf device used to access the host in its local mapping table.
[0010] Secondly, this application provides a message processing apparatus applied to a first network device in a Leaf-Spine architecture network. For each host connected to a Leaf device, the apparatus pre-configures the device identifier of the Leaf device to which the host is connected, and the port identifier of the port on the Leaf device used to access the host. The apparatus includes: The receiving unit is used to receive an extended route advertisement sent by a Leaf device in the network, which is used to announce the IP prefix of its connected hosts. The extended route advertisement also includes the device identifier of the Leaf device to which the host is connected and the port identifier of the port on the Leaf device used to access the host. The establishment unit is used to establish and maintain the mapping relationship between the IP prefix of the host, the device identifier of the Leaf device to which the host is connected, and the port identifier of the port on the Leaf device used to access the host in the mapping table; The receiving unit is also used to receive messages; The judgment unit is used to determine whether there is a target mapping table entry in the mapping table that matches the IP address of the packet; If the judgment unit determines that there is a target mapping table entry in the mapping table that matches the IP address of the packet, the forwarding unit is used to forward the packet according to the target device identifier and target port identifier included in the target mapping table entry.
[0011] Optionally, when determining whether a target mapping table entry matching the IP address of the packet exists in the mapping table, the determining unit is specifically used for: Parse the message to obtain the prefix of the destination IP address; Based on the prefix of the destination IP of the message, determine whether there is a target mapping table entry in the mapping table that matches the prefix of the destination IP of the message.
[0012] Optionally, if there is a mapping entry in the mapping table whose IP prefix is the prefix of the destination IP of the packet, then it is determined that there is a target mapping entry in the mapping table that matches the IP address of the packet.
[0013] Optionally, when forwarding the packet according to the target device identifier and target port identifier included in the target mapping table entry, the forwarding unit is specifically used for: Based on the five-tuple of the message, the target device identifier and target port identifier included in the target mapping table entry are hashed to obtain a hash result; The path is selected based on the hash result, and the message is forwarded according to the selected path.
[0014] Optionally, If the first network device is a Leaf device, then the apparatus further includes: The sending unit is used to send an extended route advertisement to the second network device in the network to announce the IP prefix of its connected host, and to carry the device identifier of the Leaf device and the port identifier of the port on the Leaf device used to access the host, so that the second network device can establish and maintain the mapping relationship between the IP prefix of the host, the device identifier of the Leaf device and the port identifier of the port on the device used to access the host in its local mapping table.
[0015] Thirdly, embodiments of this application provide a message processing apparatus, which includes: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the steps of the method as described in any one of the first aspects above, according to the obtained program instructions.
[0016] Fourthly, embodiments of this application also provide a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the steps of the method as described in any of the first aspects above.
[0017] In summary, the message processing method provided in this application is applied to a first network device in a Leaf-Spine architecture network. For each host connected to a Leaf device, the device identifier of the Leaf device to which the host is connected, and the port identifier of the port on the Leaf device used to access the host are pre-configured. The method includes: receiving an extended route advertisement sent by a Leaf device in the network to announce the IP prefix of its connected hosts, wherein the extended route advertisement also includes the device identifier of the Leaf device to which the host is connected and the port identifier of the port on the Leaf device used to access the host; establishing and maintaining a mapping relationship in a mapping table between the IP prefix of the host, the device identifier of the Leaf device to which the host is connected, and the port identifier of the port on the Leaf device used to access the host; receiving a message and determining whether there is a target mapping entry in the mapping table that matches the IP address of the message; if it is determined that there is a target mapping entry in the mapping table that matches the IP address of the message, then forwarding the message according to the target device identifier and target port identifier included in the target mapping entry.
[0018] Using the message processing method provided in this application, when the Leaf device announces the IP prefix of a host to other network devices in the network, it carries the identifier of the Leaf device to which the host is connected and the port identifier of the port to which the Leaf device is connected to the host in the extended route advertisement and sends them to other network devices. This allows other network devices to maintain the mapping relationship between the host's IP prefix, the Leaf device's identifier, and the port identifier. Subsequently, when forwarding a message whose destination IP prefix is the host's IP prefix, hash routing is performed based on the Leaf device's identifier and the port identifier associated with the host's IP prefix. This achieves traffic-aware load balancing for the same destination device, effectively improving the link utilization and network performance of cross-leaf communication in the AI cluster training network. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments of this application or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings of the embodiments of this application.
[0020] Figure 1 A detailed flowchart of a message processing method provided for an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a message processing device provided in an embodiment of this application; Figure 3 This is a schematic diagram of the hardware architecture of a message processing device provided in an embodiment of this application. Detailed Implementation
[0021] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “the,” and “the” as used in this application and claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to any and all possible combinations comprising one or more of the associated listed items.
[0022] It should be understood that although the terms first, second, third, etc., may be used to describe various information in embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" may also be interpreted as "when," "when," or "in response to a determination."
[0023] For example, see Figure 1 The diagram shown is a detailed flowchart of a message processing method provided in an embodiment of this application. This method is applied to a first network device in a Leaf-Spine architecture network. For each host connected to a Leaf device, the device identifier of the Leaf device to which the host is connected, and the port identifier of the port on the Leaf device used to access the host are pre-configured. The method includes the following steps: Step 100: Receive the extended route advertisement sent by the Leaf device in the network, which is used to announce the IP prefix of its connected hosts.
[0024] The extended route advertisement also includes the device identifier of the Leaf device to which the host is connected and the port identifier of the port on the Leaf device used to access the host.
[0025] In this embodiment of the application, on each Leaf switch in the Leaf-Spine architecture network, a device identifier is pre-assigned to each downstream host, that is, the identifier of the Leaf switch: Leaf-ID. Preferably, for example, Leaf-ID is a global Router ID. A port identifier is pre-assigned to each downstream host, which represents the port identifier of the port on the Leaf switch that connects to the host, that is, Port-ID (the port number or logical identifier to which the host is connected).
[0026] In practical applications, when a Leaf switch (e.g., a second Leaf device) advertises the IP prefix routes of its connected hosts in the BGP protocol, it appends the Leaf-ID and Port-ID of the Leaf switch to which the host is connected to the extended community attribute of the Update message. For example, the Leaf device ID can be carried as an extended community attribute, similar to the peer advertise device-id approach. Since both Leaf-ID and Port-ID are deterministic identifiers of the device, broadcasting to other switches via the extended community attribute is secure and transparent.
[0027] In this way, each Leaf switch in the network will advertise the IP prefix of its connected hosts to other Leaf switches in the network based on the device identifier of the Leaf switch to which the host is connected and the port identifier of the port on the Leaf switch to which the host is connected.
[0028] For example, suppose Leaf 1 has Host 1 and Host 2 connected to it. Leaf 1 connects to Host 1 through port 1 and joins Host 2 through port 2. Then, the device identifier pre-assigned to Host 1 is Leaf 1, and the port identifier is port 1; the device identifier pre-assigned to Host 2 is Leaf 1, and the port identifier is port 2. For example, Leaf 2 has hosts 3 and 4 connected to it. Leaf 2 connects to host 3 through port 1 and to host 4 through port 2. In this case, the device identifier pre-assigned to host 3 is Leaf 2, and the port identifier is port 1; the device identifier pre-assigned to host 4 is Leaf 2, and the port identifier is port 2.
[0029] Next, when Leaf 1 advertises the IP prefix of its subordinate host 1 to Leaf 2, it includes the device identifier Leaf 1 and the port identifier port 1 in the extended route advertisement. When Leaf 1 advertises the IP prefix of host 2 to Leaf 2, it includes the device identifier Leaf 1 and the port identifier port 2 in the extended route advertisement.
[0030] Similarly, Leaf 2 will also advertise the IP prefixes of its connected hosts 3 and 4 to Leaf 1. That is, when Leaf 2 advertises the IP prefix of its connected host 3 to Leaf 1, it includes the device identifier Leaf 2 and the port identifier port 1 in the extended route advertisement. When Leaf 2 advertises the IP prefix of its connected host 4 to Leaf 1, it includes the device identifier Leaf 2 and the port identifier port 2 in the extended route advertisement.
[0031] It should be noted that in this embodiment of the application, the first network device can be a Leaf device or a Spine device.
[0032] Step 110: Establish and maintain the mapping relationship in the mapping table between the host's IP prefix, the device identifier of the Leaf device to which the host is connected, and the port identifier of the port on the Leaf device used to access the host.
[0033] After receiving the extended route advertisement from the Leaf device, the first network device parses the extended route advertisement, obtains the host's IP prefix, the device identifier of the Leaf device to which the host is connected, and the port identifier of the port to which the Leaf device is connected to the host, and maintains the mapping relationship between the host's IP prefix, the device identifier of the Leaf device to which the host is connected, and the port identifier of the port to which the Leaf device is connected to the host in the mapping table.
[0034] In practical applications, the mapping table can be a routing table or other tables besides the routing table. In this embodiment of the application, no specific limitation is made.
[0035] Step 120: Receive the message and determine whether there is a target mapping table entry in the mapping table that matches the IP address of the message.
[0036] In this embodiment of the application, when determining whether there is a target mapping table entry in the mapping table that matches the IP address of the packet, a preferred implementation is as follows: Parse the packet to obtain the prefix of the destination IP of the packet; determine whether there is a target mapping table entry in the mapping table that matches the prefix of the destination IP of the packet based on the prefix of the destination IP of the packet.
[0037] In other words, after receiving the packet, the first network device parses the packet to obtain the destination IP address of the packet, retrieves the destination IP prefix information of the packet, and determines whether the mapping identifier exists in the target mapping table entry that matches the destination IP prefix based on the destination IP prefix of the packet.
[0038] In this embodiment of the application, if there is a mapping table entry in the mapping table whose IP prefix is the prefix of the destination IP of the packet, then it is determined that there is a target mapping table entry in the mapping table that matches the IP address of the packet; otherwise, it is determined that there is no target mapping table entry in the mapping table that matches the IP address of the packet.
[0039] In practical applications, a preferred implementation is that if the first network device is a Leaf device, the received message is a message sent by the local host; if the first network device is a Spine device, the received message is a message sent by the Leaf device.
[0040] Step 130: If it is determined that there is a target mapping table entry in the mapping table that matches the IP address of the packet, then forward the packet according to the target device identifier and target port identifier included in the target mapping table entry.
[0041] In this embodiment of the application, when forwarding the packet according to the target device identifier and target port identifier included in the target mapping table entry, a preferred implementation is as follows: Based on the five-tuple of the message, the target device identifier and target port identifier included in the target mapping table entry are hashed to obtain a hash result; a path is selected based on the hash result, and the message is forwarded according to the selected path.
[0042] In practical applications, after receiving extended route advertisements with Leaf-ID and Port-ID, other network devices (including Spine and Peer Leaf) store the Leaf-ID and Port-ID in their routing tables and associate them with the IP prefix of the extended route advertisement. Based on this, when performing ECMP path selection, in addition to hashing the 5-tuple field, other network devices also use the destination Leaf-ID and Port-ID obtained in the previous step as additional hash input. For example, for traffic destined for port Y on Leaf switch X, the switch adds (Leaf-ID=X, Port-ID=Y) when calculating the hash, so that the destination device's identification information is included in the hash function.
[0043] In this way, each flow destined for a different leaf switch or a different port will receive a different hash value, thus distributing the flow more evenly across equal-cost paths. For example, all flows destined for Leaf A will tend to be assigned to one set of paths due to the same Leaf-ID, while flows destined for Leaf B will be assigned to another set of paths. Adding Port-ID allows for further subdivision of flows on different ports within the same leaf switch, preventing traffic conflicts between ports.
[0044] In this embodiment, configuration is only required at the network device level, without any server or application layer modifications. Leaf switches can advertise Leaf-ID and Port-ID through conventional BGP configuration (such as enabling extended community passing), and receiving switches recognize and utilize this attribute when updating ECMP hash logic. This achieves traffic-aware load balancing at the destination device level, effectively improving link utilization and network performance for cross-leaf communication in AI cluster training networks.
[0045] Furthermore, if the first network device is a Leaf device, the above message processing method may further include the following steps: The network sends an extended route advertisement to the second network device in the network to announce the IP prefix of its connected host, and carries the device identifier of the Leaf device and the port identifier of the port on the Leaf device used to access the host, so that the second network device can establish and maintain the mapping relationship of the IP prefix of the host, the device identifier of the Leaf device and the port identifier of the port on the Leaf device used to access the host in its local mapping table.
[0046] It should be noted that the second network device is a Spine device, or another Leaf device besides the Leaf device.
[0047] Based on the same inventive concept as the above-described embodiments, see, for example, the following: Figure 2 The diagram shown is a schematic representation of a message processing device provided in an embodiment of this application. This device is applied to a first network device in a Leaf-Spine architecture network. For each host connected to a Leaf device, the device identifier of the Leaf device to which the host is connected, and the port identifier of the port on the Leaf device used to access the host are pre-configured. The device includes: The receiving unit 20 is used to receive an extended route advertisement sent by the Leaf device in the network, which is used to announce the IP prefix of its connected host. The extended route advertisement also includes the device identifier of the Leaf device to which the host is connected and the port identifier of the port on the Leaf device used to access the host. Establishment unit 21 is used to establish and maintain in the mapping table the mapping relationship between the IP prefix of the host, the device identifier of the Leaf device to which the host is connected, and the port identifier of the port on the Leaf device used to access the host; The receiving unit 20 is further configured to receive messages; The judgment unit 22 is used to determine whether there is a target mapping table entry in the mapping table that matches the IP address of the packet; If the judgment unit 22 determines that there is a target mapping table entry in the mapping table that matches the IP address of the packet, then the forwarding unit 23 is used to forward the packet according to the target device identifier and target port identifier included in the target mapping table entry.
[0048] Optionally, when determining whether there is a target mapping entry in the mapping table that matches the IP address of the packet, the determining unit 22 is specifically used for: Parse the message to obtain the prefix of the destination IP address; Based on the prefix of the destination IP of the message, determine whether there is a target mapping table entry in the mapping table that matches the prefix of the destination IP of the message.
[0049] Optionally, if there is a mapping entry in the mapping table whose IP prefix is the prefix of the destination IP of the packet, then it is determined that there is a target mapping entry in the mapping table that matches the IP address of the packet.
[0050] Optionally, when forwarding the packet according to the target device identifier and target port identifier included in the target mapping table entry, the forwarding unit 23 is specifically used for: Based on the five-tuple of the message, the target device identifier and target port identifier included in the target mapping table entry are hashed to obtain a hash result; The path is selected based on the hash result, and the message is forwarded according to the selected path.
[0051] Optionally, if the first network device is a Leaf device, the apparatus further includes: The sending unit is used to send an extended route advertisement to the second network device in the network to announce the IP prefix of its connected host, and to carry the device identifier of the Leaf device and the port identifier of the port on the Leaf device used to access the host, so that the second network device can establish and maintain the mapping relationship between the IP prefix of the host, the device identifier of the Leaf device and the port identifier of the port on the device used to access the host in its local mapping table.
[0052] These units can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more digital signal processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when one of these units is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these units can be integrated together to form a system-on-a-chip (SOC).
[0053] Furthermore, regarding the message processing apparatus provided in this application embodiment, from a hardware perspective, the hardware architecture schematic diagram of the message processing apparatus can be found in [reference needed]. Figure 3 As shown, the message processing device may include: a memory 30 and a processor 31. The memory 30 is used to store program instructions; the processor 31 calls the program instructions stored in the memory 30 and executes the above method embodiment according to the obtained program instructions. The specific implementation method and technical effect are similar, and will not be described again here.
[0054] Optionally, this application also provides a network device, including at least one processing element (or chip) for performing the above method embodiments.
[0055] Optionally, this application also provides a program product, such as a computer-readable storage medium storing computer-executable instructions for causing the computer to perform the above-described method embodiments.
[0056] Here, a machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, a machine-readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.
[0057] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.
[0058] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.
[0059] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of this application can take the form of a computer program product 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.
[0060] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and 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 apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0061] Furthermore, these computer program instructions can also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing 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 the process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0062] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable 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.
[0063] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A message processing method, characterized in that, The first network device applied in a Leaf-Spine architecture network pre-configures, for each host connected to the Leaf device, the device identifier of the Leaf device to which the host is connected, and the port identifier of the port on the Leaf device used to access the host; the method includes: Receive extended route advertisements sent by Leaf devices in the network, which are used to announce the IP prefixes of their connected hosts. The extended route advertisements also include the device identifier of the Leaf device to which the host is connected and the port identifier of the port on the Leaf device used to access the host. Establish and maintain the mapping relationship in the mapping table between the IP prefix of the host, the device identifier of the Leaf device to which the host is connected, and the port identifier of the port on the Leaf device used to access the host; Receive the message and determine whether there is a target mapping table entry in the mapping table that matches the IP address of the message; If it is determined that there is a target mapping table entry in the mapping table that matches the IP address of the packet, then the packet is forwarded according to the target device identifier and target port identifier included in the target mapping table entry.
2. The method as described in claim 1, characterized in that, The step of determining whether there is a target mapping table entry in the mapping table that matches the IP address of the packet includes: Parse the message to obtain the prefix of the destination IP address; Based on the prefix of the destination IP of the message, determine whether there is a target mapping table entry in the mapping table that matches the prefix of the destination IP of the message.
3. The method as described in claim 2, characterized in that, If there is a mapping entry in the mapping table whose IP prefix is the prefix of the destination IP of the packet, then it is determined that there is a target mapping entry in the mapping table that matches the IP address of the packet.
4. The method as described in claim 1, characterized in that, The steps of forwarding the packet based on the target device identifier and target port identifier included in the target mapping table entry include: Based on the five-tuple of the message, the target device identifier and target port identifier included in the target mapping table entry are hashed to obtain a hash result; The path is selected based on the hash result, and the message is forwarded according to the selected path.
5. The method as described in claim 1, characterized in that, If the first network device is a Leaf device, the method further includes: The network sends an extended route advertisement to the second network device in the network to announce the IP prefix of its connected host, and carries the device identifier of the Leaf device and the port identifier of the port on the Leaf device used to access the host, so that the second network device can establish and maintain the mapping relationship of the IP prefix of the host, the device identifier of the Leaf device and the port identifier of the port on the Leaf device used to access the host in its local mapping table.
6. A message processing apparatus, characterized in that, A first network device applied in a Leaf-Spine architecture network, for each host connected to a Leaf device, pre-configures the device identifier of the Leaf device to which the host is connected, and the port identifier of the port on the Leaf device used to access the host; the device includes: The receiving unit is used to receive an extended route advertisement sent by a Leaf device in the network, which is used to announce the IP prefix of its connected hosts. The extended route advertisement also includes the device identifier of the Leaf device to which the host is connected and the port identifier of the port on the Leaf device used to access the host. The establishment unit is used to establish and maintain the mapping relationship between the IP prefix of the host, the device identifier of the Leaf device to which the host is connected, and the port identifier of the port on the Leaf device used to access the host in the mapping table; The receiving unit is also used to receive messages; The judgment unit is used to determine whether there is a target mapping table entry in the mapping table that matches the IP address of the packet; If the judgment unit determines that there is a target mapping table entry in the mapping table that matches the IP address of the packet, the forwarding unit is used to forward the packet according to the target device identifier and target port identifier included in the target mapping table entry.
7. The apparatus as claimed in claim 6, characterized in that, When determining whether a target mapping table entry matching the IP address of the packet exists in the mapping table, the determining unit is specifically used for: Parse the message to obtain the prefix of the destination IP address; Based on the prefix of the destination IP of the message, determine whether there is a target mapping table entry in the mapping table that matches the prefix of the destination IP of the message.
8. The apparatus as claimed in claim 7, characterized in that, If there is a mapping entry in the mapping table whose IP prefix is the prefix of the destination IP of the packet, then it is determined that there is a target mapping entry in the mapping table that matches the IP address of the packet.
9. The apparatus as claimed in claim 6, characterized in that, When forwarding the packet according to the target device identifier and target port identifier included in the target mapping table entry, the forwarding unit is specifically used for: Based on the five-tuple of the message, the target device identifier and target port identifier included in the target mapping table entry are hashed to obtain a hash result; The path is selected based on the hash result, and the message is forwarded according to the selected path.
10. The apparatus as claimed in claim 6, characterized in that, If the first network device is a Leaf device, then the apparatus further includes: The sending unit is used to send an extended route advertisement to the second network device in the network to announce the IP prefix of its connected host, and to carry the device identifier of the Leaf device and the port identifier of the port on the Leaf device used to access the host, so that the second network device can establish and maintain the mapping relationship between the IP prefix of the host, the device identifier of the Leaf device and the port identifier of the port on the device used to access the host in its local mapping table.
11. A message processing apparatus, characterized in that, The message processing device includes: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the steps of the method as described in any one of claims 1-5 according to the obtained program instructions.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing the computer to perform the steps of the method as described in any one of claims 1-5.