A data packet order preserving output method, device, equipment and medium
By using information tag generation at the source node, timestamp arbitration at intermediate nodes, and round-robin arbitration at the target node, the problem of low utilization of idle paths and nodes in traditional data order preservation schemes is solved, achieving first-in-first-out data packets and improving transmission efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
- Filing Date
- 2026-04-10
- Publication Date
- 2026-06-19
AI Technical Summary
In traditional data order preservation schemes, the utilization rate of idle paths and idle secondary nodes in the network topology decreases, leading to head-of-line congestion, which affects system transmission efficiency and wastes network resources.
By generating information tags at the source node, arbitrating timestamps at intermediate nodes, and arbitrating polling at the target node, data packets are processed in a first-in-first-out manner, improving the utilization of idle paths and nodes, and alleviating congestion at the head of the queue.
It improves the utilization of idle paths and nodes, alleviates the head-of-line congestion problem, shortens the transmission delay of data packets in the network topology, and realizes the first-in-first-out (FIFO) of data packets.
Smart Images

Figure CN122247942A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data transmission technology, and in particular to a method, apparatus, device, and medium for preserving the order of data packets. Background Technology
[0002] With the development of computer networks, it has been discovered that computer network topologies exhibit a power-law distribution of node degrees. This power-law distribution has spurred a significant shift in network topology models. More and more models are being built based on the power-law principles of preferential connections and optimized growth, allowing models that closely match the properties of computer topologies to automatically generate, grow, and connect according to simple evolutionary rules. New nodes are continuously added through these preferential connections and growth patterns. These characteristics of network topologies have made network development increasingly complex and its performance increasingly reliable, thus prompting the emergence of many network topology connection rules—the construction of network topology formation mechanisms. The topology of a computer network refers to the abstract connection method exhibited by various network devices (such as routers and switches), including computers, to interconnect the network. Computer network topology focuses on this connection relationship and its graphical representation, rather than the details of the connected computers or devices. A topology diagram clearly shows the wiring connections of each node in the entire network and the overall network structure. Nodes mainly refer to the various active devices connected in the network; therefore, the computer network topology is composed of nodes and links.
[0003] like Figure 1 The diagram shows a 32-port two-level bidirectional CLOS topology. Each connection in the diagram is bidirectional. This topology contains 8 primary nodes, each connected to 4 input / output ports; and 4 secondary nodes, each connected to one of the 8 primary nodes. The 32 input ports can be used as data initiators to send data to other output ports.
[0004] Traditional data ordering schemes lock the path from the current input port to all output ports. When an input port continuously initiates data transmission to a certain output port, the transmission path is locked. Subsequent data transmissions to that output port will follow the locked path until the current continuous data transmission task ends (output through the target port). At this point, the lock is cleared, and subsequent data packets destined for the same target node can re-match the path and select a new path for transmission. Traditional schemes achieve data ordering by restricting consecutive data packets destined for the same target port to be routed along the same path. However, traditional schemes have a problem: when data packets destined for the same target node choose the same path, if the data packet at the head of the queue is blocked and cannot be output from the target port, it may cause data packets from the input port to other target ports to be blocked, i.e., head-of-queue blocking, which affects the transmission efficiency of the system. At the same time, the single path selection will reduce the utilization rate of idle paths and idle secondary nodes in the network topology, thus wasting network resources and exacerbating the congestion within the locked secondary nodes.
[0005] It is evident that how to address the reduced utilization of idle paths and idle secondary nodes in the network topology and alleviate the head-of-line congestion problem in traditional order-preserving schemes is a question that those skilled in the art need to consider. Summary of the Invention
[0006] The purpose of this invention is to provide a data packet order-preserving output method, apparatus, device, and medium that can solve the problem of reduced utilization of idle paths and idle secondary nodes in the network topology and alleviate head-of-line congestion in traditional order-preserving schemes. The specific solution is as follows: Firstly, this application discloses a data packet order-preserving output method, including: The source node receives data packets from the input port and determines the target stack label corresponding to the target port based on the target port number corresponding to each data packet. The source node generates information tags based on a pre-created target stack statistics table, the timestamp of the data packet entering the input port, and the stack number of the source node. The information tags are added to the data packet to obtain the packaged data packet. The target stack statistics table is used to count the batches of data packets transmitted to different target stacks and the number of data packets in the same batch transmitted to the target stack. The source node sends the packaged data packet to the intermediate node, so that the intermediate node can determine the target data packet with the smallest timestamp based on the information tags in the packaged data packet and the preset global list, and send the target data packet to the target node; the preset global list is a table that records the data packet batches corresponding to the source node's stack and the target stack. The target node receives each target data packet and sends the target data packet to the corresponding output port through polling arbitration based on the information tag of the target data packet.
[0007] Optionally, the target stack label corresponding to the target port can be determined based on the target port number corresponding to each data packet, including: The target stack label corresponding to the target port is determined based on the high target bits of the target port number corresponding to each data packet.
[0008] Optionally, information tags are generated by the source node based on a pre-created target stack statistics table, the timestamp of the data packet entering the input port, and the stack label of the source node, including: The source node generates information tags based on the data packet batches transmitted to different target stacks, the number of data packets in the same batch transmitted to the target stack, the timestamp of the data packet entering the input port, and the stack label of the source node, as recorded in the target stack statistics table.
[0009] Optionally, the intermediate node determines the target data packet with the smallest timestamp based on the information tags in the packaged data packet and a preset global list, and sends the target data packet to the target node, including: Intermediate nodes determine the batch of data packets to be transmitted to the target stack from the information tags of the packaged data packets; If the data packet batch is the same as the value in the preset global list, the packaged data packet is determined to be valid, and the valid packaged data packet is stored in the preset arbitration pool; If the value in the data packet batch is different from the value in the preset global list, the packaged data packet is determined to be invalid, and the packaged data packet is controlled to wait until the value in the preset global list is updated to the same value as the data packet batch, and the operation of determining the validity of the packaged data packet is triggered. The target data packet with the smallest timestamp is determined from the preset arbitration pool and sent to the target node.
[0010] Optionally, based on the information tag of the target data packet, the target data packet is sent to the corresponding output port through polling arbitration, including: Update the value of the corresponding target row in the preset source node stack reception statistics table according to the stack label of the source node in the target data packet; the target row records the number of packets received in the same batch. Based on the relationship between the numerical value and the number of data packets in the same batch transmitted to the target stack in the target data packet, it is determined whether to send the target data packet to the corresponding output port through polling arbitration.
[0011] Optionally, based on the relationship between the numerical value and the number of data packets in the same batch transmitted to the target stack in the target data packet, determine whether to send the target data packet to the corresponding output port through polling arbitration, including: If the value is equal to the number of data packets in the same batch transmitted to the target stack in the target data packet, then the target data packet is sent to the corresponding output port through polling arbitration; If the value is not equal to the number of packets in the same batch transmitted to the target stack in the target data packet, then wait for the next data packet from the source node until the value equals the number of packets in the same batch transmitted to the target stack in the target data packet.
[0012] Optionally, after sending the target data packet to the corresponding output port through polling arbitration based on the target data packet's information tag, the process further includes: Increment the batch counter corresponding to the source node by 1 to obtain the new batch number, and update the preset global list based on the new batch number.
[0013] Secondly, this application discloses a data packet order-preserving output device, comprising: The target stack label determination module is used to receive data packets from the input port through the source node and determine the target stack label corresponding to the target port based on the target port number corresponding to each data packet. The data packet packaging module is used to generate information tags by the source node based on a pre-created target stack statistics table, the timestamp of the data packet entering the input port, and the stack number of the source node. The information tags are added to the data packet to obtain the packaged data packet. The target stack statistics table is used to count the batches of data packets transmitted to different target stacks and the number of data packets in the same batch transmitted to the target stack. The first data packet sending module is used to send the packaged data packet to the intermediate node through the source node, so that the intermediate node can determine the target data packet with the smallest timestamp based on the information tags in the packaged data packet and the preset global list, and send the target data packet to the target node; the preset global list is a table that records the data packet batches corresponding to the source node's stack and the target stack; The second data packet sending module is used to receive each target data packet through the target node, and send the target data packet to the corresponding output port through polling arbitration based on the information tag of the target data packet.
[0014] Thirdly, this application discloses an electronic device, including: Memory, used to store computer programs; A processor is used to execute computer programs to implement the steps of the aforementioned data packet order-preserving output method.
[0015] Fourthly, this application discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the aforementioned data packet order-preserving output method.
[0016] This invention first receives data packets from the input port through the source node, and determines the target stack number corresponding to the target port based on the target port number corresponding to each data packet. The source node generates information tags based on a pre-created target stack statistics table, the timestamp of the data packet entering the input port, and the stack number of the source node, and adds the information tags to the data packets to obtain packaged data packets. The target stack statistics table is used to count the batches of data packets transmitted to different target stacks and the number of data packets in the same batch transmitted to the target stack. The source node sends the packaged data packets to intermediate nodes, so that the intermediate nodes determine the target data packet with the smallest timestamp based on the information tags in the packaged data packets and a preset global list, and send the target data packet to the target node. The preset global list is a table that records the batches of data packets corresponding to the stacks of the source node and the target stack. The target node receives each target data packet and sends the target data packet to the corresponding output port through polling arbitration based on the information tags of the target data packets.
[0017] Beneficial effects: While ensuring data output order, this invention improves the utilization rate of idle paths and idle nodes, enhances system transmission efficiency, and alleviates the head-of-line blocking problem of target node output to a certain extent. Finally, the arbitration method of timestamps used by intermediate nodes can also shorten the transmission delay of data packets in the topology network, realize the first-in-first-out of data packets, and reduce the transmission delay of data packets in the network topology. Attached Figure Description
[0018] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A schematic diagram of a two-level bidirectional CLOS topology provided in an embodiment of the present invention; Figure 2 A flowchart of a data packet order-preserving output method provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of data packet transmission at a source level 1 node, provided in an embodiment of the present invention. Figure 4 This is a schematic diagram illustrating the conversion between target port number and stack number provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of updating the source level 1 node statistics list according to an embodiment of the present invention; Figure 6 This is a schematic diagram illustrating an example of updating a source level 1 node statistics list according to an embodiment of the present invention; Figure 7A schematic diagram of accompanying data information provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of source level 1 node data integration provided in an embodiment of the present invention; Figure 9 This is a schematic diagram of a second-level node order preservation process provided in an embodiment of the present invention; Figure 10 This is an example schematic diagram provided for an embodiment of the present invention; Figure 11 This is another example schematic diagram provided for an embodiment of the present invention; Figure 12 This is another example schematic diagram provided for an embodiment of the present invention; Figure 13 This is another example schematic diagram provided for an embodiment of the present invention; Figure 14 This is another example schematic diagram provided for an embodiment of the present invention; Figure 15 This is another example schematic diagram provided for an embodiment of the present invention; Figure 16 This is another example schematic diagram provided for an embodiment of the present invention; Figure 17 This is another example schematic diagram provided for an embodiment of the present invention; Figure 18 This is a schematic diagram of a data packet order-preserving output device provided in an embodiment of the present invention; Figure 19 This is a structural diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0021] The terms "comprising" and "having," and any variations thereof, in the specification and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may include steps or units not listed.
[0022] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0023] Traditional data ordering schemes lock the path from the current input port to all output ports. When an input port continuously initiates data transmission to a certain output port, the transmission path is locked. Subsequent data transmissions to that output port will follow the locked path until the current continuous data transmission task ends (output through the target port). At this point, the lock is cleared, and subsequent data packets destined for the same target node can re-match the path and select a new path for transmission. Traditional schemes achieve data ordering by restricting consecutive data packets destined for the same target port to be routed along the same path. However, traditional schemes have a problem: when data packets destined for the same target node choose the same path, if the data packet at the head of the queue is blocked and cannot be output from the target port, it may cause data packets from the input port to other target ports to be blocked, i.e., head-of-queue blocking, which affects the transmission efficiency of the system. At the same time, the single path selection will reduce the utilization rate of idle paths and idle secondary nodes in the network topology, thus wasting network resources and exacerbating the congestion within the locked secondary nodes. To address the aforementioned technical problems, this invention discloses a data packet order-preserving output method, apparatus, device, and medium, which can solve the problem of reduced utilization of idle paths and idle secondary nodes in the network topology in traditional order-preserving schemes, and alleviate the problem of head-of-line congestion.
[0024] See Figure 2 As shown, this embodiment of the invention provides a data packet order-preserving output method, including: Step S11: Receive data packets from the input port through the source node, and determine the target stack label corresponding to the target port based on the target port number corresponding to each data packet.
[0025] In this embodiment of the invention, the source node first receives data packets from the input port, and then determines the target stack label corresponding to the target port based on the high-order bits of the target port number corresponding to each data packet. In a specific embodiment, using... Figure 1 Taking the two-level bidirectional CLOS topology shown as an example, the order-preserving processing of the source first-level node, second-level node, and target first-level node is explained respectively. Figure 3 The diagram shows the data packet transmission for the four input ports of source level 1 node 0. The data packet transmission format is data followed by the destination port number (the destination port number is 5 bits and is used to locate the output port in the topology). The structure of other level 1 nodes is the same as that of level 1 node 0. The stack number corresponding to the destination port can be obtained from the high 3 bits of the destination port number (e.g., ...). Figure 4(As shown). Here, "stack" refers to all ports that share a common set of PHY (Physical, physical layer) ports, forming a stack. A routing node is a node in the network whose function is to distribute data packets from various networks to the correct network path, so that data can be accurately transmitted from one network node to another.
[0026] Step S12: The source node generates an information tag based on the pre-created target stack statistics table, the timestamp of the data packet entering the input port, and the stack number of the source node. The information tag is added to the data packet to obtain the packaged data packet. The target stack statistics table is used to count the batches of data packets transmitted to different target stacks and the number of data packets in the same batch transmitted to the target stack.
[0027] In this embodiment of the invention, the source node generates information tags based on the target stack statistics table, including the batches of data packets transmitted to different target stacks, the number of data packets in the same batch transmitted to the target stack, the timestamp of the data packets entering the input port, and the stack number of the source node. In a specific embodiment, as shown in Table 1 below, each source level 1 node sets up an independent target stack data packet statistics list to count the batches of data packets going to different target stacks and the number of data packets in the same batch going to the target stack. Both of these statistics are initially set to 0, and the statistical condition is that the corresponding port data stream request and subsequent handshake are successful, i.e., no backpressure is applied.
[0028] Table 1 Target stack packet statistics list
[0029] The source level 1 node counts the port input data that was not back-pressurized in the same clock cycle based on the destination stack labels of the data packets from the four input ports, and updates the data according to the destination stack labels of the input ports. Figure 5 The first column, the packet batch counter, counts the number of packets from the four input ports to each target stack. The second column, the packet count counter, is then updated. For example: like Figure 6 As shown, it is assumed that the input ports 0, 1, 2, and 3 of the level 1 node are not subjected to back pressure, that is, all input port data packets are continuously transmitted to the next level.
[0030] Clock cycle 1: The target stacks corresponding to the 4 input ports are stack1, 2, 2, 2. Update the batch counter of data packets in stack1 to 0 (batch 0), and the count counter of data packets in the same batch in target stack1 to 1 (1 1); update the batch counter of data packets in stack2 to 0 (batch 0), and the count counter of data packets in the same batch in target stack2 to 3 (3 2).
[0031] Clock cycle 2: The target stacks corresponding to the 4 input ports are stack2, 4, 5, and 2. Update the batch counter of the data packets in target stack2 to 1 (batch 1), and the count counter of the number of data packets in the same batch in target stack2 to 2 (two 2s); update the batch counter of the data packets in target stack4 to 0 (batch 0), and the count counter of the number of data packets in the same batch in target stack4 to 1 (one 4); update the batch counter of the data packets in target stack5 to 0 (batch 0), and the count counter of the number of data packets in the same batch in target stack5 to 1 (one 5).
[0032] Clock cycle 3: The target stacks corresponding to the 4 input ports are stack2, 1, 3, and 3. Update the batch counter of the data packets in target stack2 to 2 (batch 2), and the count counter of the number of data packets in the same batch in target stack2 to 1 (1 count of 2); update the batch counter of the data packets in target stack1 to 1 (batch 1), and the count counter of the number of data packets in the same batch in target stack1 to 1 (1 count of 1); update the batch counter of the data packets in target stack3 to 0 (batch 0), and the count counter of the number of data packets in the same batch in target stack3 to 2 (2 counts of 3).
[0033] like Figure 7 As shown, based on the updated target stack packet statistics list, the target stack batch count and the target stack same batch packet count are added to the packet as accompanying information. At the same time, a global timestamp counter is set, and the global timestamp is latched at the input port (indicating the time when the current packet enters the input port), and added to the packet as accompanying information for time arbitration by the secondary node. Finally, the current source node stack number is added to the packet as accompanying information.
[0034] Finally, the data packet format for the four input ports corresponding to Level 1 node 0 is as follows: Figure 8 As shown, the routing method for data packets from the source level 1 node to the level 2 node is as follows: data packets are routed to the level 2 node via randomly selected idle paths. This routing method can alleviate the head-of-line congestion problem of data packets at each input port, improve the utilization rate of idle paths, improve system transmission efficiency, and at the same time alleviate congestion within the level 2 node.
[0035] Step S13: The source node sends the packaged data packet to the intermediate node, so that the intermediate node can determine the target data packet with the smallest timestamp based on the information tags in the packaged data packet and the preset global list, and send the target data packet to the target node; the preset global list is a table that records the data packet batches corresponding to the source node's stack and the target stack.
[0036] In this embodiment of the invention, the source node sends the packaged data packet to the intermediate node. The intermediate node then determines the batch of data packets to be transmitted to the target stack from the information tag of the packaged data packet. If the batch of data packets is the same as the value in the preset global list, the packaged data packet is determined to be valid, and the valid packaged data packet is stored in the preset arbitration pool. If the batch of data packets is not the same as the value in the preset global list, the packaged data packet is determined to be invalid, and the packaged data packet is controlled to wait until the value in the preset global list is updated to the same value as the batch of data packets, and the operation of determining the validity of the packaged data packet is triggered. The target data packet with the smallest timestamp is determined from the preset arbitration pool and sent to the target node.
[0037] In one specific embodiment, a global list of source stack and target stack data packet batches is set, as shown in Table 2 below. This global list is updated independently by each target level 1 node and provided to all level 2 nodes for querying. The update and query mechanism of this global list is crucial for data order preservation scheduling.
[0038] Table 2 Global List of Source Stack and Target Stack Packet Batches
[0039] like Figure 9 As shown, each Level 2 node first checks the corresponding entry in the global list of data packet batches based on the source stack number and destination stack number (obtainable from the destination port number) in its accompanying information. If the value of the query entry equals the destination stack batch count in the accompanying information, the data packet transmission request is considered valid; otherwise, it is considered invalid. When invalid, the data packet will be scheduled and wait within the Level 2 node until the corresponding Level 1 node updates the corresponding entry in the global list of data packet batches, satisfying the condition that the destination stack batch count in the accompanying information equals the corresponding entry value. Only then can the current data transmission be considered valid and participate in arbitration. Finally, valid data transmission requests are timestamped based on the timestamp information in their accompanying information. Valid data transmission requests with the smallest timestamp are transmitted first to achieve "first-in, first-out" data packet transmission, shortening the transmission delay of data packets in the network topology.
[0040] Step S14: Receive each target data packet through the target node, and send the target data packet to the corresponding output port through polling arbitration based on the information tag of the target data packet.
[0041] In this embodiment of the invention, the target node receives each target data packet and updates the value of the corresponding target row in the preset source node stack reception statistics table according to the stack label of the source node in the target data packet; the target row records the number of packets received in the same batch; based on the relationship between the value and the number of data packets in the same batch transmitted to the target stack in the target data packet, it determines whether to send the target data packet to the corresponding output port through round-robin arbitration. Specifically, when the intermediate node (secondary node) sends the valid data packet with the smallest timestamp to the target node (target primary node), the target node will execute a precise operation process of "receiving-statistics-batch aggregation-feedback". The input port of the target node receives data packets from the secondary node and temporarily stores them in the internal buffer. Parsing information: immediately parse the accompanying information of the data packet and extract three key fields: source stack label (e.g., Stack0, Stack4, Stack7); target stack batch (e.g., batch 0, batch 1); number of data packets in the same batch (e.g., 2, 1). The target node has multiple input ports (which may come from different secondary nodes). It uses a round-robin (a scheduling algorithm that takes turns serving) approach to fairly select a port's data packet and allow it to be sent to the final output port. This prevents a port from occupying output resources for an extended period.
[0042] In addition, during the process of determining whether to send the target data packet to the corresponding output port through polling arbitration, if the value is equal to the number of data packets in the same batch transmitted to the target stack in the target data packet, then the target data packet is sent to the corresponding output port through polling arbitration; if the value is not equal to the number of data packets in the same batch transmitted to the target stack in the target data packet, then wait for the next data packet from the source node until the value is equal to the number of data packets in the same batch transmitted to the target stack in the target data packet.
[0043] In one specific embodiment, each target level 1 node has an independent source stack packet statistics list, as shown in Table 3. The list counts the batches of packets from different source stacks and the number of packets received from the same batch of source stacks. The initial state of both statistics is 0. The statistical condition is that the corresponding port packet obtains arbitration rights (round-robin arbitration) within the target level 1 node and is transmitted to the next level.
[0044] Table 3 Source stack packet statistics list
[0045] When a data packet arrives at the input port of the target level 1 node, and a certain input obtains arbitration rights and transmits it to the next level, the counter for the number of data packets in the same batch corresponding to the source stack in Table 3 is incremented by 1 according to the source stack number in the data packet's accompanying information. If the result of the counter increment is less than the count value of the number of data packets in the same batch in the data packet's accompanying information, then it continues to wait for data packets in the same batch from the same source stack and continues to increment the counter for the number of data packets in the same batch until it is equal to the count value of the number of data packets in the same batch in the data packet's accompanying information.
[0046] In this embodiment of the invention, the batch counter corresponding to the source node is incremented by 1 to obtain a new batch number, and the preset global list is updated based on the new batch number. Specifically, when the count value of the number of data packets in the same batch in the accompanying information of the data packets is equal, the batch counter of the data packets in the corresponding source stack in Table 3 is incremented by 1. At the same time, the value of the data packet batch counter is updated to the corresponding entry position in the global list of data packet batches shown in Table 2 by using the data packet source stack number and the current target level 1 node number, for subsequent data packets to be queried in order.
[0047] Furthermore, in lossless networks like Clos networks (assuming no packet loss and avoiding packet loss through backpressure), order preservation and congestion control can be decoupled: Backpressure mechanism: Handles short-term congestion (suspends upstream transmission when the port is full); Batch-Global List: Handles long-term sequential issues; Timestamp arbitration: addressing fairness in delays.
[0048] In this way, the complex problem is broken down into three orthogonal subproblems, each of which is solved using a simple local mechanism, but when combined, they achieve the global goal.
[0049] Beneficial effects: While ensuring data output order, this invention improves the utilization rate of idle paths and idle nodes, enhances system transmission efficiency, and alleviates the head-of-line blocking problem of target node output to a certain extent. Finally, the arbitration method of timestamps used by intermediate nodes can also shorten the transmission delay of data packets in the topology network, realize the first-in-first-out of data packets, and reduce the transmission delay of data packets in the network topology.
[0050] As can be seen from the previous embodiment, the present invention discloses a data packet order-preserving output method. The following is a specific example to illustrate the execution flow of each routing node in the order-preserving scheme proposed by the present invention.
[0051] like Figure 10As shown, input port 0 sends two data packets in sequence, corresponding to target port number 8; input port 1 sends two data packets in sequence, corresponding to target port number 8; input port 16 sends one data packet, corresponding to target port number 8; and input port 28 sends one data packet, corresponding to target port number 8.
[0052] like Figure 11 The diagram shows the update process of the statistical list of data packets corresponding to the target stack in the source stack0. Assuming that none of the four input ports corresponding to the source stack0 are back-pressured at this time, according to the high 3 bits 010 of the target port 8, the target stack corresponding to the data packets of input ports 0 and 1 is stack2. At timestamp 10, the batch of data packets corresponding to the target stack2 is 0 (first batch) and there are 2 data packets. At this time, the target stack2 row in the update list is updated, the data packet batch counter is 0 and the count of data packets in the same batch is 2. At timestamp 20, the batch of data packets corresponding to the target stack2 is 1 (second batch) and there are 2 data packets. At this time, the target stack2 row in the update list is updated, the data packet batch counter is 1 and the count of data packets in the same batch is 2.
[0053] like Figure 12 As shown in the dashed box, according to Figure 11 The updated target stack packet statistics list entries are used to form accompanying information, which is then added to the input data on input ports 0 and 1 for transmission to subsequent stages; for example... Figure 13 and 14 As shown, following the same process as source node 0, update the accompanying information of input port 16 of source node 4 and input port 28 of source node 7 (assuming the data packet input timestamp of input port 16 is 15 and the data packet input timestamp of input port 28 is 17), and transmit it to the subsequent level.
[0054] The routing method from source node 1 to level 2 node is as follows: Data packets are routed to level 2 nodes by randomly selecting an idle path; for example... Figure 15 As shown, in this example, assuming that source port 0 packet 1 selects an idle path: level 1 node 0~level 2 node 0, source port 0 packet 2 selects an idle path: level 1 node 0~level 2 node 2, source port 1 packet 1 selects an idle path: level 1 node 0~level 2 node 1, source port 1 packet 2 selects an idle path: level 1 node 0~level 2 node 3, source port 16 packet 1 selects an idle path: level 1 node 4~level 2 node 0, and source port 28 packet 1 selects an idle path: level 1 node 7~level 2 node 3. In the global list of source and destination stack packet batches, each entry has an initial value of 0 (0 represents batch 1).
[0055] When packet 1 from port 0 and packet 1 from port 16 arrive at secondary node 0, packet 1 from port 0, based on its accompanying information (source stack number 0, destination stack number 2, which can be obtained from the high 3 bits of the destination port number 8), checks the corresponding entry in the global packet batch list and finds it to be 0, which is equal to the destination stack 2 batch value of 0 in the accompanying information. Therefore, packet 1 from port 0 is valid for transmission. Similarly, packet 1 from port 16, based on its accompanying information (source stack number 4, destination stack number 2), checks the corresponding entry in the global packet batch list and finds it to be 0, which is equal to the accompanying information. If the target stack2 batch value in the information is 0, then the transmission request for port 16 data packet 1 is valid. Next, based on the timestamps 10 and 15 in the accompanying information of port 0 data packet 1 and port 16 data packet 1, the two data packets are arbitrated using timestamps. Since the timestamp of port 0 data packet 1 is less than that of port 16 data packet 1, port 0 data packet 1 wins the arbitration right and is transmitted to the target level 1 node 2 through level 2 node 0. Port 16 data packet 1 is temporarily under pressure. Only after all data packets of port 0 data packet 1 have been sent to the target level 1 node 2 can the arbitration right switch to port 16 data packet 1.
[0056] When data packets 2 from port 1 and 1 from port 28 arrive at level 2 node 3, data packet 2 from port 1, based on its accompanying information (source stack number 0, target stack number 2, which can be obtained from the high 3 bits of target port number 8), checks the corresponding entry in the global list of data packet batches. If the entry is 0, it is not equal to the target stack 2 batch value 1 in the accompanying information. Therefore, the transmission request of data packet 2 from port 1 is invalid, and the data packet is back-pressed. Data packet 1 from port 28, based on its accompanying information (source stack number 7, target stack number 2), checks the corresponding entry in the global list of data packet batches. If the entry is 0, it is equal to the target stack 2 batch value 0 in the accompanying information. Therefore, the transmission request of data packet 1 from port 28 is valid. At this point, only data packet 1 from port 28 is a valid transmission request, obtains the arbitration right, and is transmitted to the target level 1 node 2 through level 2 node 3.
[0057] like Figure 16As shown, when packet 2 from port 0 arrives at secondary node 2, packet 2 checks the corresponding entry in the global packet batch list based on its accompanying information (source stack number 0, target stack number 2, which can be obtained from the high 3 bits of target port number 8). The entry is 0, which is not equal to the target stack 2 batch value of 1 in the accompanying information. Therefore, packet 2's transmission request is invalid, and the packet is backpressured. If packet 1 from port 1 arrives at secondary node 1, packet 1 checks the corresponding entry in the global packet batch list based on its accompanying information (source stack number 0, target stack number 2, which can be obtained from the high 3 bits of target port number 8). The entry is 0, which is equal to the target stack 2 batch value of 0 in the accompanying information. Therefore, packet 1's transmission request is valid. Only packet 1 from port 1 is a valid transmission request, obtains arbitration rights, and is transmitted to the target primary node 2 through secondary node 1.
[0058] Then, data packets 1 from port 0, 1 from port 1, and 1 from port 28 arrive at target level 2. Within target level 2, data packet transmission is selected through a round-robin arbitration process. First, data packet 1 from port 0 obtains arbitration and transmits to target port 8. At this point, based on the source stack number 0 in the accompanying information of data packet 1 from port 0, the counter 0 for the number of data packets in the same batch of stack 0 in the source stack data packet statistics list in target stack 2 is incremented by 1. The result is 1, which is less than the number of data packets in batch 0 in the accompanying information (2). Therefore, the source stack data packet statistics list is not updated. The packet batch counter is then used. Subsequently, packet 1 on port 1 obtains the arbitration right and transmits to the target port 8. At this time, according to the source stack number 0 in the accompanying information of packet 1 on port 1, the number counter 1 of the number of packets in the same batch of stack 0 in the source stack packet statistics list in the target stack 2 is incremented by 1, and the result is 2, which is equal to the number of packets in batch 0 in the accompanying information. At this time, the packet batch counter in the source stack packet statistics list is updated by incrementing it by 1, and the result is 1. The corresponding entries in the global packet batch list from source stack 0 to target stack 2 are also updated to 1. Finally, packet 1 on port 28 obtains the arbitration right and transmits it to the target port 8. At this time, according to the source stack number 7 in the accompanying information of packet 1 on port 28, the counter 0 of the number of packets in the same batch of stack 7 in the source stack packet statistics list in the target stack 2 is incremented by 1, and the result is 1, which is equal to the number of packets in batch 0 in the accompanying information. At this time, the packet batch counter in the source stack packet statistics list is updated by incrementing it by 1, and the result is 1. The corresponding entries in the global packet batch list from source stack 7 to target stack 2 are updated to 1.
[0059] After packet 1 from port 0 is sent from secondary node 0 to target primary node 2, packet 1 from port 16 acquires the arbitration right and sends it to target primary node 2. After the global packet batch list is updated, packet 2 from port 1, based on its accompanying information (source stack number 0, target stack number 2, obtained from the high 3 bits of target port number 8), checks the corresponding entry in the global packet batch list. If the entry is 1, equal to the target stack 2 batch value 1 in the accompanying information, then packet 2's transmission request is valid. At this point, only packet 2 from port 1 has a valid transmission request, acquires the arbitration right, and is transmitted to target primary node 2 through secondary node 3. After the global packet batch list is updated, packet 2 from port 0, based on its accompanying information (source stack number 0, target stack number 2, obtained from the high 3 bits of target port number 8), checks the corresponding entry in the global packet batch list. If the entry is 1, equal to the target stack 2 batch value 1 in the accompanying information, then packet 2's transmission request is valid. At this point, only packet 2 from port 0 has a valid transmission request, acquires the arbitration right, and is transmitted to target primary node 2 through secondary node 2.
[0060] Packet 1 from port 16, packet 2 from port 0, and packet 2 from port 1 arrive at target level 1 node 2. Within the target level 1 node, packet transmission is selected through a round-robin arbitration process. First, packet 1 from port 16 obtains arbitration and transmits to target port 8. At this time, based on the source stack number 4 in the accompanying information of packet 1 from port 16, the counter 0 for the number of packets in the same batch of stack 4 in the source stack packet statistics list of target stack 2 is incremented by 1, and the result is 1, which is equal to the number of packets in batch 0 in the accompanying information. Then, the packet batch counter in the source stack packet statistics list is updated by incrementing it by 1, and the corresponding entries in the global packet batch list from source stack 4 to target stack 2 are updated to 1. Subsequently, packet 2 on port 0 obtains arbitration and transmits it to the target port 8. At this time, based on the source stack number 0 in the accompanying information of packet 2 on port 0, the counter 1 for the number of packets in the same batch of stack 0 in the source stack packet statistics list in the target stack 2 is incremented by 1, and the result is 1, which is less than the number of packets in batch 1 (2) in the accompanying information. At this time, the packet batch counter in the source stack packet statistics list is not updated. Finally, packet 2 on port 1 obtains arbitration and transmits it to the target port 8. At this time, based on the source stack number 0 in the accompanying information of packet 2 on port 1, the counter 1 for the number of packets in the same batch of stack 0 in the source stack packet statistics list in the target stack 2 is incremented by 1, and the result is 2, which is equal to the number of packets in batch 1 (2) in the accompanying information. At this time, the packet batch counter in the source stack packet statistics list is updated by incrementing it by 1, and the result is 2. The corresponding entries in the global packet batch list from source stack 0 to target stack 2 are also updated to 2.
[0061] like Figure 17 As shown, the final order in which data packets are sent from output port 8 is: port 0 data packet 1, port 1 data packet 1, port 28 data packet 1, port 16 data packet 1, port 0 data packet 2, and port 1 data packet 2. It can be seen that the data packets sent from source port 0 are sent in the order of 1 followed by 2, and the data packets sent from source port 1 are also sent in the order of 1 followed by 2. This achieves the preservation of the output order of data from the same input port. At the same time, it also achieves the preservation of the input order of data from the same stack node, that is, data packets with smaller batch values from the source stack are output from the corresponding target port first.
[0062] In summary, the method of this invention sets up a target stack data packet statistics list within the source-level node. By counting the batches of data packets destined for different target stacks and the number of data packets in the same batch destined for a target stack, this information, along with timestamp information, forms accompanying information and is added to the data packets for transmission to subsequent levels. The source-level node can randomly select an idle path to route to the secondary nodes. A global list of data packet batches is set up, and a mechanism for updating by the target-level node is proposed to assist the secondary nodes in effectively adjudicating data transmission requests. Simultaneously, the secondary nodes employ a timestamp-based arbitration method to achieve first-in-first-out (FIFO) data packet delivery, reducing transmission latency in the network topology. Furthermore, the target-level node sets up a source stack data packet statistics list within the source-level node. The ck packet statistics list updates the global list of packet batches by counting the number of packet batches from different source stacks and the number of packets from the same source stack in the same batch, and matches them with the data in the packet's accompanying information. This ensures ordered output of data from the same source stack. While ensuring ordered data output, this scheme also enables random selection of idle paths from source level 1 nodes to level 2 nodes, improving the utilization of idle paths and idle level 2 nodes, increasing system transmission efficiency, and alleviating the head-of-line congestion problem of source level 1 nodes to some extent. Finally, the timestamp arbitration method of level 2 nodes can also shorten the transmission delay of packets in the topology network, achieving first-in-first-out (FIFO) packet delivery.
[0063] See Figure 18 As shown, an embodiment of the present invention provides a data packet order-preserving output device, comprising: The target stack label determination module 11 is used to receive data packets from the input port through the source node and determine the target stack label corresponding to the target port based on the target port number corresponding to each data packet. The data packet packaging module 12 is used to generate information tags by the source node based on a pre-created target stack statistics table, the timestamp of the data packet entering the input port, and the stack number of the source node, and add the information tags to the data packet to obtain the packaged data packet; the target stack statistics table is a table used to count the batches of data packets transmitted to different target stacks and the number of data packets in the same batch transmitted to the target stack; The first data packet sending module 13 is used to send the packaged data packet to the intermediate node through the source node, so that the intermediate node can determine the target data packet with the smallest timestamp based on the information tag in the packaged data packet and the preset global list, and send the target data packet to the target node; the preset global list is a table that records the data packet batches corresponding to the stack of the source node and the stack of the target node. The second data packet sending module 14 is used to receive each target data packet through the target node, and send the target data packet to the corresponding output port through polling arbitration based on the information tag of the target data packet.
[0064] Since the embodiments of the device part correspond to the embodiments described above, please refer to the embodiments described in the method part for the embodiments of the device part, and will not be repeated here.
[0065] Beneficial effects: While ensuring data output order, this invention improves the utilization rate of idle paths and idle nodes, enhances system transmission efficiency, and alleviates the head-of-line blocking problem of target node output to a certain extent. Finally, the arbitration method of timestamps used by intermediate nodes can also shorten the transmission delay of data packets in the topology network, realize the first-in-first-out of data packets, and reduce the transmission delay of data packets in the network topology.
[0066] Furthermore, embodiments of this application also disclose an electronic device, Figure 19 This is a structural diagram of an electronic device according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. Specifically, the electronic device may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the data packet order-preserving output method disclosed in any of the foregoing embodiments. Furthermore, the electronic device in this embodiment may specifically be an electronic computer.
[0067] In this embodiment, the power supply 23 is used to provide operating voltage for various hardware devices on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0068] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0069] The operating system 221 is used to manage and control the various hardware devices on the electronic device and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the data packet ordering output method disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.
[0070] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned data packet order-preserving output method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0071] Furthermore, this application also discloses a computer program product, including a computer program / instructions; wherein, when the computer program / instructions are executed by a processor, they implement the aforementioned data packet order-preserving output method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0072] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0073] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0074] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0075] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0076] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only intended to help understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for preserving the order of data packets during output, characterized in that, include: The source node receives data packets from the input port and determines the target stack label corresponding to the target port based on the target port number corresponding to each data packet. The source node generates an information tag based on a pre-created target stack statistics table, the timestamp of the data packet entering the input port, and the stack label of the source node. The information tag is then added to the data packet to obtain the packaged data packet. The target stack statistics table is used to count the batches of data packets transmitted to different target stacks and the number of data packets in the same batch transmitted to the target stack; The source node sends the packaged data packet to the intermediate node, so that the intermediate node can determine the target data packet with the smallest timestamp based on the information tags in the packaged data packet and a preset global list, and send the target data packet to the target node. The preset global list is a table that records the data packet batches corresponding to the source node's stack and the target stack; The target node receives each target data packet and sends the target data packet to the corresponding output port through polling arbitration based on the information tag of the target data packet.
2. The data packet order-preserving output method according to claim 1, characterized in that, The step of determining the target stack label corresponding to the target port based on the target port number corresponding to each data packet includes: The target stack label corresponding to the target port is determined based on the high target bits of the target port number corresponding to each data packet.
3. The data packet order-preserving output method according to claim 1, characterized in that, The process of generating information tags by the source node based on a pre-created target stack statistics table, the timestamp of the data packet entering the input port, and the stack label of the source node includes: The source node generates information tags based on the target stack statistics table, including the batch of data packets transmitted to different target stacks, the number of data packets in the same batch transmitted to the target stack, the timestamp of the data packets entering the input port, and the stack number of the source node.
4. The data packet order-preserving output method according to claim 1, characterized in that, The intermediate node determines the target data packet with the smallest timestamp based on the information tags in the packaged data packet and a preset global list, and sends the target data packet to the target node, including: The intermediate node determines the batch of data packets transmitted to the target stack from the information tag of the packaged data packet; If the data packet batch is the same as the value in the preset global list, the packaged data packet is determined to be valid, and the valid packaged data packet is stored in the preset arbitration pool; If the value of the data packet batch is different from the value in the preset global list, the packaged data packet is determined to be invalid, and the packaged data packet is controlled to wait until the value in the preset global list is updated to the same value as the data packet batch, and the operation of determining the validity of the packaged data packet is triggered. The target data packet with the smallest timestamp is determined from the preset arbitration pool, and the target data packet is sent to the target node.
5. The data packet order-preserving output method according to claim 1, characterized in that, The step of sending the target data packet to the corresponding output port through polling arbitration based on the information tag of the target data packet includes: Update the value of the corresponding target row in the preset source node stack reception statistics table according to the stack label of the source node in the target data packet; the target row records the number of packets received in the same batch; Based on the relationship between the value and the number of data packets in the same batch transmitted to the target stack in the target data packet, it is determined whether to send the target data packet to the corresponding output port through polling arbitration.
6. The data packet order-preserving output method according to claim 5, characterized in that, The step of determining whether to send the target data packet to the corresponding output port via polling arbitration based on the relationship between the value and the number of data packets in the same batch transmitted to the target stack in the target data packet includes: If the value is equal to the number of data packets in the same batch transmitted to the target stack in the target data packet, then the target data packet is sent to the corresponding output port through polling arbitration; If the value is not equal to the number of data packets in the same batch transmitted to the target stack in the target data packet, then wait for the next data packet from the source node until the value equals the number of data packets in the same batch transmitted to the target stack in the target data packet.
7. The data packet order-preserving output method according to any one of claims 1 to 6, characterized in that, After the information tag based on the target data packet is sent to the corresponding output port through polling arbitration, the method further includes: Increment the batch counter corresponding to the source node by 1 to obtain a new batch number, and update the preset global list based on the new batch number.
8. A data packet order-preserving output device, characterized in that, include: The target stack label determination module is used to receive data packets from the input port through the source node and determine the target stack label corresponding to the target port based on the target port number corresponding to each data packet. The data packet packaging module is used to generate information tags based on a pre-created target stack statistics table, the timestamp of the data packet entering the input port, and the stack label of the source node, and add the information tags to the data packet to obtain the packaged data packet; The target stack statistics table is used to count the batches of data packets transmitted to different target stacks and the number of data packets in the same batch transmitted to the target stack; The first data packet sending module is used to send the packaged data packet to the intermediate node through the source node, so that the intermediate node can determine the target data packet with the smallest timestamp based on the information tags in the packaged data packet and the preset global list, and send the target data packet to the target node; The preset global list is a table that records the data packet batches corresponding to the source node's stack and the target stack; The second data packet sending module is used to receive each of the target data packets through the target node, and send the target data packets to the corresponding output port through polling arbitration based on the information tags of the target data packets.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the data packet order-preserving output method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the data packet order-preserving output method as described in any one of claims 1 to 7.