Data transmission path determination method and device, computer equipment, storage medium and computer program product

By receiving IPv6 data packets in an Ethernet virtual private network environment, extracting identification tuples to generate hash values, and selecting target paths, the problem of low data transmission efficiency in existing technologies is solved, load balancing and efficient utilization of network resources are achieved, and the network's fault tolerance and security are enhanced.

CN120750848APending Publication Date: 2025-10-03CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510924703.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-04
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

Existing equal-cost multi-path routing technology cannot directly process Ethernet frames in Ethernet virtual private network environments, resulting in low data transmission efficiency and lack of effective redundancy mechanism, which affects network resource utilization and service quality.

Method used

By receiving IPv6 data packets, extracting identification tuples to generate hash values, selecting the target path according to the routing table, directly processing Ethernet frames and forwarding them to the destination terminal, using hash values ​​to achieve unique identification and fast indexing of IPv6 data packets, and selecting the most appropriate equal-cost path for forwarding.

Benefits of technology

It improves the data transmission efficiency in the Ethernet virtual private network environment, realizes load balancing and efficient utilization of network resources, and enhances the network's fault tolerance and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120750848A_ABST
    Figure CN120750848A_ABST
Patent Text Reader

Abstract

The invention relates to a data transmission path determination method and device, computer equipment, a storage medium and a computer program product. Relates to the technical field of computer networks. The method comprises the following steps: receiving an IPv6 data packet sent by a first terminal; ethernet frames sent to the second terminal by the first terminal are packaged in the IPv6 data packet; extracting an identification tuple of the IPv6 data packet from the IPv6 data packet; the identification tuple is a parameter set used for identifying the IPv6 data packet; generating a hash value according to the identification tuple, and determining a corresponding routing table according to the prefix of the network address of the second terminal; selecting a target path from a plurality of equal-cost paths contained in a routing table according to the hash value; and forwarding the IPv6 data packet to the second terminal through the target path. By adopting the method, the efficiency of data transmission in an Ethernet virtual private network environment by an equal-cost multi-path routing technology can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer network technology, and in particular to a method, apparatus, computer device, storage medium, and computer program product for determining a data transmission path. Background Art

[0002] The ever-increasing network traffic has brought about an increasing demand for network bandwidth. The current single-path routing technology cannot effectively utilize the bandwidth resources provided by multiple parallel links when the network is congested, resulting in low network resource utilization. In addition, there is a lack of redundancy mechanism in the event of network failure, and the service quality cannot be guaranteed after the main path fails.

[0003] To address the shortcomings of single-path routing, equal-cost multi-path routing (ECMP) has emerged. However, current ECMP technology is primarily designed for IP (Internet Protocol) networks. When applied to Ethernet VPNs, it faces compatibility and efficiency issues. For example, current ECMP technology cannot directly process Ethernet frames and requires additional encapsulation and decapsulation mechanisms, increasing network complexity and latency, and impacting data transmission efficiency. Consequently, ECMP suffers from low data transmission efficiency in Ethernet VPNs. Summary of the Invention

[0004] Based on this, it is necessary to provide a data transmission path determination method, device, computer equipment, computer-readable storage medium and computer program product to address the technical problem of low data transmission efficiency of the above-mentioned equal-cost multi-path routing technology in the Ethernet virtual private network environment.

[0005] In a first aspect, the present application provides a method for determining a data transmission path, applied to a router, the method comprising:

[0006] Receiving an IPv6 data packet sent by a first terminal; the IPv6 data packet encapsulates an Ethernet frame sent by the first terminal to a second terminal;

[0007] Extracting an identification tuple of the IPv6 data packet from the IPv6 data packet; the identification tuple is a parameter set for identifying the IPv6 data packet;

[0008] generating a hash value according to the identification tuple, and determining a corresponding routing table according to the prefix of the network address of the second terminal;

[0009] According to the hash value, a target path is selected from a plurality of equal-cost paths included in the routing table; and the IPv6 data packet is forwarded to the second terminal via the target path.

[0010] In one embodiment, selecting a target path from a plurality of equal-cost paths included in the routing table according to the hash value includes: obtaining a first value according to the hash value and the number of the plurality of equal-cost paths in the routing table; obtaining a second value by obtaining the sum of the first value and a preset equal-cost path offset value; and querying a mapping relationship between a plurality of pre-configured values ​​and indexes of a plurality of equal-cost paths to obtain an index of an equal-cost path that matches the second value, and the equal-cost path corresponding to the index is the target path.

[0011] In one embodiment, generating a hash value based on the identification tuple includes: splicing multiple elements in the identification tuple based on a preset splicing order to obtain a splicing sequence; and processing the splicing sequence based on a hash algorithm to generate the hash value.

