Load sharing method, apparatus, network node, storage medium, and computer program product
By dividing data stream packets into multiple packet containers and using different identifiers for load balancing, the congestion and imbalance problems caused by traffic hashing to a fixed SL in SRv6-Policy are solved, achieving more efficient network bandwidth utilization and traffic distribution.
Patent Information
- Application Number
- CN202411045154.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2044-07-31
AI Technical Summary
In the data transmission between intelligent computing centers, the fixed 5-tuple information of the same elephant stream causes SRv6-Policy traffic to hash to a fixed SL, resulting in traffic congestion and uneven load distribution, especially on trunk interfaces, leading to bandwidth waste and packet loss.
By dividing a single data stream into multiple message containers and using different first identifiers for load balancing, it ensures that messages within the same message container are transmitted through the same member interface of the same SL and/or aggregation interface, while messages from different message containers are transmitted through different member interfaces of different SLs and/or aggregation interfaces, thus achieving balanced traffic load balancing.
It improved the overall utilization of network bandwidth, increased message transmission efficiency, reduced the probability of traffic congestion, and ensured the even distribution of traffic.
Smart Images

Figure CN118802763B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a load-sharing method, apparatus, network node, storage medium, and computer program product. Background Technology
[0002] In related technologies, data transmission between intelligent computing centers can exhibit "elephant flows," which are large-bandwidth flows with a fixed five-tuple of information. When this traffic is introduced into the Segment Routing IPv6 (SRv6-Policy) based on Internet Protocol Version 6 (IPv6), router nodes hash the traffic according to its five-tuple information, and the traffic is then distributed across an active set of segment lists (SLs) for load balancing.
[0003] However, since the same elephant flow has fixed 5-tuple information, all traffic of SRv6-Policy will be hashed to a fixed SL. When the outgoing interface of the SL is an aggregation interface, the traffic will only be forwarded on a fixed member interface of the aggregation interface, which will cause traffic congestion and uneven traffic load distribution. Summary of the Invention
[0004] To address the related technical issues, embodiments of this application provide a load-sharing method, apparatus, network node, and storage medium.
[0005] The technical solution of this application embodiment is implemented as follows:
[0006] This application provides a load-sharing method applied to a first node, the method comprising:
[0007] Based on the first identifier carried by the packets of the first data stream, load balancing is performed on the first data stream; wherein, the first identifier indicates the packet container to which the packet belongs, packets within the same packet container carry the same first identifier, and packets from different packet containers carry different first identifiers.
[0008] In the above scheme, the load balancing of the first data stream based on the first identifier carried in the message of the first data stream includes:
[0009] Based on the first information and the first identifier carried in the message, the hash value of the message is determined; the first information represents the relevant information of the first data stream.
[0010] Based on the hash value of the message, the first data stream is load-balanced across multiple member ports of multiple message forwarding paths and / or aggregation interfaces.
[0011] The method in the above scheme further includes:
[0012] The messages in the first data stream are divided into multiple message containers.
[0013] The method in the above scheme further includes:
[0014] The packets of the first data stream are divided into multiple packet containers based on one or more of the following:
[0015] Number of messages;
[0016] Message transmission time length;
[0017] Message transmission duration;
[0018] Message length.
[0019] The method in the above scheme further includes:
[0020] Receive a message carrying the first identifier.
[0021] In the above scheme, the last message of each message container carries a second identifier.
[0022] This application embodiment also provides a load-sharing method applied to a second node, the method comprising:
[0023] Receive a message from the first data stream. The message carries a first identifier, which indicates the message container to which the message belongs. Messages in the same message container carry the same first identifier, while messages in different message containers carry different first identifiers.
[0024] Based on the first identifier carried in the message, the messages of the first data stream are reassembled and / or forwarded.
[0025] In the above scheme, the message also carries a second identifier, which indicates the last message in the message container to which the message belongs.
[0026] The method in the above scheme further includes:
[0027] Based on the first identifier and / or the second identifier carried in the message, the messages of the first data stream are reassembled and / or forwarded.
[0028] In the above scheme, forwarding the packets of the first data stream includes:
[0029] Under certain conditions, forward part or all of the messages or message containers.
[0030] In the above scheme, forwarding part or all of the messages or message containers under the condition of meeting the set conditions includes one or more of the following:
[0031] If the messages are not out of order, and / or the first identifier carried by the first message is the same as the first identifier recorded, the first message is forwarded directly; the first identifier recorded represents the first identifier carried by the most recently forwarded second message, or is updated based on the first identifier carried by the second message or the first identifier carried by the last cached message;
[0032] In the event of out-of-order packets, and / or, if the first identifier carried by the first packet differs from the recorded first identifier, the first packet is cached; the recorded first identifier represents the first identifier carried by the most recently forwarded second packet, or is updated based on the first identifier carried by the second packet or the first identifier carried by the last cached packet;
[0033] If the last message of the first message container is received, forward some or all of the messages of the first message container.
[0034] Upon receiving the last message of the first message container, forward some or all of the messages of the first message container and some or all of the cached messages of the second message container; wherein, in the first data stream, the messages of the second message container are located after the messages of the first message container;
[0035] If the timer times out, all cached packets are forwarded. The timer is started when packets are out of order.
[0036] The above scheme, the method further includes one or more of the following:
[0037] If the first identifier carried in the first message is different from the first identifier recorded, the timer is started.
[0038] Cancel the timer if the cache is empty;
[0039] Upon receiving the last message of the first message container, increment the first identifier of the record;
[0040] If the timer times out, the first identifier recorded will be updated to the first identifier carried by the last cached message.
[0041] In the above scheme, the timer's count value is greater than or equal to the maximum delay difference of the message forwarding path.
[0042] In the above scheme, the setting conditions include one or more of the following:
[0043] The first identifier carried in the received message is the same as the first identifier carried in the most recently forwarded message;
[0044] The most recently forwarded message is not the last message in the message container;
[0045] The last message in the message container has been received;
[0046] The timer times out, and the timer is started in the event of out-of-order messages.
[0047] This application embodiment also provides a load-sharing device, including:
[0048] The first processing unit is configured to perform load balancing on the first data stream based on the first identifier carried by the packets of the first data stream; wherein the first identifier indicates the packet container to which the packet belongs, packets within the same packet container carry the same first identifier, and packets from different packet containers carry different first identifiers.
[0049] This application embodiment also provides a load-sharing device, including:
[0050] The first receiving unit is used to receive messages from the first data stream. The message carries a first identifier, which indicates the message container to which the message belongs. Messages in the same message container carry the same first identifier, while messages in different message containers carry different first identifiers.
[0051] The second processing unit is used to reassemble and / or forward the packets of the first data stream based on the first identifier carried in the packet.
[0052] This application embodiment also provides a first node, including: a first processor and a first communication interface; wherein,
[0053] The first processor is configured to perform load balancing on the first data stream based on the first identifier carried by the packets of the first data stream; wherein the first identifier indicates the packet container to which the packet belongs, packets within the same packet container carry the same first identifier, and packets from different packet containers carry different first identifiers.
[0054] This application embodiment also provides a second node, including: a second processor and a second communication interface; wherein,
[0055] The second communication interface is used to receive messages from the first data stream. The message carries a first identifier, which indicates the message container to which the message belongs. Messages in the same message container carry the same first identifier, while messages in different message containers carry different first identifiers.
[0056] The second processor is configured to reassemble and / or forward packets of the first data stream based on a first identifier carried in the packet.
[0057] This application embodiment also provides a network node, which includes a first node or a second node, and the network node includes a processor and a memory for storing computer programs that can run on the processor.
[0058] Wherein, when the processor runs the computer program, it executes the steps of any method on the first node side, or executes the steps of any method on the second node side.
[0059] This application embodiment also provides a storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, it implements the steps of any method on the first node side, or the steps of any method on the second node side.
[0060] This application also provides a computer program product, including a computer program, characterized in that the computer program, when executed by a processor, includes the steps of any of the above methods.
[0061] In the load balancing method, apparatus, network node, and storage medium provided in this application embodiment, the first node performs load balancing on the first data stream based on the first identifier carried by the packets of the first data stream. The first identifier indicates the packet container to which the packet belongs. Packets within the same packet container carry the same first identifier, while packets from different packet containers carry different first identifiers. The second node receives packets from the first data stream, each carrying a first identifier, and reassembles and / or forwards the packets based on the first identifier. It can be seen that in this application embodiment, packets from a single data stream can be divided into multiple packet containers. Since packets within the same packet container carry the same first identifier, and packets from different packet containers carry different first identifiers, packets carrying the same first identifier can be transmitted through the same member interface of the same SL and / or aggregation interface, while packets carrying different first identifiers can be transmitted through different member interfaces of different SLs and / or aggregation interfaces. This achieves balanced traffic load balancing, significantly improves the overall utilization of network bandwidth, increases packet transmission efficiency, and reduces the probability of traffic congestion. Attached Figure Description
[0062] Figure 1 This is an example diagram showing the format of the routing header for the relevant technology segment;
[0063] Figure 2 Example diagram of the SRv6 traffic engineering strategy model for related technologies;
[0064] Figure 3 This is a schematic flowchart of a load-sharing method according to an embodiment of this application;
[0065] Figure 4This is an example diagram illustrating the structure of the basic IPv6 header in an embodiment of this application;
[0066] Figure 5 This is an example diagram illustrating the structure of an IPv6 source address in an embodiment of this application;
[0067] Figure 6 This is an example diagram of the packaging format of the DOH in the embodiments of this application;
[0068] Figure 7 This is an example diagram of the SRH TLV structure in an embodiment of this application;
[0069] Figure 8 This is a schematic flowchart of a load-sharing method according to an embodiment of this application;
[0070] Figure 9 This is a schematic diagram of the interaction process of the load sharing method in this application embodiment;
[0071] Figure 10 This is an example diagram of a load-sharing method according to an embodiment of this application;
[0072] Figure 11 This is an example diagram of a load-sharing method according to an embodiment of this application;
[0073] Figure 12 This is a schematic diagram of a load-sharing device according to an embodiment of this application;
[0074] Figure 13 This is a schematic diagram of a load-sharing device according to an embodiment of this application;
[0075] Figure 14 This is a schematic diagram of the first node structure in an embodiment of this application;
[0076] Figure 15 This is a schematic diagram of the second node structure in an embodiment of this application. Detailed Implementation
[0077] SRv6 is a protocol designed based on the source routing concept for forwarding IPv6 packets over a network. Based on the IPv6 forwarding plane, SRv6 inserts a Segment Routing Header (SRH) into IPv6 packets, pushes an explicit IPv6 address stack onto the SRH, and completes hop-by-hop forwarding by continuously updating the destination address and offset address stack through intermediate nodes.
[0078] Segment routing (SR) is a source routing paradigm that explicitly indicates the forwarding path of a data packet at the ingress node. The ingress node directs the data packet to the specific path according to the segment routing policy (SR policy).
[0079] The new SRH is used to carry a sequence of SRv6 SIDs, enabling flexible programming of SRv6 network paths and various functions. The SID stands for Segment Identifier. The SRH can also include an optional TLV (Type-length-value) field for carrying variable-length data, providing better scalability for SRv6. Figure 1 An example of SRH format is shown. Figure 1 In this context, "Segments Left" refers to the remaining segments, i.e., the number of remaining segments.
[0080] SRv6 operates in two modes: Best Effort (BE) and Traffic Engineering Policy (TE). SRv6 BE refers to calculating the optimal SRv6 path based on the Interior Gateway Protocol (IGP) shortest path algorithm, using only one service SID to guide packet forwarding along the link; it is a best-effort mode. SRv6 TE Policy utilizes SR's source routing mechanism, encapsulating an ordered list of instructions (path information) at the header node to guide packets across the network. SRv6 TE Policy is used to implement traffic engineering, improve network quality, and meet end-to-end service requirements.
[0081] Figure 2 The SRv6 TE Policy model is shown. (Example) Figure 2 As shown, an SRv6 TE Policy can contain multiple candidate paths (CPs), each carrying a priority attribute. The valid candidate path with the highest priority becomes the primary path of the SRv6 TE Policy. A candidate path can contain multiple segment lists (SLs), each carrying a weight attribute; these segment lists are also called fragment lists. Each SL is an explicit SID stack, and SLs can instruct network devices to forward packets. Multiple SLs can form a load-sharing mechanism.
[0082] An SRv6 policy may have multiple candidate paths. A candidate path can be represented as a single SL or a set of SLs, and traffic will be guided and weighted equal-cost multi-path routing (W-ECMP) will be performed based on the relative weight of each valid SL.
[0083] Traffic load balancing can be achieved for multiple SLs and / or multi-port aggregations. Load balancing is generally divided into packet-by-packet load balancing and flow-by-flow load balancing. Because packet-by-packet load balancing may result in out-of-order packets, it is not suitable for services that are highly sensitive to packet order. Flow-by-flow load balancing is more widely used in existing networks. Flow-by-flow load balancing uses a hash algorithm. The packet's characteristic value is used as input to the hash algorithm, called the hash factor. Packet characteristic values that can be used as hash factors include, but are not limited to, one or more of the following:
[0084] Ethernet frame header: source Media Access Control (MAC) address, destination MAC address;
[0085] IP header: source Internet Protocol (IP) address, destination IP address, protocol number;
[0086] Transmission Control Protocol (TCP) / User Datagram Protocol (UDP) header: source port number, destination port number;
[0087] Multi-Protocol Label Switching (MPLS) header: MPLS label, certain bits of the message payload, etc.
[0088] If the hash factor has good hashing properties, the load distribution obtained by the hash algorithm will be more even. However, if the network traffic types are too complex, relying solely on the hash factor mentioned above may not achieve the best load distribution effect.
[0089] Data transfer between intelligent computing centers can result in "elephant streams," which are large-bandwidth traffic streams with a fixed five-tuple of information. When traffic is introduced into SRv6-Policy, router nodes hash the traffic according to the five-tuple information, and the traffic is load-balanced among a set of active segments.
[0090] The existing solution has three traffic hashing problems:
[0091] Question 1: Because the fixed 5-tuple information of the elephant stream is hashed into the same segment list, multiple SLs cannot form load sharing. In fact, when the traffic of this elephant stream is too large and exceeds the carrying capacity of a single SL, it will cause link congestion, resulting in packet loss and damage to the service of this SL.
[0092] Question 2: When the outgoing interface of the segment list is a trunk (port aggregation) port, since the five-tuple information of the traffic remains unchanged, after the hash algorithm is used to calculate, the traffic will only be forwarded on a fixed member port of the trunk. Traffic hashing cannot make full use of the bandwidth of the network multi-link, resulting in bandwidth waste.
[0093] Question 3: At intermediate nodes in the network, because the packets are encapsulated with SRv6, it is very difficult for the forwarding chip to parse the five-tuple information of the original packet. Hashping according to the five-tuple of the IPv6 packet header encapsulated with SRH will cause all traffic of SRv6-Policy to be hashed to a fixed SL, resulting in traffic congestion and uneven hashing.
[0094] In summary, in the relevant technologies, since the same elephant flow has fixed 5-tuple information, all traffic of SRv6-Policy will be hashed to a fixed SL. When the outgoing interface of the SL is a trunk (port aggregation) port, the traffic will only be forwarded on a fixed member port of the trunk, which will cause traffic congestion and uneven traffic load distribution.
[0095] Based on this, in various embodiments of this application, the first node load balances the first data stream based on the first identifier carried by the packets of the first data stream. The first identifier indicates the packet container to which the packet belongs. Packets within the same packet container carry the same first identifier, while packets from different packet containers carry different first identifiers. The second node receives packets from the first data stream, each carrying a first identifier, and reassembles and / or forwards the packets based on the first identifier. It can be seen that in these embodiments, packets from a single data stream can be divided into multiple packet containers. Since packets within the same packet container carry the same first identifier, and packets from different packet containers carry different first identifiers, packets carrying the same first identifier can be transmitted through the same member interface of the same SL and / or aggregation interface, while packets carrying different first identifiers can be transmitted through different member interfaces of different SLs and / or aggregation interfaces. This achieves balanced traffic load balancing, significantly improves the overall utilization of network bandwidth, increases packet transmission efficiency, and reduces the probability of traffic congestion.
[0096] The present application will now be described in further detail with reference to the accompanying drawings and embodiments.
[0097] This application provides a load-sharing method applied to a first node. The first node includes an ingress node and / or intermediate nodes, and the number of intermediate nodes can be multiple. An ingress node, also known as a head node, source node, or ingress device, describes the entry point of a path or tunnel, such as the entry point of an SRv6 BE or SRv6-Policy (SRv6-Policy is also called SRv6 TE Policy). An intermediate node is a node located between the ingress node and the egress node, and is an endpoint of a segment list. An egress node, also known as an egress device, tail node, or destination node, describes the exit point of a path or tunnel, such as the tail node of an SRv6 BE or SRv6-Policy. Figure 3 As shown, the method includes:
[0098] Step 301: Based on the first identifier carried in the packets of the first data stream, perform load balancing on the first data stream.
[0099] The first identifier indicates the message container to which the message belongs. Messages within the same message container carry the same first identifier, while messages from different message containers carry different first identifiers.
[0100] Here, during load balancing of the first data stream, packets belonging to the same packet container are transmitted through the same SL and / or the same member interface of the aggregation interface; packets belonging to different packet containers are transmitted through different SLs and / or different member interfaces of the aggregation interface. One SL corresponds to one packet forwarding path, which can be simply referred to as a path or forwarding path. When packet forwarding is performed via native IP or SRv6 BE, and an aggregation interface exists in the packet forwarding path, packets from the same packet container are transmitted through the same member interface of the aggregation interface, while packets from different packet containers are transmitted through different member interfaces of the aggregation interface. When forwarding packets via SRv6-Policy, packets from the same packet container are transmitted through the same SL, while packets from different packet containers are transmitted through different SLs.
[0101] It should be noted that load balancing of the first data stream can be performed packet-by-packet and / or flow-by-flow. A data stream is also called a flow. The first data stream can be understood as a data stream with the same flow characteristics. The first data stream includes, but is not limited to, one or more of the following: data streams with the same source and destination addresses, data streams with the same or fixed 5-tuples; since an "elephant stream" has a fixed 5-tuple, the first data stream can be an "elephant stream," which can be understood as a high-volume data stream. The same message container can be understood as the same message container, that is, messages within the same message container carry the same first identifier. A message container can be translated as a message Docker, which is a logical grouping of messages. A message container can be called a message set, message collection, message group, or message block. A message container can contain one or more messages. The first identifiers carried by messages from different data streams can be different.
[0102] Based on the first node including an ingress node, in one embodiment, before load balancing the first data stream based on the first identifier carried in the packets of the first data stream, the method further includes:
[0103] The messages in the first data stream are divided into multiple message containers.
[0104] Here, when the first node is the entry node (also called the head node, source node, or entry device), before load balancing the first data stream based on the first identifier carried in the packets of the first data stream, the entry node divides the packets of the first data stream into multiple packet containers, assigns a first identifier to each packet container, and writes or adds the corresponding first identifier to the packets of each packet container, or marks the packets of each packet container with the corresponding first identifier. Specifically, the first identifiers assigned to different packet containers are different; the first identifiers written, added, or marked in different packets within the same packet container are the same; and the first identifiers written, added, or marked in packets of different packet containers are different.
[0105] In one embodiment, based on the first node including an entry node, the method further includes:
[0106] The packets of the first data stream are divided into multiple packet containers based on one or more of the following:
[0107] Number of messages;
[0108] Message transmission time length;
[0109] Message transmission duration;
[0110] Message length.
[0111] Here, when the first node is the ingress node, before load balancing the first data stream based on the first identifier carried in the packets of the first data stream, the ingress node divides the packets of the first data stream into multiple packet containers based on one or more of the following: number of packets, packet transmission time length, packet transmission duration, and packet length. The number of packets can be fixed or variable; no restriction is placed here. A packet is also called a data packet.
[0112] Specifically, upon receiving a message, the ingress node identifies whether the message belongs to the first data stream. If the message belongs to the first data stream, it divides the first data stream messages into multiple message containers based on one or more of the above criteria. For example, it divides every M messages into one message container, and / or divides messages received within N message transmission time periods into one message container, and / or divides 64 kilobyte (KB) messages into one message container.
[0113] It should be noted that all messages within each message container, measured in units of message length and / or message transmission duration and / or message transmission time length, are complete messages. Individual messages are no longer decomposed, and the total length of messages in each message container is the same or approximately the same.
[0114] In one embodiment, based on the first node including intermediate nodes, the method further includes:
[0115] Receive a message carrying the first identifier.
[0116] Here, when the first node is an intermediate node, before the intermediate node performs load balancing on the first data stream based on the first identifier carried in the message of the first data stream, the intermediate node also receives a message carrying the first identifier.
[0117] The first identifier is added or written to the message header by the ingress node. In one embodiment, the first identifier may be carried in the message in one or more of the following ways:
[0118] IPv6 source address field;
[0119] SRv6 source address field;
[0120] Flow Label field.
[0121] here, Figure 4 This shows an example of the structure of the IPv6 basic header, where the first identifier can be carried in... Figure 4 The source address field and / or Flow Label field. The source address field can be an IPv6 source address field or an SRv6 source address field.
[0122] For example, the Flow Label field occupies 20 bits. This field can be used to distinguish different data streams with the same source and destination addresses. In this application, the Flow Label field can carry a first identifier to indicate the message container to which a message of the same data stream belongs. Data stream is also called traffic.
[0123] For example, the first identifier can be carried in the source address field, which is a 128-bit IPv6 address. Referring to the definition method of draft-cheng-spring-srv6-encoding-network-sliceid, network programming can be performed on the IPv6 source address, and the first identifier can be represented by the first ID. Figure 5 An example of the structure of an IPv6 source address is shown; in Figure 5 In this context, Block indicates the network routing prefix; Node ID is the node identifier, representing the node from which the data stream is sent; Flow ID is the flow identifier, representing different data streams originating from the same node; and First ID is the first identifier, representing different packet containers for the same data stream.
[0124] It should be noted that the first identifier is not limited to the fields mentioned above; it can also be carried in other fields, depending on actual needs. No restrictions are placed here. By explicitly defining the location of the first identifier, the receiving node can quickly obtain it.
[0125] To facilitate node identification of the last message in a message container, in one embodiment, the last message in each message container carries a second identifier.
[0126] Here, the second identifier can be carried in the Destination Options Header (DOH) and / or SRH of the message. That is, the second identifier can be extended and defined in the DOH or the SRH TLV. Of course, the second identifier can also be carried in other fields; the specific settings can be configured according to actual needs, and there are no restrictions here. Figure 6 An example of the DOH encapsulation format is shown. The second identifier can be carried in the Option Type field of the DOH. The value of the Option Type field is undetermined and represents the type number of the second identifier. The length of the option data field (Opt Data Len) is in bytes. This type has no data field, so this field is filled with 0, that is, the value of the Opt Data Len field is 0. Figure 7 An example diagram of an SRH TLV structure is shown. Figure 7In this context, the type value is undetermined and represents the type number of the second identifier; the length is in bytes, and since this type has no data field, this field is filled with 0.
[0127] To achieve more even load balancing and reduce the probability of traffic congestion, the first data stream can be load-balanced stream-by-stream based on the hash value of its packets. Therefore, in one embodiment, the load balancing of the first data stream based on the first identifier carried in the packets of the first data stream includes:
[0128] Based on the first information and the first identifier carried in the message, the hash value of the message is determined; the first information represents the relevant information of the first data stream.
[0129] Based on the hash value of the message, the first data stream is load-balanced across multiple member ports of multiple message forwarding paths and / or aggregation interfaces.
[0130] Here, the first information of the first data stream is determined; using a hash algorithm, based on the first information and the first identifier carried by any packet, the hash value of that packet is determined; based on the hash values of each packet in the first data stream, load balancing of the first data stream is performed on multiple member ports of multiple packet forwarding paths and / or aggregation interfaces. Specifically, different packets within the same packet container have the same hash value, and packets within the same packet container are transmitted through the same member port of the same packet forwarding path and / or aggregation interface; packets in different packet containers have different hash values, and packets from different packet containers are transmitted through different member ports of different packet forwarding paths and / or aggregation interfaces. Aggregation interfaces include, but are not limited to, Trunk interfaces.
[0131] It should be noted that, if the first information of the first data stream remains unchanged, and the first identifier of the current message is the same as the first identifier of the previous message, the hash value of the previous message can be directly used as the hash value of the current message. There is no need to determine the hash value of the message again based on the first information and the first identifier carried by the message, so as to save computing resources and improve message forwarding efficiency.
[0132] It should be noted that the first piece of information includes, but is not limited to, one or more of the following: source MAC address, destination MAC address, source IP address, destination IP address, 5-tuple information, and flow label. The 5-tuple information includes source IP address, source port, destination IP address, destination port, and transport protocol.
[0133] Correspondingly, this application also provides a load-sharing method applied to a second node, which is an exit node. An exit node is also called an exit device, tail node, or destination node. In practical applications, an exit node describes the exit of a path or tunnel, such as the tail node of an SRv6 BE or SRv6-Policy. Figure 8 As shown, the method includes:
[0134] Step 801: Receive the message of the first data stream.
[0135] The message carries a first identifier, which indicates the message container to which the message belongs. Messages in the same message container carry the same first identifier, while messages in different message containers carry different first identifiers.
[0136] In one embodiment, the message also carries a second identifier, which indicates the last message in the message container to which the message belongs.
[0137] Here, when the message in the first data stream carries the second identifier, it indicates that the message is the last message in the message container.
[0138] Step 802: Based on the first identifier carried in the message, reassemble and / or forward the messages of the first data stream.
[0139] Here, upon receiving a message from the first data stream, the second node parses out the first identifier carried in the message. For example, if the message is an SRv6 message, the second node can parse out the first identifier and / or the second identifier from the message header before removing the SRv6 encapsulation. Based on the first identifier carried in the message, the second node determines whether out-of-order delivery has occurred. If the message is not out of order, it directly forwards the received message; if out-of-order delivery has occurred, it reassembles the received message and forwards the reassembled message.
[0140] Specifically, if the first identifier carried by the currently received message is the same as the first identifier carried by the most recently forwarded message, the message is not out of order; or, if the first identifier carried by the currently received message is the same as the first identifier carried by the most recently forwarded message, and the most recently forwarded message is not the last message in the message container, the message is not out of order; if the first identifier carried by the currently received message is different from the first identifier carried by the most recently forwarded message, and the most recently forwarded message is not the last message in the message container, the message is out of order. The last message in the message container carries a second identifier.
[0141] It should be noted that because packets from different packet containers within the same data stream reach the egress node via different packet forwarding paths, the timing of the packets may change. Reassembling received packets can be understood as reassembling packets from different packet containers; for example, in the event of out-of-order packets, the out-of-order packets can be buffered first, and then reassembled according to the order of the packet containers or according to the first identifier carried by the packets in different containers to adjust or correct the timing of the packets. Packets within the same packet container maintain their timing unchanged because they are forwarded via the same packet forwarding path.
[0142] In order to send the packets of the first data stream in an orderly manner, thereby improving the decoding success rate of the packets of the first data stream by the receiver, in one embodiment, the method further includes:
[0143] Based on the first identifier and / or the second identifier carried in the message, the messages of the first data stream are reassembled and / or forwarded.
[0144] Here, based on the first identifier and / or the second identifier carried in the message, it can be determined whether the message is out of order; if the message is not out of order, the received message is forwarded directly; if the message is out of order, the received message is reassembled and the reassembled message is forwarded, so as to avoid or reduce message forwarding errors caused by different message timing.
[0145] For example, if the first identifier carried by the currently received message is the same as the first identifier carried by the most recently forwarded message, the message is not out of order, and the most recently forwarded message can be described as the most recently sent message. If the first identifier carried by the currently received message is different from the first identifier carried by the most recently forwarded message, and if the currently received message does not carry a second identifier, but the most recently forwarded message does carry a second identifier, it indicates that the message is not out of order. If the first identifier carried by the currently received message is different from the first identifier carried by the most recently forwarded message, and the most recently forwarded message does not carry a second identifier, then message out of order occurs. If the first identifier carried by the currently received message is different from the first identifier carried by the most recently forwarded message, and if the most recently forwarded message does not carry a second identifier, then message out of order occurs.
[0146] In order to send the packets of the first data stream in an orderly manner and improve the decoding success rate of the packets of the first data stream by the receiver, in one embodiment, the packets of the first data stream are forwarded, including:
[0147] Under certain conditions, forward part or all of the messages or message containers.
[0148] The set conditions include one or more of the following:
[0149] The first identifier carried in the received message is the same as the first identifier carried in the most recently forwarded message;
[0150] The most recently forwarded message is not the last message in the message container;
[0151] The last message in the message container has been received;
[0152] The timer times out, and the timer is started in the event of out-of-order messages.
[0153] Here, if the first identifier carried by the received message is the same as the first identifier carried by the most recently forwarded message, the message can be forwarded directly. Alternatively, if the first identifier carried by the received message is the same as the first identifier carried by the most recently forwarded message, the message can be forwarded directly, provided that the most recently forwarded message is not the last message in the message container (the most recently forwarded message carries the second identifier). In the event of out-of-order messages, the out-of-order messages can be buffered first. If the last message in the message container is received, all buffered messages belonging to that message container can be forwarded. If a timer expires, all buffered messages can be forwarded. Different buffered messages can belong to the same message container or different message containers.
[0154] In one embodiment, forwarding part or all of the packets or packet containers when the set conditions are met includes one or more of the following:
[0155] If the messages are not out of order, and / or the first identifier carried by the first message is the same as the first identifier recorded, the first message is forwarded directly; the first identifier recorded represents the first identifier carried by the most recently forwarded second message, or is updated based on the first identifier carried by the second message or the first identifier carried by the last cached message;
[0156] In the event of out-of-order packets, and / or, if the first identifier carried by the first packet differs from the recorded first identifier, the first packet is cached; the recorded first identifier represents the first identifier carried by the most recently forwarded second packet, or is updated based on the first identifier carried by the second packet or the first identifier carried by the last cached packet;
[0157] If the last message of the first message container is received, forward some or all of the messages of the first message container.
[0158] Upon receiving the last message of the first message container, forward some or all of the messages of the first message container and some or all of the cached messages of the second message container; wherein, in the first data stream, the messages of the second message container are located after the messages of the first message container;
[0159] If the timer times out, all cached packets are forwarded. The timer is started when packets are out of order.
[0160] Here, the first message can be understood as the currently received message, and the second message can be understood as the most recently forwarded message. Assuming that the message in the second message container in the first data stream follows the message in the first message container, and the second node has not yet received the last message in the first message container, then the recorded first identifier can be understood as the first identifier carried by the message in the first message container. If the first identifier carried by the first message is the same as the recorded first identifier, it indicates that the first message belongs to the first message container, the message is not out of order, and the first message is forwarded directly. If the first identifier carried by the first message is different from the recorded first identifier, it indicates that the first message does not belong to the first message container, and the first message belongs to the second message container. In this case, message out of order occurs, and the first message is buffered. In other words, during the forwarding of messages from the first message container, if a message belonging to the second message container is received, the message belonging to the second message container is buffered first, so that messages belonging to the first message container are forwarded first. After all messages belonging to the first message container have been forwarded, messages belonging to the second message container are forwarded. If the last message of the first message container has been forwarded, the recorded first identifier is updated to the first identifier carried by the message of the second message container. That is, if the most recently forwarded message is the last message of the message container, the recorded first identifier is updated based on the first identifier carried by the most recently forwarded message. The first message container can be understood as any message container. The second message container and the first message container can be adjacent or not adjacent in the first data stream. For example, if there are at least two second message containers, there may be second message containers that are not adjacent to the first message containers. A message of the second message container can be understood as a successor message of the first message container.
[0161] If some packets of the first packet container have been forwarded before the packets of the first packet container are cached, then upon receiving the last packet of the first packet container, some packets of the first packet container are forwarded, that is, all packets cached in the first packet container are forwarded; if no packets of the first packet container have been forwarded before the packets of the first packet container are cached, then upon receiving the last packet of the first packet container, all packets of the first packet container are forwarded.
[0162] In the scenario where a message belonging to the second message container is received during the forwarding of a message from the first message container, since the recorded first identifier is the first identifier carried by the message from the first message container, and the received first message belongs to the second message container, the first identifier carried by the first message is different from the recorded first identifier. At this time, the first message (the message belonging to the second message container) and the messages belonging to the first message container received after the first message can be cached. When the last message of the first message container is received (the message carries the first identifier and the second identifier), all the cached messages belonging to the first message container and some or all of the cached messages belonging to the second message container are forwarded. For example, during the forwarding of messages from the first message container, messages belonging to the second message container and messages belonging to the first message container are received alternately. Messages belonging to the second message container and messages belonging to the first message container are cached. Messages from different message containers are reassembled. Upon receiving the last message from the first message container, all cached messages belonging to the first message container and some or all cached messages belonging to the second message container are forwarded. Specifically, upon receiving the last message from the first message container, if there is one second message container and its last message has been received, then after forwarding all cached messages from the first message container, all cached messages from the second message container are forwarded. If there are two or more second message containers, then after forwarding all cached messages from the first message container, the cached messages from the second message containers adjacent to the first message container are forwarded sequentially. Finally, according to the order of the message containers, the cached messages from the second message containers not adjacent to the first message container are forwarded.
[0163] In the event of out-of-order packets, a timer is started. If the timer expires, all buffered packets are forwarded. For example, if the first identifier carried by the first packet differs from the recorded first identifier, the timer can also be started. If the timer expires, all buffered packets are forwarded, and the recorded first identifier is updated to the first identifier carried by the last buffered packet, or the recorded first identifier is updated to the first identifier carried by the last forwarded packet. The timer is also called a timer or counter. In other words, if the timer expires, regardless of whether the last packet in the current packet container has been received, all buffered packets must be forwarded immediately to ensure that the packet transmission delay meets the delay requirements of the first data stream.
[0164] In one embodiment, the timer count is greater than or equal to the maximum delay difference of the message forwarding path.
[0165] Here, the timer's count value can be understood as the timing value. The maximum delay difference of a message forwarding path can be understood as the maximum value among the delay differences of any two message forwarding paths. For example, the timer's count value can be expressed as ΔT = max(t i -t j ) or ΔT=|max(t i -t j )|, where i and j represent two different message forwarding paths, t i t represents the delay of the forwarding path of the i-th message. j This represents the delay of the forwarding path for the j-th message.
[0166] It should be noted that either the Two-Way Active Measurement Protocol (TWAMP) or the Simple Two-Way Active Measurement Protocol (STAMP) can be used to measure path delays based on the packet forwarding paths of SRv6-BE or SRv6-Policy, obtaining the delay of each packet forwarding path. Based on the delays of each packet forwarding path, the maximum delay difference of the packet forwarding paths can be determined. Alternatively, the maximum difference can be calculated based on the delays of different packet forwarding paths calculated by the controller, thus obtaining the maximum delay difference of the packet forwarding paths. This application embodiment does not limit the method for measuring the delay of the forwarding paths of SRv6-BE or SRv6-Policy.
[0167] To avoid or reduce message forwarding errors caused by out-of-order message delivery, in one embodiment, the method further includes one or more of the following:
[0168] If the first identifier carried in the first message is different from the first identifier recorded, the timer is started.
[0169] Cancel the timer if the cache is empty;
[0170] Upon receiving the last message of the first message container, increment the first identifier of the record;
[0171] If the timer times out, the first identifier recorded will be updated to the first identifier carried by the last cached message.
[0172] Here, if the timer times out, all cached packets will be forwarded, for example, according to the order of the packet containers or according to the first identifier carried by the packets in different packet containers. Therefore, if the timer times out, the recorded first identifier will be updated to the first identifier carried by the last cached packet. This can also be understood as: if all cached packets are forwarded, the recorded first identifier will be updated to the first identifier carried by the most recently forwarded packet.
[0173] The following section provides a more detailed description of this application with reference to application examples.
[0174] like Figure 9 As shown, the load-sharing method includes the following steps:
[0175] Step 1: The head node (entry node) divides the messages of the first data stream into multiple message containers.
[0176] Among them, messages from the same message container carry the same first identifier, while messages from different message containers carry different first identifiers; the first identifier indicates the message container to which the message belongs.
[0177] In one embodiment, the head node divides the messages of the first data stream into multiple message containers based on one or more of the following: number of messages, message transmission time length, message transmission duration, and message length.
[0178] Here, the method by which the head node divides the packets of the first data stream into multiple packet containers is described in the relevant section above and will not be repeated here. For example... Figure 10 and Figure 11 As shown, the head node can divide the messages of the first data stream into 4 message containers, each containing 3 messages.
[0179] The first data stream includes, but is not limited to, one or more of the following: data streams with the same source and destination addresses, and data streams with the same or fixed 5-tuples. In practical applications, the first data stream is an elephant stream. The first identifier can be carried in the message in one or more of the following ways:
[0180] IPv6 source address field, SRv6 source address field, and flow label / flow identifier field.
[0181] In each packet container, the last packet carries a second identifier, which can be carried in the packet's DOH and / or SRH (e.g., SRH TLV). Specifically, IPv6 packets can carry the identifier in the DOH, and SRv6 packets can carry it in the DOH and / or SRH TLV fields.
[0182] Step 2: The head node performs load balancing on the first data stream based on the first identifier carried in the first data stream's packets.
[0183] In one embodiment, step 2 specifically includes:
[0184] Based on the first information and the first identifier carried in the message, the hash value of the message is determined; the first information represents the relevant information of the first data stream.
[0185] Based on the hash value of the message, the first data stream is load-balanced across multiple member ports of multiple message forwarding paths and / or aggregation interfaces.
[0186] Here, as Figure 10 and Figure 11 As shown, after the head node encapsulates the packet with an SRv6 packet header, it hashes the first identifier carried in the packet across multiple segment lists (SL1, SL2, SL3) and forwards packets from different packet containers of the first data stream through different packet forwarding paths corresponding to different SLs. Figure 10 and Figure 11 In this process, all packets in packet container 3 are forwarded through the packet forwarding path corresponding to SL1; all packets in packet container 1 and all packets in packet container 2 are forwarded through the packet forwarding path corresponding to SL2; and all packets in packet container 4 are forwarded through the packet forwarding path corresponding to SL3.
[0187] Step 3: The head node sends the first data stream message to multiple intermediate nodes, and the message carries the first identifier.
[0188] Here, as Figure 10 and Figure 11 As shown, the head node sends all messages of message container 3 to intermediate node 1, the head node sends all messages of message container 1 and all messages of message container 2 to intermediate node 2 respectively, and the head node sends all messages of message container 4 to intermediate node 3.
[0189] Step 4: The intermediate node receives the message of the first data stream, and the message carries the first identifier.
[0190] Here, as Figure 10 and Figure 11 As shown, intermediate node 1 receives all messages from message container 3, intermediate node 2 receives all messages from message container 1 and all messages from message container 2 in sequence, and intermediate node 3 receives all messages from message container 4.
[0191] Step 5: The intermediate node performs load balancing on the first data stream based on the first identifier carried in the first data stream's packets.
[0192] In one embodiment, step 5 specifically includes:
[0193] Based on the first information and the first identifier carried in the message, the hash value of the message is determined; the first information represents the relevant information of the first data stream.
[0194] Based on the hash value of the message, the first data stream is load-balanced across multiple member ports of multiple message forwarding paths and / or aggregation interfaces.
[0195] Here, if forwarding is done via SRv6 Policy, the intermediate node is an endpoint of a segment list. After receiving the first data stream's packets, the intermediate node continues forwarding according to the SRv6 segment list. If packet forwarding is done via native IP or SRv6-BE, and the intermediate node's outgoing interface is an aggregation interface with multiple member ports, the intermediate node load-balances and forwards the first data stream's packets across different member ports based on different first identifiers. Packets within the same packet container are forwarded through the same member port.
[0196] For example, such as Figure 10 and Figure 11 As shown, the outgoing interface of intermediate node 1 is an aggregation interface with three member ports. Intermediate node 1 forwards all packets from packet container 3 through the same member port. The outgoing interface of intermediate node 2 is not an aggregation interface. Intermediate node 2 continues to forward all packets from packet container 1 and all packets from packet container 2 based on the SRv6 segment list. The outgoing interface of intermediate node 3 is not an aggregation interface. Intermediate node 3 continues to forward all packets from packet container 4 based on the SRv6 segment list. It should be noted that intermediate node 1 can forward all packets from packet container 3 through the first member port. If intermediate node 1 subsequently receives packets from packet container 5 of the first data stream, it can forward all packets from packet container 5 through the second member port. If intermediate node 1 subsequently receives packets from other packet containers of the first data stream, it can forward all packets from that packet container through the third member port.
[0197] Step 6: The intermediate node sends the first data stream message to the tail node, and the message carries the first identifier.
[0198] Here, as Figure 10 and Figure 11 As shown, intermediate node 1 forwards all messages of message container 3 to the tail node (egress node) through the same member port. Intermediate node 2 forwards all messages of message container 1 and all messages of message container 2 to the tail node in sequence. Intermediate node 3 forwards all messages of message container 4 to the tail node.
[0199] Step 7: The tail node receives the packets of the first data stream sent by the intermediate node, and reassembles and / or forwards the packets of the first data stream based on the first identifier and / or the second identifier carried in the packets.
[0200] Here, since the messages from different message containers in the first data stream reach the tail node through different message forwarding paths, the timing between messages may change, that is, message out-of-order may occur. In the case of message out-of-order, the messages from different message containers need to be reassembled and the reassembled messages are forwarded. In the case of messages not out of order, the received messages are forwarded directly.
[0201] like Figure 10 As shown, the packets in the first data stream are not out of order. After receiving the packets from the first data stream, the tail node forwards them directly. Figure 11 As shown, some messages in message container 1 and message container 2 are out of order. It is necessary to reassemble the messages in message container 1 and message container 2, and then forward the reassembled messages in message container 1 and message container 2.
[0202] In one embodiment, the tail node forwards part or all of the packets or packet containers when certain conditions are met. These conditions include one or more of the following:
[0203] The first identifier carried in the received message is the same as the first identifier carried in the most recently forwarded message;
[0204] The most recently forwarded message is not the last message in the message container;
[0205] The last message in the message container has been received;
[0206] The timer times out, and the timer is started in the event of out-of-order messages.
[0207] For example, such as Figure 11As shown, when the tail node receives the second message from message container 1, the most recently forwarded message is the first message from message container 1. The first identifier carried by the second message from message container 1 is the same as the first identifier carried by the most recently forwarded message, so the tail node directly forwards the second message from message container 1. When the tail node receives the last message from message container 2, it directly forwards the last message from message container 2. After receiving the second message from message container 1, the tail node receives the first message from message container 2. Due to out-of-order message delivery, the tail node starts a timer to buffer the first message from message container 2. If the last message from message container 1 has not been received by the timer expires, the tail node forwards the buffered first message from message container 2. If the last message from message container 1 is received before the timer expires, the tail node can directly forward the last message from message container 1. If the last message of message container 1 is received when the timer expires, the last message of message container 1 and the first message of the cached message container 2 are forwarded directly. Since the messages of message container 3 and message container 4 are not out of order, the tail node forwards the received message directly if it receives any message of message container 3; and forwards the received message directly if it receives any message of message container 4.
[0208] In one embodiment, forwarding part or all of the packets or packet containers when the set conditions are met includes one or more of the following:
[0209] If the messages are not out of order, and / or the first identifier carried by the first message is the same as the first identifier recorded, the first message is forwarded directly; the first identifier recorded represents the first identifier carried by the most recently forwarded second message, or is updated based on the first identifier carried by the second message or the first identifier carried by the last cached message;
[0210] In the event of out-of-order packets, and / or, if the first identifier carried by the first packet differs from the recorded first identifier, the first packet is cached; the recorded first identifier represents the first identifier carried by the most recently forwarded second packet, or is updated based on the first identifier carried by the second packet or the first identifier carried by the last cached packet;
[0211] If the last message of the first message container is received, forward some or all of the messages of the first message container.
[0212] Upon receiving the last message of the first message container, forward some or all of the messages of the first message container and some or all of the cached messages of the second message container; wherein, in the first data stream, the messages of the second message container are located after the messages of the first message container;
[0213] If the timer times out, all buffered packets are forwarded. The timer is started when packets are out of order. The timer's count value is greater than or equal to the maximum delay difference of the packet forwarding path.
[0214] In one embodiment, the method further includes one or more of the following:
[0215] If the first identifier carried in the first message is different from the first identifier recorded, the tail node starts a timer.
[0216] The tail node cancels the timer if the cache is empty;
[0217] When the tail node receives the last message of the first message container, it increments the first identifier of the record.
[0218] If the timer expires, the tail node will update the recorded first identifier to the first identifier carried by the last cached message.
[0219] Here, with Figure 11 Let's take an example to illustrate. For example... Figure 11 As shown, during the process of sending a message from message container 1, the tail node records the first identifier, which is the first identifier carried by the message from message container 1. When the tail node receives the first message from message container 1, it directly forwards the first message from message container 1. When the tail node receives the second message from message container 1, since the first identifier carried by the second message from message container 1 is the same as the recorded first identifier, the tail node directly forwards the second message from message container 1.
[0220] After the tail node receives the second message from message container 1, it receives the first message from message container 2. At this time, the tail node has not yet received the last message from message container 1. Since the first identifier carried by the first message from message container 2 is different from the first identifier carried by the second message from message container 1, and the second message from message container 1 does not carry the second identifier, indicating that the second message from message container 1 is not the last message from message container 1, the tail node starts a timer, sets the timer count value to be greater than or equal to the maximum delay difference ΔT of the message forwarding path, and buffers the first message from message container 2.
[0221] After the tail node receives the first message of message container 2, it receives the last message of message container 1. Since the first identifier carried by the last message of message container 1 is different from that of the first message of message container 2, the messages are out of order. Because the timer has already started, the tail node does not need to start the timer again. The tail node can either cache the last message of message container 1 or directly forward it. Specifically, if the timer is started, the tail node checks if the timer has expired. If the last message of message container 1 has not been received by the timer expires, then the tail node forwards the cached first message of message container 2. If the last message of message container 1 is received before the timer expires, then the last message of message container 1 can be forwarded directly. After forwarding the last message of message container 1, the cached first message of message container 2 can be forwarded. If the last message of message container 1 is received when the timer expires, the last message of message container 1 and the first message of the cached message container 2 are forwarded directly, and the recorded first identifier is updated to the first identifier carried by the message of message container 2. The tail node cancels the timer after forwarding all cached messages; that is, when the cache is empty, the tail node controls the timer not to work.
[0222] After receiving the last message from message container 1, the tail node receives the second message from message container 2. Since the tail node has already forwarded the last message from message container 1, the recorded first identifier has been updated to the first identifier carried in the message from message container 2. The first identifier carried in the second message from message container 2 is the same as the recorded first identifier. Therefore, the tail node directly forwards the second message from message container 2. The last message from message container 2, the messages from message container 3, and the messages from message container 4 are not out of order. Therefore, the tail node directly forwards the received messages. After forwarding the last message from message container 2, the tail node updates the recorded first identifier to the first identifier carried in the message from message container 3. After forwarding the last message from message container 3, the tail node updates the recorded first identifier to the first identifier carried in the message from message container 4.
[0223] To implement the method on the first node side of this application embodiment, this application embodiment also provides a load-sharing device, which is disposed on the first node, such as... Figure 12 As shown, the device includes:
[0224] The first processing unit 1201 is used to perform load balancing on the first data stream based on the first identifier carried by the packets of the first data stream; wherein, the first identifier indicates the packet container to which the packet belongs, packets in the same packet container carry the same first identifier, and packets in different packet containers carry different first identifiers.
[0225] In one embodiment, the first processing unit 1201 is specifically used to determine the hash value of the message based on the first information and the first identifier carried by the message; the first information represents the relevant information of the first data stream; and based on the hash value of the message, to perform load balancing on the first data stream on multiple member ports of multiple message forwarding paths and / or aggregation interfaces.
[0226] In one embodiment, the first processing unit 1201 is further configured to divide the packets of the first data stream into multiple packet containers.
[0227] In one embodiment, the first processing unit 1201 is specifically configured to divide the packets of the first data stream into multiple packet containers based on one or more of the following:
[0228] Number of messages;
[0229] Message transmission time length;
[0230] Message transmission duration;
[0231] Message length.
[0232] In one embodiment, the device further includes:
[0233] The second receiving unit is used to receive messages carrying the first identifier.
[0234] In one embodiment, the last message of each message container carries a second identifier.
[0235] In practical applications, the first processing unit 1201 can be implemented by the processor in the load sharing device, and the second receiving unit can be implemented by the processor in the load sharing device in combination with the communication interface.
[0236] To implement the method on the second node side of this application embodiment, this application embodiment also provides a load-sharing device, which is disposed on the second node, such as... Figure 13 As shown, the device includes:
[0237] The first receiving unit 1301 is used to receive messages of the first data stream. The message carries a first identifier, which indicates the message container to which the message belongs. Messages in the same message container carry the same first identifier, while messages in different message containers carry different first identifiers.
[0238] The second processing unit 1302 is used to reassemble and / or forward the packets of the first data stream based on the first identifier carried in the packet.
[0239] In one embodiment, the message also carries a second identifier, which indicates the last message in the message container to which the message belongs.
[0240] In one embodiment, the second processing unit 1302 is further configured to reassemble and / or forward the packets of the first data stream based on the first identifier and / or the second identifier carried in the packet.
[0241] In one embodiment, the second processing unit 1302 is specifically used to forward part or all of the messages of a message or message container when a set condition is met.
[0242] In one embodiment, the second processing unit 1302 is specifically used for one or more of the following:
[0243] If the messages are not out of order, and / or the first identifier carried by the first message is the same as the first identifier recorded, the first message is forwarded directly; the first identifier recorded represents the first identifier carried by the most recently forwarded second message, or is updated based on the first identifier carried by the second message or the first identifier carried by the last cached message;
[0244] In the event of out-of-order packets, and / or, if the first identifier carried by the first packet differs from the recorded first identifier, the first packet is cached; the recorded first identifier represents the first identifier carried by the most recently forwarded second packet, or is updated based on the first identifier carried by the second packet or the first identifier carried by the last cached packet;
[0245] If the last message of the first message container is received, forward some or all of the messages of the first message container.
[0246] Upon receiving the last message of the first message container, forward some or all of the messages of the first message container and some or all of the cached messages of the second message container; wherein, in the first data stream, the messages of the second message container are located after the messages of the first message container;
[0247] If the timer times out, all cached packets are forwarded. The timer is started when packets are out of order.
[0248] In one embodiment, the second processing unit 1302 is further configured to perform one or more of the following:
[0249] If the first identifier carried in the first message is different from the first identifier recorded, the timer is started.
[0250] Cancel the timer if the cache is empty;
[0251] Upon receiving the last message of the first message container, increment the first identifier of the record;
[0252] If the timer times out, the first identifier recorded will be updated to the first identifier carried by the last cached message.
[0253] In one embodiment, the timer count is greater than or equal to the maximum delay difference of the message forwarding path.
[0254] In one embodiment, the setting conditions include one or more of the following:
[0255] The first identifier carried in the received message is the same as the first identifier carried in the most recently forwarded message;
[0256] The most recently forwarded message is not the last message in the message container;
[0257] The last message in the message container has been received;
[0258] The timer times out, and the timer is started in the event of out-of-order messages.
[0259] In practical applications, the second processing unit 1302 can be implemented by the processor in the load sharing device, and the first receiving unit 1301 can be implemented by the processor in the load sharing device in combination with the communication interface.
[0260] Based on the hardware implementation of the above program modules, and in order to implement the method on the first node side of the embodiments of this application, the embodiments of this application also provide a first node. In practical applications, the first node includes the head node and / or intermediate nodes of SRv6, such as... Figure 14 As shown, the first node 1400 includes:
[0261] The first communication interface 1401 is capable of exchanging information with other network nodes;
[0262] The first processor 1402 is connected to the first communication interface 1401 to enable information interaction with other network nodes. When running a computer program, it executes the methods provided by one or more technical solutions on the first node side. The computer program is stored in the first memory 1403.
[0263] Specifically, the first processor 1402 is used to perform load balancing on the first data stream based on the first identifier carried by the packets of the first data stream; wherein, the first identifier indicates the packet container to which the packet belongs, packets in the same packet container carry the same first identifier, and packets in different packet containers carry different first identifiers.
[0264] In one embodiment, the first processor 1402 is specifically configured to determine the hash value of the message based on the first information and the first identifier carried by the message; the first information represents the relevant information of the first data stream; and based on the hash value of the message, to perform load balancing on the first data stream on multiple member ports of multiple message forwarding paths and / or aggregation interfaces.
[0265] In one embodiment, the first processor 1402 is further configured to divide the packets of the first data stream into multiple packet containers.
[0266] In one embodiment, the first processor 1402 is specifically configured to divide the packets of the first data stream into multiple packet containers based on one or more of the following:
[0267] Number of messages;
[0268] Message transmission time length;
[0269] Message transmission duration;
[0270] Message length.
[0271] In one embodiment, the first communication interface 1401 is used to receive a message carrying a first identifier.
[0272] In one embodiment, the last message of each message container carries a second identifier.
[0273] It should be noted that the specific processing procedures of the first processor 1402 and the first communication interface 1401 can be understood by referring to the above method.
[0274] Of course, in practical applications, the various components in the first node 1400 are coupled together through the bus system 1404. It can be understood that the bus system 1404 is used to implement communication between these components. In addition to the data bus, the bus system 1404 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 14 The general designated all buses as Bus System 1404.
[0275] The first memory 1403 in this embodiment is used to store various types of data to support the operation of the first node 1400. Examples of such data include any computer program used to operate on the first node 1400.
[0276] The methods disclosed in the embodiments of this application can be applied to the first processor 1402, or implemented by the first processor 1402. The first processor 1402 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware or by instructions in the form of software in the first processor 1402. The first processor 1402 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The first processor 1402 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in the first memory 1403. The first processor 1402 reads the information in the first memory 1403 and completes the steps of the aforementioned method in combination with its hardware.
[0277] In an exemplary embodiment, the first node 1400 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned method.
[0278] Based on the hardware implementation of the above-described program modules, and in order to implement the method on the second node side of this application embodiment, this application embodiment also provides a second node, which represents an exit node or a tail node. In practical applications, the second node is the last node of the SRv6 path or tunnel. Figure 15 As shown, the second node 1500 includes:
[0279] The second communication interface 1501 is capable of exchanging information with other network nodes;
[0280] The second processor 1502 is connected to the second communication interface 1501 to enable information interaction with other network nodes. When running a computer program, it executes the methods provided by one or more technical solutions on the second node side. The computer program is stored in the second memory 1503.
[0281] Specifically, the second communication interface 1501 is used to receive messages of the first data stream. The message carries a first identifier, which indicates the message container to which the message belongs. Messages in the same message container carry the same first identifier, while messages in different message containers carry different first identifiers.
[0282] The second processor 1502 is used to reassemble and / or forward the packets of the first data stream based on the first identifier carried in the packet.
[0283] In one embodiment, the message also carries a second identifier, which indicates the last message in the message container to which the message belongs.
[0284] In one embodiment, the second processor 1502 is further configured to reassemble and / or forward the packets of the first data stream based on a first identifier and / or a second identifier carried in the packets.
[0285] In one embodiment, the second processor 1502 is specifically used to forward part or all of the messages of a message or message container when certain conditions are met.
[0286] In one embodiment, the second processor 1502 is specifically used for one or more of the following:
[0287] If the messages are not out of order, and / or the first identifier carried by the first message is the same as the first identifier recorded, the first message is forwarded directly; the first identifier recorded represents the first identifier carried by the most recently forwarded second message, or is updated based on the first identifier carried by the second message or the first identifier carried by the last cached message;
[0288] In the event of out-of-order packets, and / or, if the first identifier carried by the first packet differs from the recorded first identifier, the first packet is cached; the recorded first identifier represents the first identifier carried by the most recently forwarded second packet, or is updated based on the first identifier carried by the second packet or the first identifier carried by the last cached packet;
[0289] If the last message of the first message container is received, forward some or all of the messages of the first message container.
[0290] Upon receiving the last message of the first message container, forward some or all of the messages of the first message container and some or all of the cached messages of the second message container; wherein, in the first data stream, the messages of the second message container are located after the messages of the first message container;
[0291] If the timer times out, all cached packets are forwarded. The timer is started when packets are out of order.
[0292] In one embodiment, the second processor 1502 is further configured to include one or more of the following:
[0293] If the first identifier carried in the first message is different from the first identifier recorded, the timer is started.
[0294] Cancel the timer if the cache is empty;
[0295] Upon receiving the last message of the first message container, increment the first identifier of the record;
[0296] If the timer times out, the first identifier recorded will be updated to the first identifier carried by the last cached message.
[0297] In one embodiment, the timer count is greater than or equal to the maximum delay difference of the message forwarding path.
[0298] In one embodiment, the setting conditions include one or more of the following:
[0299] The first identifier carried in the received message is the same as the first identifier carried in the most recently forwarded message;
[0300] The most recently forwarded message is not the last message in the message container;
[0301] The last message in the message container has been received;
[0302] The timer times out, and the timer is started in the event of out-of-order messages.
[0303] It should be noted that the specific processing procedures of the second processor 1502 and the second communication interface 1501 can be understood by referring to the above method.
[0304] Of course, in practical applications, the various components in the second node 1500 are coupled together through the bus system 1504. It can be understood that the bus system 1504 is used to implement communication between these components. In addition to the data bus, the bus system 1504 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 15 The general labeled all buses as Bus System 1504.
[0305] The second memory 1503 in this embodiment is used to store various types of data to support the operation of the second node 1500. Examples of such data include any computer program used to operate on the second node 1500.
[0306] The methods disclosed in the embodiments of this application can be applied to, or implemented by, the second processor 1502. The second processor 1502 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by the integrated logic circuitry of the hardware or by instructions in the form of software within the second processor 1502. The second processor 1502 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The second processor 1502 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, specifically a second memory 1503. The second processor 1502 reads information from the second memory 1503 and, in conjunction with its hardware, completes the steps of the aforementioned method.
[0307] In an exemplary embodiment, the second node 1500 may be implemented by one or more ASICs, DSPs, PLDs, CPLDs, FPGAs, general-purpose processors, controllers, MCUs, microprocessors, or other electronic components to perform the aforementioned method.
[0308] It is understood that the memories (first memory 1403 and second memory 1503) in the embodiments of this application can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be 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), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memories.
[0309] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a first memory 1403 storing a computer program, which can be executed by a first processor 1402 of a first node 1400 to complete the steps described in the aforementioned first node-side method. Another example is a second memory 1503 storing a computer program, which can be executed by a second processor 1502 of a second node 1500 to complete the steps described in the aforementioned second node-side method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.
[0310] By way of example, this application also provides a computer program product, including a computer program that can be executed by a first processor 1402 of a first node 1400 to complete the steps described in the aforementioned first node-side method. The computer program can also be executed by a second processor 1502 of a second node 1500 to complete the steps described in the aforementioned second node-side method.
[0311] It should be noted that terms such as "first" and "second" are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. "Multiple" can refer to two or more items, and "multiple" can refer to two or more items. The term "and / or" in this document merely describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, the term "one or more" in this document refers to any combination of at least two of the multiple elements. For example, including one or more of A, B, and C can represent including any one or at least two or more elements selected from the set consisting of A, B, and C.
[0312] Furthermore, the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.
[0313] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application.
Claims
1. A load sharing method, characterized by, The method applied to a first node comprises: performing load sharing on a first data stream based on a first identifier carried by a packet of the first data stream; wherein the first identifier indicates a packet container to which the packet belongs, packets of a same packet container carry a same first identifier, and packets of different packet containers carry different first identifiers; the first identifier is used by a second node to determine whether to directly forward or cache a packet of the first data stream, so that the second node directly forwards a first packet in a case where a first identifier carried by the first packet is same as a recorded first identifier, and / or caches the first packet in a case where the first identifier carried by the first packet is different from the recorded first identifier, and / or forwards part or all of packets of a first packet container and part or all of packets of a second packet container cached in a case where a last packet of the first packet container is received; wherein a packet of the second packet container is located after a packet of the first packet container in the first data stream; the first packet is any packet of the first data stream; the recorded first identifier represents a first identifier carried by a second packet that is lastly forwarded, or is updated based on a first identifier carried by a last packet cached.
2. The method of claim 1, wherein, The method of performing load sharing on the first data stream based on the first identifier carried by the packet of the first data stream comprises: determining a hash value of the packet based on first information and the first identifier carried by the packet; the first information represents related information of the first data stream; performing load sharing on the first data stream on a plurality of packet forwarding paths and / or a plurality of member ports of an aggregation interface based on the hash value of the packet.
3. The method of claim 1, wherein, The method further comprises: dividing the packet of the first data stream into a plurality of packet containers.
4. The method of claim 1, wherein, The method further comprises: dividing the packet of the first data stream into a plurality of packet containers based on one or more of the following: a number of packets; a length of a packet sending time; a packet sending time length; a packet length.
5. The method of claim 1, wherein, The method further comprises: receiving the packet carrying the first identifier.
6. The method according to any one of claims 1 to 5, characterized in that, a last packet of each packet container carries a second identifier.
7. A load sharing method characterized by, The method applied to a second node comprises: receiving a packet of a first data stream, the packet carrying a first identifier, the first identifier indicating a packet container to which the packet belongs, packets of a same packet container carrying a same first identifier, and packets of different packet containers carrying different first identifiers; performing reorganization and forwarding on the packet of the first data stream based on the first identifier carried by the packet; wherein the forwarding on the packet of the first data stream comprises one or more of the following: directly forwarding a first packet in a case where a first identifier carried by the first packet is same as a recorded first identifier; the recorded first identifier represents a first identifier carried by a second packet that is lastly forwarded, or is updated based on a first identifier carried by a last packet cached; caching the first packet in a case where the first identifier carried by the first packet is different from the recorded first identifier; the recorded first identifier represents a first identifier carried by a second packet that is lastly forwarded, or is updated based on a first identifier carried by a last packet cached; forwarding part or all of the first message container and part or all of the buffered second message container in a case where a last message of the first message container is received; wherein the messages of the second message container are located after the messages of the first message container in the first data stream.
8. The method of claim 7, wherein, The message further carries a second identifier, the second identifier indicating a last message of a message container to which the message belongs.
9. The method of claim 8, wherein, The method further comprises: reorganizing and forwarding the messages of the first data stream based on the first identifier and the second identifier carried by the messages.
10. The method of claim 7, wherein, The method further comprises one or more of: starting a timer in a case where the first identifier carried by the first message is different from the recorded first identifier; canceling the timer in a case where the buffer is empty; incrementing the recorded first identifier in a case where a last message of the first message container is received; updating the recorded first identifier to the first identifier carried by the last message of the buffer in a case where the timer times out.
11. The method according to claim 7 or 10, characterized in that, The count value of the timer is greater than or equal to a maximum delay difference of a message forwarding path.
12. A load sharing device, characterized by Comprise: a first processing unit configured to load share the first data stream based on a first identifier carried by the messages of the first data stream; wherein the first identifier indicates a message container to which the message belongs, the messages of a same message container carry a same first identifier, and the messages of different message containers carry different first identifiers; the first identifier is used by the second node to determine whether to directly forward or buffer the messages of the first data stream, so that the second node directly forwards a first message in a case where the first identifier carried by the first message is same as a recorded first identifier, and / or buffers the first message in a case where the first identifier carried by the first message is different from the recorded first identifier, and / or forwards part or all of the first message container and part or all of the buffered second message container in a case where a last message of the first message container is received; wherein the messages of the second message container are located after the messages of the first message container in the first data stream; the first message is any message of the first data stream, the recorded first identifier represents the first identifier carried by a second message that is most recently forwarded, or is updated based on the first identifier carried by the last message of the buffer.
13. A load sharing device, characterized by Comprise: a first receiving unit configured to receive the messages of the first data stream, the messages carrying a first identifier, the first identifier indicating a message container to which the message belongs, the messages of a same message container carrying a same first identifier, and the messages of different message containers carrying different first identifiers; a second processing unit configured to reorganize and forward the messages of the first data stream based on the first identifier carried by the messages; wherein the second processing unit is specifically configured to one or more of: directly forwarding a first message in a case where the first identifier carried by the first message is same as a recorded first identifier; the recorded first identifier represents the first identifier carried by a second message that is most recently forwarded, or is updated based on the first identifier carried by the last message of the buffer. In a case where the first identifier carried by the first packet is different from the recorded first identifier, the first packet is cached; the recorded first identifier represents the first identifier carried by the second packet that is forwarded last time, or is updated based on the first identifier carried by the last cached packet; In a case where the last packet of the first packet container is received, part or all of the packets of the first packet container and part or all of the packets of the cached second packet container are forwarded; wherein, in the first data stream, the packets of the second packet container are located after the packets of the first packet container.
14. A first node, characterized by Comprise: A first processor and a first communication interface; wherein, The first processor is configured to perform load sharing on the packets of the first data stream based on the first identifier carried by the packets; wherein, The first identifier indicates the packet container to which the packet belongs, the packets of the same packet container carry the same first identifier, and the packets of different packet containers carry different first identifiers; The first identifier is used by the second node to determine whether to directly forward or cache the packets of the first data stream, so that the second node directly forwards the first packet in a case where the first identifier carried by the first packet is the same as the recorded first identifier, and / or caches the first packet in a case where the first identifier carried by the first packet is different from the recorded first identifier, and / or forwards part or all of the packets of the first packet container and part or all of the packets of the cached second packet container in a case where the last packet of the first packet container is received; wherein, in the first data stream, the packets of the second packet container are located after the packets of the first packet container; the first packet is any packet of the first data stream, the recorded first identifier represents the first identifier carried by the second packet that is forwarded last time, or is updated based on the first identifier carried by the last cached packet.
15. A second node, comprising: Comprise: A second processor and a second communication interface; wherein, The second communication interface is configured to receive the packets of the first data stream, and the packets carry the first identifier, the first identifier indicates the packet container to which the packet belongs, the packets of the same packet container carry the same first identifier, and the packets of different packet containers carry different first identifiers; The second processor is configured to perform reorganization and forwarding on the packets of the first data stream based on the first identifier carried by the packets; wherein, the second processor is specifically configured to perform one or more of the following: In a case where the first identifier carried by the first packet is the same as the recorded first identifier, the first packet is directly forwarded; the recorded first identifier represents the first identifier carried by the second packet that is forwarded last time, or is updated based on the first identifier carried by the last cached packet; In a case where the first identifier carried by the first packet is different from the recorded first identifier, the first packet is cached; the recorded first identifier represents the first identifier carried by the second packet that is forwarded last time, or is updated based on the first identifier carried by the last cached packet; In a case where the last packet of the first packet container is received, part or all of the packets of the first packet container and part or all of the packets of the cached second packet container are forwarded; wherein, in the first data stream, the packets of the second packet container are located after the packets of the first packet container. In a case that a last packet of the first packet container is received, forwarding part or all of the packets of the first packet container and part or all of the packets of the buffered second packet container; wherein the packets of the second packet container are located after the packets of the first packet container in the first data stream.
16. A network node, characterized by: The network node comprises a first node or a second node, the network node comprises a processor and a memory for storing a computer program capable of running on the processor, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6, or to implement the steps of the method of any one of claims 7 to 11.
17. A storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6, or to implement the steps of the method of any one of claims 7 to 11.
18. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 11.
Citation Information
Patent Citations
Message transmission method and device
CN111654447A
Data transmission method and device
CN114189474A