WO2023011153A1 - 负载均衡的哈希算法信息的确定方法、装置及存储介质 - Google Patents

负载均衡的哈希算法信息的确定方法、装置及存储介质 Download PDF

Info

Publication number
WO2023011153A1
WO2023011153A1 PCT/CN2022/106253 CN2022106253W WO2023011153A1 WO 2023011153 A1 WO2023011153 A1 WO 2023011153A1 CN 2022106253 W CN2022106253 W CN 2022106253W WO 2023011153 A1 WO2023011153 A1 WO 2023011153A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
hash algorithm
communication device
hash
algorithm information
Prior art date
Application number
PCT/CN2022/106253
Other languages
English (en)
French (fr)
Inventor
郑合文
张小俊
閤先军
崔雷
韩磊
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP22851867.6A priority Critical patent/EP4369682A4/en
Publication of WO2023011153A1 publication Critical patent/WO2023011153A1/zh
Priority to US18/430,159 priority patent/US20240179095A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • H04L45/245Link aggregation, e.g. trunking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Definitions

  • the embodiments of the present application relate to the field of wireless communications, and in particular, to a method, device and storage medium for determining hash algorithm information for load balancing.
  • Load balancing also known as load balancing or load sharing, refers to forwarding traffic evenly through multiple links. Load balancing is generally used to improve the overall processing capacity of the network. It can expand the bandwidth of the network, increase the throughput of the network, strengthen the data processing capacity, and improve the availability of the network without changing the existing network structure.
  • Existing load balancing usually adopts the following balancing method: extract the integrated bit sequence from the data message to obtain the load balancing parameters, and then use a solidified hash (hash) algorithm (such as: cyclic redundancy check (cyclic redundancy check, CRC) algorithm) to calculate the hash value of the message, and then perform a modulo operation on the obtained hash value according to the number of ports to obtain the hash modulus value, and forward the message through the physical port corresponding to the hash modulus value.
  • a solidified hash (hash) algorithm such as: cyclic redundancy check (cyclic redundancy check, CRC) algorithm
  • the present application provides a method, device and storage medium for determining hash algorithm information of load balancing, which are used to determine a second communication device according to the first hash algorithm information of the first communication device and the information of the first number of first ports Information about the second hash algorithm used for load balancing.
  • the present application provides a method for determining hash algorithm information of load balancing, in which the load balancing device receives a first message, and the first message includes the first hash algorithm information of the load balancing mode of the first communication device and the first quantity of information of the first port of the first communication device.
  • the load balancing device determines the second hash algorithm information of the load balancing mode of the second communication device according to the first hash algorithm information and the first quantity information.
  • the load balancing device can obtain the first hash algorithm information used by the first communication device for load balancing, and the information of the first number of first outgoing ports of the first communication device, it can then based on the first hash algorithm information and the information of the first quantity to more reasonably determine the information of the second hash algorithm.
  • the load balancing device may determine the second hash algorithm information according to the first hash algorithm information, the first quantity information, and the second quantity information of the second port of the second communication device. Since the second communication device needs to perform a modulus of the second number on the hash value calculated based on the information of the second hash algorithm in the process of load balancing the message, and then determine the corresponding hash value of the message according to the obtained hash modulus value.
  • the outgoing ports, that is, the second number will affect the distribution of packets of the second communication device on each port. Therefore, the information of the second hash algorithm can be more reasonably determined in combination with the number of ports of the second communication device.
  • the first communication device since the first communication device moduloes the hash value to the first number when performing load balancing, and the second communication device moduloes the hash value to the second number, the first When the quantity is different from the second quantity, the first hash algorithm information and the second hash algorithm information may be different or the same. Even if the first hash algorithm information is the same as the second hash algorithm information, the second communication device may use different Multiple packets are sent and received on the link, so the polarization phenomenon of the network can be alleviated.
  • the first number is the same as the second number
  • the first hash algorithm information is different from the second hash algorithm information
  • the second communication device may also send and receive multiple packets through different links, so the polarization phenomenon of the network can be alleviated.
  • the first hash algorithm information includes at least one of the following: the first hash algorithm, the parameter items of the first hash key information, and the parameters of each parameter item of the first hash key information Arrangement order, first hash value method.
  • the second hash algorithm information includes at least one of the following: the second hash algorithm, the parameter items of the second hash key information, the arrangement order of each parameter item of the second hash key information, or the second hash The way to get the value. In this way, it can be more compatible with the existing technology.
  • the information of the first hash algorithm and the information of the second hash algorithm satisfy At least one of the following: the first hash algorithm is different from the second hash algorithm; the parameter items of the first hash key information are different from the parameter items of the second hash key information; each of the first hash key information The arrangement order of the parameter items is different from the arrangement order of each parameter item of the second hash key information; or, the first hash value is obtained in a different manner from the second hash value.
  • the first number may include: the number of equal-cost multipath (ECMP group) members of the first communication device.
  • ECMP group equal-cost multipath
  • the above first hash algorithm information may also be applied in the process of load balancing based on the ECMP technology.
  • LAG group link aggregation group
  • the above first hash algorithm information may also be applied in the process of load balancing based on the LAG technology.
  • the load balancing device may also receive a second message, where the second message includes third hash algorithm information of a load balancing mode of the first communication device and a third number of third ports of the first communication device Information.
  • the load balancing device may determine the second hash algorithm information of the load balancing mode of the second communication device according to the first message and the second message. Since the first communication device can perform load balancing once or multiple times, and one or more of the multiple load balancing performed may affect the diversity of the packets received by the second communication device, Therefore, if the first communication device can send the hash algorithm information of multiple times of load balancing to the load balancing device, the load balancing device can determine more reasonable second hash algorithm information.
  • the first number includes the number of equal-cost multipath (ECMP group) members of the first communication device
  • the third number includes the number of link aggregation group (LAG group) members of the first communication device.
  • ECMP group equal-cost multipath
  • LAG group link aggregation group
  • the load balancing device may determine the second hash of the load balancing mode of the second communication device according to the first message, the second message, and information about the second number of the second port of the second communication device algorithm information. Since the second communication device needs to perform a modulus of the second number on the hash value calculated based on the information of the second hash algorithm in the process of load balancing the message, and then determine the corresponding hash value of the message according to the obtained hash modulus value The outgoing ports, that is, the second number will affect the distribution of packets of the second communication device on each port. Therefore, the information of the second hash algorithm can be more reasonably determined in combination with the number of ports of the second communication device.
  • the second hash algorithm information satisfies the first condition includes: performing hash calculation on the first message and the second message based on the second hash algorithm information, and obtaining The two hash values are respectively moduloed to the second number of the second port of the second communication device, and the two hash modulus values obtained are different.
  • the received first packet and the second packet can be sent through two different ports corresponding to two different hash modulus values, so that the problem of network polarization can be alleviated.
  • the first condition further includes: performing hash calculations on the first message and the second message based on the first hash algorithm information, and calculating the two obtained hash values on the first The number is modulo, and the obtained two hash modulus values are the same.
  • the first message and the second message may be based on the first hash algorithm information and The first amount is sent to the second communication device after performing load balancing.
  • load balancing is performed based on the information of the second hash algorithm, they can be sent through different links, so that the polarization problem can be alleviated.
  • the first condition further includes: performing hash calculations on the first message and the second message based on the information of the third hash algorithm, and calculating the obtained two hash values on the third The number is modulo taken, and the obtained two hash modulus values are connected to the second communication device at the port corresponding to the first communication device.
  • the third hash algorithm information is the hash algorithm information corresponding to the load balancing mode of the first communication device, and the third number includes the number of third ports of the first communication device.
  • both the first message and the second message are sent by the upper-level device of the second communication device after performing load balancing based on the first hash algorithm information, the first number, the third hash algorithm information, and the third number to the second communication device.
  • the first packet and the second packet satisfying the first condition after load balancing is performed based on the information of the second hash algorithm, they can be sent through different links, so that the polarization problem can be alleviated.
  • the load balancing device may pre-establish a hash algorithm information association relationship, and the hash algorithm information association relationship may be stored in a table or other forms of documents.
  • the hash algorithm information association relationship includes: the association relationship between the first hash algorithm information, the first quantity information, the second quantity information of the port of the second communication device, and the second hash algorithm information.
  • the load balancing device can query the preset association relationship of hash algorithm information according to the first hash algorithm information and the first amount of information, and obtain the second hash algorithm information.
  • the hash algorithm information association relationship further includes: first hash algorithm information, information of the first quantity, information of the third hash algorithm, information of the third quantity, connection of the first communication device to the first quantity An association relationship between the information of the hash modulus corresponding to the port of the second communication device, the information of the second number of ports of the second communication device, and the information of the second hash algorithm. In this way, more reasonable second hash algorithm information with less diversity loss can be found from the hash algorithm information association relationship according to the plurality of hash algorithm information of the first communication device.
  • the load balancing device may determine a fourth number corresponding to the hash algorithm information among the N pieces of hash algorithm information; N is a positive integer. Select the corresponding hash algorithm information whose fourth quantity is greater than 1 from the N pieces of hash algorithm information as the second hash algorithm information.
  • the fourth quantity corresponding to the hash algorithm information is: perform hash calculations on M messages based on the hash algorithm information, and obtain M hashes The values are respectively moduloed by the second number of ports of the second communication device, and the number of numerical values obtained after deduplication of M hash modulus values is obtained; M is an integer greater than 1.
  • the M messages can be distributed to at least two links after load balancing based on the second hash algorithm information and the second number, so that the network polarization problem can be alleviated.
  • the load balancing device may select, from the N pieces of hash algorithm information, corresponding hash algorithm information with the fourth largest number as the second hash algorithm information. In this way, if the hash algorithm information with the fourth largest number is selected as the second hash algorithm information, the M messages can be distributed to as many links as possible for transmission, thereby reducing the network load as much as possible. problem.
  • the M messages satisfy the second condition includes: performing hash calculation on the M messages based on the information of the first hash algorithm, and calculating the obtained M hash values respectively Taking the modulus of the first quantity, M hash modulus values obtained are the same.
  • the other communication device receives M messages, it will send the M messages to the second communication device after performing load balancing based on the first hash algorithm information and the first number.
  • load balancing is performed based on the information of the second hash algorithm, they can be sent through different links, so that the polarization problem can be alleviated.
  • the second condition further includes: performing hash calculations on the M messages based on the information of the third hash algorithm, and taking the obtained M hash values modulo the third number respectively, The obtained M hash modulus values are connected to the second communication device at the layer 2 physical port corresponding to the first communication device.
  • the third hash algorithm information is the hash algorithm information corresponding to the load balancing mode of the first communication device, and the third number includes the number of third ports of the first communication device.
  • both the first message and the second message are sent by the upper-level device of the second communication device after performing load balancing based on the first hash algorithm information, the first number, the third hash algorithm information, and the third number to the second communication device. Furthermore, for the first packet and the second packet satisfying the first condition, after load balancing is performed based on the information of the second hash algorithm, they can be sent through different links, so that the polarization problem can be alleviated.
  • the load balancing device after the load balancing device receives the first message, it further includes: determining that there is no second hash algorithm information that satisfies the first condition, and determining a fourth hash algorithm for the load balancing mode of the second communication device information; sending a third message to the first communication device, where the third message is used to instruct the first communication device to update the load balance of the first communication device according to the fourth hash algorithm information and the information of the second number of ports of the second communication device Hash algorithm information corresponding to the mode.
  • the first communication device can reselect the hash algorithm to alleviate the polarization problem in the network, and the first communication device can choose the hash algorithm and the scheme in the parameters of other hash algorithm information to participate in the aforementioned second communication
  • the method for the device to select the second hash algorithm information will not be repeated here.
  • the load balancing device after the load balancing device receives the first message, it further includes: determining that there is no second hash algorithm information that satisfies the first condition, and determining a fourth hash algorithm for the load balancing mode of the second communication device information.
  • the load balancing device determines the fifth hash algorithm information of the load balancing mode of the first communication device according to the fourth hash algorithm information, the first number information, and the second number information of ports of the second communication device.
  • the load balancing device sends a fourth message to the first communication device, where the fourth message is used to notify the first communication device to forward packets based on the fifth hash algorithm information.
  • the load balancing device can re-select the hash algorithm for the first communication device to alleviate the polarization problem in the network, and the hash algorithm selected for the first communication device and the scheme in the parameters of other hash algorithm information can participate in the The aforementioned method for selecting the second hash algorithm information for the second communication device will not be repeated here.
  • the information of the fourth hash algorithm satisfies the following conditions: Hash calculations are performed on the third message and the fourth message respectively based on the information of the fourth hash algorithm, and the obtained two hash values The modulus of the second quantity is respectively taken, and the obtained two hash modulus values are different.
  • the third packet and the fourth packet can be sent on the second communication device through two links, so that the polarization problem of the network can be alleviated.
  • the third message and the fourth message meet the requirements of: performing hash calculation on the third message and the fourth message based on the information of the fifth hash algorithm, and combining the obtained two hashes
  • the values are respectively modulo the first quantity, and the obtained two hash modulus values are the same.
  • the upper-level device of the second communication device may send the third message and the fourth message to the second communication device after performing load balancing based on the fifth hash algorithm information and the first number.
  • the third message and the fourth message can be sent on the second communication device through two links, so that the polarization problem of the network can be alleviated.
  • the load balancing device determines the second hash algorithm information of the load balancing mode of the second communication device according to the first hash algorithm information and the first quantity information, it further includes: determining the second communication The device is a slave device.
  • the load balancing device receives the first hash algorithm information of the load balancing mode of the first communication device and the information of the first number of ports of the first communication device, it further includes: determining that there is no second hash algorithm that satisfies the first condition information, and update the second communication device as the master device. In this way, based on the new hash algorithm information determined for the second communication device, the hash algorithm information can be reselected for the first communication device, thereby achieving the purpose of alleviating the problem of network polarization.
  • At least one of the first hash algorithm information or the first amount of information is carried in the following information: Link Layer Discovery Protocol LLDP message, developed shortest path first routing protocol OSPF message, or boundary Gateway Routing Protocol BGP message. In this way, it can be more compatible with the existing technology.
  • a communication device in a second aspect, may be the aforementioned load balancing device, and the communication device may include a communication unit and a processing unit, so as to implement the first aspect or any implementation manner of the first aspect.
  • the communication unit is used to perform functions related to transmission and reception.
  • the communication unit includes a receiving unit and a sending unit.
  • the communication device is a communication chip
  • the processing unit may be one or more processors or processor cores
  • the communication unit may be an input/output circuit or port of the communication chip.
  • the communication unit may be a transmitter and a receiver, or the communication unit may be a transmitter and a receiver.
  • the communication device further includes various modules that can be used to implement the first aspect or any implementation manner of the first aspect.
  • a communication device may be the aforementioned load balancing device, and the communication device may include a processor and a memory.
  • a transceiver is also included, the memory is used to store computer programs or instructions, the processor is used to call and run the computer programs or instructions from the memory, and when the processor executes the computer programs or instructions in the memory, the The communication device implements the first aspect or any implementation manner of the first aspect.
  • processors there are one or more processors, and one or more memories.
  • the memory may be integrated with the processor, or the memory may be separated from the processor.
  • the transceiver may include a transmitter (transmitter) and a receiver (receiver).
  • a communication device may be the aforementioned load balancing device, and the communication device may include a processor.
  • the processor is coupled with the memory and can be used to implement the first aspect or any implementation manner of the first aspect.
  • the communication device further includes a memory.
  • the communication device further includes a communication interface, and the processor is coupled to the communication interface.
  • the communication interface may be a transceiver, or an input/output interface.
  • the transceiver may be a transceiver circuit.
  • the input/output interface may be an input/output circuit.
  • the communication interface may be an input/output interface, an interface circuit, an output circuit, an input circuit, a pin or a related circuit on the chip or the chip system, etc.
  • a processor may also be embodied as processing circuitry or logic circuitry.
  • a system in a fifth aspect, includes the above-mentioned communication apparatus, a first communication device, and a second communication device.
  • a computer program product includes: a computer program (also referred to as code, or an instruction), which, when the computer program is run, causes the computer to perform any of the above-mentioned first aspect or the first aspect.
  • a computer program also referred to as code, or an instruction
  • a computer-readable storage medium stores a computer program (also referred to as code, or instruction) which, when run on a computer, causes the computer to perform the above-mentioned first aspect or the first Any embodiment of the aspect.
  • a computer program also referred to as code, or instruction
  • a chip system may include a processor.
  • the processor is coupled with the memory, and may be used to execute the first aspect or any implementation manner of the first aspect.
  • the chip system further includes a memory.
  • Memory used to store computer programs (also called code, or instructions).
  • the processor is configured to call and run a computer program from the memory, so that the device equipped with the system-on-a-chip executes the first aspect or any one of the implementation manners of the first aspect.
  • a processing device including: an interface circuit and a processing circuit.
  • Interface circuitry may include input circuitry and output circuitry.
  • the processing circuit is configured to receive signals through the input circuit and transmit signals through the output circuit, so that the first aspect or any implementation manner of the first aspect is realized.
  • the above-mentioned processing device may be a chip
  • the input circuit may be an input pin
  • the output circuit may be an output pin
  • the processing circuit may be a transistor, a gate circuit, a flip-flop, and various logic circuits.
  • the input signal received by the input circuit may be received and input by, for example but not limited to, the receiver
  • the output signal of the output circuit may be, for example but not limited to, output to the transmitter and transmitted by the transmitter
  • the circuit may be the same circuit, which is used as an input circuit and an output circuit respectively at different times.
  • the present application does not limit the specific implementation manners of the processor and various circuits.
  • the communication device may be a part of a load balancing device, such as an integrated circuit product such as a system chip or a communication chip.
  • the interface circuit may be an input/output interface, interface circuit, output circuit, input circuit, pin or related circuit on the chip or chip system.
  • the processing circuitry may be logic circuitry on the chip.
  • Figure 1a, Figure 1b, Figure 1c and Figure 1d are schematic diagrams of several system architectures applicable to the embodiments of the present application;
  • FIG. 1 Figure 2a, Figure 2b, Figure 2c and Figure 2d are schematic diagrams of several system architectures provided by the embodiments of the present application;
  • FIG. 3 is a schematic structural diagram of a communication device provided in an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a method for determining load-balanced hash algorithm information provided by an embodiment of the present application
  • Fig. 5 is a schematic diagram of the distribution of the diversity of hash key information provided by the embodiment of the present application.
  • FIG. 6 is a schematic flowchart of another method for determining hash algorithm information of load balancing provided by the embodiment of the present application.
  • Fig. 7a is a schematic flowchart of another method for determining the hash algorithm information of load balancing provided by the embodiment of the present application.
  • Fig. 7b is a schematic flowchart of another method for determining the hash algorithm information of load balancing provided by the embodiment of the present application.
  • FIG. 8a is a schematic structural diagram of an extended LLDP message used to carry the information of the first hash algorithm and the information of the first quantity provided by the embodiment of the present application;
  • FIG. 8b is a schematic structural diagram of another OSPF message for carrying the information of the first hash algorithm and the information of the first quantity provided by the embodiment of the present application;
  • FIG. 8c is a schematic structural diagram of another BGP message used to carry the information of the first hash algorithm and the information of the first quantity provided by the embodiment of the present application;
  • FIG. 9 is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of another communication device provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of another communication device provided by an embodiment of the present application.
  • the technical solutions of the embodiments of the present application can be applied to various communication systems, for example: the data center internal server access switch included in the data center network and the interconnection between switches and switches, the inter-city interconnection or backbone network of operators, mobile Communication systems based on Ethernet technology such as fronthaul or backhaul, metro multi-service bearer, data center interconnection, industrial communication, and communication systems between different components or modules in industrial or communication equipment.
  • the data center internal server access switch included in the data center network and the interconnection between switches and switches, the inter-city interconnection or backbone network of operators mobile Communication systems based on Ethernet technology such as fronthaul or backhaul, metro multi-service bearer, data center interconnection, industrial communication, and communication systems between different components or modules in industrial or communication equipment.
  • the system architecture includes a first communication device and a load balancing device.
  • the load balancing device may be connected to the first communication device, and is used to receive the first hash algorithm information used by the first communication device for load balancing and the number of first ports of the first communication device (for distinction, the number of the first port is The quantity is called the first quantity) information.
  • the load balancing device selects the second hash algorithm information for the second communication device according to the first hash algorithm information and the first amount of information.
  • the first quantity of information in this embodiment of the present application refers to information that can indicate the first quantity.
  • the system architecture may further include a second communication device, and the second communication device may send packets based on the second hash algorithm information selected by the load balancing device.
  • the first communication device may be upstream of the second communication device, and the first communication device sends the message to the second communication device, and then the second communication device sends the message to other devices.
  • the first communication device may also be downstream of the second communication device, and the second communication device sends the message to the first communication device, and then the first communication device sends the message to other devices.
  • the subsequent content takes the first communication device as an upstream of the second communication device as an example for introduction.
  • the first communication device and the second communication device in this embodiment of the present application may be network devices, or chips disposed inside the network device.
  • the equipment includes, but is not limited to: data center switches, operator metropolitan area network routers, campus network switches, artificial intelligence (AI) and high-performance computing network switches, core routers, Internet Protocol-based radio access networks (Internet Protocol Radio Access Network, IPRAN), packet transport network (Packet Transport Network, PTN) box or frame switch equipment, etc.
  • IPRAN Internet Protocol Radio Access Network
  • PTN Packet Transport Network
  • the load balancing device may be a module or unit in the second communication device.
  • the load balancing device may also be a device independent of the first communication device and the second communication device.
  • the first communication device and the second communication device may be different devices respectively, as shown in FIG. 1a and FIG. 1b .
  • the first communication device and the second communication device can also be in the same communication device 100, for example, the first communication device can be a layer in the communication device 100 3 (Layer 3, L3) communication module, the second communication device can be a layer 2 (Layer 2, L2) communication module in the communication device 100; the first communication device can be a message in layer 3 based on the first hash algorithm information To select the next hop, the second communication device may select a layer 2 port for the packet at layer 2 based on the second hash algorithm information.
  • the first communication device can be a layer in the communication device 100 3 (Layer 3, L3) communication module
  • the second communication device can be a layer 2 (Layer 2, L2) communication module in the communication device 100
  • the first communication device can be a message in layer 3 based on the first hash algorithm information
  • the second communication device may select a layer 2 port for the packet at layer 2 based on the second hash
  • the first communication device may be a layer 2 communication module in the communication device 100, and the second communication device may be a layer 3 communication module in the communication device 100; the second communication device may be based on the second hash algorithm information in layer 3
  • the first communication device may select a layer 2 port for the message at layer 2 based on the first hash algorithm information.
  • FIG. 1c and FIG. 1d the relevant content of this embodiment will be introduced in detail later, and will not be elaborated here.
  • the content of the subsequent part assumes that the first communication device can be a layer 3 communication module in the communication device 100, and the second communication device can be a layer 2 communication module in the communication device 100 Introduce as an example.
  • the load balancing device in FIG. 1c may be a module independent of the first communication device and the second communication device, and the load balancing device in FIG. 1d may be a module in the second communication device.
  • the load balancing device in FIG. 1c may also be a module on other devices than the communication device 100, which is not limited in this embodiment of the present application.
  • the first hash algorithm information of the first communication device in the embodiment of the present application can be applied to various scenarios.
  • the first communication device can select the next hop for the message based on the first hash algorithm information, for example, it can be based on the equivalent Multi-path routing (equal-cost multi-path, ECMP) technology selects the next hop for the packet.
  • selecting the next hop for the message by the first communication device may also be understood as selecting a logical port for the message by the first communication device, for example, selecting a logical port for the message at layer 3.
  • a logical port in this embodiment of the present application may also be referred to as a logical egress port.
  • the first communication device may select a physical port for the message based on the first hash algorithm information, such as selecting a physical port for the message at layer 2, for example, it may select a physical port for the message based on link aggregation (LAG) technology.
  • LAG link aggregation
  • Physical ports, LAG can also be called port aggregation (trunk) technology.
  • the physical port may also be referred to as a physical egress port.
  • the first communication device performs load balancing based on the first hash algorithm information through ECMP technology as an example.
  • the hash algorithm included in the first hash algorithm information is called the first hash algorithm
  • the second hash key information in the first hash algorithm information is called the first hash key information
  • the hash value method in the first hash algorithm information is called the first hash value method:
  • the first communication device receives the first message, obtains the network layer identifier of layer 3 of the first message (ie, the destination IP address (destination IP address, DIP) etc.) of the first message, and queries the network layer routing table .
  • the network layer identifier of layer 3 of the first message ie, the destination IP address (destination IP address, DIP) etc.
  • the following content is executed:
  • the first communication device extracts information corresponding to the parameter item of the first hash key information from the first message according to the preset parameter item of the first hash key information.
  • the first communication device arranges the extracted information of each parameter item of the first hash key information in order to form the first hash key information ( hash key) (it should be noted that if the information of some parameter items is not extracted, the preset value can be filled in the corresponding field of the first hash key information according to the preset rules).
  • the first communication device performs hash calculation on the first hash key information based on the first hash algorithm, and determines the hash value from the obtained value based on the first hash value acquisition method.
  • the first communication device performs a modulo operation on the obtained hash value to the first number of the first port of the first communication device to obtain a hash modulus value of the first packet.
  • the first number of the first port of the first communication device in this example, it can be understood as the number of ECMP group (Group) members corresponding to the first message on the first communication device;
  • the total number of paths to the destination IP of the first packet or understood as the total number of paths to the IP subnet of the destination IP of the first packet; or, or understood as the destination IP of the first packet
  • the first communication device After determining the next hop information corresponding to the hash modulus of the first message (for example, determining that the next hop is the second communication device), the first communication device sends the next hop to the next hop (such as the second communication device). a message.
  • determining the next hop by the first communication device can also be understood as determining a logical egress port, through which the first communication device can send the message.
  • the above content is introduced by taking the first communication device to perform load balancing through ECMP technology based on the first hash algorithm information as an example.
  • the solution of other communication devices to perform load balancing through ECMP technology based on other hash algorithm information is similar, and may adopt The hash algorithm information and the number of ECMP group members will be different, so I won't repeat them here.
  • the first communication device performs load balancing based on the first hash algorithm information through the LAG technology as an example.
  • the hash algorithm included in the first hash algorithm information is called the first hash algorithm
  • the second hash key information in the first hash algorithm information is called the first hash key information
  • the hash value method in the first hash algorithm information is called the first hash value method:
  • the first communication device receives the first message, obtains the link layer identifier of layer 2 of the first message (ie, the destination MAC address (destination MAC), etc.), and queries the MAC table.
  • the link layer identifier of layer 2 of the first message ie, the destination MAC address (destination MAC), etc.
  • the following content is executed:
  • the first communication device extracts information corresponding to the parameter item of the first hash key information from the first message according to the preset parameter item of the first hash key information.
  • the first communication device arranges the extracted information of each parameter item of the first hash key information in order to form the first hash key information ( hash key) (it should be noted that if the information of some parameter items is not extracted, the preset value can be filled in the corresponding field of the first hash key information according to the preset rules).
  • the first communication device performs hash calculation on the first hash key information based on the first hash algorithm, and determines the hash value from the obtained value based on the first hash value acquisition method.
  • the first communication device performs a modulo operation on the obtained hash value to the first number of the first port of the first communication device to obtain the hash modulus value of the first message; it should be noted that the first communication device's first port
  • the first number of ports can be understood as the number of LAG group (Group) members corresponding to the first message on the first communication device, and can also be understood as the destination MAC of the first message on the first communication device
  • the total number of corresponding ports or be understood as the total number of paths to the destination MAC of the first packet.
  • the first communication device determines the port corresponding to the hash modulus value of the first message according to the preset correspondence between the hash modulus value and the port (which can be understood as a physical output port), and passes the port Send the first message.
  • the above content is introduced by taking the following as an example where the first communication device performs load balancing based on the first hash algorithm information through the LAG technology.
  • the way the first communication device performs load balancing based on the third hash algorithm information through the LAG technology is similar. The difference is that each item in the first hash algorithm information is replaced with each item in the third hash algorithm information, and the first number is replaced with the third number of the third port of the first communication device, and the rest of the content is the same as are similar and will not be repeated here.
  • other hash algorithm information load balancing schemes through LAG technology are similar, and the hash algorithm information and the number of LAG group members that may be used will be different, so I won't repeat them here.
  • FIG. 2a exemplarily shows a schematic diagram of a system architecture provided by the embodiment of the present application.
  • the embodiment of the present application can be applied to a 3-level Clos (CLOS) network architecture, which includes TOR/leaf /spine three-level networking, each level can include multiple communication devices (communication devices can be switches), as shown in Figure 2a, the TOR level includes 8 communication devices, which are marked with 1-8 in Figure 2a; the leaf level It includes 8 communication devices, which are respectively marked by 1-8 in Fig. 2a; the spine level includes 16 communication devices, which are respectively marked by 1-16 in Fig. 2a.
  • CLOS 3-level Clos
  • a TOR-level communication device can be connected to one or more servers, such as a server 118 connected to a TOR-level communication device 8, a server 117 connected to a TOR-level communication device 7, a server 116 connected to a TOR-level communication device 2, and a TOR-level The communication device 1 is connected to the server 115.
  • servers such as a server 118 connected to a TOR-level communication device 8, a server 117 connected to a TOR-level communication device 7, a server 116 connected to a TOR-level communication device 2, and a TOR-level
  • the communication device 1 is connected to the server 115.
  • the communication device 8 of the TOR level is connected to the communication device of the leaf level through 4 links, and is used to send its own message to the leaf level through the 4 links.
  • the message can be sent through the above-mentioned ECMP technology.
  • the leaf-level communication device 8 is connected to the spine-level communication device through 4 links, and is used to send its own message to the spine level through the 4 links.
  • the message can be sent through the above-mentioned ECMP technology.
  • the first communication device in above-mentioned Fig. 1a and Fig. 1b may be the TOR level communication device in Fig. 2a
  • the second communication device may be the leaf level communication device in Fig. 2a; or, the first communication device is the communication device in Fig. 2a
  • the communication device of the leaf level, and the second communication device is the communication device of the TOR level in FIG. 2a.
  • the load balancing device may be a module inside the second communication device, or may be a device or module independent of the TOR-level communication device and the leaf-level communication device.
  • the TOR-level communication device 8 calculates the hash modulus value of the first message and the hash modulus value of the second message based on its own hash algorithm information and the number of ports. If the hash modulus values are the same, the first message and the second message are sent to the same leaf-level communication device, such as leaf-level communication device 8 . Wherein, the first packet and the second packet may originate from the same server, or may originate from different servers.
  • the leaf-level communication device 8 calculates the hash modulus values corresponding to the two messages based on its own hash algorithm information and the number of ports. Since the hash modulus values of the two messages calculated by the TOR-level communication device 8 based on its own hash algorithm information and the number of ports are the same, the leaf-level communication device 8 calculates based on its own hash algorithm information and the number of ports The hash modulus values of the two messages are also the same. In this way, for the multiple messages received from the TOR communication device 8 at the leaf level, the leaf-level communication device 8 only sends the multiple messages through one link, and cannot balance the multiple messages to multiple chains. way to send.
  • the leaf-level communication device 8 will also receive one or more messages, such as the third message and the fourth message, from other TOR-level communication devices (TOR-level communication device 7 ). Similarly, since the TOR level communication device 7 is based on its own hash algorithm information and the number of ports, it sends the two messages according to the calculated hash modulus value of the third message and the hash modulus value of the fourth message To the leaf-level communication device 8, therefore, the leaf-level communication device 8 calculates the same hash modulus values of the third message and the fourth message based on its own hash algorithm information and the number of ports.
  • the hash algorithm information of the TOR-level communication device 7 and the TOR-level communication device 8 are the same, and the number of ports of the two is also the same, the first message, the second message, and the second message calculated by the leaf-level communication device 8
  • the hash modulus values of the third message and the fourth message are all the same, therefore, multiple messages from different TOR-level communication devices (TOR-level communication device 7 and TOR-level communication device 8) received by the leaf level
  • the leaf-level communication device 8 only sends the four messages through one link, and cannot balance the multiple messages to multiple links for sending.
  • Traffic load balancing pursues balance, that is, the traffic expected to be forwarded is evenly distributed to multiple downlinks. However, if the traffic to be forwarded is not evenly distributed to multiple downlink links, the link load will be high or low. When the high-load link is close to full load, the low-load link is idle, and the overall network utilization is low. This phenomenon is called polarization. It can be seen from the above analysis that if the polarization phenomenon is to be slowed down, it is necessary to set the hash algorithm information for the load balancing device more reasonably, which is exactly the problem to be solved in the embodiment of the present application.
  • the layer 3 hash algorithm is used between communication devices as an example.
  • any device that needs to perform load balancing shown in Figure 2a can perform layer 3
  • the load balancing of layer 2 can also be performed.
  • the TOR-level communication device 8 can have multiple links to the leaf-level communication device 8 based on the LAG.
  • the leaf-level communication device 8 can have multiple links based on the LAG. Multiple links lead to the spine level communication device 16 .
  • the TOR-level communication device 8 needs to perform load balancing on layer 3 and layer 2 respectively, and the leaf-level communication device 8 needs to perform load balancing on layer 3 and layer 2 respectively.
  • Fig. 2b exemplarily shows a schematic diagram of a system architecture provided by the embodiment of the present application.
  • the embodiment of the present application may be applicable to adopt link aggregation group (link aggregation group, LAG)/port aggregation (trunk ) for traffic load balancing, and is also applicable to the interaction of load balancing information between servers and switches that use bonding (bonding) for traffic load balancing.
  • link aggregation group link aggregation group
  • Trunk port aggregation
  • Figure 2b shows the system architecture of a 3-level L2 network.
  • TOR-level communication devices are interconnected through Leaf-level communication devices, and server #A1 and server #A2 can use bond link aggregation mode to access TOR-level communication devices, such as TOR#1 and TOR#2.
  • TOR#1 and TOR#2 are back-to-back connected to leaf#1 and leaf#2 through link aggregation.
  • Leaf#1 and leaf#2 are connected to TOR#3 and TOR#4 by back-to-back link aggregation.
  • Server #B1 and server #B 2 use bond link aggregation mode to access TOR#3 and TOR#4.
  • FIG. 2c exemplarily shows a schematic diagram of a system architecture provided by an embodiment of the present application. The difference from FIG. 2b is that the system architecture shown in FIG. 2c removes leaf-level communication devices and is a system architecture of a 2-level L2 network.
  • the traffic from server #A1 and server #A2 to server #B1 and server #B2 will first do a hash on the server, and then do a hash on the TOR-level communication device. Due to the two hashes, based on the polarization problem caused by the two hashes discussed in Figure 2a above, if the hash algorithm information on the server side and the TOR-level communication device side in Figure 2b is unreasonably selected, it will also lead to extremes. problem.
  • leaf#1 and leaf#2 are based on bonding (bonding ) is dual-homing to TOR#3 and TOR#4, then: the traffic from server #A1 and server #A2 to server #B1 and server #B 2 can firstly pass through the TOR level communication equipment (TOR#1 and TOR#2 ), and then perform a hash on the leaf-level communication devices (leaf#1 and leaf#2).
  • the server simultaneously accesses two TOR-level communication devices, and the two links may be in a master-backup mode.
  • the message sent by server #A1 can first select the next hop based on ECMP (performing a hash operation) on the layer 3 of the server according to the IP address; A hash operation) selects the port link. Due to two hashes, based on the polarization problem caused by the two hashes discussed in Figure 2a above, if the hash algorithm information of layer 3 and layer 2 on the server side in Figure 2b is unreasonably selected, it will also lead to polarization question.
  • TOR#1 can be based on ECMP ( Perform a hash operation) to select the next hop; then select a port link based on the LAG at Layer 2 of TOR#1 (perform another hash operation). Due to the two hashes, based on the polarization problem caused by the two hashes discussed above in Figure 2a, if the hash algorithm information selection of TOR#1 side layer 3 and layer 2 in Figure 2b is unreasonable, it will also lead to Polarization problem. To alleviate the occurrence of the polarization phenomenon, it is necessary to more reasonably set hash algorithm information for the devices performing load balancing, which is exactly the problem to be solved in the embodiments of the present application.
  • ECMP Perform a hash operation
  • the first communication device in FIG. 1a and FIG. 1b above may be the server in FIG. 2b, and the second communication device may be a TOR-level communication device in FIG. 2b.
  • the first communication device is a TOR-level communication device in FIG. 2a
  • the second communication device is a server in FIG. 2a.
  • the load balancing device may be a module inside the second communication device, or a device or module independent of the TOR-level communication device and server.
  • the first communication device in FIG. 1a and FIG. 1b may be a TOR-level communication device in FIG. 2b, and the second communication device may be a leaf-level communication device in FIG. 2b.
  • the first communication device is a leaf-level communication device in FIG. 2a
  • the second communication device is a TOR-level communication device in FIG. 2a.
  • the load balancing device may be a module inside the second communication device, or may be a device or module independent of the TOR-level communication device and the leaf-level communication device.
  • the above-mentioned first communication device and second communication device in Fig. 1c and Fig. 1d may be modules in the server in Fig. 2b.
  • the first communication device may be a module of Layer 3 in the server
  • the second communication device may be a module of Layer 2 in the server.
  • the first communication device may be a module of Layer 2 in the server
  • the second communication device may be a module of Layer 3 in the server.
  • the load balancing device can be a module inside the server, or a device or module independent of the server.
  • the first communication device and the second communication device in FIG. 1c and FIG. 1d above may be modules in the TOR level communication device in FIG. 2b.
  • the first communication device may be a layer 3 module in the TOR level communication device
  • the second communication device may be a layer 2 module in the TOR level communication device.
  • the first communication device may be a layer 2 module in the TOR level communication device
  • the second communication device may be a layer 3 module in the TOR level communication device.
  • the load balancing device may be a module inside the TOR-level communication device, or a device or module independent of the TOR-level communication device.
  • the first communication device and the second communication device in the foregoing FIG. 1c and FIG. 1d may be modules in the leaf-level communication device in FIG. 2b.
  • the first communication device may be a layer 3 module in the leaf-level communication device
  • the second communication device may be a layer-2 module in the leaf-level communication device.
  • the first communication device may be a layer 2 module in the leaf-level communication device
  • the second communication device may be a layer 3 module in the leaf-level communication device.
  • the load balancing device may be a module inside the leaf-level communication device, or a device or module independent of the leaf-level communication device.
  • FIG. 2d exemplarily shows a schematic diagram of a system architecture provided by the embodiment of the present application.
  • the embodiment of the present application can be applied to a 3-level Clos (CLOS) network architecture, which includes TOR/leaf /spine Three-level networking, each level can include multiple communication devices (communication devices can be switches).
  • CLOS 3-level Clos
  • the TOR level includes 4 communication devices, which are respectively marked by 1-4 in Figure 2a;
  • the leaf level includes 4 logical communication devices, which are respectively leaf-level communication device 1, and leaf-level communication device 3 and leaf level communication equipment4.
  • the leaf-level communication device 1 may be composed of multiple physical leaf-level communication devices. For example, in FIG.
  • a leaf-level communication device 1a and a leaf-level communication device 1b are bundled to obtain a logical leaf-level communication device 1 .
  • the spine level includes 2 communication devices, which are respectively indicated as 1-2 in the figure.
  • a TOR-level communication device may be connected to one or more servers, such as server 121, server 122, server 123, and server 124 shown in FIG. 2d.
  • any communication device in the embodiment of the present application may perform traffic load balancing once, or perform load balancing multiple times, such as performing one load balancing on layer 3 of the TOR-level communication device, and performing load balancing on layer 2 of the TOR-level communication device.
  • One time load balancing For another example, a load balancing is performed on the layer 3 of the leaf-level communication equipment, and a load balancing is performed on the layer 2 of the leaf-level communication equipment.
  • the TOR level communication device 1 After the TOR level communication device 1 receives the first message, it calculates the hash modulus value of the first message based on the hash algorithm information of layer 3 and the number of ECMP group members corresponding to the destination IP address of the first message, and Based on the hash modulus value and the preset corresponding relationship between the hash modulus value and the next hop (or logical port), the next hop corresponding to the first packet is determined.
  • the hash modulus value of the first message is calculated, and based on the hash modulus value and the preset hash
  • the corresponding relationship between the modulus value and the physical port determines the physical port corresponding to the first message, and sends the first message to the next hop corresponding to the first message through the physical port.
  • the TOR-level communication device may select a transmission link for the first message based on the LAG technology among the four links connected to the leaf-level communication device 1 .
  • a leaf-level communication device may be composed of multiple devices
  • the hash algorithm selected by the leaf-level communication device may be affected by layer 3 of the TOR-level communication device.
  • the impact of the hash algorithm information may also be affected by the hash algorithm information of layer 2 of the TOR level communication device (for example, it will affect the number of diversity of messages received by the leaf level communication device 1a, the Examples will be described in detail in subsequent embodiments, and will not be elaborated here), and it can also be understood that multiple load balancing may be performed on the first communication device, and multiple load balancing may affect the second communication device.
  • the choice of hashing algorithm has an impact. Therefore, this embodiment of the present application also provides a possible implementation manner, that is, the second communication device may determine its own hash algorithm information in combination with the hash algorithm information of at least two load balances of the first communication device.
  • the hash algorithm information of layer 3 of load balancing performed by the first communication device is called the first hash algorithm information
  • the hash algorithm information of layer 2 of load balancing performed by the first communication device is called The information is called the third hash algorithm information.
  • the above-mentioned first communication device in Figure 1a and Figure 1b may be a TOR-level communication device in Figure 2d, and the second communication device may be a leaf-level communication device in Figure 2d; or, the first communication device is a communication device in Figure 2d
  • the communication device of the leaf level, and the second communication device is the communication device of the TOR level in FIG. 2d.
  • the load balancing device may be a module inside the second communication device, or may be a device or module independent of the TOR-level communication device and the leaf-level communication device.
  • Fig. 3 exemplarily shows a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • the communication device may be a forwarding device, and the following uses the communication device as a switch as an example for introduction.
  • the communication device may include a switch chip 510 for processing traffic forwarding and a processor central processing unit (central processing unit, CPU) 520 for managing and controlling the switch chip.
  • a switch chip 510 for processing traffic forwarding
  • a processor central processing unit (central processing unit, CPU) 520 for managing and controlling the switch chip.
  • the switch chip 510 includes one or more ports 511, such as port #1, port #2...port #mn+n, where m can be an integer greater than 1, and n can be an integer greater than 2.
  • the number of ports in FIG. 3 is only for illustration, and the actual communication device may include more or less ports than that in FIG. 3 .
  • multiple ports can be aggregated into one port block, and multiple port blocks 512 are illustrated in Figure 3, such as port block (port block) #1, port block (port block) #2... in Figure 3 port block #(m+1).
  • the port block 512 can decode the message from the outside into a frame and send it to the processing module 513.
  • multiple processing modules are illustrated, such as processing module (pipe) #0...processing module (pipe) #y.
  • the port block 512 may also receive the message to be sent from the processing module 513 and encode and send it.
  • the processing module 513 may include an ingress processing module (Ingress Pipeline) and an egress processing module (Egress Pipeline).
  • the ingress processing module (Ingress Pipeline) can be used to extract message information, generate message description, and perform table lookup (such as tables (tables)/ternary content addressable memory (Ternary Content Addressable Memories, TCAM) in Figure 3) 514 ), then the message is sent to the memory management unit (memory management unit, MMU) 515, and after scheduling in the MMU 515, the message is sent to the outgoing direction processing module (Egress Pipeline) connected to the corresponding port for encoding and encapsulation, etc. The processed message is sent out through the selected port. in this processing flow.
  • Table lookup forwarding decisions can be implemented in the ingress processing module (Ingress Pipeline), including traffic load balancing.
  • the load balancing device may include the processor 520 in FIG. 3 in the processor 520 module.
  • the second hash algorithm information determined by the load balancing device may be delivered to the switch chip 510 through the processor 520 .
  • the load balancing device can also adjust the number of ports on which the second communication device forwards packets. If the number of ports for message forwarding of the second communication device is adjusted, the adjusted number of ports may also be delivered to the switch chip 510 through the processor 520 .
  • the management interface controller (management interface controller) 516 of the switch chip 510 can send the second hash algorithm information and/or the port number information of the second communication device received from the processor CPU520 to a designated component, such as a processing module 513.
  • the management interface controller 516 may also feed back the relevant configuration of the second communication device (such as the current number of ports of the second communication device) to the processor 520 .
  • the management interface controller 516 can also send the designated message received from the port to the processor 520, and can also send the message to be sent by the processor CPU 520 to the switch chip for transmission.
  • the communication device shown in FIG. 3 is the second communication device
  • the load balancing device is a device independent of the second communication device
  • the load balancing device can send the second hash algorithm information to the second communication device
  • the second communication The device sends the message received through the port to the processor 520, and the processor 520 parses the message, determines the second hash algorithm information, and sends it to the switch chip 510.
  • the load balancing device adjusts the number of ports for packet forwarding by the second communication device, it may also send the adjusted number of ports to the second communication device, and the second communication device obtains the adjusted number of ports through the processor 520 After that, send it to the switch chip 510.
  • FIG. 4 exemplarily shows a schematic flowchart of a method for determining hash algorithm information for load balancing provided by an embodiment of the present application, and the method may be implemented by the load balancing device in FIGS. 1a to 2c. As shown in Figure 4, the method includes:
  • the load balancing device receives a first message, where the first message includes first hash algorithm information of a load balancing mode of the first communication device and information of a first number of first ports of the first communication device.
  • the first hash algorithm information and the first quantity information of the first port of the first communication device may be directly sent by the first communication device to the load balancing device; they may also be sent by other devices, such as It may be sent by the information sharing module, and before S401, the information sharing module may acquire the first hash algorithm information of the first communication device and the information of the first number of first ports of the first communication device from the first communication device.
  • the load balancing device determines the second hash algorithm information of the load balancing mode of the second communication device according to the first hash algorithm information and the information of the first quantity.
  • the load balancing device may be a module or unit in the second communication device, or may be a module or unit independent of devices other than the first communication device and the second communication device. If it is a device independent of the first communication device and the second communication device, after S402, the load balancing device may send the second hash algorithm information to the second communication device. In this way, the second communication device can forward the message based on the second hash algorithm information.
  • the load balancing device can communicate with the first communication device, it can obtain the first hash algorithm information and the first number of information, and then according to the first hash algorithm information and the first port of the first communication device The information of the second hash algorithm determined by the information of the first quantity may be more reasonable.
  • Each hash algorithm information may include: at least one of: parameter items of the hash key information, an arrangement order of each parameter item of the hash key information, a hash algorithm, or a way of obtaining a hash value.
  • each parameter in the first hash algorithm information is referred to as the first hash algorithm, the parameter item of the first hash key information, the arrangement order of each parameter item of the first hash key information, and the first hash algorithm.
  • the Hash algorithm and the value method of the first hash value is referred to as the first hash algorithm, the parameter item of the first hash key information, the arrangement order of each parameter item of the first hash key information, and the first hash algorithm.
  • Each parameter in the second hash algorithm information is respectively referred to as the second hash algorithm, the parameter item of the second hash key information, the arrangement order of each parameter item of the second hash key information, the second hash algorithm, and The value method of the second hash value.
  • the parameters in the subsequent third hash algorithm information are respectively referred to as the third hash algorithm, the parameter items of the third hash key information, the arrangement order of each parameter item of the third hash key information, and the third hash algorithm.
  • Hash algorithm and the method of obtaining the third hash value is respectively referred to as the second hash algorithm, the parameter item of the second hash key information, the arrangement order of each parameter item of the second hash key information, the second hash algorithm, and The value method of the second hash value.
  • Other hash algorithm information (such as the second hash algorithm information, the third hash algorithm information, etc.) repeat.
  • Parameter a1 the parameter item of hash key information.
  • the parameter items of hash key information may include fields carried by the message itself, such as network layer destination address, network layer source address, transport layer destination port, transport layer source port, network layer protocol identifier, congestion notification tag (congestion notification tag, CNTag), virtual network tag (virtual network tag, VNTag), virtual local area network (virtual local area network, VLAN) identification, etc.
  • the parameter item of the hash key information in the embodiment of the present application also includes an area for constituting the parameter value of the parameter item of the hash key information (also can be understood as bit width, bit length, etc. ).
  • the parameter item of hash key information may include: the upper 16 bits of the network layer destination address, the lower 16 bits of the network layer source address, or the upper 16 bits of the network layer original address, etc. It can be seen that, through the parameter items of the hash key information, the bits to be extracted from the parameter values corresponding to each parameter item used to construct the hash key information can be determined.
  • the parameter item of hash key information may also include information of the communication device to which the message currently belongs.
  • the parameter item of the hash key information corresponding to the first hash algorithm information of the first communication device may include the first port identifier of the first message arriving at the first communication device .
  • the identity of the first communication device (it should be noted that the identity of the first communication device is configurable, and the identity of the first communication device may be different in different systems, which is not limited in the embodiment of this application) wait.
  • the communication device that performs load balancing for the message can fill this field with the default value, 0 or other setting values.
  • the first communication device receives a first packet, if the first packet is an ARP packet.
  • the parameter item of the hash key information corresponding to the first hash algorithm information may include fields carried by the message itself, such as network layer destination address, network layer source address, transport layer destination port, transport layer source port, network layer protocol identifier, CNTag, VNTag, and VLAN tags. Since the first packet has no network layer and transport information, the network layer and transport layer information of the first packet cannot be extracted, such as network layer destination address, network layer source address, transport layer destination port, transport layer source port, etc. In this case, when constructing the hash key information corresponding to the first message, the first communication device may fill the values corresponding to the parameter items corresponding to the network layer and transport layer information with default values, 0 or other set values.
  • Parameter a2 the order of each parameter item of hash key information.
  • the arrangement order of each parameter item of the hash key information may change.
  • the parameter items of the hash key information corresponding to the first hash algorithm information and the second hash algorithm information are the same, but the arrangement order of each parameter item is different.
  • Hash algorithm can refer to the algorithm for calculating hash key information, such as cyclic redundancy check (cyclic redundancy check, CRC) algorithm, exclusive OR folding (XOR folding) or exclusive OR (exclusive OR, XOR folding) ) object, division and summation, etc.
  • CRC cyclic redundancy check
  • XOR folding exclusive OR folding
  • exclusive OR exclusive OR, XOR folding
  • the CRC algorithm is essentially to perform XOR remainder on hash key information (a string of bits).
  • CRC algorithm A actually means “the generator polynomial used by the CRC algorithm is A” or "the name of the generator polynomial used by the CRC algorithm is identified as A”.
  • CRC-16-CCITT or "CRC 0x1021”
  • 0x1021 is the generating polynomial.
  • the device or other CRC algorithm implementation subjects can also name CRC by themselves to identify and distinguish .
  • Parameter a4 the value method of the hash value.
  • the value obtained by using the hash algorithm corresponding to the hash algorithm information to calculate the hash key information can be obtained according to the hash value corresponding to the hash algorithm information. , from which the hash value is determined.
  • the method of obtaining the hash value includes: extracting the lower 16 bits of the result of the hash algorithm as the hash value, extracting the upper 16 bits of the result of the hash algorithm as the hash value, or extracting all the bits of the result of the hash algorithm Bits are hash values etc.
  • the first hash algorithm information and the second number of ports of the second communication device satisfy at least one of the following: the first number is different from the second number, the first hash algorithm information The same as the second hash algorithm information; the first number is different from the second number, and the first hash algorithm information is different from the second hash algorithm information; or, the first number is the same as the second number, and the first hash algorithm information It is different from the second hash algorithm information.
  • the first communication device moduloes the hash value to the first number when performing load balancing
  • the second communication device moduloes the hash value to the second number, so when the first number and the second number are different.
  • the first hash algorithm information and the second hash algorithm information may be different or the same. Even if the first hash algorithm information is the same as the second hash algorithm information, the second communication device may use different Multiple packets are sent and received on the link, so the polarization phenomenon of the network can be alleviated.
  • the second communication device may also send and receive multiple packets through different links, so the polarization phenomenon of the network can be alleviated.
  • the first hash algorithm information and the second hash algorithm information satisfy at least one of the following:
  • the first hash algorithm is different from the second hash algorithm; the parameter items of the first hash key information are different from the parameter items of the second hash key information; the arrangement order of each parameter item of the first hash key information is the same as that of the second hash key information Arrangement orders of various parameter items of the hash key information are different; or, the value method of the first hash value is different from that of the second hash value.
  • the first message and the second message from the first communication device even if the first message and the second message are respectively hashed based on the first hash algorithm information Calculate, and take the modulus of the two obtained hash values to the first number respectively, and the obtained two hash modulus values are the same, then perform hashing on the first message and the second message respectively based on the information of the second hash algorithm
  • the two hash values obtained by taking the modulus of the second number may be different, and then two different links corresponding to the two hash moduli can be used
  • the first packet and the second packet are sent separately, so that the polarization problem in the network can be alleviated.
  • the embodiment of this application defines the number of ports of the noun communication device.
  • the number of the first port of the first communication device is called the first number
  • the number of the second port of the second communication device is called the second number .
  • the first number includes: the number of equal-cost multipath (ECMP group) members of the first communication device; or, the number of link aggregation group (LAG group) members of the first communication device. Introduce them separately below.
  • ECMP group equal-cost multipath
  • LAG group link aggregation group
  • the first number of first ports of the first communication device may be: the number of equal-cost multipath (ECMP group) members of the first communication device.
  • ECMP group equal-cost multipath
  • the number of equal-cost multipath (ECMP group) members of the first communication device can also be understood as the first communication device can transmit the received message (such as the first message) to the destination IP address of the first message.
  • the number of paths in layer 3 of the first communication device of the address (the number of paths in layer 3 can also be understood as the number of logical ports in layer 3).
  • the number of members of the equal-cost multipath (ECMP group) of the first communication device can also be understood as the number of ports (or ports) of the first communication device layer 3 corresponding to the IP subnet address in the destination IP address of the first message , the number of ports can also be understood as the number of equivalent paths, the number of next hops, or the number of logical ports (or called logical ports).
  • the first number of the first port of the first communication device may be: the number of members of the link aggregation group (LAG group) of the first communication device.
  • LAG group link aggregation group
  • the number of members of the link aggregation group (LAG group) of the first communication device can also be understood as the first communication device can transmit the received message (such as the first message) to the destination MAC address of the first message.
  • the number of ports on layer 2 of the first communication device of the address (the number of ports on layer 2 can also be understood as the number of physical ports on layer 2).
  • the number of members of the link aggregation group (LAG group) of the first communication device can also be understood as the number of ports (or ports) of the first communication device layer 2 corresponding to the destination MAC address of the first message, and the number of the ports is also It can be understood as the number of physical ports (or called physical ports).
  • the second hash algorithm information may be applied to the processing of the layer 3 load balancing mode of the second communication device.
  • the second number of the second ports of the second communication device may include: the number of equal cost multipath (ECMP group) members of the second communication device.
  • the second hash algorithm information may be applied to the processing of the layer 2 load balancing mode of the second communication device.
  • the second number of the second port of the second communication device may include: the number of members of the link aggregation group (LAG group) of the second communication device, and the specific content is similar to the above content, and will not be described again.
  • LAG group link aggregation group
  • the load balancing device may determine the second hash according to the information of the first hash algorithm, the information of the first quantity, and the information of the second quantity of the second port of the second communication device. algorithm information. In this way, the second hash algorithm information can be more reasonably determined in combination with the number of ports of the second communication device.
  • the leaf level communication device 8 only sends the multiple messages through one link. packets, and the multiple packets cannot be balanced to multiple links for transmission.
  • the second hash algorithm information selected by the load balancing device may satisfy the first condition,
  • the first condition includes: performing hash calculation on the first packet and the second packet based on the information of the second hash algorithm, and calculating the two obtained hash values respectively on the second hash value of the second port of the second communication device.
  • the number is modulo, and the obtained two hash modulus values are different. In this way, the received first packet and the second packet can be sent through two different ports corresponding to two different hash modulus values, so that the problem of network polarization can be alleviated.
  • the first message and the second message may be other communication devices (such as the first communication device and/or other communication devices) after performing load balancing on the first hash algorithm information and the first number Two messages transmitted to the second communication device.
  • the first condition may further include: performing hash calculation on the first packet and the second packet based on the information of the first hash algorithm, and comparing the obtained two hash values to The modulus of the first quantity is taken, and the obtained two hash modulus values are the same.
  • the first message and the second message may be generated by two different higher-level devices (including the first communication device and other communication devices) of the second communication device based on the first hash algorithm information and the first number It is sent to the second communication device after performing load balancing.
  • the first message and the second message may also be sent to the second message after load balancing by the same upper-level device (such as the first communication device) of the second communication device based on the first hash algorithm information and the first number.
  • the information of the communication device may be sent to the second communication device through the same logical link or the same physical link of the first communication device. Furthermore, for the first packet and the second packet satisfying the first condition, after load balancing is performed based on the information of the second hash algorithm, they can be sent through different links, so that the polarization problem can be alleviated.
  • An example is used to illustrate the beneficial effect when the second hash algorithm information satisfies the first condition: for example, after the first communication device receives the first message and the second message from the same communication device or from different communication devices, Hash calculations are performed on the first message and the second message respectively based on the first hash algorithm information, and the obtained two hash values are respectively modulo the first number, and the obtained two hash modulus values are the same, Therefore, the first communication device determines to respectively send the first packet and the second packet to the second communication device through the same link.
  • the second communication device performs hash calculation on the first message and the second message respectively based on the information of the second hash algorithm, and moduloes the two obtained hash values to the second number respectively, and the obtained two hash values Since the modulus values are different, the first packet and the second packet are respectively sent to the next hop through two different links.
  • the second hash algorithm information satisfies the first condition
  • the messages with the same characteristics filtered by the communication device of the previous hop can be sent through different links as far as possible, so as to slow down the above-mentioned problems in Figure 2a.
  • the polarization problem caused by unreasonable selection of hash algorithm information mentioned in .
  • Fig. 5 exemplarily shows a schematic diagram of the distribution of the diversity of hash key information provided by the embodiment of the present application.
  • the set S1 includes hashes corresponding to each message generated by the first communication device Key information, such as 12 hash key information such as key#1, key#2...key#12.
  • the set S2 represents a schematic diagram of calculating the 12 hash key information in the set S1 based on the first hash algorithm information, and taking the obtained hash value modulo the first number, and obtaining the hash modulus value, As shown in Figure 5, a total of 12 hash modulus values are calculated from the 12 hash key information in the set S1, among which there are repeated values in the 12 hash modulus values, and the 12 hash modulus values can be deduplicated. Four different hash modulus values are obtained, which are hash modulus A, hash modulus B, hash modulus C, and hash modulus D.
  • the first communication device can distribute the data streams corresponding to the 12 hash key information to 4 links (or 4 equal-cost multipath (ECMP group) members or 4 link aggregation groups (LAG group) member) to send.
  • 4 links or 4 equal-cost multipath (ECMP group) members or 4 link aggregation groups (LAG group) member
  • LAG group link aggregation groups
  • hash modulus values corresponding to the hash key information key#1, key#2 and key#3 of the first communication device in Figure 5 are all hash modulus A, that is, the hash key information key#1, key#
  • the data streams corresponding to 2 and key#3 are both sent through the same link, for example, both are sent to the second communication device.
  • the second communication device calculates The hash modulus values corresponding to the hash key information key#1, key#2 and key#3 are all hash modulus A.
  • the data flows corresponding to the hash key information key#1, key#2 and key#3 are not load-balanced on the second communication device, but are sent out through the same link, which may cause extreme generation of problems.
  • the hash modulus obtained through calculation of the hash key information is understood as diversity, then as shown in Figure 5, on the first communication device, the 12 hash moduli corresponding to the 12 hash key information are deduplicated The number of is 4, which can be understood as the diversity corresponding to the first hash algorithm information on the first communication device is 4.
  • the second communication device still uses the first hash algorithm information for equalization, and the first number of first ports of the first communication device is the same as the number of ports of the second communication device, on the second communication device,
  • the number of the three hash moduli corresponding to the three hash key information (key#1, key#2 and key#3) after deduplication is 1 (as shown in the set S3 of Figure 5), that is, the three The multiplicity corresponding to each hash key information (key#1, key#2 and key#3) is 1.
  • the data streams corresponding to the three hash key information are only sent through one link. It can be seen that, due to the information of the hash algorithm selected on the second communication device, the diversity of the packets processed by the load balancing of the first communication device is reduced, thereby causing the generation of the polarization problem.
  • the load balancing device determines the fourth number corresponding to the hash algorithm information among the N hash algorithm information; N is a positive integer, and selects the corresponding fourth hash algorithm information greater than 1 from the N hash algorithm information as the second hash algorithm information. Hash algorithm information.
  • the fourth quantity corresponding to the hash algorithm information is: perform hash calculations on M messages based on the hash algorithm information, and obtain M hashes
  • the values are respectively moduloed by the second number of ports of the second communication device, and the number of numerical values obtained after deduplication of M hash modulus values is obtained; M is an integer greater than 1.
  • the M messages can be distributed to at least two links after load balancing based on the second hash algorithm information and the second number, so that the network polarization problem can be alleviated.
  • the M messages may be transmitted to the second communication device (such as the first communication device and/or other communication devices) after performing load balancing on the first hash algorithm information and the first number. M messages of the communication device.
  • the M messages satisfy the second condition includes: performing hash calculations on the M messages based on the first hash algorithm information, and calculating the obtained M hash values
  • the modulus of the first quantity is respectively taken, and the obtained M hash modulus values are the same.
  • the other communication device receives M messages, it will send the M messages to the second communication device after performing load balancing based on the first hash algorithm information and the first number.
  • load balancing is performed based on the information of the second hash algorithm, they can be sent through different links, so that the polarization problem can be alleviated.
  • the M messages can be the messages corresponding to the above hash key information key#1, key#2 and key#3, and the selected second hash algorithm information needs to satisfy: based on the second hash Hash algorithm information performs hash calculation on M messages respectively, takes the obtained M hash values modulo the second number respectively, and deduplicates the obtained M hash modulus values to obtain a number greater than 1. In this way, at least two links can be selected for sending the messages corresponding to the hash key information key#1, key#2 and key#3, so that the polarization problem can be alleviated.
  • the first number of the first port of the first communication device is the same as the number of ports of the second communication device
  • the parameters of the hash key information corresponding to the first hash algorithm information The item is the same as the parameter item of the hash key information corresponding to the second hash algorithm information
  • the sorting method of each parameter item of the hash key information corresponding to the first hash algorithm information is the same as that of the hash key information corresponding to the second hash algorithm information
  • the sorting manner of each parameter item of the information is the same, and the value manner of the hash value corresponding to the first hash algorithm information is the same as that of the hash value corresponding to the second hash algorithm information.
  • the hash algorithm corresponding to the first hash algorithm information adopted by the first communication device is CRC16a, and the first communication device performs operations on the received message based on the first hash algorithm information, and the obtained hash
  • the value is moduloed to the first number, and the total number of hash modulus values obtained after deduplication is 2, and the 2 values can be expressed as 0 and 3 respectively.
  • a hash modulus of 0 corresponds to the first port of the first communication device
  • a hash modulus of 3 corresponds to the fourth port of the first communication device.
  • the first port of the first communication device is connected to the second communication device. That is to say, all the messages received by the second communication device are calculated on the first communication device, and the obtained messages have a hash modulus value of 0 (the messages can be understood as the aforementioned M messages).
  • the second communication device will receive The M messages are calculated based on CRC16a, and the obtained hash value is modulo the first number, and the obtained hash modulus value is 1 after deduplication of the total number, as shown in Table 1, the value is 0 . That is, when the first hash algorithm information is the same as the second hash algorithm information, and the first number is the same as the second number, the first communication device performs calculations on the M messages, and obtains hashes corresponding to the M messages.
  • the desired modulus values are all 0, the second communication device calculates the M messages, and the hash modulus values corresponding to the obtained M messages are also all 0, and the second communication device passes the M messages through the hash The port corresponding to the modulus value of 0 is sent.
  • the second communication device will receive The M messages of M are calculated based on CRC16b, and the obtained hash value is moduloed to the first number, and the total number of hash modulus values obtained after deduplication is 4, as shown in Table 1, the 4 values They are 1, 2, 3, 0 respectively. That is, for the M messages from the first communication device, the second communication device can send them through 4 links, so that the polarization problem of the network can be alleviated.
  • the hash algorithm corresponding to the second hash algorithm information adopted by the second communication device is CRC32HI
  • the second communication device will receive The M messages of M are calculated based on 32HI, and the obtained hash value is modulo the first number, and the obtained hash modulus value is 1 after deduplication.
  • the 1 value Represented as 0. That is, for the M messages from the first communication device, the second communication device can only send them through one link, which will cause polarization problems.
  • the second communication device will receive The M messages of M are calculated based on CRC32LO, and the obtained hash value is moduloed to the first number, and the total number of obtained hash modulus values after deduplication is 4, as shown in Table 1, the 4 values They are 2, 0, 1, 3 respectively (compared with the scheme in which the second communication device adopts CRC16b, the number of diversity is the same, but the order of distribution of the diversity values is different). That is, for the M messages from the first communication device, the second communication device can send them through 4 links, so that the polarization problem of the network can be alleviated.
  • the selected second hash algorithm information needs to meet the requirements: based on the second hash algorithm information, the hash calculations are performed on the M messages respectively, and the obtained M hash values are respectively compared to the first Take the modulus of the two numbers, and deduplicate the obtained M hash modulus values, and the number of values obtained is greater than 1. In this way, polarization problems can be mitigated.
  • the first number of the first port of the first communication device is equal to the number of ports of the second communication device
  • the parameter item of the hash key information corresponding to the first hash algorithm information is the same as the second
  • the parameter items of the hash key information corresponding to the two hash algorithm information are the same, and the sorting method of each parameter item of the hash key information corresponding to the first hash algorithm information is the same as that of the hash key information corresponding to the second hash algorithm information
  • the sorting method of each parameter item is the same, and the value method of the hash value corresponding to the first hash algorithm information is the same as the value method of the hash value corresponding to the second hash algorithm information.
  • the parameter item of the hash key information corresponding to the first hash algorithm information and the hash key corresponding to the second hash algorithm information are different, the ordering method of each parameter item of the hash key information corresponding to the first hash algorithm information is different from the ordering method of each parameter item of the hash key information corresponding to the second hash algorithm information, or, the first At least one of the values in which the value of the hash value corresponding to the first hash algorithm information is different from the value of the hash value corresponding to the second hash algorithm information is satisfied, then the value in the seventh column of the above table 1 and the value in the first column 8 column values may also change.
  • Table 2 exemplarily shows the distribution of the hash modulus values after the first communication device and the third communication device in Table 1 perform operations on the received message.
  • Table 3 shows the processing method of the message with a hash modulus value of 3 obtained by hashing on the first communication device, which will be described in detail below.
  • Table 1 The description in , will not be repeated.
  • the hash modulus 3 on the first communication device corresponds to the fourth port of the first communication device.
  • the fourth port of the first communication device is connected to the third communication device. That is to say, all the messages received by the third communication device are calculated on the first communication device, and the obtained messages have a hash modulus value of 3 (in the embodiment of the present application, the hash algorithm information is selected for the third communication device
  • the hash algorithm information is selected for the third communication device
  • the content of the second row and the fourth row of Table 2 is used as an example below, and the contents of other rows are similar, and will not be repeated here.
  • Table 2 if the hash algorithm corresponding to the hash algorithm information adopted by the third communication device is CRC16a, then for the received message from the first communication device, the third communication device The calculation is based on CRC16a, and the obtained hash value is modulo the first number, and the total number of hash modulus values obtained after deduplication is 1. As shown in Table 1, the value is 3.
  • the third communication device performs operations on the received multiple messages based on CRC16b , the obtained hash value is moduloed to the first number, and the obtained hash modulus value is 4 after deduplication. As shown in Table 1, the 4 values are 3, 0, 1, 2 respectively .
  • the hash algorithm information selected for the third communication device can refer to the aforementioned solution for selecting the second hash algorithm information, that is, the hash algorithm information selected for the third communication device needs to satisfy:
  • the hash algorithm information selected for the third communication device performs hash calculations on multiple messages, respectively takes the obtained multiple hash values modulo the number of ports of the third communication device, and decomposes the obtained hash modulus values to The number of values obtained after weighting is greater than 1. In this way, polarization problems can be mitigated.
  • the hash algorithm information selected for the third communication device reference may be made to the foregoing solution for selecting the second hash algorithm information, and details are not repeated here.
  • the embodiment of the present application also provides a possible implementation manner.
  • the load balancing device selects the corresponding fourth largest hash algorithm information from the N pieces of hash algorithm information.
  • the hash algorithm information is used as the second hash algorithm information.
  • the second hash algorithm information selected by the load balancing device not only satisfies the following requirements: performing hash calculations on M messages based on the second hash algorithm information, and the obtained M hash values
  • the modulus of the second number is respectively taken, and the number of values obtained after deduplication of the obtained M hash modulus values is greater than 1.
  • the hash algorithm information corresponding to the fourth largest number among the N hash algorithm information can also be understood as the hash algorithm information with the least diversity loss when performing load balancing on M packets.
  • the N pieces of hash algorithm information can be several optional hash algorithm information configured in advance, and the staff can also modify and supplement the preset N pieces of hash algorithm information at any time.
  • the sorting method of each parameter item of the key information is the same, the value method of the hash value corresponding to the first hash algorithm information is the same as the value method of the hash value corresponding to the second hash algorithm information, if the first hash
  • the hash algorithm corresponding to the algorithm information is CRC16a, and the second hash algorithm information may select CRC16b or CRC32LO.
  • the load balancing device may pre-establish a hash algorithm information association relationship, and the hash algorithm information association relationship may be stored in a table or other forms of documents.
  • the hash algorithm information association relationship includes: the association relationship between the first hash algorithm information, the first quantity information, the second quantity information of the port of the second communication device, and the second hash algorithm information.
  • the load balancing device may query the preset hash algorithm information association relationship according to the first hash algorithm information and the first amount of information, and obtain the second hash algorithm information. Further, the load balancing device can query the preset hash algorithm information association relationship according to the first hash algorithm information, the first quantity information and the second quantity of the second port of the second communication device, and obtain the second hash algorithm information.
  • Table 3 lists several examples of the hash algorithm corresponding to the first hash algorithm information and the hash algorithm corresponding to the second hash algorithm information.
  • Table 3 is the hash key information corresponding to the first hash algorithm information.
  • the parameter item is the same as the parameter item of the hash key information corresponding to the second hash algorithm information, and the sorting method of each parameter item of the hash key information corresponding to the first hash algorithm information is the same as the hash key information corresponding to the second hash algorithm information. It is assumed that each parameter item of the key information is sorted in the same way as an example.
  • the hash algorithm corresponding to the first hash algorithm information is CRC16b
  • the number of ports of the second communication device is 4
  • the hash algorithm corresponding to the second hash algorithm information may be recommended to select CRC32LO.
  • the hash algorithm corresponding to the second hash algorithm information in Table 3 can be obtained by pre-calculation, or real-time calculation, for example, it can be obtained by traversing various combinations for evaluation or mathematical calculation. The content of other lines is similar and will not be described again.
  • Table 3 exemplarily shows several combinations of hash algorithms corresponding to the first hash algorithm information and hash algorithms corresponding to the second hash algorithm information.
  • the hash algorithm corresponding to the first hash algorithm information and the second hash may change.
  • the first hash algorithm information corresponds to
  • the hash algorithm of the second hash algorithm information may be CRC16b, and the hash algorithm corresponding to the second hash algorithm information may be CRC32LO.
  • the hash algorithm corresponding to the first hash algorithm information is CRC16b
  • the hash algorithm corresponding to the second hash algorithm information The Greek algorithm can be CRC16a.
  • the number of ports of the load balancing subsystem of the multi-level communication equipment must also be considered; it can also be seen that even if the hash algorithms of the first hash algorithm information and the second hash algorithm information are different, the There is no fixed set of first hash algorithm information and second hash algorithm information that can ensure optimal performance in solving the polarization problem under all combinations of the number of ports of the first communication device and the number of ports of the second communication device .
  • a communication device may perform load balancing once or multiple times.
  • the first communication device may perform load balancing once at layer 3 and once at layer 2.
  • the foregoing content is introduced by taking the first hash algorithm information as an example of the hash algorithm information corresponding to any load balancing performed by the first communication device.
  • the first communication device may send the hash algorithm information of multiple times of load balancing to the load balancing device, so that the load balancing device can determine more reasonable second hash algorithm information.
  • the method also includes before S402:
  • the load balancing device receives a second message, where the second message includes third hash algorithm information of a load balancing mode of the first communication device and information of a third number of third ports of the first communication device.
  • the above S402 may be replaced by: the load balancing device determines the second hash algorithm information of the load balancing mode of the second communication device according to the first message and the second message.
  • the foregoing S402 may be replaced with: the load balancing device determines the second hash algorithm information of the load balancing mode of the second communication device according to the first message, the second message, and the second quantity.
  • first message and the second message above can be two different messages, or the same message.
  • first message also includes: the third hash algorithm information and a third quantity of information.
  • the first hash algorithm information and the third hash algorithm information may be hash algorithm information corresponding to the two load balances of the first communication device.
  • the first hash algorithm information is hash algorithm information used by the first communication device to perform load balancing based on the equal-cost multi-path technology at layer 3.
  • the first quantity includes the number of equal cost multipath (ECMP group) members of the first communication device.
  • the third hash algorithm information is the hash algorithm information used by the first communication device to perform load balancing based on link aggregation group (LAG) technology at layer 2.
  • the third quantity includes the number of link aggregation group (LAG group) members of the first communication device.
  • the first communication device in Table 4 is, for example, the TOR-level communication device 1 in FIG. 2d, and the second communication device is, for example, the leaf-level communication device 1a.
  • the first hash algorithm information is the hash algorithm information used by the TOR-level communication device layer 3 for load balancing.
  • the third hash algorithm information is the hash algorithm information used by the TOR communication device layer 2 for load balancing.
  • the TOR level communication device 1 corresponds to 4 logical egress ports at layer 3, so the first number is 4.
  • the hash algorithm corresponding to the first hash algorithm information is CRC16b.
  • the number of hash modulus values corresponding to the first hash algorithm information after deduplication is 4, and the values are 0, 1, 2, and 3 respectively.
  • the message with a hash modulus value of 0 goes to the leaf-level communication device 1 .
  • a message with a hash modulus of 1 is sent to the leaf-level communication device 2 .
  • Packets with a hash modulus of 2 are sent to the leaf-level communication device 3 .
  • Packets with a hash modulus of 3 are sent to the leaf-level communication device 4 .
  • the number of physical outgoing ports from the TOR-level communication device 1 to the leaf-level communication device 1 is 4, so the third number corresponding to the hash modulus 0 is 4.
  • the number of de-duplicated hash modulus values corresponding to the third hash algorithm information (based on the third hash algorithm information to calculate the received message, the obtained hash modulus value de-duplicated number) is 4, respectively are 0, 1, 2 and 3.
  • the hash modulus values of 0 and 1 go to the leaf-class communication device 1a in the leaf-class communication device 1
  • the hash modulus values of 2 and 3 go to the leaf-class communication device 1b in the leaf-class communication device 1.
  • the second communication device is a leaf-level communication device 1a, the second number of its output ports is 2, and when the second hash algorithm information adopted is CRC16a, the obtained hash modulus value after deduplication is 2, that is, the obtained The multiplicity of the message is 2.
  • the first condition mentioned in the above embodiment may further include: performing hash calculation on the first message and the second message based on the information of the third hash algorithm, and combining the obtained two Each hash value is moduloed to the third quantity, and the obtained two hash modulus values are connected to the second communication device at a port corresponding to the first communication device (such as a physical port at layer 2).
  • both the first message and the second message are sent by the upper-level device of the second communication device after performing load balancing based on the first hash algorithm information, the first number, the third hash algorithm information, and the third number to the second communication device.
  • the first packet and the second packet satisfying the first condition after load balancing is performed based on the information of the second hash algorithm, they can be sent through different links, so that the polarization problem can be alleviated.
  • the hash algorithm information association relationships mentioned in the above embodiments may include: first Hash algorithm information, information of the first quantity, information of the third hash algorithm, information of the third quantity, information of the hash modulus corresponding to the port connecting the first communication device to the second communication device, information of the second communication device An association relationship between the information of the second number of ports and the information of the second hash algorithm. In this way, more reasonable second hash algorithm information with less diversity loss can be found from the hash algorithm information association relationship according to the plurality of hash algorithm information of the first communication device.
  • the number of links between the TOR-level communication device where the computing cluster is located and the Leaf-level communication device can remain unchanged, but how the links are allocated to the layer 3 ECMP and Layer 2 LAG can be changed, and different allocations will cause changes in the first quantity and the third quantity.
  • the second hash algorithm information of the second communication device may be updated again according to the updated first number and the third number.
  • Fig. 7a and Fig. 7b exemplarily show the flowcharts of two possible methods for determining the hash algorithm information of load balancing provided by the embodiment of the present application. As shown in Fig. 7a, the method further includes:
  • the load balancing device determines that the second communication device is a slave device.
  • the load balancing device can judge the master-slave relationship between the first communication device and the second communication device. For example, it can compare the priorities of the first communication device and the second communication device. It is a slave device; as another example, the MAC addresses of the first communication device and the second communication device may also be compared, or the device with a smaller MAC address may also be agreed to be the master device.
  • the hash algorithm information of the slave device can change with the hash algorithm information of the master device. Based on this, in the case where it is determined in S601 that the second communication device is a slave device, the subsequent S602 is executed. and S603. If under other agreed conditions, for example, it is agreed that the hash algorithm information of the master device can be changed along with the hash algorithm information of the slave device, then S601 can be replaced by determining that the second communication device is the master device, and this condition is satisfied S602 and S603 are executed next.
  • the load balancing device judges whether there is hash algorithm information satisfying the first condition
  • the load balancing device determines the hash algorithm information satisfying the first condition as the second hash algorithm information.
  • S603 is similar to the foregoing S402 manner, which can be referred to each other and will not be repeated here.
  • the load balancing device updates the second communication device as the master device.
  • the load balancing device may also update the first communication device as a master device.
  • a message may also be sent to the first communication device to notify the second communication device to be updated as a master device, so that the first communication device updates itself as a slave device.
  • the second communication device There are many ways to change the second communication device as the main device, for example, the priority of the second communication device may be modified.
  • the load balancing device selects fourth hash algorithm information; the fourth hash algorithm information is hash algorithm information used by the second communication device for packet forwarding.
  • the fourth hash algorithm information selected by the load balancing device may be selected from preset hash algorithm information.
  • the load balancing device sends a third message to the first communication device, where the third message is used to instruct the first communication device to update the first communication device according to the fourth hash algorithm information and the second number of ports of the second communication device.
  • the hash algorithm corresponding to the load balancing method.
  • the first communication device can reselect the hash algorithm to alleviate the polarization problem in the network, and the first communication device can select the hash algorithm and the scheme in the parameters of other hash algorithm information to participate in the aforementioned second The method for the communication device to select the second hash algorithm information will not be repeated here.
  • the third message may instruct the first communication device to update the primary load balancing method (such as layer 2 or layer 3 load balancing) of the first communication device according to the fourth hash algorithm information and the information of the second number of ports of the second communication device, or The hash algorithm corresponding to multiple load balancing (such as layer 2 and layer 3 load balancing).
  • the primary load balancing method such as layer 2 or layer 3 load balancing
  • the hash algorithm corresponding to multiple load balancing such as layer 2 and layer 3 load balancing.
  • the load balancing device may also send fourth hash algorithm information to the second communication device to inform the second communication device of the hash algorithm information it uses.
  • the load balancing device may reselect the hash algorithm information for the first communication device, for example, after S604, it may be implemented by executing the following contents of S607 and S608 in FIG. 7b.
  • the load balancing device determines the fifth hash algorithm information of the load balancing mode of the first communication device according to the fourth hash algorithm information, the information of the first number, and the information of the second number of ports of the second communication device.
  • the fourth hash algorithm information satisfies the third condition, and the third condition includes: performing hash calculations on the third message and the fourth message based on the fourth hash algorithm information, and comparing the obtained two hash values to The second quantity is modulo, and the obtained two hash modulus values are different.
  • the third packet and the fourth packet can be sent on the second communication device through two links, so that the polarization problem of the network can be alleviated.
  • the third message and the fourth message may be messages sent to the second communication device after other communication devices perform load balancing based on the fifth hash algorithm information and the first number.
  • the third condition further includes: performing hash calculations on the third message and the fourth message based on the information of the fifth hash algorithm, and applying the obtained two hash values to the second message respectively.
  • a quantity is modulo, and the obtained two hash modulus values are the same.
  • the upper-level device of the second communication device may send the third message and the fourth message to the second communication device after performing load balancing based on the fifth hash algorithm information and the first number.
  • the third message and the fourth message can be sent on the second communication device through two links, so that the polarization problem of the network can be alleviated.
  • the load balancing device can reselect the hash algorithm for the first communication device, so as to alleviate the polarization problem in the network, select the hash algorithm for the first communication device and the scheme in the parameters in other hash algorithm information can be Participate in the above-mentioned method for selecting the second hash algorithm information for the second communication device, which will not be repeated here.
  • the scheme for the load balancing device to select the information of the fourth hash algorithm is similar to the above-mentioned content of selecting the information of the second hash algorithm by the load balancing device, and will not be repeated here.
  • the load balancing device may also determine the load balancing mode of the first communication device according to the information of the fourth hash algorithm, the information of the first number, and the information of the second number of ports of the second communication device
  • the seventh hash algorithm information may be the hash algorithm information of the two load balances of the first communication device respectively, for example, may be the hash algorithm information corresponding to the load balance of layer 3 and layer 2 respectively.
  • the load balancing device sends a fourth message to the first communication device, where the fourth message is used to notify the first communication device to forward packets based on the fifth hash algorithm information.
  • the first communication device may be notified through the fourth message, so that the first communication device sends a message based on the reselected fifth hash algorithm information. Forward.
  • the load balancing device is a device independent of the first communication device and the second communication device
  • the solution of the embodiment of the application can be implemented by performing information interaction with the first communication device and the second communication device respectively , if the load balancing device is located at the second communication device, the mutual information interaction between the first communication device and the second communication device can implement the above solution. It can be seen from the above that, through information interaction, the load balancing device can combine the information of the first communication device and the second communication device to select more reasonable hash algorithm information for the two, thereby alleviating the polarization problem.
  • At least one of the first hash algorithm information or the first amount of information is carried in the following information: a link layer discovery protocol (link layer discovery protocol, LLDP) message, a developed shortest path first routing protocol ( open shortest path first (OSPF) message, or border gateway protocol (border gateway protocol, BGP) message, link aggregation control protocol (link aggregation control protocol, LACP).
  • link layer discovery protocol link layer discovery protocol, LLDP
  • OSPF open shortest path first
  • border gateway protocol border gateway protocol
  • LACP link aggregation control protocol
  • Fig. 8a exemplarily shows a schematic structural diagram of an extended LLDP message for carrying first hash algorithm information and first quantity information provided by an embodiment of the present application.
  • the extended LLDP message may include a TLV header (header) and a TLV information string (information string).
  • the TLV header (header) may include a TLV type (type) and a TLV information string length (information string length).
  • the device type can be It is used to indicate the entity type used by the data plane to achieve traffic load balancing, such as the model of the switch chip manufacturer, the version of the server that implements link bonding, etc., and can be encoded uniformly.
  • the hash algorithm code identification (hash code ID (1 byte (octets))
  • hash algorithm information such as the following parameters in the above hash algorithm information (such as the aforementioned parameter a1, parameter a2 , parameter a3 and parameter a4) at least one of: hash algorithm, parameter items of hash key information, order of arrangement of each parameter item of hash key information, or way of hash value, etc.
  • members of a group (1 byte (octets) may be used to carry the first amount of information.
  • Fig. 8b exemplarily shows a schematic structural diagram of another OSPF (or called OSPF Opaque) message for carrying the information of the first hash algorithm and the information of the first quantity provided by the embodiment of the present application.
  • OSPF or called OSPF Opaque
  • the extended OSPF message can include link state (link state, LS) lifetime (age), option (options), opaque type (opaque tyep), opaque identification (opaque ID), advertisement router (advertising router), LS sequence number, LS checksum, length, device type, hash code ID, members of group).
  • Fig. 8c exemplarily shows a schematic structural diagram of another BGP (or called BGP Opaque) message for carrying the information of the first hash algorithm and the information of the first quantity provided by the embodiment of the present application.
  • the BGP message includes address family identifier (address family identifier) (2 bytes (octets)), follow-up address family identifier (subsequent address family identifier) (1 byte (octets)), the next Hop address length (length of next hop address) (octets), must be 0 (must be zero), reserved bit (reserved) (1 byte (octets)), must be 0 (must be zero), Opaque key length (opaque key length) (2 bytes (octets)), opaque key data (opaque key data) (4 bytes (octets)).
  • address family identifier 2 bytes (octets)
  • follow-up address family identifier
  • the device type (device type), hash algorithm code ID (hash code ID) and group members (members of group) in Figure 8b and Figure 8c can all refer to the content of the aforementioned Figure 8a, and will not be repeated here.
  • the information of the first hash algorithm or the information of the first quantity can also be carried by the LACP message, and the carried information is similar to the information carried by protocols such as LLDP, and will not be repeated here.
  • Table 6 and Table 7 exemplarily show the schematic table of network utilization rate in the following content.
  • the first communication device is the TOR-level communication device in Figure 2a
  • the second communication device is the leaf-level communication device in Figure 2a
  • both use the same hash algorithm information that is, the first hash algorithm information corresponds to
  • the hash algorithm is the same as the hash algorithm corresponding to the second hash algorithm information
  • the parameter items of the hash key information corresponding to the first hash algorithm information are the same as the parameter items of the hash key information corresponding to the second hash algorithm information
  • the arrangement order of each parameter item of the hash key information corresponding to the first hash algorithm information is the same as the arrangement order of each parameter item of the hash key information corresponding to the second hash algorithm information
  • the value acquisition method of the hash value is the same as the value acquisition method of the hash value corresponding to the second hash algorithm information.
  • the first communication device in Table 7 is the TOR-level communication device in Figure 2a
  • the second communication device is the leaf-level communication device in Figure 2a
  • the hash algorithm corresponding to the first hash algorithm information is CRC16b
  • the second hash algorithm information corresponds to
  • the hash algorithm is CRC32LO.
  • the CRC algorithm is usually identified by a generator polynomial
  • CRC16b and CRC32LO are CRC code names
  • the CRC generator polynomial corresponding to CRC16b is 0x1021.
  • the CRC generator polynomial corresponding to CRC32LO is 0x1EDC6F41, where the 0x prefix indicates that this is a number expressed in hexadecimal.
  • the parameter items of the hash key information corresponding to the first hash algorithm information are the same as the parameter items of the hash key information corresponding to the second hash algorithm information, and each parameter item of the hash key information corresponding to the first hash algorithm information
  • the arrangement order is the same as the arrangement order of each parameter item of the hash key information corresponding to the second hash algorithm information, and the value method of the hash value corresponding to the first hash algorithm information is the same as that of the hash value corresponding to the second hash algorithm information. Values are taken in the same way.
  • the load balancing device includes corresponding hardware structures and/or software modules for performing various functions.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software with reference to the units and method steps of the examples described in the embodiments disclosed in the present application. Whether a certain function is executed by hardware or computer software drives the hardware depends on the specific application scenario and design constraints of the technical solution.
  • FIG. 9 , FIG. 10 and FIG. 11 are schematic structural diagrams of possible communication devices provided by embodiments of the present application. These communication devices can be used to implement the functions of the load balancing device in the above method embodiments, and therefore can also achieve the beneficial effects of the above method embodiments.
  • the communication device may be a load balancing device as shown in FIG. 1a, FIG. 1b, FIG. 1c or 1d, or a module (such as a chip) applied to the load balancing device.
  • a communication device 1300 includes a processing unit 1310 and a transceiver unit 1320 .
  • the communication device 1300 is configured to realize the function of the load balancing device in the method embodiment shown in FIG. 4 , FIG. 6 , FIG. 7a or FIG. 7b above.
  • the message includes first hash algorithm information of a load balancing mode of the first communication device and information of a first number of first ports of the first communication device. According to the first hash algorithm information and the first quantity information, determine the second hash algorithm information of the load balancing mode of the second communication device.
  • processing unit 1310 and the transceiver unit 1320 can be directly obtained by referring to the relevant descriptions in the method embodiments shown in FIG. 4 , FIG. 6 , FIG. 7a or FIG. 7b , and will not be repeated here.
  • the communication device 1400 includes a processing circuit 1410 and an interface circuit 1420 .
  • the processing circuit 1410 and the interface circuit 1420 are coupled to each other.
  • the interface circuit 1420 may be a transceiver or an input-output interface.
  • the communication device 1400 may further include a memory for storing instructions executed by the processing circuit, or storing input data required by the processing circuit 1410 to execute the instructions, or storing data generated after the processing circuit 1410 executes the instructions.
  • the processing circuit 1410 is used to implement the functions of the processing unit 1310 described above
  • the interface circuit 1420 is used to implement the functions of the transceiver unit 1320 described above.
  • a communication device 1500 includes a processor 1510 and a communication interface 1520 .
  • the processor 1510 and the communication interface 1520 are coupled to each other.
  • the communication interface 1520 may be a transceiver or an input and output interface.
  • the communication device 1500 may further include a memory 1530 for storing instructions executed by the processor 1510 or storing input data required by the processor 1510 to execute the instructions or storing data generated by the processor 1510 after executing the instructions.
  • the processor 1510 is used to implement the functions of the processing unit 1310
  • the communication interface 1520 is used to implement the functions of the transceiver unit 1320 .
  • the message includes first hash algorithm information of a load balancing mode of the first communication device and information of a first number of first ports of the first communication device. According to the first hash algorithm information and the first quantity information, determine the second hash algorithm information of the load balancing mode of the second communication device.
  • the processor 1510 is configured to: determine the second hash algorithm according to the first hash algorithm information, the first quantity information, and the second quantity information of the second port of the second communication device information.
  • the processor 1510 is further configured to: receive the second message through the communication interface, the second message includes the third hash algorithm information of the load balancing mode of the first communication device and the information of the first communication device's Information of the third quantity of the third port. According to the first message and the second message, determine the second hash algorithm information of the load balancing mode of the second communication device.
  • the processor 1510 is configured to: determine the load balancing mode of the second communication device according to the first message, the second message, and information about the second number of the second port of the second communication device Second hash algorithm information.
  • the processor 1510 is configured to: query a preset association relationship of hash algorithm information according to the first hash algorithm information and the information of the first quantity, and obtain the second hash algorithm information.
  • the hash algorithm information association relationship includes: the association relationship between the first hash algorithm information, the first quantity information, the second quantity information of the port of the second communication device, and the second hash algorithm information.
  • the processor 1510 is configured to: determine the fourth quantity corresponding to the hash algorithm information in the N pieces of hash algorithm information; N is a positive integer; select the corresponding number from the N pieces of hash algorithm information The hash algorithm information whose fourth quantity is greater than 1 is used as the second hash algorithm information.
  • the fourth quantity corresponding to the hash algorithm information is: perform hash calculations on M messages based on the hash algorithm information, and obtain M hashes The values are respectively moduloed by the second number of ports of the second communication device, and the number of numerical values obtained after deduplication of M hash modulus values is obtained; M is an integer greater than 1.
  • the processor 1510 is configured to: select, from the N pieces of hash algorithm information, corresponding hash algorithm information with the fourth largest number as the second hash algorithm information.
  • the processor 1510 is further configured to: determine that there is no second hash algorithm information satisfying the first condition, and determine fourth hash algorithm information of a load balancing mode of the second communication device. Send a third message to the first communication device through the communication interface 1520, and the third message is used to instruct the first communication device to update the information of the first communication device according to the information of the fourth hash algorithm and the second number of ports of the second communication device.
  • the first condition includes: performing hash calculation on the first packet and the second packet based on the information of the second hash algorithm, and applying the obtained two hash values to the second hash value of the port of the second communication device respectively. The number is modulo, and the obtained two hash modulus values are different.
  • the processor 1510 is further configured to: determine that there is no second hash algorithm information satisfying the first condition, and determine fourth hash algorithm information of a load balancing mode of the second communication device. According to the fourth hash algorithm information, the information of the first number and the information of the second number of ports of the second communication device, determine the fifth hash algorithm information of the load balancing mode of the first communication device. Send a fourth message to the first communication device through the communication interface 1520, where the fourth message is used to notify the first communication device to forward the packet based on the fifth hash algorithm information.
  • the processor 1510 is further configured to: determine that the second communication device is a slave device; determine that there is no second hash algorithm information that satisfies the first condition, and update the second communication device as a master device .
  • the chip When the above communication device is a chip applied to a load balancing device, the chip implements the functions of the load balancing device in the above method embodiment.
  • the chip receives information from other modules in the load balancing device, and the information is sent to the load balancing device by other devices; or, the chip sends information to other modules in the load balancing device, and the information is sent by the load balancing device to other devices of.
  • the processor in the embodiments of the present application can be a central processing unit (Central Processing Unit, CPU), and can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field Programmable Gate Array (Field Programmable Gate Array, FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.
  • a general-purpose processor can be a microprocessor, or any conventional processor.
  • the present application also provides a computer program product, the computer program product including: computer program code or instruction, when the computer program code or instruction is run on the computer, the computer is made to execute the , the method of any one of the embodiments shown in Fig. 6, Fig. 7a or Fig. 7b.
  • the present application also provides a computer-readable storage medium, the computer-readable medium stores program code, and when the program code is run on the computer, the computer is made to execute the steps shown in Figures 4 and 6. , the method of any one of the embodiments shown in Fig. 7a or Fig. 7b.
  • the present application also provides a chip system, where the chip system may include a processor.
  • the processor is coupled with the memory, and may be used to execute the method in any one of the embodiments shown in FIG. 4 , FIG. 6 , FIG. 7 a or FIG. 7 b.
  • the chip system further includes a memory. Memory, used to store computer programs (also called code, or instructions).
  • the processor is configured to call and run a computer program from the memory, so that the device installed with the system-on-a-chip executes the method in any one of the embodiments shown in FIG. 4 , FIG. 6 , FIG. 7a or FIG. 7b .
  • the present application further provides a system, which includes the aforementioned load balancing device and network device.
  • the method steps in the embodiments of the present application may be implemented by means of hardware, or may be implemented by means of a processor executing software instructions.
  • Software instructions can be composed of corresponding software modules, and software modules can be stored in random access memory, flash memory, read-only memory, programmable read-only memory, erasable programmable read-only memory, electrically erasable programmable read-only Memory, registers, hard disk, removable hard disk, CD-ROM or any other form of storage medium known in the art.
  • An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium.
  • the storage medium may also be a component of the processor.
  • the processor and storage medium can be located in the ASIC.
  • the ASIC may be located in a load balancing device.
  • the processor and the storage medium may also exist in the load balancing device as discrete components.
  • all or part of them may be implemented by software, hardware, firmware or any combination thereof.
  • software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
  • a computer program product consists of one or more computer programs or instructions. When the computer programs or instructions are loaded and executed on the computer, the processes or functions of the embodiments of the present application are executed in whole or in part.
  • the computer can be a general purpose computer, special purpose computer, computer network, network equipment, user equipment, or other programmable apparatus.
  • Computer programs or instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, computer programs or instructions may be Wired or wireless transmission to another website site, computer, server or data center.
  • a computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrating one or more available media. Available media may be magnetic media, such as floppy disks, hard disks, and magnetic tapes; optical media, such as digital video discs; or semiconductor media, such as solid-state hard disks.
  • the computer readable storage medium may be a volatile or a nonvolatile storage medium, or may include both volatile and nonvolatile types of storage media.
  • “plurality” means two or more.
  • “And/or” describes the association relationship of associated objects, indicating that there can be three types of relationships, for example, A and/or B, which can mean: A exists alone, A and B exist at the same time, and B exists alone, where A, B can be singular or plural.
  • the character “/” generally indicates that the contextual objects are an “or” relationship; in the formulas of this application, the character “/” indicates that the contextual objects are a “division” Relationship.
  • “Including at least one of A, B and C” may mean: including A; including B; including C; including A and B; including A and C; including B and C; including A, B and C.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

一种负载均衡的哈希算法信息的确定方法、装置及存储介质,用于根据第一通信设备的第一哈希算法信息和第一端口的第一数量的信息确定第二通信设备的用于负载均衡的第二哈希算法信息。本申请中负载均衡设备接收第一消息。第一消息包括第一通信设备的负载均衡方式的第一哈希算法信息和第一通信设备的第一端口的第一数量的信息。负载均衡设备根据第一哈希算法信息和第一数量的信息,确定第二通信设备的负载均衡方式的第二哈希算法信息。由于负载均衡设备可以获取到第一通信设备用于进行负载均衡的第一哈希算法信息和第一数量,进而可以基于第一哈希算法信息和第一数量的信息更加合理的确定第二哈希算法信息。

Description

负载均衡的哈希算法信息的确定方法、装置及存储介质
相关申请的交叉引用
本申请要求在2021年08月03日提交中华人民共和国知识产权局、申请号为202110887822.6、申请名称为“负载均衡的哈希算法信息的确定方法、装置及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及无线通信领域,尤其涉及一种负载均衡的哈希算法信息的确定方法、装置及存储介质。
背景技术
负载均衡(Load balancing)又称负载分担(Load balance)或负载共享(load sharing),是指将流量均匀地通过多个链路转发出去。负载均衡一般用于提高网络的整体处理能力,能够在不改变现有网络结构情况下,扩展网络的带宽、增加网络的吞吐量、加强数据处理能力、提高网络的可用性。
现有负载均衡通常采用下述均衡方法:从数据报文中提取整合的比特序列得到负载均衡参数,然后采用固化的哈希(hash)算法(如:循环冗余码校验(cyclic redundancy check,CRC)算法)计算报文的哈希值,然后根据端口数目对得到的哈希值进行取模运算获得哈希模值,将报文通过与该哈希模值对应的物理端口转发出去。
在云计算及数据中心应用的网络中,因规模要求,多用架顶交换机(top of rack,TOR)/叶(leaf)二层或TOR/leaf/脊(spine)的三层组网。在多级组网中,如何为通信装置选择哈希算法信息成为亟需解决的问题。
发明内容
本申请提供一种负载均衡的哈希算法信息的确定方法、装置及存储介质,用于根据第一通信设备的第一哈希算法信息和第一端口的第一数量的信息确定第二通信设备的用于负载均衡的第二哈希算法信息。
第一方面,本申请提供一种负载均衡的哈希算法信息的确定方法,该方法中负载均衡设备接收第一消息,第一消息包括第一通信设备的负载均衡方式的第一哈希算法信息和第一通信设备的第一端口的第一数量的信息。负载均衡设备根据第一哈希算法信息和第一数量的信息,确定第二通信设备的负载均衡方式的第二哈希算法信息。
由于负载均衡设备可以获取到第一通信设备用于进行负载均衡的第一哈希算法信息,以及第一通信设备的第一出端口的第一数量的信息,进而可以基于第一哈希算法信息和第一数量的信息更加合理的确定第二哈希算法信息。
一种可能的实施方式中,负载均衡设备可以根据第一哈希算法信息、第一数量的信息和第二通信设备的第二端口的第二数量的信息,确定第二哈希算法信息。由于第二通信设备对报文进行负载均衡的过程中需要将基于第二哈希算法信息计算的哈希值对第二数量 进行取模,进而依据得到的哈希模值确定该报文对应的出端口,即第二数量会对第二通信设备的报文在各个端口的分配造成影响,因此,结合第二通信设备的端口数量可以更加合理的确定第二哈希算法信息。
一种可能的实施方式中,由于第一通信设备进行负载均衡时将哈希值对第一数量进行取模,而第二通信设备时将哈希值对第二数量进行取模,因此第一数量和第二数量不同时,第一哈希算法信息和第二哈希算法信息可以不同,也可以相同。即使第一哈希算法信息和第二哈希算法信息相同,针对第二通信设备接收到的基于第一哈希算法信息和第一数量进行均衡后的报文,第二通信设备也有可能通过不同的链路发送接收到多个报文,因此,可以减轻网络的极化现象。
另一种可能的实施方式中,第一数量与第二数量相同,第一哈希算法信息与第二哈希算法信息不同,则针对第二通信设备接收到的基于第一哈希算法信息和第一数量进行均衡后的报文,第二通信设备也有可能通过不同的链路发送接收到多个报文,因此,可以减轻网络的极化现象。
一种可能的实施方式中,第一哈希算法信息包括以下内容中的至少一项:第一哈希算法、第一哈希关键信息的参数项、第一哈希关键信息的各个参数项的排列顺序、第一哈希值取值方式。第二哈希算法信息包括以下内容中的至少一项:第二哈希算法、第二哈希关键信息的参数项、第二哈希关键信息的各个参数项的排列顺序,或第二哈希值取值方式。如此,可以与现有技术更加兼容。
为了提高方案的灵活性,一种可能的实施方式中,在第一哈希算法信息与第二哈希算法信息不同的情况下,第一哈希算法信息和所是第二哈希算法信息满足以下内容中的至少一项:第一哈希算法与第二哈希算法不同;第一哈希关键信息的参数项与第二哈希关键信息的参数项不同;第一哈希关键信息的各个参数项的排列顺序与第二哈希关键信息的各个参数项的排列顺序不同;或,第一哈希值取值方式与第二哈希值取值方式不同。
本申请适用于多种负载均衡技术,比如第一数量可以包括:第一通信设备的等价多路径(ECMP group)成员数量。这种情况下,上述第一哈希算法信息也可以适用于基于ECMP技术进行负载均衡的过程中。再比如,第一通信设备的链路汇聚组(LAG group)成员数量。这种情况下,上述第一哈希算法信息也可以适用于基于LAG技术进行负载均衡的过程中。
一种可能的实施方式中,负载均衡设备还可以接收第二消息,第二消息包括第一通信设备的负载均衡方式的第三哈希算法信息和第一通信设备的第三端口的第三数量的信息。负载均衡设备可以根据第一消息和第二消息,确定第二通信设备的负载均衡方式的第二哈希算法信息。由于第一通信设备可以进行一次负载均衡,也可以进行多次负载均衡,且进行的多次负载均衡中的一次或多次可能会对第二通信设备接收到的报文的多样性造成影响,因此若第一通信设备可以将进行的多次负载均衡的哈希算法信息均发送至负载均衡设备,则负载均衡设备可以确定出更加合理的第二哈希算法信息。
一种可能的实施方式中,第一数量包括第一通信设备的等价多路径(ECMP group)成员数量,第三数量包括第一通信设备的链路汇聚组(LAG group)成员数量。如此,可以与现有技术更加兼容。
一种可能的实施方式中,负载均衡设备可以根据第一消息、第二消息和第二通信设备的第二端口的第二数量的信息,确定第二通信设备的负载均衡方式的第二哈希算法信息。 由于第二通信设备对报文进行负载均衡的过程中需要将基于第二哈希算法信息计算的哈希值对第二数量进行取模,进而依据得到的哈希模值确定该报文对应的出端口,即第二数量会对第二通信设备的报文在各个端口的分配造成影响,因此,结合第二通信设备的端口数量可以更加合理的确定第二哈希算法信息。
一种可能的实施方式中,第二哈希算法信息满足第一条件,第一条件包括:基于第二哈希算法信息对第一报文和第二报文分别进行哈希计算,并将得到的两个哈希值分别对第二通信设备的第二端口的第二数量取模,得到的两个哈希模值不同。如此,针对接收到的第一报文和第二报文,可以通过两个不同的哈希模值对应的两个不同的端口发送,从而可以减轻网络极化问题。
一种可能的实施方式中,第一条件还包括:基于第一哈希算法信息对第一报文和第二报文分别进行哈希计算,并将得到的两个哈希值分别对第一数量取模,得到的两个哈希模值相同。如此,第一报文和第二报文可以是由第二通信设备的两个不同的或相同的上一级设备(包括第一通信设备和其他的通信设备)基于第一哈希算法信息和第一数量进行负载均衡后发送给第二通信设备的。进而,针对满足第一条件的第一报文和第二报文,基于第二哈希算法信息进行负载均衡后可以通过不同的链路发送,从而可以减轻极化问题。
一种可能的实施方式中,第一条件还包括:基于第三哈希算法信息对第一报文和第二报文分别进行哈希计算,并将得到的两个哈希值分别对第三数量取模,得到的两个哈希模值在第一通信设备对应的端口连接至第二通信设备。其中,第三哈希算法信息为第一通信设备的负载均衡方式对应的哈希算法信息,第三数量包括第一通信设备的第三端口的数量。如此,第一报文和第二报文则均是第二通信设备的上一级设备基于第一哈希算法信息、第一数量、第三哈希算法信息和第三数量进行负载均衡后发送至第二通信设备的。进而,针对满足第一条件的第一报文和第二报文,基于第二哈希算法信息进行负载均衡后可以通过不同的链路发送,从而可以减轻极化问题。
又一种可能的实施方式中,负载均衡设备可以预先建立哈希算法信息关联关系,该哈希算法信息关联关系可以存储于表格,或者其他形式的文档中。其中,哈希算法信息关联关系包括:第一哈希算法信息、第一数量的信息、第二通信设备的端口的第二数量的信息和第二哈希算法信息的关联关系。如此,负载均衡设备可以根据第一哈希算法信息和第一数量的信息,查询预设的哈希算法信息关联关系,得到第二哈希算法信息。
一种可能的实施方式中,哈希算法信息关联关系还包括:第一哈希算法信息、第一数量的信息、第三哈希算法信息、第三数量的信息、第一通信设备连接至第二通信设备的端口对应的哈希模值的信息、第二通信设备的端口的第二数量的信息和第二哈希算法信息的关联关系。如此,可以根据第一通信设备的多个哈希算法信息从哈希算法信息关联关系中查找出更加合理的、多样性损失较少的第二哈希算法信息。
一种可能的实施方式中,负载均衡设备可以确定N个哈希算法信息中哈希算法信息对应的第四数量;N为正整数。从N个哈希算法信息中选择对应的第四数量大于1的哈希算法信息作为第二哈希算法信息。其中,针对N个哈希算法信息中的哈希算法信息,哈希算法信息对应的第四数量为:基于哈希算法信息对M个报文分别进行哈希计算,将得到的M个哈希值分别对第二通信设备的端口的第二数量取模,并将得到M个哈希模值去重后所得到数值的数量;M为大于1的整数。如此,M个报文可以基于第二哈希算法信息和第二数量进行负载均衡后,被分配到至少两个链路,从而可以减轻网络的极化问题。
一种可能的实施方式中,负载均衡设备可以从N个哈希算法信息中选择对应的第四数量最大的哈希算法信息作为第二哈希算法信息。如此,若选择第四数量最大的哈希算法信息作为第二哈希算法信息,则可以将M个报文尽可能的分配到更多的链路进行传输,从而可以尽可能的减轻网络的极化问题。
一种可能的实施方式中,M个报文满足第二条件,第二条件包括:基于第一哈希算法信息对M个报文分别进行哈希计算,并将得到的M个哈希值分别对第一数量取模,得到的M个哈希模值相同。如此,若其他通信设备接收到M个报文,则基于第一哈希算法信息和第一数量进行负载均衡后,会将M个报文发送至第二通信设备。进而,针对满足第二条件的M个报文,基于第二哈希算法信息进行负载均衡后可以通过不同的链路发送,从而可以减轻极化问题。
一种可能的实施方式中,第二条件,还包括:基于第三哈希算法信息对M个报文分别进行哈希计算,并将得到的M个哈希值分别对第三数量取模,得到的M个哈希模值在第一通信设备对应的层2物理端口连接至第二通信设备。其中,第三哈希算法信息为第一通信设备的负载均衡方式对应的哈希算法信息,第三数量包括第一通信设备的第三端口的数量。
如此,第一报文和第二报文则均是第二通信设备的上一级设备基于第一哈希算法信息、第一数量、第三哈希算法信息和第三数量进行负载均衡后发送至第二通信设备的。进而,针对满足第一条件的第一报文和第二报文,基于第二哈希算法信息进行负载均衡后可以通过不同的链路发送,从而可以减轻极化问题。
一种可能的实施方式中,负载均衡设备接收第一消息之后,还包括:确定不存在满足第一条件的第二哈希算法信息,确定第二通信设备的负载均衡方式的第四哈希算法信息;向第一通信设备发送第三消息,第三消息用于指示第一通信设备根据第四哈希算法信息和第二通信设备的端口的第二数量的信息更新第一通信设备的负载均衡方式对应的哈希算法信息。
如此,第一通信设备可以重新选择哈希算法,以达到减轻网络中的极化问题,第一通信设备选择哈希算法以及其他哈希算法信息中的参数中的方案可以参加前述为第二通信设备选择第二哈希算法信息的方法,在此不再赘述。
一种可能的实施方式中,负载均衡设备接收第一消息之后,还包括:确定不存在满足第一条件的第二哈希算法信息,确定第二通信设备的负载均衡方式的第四哈希算法信息。负载均衡设备根据第四哈希算法信息、第一数量的信息和第二通信设备的端口的第二数量的信息,确定第一通信设备的负载均衡方式的第五哈希算法信息。负载均衡设备向第一通信设备发送第四消息,第四消息用于通知第一通信设备基于第五哈希算法信息进行报文转发。
如此,负载均衡设备可以重新为第一通信设备选择哈希算法,以达到减轻网络中的极化问题,为第一通信设备选择哈希算法以及其他哈希算法信息中的参数中的方案可以参加前述为第二通信设备选择第二哈希算法信息的方法,在此不再赘述。
一种可能的实施方式中,第四哈希算法信息满足以下条件:基于第四哈希算法信息对第三报文和第四报文分别进行哈希计算,并将得到的两个哈希值分别对第二数量取模,得到的两个哈希模值不同。如此,第三报文和第四报文可以在第二通信设备上通过两条链路进行发送,从而可以减轻网络的极化问题。
一种可能的实施方式中,第三报文和第四报文满足:基于第五哈希算法信息对第三报文和第四报文分别进行哈希计算,并将得到的两个哈希值分别对第一数量取模,得到的两个哈希模值相同。如此第二通信设备的上级设备基于第五哈希算法信息和第一数量进行负载均衡后可以将第三报文和第四报文发送至第二通信设备。进而,第三报文和第四报文可以在第二通信设备上通过两条链路进行发送,从而可以减轻网络的极化问题。
一种可能的实施方式中,负载均衡设备根据第一哈希算法信息和第一数量的信息,确定第二通信设备的负载均衡方式的第二哈希算法信息之前,还包括:确定第二通信设备为从设备。负载均衡设备接收第一通信设备的负载均衡方式的第一哈希算法信息和第一通信设备的端口的第一数量的信息之后,还包括:确定不存在满足第一条件的第二哈希算法信息,将第二通信设备更新为主设备。如此,可以基于为第二通信设备确定的新的哈希算法信息重新为第一通信设备选择哈希算法信息,从而达到减轻网络极化问题的目的。
一种可能的实施方式中,第一哈希算法信息或第一数量的信息中的至少一项承载于以下信息:链路层发现协议LLDP消息、开发的最短路径优先路由协议OSPF消息,或边界网关路由协议BGP消息。如此,可以更加与现有技术兼容。
第二方面,提供了一种通信装置,该通信装置可以为前述负载均衡设备,该通信装置可以包括通信单元和处理单元,以执行上述第一方面或第一方面的任一种实施方式。通信单元用于执行与发送和接收相关的功能。可选地,通信单元包括接收单元和发送单元。在一种设计中,通信装置为通信芯片,处理单元可以是一个或多个处理器或处理器核心,通信单元可以为通信芯片的输入输出电路或者端口。
在另一种设计中,通信单元可以为发射器和接收器,或者通信单元为发射机和接收机。
可选的,通信装置还包括可用于执行上述第一方面或第一方面的任一种实施方式的各个模块。
第三方面,提供了一种通信装置,该通信装置可以为前述负载均衡设备,该通信装置可以包括处理器和存储器。可选的,还包括收发器,该存储器用于存储计算机程序或指令,该处理器用于从存储器中调用并运行该计算机程序或指令,当处理器执行存储器中的计算机程序或指令时,使得该通信装置执行上述第一方面或第一方面的任一种实施方式。
可选的,处理器为一个或多个,存储器为一个或多个。
可选的,存储器可以与处理器集成在一起,或者存储器与处理器分离设置。
可选的,收发器中可以包括,发射机(发射器)和接收机(接收器)。
第四方面,提供了一种通信装置,该通信装置可以为前述负载均衡设备,该通信装置可以包括处理器。该处理器与存储器耦合,可用于执行第一方面或第一方面的任一种实施方式。可选地,该通信装置还包括存储器。可选地,该通信装置还包括通信接口,处理器与通信接口耦合。
在一种实现方式中,该通信装置为负载均衡设备时,通信接口可以是收发器,或,输入/输出接口。可选地,收发器可以为收发电路。可选地,输入/输出接口可以为输入/输出电路。
在又一种实现方式中,当该通信装置为芯片或芯片系统时,通信接口可以是该芯片或 芯片系统上的输入/输出接口、接口电路、输出电路、输入电路、管脚或相关电路等。处理器也可以体现为处理电路或逻辑电路。
第五方面,提供了一种系统,系统包括上述通信装置、第一通信设备和第二通信设备。
第六方面,提供了一种计算机程序产品,计算机程序产品包括:计算机程序(也可以称为代码,或指令),当计算机程序被运行时,使得计算机执行上述第一方面或第一方面的任一种实施方式。
第七方面,提供了一种计算机可读存储介质,计算机可读介质存储有计算机程序(也可以称为代码,或指令)当其在计算机上运行时,使得计算机执行上述第一方面或第一方面的任一种实施方式。
第八方面,提供了一种芯片系统,该芯片系统可以包括处理器。该处理器与存储器耦合,可用于执行上述第一方面或第一方面的任一种实施方式。可选地,该芯片系统还包括存储器。存储器,用于存储计算机程序(也可以称为代码,或指令)。处理器,用于从存储器调用并运行计算机程序,使得安装有芯片系统的设备执行第一方面或第一方面的任一种实施方式。
第九方面,提供了一种处理装置,包括:接口电路和处理电路。接口电路可以包括输入电路和输出电路。处理电路用于通过输入电路接收信号,并通过输出电路发射信号,使得第一方面或第一方面的任一种实施方式被实现。
在具体实现过程中,上述处理装置可以为芯片,输入电路可以为输入管脚,输出电路可以为输出管脚,处理电路可以为晶体管、门电路、触发器和各种逻辑电路等。输入电路所接收的输入的信号可以是由例如但不限于接收器接收并输入的,输出电路所输出的信号可以是例如但不限于输出给发射器并由发射器发射的,且输入电路和输出电路可以是同一电路,该电路在不同的时刻分别用作输入电路和输出电路。本申请对处理器及各种电路的具体实现方式不做限定。
在一种实现方式中,通信装置可以是负载均衡设备中的部分器件,如系统芯片或通信芯片等集成电路产品。接口电路可以为该芯片或芯片系统上的输入/输出接口、接口电路、输出电路、输入电路、管脚或相关电路等。处理电路可以为该芯片上的逻辑电路。
附图说明
图1a、图1b、图1c和图1d为本申请实施例适用的几种系统架构示意图;
图2a、图2b、图2c和图2d为本申请实施例提供的几种系统架构示意图;
图3为本申请实施例提供的一种通信设备的结构示意图;
图4为本申请实施例提供的一种负载均衡的哈希算法信息的确定方法的流程示意图;
图5为本申请实施例提供的一种哈希关键信息的多样性的分布示意图;
图6为本申请实施例提供的又一种负载均衡的哈希算法信息的确定方法的流程示意图;
图7a为本申请实施例提供的又一种负载均衡的哈希算法信息的确定方法的流程示意图;
图7b为本申请实施例提供的又一种负载均衡的哈希算法信息的确定方法的流程示意图;
图8a为本申请实施例提供的一种用于承载第一哈希算法信息和第一数量的信息的扩展LLDP消息的结构示意图;
图8b为本申请实施例提供的另一种用于承载第一哈希算法信息和第一数量的信息的OSPF消息的结构示意图;
图8c为本申请实施例提供的另一种用于承载第一哈希算法信息和第一数量的信息的BGP消息的结构示意图;
图9为本申请实施例提供的一种通信装置的结构示意图;
图10为本申请实施例提供的又一种通信装置的结构示意图;
图11为本申请实施例提供的又一种通信装置的结构示意图。
具体实施方式
应理解,本申请实施例的技术方案可以应用于各种通信系统,例如:数据中心网络包括的数据中心内部服务器接入交换机及交换机与交换机间互联、运营商跨城域互联或骨干网、移动承载前传或回传领域、城域多业务承载、数据中心互联、工业通讯等基于以太网技术的通讯系统,以及工业或通讯设备内不同元器件或模块之间的通讯系统。
图1a、图1b、图1c和图1d示例性示出了本申请实施例适用的几种系统架构示意图,如图1a所示,该系统架构包括第一通信设备和负载均衡设备。负载均衡设备可以与第一通信设备连接,用于接收第一通信设备用于进行负载均衡的第一哈希算法信息和第一通信设备的第一端口的数量(为了区分,将第一端口的数量称为第一数量)的信息。负载均衡设备根据第一哈希算法信息和第一数量的信息,为第二通信设备选择第二哈希算法信息。本申请实施例中第一数量的信息是指能够指示出第一数量的信息。
如图1a所示,该系统架构还可以包括有第二通信设备,第二通信设备可以基于负载均衡设备为其选择的第二哈希算法信息进行报文的发送。第一通信设备可以为第二通信设备的上游,第一通信设备将报文发送给第二通信设备,再由第二通信设备发送给其他设备。第一通信设备也可以为第二通信设备的下游,第二通信设备将报文发送给第一通信设备,再由第一通信设备发送给其他设备。后续部分内容为了更清楚的介绍本申请实施例提供的方案,后续内容以第一通信设备为第二通信设备的上游为例进行介绍。
本申请实施例中的第一通信设备和第二通信设备可以为网络设备,或为设置于网络设备内部的芯片。该设备包括但不限于:数据中心交换机、运营商城域网路由器、园区网交换机、人工智能(artificial intelligence,AI)及高性能计算网络交换机、核心路由器、基于网络协议的无线电接入网(Internet Protocol Radio Access Network,IPRAN)、分组传送网(Packet Transport Network,PTN)盒式或框式交换机设备等。
本申请实施例中负载均衡设备与第二通信设备的关系有多种,如图1a中所示,负载均衡设备可以为第二通信设备中的一个模块或单元。如图1b中所示,负载均衡设备还可以为独立于第一通信设备和第二通信设备的一个设备。
本申请实施例中第一通信设备和第二通信设备可以分别为不同的设备,如图1a和图1b中所示。另一种可能的实施方式中,如图1c和图1d所示,第一通信设备和第二通信设备还可以为同一个通信装置100中,比如第一通信设备可以为通信装置100中的层3(Layer 3,L3)通信模块,第二通信设备可以为通信装置100中的层2(Layer 2,L2)通信模块;第一通信设备可以基于第一哈希算法信息在层3为报文选择下一跳,第二通信设备可以基于 第二哈希算法信息在层2为报文选择层2的端口。再比如,第一通信设备可以为通信装置100中的层2通信模块,第二通信设备可以为通信装置100中的层3通信模块;第二通信设备可以基于第二哈希算法信息在层3为报文选择下一跳,第一通信设备可以基于第一哈希算法信息在层2为报文选择层2的端口。图1c和图1d中,该实施例的相关内容将在后续进行详细介绍,在此先不做阐述。后续内容为了更清楚的介绍本申请实施例提供的方案,后续部分内容以第一通信设备可以为通信装置100中的层3通信模块,第二通信设备可以为通信装置100中的层2通信模块为例进行介绍。
此外,图1c中负载均衡设备可以为独立于第一通信设备和第二通信设备的模块,图1d中负载均衡设备可以为第二通信设备中的一个模块。当然,图1c中负载均衡设备也可以为通信装置100之外的其他设备上的模块,本申请实施例不做限定。
在进一步介绍本申请实施例之前,先对本申请实施例涉及到的术语和名词进行解释。
(1)负载均衡方式所采用的技术。
本申请实施例中的第一通信装置的第一哈希算法信息可以适用于多种场景,比如第一通信设备可以基于第一哈希算法信息为报文选择下一跳,比如可以基于等价多路径路由(equal-cost multi-path,ECMP)技术为报文选择下一跳。其中,第一通信设备为报文选择下一跳也可以理解为第一通信设备为报文选择逻辑端口,比如在层3为报文选择逻辑端口。本申请实施例中的逻辑端口也可以称为逻辑出端口。
再比如,第一通信设备可以基于第一哈希算法信息为报文选择物理端口,比如在层2为报文选择物理端口,比如可以基于链路聚合(link aggregation,LAG)技术为报文选择物理端口,LAG也可以称为端口汇聚(trunk)技术。其中,物理端口也可以称为物理出端口。
(2)ECMP。
下面以第一通信设备基于第一哈希算法信息通过ECMP技术进行负载均衡为例进行介绍,为了区分,将第一哈希算法信息中包括的哈希算法称为第一哈希算法,将第一哈希算法信息中的哈希关键信息称为第一哈希关键信息,将第一哈希算法信息中的哈希值取值方式称为第一哈希值取值方式:
第一通信设备接收到第一报文,获取第一报文的层3的网络层标识(即目的网际协议(internet protocol,IP)地址(destination IP address,DIP)等),查询网络层路由表。
第一通信设备在根据网络层路由表确定去往第一报文的目的IP的路径有多条(即去往目的IP的路径存在多个等价下一跳)的情况下,执行以下内容:
第一通信设备根据预设的第一哈希关键信息的参数项,从第一报文中提取第一哈希关键信息的参数项对应的信息。
第一通信设备根据预设的第一哈希关键信息的各个参数项的排列顺序,将提取到的第一哈希关键信息的各个参数项的信息依序排列,构成第一哈希关键信息(hash key)(需要说明的是,如果未提取到某些参数项的信息,则可以根据预设的规则在第一哈希关键信息的对应字段填充预设值)。
第一通信设备基于第一哈希算法对第一哈希关键信息进行哈希计算,基于第一哈希值取值方式从得到的值中确定出哈希值。
第一通信设备将得到的哈希值对第一通信设备的第一端口的第一数量做取模运算,得到第一报文的哈希模值。需要说明的是,第一通信设备的第一端口的第一数量:在该示例 中可以理解为第一报文在第一通信设备上对应的ECMP组(Group)成员数量;也可以理解为去往第一报文的目的IP的路径的总数量,或者理解为去往第一报文的目的IP的IP子网的路径的总数量;或者,或理解为去往第一报文的目的IP所在子网的下一跳数目。
进一步,第一通信设备根据预设的哈希模值与下一跳的通信设备之间的对应关系(或者称预设的哈希模值与预设的逻辑出端口之间的对应关系),确定出该第一报文的哈希模值对应的下一跳信息(比如确定出下一跳为第二通信设备),则第一通信设备向下一跳(比如第二通信设备)发送第一报文。其中,第一通信设备确定下一跳也可以理解为确定逻辑出端口,第一通信设备可以通过该逻辑出端口发送该报文。
上述内容以下面以第一通信设备基于第一哈希算法信息通过ECMP技术进行负载均衡为例进行介绍,其他通信设备基于其他哈希算法信息通过ECMP技术进行负载均衡的方案与之类似,可能采用的哈希算法信息和ECMP组成员数量会不同,在此不再赘述。
(3)LAG。
下面以第一通信设备基于第一哈希算法信息通过LAG技术进行负载均衡为例进行介绍,为了区分,将第一哈希算法信息中包括的哈希算法称为第一哈希算法,将第一哈希算法信息中的哈希关键信息称为第一哈希关键信息,将第一哈希算法信息中的哈希值取值方式称为第一哈希值取值方式:
第一通信设备接收到第一报文,获取第一报文的层2的链路层标识(即目的媒体访问控制(Medium Access Control,MAC)地址(destination MAC)等),查询MAC表。
第一通信设备在根据MAC表确定去往第一报文的目的MAC的端口有多个的情况下,执行以下内容:
第一通信设备根据预设的第一哈希关键信息的参数项,从第一报文中提取第一哈希关键信息的参数项对应的信息。
第一通信设备根据预设的第一哈希关键信息的各个参数项的排列顺序,将提取到的第一哈希关键信息的各个参数项的信息依序排列,构成第一哈希关键信息(hash key)(需要说明的是,如果未提取到某些参数项的信息,则可以根据预设的规则在第一哈希关键信息的对应字段填充预设值)。
第一通信设备基于第一哈希算法对第一哈希关键信息进行哈希计算,基于第一哈希值取值方式从得到的值中确定出哈希值。
第一通信设备将得到的哈希值对第一通信设备的第一端口的第一数量做取模运算,得到第一报文的哈希模值;需要说明的是,第一通信设备的第一端口的第一数量在该示例中可以理解为第一报文在第一通信设备上对应的LAG组(Group)成员数量,也可以理解为第一报文的目的MAC在第一通信设备上对应的端口的总数量,或者理解为去往第一报文的目的MAC的路径的总数量。
进一步,第一通信设备根据预设的哈希模值与端口(可以理解为物理出端口)之间的对应关系,确定出该第一报文的哈希模值对应的端口,并通过该端口发送该第一报文。
上述内容以下面以第一通信设备基于第一哈希算法信息通过LAG技术进行负载均衡为例进行介绍,第一通信设备基于第三哈希算法信息通过LAG技术进行负载均衡的方式与之类似,区别是将第一哈希算法信息中的各个项对应替换为第三哈希算法信息中的各个项,且将第一数量替换为第一通信设备的第三端口的第三数量,其余内容与之类似,在此不再赘述。且其他哈希算法信息通过LAG技术进行负载均衡的方案与之类似,可能采用 的哈希算法信息和LAG组成员数量会不同,在此不再赘述。
图2a示例性示出了本申请实施例提供的一种系统架构示意图,如图2a所示,本申请实施例中可以适用于3级克洛斯(CLOS)网络架构,该网络架构包括TOR/leaf/spine三级组网,每级可以包括多个通信设备(通信设备可以为交换机),如图2a所示,TOR级包括8个通信设备,在图2a中分别用1-8标识;leaf级包括8个通信设备,在图2a中分别用1-8标识;spine级包括16个通信设备,在图2a中分别用1-16标识。TOR级的通信设备可以连接一个或多个服务器,比如TOR级的通信设备8连接的服务器118、TOR级的通信设备7连接的服务器117、TOR级的通信设备2连接的服务器116,以及TOR级的通信设备1连接的服务器115。
在图2a所示的系统架构下,通常可以有2次流量负载均衡,一次是从TOR的通信设备到leaf的通信设备的转发方向上,另一次是从Leaf的通信设备到spine的通信设备的转发方向上。比如,TOR级的通信设备8通过4条链路连接leaf级的通信设备,用于将自身的报文通过该4条链路发送至leaf级,比如可以通过上述ECMP技术进行报文发送。leaf级的通信设备8通过4条链路连接spine级的通信设备,用于将自身的报文通过该4条链路发送至spine级,比如可以通过上述ECMP技术进行报文发送。
上述图1a和图1b中的第一通信设备可以为图2a中的TOR级的通信设备,第二通信设备可以为图2a中的leaf级的通信设备;或者,第一通信设备为图2a中的leaf级的通信设备,第二通信设备为图2a中的TOR级的通信设备。负载均衡设备可以为第二通信设备内部的一个模块,也可以为独立于TOR级的通信设备和leaf级的通信设备的一个设备或模块。
举个例子,TOR级通信设备8接收到第一报文和第二报文后,基于自身的哈希算法信息和端口数量,计算出第一报文的哈希模值与第二报文的哈希模值相同,则将第一报文和第二报文发送至同一个leaf级通信设备,比如leaf级的通信设备8。其中,第一报文和第二报文可能来源于同一个服务器,也可能来源于不同的服务器。
进一步,leaf级通信设备8接收到第一报文和第二报文后,基于自身的哈希算法信息和端口数量,计算出该两个报文对应的哈希模值。由于TOR级通信设备8基于自身的哈希算法信息和端口数量计算出的该两个报文的哈希模值相同,因此,leaf级通信设备8基于自身的哈希算法信息和端口数量计算出的该两个报文的哈希模值也相同。如此,针对leaf级接收到的来自TOR的通信设备8的多个报文,leaf级的通信设备8仅通过一条链路发送该多个报文,并不能将该多个报文均衡至多个链路进行发送。
另一方面,leaf级通信设备8也会接收到来自其他TOR级的通信设备的(TOR级的通信设备7)的一个或多个报文,比如第三报文和第四报文。类似的,由于TOR级通信设备7基于自身的哈希算法信息和端口数量,根据计算出的第三报文的哈希模值与第四报文的哈希模值将该两个报文发送至Leaf级通信设备8,因此,leaf级的通信设备8基于自身的哈希算法信息和端口数量,计算出的第三报文和第四报文的哈希模值也相同。在TOR级通信设备7和TOR级通信设备8的哈希算法信息相同,且二者端口数量也相同的情况下,leaf级的通信设备8计算出的第一报文、第二报文、第三报文和第四报文的哈希模值均相同,因此,针对leaf级接收到的来自不同的TOR级的通信设备(TOR级的通信设备7和TOR级的通信设备8)的多个报文,leaf级的通信设备8仅通过一条链路发送该四个报文, 并不能将该多个报文均衡至多个链路进行发送。
流量负载均衡追求的是均衡,即期望转发的流量平均分担到下行的多个链路。而如果待转发流量未均匀分摊至下行的多个链路,则会出现链路负载有高有低,在高负载链路逼近满载的时候低负载链路空闲,整体的网络利用率低下,这种现象被称为极化。通过上述分析可以看出,若要减缓极化现象的发生,则需要更合理的为进行负载均衡的设备设置哈希算法信息,这正是本申请实施例要解决的问题。
需要说明的是,上述图2a中以通信设备之间进行的是层3的哈希算法为例进行示意,在实际应用中,图2a所示的任何一个需进行负载均衡的设备可以进行层3的负载均衡,还可以进行层2的负载均衡,举个例子,TOR级通信设备8基于LAG可以有多条链路通往leaf级通信设备8,再比如,leaf级通信设备8基于LAG可以有多条链路通往spine级通信设备16。这种情况下,TOR级通信设备8需要在层3和层2分别进行负载均衡,leaf级通信设备8需要在层3和层2分别进行负载均衡。
图2b示例性示出了本申请实施例提供的一种系统架构示意图,如图2b所示,本申请实施例中可以适用于采用链路汇聚组(link aggregation group,LAG)/端口汇聚(trunk)进行流量负载均衡的网络架构,也适用于采用绑定(bonding)进行流量负载均衡的服务器与交换机之间的负载均衡信息的交互。
图2b示出了3级L2网络的系统架构,图2b中,TOR级通信设备通过Leaf级通信设备互联,服务器#A1和服务器#A2可以采用bond链路聚合模式接入TOR级通信设备,比如TOR#1和TOR#2。TOR#1和TOR#2背靠背通过链路聚合连接到leaf#1和leaf#2。leaf#1和leaf#2背靠背链路聚合连接到TOR#3和TOR#4。服务器#B1和服务器#B 2采用bond链路聚合模式接入TOR#3和TOR#4。
图2c示例性示出了本申请实施例提供的一种系统架构示意图,与图2b的区别为,图2c所示的系统架构中去除leaf级通信设备,为2级L2网络的系统架构。
如图2b所示,从服务器#A1和服务器#A2到达服务器#B1和服务器#B 2的流量会先在服务器做一次hash,然后在TOR级通信设备上做一次哈希。由于进行了两次哈希,基于前述图2a论述的两次哈希造成的极化问题,若图2b中服务器侧和TOR级通信设备侧的哈希算法信息选择不合理,则也会导致极化问题。
可以继续参见图2b,若leaf#1和leaf#2到TOR#3和TOR#4之间背靠背有多个链路,则从服务器#A1和服务器#A2到达服务器#B1和服务器#B 2的流量可以先在TOR级通信设备(TOR#1和TOR#2)上做一次哈希,之后在leaf级通信设备(leaf#1和leaf#2)上做一次哈希。由于进行了两次哈希,基于前述图2a论述的两次哈希造成的极化问题,若TOR级通信设备和leaf级通信设备侧的哈希算法信息选择不合理,也会导致极化问题。
需要补充的是,还有一种可能的情况,若leaf#1和leaf#2到TOR#3和TOR#4之间背靠背有1个链路,但是leaf#1和leaf#2基于绑定(bonding)双归接入到TOR#3和TOR#4,则:从服务器#A1和服务器#A2到达服务器#B1和服务器#B 2的流量可以先在TOR级通信设备(TOR#1和TOR#2)上做一次哈希,之后在leaf级通信设备(leaf#1和leaf#2)上做一次哈希。由于进行了两次哈希,基于前述图2a论述的两次哈希造成的极化问题,若TOR级通信设备和leaf级通信设备侧的哈希算法信息选择不合理,也会导致极化问题。
如图2b和如图2c所示,又一种可能的实施方式中,服务器同时接入两个TOR级通信 设备,该两个链路可以是主-备模式。以服务器#A1举例,服务器#A1发送的报文可以先在服务器的层3按照IP地址基于ECMP(进行一次哈希运算)选择下一跳;然后在服务器#A1的层2基于LAG(再进行一次哈希运算)选择端口链路。由于进行了两次哈希,基于前述图2a论述的两次哈希造成的极化问题,若图2b中服务器侧层3和层2的哈希算法信息选择不合理,则也会导致极化问题。
如图2b和如图2c所示,又一种可能的实施方式中,来自服务器#A1和服务器#A2的报文到TOR#1,则TOR#1可以先在层3按照IP地址基于ECMP(进行一次哈希运算)选择下一跳;然后在TOR#1的层2基于LAG(再进行一次哈希运算)选择端口链路。由于进行了两次哈希,基于前述图2a论述的两次哈希造成的极化问题,若图2b中TOR#1侧层3和层2的哈希算法信息选择不合理,则也会导致极化问题。若要减缓极化现象的发生,则需要更合理的为进行负载均衡的设备设置哈希算法信息,这正是本申请实施例要解决的问题。
需要说明的是,上述图1a和图1b中的第一通信设备可以为图2b中的服务器,第二通信设备可以为图2b中的TOR级的通信设备。或者,第一通信设备为图2a中的TOR级的通信设备,第二通信设备为图2a中的服务器。负载均衡设备可以为第二通信设备内部的一个模块,也可以为独立于TOR级的通信设备和服务器的一个设备或模块。
或者,上述图1a和图1b中的第一通信设备可以为图2b中的TOR级的通信设备,第二通信设备可以为图2b中的leaf级的通信设备。或者,第一通信设备为图2a中的leaf级的通信设备,第二通信设备为图2a中的TOR级的通信设备。负载均衡设备可以为第二通信设备内部的一个模块,也可以为独立于TOR级的通信设备和leaf级的通信设备的一个设备或模块。
上述图1c和图1d中的第一通信设备和第二通信设备可以为图2b中的服务器中的模块。比如第一通信设备可以为服务器中层3的模块,第二通信设备可以为服务器中层2的模块。或者,第一通信设备可以为服务器中层2的模块,第二通信设备可以为服务器中层3的模块。负载均衡设备可以为服务器内部的一个模块,也可以为独立于服务器的一个设备或模块。
又一种可能的实施方式中,上述图1c和图1d中的第一通信设备和第二通信设备可以为图2b中的TOR级通信设备中的模块。比如第一通信设备可以为TOR级通信设备中层3的模块,第二通信设备可以为TOR级通信设备中层2的模块。或者,第一通信设备可以为TOR级通信设备中层2的模块,第二通信设备可以为TOR级通信设备中层3的模块。负载均衡设备可以为TOR级通信设备内部的一个模块,也可以为独立于TOR级通信设备的一个设备或模块。
又一种可能的实施方式中,上述图1c和图1d中的第一通信设备和第二通信设备可以为图2b中的leaf级通信设备中的模块。比如第一通信设备可以为leaf级通信设备中层3的模块,第二通信设备可以为leaf级通信设备中层2的模块。或者,第一通信设备可以为leaf级通信设备中层2的模块,第二通信设备可以为leaf级通信设备中层3的模块。负载均衡设备可以为leaf级通信设备内部的一个模块,也可以为独立于leaf级通信设备的一个设备或模块。
图2d示例性示出了本申请实施例提供的一种系统架构示意图,如图2d所示,本申请 实施例中可以适用于3级克洛斯(CLOS)网络架构,该网络架构包括TOR/leaf/spine三级组网,每级可以包括多个通信设备(通信设备可以为交换机)。如图2d所示,TOR级包括4个通信设备,在图2a中分别用1-4标识;leaf级包括4个逻辑通信设备,分别为leaf级通信设备1、和leaf级通信设备3和leaf级通信设备4。其中leaf级通信设备1可以由多个物理的leaf级通信设备构成,比如图2d中将leaf级通信设备1a和leaf级通信设备1b通过捆绑,得到逻辑上的一个leaf级通信设备1。Spine级包括2个通信设备,图中分别表示为1-2。TOR级的通信设备可以连接一个或多个服务器,比如图2d示出的服务器121、服务器122、服务器123和服务器124等。
与图2a类似,由于图2d中在TOR级通信设备和leaf级通信设备进行了至少两次哈希,因此若图2d中leaf级通信设备的哈希算法信息选择不合理,则也会导致极化问题。
另外,本申请实施例中的任一个通信设备可能进行一次流量负载均衡,也可能进行多次负载均衡,比如在TOR级通信设备的层3进行一次负载均衡,在TOR级通信设备的层2进行一次负载均衡。再比如,在leaf级通信设备的层3进行一次负载均衡,在leaf级通信设备的层2进行一次负载均衡。
下面结合图2d以TOR级通信设备分别在层3和层2进行两次负载均衡为例进行说明。TOR级通信设备1接收到第一报文后,基于层3的哈希算法信息和第一报文的目的IP地址对应的ECMP组成员数量,计算出第一报文的哈希模值,并基于该哈希模值和预设的哈希模值与下一跳(或者称为逻辑端口)的对应关系,确定出第一报文对应的下一跳。进一步,基于层2的哈希算法信息和第一报文的目的MAC对应的LAG组成员数量,计算出第一报文的哈希模值,并基于该哈希模值和预设的哈希模值与物理端口的对应关系,确定出第一报文对应的物理端口,并通过该物理端口将第一报文发送至第一报文对应的下一跳。如图2d所示,TOR级通信设备通往leaf级通信设备1共有四条链路,其中两条链路连接leaf级通信设备1a,另外两条链路连接leaf级通信设备1b。TOR级通信设备可以在连接至leaf级通信设备1的四条链路中基于LAG技术为第一报文选择传输链路。
需要注意的是,在图2d中,由于leaf级一个通信设备可能是绑定多个设备组成的,因此leaf级通信设备所选择的哈希算法可能一方面会受到TOR级通信设备的层3的哈希算法信息的影响,另一方面可能还会受到TOR级通信设备的层2的哈希算法信息的影响(比如会影响到leaf级通信设备1a接收到的报文的多样性的数量,该示例在后续实施例将进行详细描述,在此先不做阐述),也可以理解为在第一通信设备上可能进行多次负载均衡,而进行的多次负载均衡可能会对第二通信设备的哈希算法的选择造成影响。因此,本申请实施例中还提供一种可能的实施方式,即第二通信设备可以结合第一通信设备的至少两次负载均衡的哈希算法信息确定自身的哈希算法信息。
为了区别,本申请实施例中将第一通信设备进行的负载均衡的层3的哈希算法信息称为第一哈希算法信息,将第一通信设备进行的负载均衡的层2的哈希算法信息称为第三哈希算法信息。该方案涉及的内容将在后续进行详细描述,在此先不进行介绍。
上述图1a和图1b中的第一通信设备可以为图2d中的TOR级的通信设备,第二通信设备可以为图2d中的leaf级的通信设备;或者,第一通信设备为图2d中的leaf级的通信设备,第二通信设备为图2d中的TOR级的通信设备。负载均衡设备可以为第二通信设备内部的一个模块,也可以为独立于TOR级的通信设备和leaf级的通信设备的一个设备或模块。
图3示例性示出了本申请实施例提供的一种通信设备的结构示意图。该通信设备可以为转发设备,下面以该通信设备为交换机为例进行介绍。
如图3所示,该通信设备可以包括处理流量转发的交换芯片510和对交换芯片进行管理控制的处理器中央处理器(central processing unit,CPU)520。
其中,交换芯片510包括一个或多个端口511,比如端口#1、端口#2…端口#mn+n,其中,m可以为大于1的整数,n可以为大于2的整数。图3中端口的数量仅仅是示意,实际中通信设备可以包括比图3中更多或更少的端口数量。
如图3所示,多个端口可以汇总到一个端口块,图3中示例出多个端口块512,比如图3中的端口块(port block)#1、端口块(port block)#2…端口块(port block)#(m+1)。端口块512可以将来自外部的报文解码成帧送给处理模块513,图3中示例出多个处理模块,比如处理模块(pipe)#0…处理模块(pipe)#y。端口块512还可以从处理模块513接收待发送报文并编码发送。
处理模块513可以包括入方向处理模块(Ingress Pipeline)和出方向处理模块(Egress Pipeline)。入方向处理模块(Ingress Pipeline)可以用于提取报文信息,生成报文描述,进行查表(比如图3中的表格(tables)/三态内容寻址存储器(Ternary Content Addressable Memories,TCAM)514),之后把报文送到内存管理单元(memory management unit,MMU)515,MMU 515中经调度后将报文送到对应的端口连接的出方向处理模块(Egress Pipeline)进行编码封装等处理,处理后的报文经选中的端口发送出去。在该处理流程中。查表转发决策可以在入方向处理模块(Ingress Pipeline)实现,包括流量负载均衡。
图3所示的通信设备为第二通信设备时,且负载均衡设备位于第二通信设备时,负载均衡设备可以包括图3中的处理器520,或者可以为处理器520,或为设置于图3中的处理器520中模块。负载均衡设备确定的第二哈希算法信息可以通过处理器520下发给交换芯片510。需要说明的是,负载均衡设备除了可以确定第二通信设备进行负载均衡的第二哈希算法信息之外,还可以对第二通信设备进行报文转发的端口的数量进行调整,当负载均衡设备对第二通信设备进行报文转发的端口的数量进行了调整,则也可以将调整后的端口数量通过处理器520下发给交换芯片510。交换芯片510的管理接口控制器(management interface controller)516可以将从处理器CPU520收到的第二哈希算法信息和/或第二通信设备的端口数量信息下发到指定的组件,如处理模块513。管理接口控制器516也可以把第二通信设备的相关配置(比如第二通信设备当前的端口数量)反馈给处理器520。
管理接口控制器516还可以把从端口收到的指定报文送给处理器520,也可以将处理器CPU520需要发出的报文送到交换芯片进行发送。比如,图3所示的通信设备为第二通信设备,负载均衡设备为独立于第二通信设备的一个设备,负载均衡设备可以将第二哈希算法信息发送给第二通信设备,第二通信设备将通过端口收到的报文发送给处理器520,处理器520对报文进行解析处理,确定出第二哈希算法信息,并下发给交换芯片510。负载均衡设备对第二通信设备进行报文转发的端口的数量进行了调整,则也可以将调整后的端口数量发送至第二通信设备,第二通信设备通过处理器520得到调整后的端口数量后,将其下发给交换芯片510。
基于上述内容,图4示例性示出了本申请实施例提供的一种负载均衡的哈希算法信息的确定方法的流程示意图,该方法可以由前述图1a至图2c的负载均衡设备。如图4所示, 该方法包括:
S401,负载均衡设备接收第一消息,第一消息包括第一通信设备的负载均衡方式的第一哈希算法信息和第一通信设备的第一端口的第一数量的信息。
本申请实施例中,第一哈希算法信息和第一通信设备的第一端口的第一数量的信息可以是第一通信设备直接向负载均衡设备发送的;也可以是其他设备发送的,比如可以是信息共享模块发送的,而在S401之前,信息共享模块可以从第一通信设备获取第一通信设备的第一哈希算法信息和第一通信设备的第一端口的第一数量的信息。
S402,负载均衡设备根据第一哈希算法信息和第一数量的信息,确定第二通信设备的负载均衡方式的第二哈希算法信息。
本申请实施例中负载均衡设备可以为第二通信设备中的模块或单元,也可以为独立于第一通信设备和第二通信设备之外的设备的模块或单元。若为独立于第一通信设备和第二通信设备之外的设备,则S402之后负载均衡设备可以向第二通信设备发送第二哈希算法信息。如此,第二通信设备可以基于第二哈希算法信息进行报文转发。
由于负载均衡设备可以与第一通信设备之间进行沟通,因此可以获取到第一哈希算法信息和第一数量的信息,进而根据第一哈希算法信息和第一通信设备的第一端口的第一数量的信息确定的第二哈希算法信息可以更加合理。
本申请实施例中涉及到多种哈希算法信息,为了区分,称为第一哈希算法信息、第二哈希算法信息等。每种哈希算法信息可以包括:哈希关键信息的参数项、哈希关键信息的各个参数项的排列顺序、哈希算法、或哈希值的取值方式中的至少一项。为了区分,将第一哈希算法信息中的各个参数分别称为第一哈希算法、第一哈希关键信息的参数项、第一哈希关键信息的各个参数项的排列顺序、第一哈希算法和第一哈希值的取值方式。将第二哈希算法信息中的各个参数分别称为第二哈希算法、第二哈希关键信息的参数项、第二哈希关键信息的各个参数项的排列顺序、第二哈希算法和第二哈希值的取值方式。以及将后续出现的第三哈希算法信息中的各个参数分别称为第三哈希算法、第三哈希关键信息的参数项、第三哈希关键信息的各个参数项的排列顺序、第三哈希算法和第三哈希值的取值方式。
下面以第一哈希算法信息为例,介绍哈希算法信息中包括的各个参数,其他哈希算法信息(比如第二哈希算法信、第三哈希算法信息等)与之类似,不再赘述。
参数a1,哈希关键信息的参数项。
哈希关键信息的参数项可以包括报文自身携带的字段,例如网络层目的地址、网络层源地址、传输层目的端口、传输层源端口、网络层协议标识、拥塞通告标签(congestion notification tag,CNTag)、虚拟网络标签(virtual network tag,VNTag)、虚拟局域网(virtual local area network,VLAN)标识等。
又一种可能的实施方式中,本申请实施例中的哈希关键信息的参数项还包括用于构成哈希关键信息的参数项的参数值的区域(也可以理解为位宽、bit长度等)。举个例子,哈希关键信息的参数项可以包括:网络层目的地址的高16比特,网络层源地址的低16比特,或网络层原地址的高16比特等。可以看出,通过哈希关键信息的参数项,可以确定出用于构建哈希关键信息的各个参数项对应的参数值中需提取的比特位。
哈希关键信息的参数项还可以包括该报文当前所属通信设备的信息。例如针对第一通 信设备接收到的第一报文,第一通信设备的第一哈希算法信息对应的哈希关键信息的参数项可以包括第一报文到达第一通信设备的第一端口标识、第一通信设备的标识(需要注意的是,第一通信设备的标识是可配置的,在不同的系统中可以第一通信设备的标识可以是不同的,本申请实施例中不做限定)等。
需要说明的是,针对某些报文,可能无法提取到该报文的上述哈希关键信息的参数项,这种情况下,针对该报文进行负载均衡的通信设备可以将这字段填充为默认值、0或其他设置值。
举个例子,第一通信设备接收到第一报文,第一报文若为ARP报文。第一哈希算法信息对应的哈希关键信息的参数项可以包括报文自身携带的字段,例如网络层目的地址、网络层源地址、传输层目的端口、传输层源端口、网络层协议标识、CNTag、VNTag和VLAN标识。由于第一报文没有网络层和传输信息,因此无法提取到第一报文的网络层和传输层信息,比如网络层目的地址、网络层源地址、传输层目的端口、传输层源端口等。这种情况下,第一通信设备在构建第一报文对应的哈希关键信息时,可以将网络层和传输层信息对应的参数项对应的值填充为默认值、0或其他设置值。
参数a2,哈希关键信息的各个参数项的排列顺序。
哈希关键信息的各个参数项的排列顺序可以发生变化,比如第一哈希算法信息和第二哈希算法信息对应的哈希关键信息的参数项相同,但是各个参数项的排列顺序不同。
参数a3,哈希算法。
针对一个哈希算法信息,依据上述参数a1和参数a2构造哈希关键信息之后,可以依据该哈希算法信息对应的哈希算法进行运算,得到该哈希算法对应的运算结果。
哈希算法可以是指对哈希关键信息进行计算的算法,比如循环冗余校验(cyclic redundancy check,CRC)算法、对折异或(exclusive OR folding,XOR folding)或异或(exclusive OR,XOR)对象、分割求和等。
CRC算法本质上是对哈希关键信息(一串比特串)进行辗转异或求余。举个例子,假设哈希关键信息是16位的二进制信息g=1011 0110 0100 0011,这串二进制码可以表示为代数多项式g(x)=x 15+x 13+x 12+x 10+x 9+x 6+x 1+1,其中g中第k位的值,对应g(x)中x k的系数,将g(x)乘以x m,即将g后加m个0,然后除以m阶多项式h(x),得到的(m-1)阶余项r(x),余项r(x)对应的二进制码r就是CRC计算结果。
也就是说,在CRC算法中,变化的是用作被除数的哈希关键信息和用作除数的m阶多项式h(x),h(x)通常也被称为生成多项式。通常用生成多项式来标识和区分不同的CRC算法,例如常说“CRC算法A”其实是说“CRC算法使用的生成多项式是A”或“CRC算法使用的生成多项式名字标识为A”,例如可以说“CRC-16-CCITT”或者“CRC 0x1021”,这里“CRC-16-CCITT”是约定的CRC名称,0x1021是生成多项式,当然设备或者其他CRC算法实现主体也可以自己命名CRC来进行标识区分。
参数a4,哈希值的取值方式。
本申请实施例中针对一个哈希算法信息,采用该哈希算法信息对应的哈希算法对哈希关键信息进行运算得到的值,可以依据该哈希算法信息对应的哈希值的取值方式,从该值中确定出哈希值。
比如,哈希值的取值方式包括:提取哈希算法运算结果的低16比特为哈希值、提取哈希算法运算结果的高16比特为哈希值、或提取哈希算法运算结果的全部比特为哈希值 等。
为了缓解网络中的极化问题,第一哈希算法信息和第二通信设备的端口的第二数量满足以下内容中的至少一项:第一数量与第二数量不同,第一哈希算法信息与第二哈希算法信息相同;第一数量与第二数量不同,第一哈希算法信息与第二哈希算法信息不同;或,第一数量与第二数量相同,第一哈希算法信息与第二哈希算法信息不同。
由于第一通信设备进行负载均衡时将哈希值对第一数量进行取模,而第二通信设备时将哈希值对第二数量进行取模,因此第一数量和第二数量不同时,第一哈希算法信息和第二哈希算法信息可以不同,也可以相同。即使第一哈希算法信息和第二哈希算法信息相同,针对第二通信设备接收到的基于第一哈希算法信息和第一数量进行均衡后的报文,第二通信设备也有可能通过不同的链路发送接收到多个报文,因此,可以减轻网络的极化现象。
另一种情况,若第一数量与第二数量相同,第一哈希算法信息与第二哈希算法信息不同,则针对第二通信设备接收到的基于第一哈希算法信息和第一数量进行均衡后的报文,第二通信设备也有可能通过不同的链路发送接收到多个报文,因此,可以减轻网络的极化现象。
其中,在第一哈希算法信息与第二哈希算法信息不同的情况下,第一哈希算法信息和所是第二哈希算法信息满足以下内容中的至少一项:
第一哈希算法与第二哈希算法不同;第一哈希关键信息的参数项与第二哈希关键信息的参数项不同;第一哈希关键信息的各个参数项的排列顺序与第二哈希关键信息的各个参数项的排列顺序不同;或,第一哈希值取值方式与第二哈希值取值方式不同。
若满足以上内容中的至少一项,则针对来自第一通信设备的第一报文和第二报文,即使基于第一哈希算法信息对第一报文和第二报文分别进行哈希计算,并将得到的两个哈希值分别对第一数量取模,得到的两个哈希模值相同,则基于第二哈希算法信息对第一报文和第二报文分别进行哈希计算,并将得到的两个哈希值分别对第二数量取模所得到的两个哈希模值有可能会不同,进而可以通过两个哈希模值对应的两个不同的链路分别发送第一报文和第二报文,从而可以减轻网络中的极化问题。
本申请实施例中定义了名词通信设备的端口数量,为了区分,将第一通信设备的第一端口的数量称为第一数量,将第二通信设备的第二端口的数量称为第二数量。一种可能的实施方式中,第一数量包括:第一通信设备的等价多路径(ECMP group)成员数量;或,第一通信设备的链路汇聚组(LAG group)成员数量。下面分别进行介绍。
实施方式1,第一通信设备的第一端口的第一数量可以为:第一通信设备的等价多路径(ECMP group)成员数量。
举个例子,第一通信设备的等价多路径(ECMP group)成员数量还可以理解为第一通信设备能够将接收到的报文(比如第一报文)传输至第一报文的目的IP地址的第一通信设备层3的路径数量(层3的路径数量也可以理解为层3的逻辑端口数量)。
第一通信设备的等价多路径(ECMP group)成员数量还可以理解为第一报文的目的IP地址中的IP子网地址对应的第一通信设备层3的端口(或者称端口)的数量,该端口的数量也可以理解为等价路径的数量、下一跳的数量或逻辑端口(或者称逻辑端口)的数量。
实施方式2,第一通信设备的第一端口的第一数量可以为:第一通信设备的链路汇聚 组(LAG group)成员数量。
举个例子,第一通信设备的链路汇聚组(LAG group)成员数量还可以理解为第一通信设备能够将接收到的报文(比如第一报文)传输至第一报文的目的MAC地址的第一通信设备层2的端口数量(层2的端口数量也可以理解为层2的物理端口数量)。
第一通信设备的链路汇聚组(LAG group)成员数量还可以理解为第一报文的目的MAC地址对应的第一通信设备层2的端口(或者称端口)的数量,该端口的数量也可以理解为物理端口(或者称物理端口)的数量。
类似的,第二哈希算法信息可以应用于第二通信设备的层3的负载均衡方式的处理中。第二通信设备的第二端口的第二数量可以包括:第二通信设备的等价多路径(ECMP group)成员数量。第二哈希算法信息可以应用于第二通信设备的层2的负载均衡方式的处理中。第二通信设备的第二端口的第二数量可以包括:第二通信设备的链路汇聚组(LAG group)成员数量,具体内容与上述内容过类似,不再赘述。
在S402中,一种可能的实施方式中,负载均衡设备可以根据第一哈希算法信息、第一数量的信息和第二通信设备的第二端口的第二数量的信息,确定第二哈希算法信息。如此可以结合第二通信设备的端口数量更加合理的确定第二哈希算法信息。
针对上述图2a中给出的示例可以看出,针对leaf级接收到的来自同一个或不同的TOR的通信设备的多个报文,leaf级的通信设备8仅通过一条链路发送该多个报文,并不能将该多个报文均衡至多个链路进行发送。为了将来自第一通信设备的多个报文尽量均匀分担至第二通信设备的多条链路,则在上述S402中,负载均衡设备所选择的第二哈希算法信息可以满足第一条件,第一条件包括:基于第二哈希算法信息对第一报文和第二报文分别进行哈希计算,并将得到的两个哈希值分别对第二通信设备的第二端口的第二数量取模,得到的两个哈希模值不同。如此,针对接收到的第一报文和第二报文,可以通过两个不同的哈希模值对应的两个不同的端口发送,从而可以减轻网络极化问题。
一种可能的实施方式中,第一报文和第二报文可以为其他通信设备(比如第一通信设备和/或其他通信设备)经过第一哈希算法信息和第一数量进行负载均衡后传输至第二通信设备的两个报文。
又一种可能的实施方式中,第一条件可以还包括:基于第一哈希算法信息对第一报文和第二报文分别进行哈希计算,并将得到的两个哈希值分别对第一数量取模,得到的两个哈希模值相同。如此,第一报文和第二报文可以是由第二通信设备的两个不同的上一级设备(包括第一通信设备和其他的通信设备)基于第一哈希算法信息和第一数量进行负载均衡后发送给第二通信设备的。第一报文和第二报文也可以是由第二通信设备的同一个上一级设备(比如第一通信设备)基于第一哈希算法信息和第一数量进行负载均衡后发送给第二通信设备的,比如可以是通过第一通信设备的同一条逻辑链路或同一条物理链路发送给第二通信设备的。进而,针对满足第一条件的第一报文和第二报文,基于第二哈希算法信息进行负载均衡后可以通过不同的链路发送,从而可以减轻极化问题。
通过一个示例来说明第二哈希算法信息满足第一条件时的有益效果:比如,第一通信设备从同一个通信设备或从不同的通信设备接收到第一报文和第二报文后,基于第一哈希算法信息对第一报文和第二报文分别进行哈希计算,并将得到的两个哈希值分别对第一数量取模,得到的两个哈希模值相同,因此第一通信设备确定通过同一条链路将第一报文和 第二报文分别发送至第二通信设备。而第二通信设备基于第二哈希算法信息对第一报文和第二报文分别进行哈希计算,并将得到的两个哈希值分别对第二数量取模,得到的两个哈希模值不同,因此会通过两条不同的链路分别将第一报文和第二报文发送至下一跳。如此,当第二哈希算法信息满足第一条件的情况下,可以尽量将经过上一跳的通信设备过滤过的具有相同特征的报文通过不同的链路发送出去,从而可以减缓上述图2a中提到的由于选择哈希算法信息不合理所导致的极化问题。
下面从另外一个角度理解极化问题产生的原因。图5示例性示出了本申请实施例提供的一种哈希关键信息的多样性的分布示意图,如图5所示,集合S1中包括是第一通信设备生成的各个报文对应的哈希关键信息,比如key#1、key#2…key#12等12个哈希关键信息。集合S2表示的是对集合S1中的12个哈希关键信息分别基于第一哈希算法信息进行运算,并将得到的哈希值对第一数量取模,得到的哈希模值的示意图,如图5所示,集合S1中的12个哈希关键信息共计算出12个哈希模值,其中12个哈希模值中有重复的值,对该12个哈希模值去重之后可以得到4个不同的哈希模值,分别为哈希模值A、哈希模值B、哈希模值C和哈希模值D。可以理解为第一通信设备可以将12个哈希关键信息对应的数据流分散至4条链路(或者说4个等价多路径(ECMP group)成员或4个链路汇聚组(LAG group)成员)进行发送。对于一个通信设备而言,该通信设备计算出的哈希模值与该通信设备的发送链路之间具有对应关系,一个通信设备计算出的两个哈希模值可以对应两条发送链路。
若图5中第一通信设备经计算哈希关键信息key#1、key#2和key#3对应的哈希模值均为哈希模值A,即哈希关键信息key#1、key#2和key#3对应的数据流均通过同一条链路发送,比如均发送至第二通信设备。
而第二通信设备若依然采用第一哈希算法信息进行均衡,且第一通信设备的第一端口的第一数量和第二通信设备的端口数量相同的情况下,则第二通信设备所计算的哈希关键信息key#1、key#2和key#3所对应的哈希模值均为哈希模值A。这种情况下,哈希关键信息key#1、key#2和key#3对应的数据流在第二通信设备上并未得到负载均衡,而是通过同一条链路发送出去,从而可能造成极化问题的产生。
若将哈希关键信息经过计算得到的哈希模值理解为多样性,则如图5所示,在第一通信设备上,12个哈希关键信息对应的12个哈希模值去重后的数量为4,可以理解为在第一通信设备上第一哈希算法信息对应的多样性为4。而第二通信设备若依然采用第一哈希算法信息进行均衡,且第一通信设备的第一端口的第一数量和第二通信设备的端口数量相同的情况下,在第二通信设备上,该3个哈希关键信息(key#1、key#2和key#3)对应的3个哈希模值去重后的数量为1(如图5的集合S3中所示),即该3个哈希关键信息(key#1、key#2和key#3)对应的多样性为1。此时第二通信设备上无论有多少条发送链路,均仅通过一条链路发送该3个哈希关键信息对应的数据流。可以看出,由于第二通信设备上选择的哈希算法信息导致了经过第一通信设备负载均衡处理后的报文的多样性减少,从而导致了极化问题的产生。
为了缓解极化问题,本申请实施例中还提供一种可能的实施方式,在该实施方式中,上述S402可以替换为:
负载均衡设备确定N个哈希算法信息中哈希算法信息对应的第四数量;N为正整数,从N个哈希算法信息中选择对应的第四数量大于1的哈希算法信息作为第二哈希算法信息。
其中,针对N个哈希算法信息中的哈希算法信息,哈希算法信息对应的第四数量为:基于哈希算法信息对M个报文分别进行哈希计算,将得到的M个哈希值分别对第二通信设备的端口的第二数量取模,并将得到M个哈希模值去重后所得到数值的数量;M为大于1的整数。如此,M个报文可以基于第二哈希算法信息和第二数量进行负载均衡后,被分配到至少两个链路,从而可以减轻网络的极化问题。
又一种可能的实施方式中,M个报文可以为其他通信设备(比如第一通信设备和/或其他通信设备)经过第一哈希算法信息和第一数量进行负载均衡后传输至第二通信设备的M个报文。
又一种可能的实施方式中,M个报文满足第二条件,第二条件包括:基于第一哈希算法信息对M个报文分别进行哈希计算,并将得到的M个哈希值分别对第一数量取模,得到的M个哈希模值相同。如此,若其他通信设备接收到M个报文,则基于第一哈希算法信息和第一数量进行负载均衡后,会将M个报文发送至第二通信设备。进而,针对满足第二条件的M个报文,基于第二哈希算法信息进行负载均衡后可以通过不同的链路发送,从而可以减轻极化问题。
结合图5举个例子,M个报文可以为上述哈希关键信息key#1、key#2和key#3对应的报文,所选择的第二哈希算法信息需满足:基于第二哈希算法信息对M个报文分别进行哈希计算,将得到的M个哈希值分别对第二数量取模,并将得到M个哈希模值去重后所得到数值的数量大于1。如此,针对哈希关键信息key#1、key#2和key#3对应的报文可以选择至少两条链路进行发送,从而可以减缓极化问题。
下面通过表1对上述内容进行举例说明。
表1第一通信设备和第二通信设备对接收到报文进行运算后的哈希模值的分布情况
Figure PCTCN2022106253-appb-000001
为了更清楚的介绍本申请实施例,表1中假设第一通信设备的第一端口的第一数量和第二通信设备的端口数量相同、第一哈希算法信息对应的哈希关键信息的参数项与第二哈希算法信息对应的哈希关键信息的参数项相同,第一哈希算法信息对应的哈希关键信息的各个参数项的排序方式与第二哈希算法信息对应的哈希关键信息的各个参数项的排序方式相同,第一哈希算法信息对应的哈希值的取值方式与第二哈希算法信息对应的哈希值的取值方式相同。
如表1所示,第一通信设备采用的第一哈希算法信息对应的哈希算法为CRC16a,第一通信设备对接收到的报文基于第一哈希算法信息进行运算,得到的哈希值对第一数量进行取模,得到的哈希模值总数量去重后的数量为2,该2个值可以分别表示为0和3。哈希模值0对应第一通信设备的第一端口,哈希模值3对应第一通信设备的第四端口。第一通信设备的第一端口连接第二通信设备。也就是说,第二通信设备接收到的报文均为第一通信设备上经过计算,得到的哈希模值为0的报文(该报文可以理解为前述M个报文)。
请继续参与表1,若第二通信设备采用的第二哈希算法信息对应的哈希算法为CRC16a,则针对接收到的来自第一通信设备的M个报文,第二通信设备对接收到的M个报文基于CRC16a进行运算,得到的哈希值对第一数量进行取模,得到的哈希模值总数量去重后的数量为1,如表1中所示,该值为0。即当第一哈希算法信息和第二哈希算法信息相同,且第一数量和第二数量相同,则第一通信设备针对该M个报文进行计算,得到的M个报文对应的哈希模值均为0,第二通信设备针对该M个报文进行计算,得到的M个报文对应的哈希模值也均为0,第二通信设备将该M个报文通过哈希模值为0所对应的端口进行发送。
请继续参与表1,若第二通信设备采用的第二哈希算法信息对应的哈希算法为CRC16b,则针对接收到的来自第一通信设备的M个报文,第二通信设备对接收到的M个报文基于CRC16b进行运算,得到的哈希值对第一数量进行取模,得到的哈希模值总数量去重后的数量为4,如表1中所示,该4个值分别为1,2,3,0。即针对来自第一通信设备的M个报文,第二通信设备可以通过4条链路进行发送,从而可以减轻网络的极化问题。
请继续参与表1,若第二通信设备采用的第二哈希算法信息对应的哈希算法为CRC32HI,则针对接收到的来自第一通信设备的M个报文,第二通信设备对接收到的M个报文基于32HI进行运算,得到的哈希值对第一数量进行取模,得到的哈希模值总数量去重后的数量为1,如表1中所示,该1个值表示为0。即针对来自第一通信设备的M个报文,第二通信设备仅可以通过1条链路进行发送,会导致极化问题。
请继续参与表1,若第二通信设备采用的第二哈希算法信息对应的哈希算法为CRC32LO,则针对接收到的来自第一通信设备的M个报文,第二通信设备对接收到的M个报文基于CRC32LO进行运算,得到的哈希值对第一数量进行取模,得到的哈希模值总数量去重后的数量为4,如表1中所示,该4个值分别为2,0,1,3(与第二通信设备采用CRC16b的方案相比,多样性数目相同,但是多样性值的分布顺序不同)。即针对来自第一通信设备的M个报文,第二通信设备可以通过4条链路进行发送,从而可以减轻网络的极化问题。
从表1可以看出,当第一哈希算法信息对应的哈希算法与第二哈希算法信息对应的哈希算法不同时,比如第一哈希算法信息采用CRC16a,第二哈希算法信息采用CRC32HI,也有可能产生极化问题。因此,仅仅限定第一哈希算法信息和第二哈希算法信息采用的哈 希算法不同不能减缓极化问题。而本申请实施例提供的方案中,选择的第二哈希算法信息需满足:基于第二哈希算法信息对M个报文分别进行哈希计算,将得到的M个哈希值分别对第二数量取模,并将得到M个哈希模值去重后所得到数值的数量大于1。如此,可以减缓极化问题。
需要注意的是,上述表1中是以第一通信设备的第一端口的第一数量与第二通信设备的端口数量相等、第一哈希算法信息对应的哈希关键信息的参数项与第二哈希算法信息对应的哈希关键信息的参数项相同,且第一哈希算法信息对应的哈希关键信息的各个参数项的排序方式与第二哈希算法信息对应的哈希关键信息的各个参数项的排序方式相同,第一哈希算法信息对应的哈希值的取值方式与第二哈希算法信息对应的哈希值的取值方式相同为例进行展示的。当第一通信设备的第一端口的第一数量与第二通信设备的端口数量不同,第一哈希算法信息对应的哈希关键信息的参数项与第二哈希算法信息对应的哈希关键信息的参数项不同,第一哈希算法信息对应的哈希关键信息的各个参数项的排序方式与第二哈希算法信息对应的哈希关键信息的各个参数项的排序方式不同,或,第一哈希算法信息对应的哈希值的取值方式与第二哈希算法信息对应的哈希值的取值方式不同中的至少一项满足,则上述表1的第7列的值和第8列的值可能也会发生变化。
表2第一通信设备和第三通信设备对接收到报文进行运算后的哈希模值的分布情况
Figure PCTCN2022106253-appb-000002
为了更清楚的介绍本申请实施例,表2中示例性示出了表1中第一通信设备与第三通信设备对接收到报文进行运算后的哈希模值的分布情况。与表1不同的是,表3示出的是第一通信设备上经过哈希,得到的哈希模值为3的报文的处理方式,下面将详细描述,至于其他内容可以参见前述表1中的描述,不再赘述。
第一通信设备上哈希模值3对应第一通信设备的第四端口。第一通信设备的第四端口连接第三通信设备。也就是说,第三通信设备接收到的报文均为第一通信设备上经过计算,得到的哈希模值为3的报文(本申请实施例中为第三通信设备选择哈希算法信息的方案可 以参见前述为第二通信设备选择哈希算法信息的方案,在此不再赘述)。且在表2中,与表1中类似,假设第一通信设备的第一端口的第一数量和第三通信设备的端口数量相同、第一哈希算法信息对应的哈希关键信息的参数项与第三通信设备的哈希算法信息对应的哈希关键信息的参数项相同,第一哈希算法信息对应的哈希关键信息的各个参数项的排序方式与第三通信设备的哈希算法信息对应的哈希关键信息的各个参数项的排序方式相同,第一哈希算法信息对应的哈希值的取值方式与第三通信设备的哈希算法信息对应的哈希值的取值方式相同。
下面以表2的第二行和第四行内容举例,其他行内容与之类似,不再赘述。如表2所示,若第三通信设备采用的哈希算法信息对应的哈希算法为CRC16a,则针对接收到的来自第一通信设备的报文,第三通信设备对接收到的多个报文基于CRC16a进行运算,得到的哈希值对第一数量进行取模,得到的哈希模值总数量去重后的数量为1,如表1中所示,该值为3。若第三通信设备采用的哈希算法信息对应的哈希算法为CRC16b,则针对接收到的来自第一通信设备的报文,第三通信设备对接收到的多个报文基于CRC16 b进行运算,得到的哈希值对第一数量进行取模,得到的哈希模值总数量去重后的数量为4,如表1中所示,该4个值分别为3,0,1,2。
从表2可以看出,当第一哈希算法信息对应的哈希算法与第三通信设备的哈希算法信息对应的哈希算法不同时,比如第一哈希算法信息采用CRC16a,第三通信设备的哈希算法信息采用CRC32HI,也有可能产生极化问题。因此,仅仅限定第一哈希算法信息和第二哈希算法信息采用的哈希算法不同不能减缓极化问题。而本申请实施例提供的方案中,为第三通信设备选择的哈希算法信息可以参见前述选择第二哈希算法信息的方案,即为第三通信设备选择的哈希算法信息需满足:基于为第三通信设备选择的哈希算法信息对多个报文分别进行哈希计算,将得到的多个哈希值分别对第三通信设备的端口数量取模,并将得到哈希模值去重后所得到数值的数量大于1。如此,可以减缓极化问题。为第三通信设备选择的哈希算法信息可以参见前述选择第二哈希算法信息的方案,不再赘述。
为了更加均匀的将负载均匀的分布在各个链路,本申请实施例还提供一种可能的实施方式,在上述S402中,负载均衡设备从N个哈希算法信息中选择对应的第四数量最大的哈希算法信息作为第二哈希算法信息。
也就是说,在该实施方式中,负载均衡设备选择的第二哈希算法信息不仅满足:基于第二哈希算法信息对M个报文分别进行哈希计算,将得到的M个哈希值分别对第二数量取模,并将得到M个哈希模值去重后所得到数值的数量大于1。而且,还是N个哈希算法信息中对应的第四数量最大的一个哈希算法信息,也可以理解为针对M个报文进行负载均衡时,多样性损失最少的一个哈希算法信息。N个哈希算法信息可以是预先配置的几个可选择的哈希算法信息,工作人员也可以随时对预设的N个哈希算法信息进行修正和补充。
比如,依据上述表1可以看出,当第一通信设备的第一端口的第一数量与第二通信设备的端口数量相等,均为4、第一哈希算法信息对应的哈希关键信息的参数项与第二哈希算法信息对应的哈希关键信息的参数项相同,且第一哈希算法信息对应的哈希关键信息的各个参数项的排序方式与第二哈希算法信息对应的哈希关键信息的各个参数项的排序方式相同,第一哈希算法信息对应的哈希值的取值方式与第二哈希算法信息对应的哈希值的取值方式相同,若第一哈希算法信息对应的哈希算法为CRC16a,则第二哈希算法信息可 以选择CRC16b,也可以选择CRC32LO。
又一种可能的实施方式中,负载均衡设备可以预先建立哈希算法信息关联关系,该哈希算法信息关联关系可以存储于表格,或者其他形式的文档中。哈希算法信息关联关系包括:第一哈希算法信息、第一数量的信息、第二通信设备的端口的第二数量的信息和第二哈希算法信息的关联关系。如此,上述S402中,负载均衡设备可以根据第一哈希算法信息和第一数量的信息,查询预设的哈希算法信息关联关系,得到第二哈希算法信息。进一步,负载均衡设备可以根据第一哈希算法信息、第一数量的信息和第二通信设备的第二端口的第二数量,查询预设的哈希算法信息关联关系,得到第二哈希算法信息。
表3列举了几种第一哈希算法信息对应的哈希算法和第二哈希算法信息对应的哈希算法的示例,表3中是以第一哈希算法信息对应的哈希关键信息的参数项与第二哈希算法信息对应的哈希关键信息的参数项相同,且第一哈希算法信息对应的哈希关键信息的各个参数项的排序方式与第二哈希算法信息对应的哈希关键信息的各个参数项的排序方式相同为例进行展示的。以表3的第一行为例进行说明,第一通信设备的第一端口的第一数量为4,第一哈希算法信息对应的哈希算法为CRC16b,第二通信设备的端口数量为4的情况下,第二哈希算法信息对应的哈希算法可以推荐选择CRC32LO。表3中的第二哈希算法信息对应的哈希算法可以是预先计算得到,也可以实时计算,比如可以通过遍历各种组合进行评估或数学求解计算得到。其他行内容与之类似,不再阐述。
表3第一哈希算法信息对应的哈希算法和第二哈希算法信息对应的哈希算法示例
Figure PCTCN2022106253-appb-000003
通过表3可以看出,本申请实施例中采用“哈希模值去重后所得到数值的数量”量化地衡量多级负载均衡后系统的负载均衡效果,可以预评估各种负载均衡算法组合的效果,以便选择合适的负载均衡算法组合来使得减轻系统的极化问题,以得到更好的负载均衡效果。表3中示例性示出了几种第一哈希算法信息对应的哈希算法和第二哈希算法信息对应的哈希算法的几种组合形式。从表3可以看出,当第一通信设备的第一端口的第一数量和/或第二通信设备的端口数量发生变化时,第一哈希算法信息对应的哈希算法和第二哈希算法信息对应的哈希算法的组合可能发生变化,比如表3中,当第一通信设备的第一端口的第一数量和第二通信设备的端口数量均为4,第一哈希算法信息对应的哈希算法为CRC16b,第二哈希算法信息对应的哈希算法可以为CRC32LO。当第一通信设备的第一端口的第一数量为8,第二通信设备的端口数量均为4,第一哈希算法信息对应的哈希算法为CRC16b,第二哈希算法信息对应的哈希算法可以为CRC16a。可见,为解决多级负载均衡还必须考 虑多级通信设备的负载均衡子系统的端口数量;也可以看出,即便第一哈希算法信息和第二哈希算法信息的哈希算法不同,也没有一组固定不变的第一哈希算法信息和第二哈希算法信息是在第一通信设备端口数量与第二通信设备端口数量所有组合下都能确保解决极化问题获得最优性能的。
本申请实施例中一个通信设备可以进行一次负载均衡,也可以进行多次负载均衡,比如第一通信设备可以在层3进行一次负载均衡,在层2也进行一次负载均衡。上述内容以第一哈希算法信息为第一通信设备进行的任意一次负载均衡对应的哈希算法信息为例进行介绍。又一种可能的实施方式中,第一通信设备可以将进行的多次负载均衡的哈希算法信息均发送至负载均衡设备,如此负载均衡设备可以确定出更加合理的第二哈希算法信息。具体可以如图6的负载均衡的哈希算法信息的确定方法的流程示意图中所示,该方法在S402之前还包括:
S4011,负载均衡设备接收第二消息,第二消息包括第一通信设备的负载均衡方式的第三哈希算法信息和第一通信设备的第三端口的第三数量的信息。
上述S402可以替换为:负载均衡设备根据第一消息和第二消息,确定第二通信设备的负载均衡方式的第二哈希算法信息。
又一种可能的实施方式中,上述S402可以替换为:负载均衡设备根据第一消息、第二消息和第二数量,确定第二通信设备的负载均衡方式的第二哈希算法信息。
需要说明的是,上述第一消息和第二消息可以是两条不同的消息,也可以是同一条消息,这种情况下,也可以理解为,第一消息还包括:第三哈希算法信息和第三数量的信息。
在图6所示的方案中,第一哈希算法信息和第三哈希算法信息可以为第一通信设备的两次负载均衡对应的哈希算法信息。一种可能的实施方式中,第一哈希算法信息为第一通信设备在层3基于等价多路径技术进行负载均衡所采用的哈希算法信息。第一数量包括第一通信设备的等价多路径(ECMP group)成员数量。第三哈希算法信息为第一通信设备在层2基于链路汇聚组(LAG)技术进行负载均衡所采用的哈希算法信息。第三数量包括第一通信设备的链路汇聚组(LAG group)成员数量。
下面以图2d和表4对图6提供的方案进行说明。
表4第一通信设备和第二通信设备对接收到报文进行运算后的哈希模值的分布情况
Figure PCTCN2022106253-appb-000004
Figure PCTCN2022106253-appb-000005
表4中的第一通信设备比如为图2d中的TOR级通信设备1,第二通信设备比如为leaf级通信设备1a。第一哈希算法信息为TOR级通信设备层3进行负载均衡采用的哈希算法信息。第三哈希算法信息为TOR级通信设备层2进行负载均衡采用的哈希算法信息。
如图2d和表4所示,TOR级通信设备1在层3对应4个逻辑出端口,因此第一数量为4。第一哈希算法信息对应的哈希算法为CRC16b。第一哈希算法信息对应的哈希模值去重后的数量为4,分别取值为0、1、2和3。其中,哈希模值为0的报文去往leaf级通信设备1。哈希模值为1的报文去往leaf级通信设备2。哈希模值为2的报文去往leaf级通信设备3。哈希模值为3的报文去往leaf级通信设备4。
TOR级通信设备1通往leaf级通信设备1的物理出端口的数量为4,因此哈希模值0对应的第三数量为4。第三哈希算法信息对应的哈希模值去重后的数量(基于第三哈希算法信息对接收到的报文进行运算,得到的哈希模值去重后的数量)为4,分别为0、1、2和3。其中,哈希模值为0和1的去往leaf级通信设备1中的leaf级通信设备1a,哈希模值为2和3的去往leaf级通信设备1中的leaf级通信设备1b。
第二通信设备为leaf级通信设备1a,其出端口的第二数量为2,采用的第二哈希算法信息为CRC16a时,得到的哈希模值去重后的数量为2,即得到的报文的多样性为2。
从表4可以看出,虽然TOR级通信设备1层2输出的报文的多样性为4,但是由于leaf级通信设备1是由两个物理的leaf级通信设备绑定而成,因此,对于leaf级通信设备1a来说,接收到的来自TOR级通信设备1的报文的多样性仅仅为2,并非4,即第二通信设备接收到的报文的多样性减少。基于此,考虑到第一通信设备的第三哈希算法信息对第二哈希算法信息的多样性可能会造成影响,则根据第一哈希算法信息和第三哈希算法信息可以更加合理的确定第二哈希算法信息。
基于上述图6提供的方案,上述实施例中提及的第一条件还可以包括:基于第三哈希算法信息对第一报文和第二报文分别进行哈希计算,并将得到的两个哈希值分别对第三数量取模,得到的两个哈希模值在第一通信设备对应的端口(比如在层2的物理端口)连接至第二通信设备。如此,第一报文和第二报文则均是第二通信设备的上一级设备基于第一哈希算法信息、第一数量、第三哈希算法信息和第三数量进行负载均衡后发送至第二通信设备的。进而,针对满足第一条件的第一报文和第二报文,基于第二哈希算法信息进行负载均衡后可以通过不同的链路发送,从而可以减轻极化问题。
基于上述图6提供的方案,下述表5示例性提供一种哈希算法信息关联关系示意表,如表5所示,上述实施例中提及的哈希算法信息关联关系可以包括:第一哈希算法信息、 第一数量的信息、第三哈希算法信息、第三数量的信息、第一通信设备连接至第二通信设备的端口对应的哈希模值的信息、第二通信设备的端口的第二数量的信息和第二哈希算法信息的关联关系。如此,可以根据第一通信设备的多个哈希算法信息从哈希算法信息关联关系中查找出更加合理的、多样性损失较少的第二哈希算法信息。
表5哈希算法信息关联关系示意表
Figure PCTCN2022106253-appb-000006
需要说明的是,在图2d所示网络场景下,部署完成后,计算集群所在的TOR级通信设备连接到Leaf级通信设备的链路数目可以保持不变,但是链路如何分配到层3ECMP和层2LAG是可以变化的,不同的分配会导致第一数量和第三数量发生变化。本申请实施例中当第一数量和第三数量发生更新后,可以依据更新后的第一数量和第三数量再次更新第二通信装置的第二哈希算法信息。
基于上述内容,图7a和图7b示例性示出了本申请实施例提供的两种可能的负载均衡的哈希算法信息的确定方法的流程示意图,如图7a所示,该方法还包括:
S601,负载均衡设备确定第二通信设备为从设备。
负载均衡设备判断第一通信设备和第二通信设备的主从关系有多种方式,比如可以比较第一通信设备和第二通信设备的优先级,优先级高的为主设备,优先级低的为从设备;再比如,还可以比较第一通信设备和第二通信设备的MAC地址,或者还可以约定MAC地址小的设备为主设备。
一种可能的实施方式中,可以约定从设备的哈希算法信息可以随着主设备的哈希算法信息进行变动,基于此,在S601中确定第二通信设备为从设备的情况下执行后续S602和S603。若在其他约定前提下,比如约定主设备的哈希算法信息可以随着从设备的哈希算法信息进行变动,则S601可以替换为确定第二通信设备为主设备,且在此前提满足的情况下才执行S602和S603。
S602,负载均衡设备判断是否存在满足第一条件的哈希算法信息;
若是,则执行S603;
若不是,则执行S604;
S603,负载均衡设备将满足第一条件的哈希算法信息确定为第二哈希算法信息。
S603与前述S402方式类似,可以相互参见,不再赘述。
S604,负载均衡设备将第二通信设备更新为主设备。
在S604中,负载均衡设备还可以将第一通信设备更新为主设备。或者,还可以向第 一通信设备发送消息,以通知其第二通信设备更新为主设备,以便第一通信设备将自身更新为从设备。更改第二通信设备为主设备的方式有多种,比如可以修改第二通信设备的优先级。
S605,负载均衡设备选择第四哈希算法信息;第四哈希算法信息为第二通信设备用于进行报文转发的哈希算法信息。
在S605中,负载均衡设备选择的第四哈希算法信息可以是从预设的哈希算法信息中选择的。
S606,负载均衡设备向第一通信设备发送第三消息,第三消息用于指示第一通信设备根据第四哈希算法信息和第二通信设备的端口的第二数量的信息更新第一通信设备的负载均衡方式对应的哈希算法。
通过S606,第一通信设备可以重新选择哈希算法,以达到减轻网络中的极化问题,第一通信设备选择哈希算法以及其他哈希算法信息中的参数中的方案可以参加前述为第二通信设备选择第二哈希算法信息的方法,在此不再赘述。
第三消息可以指示第一通信设备根据第四哈希算法信息和第二通信设备的端口的第二数量的信息更新第一通信设备的一次负载均衡方式(比如层2或层3负载均衡)或者多次负载均衡(比如层2和层3负载均衡)对应的哈希算法。
当负载均衡设备与第二通信设备分别为两个设备时,负载均衡设备还可以向第二通信设备发送第四哈希算法信息,用于告知第二通信设备其所使用的哈希算法信息。
又一种可能的实施方式中,可以由负载均衡设备为第一通信设备重新选择哈希算法信息,比如S604之后可以通过执行图7b中的下述S607和S608的内容实现。
S607,负载均衡设备根据第四哈希算法信息、第一数量的信息和第二通信设备的端口的第二数量的信息,确定第一通信设备的负载均衡方式的第五哈希算法信息。
第四哈希算法信息满足第三条件,第三条件包括:基于第四哈希算法信息对第三报文和第四报文分别进行哈希计算,并将得到的两个哈希值分别对第二数量取模,得到的两个哈希模值不同。如此,第三报文和第四报文可以在第二通信设备上通过两条链路进行发送,从而可以减轻网络的极化问题。
第三报文和第四报文可以为其他通信设备基于第五哈希算法信息和第一数量进行负载均衡后发送给第二通信设备的报文。又一种可能的实施方式中,第三条件还包括:基于第五哈希算法信息对第三报文和第四报文分别进行哈希计算,并将得到的两个哈希值分别对第一数量取模,得到的两个哈希模值相同。如此第二通信设备的上级设备基于第五哈希算法信息和第一数量进行负载均衡后可以将第三报文和第四报文发送至第二通信设备。进而,第三报文和第四报文可以在第二通信设备上通过两条链路进行发送,从而可以减轻网络的极化问题。
通过S607,负载均衡设备可以重新为第一通信设备选择哈希算法,以达到减轻网络中的极化问题,为第一通信设备选择哈希算法以及其他哈希算法信息中的参数中的方案可以参加前述为第二通信设备选择第二哈希算法信息的方法,在此不再赘述。
负载均衡设备选择第四哈希算法信息的方案与前述负载均衡设备选择第二哈希算法信息的内容类似,在此不再赘述。
又一种可能的实施方式中,负载均衡设备还可以根据第四哈希算法信息、第一数量的信息和第二通信设备的端口的第二数量的信息,确定第一通信设备的负载均衡方式的第七 哈希算法信息。第五哈希算法信息和第七哈希算法信息可以分别为第一通信设备的两次负载均衡的哈希算法信息,比如可以分别为层3和层2的负载均衡对应的哈希算法信息。
S608,负载均衡设备向第一通信设备发送第四消息,第四消息用于通知第一通信设备基于第五哈希算法信息进行报文转发。
在S608中,哈希算法信息为第一通信设备重新选择哈希算法信息后,可以通过第四消息告知第一通信设备,以便第一通信设备基于重新选择的第五哈希算法信息进行报文转发。
本申请实施例中负载均衡设备若为独立于第一通信设备和第二通信设备之外的设备,则可以通过与第一通信设备和第二通信设备分别进行信息交互实现本申请实施例的方案,若负载均衡设备位于第二通信设备,则第一通信设备和第二通信设备之间相互的信息交互可以实现上述方案。通过上述内容可以看出,通过信息的交互,负载均衡设备可以结合第一通信设备和第二通信设备的信息为二者选择更合理的哈希算法信息,从而可以减轻极化问题。
本申请实施例中第一哈希算法信息或第一数量的信息中的至少一项承载于以下信息:链路层发现协议(link layer discovery protocol,LLDP)消息、开发的最短路径优先路由协议(open shortest path first,OSPF)消息,或边界网关路由协议(border gateway protocol,BGP)消息、链路汇聚控制协议(link aggregation control protocol,LACP)。
图8a示例性示出了本申请实施例提供的一种用于承载第一哈希算法信息和第一数量的信息的扩展LLDP消息的结构示意图。
如图8a所示,该扩展LLDP消息可以包括TLV头(header)和TLV信息字符串(information string)。其中,TLV头(header)可以包括TLV类型(type)、TLV信息字符串长度(information string length)。TLV信息字符串(information string)可以包括802.1 OUI 00-80-C2(3字节(octets))、802.1子类型(subtype)=21(1字节(octets)、设备类型(device type)(1字节(octets)、哈希算法编码标识(hash code ID(1字节(octets))、组成员(members of group)(1字节(octets))。其中,设备类型(device type),可以用来指明数据平面用来实现流量负载均衡的实体类型,例如交换芯片厂家型号、服务器实现链路bonding的版本等,可以统一进行编码。
如图8a所示,哈希算法编码标识(hash code ID(1字节(octets)),可以用于承载哈希算法信息,比如上述哈希算法信息中以下参数(比如前述参数a1、参数a2、参数a3和参数a4)中的至少一项:哈希算法、哈希关键信息的参数项、哈希关键信息的各个参数项的排列顺序,或哈希值取值方式等。一种可能的实施方式中,可以为哈希算法信息中的各个参数(比如前述参数a1、参数a2、参数a3和参数a4)的不同组合进行编码标识,如此通过该字段承载的信息确定组合标识,进而根据组合标识确定该组合中参数a1、参数a2、参数a3或参数a4的具体内容,从而可以减少该字段承载的数据量。
如图8a所示,组成员(members of group)(1字节(octets)),可以用于承载第一数量的信息。
图8b示例性示出了本申请实施例提供的另一种用于承载第一哈希算法信息和第一数量的信息的OSPF(或者称OSPF Opaque)消息的结构示意图。
如图8b所示,该扩展OSPF消息可以包括链路状态(link state,LS)生存时间(age)、 选项(options)、不透明类型(opaque tyep)、不透明标识(opaque ID)、公告路由器(advertising router)、LS序号(sequence number)、LS校验和(checksum)、长度(length)、设备类型(device type)、哈希算法编码标识(hash code ID)、组成员(members of group))。
图8c示例性示出了本申请实施例提供的另一种用于承载第一哈希算法信息和第一数量的信息的BGP(或者称BGP Opaque)消息的结构示意图。如图8c所示,该BGP消息包括地址族标识符(address family identifier)(2字节(octets))、后续地址族标识符(subsequent address family identifier)(1字节(octets))、下一跳地址长度(length of next hop address)(字节(octets)),必须为0(must be zero)、保留位(reserved)(1字节(octets)),必须为0(must be zero)、不透明秘钥长度(opaque key length)(2字节(octets))、不透明秘钥数据(opaque key data)(4字节(octets))。
图8b和图8c中的设备类型(device type)、哈希算法编码标识(hash code ID)和组成员(members of group)均可以参见前述图8a的内容,在此不再赘述。对于LAG/Trunk应用场景,第一哈希算法信息或第一数量的信息还可以通过LACP消息携带,携带的信息与LLDP等协议携带的信息类似,不再赘述。
下述内容通过表6和表7示例性示出了网络利用率的示意表。表6中第一通信设备为图2a中的TOR级通信设备,第二通信设备为图2a中的leaf级通信设备,且二者使用相同的哈希算法信息,即第一哈希算法信息对应的哈希算法与第二哈希算法信息对应的哈希算法相同,第一哈希算法信息对应的哈希关键信息的参数项与第二哈希算法信息对应的哈希关键信息的参数项相同;第一哈希算法信息对应的哈希关键信息的各个参数项的排列顺序与第二哈希算法信息对应的哈希关键信息的各个参数项的排列顺序相同;第一哈希算法信息对应的哈希值的取值方式与第二哈希算法信息对应的哈希值的取值方式相同。
表6网络利用率的示意表
Figure PCTCN2022106253-appb-000007
以表6的第一行为例进行介绍,在“#flows”流量模型下总的流的数目为294912的情况下,当第一通信设备和第二通信设备的上行的端口数量均为4时,网络利用率为25%;当第一通信设备和第二通信设备的上行的端口数量均为8时,网络利用率为12.5%;当第一通信设备和第二通信设备的上行的端口数量均为16时,网络利用率为6.25%;当第一通 信设备和第二通信设备的上行的端口数量均为32时,网络利用率为3.125%。其他行内容与之类似,不再赘述。通过表6可以看出,第一通信设备和第二通信设备采用相同的哈希算法信息时,网络利用率较低,出现极化问题。
表7中第一通信设备为图2a中TOR级通信设备,第二通信设备为图2a中leaf级通信设备,第一哈希算法信息对应的哈希算法为CRC16b,第二哈希算法信息对应的哈希算法为CRC32LO。CRC算法通常以生成多项式标识,CRC16b和CRC32LO是CRC代码名称,CRC16b对应的CRC生成多项式为0x1021。CRC32LO对应的CRC生成多项式为0x1EDC6F41,其中0x前缀表示这是一个以16位进制表示的数字。第一哈希算法信息对应的哈希关键信息的参数项与第二哈希算法信息对应的哈希关键信息的参数项相同,第一哈希算法信息对应的哈希关键信息的各个参数项的排列顺序与第二哈希算法信息对应的哈希关键信息的各个参数项的排列顺序相同,第一哈希算法信息对应的哈希值的取值方式与第二哈希算法信息对应的哈希值的取值方式相同。
表7网络利用率的示意表
Figure PCTCN2022106253-appb-000008
以表7的第一行为例进行介绍,在“#flows”流量模型下总的流的数目为294912的情况下,当第一通信设备和第二通信设备的上行的端口数量均为4时,网络利用率为99.9%;当第一通信设备和第二通信设备的上行的端口数量均为8时,网络利用率为99.9%;当第一通信设备和第二通信设备的上行的端口数量均为16时,网络利用率为98.814%;当第一通信设备和第二通信设备的上行的端口数量均为32时,网络利用率为95.238%。其他行内容与之类似,不再赘述。通过表7可以看出,应用本申请实施例提供的方案后,网络利用率可以得到提高,可以减轻网络中的极化问题。
可以理解的是,为了实现上述实施例中功能,负载均衡设备包括了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本申请中所公开的实施例描述的各示例的单元及方法步骤,本申请能够以硬件或硬件和计算机软件相结合的形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用场景和设计约束条件。
图9、图10和图11为本申请的实施例提供的可能的通信装置的结构示意图。这些通 信装置可以用于实现上述方法实施例中负载均衡设备的功能,因此也能实现上述方法实施例所具备的有益效果。在本申请的实施例中,该通信装置可以是如图1a、图1b、图1c或图1d所示的负载均衡设备,还可以是应用于负载均衡设备的模块(如芯片)。
如图9所示,通信装置1300包括处理单元1310和收发单元1320。通信装置1300用于实现上述图4、图6、图7a或图7b中所示的方法实施例中负载均衡设备的功能。
当通信装置1300用于实现图4、图6、图7a或图7b所示的方法实施例中负载均衡设备的功能时:处理单元1310用于通过收发单元1320执行:接收第一消息,第一消息包括第一通信设备的负载均衡方式的第一哈希算法信息和第一通信设备的第一端口的第一数量的信息。根据第一哈希算法信息和第一数量的信息,确定第二通信设备的负载均衡方式的第二哈希算法信息。
有关上述处理单元1310和收发单元1320更详细的描述可以直接参考图4、图6、图7a或图7b所示的方法实施例中相关描述直接得到,这里不加赘述。
如图10所示,通信装置1400包括处理电路1410和接口电路1420。处理电路1410和接口电路1420之间相互耦合。可以理解的是,接口电路1420可以为收发器或输入输出接口。可选的,通信装置1400还可以包括存储器,用于存储处理电路执行的指令或存储处理电路1410运行指令所需要的输入数据或存储处理电路1410运行指令后产生的数据。
当通信装置1400用于实现图4、图6、图7a或图7b所示的方法时,处理电路1410用于实现上述处理单元1310的功能,接口电路1420用于实现上述收发单元1320的功能。
如图11所示,通信装置1500包括处理器1510和通信接口1520。处理器1510和通信接口1520之间相互耦合。可以理解的是,通信接口1520可以为收发器或输入输出接口。可选的,通信装置1500还可以包括存储器1530,用于存储处理器1510执行的指令或存储处理器1510运行指令所需要的输入数据或存储处理器1510运行指令后产生的数据。
当通信装置1500用于实现图4、图6、图7a或图7b所示的方法时,处理器1510用于实现上述处理单元1310的功能,通信接口1520用于实现上述收发单元1320的功能。
当通信装置1500用于实现图4、图6、图7a或图7b所示的方法实施例中负载均衡设备的功能时:处理器1510用于通过通信接口1520执行:接收第一消息,第一消息包括第一通信设备的负载均衡方式的第一哈希算法信息和第一通信设备的第一端口的第一数量的信息。根据第一哈希算法信息和第一数量的信息,确定第二通信设备的负载均衡方式的第二哈希算法信息。
在一种可能的实施方式中,处理器1510用于:根据第一哈希算法信息、第一数量的信息和第二通信设备的第二端口的第二数量的信息,确定第二哈希算法信息。
在一种可能的实施方式中,处理器1510,还用于:通过通信接口接收第二消息,第二消息包括第一通信设备的负载均衡方式的第三哈希算法信息和第一通信设备的第三端口的第三数量的信息。根据第一消息和第二消息,确定第二通信设备的负载均衡方式的第二哈希算法信息。
在一种可能的实施方式中,处理器1510,用于:根据第一消息、第二消息和第二通信设备的第二端口的第二数量的信息,确定第二通信设备的负载均衡方式的第二哈希算法信息。
在一种可能的实施方式中,处理器1510,用于:根据第一哈希算法信息和第一数量的信息,查询预设的哈希算法信息关联关系,得到第二哈希算法信息。其中,哈希算法信息 关联关系包括:第一哈希算法信息、第一数量的信息、第二通信设备的端口的第二数量的信息和第二哈希算法信息的关联关系。
在一种可能的实施方式中,处理器1510,用于:确定N个哈希算法信息中哈希算法信息对应的第四数量;N为正整数;从N个哈希算法信息中选择对应的第四数量大于1的哈希算法信息作为第二哈希算法信息。其中,针对N个哈希算法信息中的哈希算法信息,哈希算法信息对应的第四数量为:基于哈希算法信息对M个报文分别进行哈希计算,将得到的M个哈希值分别对第二通信设备的端口的第二数量取模,并将得到M个哈希模值去重后所得到数值的数量;M为大于1的整数。
在一种可能的实施方式中,处理器1510,用于:从N个哈希算法信息中选择对应的第四数量最大的哈希算法信息作为第二哈希算法信息。
在一种可能的实施方式中,处理器1510,还用于:确定不存在满足第一条件的第二哈希算法信息,确定第二通信设备的负载均衡方式的第四哈希算法信息。通过通信接口1520向第一通信设备发送第三消息,第三消息用于指示第一通信设备根据第四哈希算法信息和第二通信设备的端口的第二数量的信息更新第一通信设备的负载均衡方式对应的哈希算法信息。其中,第一条件包括:基于第二哈希算法信息对第一报文和第二报文分别进行哈希计算,并将得到的两个哈希值分别对第二通信设备的端口的第二数量取模,得到的两个哈希模值不同。
在一种可能的实施方式中,处理器1510,还用于:确定不存在满足第一条件的第二哈希算法信息,确定第二通信设备的负载均衡方式的第四哈希算法信息。根据第四哈希算法信息、第一数量的信息和第二通信设备的端口的第二数量的信息,确定第一通信设备的负载均衡方式的第五哈希算法信息。通过通信接口1520向第一通信设备发送第四消息,第四消息用于通知第一通信设备基于第五哈希算法信息进行报文转发。
在一种可能的实施方式中,处理器1510,还用于:确定第二通信设备为从设备;确定不存在满足第一条件的第二哈希算法信息,将第二通信设备更新为主设备。
当上述通信装置为应用于负载均衡设备的芯片时,该芯片实现上述方法实施例中负载均衡设备的功能。该芯片从负载均衡设备中的其它模块接收信息,该信息是其他设备发送给负载均衡设备的;或者,该芯片向负载均衡设备中的其它模块发送信息,该信息是负载均衡设备发送给其他设备的。
可以理解的是,本申请的实施例中的处理器可以是中央处理单元(Central Processing Unit,CPU),还可以是其它通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其它可编程逻辑器件、晶体管逻辑器件,硬件部件或者其任意组合。通用处理器可以是微处理器,也可以是任何常规的处理器。
根据本申请实施例提供的方法,本申请还提供一种计算机程序产品,该计算机程序产品包括:计算机程序代码或指令,当该计算机程序代码或指令在计算机上运行时,使得该计算机执行图4、图6、图7a或图7b所示实施例中任意一个实施例的方法。
根据本申请实施例提供的方法,本申请还提供一种计算机可读存储介质,该计算机可读介质存储有程序代码,当该程序代码在计算机上运行时,使得该计算机执行图4、图6、图7a或图7b所示实施例中任意一个实施例的方法。
根据本申请实施例提供的方法,本申请还提供一种芯片系统,该芯片系统可以包括处 理器。该处理器与存储器耦合,可用于执行图4、图6、图7a或图7b所示实施例中任意一个实施例的方法。可选地,该芯片系统还包括存储器。存储器,用于存储计算机程序(也可以称为代码,或指令)。处理器,用于从存储器调用并运行计算机程序,使得安装有芯片系统的设备执行图4、图6、图7a或图7b所示实施例中任意一个实施例的方法。
根据本申请实施例提供的方法,本申请还提供一种系统,其包括前述的负载均衡设备和网络设备。
本申请的实施例中的方法步骤可以通过硬件的方式来实现,也可以由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器、闪存、只读存储器、可编程只读存储器、可擦除可编程只读存储器、电可擦除可编程只读存储器、寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于负载均衡设备中。当然,处理器和存储介质也可以作为分立组件存在于负载均衡设备中。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。计算机程序产品包括一个或多个计算机程序或指令。在计算机上加载和执行计算机程序或指令时,全部或部分地执行本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、网络设备、用户设备或者其它可编程装置。计算机程序或指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机程序或指令可以从一个网站站点、计算机、服务器或数据中心通过有线或无线方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是集成一个或多个可用介质的服务器、数据中心等数据存储设备。可用介质可以是磁性介质,例如,软盘、硬盘、磁带;也可以是光介质,例如,数字视频光盘;还可以是半导体介质,例如,固态硬盘。该计算机可读存储介质可以是易失性或非易失性存储介质,或可包括易失性和非易失性两种类型的存储介质。
需要指出的是,本专利申请文件的一部分包含受著作权保护的内容。除了对专利局的专利文件或记录的专利文档内容制作副本以外,著作权人保留著作权。
在本申请的各个实施例中,如果没有特殊说明以及逻辑冲突,不同的实施例之间的术语和/或描述具有一致性、且可以相互引用,不同的实施例中的技术特征根据其内在的逻辑关系可以组合形成新的实施例。
本申请中,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。在本申请的文字描述中,字符“/”,一般表示前后关联对象是一种“或”的关系;在本申请的公式中,字符“/”,表示前后关联对象是一种“相除”的关系。“包括A,B和C中的至少一个”可以表示:包括A;包括B;包括C;包括A和B;包括A和C;包括B和C;包括A、B和C。
可以理解的是,在本申请的实施例中涉及的各种数字编号仅为描述方便进行的区分,并不用来限制本申请的实施例的范围。上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定。

Claims (30)

  1. 一种负载均衡的哈希算法信息的确定方法,其特征在于,包括:
    接收第一消息,所述第一消息包括第一通信设备的负载均衡方式的第一哈希算法信息和所述第一通信设备的第一端口的第一数量的信息;
    根据所述第一哈希算法信息和所述第一数量的信息,确定第二通信设备的负载均衡方式的第二哈希算法信息。
  2. 如权利要求1所述的方法,其特征在于,所述第一哈希算法信息和所述第二通信设备的端口的第二数量满足以下内容中的至少一项:
    所述第一数量与所述第二数量不同,所述第一哈希算法信息与所述第二哈希算法信息相同;
    所述第一数量与所述第二数量不同,所述第一哈希算法信息与所述第二哈希算法信息不同;或,
    所述第一数量与所述第二数量相同,所述第一哈希算法信息与所述第二哈希算法信息不同。
  3. 如权利要求1或2所述的方法,其特征在于,所述第一哈希算法信息包括以下内容中的至少一项:
    第一哈希算法、第一哈希关键信息的参数项、所述第一哈希关键信息的各个参数项的排列顺序、第一哈希值取值方式;
    所述第二哈希算法信息包括以下内容中的至少一项:
    第二哈希算法、第二哈希关键信息的参数项、所述第二哈希关键信息的各个参数项的排列顺序,或第二哈希值取值方式。
  4. 如权利要求3所述的方法,其特征在于,在所述第一哈希算法信息与所述第二哈希算法信息不同的情况下,所述第一哈希算法信息和所是第二哈希算法信息满足以下内容中的至少一项:
    所述第一哈希算法与所述第二哈希算法不同;
    所述第一哈希关键信息的参数项与所述第二哈希关键信息的参数项不同;
    所述第一哈希关键信息的各个参数项的排列顺序与所述第二哈希关键信息的各个参数项的排列顺序不同;或,
    所述第一哈希值取值方式与所述第二哈希值取值方式不同。
  5. 如权利要求1-4任一项所述的方法,其特征在于,所述第一数量包括:所述第一通信设备的等价多路径(ECMP group)成员数量;或,
    所述第一通信设备的链路汇聚组(LAG group)成员数量。
  6. 如权利要求1-5任一项所述的方法,其特征在于,所述根据所述第一哈希算法信息和所述第一数量的信息,确定第二通信设备的负载均衡方式的第二哈希算法信息之前,还包括:
    接收第二消息,所述第二消息包括所述第一通信设备的负载均衡方式的第三哈希算法信息和所述第一通信设备的第三端口的第三数量的信息;
    所述根据所述第一哈希算法信息和所述第一数量的信息,确定第二通信设备的负载均衡方式的第二哈希算法信息,包括:
    根据所述第一消息和所述第二消息,确定第二通信设备的负载均衡方式的第二哈希算法信息。
  7. 如权利要求6所述的方法,其特征在于,所述第一数量包括所述第一通信设备的等价多路径(ECMP group)成员数量,所述第三数量包括所述第一通信设备的链路汇聚组(LAG group)成员数量。
  8. 如权利要求1-7任一项所述的方法,其特征在于,所述第二哈希算法信息满足第一条件,所述第一条件包括:
    基于所述第二哈希算法信息对第一报文和第二报文分别进行哈希计算,并将得到的两个哈希值分别对所述第二通信设备的第二端口的第二数量取模,得到的两个哈希模值不同。
  9. 如权利要求1-8任一项所述的方法,其特征在于,所述根据所述第一哈希算法信息和所述第一数量的信息,确定第二通信设备的负载均衡方式的第二哈希算法信息,包括:
    根据所述第一哈希算法信息和所述第一数量的信息,查询预设的哈希算法信息关联关系,得到所述第二哈希算法信息;
    其中,所述哈希算法信息关联关系包括:所述第一哈希算法信息、所述第一数量的信息、所述第二通信设备的端口的第二数量的信息和所述第二哈希算法信息的关联关系。
  10. 如权利要求1-8任一项所述的方法,其特征在于,所述根据所述第一哈希算法信息和所述第一数量的信息,确定第二通信设备的负载均衡方式的第二哈希算法信息,包括:
    确定N个哈希算法信息中哈希算法信息对应的第四数量;所述N为正整数;
    从所述N个哈希算法信息中选择对应的第四数量大于1的哈希算法信息作为所述第二哈希算法信息;
    其中,针对所述N个哈希算法信息中的哈希算法信息,所述哈希算法信息对应的第四数量为:
    基于所述哈希算法信息对M个报文分别进行哈希计算,将得到的M个哈希值分别对所述第二通信设备的端口的第二数量取模,并将得到M个哈希模值去重后所得到数值的数量;所述M为大于1的整数。
  11. 如权利要求1-10任一项所述的方法,其特征在于,所述接收第一消息之后,还包括:
    确定不存在满足第一条件的所述第二哈希算法信息,确定所述第二通信设备的负载均衡方式的第四哈希算法信息;
    向所述第一通信设备发送第三消息,所述第三消息用于指示所述第一通信设备根据所述第四哈希算法信息和所述第二通信设备的端口的第二数量的信息更新所述第一通信设备的负载均衡方式对应的哈希算法信息;
    其中,所述第一条件包括:
    基于所述第二哈希算法信息对第一报文和第二报文分别进行哈希计算,并将得到的两个哈希值分别对所述第二通信设备的端口的第二数量取模,得到的两个哈希模值不同。
  12. 如权利要求1-10任一项所述的方法,其特征在于,所述接收第一消息之后,还包括:
    确定不存在满足第一条件的所述第二哈希算法信息,确定所述第二通信设备的负载均衡方式的第四哈希算法信息;
    根据所述第四哈希算法信息、所述第一数量的信息和所述第二通信设备的端口的第二 数量的信息,确定第一通信设备的负载均衡方式的第五哈希算法信息;
    向所述第一通信设备发送第四消息,所述第四消息用于通知所述第一通信设备基于所述第五哈希算法信息进行报文转发。
  13. 如权利要求1-12任一项所述的方法,其特征在于,所述第一哈希算法信息或所述第一数量的信息中的至少一项承载于以下信息:
    链路层发现协议LLDP消息、开发的最短路径优先路由协议OSPF消息,或边界网关路由协议BGP消息。
  14. 一种用于确定负载均衡的哈希算法信息的设备,其特征在于,包括处理器和通信接口,所述处理器用于:
    通过所述通信接口接收第一消息,所述第一消息包括第一通信设备的负载均衡方式的第一哈希算法信息和所述第一通信设备的第一端口的第一数量的信息;
    根据所述第一哈希算法信息和所述第一数量的信息,确定第二通信设备的负载均衡方式的第二哈希算法信息。
  15. 如权利要求14所述的设备,其特征在于,所述第一哈希算法信息和所述第二通信设备的端口的第二数量满足以下内容中的至少一项:
    所述第一数量与所述第二数量不同,所述第一哈希算法信息与所述第二哈希算法信息相同;
    所述第一数量与所述第二数量不同,所述第一哈希算法信息与所述第二哈希算法信息不同;或,
    所述第一数量与所述第二数量相同,所述第一哈希算法信息与所述第二哈希算法信息不同。
  16. 如权利要求14或15所述的设备,其特征在于,所述第一哈希算法信息包括以下内容中的至少一项:
    第一哈希算法、第一哈希关键信息的参数项、所述第一哈希关键信息的各个参数项的排列顺序、第一哈希值取值方式;
    所述第二哈希算法信息包括以下内容中的至少一项:
    第二哈希算法、第二哈希关键信息的参数项、所述第二哈希关键信息的各个参数项的排列顺序,或第二哈希值取值方式。
  17. 如权利要求16所述的设备,其特征在于,在所述第一哈希算法信息与所述第二哈希算法信息不同的情况下,所述第一哈希算法信息和所是第二哈希算法信息满足以下内容中的至少一项:
    所述第一哈希算法与所述第二哈希算法不同;
    所述第一哈希关键信息的参数项与所述第二哈希关键信息的参数项不同;
    所述第一哈希关键信息的各个参数项的排列顺序与所述第二哈希关键信息的各个参数项的排列顺序不同;或,
    所述第一哈希值取值方式与所述第二哈希值取值方式不同。
  18. 如权利要求14-17任一项所述的设备,其特征在于,所述第一数量包括:所述第一通信设备的等价多路径(ECMP group)成员数量;或,
    所述第一通信设备的链路汇聚组(LAG group)成员数量。
  19. 如权利要求14-18任一项所述的设备,其特征在于,所述处理器,还用于:
    通过所述通信接口接收第二消息,所述第二消息包括所述第一通信设备的负载均衡方式的第三哈希算法信息和所述第一通信设备的第三端口的第三数量的信息;
    根据所述第一消息和所述第二消息,确定第二通信设备的负载均衡方式的第二哈希算法信息。
  20. 如权利要求19所述的设备,其特征在于,所述第一数量包括所述第一通信设备的等价多路径(ECMP group)成员数量,所述第三数量包括所述第一通信设备的链路汇聚组(LAG group)成员数量。
  21. 如权利要求14-20任一项所述的设备,其特征在于,所述第二哈希算法信息满足第一条件,所述第一条件包括:
    基于所述第二哈希算法信息对第一报文和第二报文分别进行哈希计算,并将得到的两个哈希值分别对所述第二通信设备的第二端口的第二数量取模,得到的两个哈希模值不同。
  22. 如权利要求14-21任一项所述的设备,其特征在于,所述处理器,用于:
    根据所述第一哈希算法信息和所述第一数量的信息,查询预设的哈希算法信息关联关系,得到所述第二哈希算法信息;
    其中,所述哈希算法信息关联关系包括:所述第一哈希算法信息、所述第一数量的信息、所述第二通信设备的端口的第二数量的信息和所述第二哈希算法信息的关联关系。
  23. 如权利要求14-21任一项所述的设备,其特征在于,所述处理器,用于:
    确定N个哈希算法信息中哈希算法信息对应的第四数量;所述N为正整数;
    从所述N个哈希算法信息中选择对应的第四数量大于1的哈希算法信息作为所述第二哈希算法信息;
    其中,针对所述N个哈希算法信息中的哈希算法信息,所述哈希算法信息对应的第四数量为:
    基于所述哈希算法信息对M个报文分别进行哈希计算,将得到的M个哈希值分别对所述第二通信设备的端口的第二数量取模,并将得到M个哈希模值去重后所得到数值的数量;所述M为大于1的整数。
  24. 如权利要求14-23任一项所述的设备,其特征在于,所述处理器,还用于:
    确定不存在满足第一条件的所述第二哈希算法信息,确定所述第二通信设备的负载均衡方式的第四哈希算法信息;
    通过所述通信接口向所述第一通信设备发送第三消息,所述第三消息用于指示所述第一通信设备根据所述第四哈希算法信息和所述第二通信设备的端口的第二数量的信息更新所述第一通信设备的负载均衡方式对应的哈希算法信息;
    其中,所述第一条件包括:
    基于所述第二哈希算法信息对第一报文和第二报文分别进行哈希计算,并将得到的两个哈希值分别对所述第二通信设备的端口的第二数量取模,得到的两个哈希模值不同。
  25. 如权利要求14-23任一项所述的设备,其特征在于,所述处理器,还用于:
    确定不存在满足第一条件的所述第二哈希算法信息,确定所述第二通信设备的负载均衡方式的第四哈希算法信息;
    根据所述第四哈希算法信息、所述第一数量的信息和所述第二通信设备的端口的第二数量的信息,确定第一通信设备的负载均衡方式的第五哈希算法信息;
    通过所述通信接口向所述第一通信设备发送第四消息,所述第四消息用于通知所述第一通信设备基于所述第五哈希算法信息进行报文转发。
  26. 如权利要求14-25任一项所述的设备,其特征在于,所述第一哈希算法信息或所述第一数量的信息中的至少一项承载于以下信息:
    链路层发现协议LLDP消息、开发的最短路径优先路由协议OSPF消息,或边界网关路由协议BGP消息。
  27. 一种通信装置,其特征在于,所述装置包括处理器和存储器,
    所述存储器,用于存储可执行程序;
    所述处理器,用于执行存储器中的计算机可执行程序,使得权利要求1-13中任一项所述的方法被执行。
  28. 一种通信装置,其特征在于,包括用于执行如权利要求1-13中的任一项所述方法的模块。
  29. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机可执行程序,所述计算机可执行程序在被计算机调用时,使所述计算机执行如权利要求1-13任一项所述的方法。
  30. 一种芯片系统,其特征在于,包括:
    所述通信接口,用于输入和/或输出信息;
    处理器,用于执行计算机可执行程序,使得安装有所述芯片系统的设备执行如权利要求1-13任一项所述的方法。
PCT/CN2022/106253 2021-08-03 2022-07-18 负载均衡的哈希算法信息的确定方法、装置及存储介质 WO2023011153A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP22851867.6A EP4369682A4 (en) 2021-08-03 2022-07-18 METHOD AND APPARATUS FOR DETERMINING HASH ALGORITHM INFORMATION FOR LOAD BALANCING, AND STORAGE MEDIUM
US18/430,159 US20240179095A1 (en) 2021-08-03 2024-02-01 Method and apparatus for determining hash algorithm information for load balancing, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110887822.6A CN115914234A (zh) 2021-08-03 2021-08-03 负载均衡的哈希算法信息的确定方法、装置及存储介质
CN202110887822.6 2021-08-03

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/430,159 Continuation US20240179095A1 (en) 2021-08-03 2024-02-01 Method and apparatus for determining hash algorithm information for load balancing, and storage medium

Publications (1)

Publication Number Publication Date
WO2023011153A1 true WO2023011153A1 (zh) 2023-02-09

Family

ID=85155130

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/106253 WO2023011153A1 (zh) 2021-08-03 2022-07-18 负载均衡的哈希算法信息的确定方法、装置及存储介质

Country Status (4)

Country Link
US (1) US20240179095A1 (zh)
EP (1) EP4369682A4 (zh)
CN (1) CN115914234A (zh)
WO (1) WO2023011153A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116192636A (zh) * 2023-04-27 2023-05-30 苏州浪潮智能科技有限公司 网络设备哈希组配置方法、装置、电子设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103414651A (zh) * 2013-08-02 2013-11-27 杭州华三通信技术有限公司 一种调整等价路由均衡分担的方法和网络设备
CN107623640A (zh) * 2017-11-07 2018-01-23 北京锐安科技有限公司 一种增强哈希算法的方法以及装置
US20200007448A1 (en) * 2018-07-02 2020-01-02 Marvell Israel (M.I.S.L) Ltd. Group specific load balancing in network devices
CN113132249A (zh) * 2019-12-31 2021-07-16 华为技术有限公司 一种负载均衡方法和设备
CN114070797A (zh) * 2021-09-29 2022-02-18 新华三信息安全技术有限公司 控制数据发送的方法及系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103414651A (zh) * 2013-08-02 2013-11-27 杭州华三通信技术有限公司 一种调整等价路由均衡分担的方法和网络设备
CN107623640A (zh) * 2017-11-07 2018-01-23 北京锐安科技有限公司 一种增强哈希算法的方法以及装置
US20200007448A1 (en) * 2018-07-02 2020-01-02 Marvell Israel (M.I.S.L) Ltd. Group specific load balancing in network devices
CN113132249A (zh) * 2019-12-31 2021-07-16 华为技术有限公司 一种负载均衡方法和设备
CN114070797A (zh) * 2021-09-29 2022-02-18 新华三信息安全技术有限公司 控制数据发送的方法及系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4369682A4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116192636A (zh) * 2023-04-27 2023-05-30 苏州浪潮智能科技有限公司 网络设备哈希组配置方法、装置、电子设备和存储介质
CN116192636B (zh) * 2023-04-27 2023-08-15 苏州浪潮智能科技有限公司 网络设备哈希组配置方法、装置、电子设备和存储介质

Also Published As

Publication number Publication date
EP4369682A4 (en) 2024-07-03
US20240179095A1 (en) 2024-05-30
EP4369682A1 (en) 2024-05-15
CN115914234A (zh) 2023-04-04

Similar Documents

Publication Publication Date Title
KR102205882B1 (ko) 팻-트리 라우팅에 기반하여 별개의 인피니밴드 서브넷들 사이에서 트래픽을 라우팅하기 위한 시스템 및 방법
WO2017128945A1 (zh) 一种业务流量的分配方法及装置
US9270618B2 (en) Source routing with fabric switches in an ethernet fabric network
EP2476226B1 (en) Apparatus for selecting between multiple equal cost paths
US9967183B2 (en) Source routing with entropy-header
US10693790B1 (en) Load balancing for multipath group routed flows by re-routing the congested route
CN110061915B (zh) 跨多个架构交换机的虚拟链路聚合的方法和系统
WO2020001299A1 (zh) 一种发送报文的方法、设备和系统
EP2928130B1 (en) Systems and methods for load balancing multicast traffic
US10547547B1 (en) Uniform route distribution for a forwarding table
US11228524B1 (en) Methods and apparatus for efficient use of link aggregation groups
WO2017190559A1 (zh) 路由查找方法、装置、分配节点、查找节点及入口节点
US20240179095A1 (en) Method and apparatus for determining hash algorithm information for load balancing, and storage medium
US20220174004A1 (en) Methods and apparatus for encoding local processing metadata in network headers
US7606230B1 (en) Link aggregation for routed ports
WO2023116580A1 (zh) 路径切换方法、装置、网络设备、以及网络系统
WO2019024759A1 (zh) 一种数据通信方法及数据通信网络
WO2024093778A1 (zh) 一种报文处理方法以及相关装置
WO2022007550A1 (zh) 一种负载均衡方法、装置、网络设备及系统
WO2017084228A1 (zh) 软件定义网络中流量项目的管理方法
WO2019084805A1 (zh) 一种分发报文的方法及装置
WO2015039616A1 (zh) 一种报文处理方法及设备
WO2023202639A1 (zh) 报文发送的方法、网络设备及通信系统
US11070472B1 (en) Dynamically mapping hash indices to member interfaces
EP4325800A1 (en) Packet forwarding method and apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22851867

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022851867

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022851867

Country of ref document: EP

Effective date: 20240209

NENP Non-entry into the national phase

Ref country code: DE