[0012] In one embodiment, processing the spliced ​​sequence based on a hash algorithm to generate the hash value includes: converting the spliced ​​sequence into a binary format based on the hash algorithm, right-shifting the sequence, and obtaining the shifted value of the spliced ​​sequence in the binary format; and obtaining an exclusive OR result of the spliced ​​sequence in the binary format and the shifted value as the hash value.

[0013] In one embodiment, the identification tuple includes: a source IPv6 address prefix, a source virtual network identifier, a source MAC address, a destination IPv6 address prefix, a destination virtual network identifier, and a destination MAC address; the first terminal corresponds to the source MAC address, and the source MAC address corresponds one-to-one to the source IPv6 address prefix; the second terminal corresponds to the destination MAC address, and the destination MAC address corresponds one-to-one to the destination IPv6 address prefix.

[0014] In one embodiment, after extracting the identification tuple of the IPv6 data packet from the IPv6 data packet, it also includes: deleting symbols in the source MAC address and the destination MAC address to obtain character strings of the source MAC address and the destination MAC address respectively; converting the character strings into integer form, and using the source MAC address and the destination MAC address in the integer form as elements of the identification tuple to generate the hash value.

[0015] In a second aspect, the present application further provides a data transmission path determination device, comprising:

[0016] A data receiving module, configured to receive an IPv6 data packet sent by a first terminal; the IPv6 data packet encapsulates an Ethernet frame sent by the first terminal to a second terminal;

[0017] A data extraction module, configured to extract an identification tuple of the IPv6 data packet from the IPv6 data packet; the identification tuple is a parameter set for identifying the IPv6 data packet;

[0018] a routing table determination module, configured to generate a hash value according to the identification tuple, and determine a corresponding routing table according to the prefix of the network address of the second terminal;

[0019] A target path determination module is configured to select a target path from a plurality of equal-cost paths included in the routing table according to the hash value; and forward the IPv6 data packet to the second terminal via the target path.

[0020] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0021] Receiving an IPv6 data packet sent by a first terminal; the IPv6 data packet encapsulates an Ethernet frame sent by the first terminal to a second terminal;

[0022] Extracting an identification tuple of the IPv6 data packet from the IPv6 data packet; the identification tuple is a parameter set for identifying the IPv6 data packet;

[0023] generating a hash value according to the identification tuple, and determining a corresponding routing table according to the prefix of the network address of the second terminal;

[0024] According to the hash value, a target path is selected from a plurality of equal-cost paths included in the routing table; and the IPv6 data packet is forwarded to the second terminal via the target path.

[0025] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the following steps:

[0026] Receiving an IPv6 data packet sent by a first terminal; the IPv6 data packet encapsulates an Ethernet frame sent by the first terminal to a second terminal;

[0027] Extracting an identification tuple of the IPv6 data packet from the IPv6 data packet; the identification tuple is a parameter set for identifying the IPv6 data packet;

[0028] generating a hash value according to the identification tuple, and determining a corresponding routing table according to the prefix of the network address of the second terminal;

[0029] According to the hash value, a target path is selected from a plurality of equal-cost paths included in the routing table; and the IPv6 data packet is forwarded to the second terminal via the target path.

[0030] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the following steps:

[0031] Receiving an IPv6 data packet sent by a first terminal; the IPv6 data packet encapsulates an Ethernet frame sent by the first terminal to a second terminal;

[0032] Extracting an identification tuple of the IPv6 data packet from the IPv6 data packet; the identification tuple is a parameter set for identifying the IPv6 data packet;

[0033] generating a hash value according to the identification tuple, and determining a corresponding routing table according to the prefix of the network address of the second terminal;

[0034] According to the hash value, a target path is selected from a plurality of equal-cost paths included in the routing table; and the IPv6 data packet is forwarded to the second terminal via the target path.

[0035] The above-mentioned data transmission path determination method, apparatus, computer device, storage medium and computer program product, in the process of determining the data transmission path, receives an IPv6 data packet sent by a first terminal; the IPv6 data packet encapsulates an Ethernet frame sent by the first terminal to a second terminal; then extracts an identification tuple of the IPv6 data packet from the IPv6 data packet; the identification tuple is a parameter set used to identify the IPv6 data packet; then generates a hash value based on the identification tuple, and determines a corresponding routing table based on the prefix of the network address of the second terminal; finally, selects a target path from multiple equal-cost paths contained in the routing table based on the hash value; and forwards the IPv6 data packet to the second terminal via the target path. In the above process, by extracting the identification tuple and generating the hash value, the unique identification and rapid indexing of the IPv6 data packet can be efficiently achieved, reducing forwarding delay; by selecting the most appropriate path from multiple equal-cost paths, network utilization can be improved; by utilizing the dispersion of the paths corresponding to the hash values, load balancing can be achieved, avoiding path overload; therefore, the above process improves the data transmission efficiency of equal-cost multi-path routing technology in an Ethernet virtual private network environment by utilizing reasonable path selection and rapid data packet identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0037] Figure 1 A diagram illustrating an application environment of a method for determining a data transmission path in an embodiment;

