Message forwarding method, message sorting method, message forwarding device, message sorting device and network equipment
By using message containers as forwarding units in network equipment, the problems of uneven load and packet out-of-order are solved, order-preserving transmission of messages is achieved, the de-ordering pressure on network equipment is reduced, and network performance is improved.
Patent Information
- Application Number
- CN202410059436.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-15
- Publication Date
- 2024-10-18
AI Technical Summary
Existing technologies can easily lead to load imbalance and packet out-of-order problems in flow-based distribution, resulting in high pressure on network devices when de-ordering, and the randomness of packet lengths affects load balancing performance.
Message containers are used as the basic forwarding unit, routing information is used to determine scheduling queues and allocate message containers, and information headers are added to identify containers and queue information to achieve message forwarding and sorting and reduce the de-sequencing pressure on network equipment.
Through the forwarding and sorting of message containers, the order-preserving transmission of messages is achieved, which reduces the out-of-order pressure and load imbalance problems of network equipment, and improves the effective bandwidth and forwarding delay stability of the network.
Smart Images

Figure CN118802791A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a message forwarding method, a message sorting method, a device and a network device. Background Art
[0002] Message-based distribution is an industry-recognized solution to the uneven distribution of traditional flows. However, message-based distribution will inevitably lead to a large number of packet out-of-order problems in a flow. The network equipment that resolves the out-of-order packets needs to cache the packets for sorting, which puts great pressure on the equipment that resolves the out-of-order packets. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a message forwarding method, a message sorting method, an apparatus and a network device, which can reduce the pressure of network devices to resolve out-of-order messages.
[0004] The technical solution of the embodiment of the present invention is achieved as follows:
[0005] On the one hand, an embodiment of the present invention provides a message forwarding method, which is applied to a first network device. The message forwarding method includes:
[0006] When receiving a message to be forwarded, determining queue information of a scheduling queue of the message to be forwarded based on routing information of the message to be forwarded;
[0007] Allocating a message container to the message to be forwarded in the scheduling queue; the messages to be forwarded in the same message container have the same forwarding path;
[0008] Adding an information header to the message to be forwarded, wherein the information header includes an identifier of the message container, the queue information, and an identifier of the first network device;
[0009] Forward the message to be forwarded to the destination network device.
[0010] In the above solution, the sum of the byte lengths of all messages to be forwarded in the same message container is less than or equal to the set length of the corresponding message container.
[0011] In the above solution, the queue information corresponds to a priority of the destination port of the message to be forwarded, and each priority of the destination port corresponds to a scheduling queue.
[0012] In the above solution, if the message to be forwarded is the first message in the corresponding message container, the message header of the message to be forwarded further includes a start identifier.
[0013] In the above solution, if the message to be forwarded is the last message in the corresponding message container, the message header of the message to be forwarded further includes an end marker.
[0014] On the other hand, an embodiment of the present invention provides a message sorting method, which is applied to a second network device. The message sorting method includes:
[0015] receiving a message sent by a first network device; the message including an information header added by the first network device;
[0016] Parsing the information header of the message to obtain the identifier of the message container allocated by the first network device to the message, queue information, and the identifier of the first network device; the messages in the same message container have the same forwarding path;
[0017] In the scheduling queue corresponding to the queue information, the messages are sorted based on the identifier of the message container and the identifier of the first network device.
[0018] In one embodiment, the queue information corresponds to a priority of a destination port of the message, and each priority of the destination port corresponds to a scheduling queue.
[0019] In one embodiment, the sum of the byte lengths of all messages in the same message container is less than or equal to the set length of the corresponding message container.
[0020] In one embodiment, the sorting of the messages based on the identifier of the message container and the identifier of the first network device includes:
[0021] Based on the identifier of the first network device, determining whether the identifier of the message container is a container identifier currently expected by the second network device;
[0022] If the message container identifier of the message is the container identifier currently expected by the second network device, the message is forwarded; otherwise, the message is cached.
[0023] In one embodiment, if the message is the last message in the corresponding message container, the message header of the message further includes an end marker; and the method further includes:
[0024] If the identifier of the message container is the container identifier currently expected by the second network device, and the message header of the message further includes the end identifier, the container identifier currently expected by the second network device is adjusted based on preset priority information of the expected container identifier.
[0025] In one embodiment, the method further comprises:
[0026] If the message including the end identifier is not received within the set time period, the container identifier currently expected by the second network device is adjusted.
[0027] On the other hand, an embodiment of the present invention provides a message forwarding device, the device comprising:
[0028] A determination module, configured to determine, upon receiving a message to be forwarded, queue information of a scheduling queue of the message to be forwarded based on routing information of the message to be forwarded;
[0029] An allocation module, configured to allocate a message container to the message to be forwarded in the scheduling queue; the messages to be forwarded in the same message container have the same forwarding path;
[0030] An adding module, configured to add an information header to the message to be forwarded, wherein the information header includes an identifier of the message container, the queue information, and an identifier of the first network device;
[0031] The forwarding module is used to forward the message to be forwarded to the destination network device.
[0032] On the other hand, an embodiment of the present invention provides a message sorting device, the device comprising:
[0033] A receiving module, configured to receive a message sent by a first network device; the message includes an information header added by the first network device;
[0034] A parsing module, used to parse the information header of the message, obtain the identifier of the message container allocated by the first network device to the message, the queue information and the identifier of the first network device; the messages in the same message container have the same forwarding path;
[0035] A sorting module is used to sort the messages in the scheduling queue corresponding to the queue information based on the identifier of the message container and the identifier of the first network device.
[0036] On the other hand, an embodiment of the present invention provides a network device, including a processor and a memory, which are interconnected, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the steps of the message sorting method provided in the embodiment of the present invention.
[0037] On the other hand, an embodiment of the present invention provides a computer-readable storage medium, including: the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of the message sorting method provided in the embodiment of the present invention are implemented.
[0038] In the embodiment of the present application, when the first network device receives the message to be forwarded, based on the routing information of the message to be forwarded, the queue information of the scheduling queue of the message to be forwarded is determined. A message container is allocated to the message to be forwarded in the scheduling queue, and the messages to be forwarded in the same message container have the same forwarding path. An information header is added to the message to be forwarded, and the information header includes the identifier of the message container, the queue information and the identifier of the first network device, and the message to be forwarded is forwarded to the destination network device. In the embodiment of the present application, the message container is used as the basic forwarding unit, and the messages in the same message container select the same forwarding path, so that when the messages in the message container arrive at the destination network device, the order of the messages is preserved, and the destination network device only needs to sort between the message containers, and there is no need to sort each message. The granularity of sorting becomes larger, which can reduce the probability of message disorder and reduce the pressure of de-sequencing on the destination network device. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a schematic diagram of a Global Scheduling Ether (GES) network architecture provided by an embodiment of the present invention;
[0040] Figure 2 It is a schematic diagram of an implementation flow of a message forwarding method provided by an embodiment of the present invention;
[0041] Figure 3 It is a schematic diagram of an implementation flow of a message sorting method provided by an embodiment of the present invention;
[0042] Figure 4 is a schematic diagram of a message forwarding device provided by an embodiment of the present invention;
[0043] Figure 5 is a schematic diagram of a message sorting device provided by an embodiment of the present invention;
[0044] Figure 6 It is a schematic diagram of a network device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] The AI training traffic model has the characteristics of a small number of flows and a large single-flow bandwidth. The traditional Ethernet flow-based load sharing method is prone to hash polarization, resulting in uneven link loads, and even congestion leading to network packet loss, making the network's effective bandwidth very low and unable to cope with burst traffic. Message distribution is the industry-recognized solution to traditional flow-based uneven distribution. However, when implementing load balancing based on message forwarding, it is first necessary to overcome the impact of random message lengths, and secondly, it is necessary to solve a large number of packet disorder problems. Therefore, it is necessary to normalize the basic forwarding unit of load balancing and establish a fixed-length message container.
[0047] Existing flow-based load balancing technologies have the following problems:
[0048] 1. Flow-based load balancing technology is prone to uneven load balancing. In the AI large model scenario, the number of flows is small and the single flow is large. Flow-based load balancing is prone to cause multiple flows to be scheduled to the same physical link, resulting in congestion, while other links are relatively idle.
[0049] 2. Message forwarding is a technical approach to solving uneven flow loads, but the message length is random. Due to the inconsistency of message length, load balancing cannot achieve high performance.
[0050] 3. Message forwarding will inevitably lead to a large number of packet disorder problems in a flow. The network equipment that resolves the disorder needs to cache the messages for sorting, which puts great pressure on the equipment that resolves the disorder.
[0051] In view of the shortcomings of the above-mentioned related technologies, the embodiments of the present invention provide a message forwarding method and a message sorting method, which can reduce the pressure of network devices to resolve out-of-order messages. In order to illustrate the technical solution of the present invention, a specific embodiment is used for description below.
[0052] Figure 1 It is a schematic diagram of a Global Scheduling Ether (GES) network architecture provided by an embodiment of the present invention.
[0053] Among them, the Global Scheduling Processor (GSP) is a network edge processing node that accesses computing traffic and performs global scheduling of traffic. It has dynamic load balancing capabilities when traffic is upstream and traffic sorting capabilities when traffic is downstream.
[0054] The Global Scheduling Fabric (GSF) is the core switching node of the network. As the upper-level device of GSP, it is used to flexibly expand the network scale and has dynamic load balancing capabilities and back pressure information publishing capabilities.
[0055] Figure 1 The Graphics Processing Unit (GPU) belongs to the computing node, which is the computing card and network card on the server side, providing high-performance computing capabilities.
[0056] GES also includes the Global Scheduling Operating System (GSOS), which provides centralized network operating system capabilities for whole-network control.
[0057] The above computing nodes belong to the computing layer, GSP and GSF belong to the network layer, and GSOS belongs to the control layer.
[0058] All network devices support standard Ethernet, without the need for dedicated cell processing nodes, and can switch seamlessly with standard Ethernet devices. Among them, although GSP and GSF devices have different roles, they are both based on Ethernet message exchange, forwarding hardware is universal, and device roles can be controlled by software versions, thus supporting more flexible deployment and maintenance.
[0059] After the network devices (GSP and GSF) are connected, they discover their neighbors through the Link Layer Discovery Protocol (LLDP) and send the neighbor information to GSOS, which obtains the interconnection interfaces of all network devices.
[0060] GSOS assigns a device ID (identifier) to all GSP devices in the entire network, namely GSP-ID, and allocates a globally unique dynamic global scheduling queue (Dynamic Global Scheduling Queue, DGSQ)-ID information to the global GSP downstream port; GSOS sends GSP-ID, DGSQ-ID and the length information of the network message container to all GSP devices.
[0061] Figure 2 is a schematic diagram of an implementation flow of a message forwarding method provided by an embodiment of the present invention, wherein the execution subject of the message sorting method is a first network device, and the first network device is a source end network device, for example, Figure 1 GSP devices in. Reference Figure 2 , the message forwarding method includes:
[0062] S201: When a message to be forwarded is received, queue information of a scheduling queue of the message to be forwarded is determined based on routing information of the message to be forwarded.
[0063] In this embodiment, the first network device is a source network device, and the second network device is a destination network device. For example, the first network device may be Figure 1 In the example, GSP-1, the second network device is GSP-2.
[0064] After the first network device receives the message, it finds the corresponding output port information according to the routing information of the message to be forwarded. The destination network device includes multiple destination ports. The corresponding destination port can be found according to the Internet Protocol (IP) routing of the message. The destination port has multiple priorities, each priority corresponds to a scheduling queue, selects a priority for the message, and then obtains the queue information.
[0065] In one embodiment, the queue information consists of a destination network device identifier, a destination port identifier, and a port priority.
[0066] In general, a unique DGSQ identifier can be established based on the source network device, the destination port, and the priority of the destination port. Of course, the DGSQ granularity can also be simplified according to business needs, such as setting 4, 2, or 1 priorities under a destination port, reducing the demand for DGSQ queues and reducing switching chip overhead.
[0067] The first network device may receive a message from the computing layer. After receiving the message, the first network device finds the final exit through the forwarding table, and allocates the message to the corresponding DGSQ for authorization scheduling based on the final exit.
[0068] S202, allocating a message container for the message to be forwarded in the scheduling queue; the messages to be forwarded in the same message container have the same forwarding path.
[0069] The first network device allocates a corresponding message container identifier to the message in the scheduling queue according to information such as the message container length and the number of bytes already occupied by the message container. Messages to be forwarded in the same message container have the same forwarding path.
[0070] Here, the implementation of the message container is logically virtual. When a message enters the GSP node, the GSP node will record the message container identifier to which it belongs, the number of bytes occupied in the message container and other information. When the number of message bytes exceeds the set length of the virtual message container, the message will be scheduled and recorded in the next message container.
[0071] S203: Add an information header to the message to be forwarded, where the information header includes an identifier of the message container, the queue information, and an identifier of the first network device.
[0072] Encapsulate the message header, which includes the message container identifier, queue information, and the identifier of the first network device. The GSE network needs to add additional information to the message for global load balancing forwarding and sorting. This information can be carried in three ways, including:
[0073] 1. Add a standard extension header outside the standard Ethernet frame: The advantage of this carrying method is that it does not damage the original message.
[0074] 2. Redefine the standard Ethernet frame: Redefine the Media Access Control (MAC) header of the message. The advantage of this carrying method is high transmission efficiency.
[0075] 3. Expand the protocol header after Ethernet MAC or IP. The advantage of this method is that it balances the compatibility and transmission efficiency of Ethernet.
[0076] S204: forward the message to be forwarded to the destination network device.
[0077] The message to be forwarded with the above information header added is forwarded to the destination network device.
[0078] After entering the DGSQ, the message needs to be authorized by the downlink scheduling before it can be sent to the switching network. At this time, the messages sent from the same ingress Leaf node to the same egress Leaf node can be formed into a de-sequencing queue, that is, all data packets in each message container are added with the same sequence number (container sequence) and source GSPID. After receiving these messages in the downlink, de-sequencing can be performed based on the source GSPID and sequence number.
[0079] Generally, there are at least three hops in a network, namely, a source Leaf, a Spine, and a destination Leaf. This embodiment only schematically shows the source network device and the destination network device. Other intermediate devices not shown can still be applied to this embodiment.
[0080] Each node in the GSE network directly forwards messages without caching messages to build actual containers. For all messages belonging to the same message container, they will be load-balanced to a unique path for forwarding in the switching network to ensure that the messages in the message container are no longer out of order, thereby reducing the pressure on the egress GSP node to resolve the out-of-order situation.
[0081] In the embodiment of the present application, when the first network device receives the message to be forwarded, based on the routing information of the message to be forwarded, it determines the queue information of the scheduling queue of the message to be forwarded. In the scheduling queue, a message container is allocated to the message to be forwarded, and the messages to be forwarded in the same message container have the same forwarding path. An information header is added to the message to be forwarded, and the information header includes the identifier of the message container, the queue information and the identifier of the first network device, and the message to be forwarded is forwarded to the destination network device. In the embodiment of the present application, the message container is used as the basic forwarding unit, and the messages in the same message container select the same forwarding path, so that when the messages in the message container arrive at the destination network device, the order of the messages is maintained, and the destination network device only needs to sort the message containers, and there is no need to sort each message. The granularity of sorting becomes larger, which can reduce the probability of message disorder and reduce the pressure of de-sequencing.
[0082] In one embodiment, the sum of the byte lengths of all messages to be forwarded in the same message container is less than or equal to the set length of the corresponding message container.
[0083] Here, the length of the message container is configurable and can be flexibly adjusted according to actual network conditions.
[0084] Based on the byte length of the message to be forwarded and the set length of the message container, a message container identifier is assigned to the message to be forwarded in the scheduling queue. When the sum of the number of bytes of the message to be forwarded and the byte lengths of other messages in the message container exceeds the set length of the message container, the message to be forwarded is scheduled and recorded in the next message container.
[0085] The embodiment of the present application proposes a concept of a logical fixed-length message container, which logically assembles multiple messages into a message container, and the message container header identifies a message container. The fixed-length message container solves the problem of uneven balance caused by random message length, improves effective bandwidth, and reduces long-tail delay.
[0086] When implementing load balancing based on message forwarding, the first thing to do is to overcome the random impact of message length. Therefore, it is necessary to normalize the basic forwarding unit of load balancing and establish a fixed-length message container. The number of messages that a message container can accommodate can be adjusted according to the distribution of service message lengths. It is required to be able to accommodate at least one longest service message, and the total length should be as short as possible within the chip forwarding capacity and de-sequencing capacity, so as to achieve the purpose of finely segmenting data streams and fully improving the instantaneous load balancing.
[0087] In one embodiment, the queue information corresponds to a priority of a destination port of the message to be forwarded, and each priority of the destination port corresponds to a scheduling queue.
[0088] In actual applications, the priority can be determined by the DSCP value of the IP header of the message. There is a mapping relationship between DSCP and priority. Alternatively, different priorities can be configured according to the scenario. For example, in the intelligent computing scenario, lossless messages have a high priority, while ordinary User Datagram Protocol (UDP) traffic has a low priority.
[0089] In one embodiment, if the message to be forwarded is the first message in the corresponding message container, the message header of the message to be forwarded further includes a start identifier.
[0090] In one embodiment, if the message to be forwarded is the last message in the corresponding message container, the message header of the message to be forwarded further includes an end marker.
[0091] If the message to be forwarded is the last message that the message container can accommodate, an End mark is added to it. When the target network device receives the message, if it finds the End mark carried by the message, it means that the message is the last message in the message container, then the message is directly sent out and the message container mark expected to be received is adjusted.
[0092] Figure 3 is a schematic diagram of an implementation flow of another message sorting method provided by an embodiment of the present invention, wherein the execution subject of the message sorting method is the second network device, and the first network device is the destination network device, for example, Figure 1 GSP devices in. Reference Figure 3 , the message sorting methods include:
[0093] S301, receiving a message sent by a first network device; the message includes an information header added by the first network device.
[0094] The first network device is a source network device, and the second network device is a destination network device. For example, the first network device may be Figure 1 In the example, GSP-1, the second network device is GSP-2.
[0095] S302, parsing the information header of the message to obtain the identifier of the message container allocated by the first network device to the message, queue information, and the identifier of the first network device; messages in the same message container have the same forwarding path.
[0096] The second network device receives a message sent by the first network device, wherein the message carries an information header including an identifier of a message container allocated by the first network device for the message, queue information, and an identifier of the first network device, and parses the message information header to obtain information therein.
[0097] S303: In the scheduling queue corresponding to the queue information, the messages are sorted based on the identifier of the message container and the identifier of the first network device.
[0098] After the destination GSP (second network device) receives the message, it knows which scheduling queue to sort in based on the DGSQ information (queue information) carried in the message, and then sorts it accordingly based on the source GSP-ID (identifier of the first network device) and container ID (identifier of the message container) carried in the message.
[0099] The destination port may receive messages from different source GSPs. The container IDs of different source GSPs may be repeated, so the source GSPID needs to be added. The order cannot be based on the container ID alone.
[0100] The destination GSP obtains the queue that needs to be sorted according to the DGSQ information carried in the message, and then sorts the containers based on the source GSP-ID and container ID.
[0101] In the embodiment of the present application, the message container is used as the basic forwarding unit. The messages in the same message container have a unique forwarding path. In this way, when the messages in the message container arrive at the destination device, the order of the messages is maintained. The message containers may be out of order. The destination device only needs to sort the containers, and there is no need to sort each message one by one. That is, the granularity of sorting becomes larger, which solves the pressure of network devices to resolve the disorder.
[0102] In one embodiment, the queue information corresponds to a priority of a destination port of the message, and each priority of the destination port corresponds to a scheduling queue.
[0103] In one embodiment, the sum of the byte lengths of all messages in the same message container is less than or equal to the set length of the corresponding message container.
[0104] In one embodiment, the sorting of the messages based on the identifier of the message container and the identifier of the first network device includes:
[0105] Based on the identifier of the first network device, determining whether the identifier of the message container is a container identifier currently expected by the second network device;
[0106] If the message container identifier of the message is the container identifier currently expected by the second network device, the message is forwarded; otherwise, the message is cached.
[0107] The destination port may receive messages from different source GSPs. The message container IDs of different source GSPs may be repeated, so the source GSPID needs to be added. The message container ID cannot be used for sorting.
[0108] For example, the second network device includes priority information of preset expected container identifiers of each first network device. For a message sent by the first network device, if the message container identifier of the message is the currently expected container identifier, the message is directly sent out, otherwise the message is cached.
[0109] In one embodiment, if the message is the last message in the corresponding message container, the message header of the message further includes an end marker; and the method further includes:
[0110] If the identifier of the message container is the container identifier currently expected by the second network device, and the message header of the message further includes the end identifier, the container identifier currently expected by the second network device is adjusted based on preset priority information of the expected container identifier.
[0111] For example, if the End flag position carried by the message is 1, it means that the message is the last message of the container, so the message is directly sent out, and the ID of the message container expected to be received is increased by 1.
[0112] In one embodiment, the method further comprises:
[0113] If the message including the end identifier is not received within the set time period, the container identifier currently expected by the second network device is adjusted.
[0114] For example, starting from the first message received by the message container, the first message of the message container can be marked with a Start flag, and the timer is started as long as a message with a Start flag is received. If the timer exceeds the set timeout period and has not received a message with an end flag, it means that the message with the end flag is lost, and the second network device starts to schedule the sending of the message container ID+1.
[0115] In one embodiment, assuming that the expected container identifiers are sorted from large to small, if no message with an end identifier is received for several consecutive set time periods, the expected container identifier is reduced once each time the set time period passes until it is reduced to the minimum container identifier.
[0116] Alternatively, the container identifier currently expected by the second network device may be adjusted according to a preset priority of the message container identifier.
[0117] In one embodiment, a virtual queue of all device exports in the network can be established on the GSP to simulate the traffic scheduling from the device to the corresponding port. Different from the flow-based load sharing mechanism of traditional Ethernet, the GSE switching network uses a fixed-length packet container (PKTC) for message forwarding and dynamic load balancing. By building a DGSQ full scheduling mechanism based on PKTC, the network's effective bandwidth and forwarding delay stability are comprehensively improved. PKTC is a core forwarding mechanism that is different from CELL forwarding. Under this mechanism, Ethernet messages are logically composed of virtual message containers, and the message container is used as the smallest unit for transmission in the switching network.
[0118] This proposal is based on the business characteristics of AI large models, with a small number of flows and large single-flow bandwidth, and proposes a concept of a logical fixed-length message container. On the one hand, multiple messages are logically assembled into a message container, and the fixed-length message container solves the problem of uneven balance caused by the randomness of the message length, improves the effective bandwidth, and reduces the long-tail delay; on the other hand, by logically assembling several messages into a fixed-length message container for forwarding, the message container is the basic forwarding unit, and the messages in the same container choose the same path. The de-sequencing device only sorts between containers without sorting the message granularity, which can reduce the probability of message disorder and solve the de-sequencing pressure of network devices.
[0119] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0120] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0121] It should be noted that the technical solutions described in the embodiments of the present invention can be arbitrarily combined without conflict.
[0122] In addition, in the embodiments of the present invention, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0123] refer to Figure 4 , Figure 4 is a schematic diagram of a message forwarding device provided by an embodiment of the present invention, such as Figure 4 As shown, the device comprises:
[0124] A determination module, configured to determine, upon receiving a message to be forwarded, queue information of a scheduling queue of the message to be forwarded based on routing information of the message to be forwarded;
[0125] An allocation module, configured to allocate a message container to the message to be forwarded in the scheduling queue; the messages to be forwarded in the same message container have the same forwarding path;
[0126] An adding module, configured to add an information header to the message to be forwarded, wherein the information header includes an identifier of the message container, the queue information, and an identifier of the first network device;
[0127] The forwarding module is used to forward the message to be forwarded to the destination network device.
[0128] refer to Figure 5 , Figure 5 is a schematic diagram of a message sorting device provided by an embodiment of the present invention, such as Figure 5 As shown, the device comprises:
[0129] A receiving module, configured to receive a message sent by a first network device; the message includes an information header added by the first network device;
[0130] A parsing module, used to parse the information header of the message, obtain the identifier of the message container allocated by the first network device to the message, the queue information and the identifier of the first network device; the messages in the same message container have the same forwarding path;
[0131] A sorting module is used to sort the messages in the scheduling queue corresponding to the queue information based on the identifier of the message container and the identifier of the first network device.
[0132] In actual application, the determination module, allocation module, addition module and forwarding module can be implemented by a processor in the network device, such as a central processing unit (CPU), a digital signal processor (DSP), a microcontroller unit (MCU) or a programmable gate array (FPGA).
[0133] It should be noted that: when the message sorting device provided in the above embodiment performs information processing, only the division of the above modules is used as an example. In actual applications, the above processing can be assigned to different modules as needed, that is, the internal structure of the device is divided into different modules to complete all or part of the processing described above. In addition, the message sorting device provided in the above embodiment and the message sorting method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0134] The above-mentioned message sorting device can be in the form of an image file. After the image file is executed, it can be run in the form of a container or a virtual machine to implement the message sorting method described in this application. Of course, it is not limited to the image file form. As long as some software forms that can implement the message sorting method described in this application are within the protection scope of this application.
[0135] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiment of the present application, the embodiment of the present application further provides a network device, and the above message sorting method is implemented by a processor of the network device. Figure 6 Schematic diagram of the hardware structure of the network device in the embodiment of the present application. Figure 6 As shown, the network equipment includes:
[0136] Communication interface 601, capable of exchanging information with other devices;
[0137] The processor 602 is connected to the communication interface 601 to implement information exchange with other devices and is used to execute the method provided by one or more technical solutions on the network device side when running a computer program. The computer program is stored in the memory 603.
[0138] Of course, in actual application, the various components in the network device are coupled together through the bus system 604. It can be understood that the bus system 604 is used to realize the connection and communication between these components. In addition to the data bus, the bus system also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 6 Various buses are labeled as bus system 604 .
[0139] The memory 603 in the embodiment of the present application is used to store various types of data to support the operation of the network device. Examples of such data include: any computer program used to operate on the network device.
[0140] In this application, a network device can be a single hardware device or a cluster of multiple hardware devices, such as a cloud computing platform. The so-called cloud computing platform is a cluster device that organizes multiple independent server physical hardware resources into pooled resources, which provides the required virtual resources and services to the outside world.
[0141] The memory 603 in the embodiment of the present application is used to store various types of data to support the operation of the network device. Examples of such data include: any computer program used to operate on the network device.
[0142] It can be understood that the memory 603 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), direct memory bus random access memory (DRRAM). The memory described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memory.
[0143] The method disclosed in the above embodiment of the present application can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in a memory, and the processor reads the program in the memory and completes the steps of the above method in combination with its hardware.
[0144] Optionally, when the processor executes the program, the corresponding process implemented by the network device in each method of the embodiments of the present application is implemented, which will not be repeated here for the sake of brevity.
[0145] In an exemplary embodiment, the present application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, including a first memory storing a computer program, and the computer program can be executed by a processor of a network device to complete the steps of the aforementioned method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.
[0146] In the several embodiments provided in the present application, it should be understood that the disclosed devices, network devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0147] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0148] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately configured as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0149] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, disks or optical disks.
[0150] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0151] It should be noted that the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.
[0152] In addition, in the examples of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0153] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A message forwarding method, applied to a first network device, characterized in that: The method comprises: When receiving a message to be forwarded, determining queue information of a scheduling queue of the message to be forwarded based on routing information of the message to be forwarded; Allocating a message container to the message to be forwarded in the scheduling queue; the messages to be forwarded in the same message container have the same forwarding path; Adding an information header to the message to be forwarded, wherein the information header includes an identifier of the message container, the queue information, and an identifier of the first network device; Forward the message to be forwarded to the destination network device.
2. The method according to claim 1, characterized in that: The sum of the byte lengths of all messages to be forwarded in the same message container is less than or equal to the set length of the corresponding message container.
3. The method according to claim 1, characterized in that The queue information corresponds to a priority of the destination port of the message to be forwarded, and each priority of the destination port corresponds to a scheduling queue.
4. The method according to claim 1, characterized in that: If the message to be forwarded is the first message in the corresponding message container, the message header of the message to be forwarded further includes a start identifier.
5. The method according to claim 1, characterized in that If the message to be forwarded is the last message in the corresponding message container, the message header of the message to be forwarded further includes an end marker.
6. A message sorting method, applied to a second network device, characterized in that: The method comprises: receiving a message sent by a first network device; the message including an information header added by the first network device; Parsing the information header of the message to obtain the identifier of the message container allocated by the first network device to the message, queue information, and the identifier of the first network device; the messages in the same message container have the same forwarding path; In the scheduling queue corresponding to the queue information, the messages are sorted based on the identifier of the message container and the identifier of the first network device.
7. The method according to claim 6, characterized in that The queue information corresponds to a priority of a destination port of the message, and each priority of the destination port corresponds to a scheduling queue.
8. The method according to claim 6, characterized in that The sum of the byte lengths of all messages in the same message container is less than or equal to the set length of the corresponding message container.
9. The method according to claim 1, characterized in that: The sorting of the messages based on the identifier of the message container and the identifier of the first network device includes: Based on the identifier of the first network device, determining whether the identifier of the message container is a container identifier currently expected by the second network device; If the message container identifier of the message is the container identifier currently expected by the second network device, the message is forwarded; otherwise, the message is cached.
10. The method according to claim 9, characterized in that If the message is the last message in the corresponding message container, the message header of the message further includes an end marker; and the method further includes: If the identifier of the message container is the container identifier currently expected by the second network device, and the message header of the message further includes the end identifier, the container identifier currently expected by the second network device is adjusted based on preset priority information of the expected container identifier.
11. The method according to claim 10, characterized in that The method further comprises: If the message including the end identifier is not received within the set time period, the container identifier currently expected by the second network device is adjusted.
12. A message forwarding device, characterized in that: include: A determination module, configured to determine, upon receiving a message to be forwarded, queue information of a scheduling queue of the message to be forwarded based on routing information of the message to be forwarded; An allocation module, configured to allocate a message container to the message to be forwarded in the scheduling queue; the messages to be forwarded in the same message container have the same forwarding path; An adding module, configured to add an information header to the message to be forwarded, wherein the information header includes an identifier of the message container, the queue information, and an identifier of the first network device; The forwarding module is used to forward the message to be forwarded to the destination network device.
13. A message sorting device, characterized in that: include: A receiving module, configured to receive a message sent by a first network device; the message includes an information header added by the first network device; A parsing module, used to parse the information header of the message, obtain the identifier of the message container allocated by the first network device to the message, the queue information and the identifier of the first network device; the messages in the same message container have the same forwarding path; A sorting module is used to sort the messages in the scheduling queue corresponding to the queue information based on the identifier of the message container and the identifier of the first network device.
14. A network device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the message forwarding method as described in claims 1 to 5 or the message sorting method as described in claims 6-11.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the processor executes the message forwarding method as described in claims 1 to 5 or the message sorting method as described in claims 6-11.
Citation Information
Cited By
Data transmission method based on remote direct memory access, computer equipment and medium
CN120670364A
Data transmission method based on remote direct memory access, computer device and medium
CN120670364B
Network flow control method and device and electronic equipment
CN121357097A