[0038] Figure 2 Schematic diagram of a flow chart of a method for determining a data transmission path in one embodiment;

[0039] Figure 3 A schematic flow chart of a data transmission path determination step in one embodiment;

[0040] Figure 4 A schematic flow chart of a method for determining a data transmission path according to another embodiment;

[0041] Figure 5 A schematic diagram of a simulated network environment for a method for determining a data transmission path in one embodiment;

[0042] Figure 6 A flowchart of a hash function calculation method for determining a data transmission path in one embodiment;

[0043] Figure 7 It is a structural block diagram of a data transmission path determination device in one embodiment;

[0044] Figure 8 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0046] With the development of the internet, network traffic is increasing, and the demand for network bandwidth is also growing. Traditional single-path routing technologies often fail to effectively utilize the bandwidth resources provided by multiple parallel links in the event of network congestion, resulting in low network resource utilization. Furthermore, single-path routing lacks effective redundancy mechanisms in the face of network failures. If the primary path fails, service quality will be severely affected. To overcome these issues, ECMP (Equal-Cost Multi-Path Routing) technology has emerged. It allows packets to be transmitted along multiple paths, thereby improving bandwidth utilization and network fault tolerance.

[0047] However, existing ECMP technology is primarily designed for Internet Protocol (IP) networks. When dealing with Ethernet virtual private networks (VPNs), such as EVN6 (Ethernet Virtual Networks in IPv6 networks), it cannot directly process Ethernet frames. It requires additional encapsulation and decapsulation mechanisms, resulting in compatibility and efficiency deficiencies, and increased network complexity and latency.

[0048] Furthermore, as enterprises increase their demand for network security and isolation, virtual private network (VPN) technology is becoming increasingly important. Ethernet Virtual Private Network (EVN6) enables virtual Ethernet connections between multiple sites by encapsulating Ethernet data frames within IPv6 packets. However, how to efficiently implement equal-cost multipath routing in an EVN6 environment while ensuring data transmission efficiency remains a pressing issue.

[0049] Furthermore, in this application, EVN6 (Ethernet Virtual Networks in IPv6 networks) is a technology for carrying multi-site virtual Ethernet private networks in IPv6 networks. It directly encapsulates the Ethernet data frames to be transmitted in IPv6 data packets and transmits the Ethernet frames to the destination site through the IPv6 network; ECMP (Equal-Cost Multi-Path Routing) is a network routing technology used to select multiple paths with the same cost (i.e., path overhead or weight) in the network to forward data packets.

[0050] In order to solve the above technical problems, the present invention provides a method for determining a data transmission path, which can be applied to Figure 1In the application environment shown, router 101 receives an IPv6 data packet sent by first terminal 102; the IPv6 data packet encapsulates an Ethernet frame sent by first terminal 102 to second terminal 103; router 101 then extracts an identification tuple of the IPv6 data packet from the IPv6 data packet; the identification tuple is a set of parameters used to identify the IPv6 data packet; a hash value is generated based on the identification tuple, and a corresponding routing table is determined based on the prefix of the network address of the second terminal; finally, router 101 selects a target path from multiple equal-cost paths included in the routing table based on the hash value; and forwards the IPv6 data packet to second terminal 103 via the target path.

[0051] In an exemplary embodiment, Figure 2 As shown, a method for determining a data transmission path is provided, which is applied to Figure 1 The router 101 in FIG. 1 is taken as an example to illustrate the process, including the following steps S202 to S208. In which:

[0052] Step S202: Receive an IPv6 data packet sent by the first terminal; the IPv6 data packet encapsulates an Ethernet frame sent by the first terminal to the second terminal.

[0053] Among them, the IPv6 data packet sent by the first terminal is received to obtain the original data; the IPv6 data packet is encapsulated in the Ethernet protocol format as the payload of the Ethernet frame and transmitted, which can realize data transmission on the local area network or link layer, and ensure that the IPv6 data packet can flow between different network devices.

[0054] Step S204: extracting an identification tuple of the IPv6 data packet from the IPv6 data packet; the identification tuple is a parameter set used to identify the IPv6 data packet.

[0055] Among them, extracting the identification tuple of the IPv6 data packet is to extract a group of parameters from the IPv6 data packet header, such as source address, destination address, etc., which together constitute the identification tuple; the identification tuple is composed of key parameters in the IPv6 data packet and is used to uniquely identify the IPv6 data packet.

[0056] Step S206: Generate a hash value according to the identification tuple, and determine a corresponding routing table according to the prefix of the network address of the second terminal.

[0057] Among them, generating a hash value is to apply a hash algorithm to the identification tuple to obtain a hash code of fixed length, which can be used to improve search efficiency and achieve load balancing and uniform distribution of paths; determining the routing table based on the network address prefix of the second terminal is through the prefix of the target IPv6 address, and searching the corresponding routing table or path set, which can be used to implement path classification and management, and support multi-path selection and routing strategies; the routing table can include multiple equal-cost paths, next-hop addresses, path priorities, path labels, outbound interfaces, and multi-path related information (such as path group numbers, path sets, etc.).

[0058] Step S208: Select a target path from a plurality of equal-cost paths included in the routing table according to the hash value; and forward the IPv6 data packet to the second terminal via the target path.

[0059] Selecting a target path from the routing table involves selecting a specific path from multiple equal-cost paths based on a hash value. This can be used to improve network resource utilization. Forwarding IPv6 packets via the target path involves transmitting the IPv6 packets to the second terminal via the selected path, enabling the second terminal to reliably and quickly receive the IPv6 packets.

[0060] In the above-mentioned data transmission path determination method, during the data transmission path determination process, an IPv6 data packet sent by a first terminal is received; the IPv6 data packet encapsulates an Ethernet frame sent by the first terminal to a second terminal; then, an identification tuple of the IPv6 data packet is extracted from the IPv6 data packet; the identification tuple is a parameter set used to identify the IPv6 data packet; a hash value is generated based on the identification tuple, and a corresponding routing table is determined based on the prefix of the network address of the second terminal; finally, a target path is selected from multiple equal-cost paths contained in the routing table based on the hash value; and the IPv6 data packet is forwarded to the second terminal via the target path. In the above process, by extracting the identification tuple and generating the hash value, unique identification and rapid indexing of the IPv6 data packet can be efficiently achieved, thereby reducing forwarding delay; by selecting the most appropriate path from multiple equal-cost paths, network utilization can be improved; by utilizing the dispersion of the paths corresponding to the hash values, load balancing can be achieved, thereby avoiding path overload; therefore, the above process improves the data transmission efficiency of equal-cost multi-path routing technology in an Ethernet virtual private network environment by utilizing reasonable path selection and rapid data packet identification.

[0061] In an exemplary embodiment, selecting a target path from a plurality of equal-cost paths included in a routing table according to a hash value includes:

[0062] A first value is obtained based on the hash value and the number of multiple equal-cost paths in the routing table; a second value is obtained by obtaining the sum of the first value and a preset equal-cost path offset value; a mapping relationship between multiple pre-configured values ​​and indexes of multiple equal-cost paths is queried to obtain the index of the equal-cost path that matches the second value, and the equal-cost path corresponding to the index is the target path.

[0063] Among them, the multiple equal-cost paths in the routing table are a collection of multiple paths with the same transmission cost. Each path can be used as an alternative path, which can be used to provide diverse forwarding paths, improve network redundancy and load distribution capabilities, and support flexibility in path selection; the first value is a value calculated by an algorithm based on the hash value and the number of paths in the routing table, which can be used to map the hash value to the path index range; the preset equal-cost path offset value is a predefined or configured offset used to adjust the offset or deviation of the path selection; the second value is the result of adding the first value to the preset offset value, which can be used as the index value of the path index and used to find the corresponding path in the mapping relationship; the mapping relationship is a pre-configured association table that maps the second value to the path index.

[0064] In this embodiment, through hash value calculation and offset adjustment, network traffic can be evenly distributed to prevent overload of a certain path; the preset offset value can adjust the path selection strategy to adapt to the needs of different scenarios; and the mapping relationship is used to quickly find the corresponding path, reducing search time and improving efficiency.

[0065] Furthermore, in an exemplary embodiment, generating a hash value according to the identification tuple includes:

[0066] Based on a preset splicing order, multiple elements in the identification tuple are spliced ​​to obtain a splicing sequence; and the splicing sequence is processed based on a hash algorithm to generate a hash value.

[0067] Among them, the preset splicing order is a predefined element splicing order, which is used to combine multiple elements in a specific order; splicing multiple elements in the identification tuple is to splice the multiple elements contained in the identification tuple into a continuous string or sequence in a preset order, which can be used to combine multiple elements to form a unique identifier, and can also lay the foundation for the calculation of the hash value; the hash value is a fixed-length string or number output by the hash algorithm.

[0068] In this embodiment, by splicing multiple elements into a unique sequence and quickly indexing them through hash values, the time for identification and matching can be greatly shortened, and the network processing speed can be improved; and by splicing the elements in a preset order and then performing hash processing, a highly unique identifier can be generated to avoid conflicts and ensure the uniqueness and traceability of each data packet; further, using the hash value as the basis for path selection helps to evenly distribute network traffic, avoid overload of specific paths, and achieve load balancing, thereby reducing the time for routing calculation and improving data transmission efficiency through precise identification and fast path indexing.

[0069] Furthermore, in an exemplary embodiment, processing the concatenated sequence based on a hash algorithm to generate a hash value includes:

[0070] Based on the hash algorithm, the concatenated sequence is converted into a binary format and then right-shifted to obtain the shifted value of the concatenated sequence in the binary format; and an exclusive OR result of the concatenated sequence in the binary format and the shifted value is obtained as a hash value.

[0071] Among them, converting the concatenated sequence into binary format is to encode the sequence formed by splicing multiple elements into binary representation; right shift is to shift all the bits of the binary number to the right by several bits, such as 3 bits, 5 bits, etc., and the shifted part will be discarded. The size or position of the binary number can be adjusted, and the introduction of bit-level transformation can increase the complexity and randomness of the hash; the XOR result is a bit-by-bit operation, comparing the two binary numbers bit by bit, the same is 0, and the different is 1, generating a new binary number, which can be used as the final hash value, combining the characteristics of the original sequence and the shifted sequence, and enhancing the randomness and dispersion of the hash.

[0072] In this embodiment, binary right shift and XOR operation help disrupt the bit structure of the original sequence, reduce hash conflicts, and improve the uniform distribution of data; by combining offset and XOR operation, the generated hash value has stronger differences, reducing the probability of different data generating the same hash value; and improving the efficiency of path selection and data identification.

[0073] In one embodiment, the identification tuple includes: a source IPv6 address prefix, a source virtual network identifier, a source MAC address, a destination IPv6 address prefix, a destination virtual network identifier, and a destination MAC address; the first terminal corresponds to the source MAC address, and the source MAC address corresponds one-to-one to the source IPv6 address prefix; the second terminal corresponds to the destination MAC address, and the destination MAC address corresponds one-to-one to the destination IPv6 address prefix.

[0074] Among them, the source IPv6 address prefix is ​​the network part of the source IPv6 address, which is used to identify the source network; the source virtual network identifier is an identifier that indicates the virtual network or virtual domain to which the source terminal belongs; the source MAC address is the address of the source terminal in the local area network, which is used to correspond one-to-one with the IPv6 prefix to ensure uniqueness and traceability; the destination IPv6 address prefix is ​​the network part of the target IPv6 address; the destination virtual network identifier is the virtual network identifier to which the destination terminal belongs; the destination MAC address is the hardware address of the destination terminal in the local area network; the one-to-one correspondence relationship is that the source MAC address and the source IPv6 address prefix correspond to each other, representing different identities of the same terminal, which can ensure that each terminal has a unique and traceable identifier, support the association management of the link layer and the network layer, and facilitate path control.

[0075] In this embodiment, a unique identifier is jointly constructed through a set of multiple parameters (IPv6 prefix, virtual network identifier, MAC address) to ensure that each network flow can be accurately identified and distinguished; the MAC address of the link layer and the IPv6 address of the network layer are combined to achieve seamless association between the link layer and the network layer, which facilitates traffic tracking, policy application and troubleshooting; the virtual network identifier is used to distinguish terminals and flows in different virtual networks to facilitate access control. Therefore, by defining multiple closely related identification parameters, the security of network operations and the efficiency of data transmission are improved.

[0076] In an exemplary embodiment, after extracting the identification tuple of the IPv6 data packet from the IPv6 data packet, the method further includes:

[0077] Delete the symbols in the source MAC address and the destination MAC address to obtain the strings of the source MAC address and the destination MAC address respectively; convert the strings into integers, and use the source MAC address and the destination MAC address in the integer form as elements of the identification tuple to generate a hash value.

[0078] Among them, deleting symbols in the source MAC address and destination MAC address is to remove the symbols used to separate fields in the MAC address, which is used to convert the MAC address into a continuous pure string, facilitate subsequent standardized processing, improve the processing efficiency of the string, and avoid symbol interference; and by deleting symbols, the MAC address is converted into a unified pure string form, eliminating the differences between different representation methods, improving processing efficiency and speed, and after the MAC address string is converted into an integer, numerical operations are more efficient than string operations, which is conducive to fast calculation and hash processing, especially in a large amount of data environment, it can significantly improve efficiency; in addition, the hash value can be used as a fast index basis for network path selection, load balancing and flow classification, improving the response speed of network processing and the efficiency of data transmission.

[0079] Furthermore, in one embodiment, Figure 3As shown, the above-mentioned data transmission path determination method may further include the following steps:

[0080] Step S302: Place the Ethernet data frame to be transmitted into an IPv6 data packet.

[0081] Among them, the Ethernet data frame to be transmitted can be directly placed in the payload of the IPv6 data packet, and the host's MAC address is mapped to the address of the outer encapsulated IPv6 data packet. There is a one-to-one relationship between the MAC address and the IPv6 address; the payload is the effective load in the data packet or frame, which is the user data part actually transmitted.

[0082] Step S304: The router receives the IPv6 data packet and searches the routing table according to the target network to determine a next-hop address set.

[0083] The target network corresponds to the network prefix of the second terminal, and after the data message (IPv6 data packet) arrives, the data packet is parsed to extract the IPv6 header information and Ethernet frame information.

[0084] Step S306: Determine the index of the first next hop in the equal-cost multi-path routing group according to the base value in the routing table.

[0085] The route table lookup includes searching for the route entry of the target network (second terminal), obtaining the next-hop address set, and obtaining the path cost. Furthermore, an ECMP base value needs to be determined.

[0086] Step S308: extracting the phase factor from the IPv6 data packet.

[0087] The phase factor corresponds to the above-mentioned identification tuple, including the source IPv6 address prefix, the source virtual network identifier, the source MAC address, the destination IPv6 address prefix, the destination virtual network identifier, and the destination MAC address.

[0088] Step S310: sequentially concatenate the extracted phase factors into a large input value, and generate a hash value through hash calculation.

[0089] Specifically, the calculation method may be to use XOR (exclusive OR) and other bit operations.

[0090] Step S312: performing a remainder operation on the hash value and the number of members in the equal-cost multi-path routing group, and adding the remainder result to the base value of the equal-cost multi-path routing to obtain a final next-hop index.

[0091] Among them, the number of members in the equal cost multi-path routing group is predefined, and the base value of the equal cost multi-path routing corresponds to the above-mentioned preset equal cost path offset value; and the number of ECMP group members can be modulo the hash value, the modulo result can be added to the ECMP base value, and the next hop address can be selected according to the calculated index.

[0092] Step S314: Select a corresponding next-hop IPv6 address from the equal-cost multi-path routing group according to the calculated next-hop index.

[0093] After the next hop address is determined, the data packet is sent to the selected next hop address.

[0094] In the above embodiments, by combining EVN6 technology and ECMP, network resources can be utilized more effectively and network bandwidth utilization can be improved; the multi-path routing mechanism improves the fault tolerance of the network, and even if a path fails, other paths can continue to work; the one-to-one mapping of MAC addresses and IPv6 addresses simplifies network configuration and reduces the complexity of network management; adding virtual network identifiers to IPv6 addresses achieves logical isolation, enhances network security and flexibility, and, by adjusting the phase factor and hash algorithm, multiple load balancing strategies can be implemented to meet the needs of different network scenarios.

[0095] This application provides a method for determining a data transmission path. In order to better understand the process of the above-mentioned method for determining a data transmission path, combined with Figure 4 As shown, the following describes in detail a specific process of the data transmission path determination method of the present application, combined with Figure 5 As shown in Figure 1, the network environment includes multiple routers and terminal devices (first terminal and second terminal). Routers E1 and E2 are responsible for forwarding data packets (IPv6 data packets). P is a core router. Suppose a data packet is sent from source host H1 (first terminal) to destination host H3 (second terminal). The data packet format is an Ethernet frame directly encapsulated in an IPv6 data packet. Router H1's routing table contains multiple next-hop addresses of equal cost. These addresses point to different physical paths, but all lead to the same destination node H3, as shown in Figure 1. Figure 5 Similarly, the routing table of router H2 (first terminal) contains multiple next-hop addresses with equal costs. These addresses point to different physical paths, but all lead to the same target node H4 (second terminal), such as Figure 5 B in the above. Specifically, the following steps may be included:

[0096] Step S402: Initialize the IPv6 data packet.

[0097] The IPv6 data packet includes the source IPv6 address prefix (SPref6): 2001::64; the source virtual network identifier (SVNI): 1000; the source MAC address (SMAC): 02:22:33:11:22:01; the destination IPv6 address prefix (DPref6): 2003::64; the destination virtual network identifier (DVNI): 1000; and the destination MAC address (DMAC): 02:22:33:11:22:03.

[0098] Step S404: extract and combine phase factors.

[0099] Among them, the phase factor corresponds to the above-mentioned identification tuple, and the process of extracting the phase factor can be: defining the function extract_fields(ipv6_packet), extracting the above-mentioned fields from the IPv6 data packet, and converting the MAC address into an integer form, and the process of combining the phase factor can be: defining the function combine_fields, splicing the extracted fields into a large integer in sequence.

[0100] Step S406: Perform hash calculation based on the combined phase factors to obtain a hash value.

[0101] The hash calculation may be composed of defining a function hash_function and using XOR (Exclusive OR) and bit shift operations to generate a hash value of a fixed length.

[0102] Specifically, the calculation process of the hash function can be as follows Figure 6 As shown, first, the combined phase factor, that is, the input value, is initialized. The input value can be converted into a binary format, and then the input value is right-shifted six times, and the input value and the value after each right shift are XORed, and finally the hash value is output.

[0103] Among them, the process of the first bit shift and XOR is: shift the input value right by 32 bits, XOR the input value with the right-shifted value to get the result, and then perform bitwise AND of the result with the corresponding mask 0×FFFFFFFFFFFFFFFF; the process of the second bit shift and XOR is: shift the input value right by 16 bits, XOR the input value with the right-shifted value to get the result, and then perform bitwise AND of the result with the corresponding mask 0×FFFFFFFF; the process of the third bit shift and XOR is: shift the input value right by 8 bits, XOR the input value with the right-shifted value to get the result, and then perform bitwise AND of the result with the corresponding mask 0×FFFFFFFF The mask 0×FFFF is bitwise ANDed; the process of the fourth bit shift and XOR is: shift the input value right by 4 bits, XOR the input value with the right-shifted value to obtain the result, and then bitwise AND the result with the corresponding mask 0×FF; the process of the fifth bit shift and XOR is: shift the input value right by 2 bits, XOR the input value with the right-shifted value to obtain the result, and then bitwise AND the result with the corresponding mask 0×3F; the process of the sixth bit shift and XOR is: shift the input value right by 1 bit, XOR the input value with the right-shifted value to obtain the result, and then bitwise AND the result with the corresponding mask 0×1F.

[0104] Step S408: Acquire a next hop index, and obtain a next hop address based on the next hop index.

[0105] Among them, the process of obtaining the next hop index may include: defining a function calculate_next_hop, performing a modulo operation on the generated hash value with the number of members in the ECMP group, and adding the base value to obtain the final next hop index; the process of obtaining the next hop address based on the next hop index may include: selecting the corresponding next hop IPv6 address from the ECMP group according to the calculated next hop index.

[0106] In the above embodiment, by generating a unique hash value according to the characteristics of the IPv6 data packet and selecting the appropriate next-hop address through the hash value, load balancing and effective utilization of network resources are achieved, and network performance and reliability are improved. This can not only effectively improve network bandwidth utilization and enhance network fault tolerance, but also ensure the quality of Ethernet virtual private network services, while simplifying the data transmission process and reducing network complexity. In addition, it also supports virtual network identification, realizes logical isolation, and enhances network security and flexibility. Moreover, it organically combines EVN6 technology with ECMP technology, directly encapsulates Ethernet data frames into IPv6 data packets, utilizes a one-to-one mapping between MAC addresses and IPv6 addresses, and combines an efficient hash algorithm to select one of multiple paths of equal cost as a data transmission path, thereby achieving the purpose of improving network efficiency and reliability.

[0107] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0108] Based on the same inventive concept, embodiments of the present application also provide a data transmission path determination device for implementing the aforementioned data transmission path determination method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations in one or more embodiments of the data transmission path determination device provided below can be found in the above-mentioned limitations of the data transmission path determination method and will not be further elaborated here.

[0109] In an exemplary embodiment, Figure 7 As shown, a data transmission path determination device is provided, comprising: a data receiving module 701, a data extraction module 702, a routing table determination module 703 and a target path determination module 704, wherein:

[0110] The data receiving module 701 is configured to receive an IPv6 data packet sent by a first terminal; the IPv6 data packet encapsulates an Ethernet frame sent by the first terminal to a second terminal.

[0111] The data extraction module 702 is used to extract the identification tuple of the IPv6 data packet from the IPv6 data packet; the identification tuple is a parameter set used to identify the IPv6 data packet.

[0112] The routing table determination module 703 is configured to generate a hash value according to the identification tuple, and determine a corresponding routing table according to the prefix of the network address of the second terminal.

[0113] The target path determination module 704 is configured to select a target path from a plurality of equal-cost paths included in the routing table according to the hash value, and forward the IPv6 data packet to the second terminal via the target path.

[0114] Furthermore, in one embodiment, the target path determination module 704 is also used to obtain a first value based on the hash value and the number of multiple equal-cost paths in the routing table; obtain the sum of the first value and a preset equal-cost path offset value to obtain a second value; query the mapping relationship between the pre-configured multiple values ​​and the indexes of multiple equal-cost paths to obtain the index of the equal-cost path that matches the second value, and the equal-cost path corresponding to the index is the target path.

[0115] Furthermore, in one embodiment, the routing table determination module 703 is further configured to concatenate multiple elements in the identification tuple based on a preset concatenation order to obtain a concatenated sequence; and process the concatenated sequence based on a hash algorithm to generate a hash value.

[0116] Furthermore, in one embodiment, the routing table determination module 703 is also used to convert the splicing sequence into a binary format based on a hash algorithm, right-shift the splicing sequence, and obtain the shifted value of the splicing sequence in the binary format; and obtain the XOR result of the splicing sequence in the binary format and the shifted value as the hash value.

[0117] Furthermore, in one embodiment, the data extraction module 702 is also used to delete symbols in the source MAC address and the destination MAC address to obtain character strings of the source MAC address and the destination MAC address, respectively; convert the character strings into integer form, and use the source MAC address and the destination MAC address in integer form as elements of the identification tuple to generate a hash value.

[0118] Each module in the above-mentioned data transmission path determination device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0119] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data for determining a data transmission path. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for determining a data transmission path is implemented.

[0120] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0121] In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0122] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0123] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0124] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0125] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.

[0126] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0127] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A method for determining a data transmission path, characterized in that: Applied to a router, the method includes: Receiving an IPv6 data packet sent by a first terminal; the IPv6 data packet encapsulates an Ethernet frame sent by the first terminal to a second terminal; Extracting an identification tuple of the IPv6 data packet from the IPv6 data packet; the identification tuple is a parameter set for identifying the IPv6 data packet; generating a hash value according to the identification tuple, and determining a corresponding routing table according to the prefix of the network address of the second terminal; According to the hash value, a target path is selected from a plurality of equal-cost paths included in the routing table; and the IPv6 data packet is forwarded to the second terminal via the target path.

2. The method according to claim 1, characterized in that The step of selecting a target path from a plurality of equal-cost paths included in the routing table according to the hash value includes: Obtain a first value according to the hash value and the number of the plurality of equal-cost paths in the routing table; Obtaining a sum of the first value and a preset equal-cost path offset value to obtain a second value; A mapping relationship between a plurality of pre-configured values ​​and indexes of a plurality of equal-cost paths is queried to obtain an index of an equal-cost path matching the second value, and the equal-cost path corresponding to the index is the target path.

3. The method according to claim 1, characterized in that Generating a hash value according to the identification tuple includes: splicing multiple elements in the identification tuple based on a preset splicing order to obtain a splicing sequence; The spliced ​​sequence is processed based on a hash algorithm to generate the hash value.

4. The method according to claim 3, characterized in that The step of processing the spliced ​​sequence based on a hash algorithm to generate the hash value includes: Based on a hash algorithm, the spliced ​​sequence is converted into a binary format and then right-shifted, and a shifted value of the spliced ​​sequence in the binary format is obtained; Obtain an exclusive OR result of the concatenated sequence in the binary format and the shifted value as the hash value.

5. The method according to claim 1, wherein The identification tuple includes: a source IPv6 address prefix, a source virtual network identifier, a source MAC address, a destination IPv6 address prefix, a destination virtual network identifier, and a destination MAC address; The first terminal corresponds to a source MAC address, and the source MAC address corresponds one-to-one with the source IPv6 address prefix; The second terminal corresponds to a destination MAC address, and the destination MAC address corresponds one-to-one to the destination IPv6 address prefix.

6. The method according to claim 5, characterized in that After extracting the identification tuple of the IPv6 data packet from the IPv6 data packet, the method further comprises: Deleting symbols from the source MAC address and the destination MAC address to obtain character strings of the source MAC address and the destination MAC address respectively; The character string is converted into an integer form, and the source MAC address and the destination MAC address in the integer form are used as elements of the identification tuple to generate the hash value.

7. A data transmission path determination device, characterized in that: The device comprises: A data receiving module, configured to receive an IPv6 data packet sent by a first terminal; the IPv6 data packet encapsulates an Ethernet frame sent by the first terminal to a second terminal; A data extraction module, configured to extract an identification tuple of the IPv6 data packet from the IPv6 data packet; the identification tuple is a parameter set for identifying the IPv6 data packet; a routing table determination module, configured to generate a hash value according to the identification tuple, and determine a corresponding routing table according to the prefix of the network address of the second terminal; A target path determination module is configured to select a target path from a plurality of equal-cost paths included in the routing table according to the hash value; and forward the IPv6 data packet to the second terminal via the target path.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.