CN108540399B - Load sharing implementation method and device - Google Patents

Load sharing implementation method and device Download PDF

Info

Publication number
CN108540399B
CN108540399B CN201810384852.3A CN201810384852A CN108540399B CN 108540399 B CN108540399 B CN 108540399B CN 201810384852 A CN201810384852 A CN 201810384852A CN 108540399 B CN108540399 B CN 108540399B
Authority
CN
China
Prior art keywords
load sharing
routing node
sharing algorithm
local routing
mac address
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201810384852.3A
Other languages
Chinese (zh)
Other versions
CN108540399A (en
Inventor
武伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
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 New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201810384852.3A priority Critical patent/CN108540399B/en
Publication of CN108540399A publication Critical patent/CN108540399A/en
Application granted granted Critical
Publication of CN108540399B publication Critical patent/CN108540399B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Abstract

The invention provides a method and a device for realizing load sharing, wherein the method comprises the following steps: receiving a load sharing algorithm notification message sent by a neighbor routing node; the load sharing algorithm notification message comprises an identifier of a first load sharing algorithm used by the neighbor routing node; determining a second load sharing algorithm used by the local routing node from the load sharing algorithms supported by the local routing node according to the identifier of the first load sharing algorithm; the second load sharing algorithm and the first load sharing algorithm are different load sharing algorithms. The embodiment of the invention can optimize the load sharing effect of the networking.

Description

Load sharing implementation method and device
Technical Field
The present invention relates to the field of network communication technologies, and in particular, to a method and an apparatus for implementing load sharing.
Background
The load sharing algorithm is to obtain a hash value according to different hash algorithms according to quintuple information of the flow, and load share the flow according to the number of equivalent routes according to the hash value.
At present, the scenario of load sharing between routing nodes by using an equivalent route is common. Once two consecutive routing nodes adopt the same load sharing algorithm, the load sharing of the second routing node is greatly reduced because the traffic has been screened once.
Taking the scenario shown in fig. 1 as an example, the traffic of R1 is load-shared to R2 and R3, and after receiving the traffic sent by R1, R2 again load-shares to R4 through two equivalent routes. When R2 receives traffic that has been screened once by R1 through a load sharing algorithm, if R2 uses the same load sharing algorithm as R1, then since the hash value obtained by hash of the R2 using the load sharing algorithm on the quintuple information of the traffic is the same as the hash value obtained by hash of R1 using the load sharing algorithm on the quintuple information of the traffic, the traffic received by R2 and sent by R1 is forwarded to R4 through the same link, that is, load sharing is not realized between R2 and R4, and equivalent bandwidth is wasted.
Disclosure of Invention
The invention provides a method and a device for realizing load sharing, which aim to solve the problem of poor load sharing effect caused by the use of the same load sharing algorithm between adjacent routing nodes in the existing load sharing scheme.
According to a first aspect of the present invention, a method for implementing load sharing is provided, which is applied to a routing node, and the method includes:
receiving a load sharing algorithm notification message sent by a neighbor routing node, wherein the load sharing algorithm notification message comprises an identifier of a first load sharing algorithm used by the neighbor routing node;
determining a second load sharing algorithm used by the local routing node from the load sharing algorithms supported by the local routing node according to the identifier of the first load sharing algorithm;
the second load sharing algorithm and the first load sharing algorithm are different load sharing algorithms.
With reference to the first aspect, in a first possible implementation manner, the determining, according to the identifier of the first load sharing algorithm, a second load sharing algorithm used by the local routing node from among load sharing algorithms supported by the local routing node includes:
when the priority level of the neighbor routing node is higher than the priority level of the local routing node, selecting a load sharing algorithm which is not used by the neighbor routing node from load sharing algorithms supported by the local routing node according to the identifier of the first load sharing algorithm;
and determining the selected load sharing algorithm as a second load sharing algorithm used by the local routing node.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner, the selecting a load sharing algorithm that is not used by the neighbor routing node from among load sharing algorithms supported by the local node includes:
selecting a load sharing algorithm which is not used by the neighbor routing node and has the minimum identifier from the load sharing algorithms supported by the local routing node;
or the like, or, alternatively,
and selecting one load sharing algorithm which is not used by the neighbor routing node and has the maximum identifier from the load sharing algorithms supported by the local routing node.
With reference to the first possible implementation manner of the first aspect, in a third possible implementation manner, the determining, according to the identifier of the first load sharing algorithm, a second load sharing algorithm used by the local routing node from among load sharing algorithms supported by the local routing node, further includes:
when the priority level of the neighbor routing node is higher than that of the local routing node and no load sharing algorithm which is not used by the neighbor routing node exists in the load sharing algorithms supported by the local routing node, selecting a load sharing algorithm with the least use times from the load sharing algorithms supported by the local routing node according to the identifier of the first load sharing algorithm;
determining the selected load sharing algorithm as a second load sharing algorithm used by the local routing node;
the number of times of using the load sharing algorithm is the number of neighbor routing nodes using the load sharing algorithm and having priority levels higher than that of the local routing node.
With reference to the first possible implementation manner of the first aspect, in a fourth possible implementation manner, after receiving a load sharing algorithm notification packet sent by a neighboring routing node, the method further includes:
comparing the size of the full-network MAC address recorded by the local routing node with the size of the full-network MAC address contained in the received load sharing algorithm notification message;
if the recorded full-network MAC address is smaller than the full-network MAC address included in the received load sharing algorithm notification message, updating the recorded full-network MAC address to the full-network MAC address included in the received load sharing algorithm notification message;
or the like, or, alternatively,
if the recorded full-network MAC address is larger than the full-network MAC address included in the received load sharing algorithm notification message, updating the recorded full-network MAC address to the full-network MAC address included in the received load sharing algorithm notification message;
the determining, according to the identifier of the first load sharing algorithm, a second load sharing algorithm used by the local routing node from among the load sharing algorithms supported by the local routing node includes:
and when the full-network MAC address included in the received load sharing algorithm notification message is the same as the recorded full-network MAC address, determining a second load sharing algorithm used by the local routing node from the load sharing algorithms supported by the local routing node according to the identifier of the first load sharing algorithm.
According to a second aspect of the present invention, there is provided a load sharing apparatus, applied to a routing node, the apparatus including:
the receiving unit is used for notifying a load sharing algorithm notification message sent by a neighbor routing node, wherein the load sharing algorithm notification message comprises an identifier of a first load sharing algorithm used by the neighbor routing node;
a control unit, configured to determine, according to the identifier of the first load sharing algorithm, a second load sharing algorithm used by the local routing node from among load sharing algorithms supported by the local routing node; the second load sharing algorithm and the first load sharing algorithm are different load sharing algorithms.
With reference to the second aspect, in a first possible implementation manner, the load sharing algorithm notification packet further includes a priority level of the neighbor routing node;
the control unit is specifically configured to select, according to the identifier of the first load sharing algorithm, one load sharing algorithm that is not used by the neighbor routing node from the load sharing algorithms supported by the local routing node when the priority level of the neighbor routing node is higher than the priority level of the local routing node; and determining the selected load sharing algorithm as a second load sharing algorithm used by the local routing node.
With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner, the control unit is specifically configured to select, from load sharing algorithms supported by the local routing node, a load sharing algorithm that is not used by the neighboring routing node and has a smallest identifier of the load sharing algorithm; or the like, or, alternatively,
the control unit is specifically configured to select a load sharing algorithm that is not used by the neighboring routing node and has a maximum identifier from load sharing algorithms supported by the local routing node.
With reference to the first possible implementation manner of the second aspect, in a third possible implementation manner, the control unit is further configured to select, when the priority level of the neighboring routing node is higher than the priority level of the local routing node and no load sharing algorithm that is not used by the neighboring routing node exists in load sharing algorithms supported by the local routing node, a load sharing algorithm that is used the least number of times from among the load sharing algorithms supported by the local routing node according to an identifier of the first load sharing algorithm; determining the selected load sharing algorithm as a second load sharing algorithm used by the local routing node;
the number of times of using the load sharing algorithm is the number of neighbor routing nodes using the load sharing algorithm and having priority levels higher than that of the local routing node.
With reference to the first possible implementation manner of the second aspect, in a fourth possible implementation manner, the load sharing algorithm notification message further includes a full-network MAC address, and an initial value of the full-network MAC address is an MAC address of a message sender node;
the device further comprises:
a recording unit for recording the whole network MAC address;
a comparing unit, configured to compare the full-network MAC address recorded by the local routing node with the size of the full-network MAC address included in the received load sharing algorithm notification message;
the recording unit is further configured to update the recorded full-network MAC address to the full-network MAC address included in the received load sharing algorithm notification message if the recorded full-network MAC address is smaller than the full-network MAC address included in the received load sharing algorithm notification message;
or the like, or, alternatively,
the recording unit is further configured to update the recorded full-network MAC address to the full-network MAC address included in the received load sharing algorithm notification message if the recorded full-network MAC address is smaller than the full-network MAC address included in the received load sharing algorithm notification message;
the control unit is specifically configured to determine, according to the identifier of the first load sharing algorithm, a second load sharing algorithm used by the local routing node from the load sharing algorithms supported by the local routing node when all the full-network MAC addresses included in the received load sharing algorithm notification message are the same as the recorded full-network MAC addresses.
By applying the technical scheme disclosed by the invention, the notification message of the load sharing algorithm sent by the neighbor routing node is received, and then the second load sharing algorithm used by the local routing node is determined from the load sharing algorithms supported by the local routing node according to the identifier of the first load sharing algorithm contained in the notification message of the received load sharing algorithm, so that the load sharing algorithm used by the local routing node is different from the load sharing algorithm used by the neighbor routing node, the reduction of the load sharing effect caused by the same load sharing algorithm used between the neighbor routing nodes is avoided, and the load sharing effect of networking is optimized.
Drawings
FIG. 1 is a schematic diagram of a load sharing network;
fig. 2 is a schematic flowchart of a load sharing implementation method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a load sharing implementation apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another load sharing implementation apparatus according to an embodiment of the present invention;
fig. 5 is a schematic hardware structure diagram of a load sharing implementation apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions in the embodiments of the present invention better understood and make the above objects, features and advantages of the embodiments of the present invention more comprehensible, the technical solutions in the embodiments of the present invention are described in further detail below with reference to the accompanying drawings.
Referring to fig. 2, a schematic flow chart of a load sharing implementation method provided in an embodiment of the present invention is shown, where the load sharing implementation method may be applied to a routing node (referred to as a local routing node herein), and as shown in fig. 2, the load sharing implementation method may include the following steps:
step 201, receiving a load sharing algorithm notification message sent by a neighboring routing node, where the load sharing algorithm notification message includes an identifier of a first load sharing algorithm used by the neighboring routing node.
It should be noted that, in the embodiment of the present invention, the local routing node or the neighboring routing node does not refer to a fixed routing node, and the local routing node and the neighboring routing node are relatively speaking.
For example, taking the scenario shown in fig. 1 as an example, when R1 is the local routing node, the neighbor routing nodes include R2 and R3; when R2 is the local routing node, the neighbor routing nodes include R1 and R4.
In the embodiment of the invention, in order to avoid the reduction of the load sharing effect caused by the same load sharing algorithm used between the directly connected routing nodes, the directly connected routing nodes can mutually inform the load sharing algorithm used by the node.
Correspondingly, in the embodiment of the invention, the local routing node can receive the load sharing algorithm notification message sent by the neighbor routing node.
Still taking the scenario shown in fig. 1 as an example, R1 may receive a load sharing algorithm notification message sent by R2 and R3; the R2 may receive the load sharing algorithm notification messages sent by R1 and R4.
The load sharing algorithm notification message may carry an identifier of a load sharing algorithm (referred to as a first load sharing algorithm herein) of the neighboring routing node, where the identifier of the load sharing algorithm is in one-to-one correspondence with the load sharing algorithm, that is, the same identifier of the load sharing algorithm is the same, and the identifiers of different load sharing algorithms are different.
For example, the load sharing algorithms supported by each routing node may be numbered uniformly, and the number is used as an identifier of the load sharing algorithm.
It should be noted that, in the embodiment of the present invention, the first load sharing algorithm does not refer to a fixed load sharing algorithm, and when the number of the neighbor routing devices is multiple, the first load sharing algorithm may also include multiple different load sharing algorithms.
For example, still taking the scenario shown in fig. 1 as an example, when the local routing node is R2, the neighboring routing nodes are R1 and R4, the load sharing algorithm used by R1 is load sharing algorithm 1, and the load sharing algorithm used by R4 is load sharing algorithm 2, then for R2, the first load sharing algorithm may include load sharing algorithm 1 and load sharing algorithm 4.
In an embodiment of the present invention, the load sharing algorithm notification message may be an LLDP message.
In this embodiment, the load sharing algorithm notification may be performed between the directly connected routing nodes through an LLDP (Link Layer Discovery Protocol) Protocol, that is, the LLDP Protocol is extended, and a Type/Length/Value (TLV) is newly added in the LLDP message, where the newly added TLV may be used to carry identification information of the load sharing algorithm.
It should be appreciated that, in the embodiment of the present invention, the load sharing algorithm notification packet is not limited to the LLDP packet, and a packet format specially used for performing load sharing algorithm notification may also be newly defined, and specific implementation thereof is not described herein again.
It should be noted that, since the local routing node and the neighboring routing node are relatively speaking, for any neighboring routing node of the local routing node, the local routing node is also a neighboring routing node of the neighboring routing node, and therefore the local routing node also needs to send a load sharing algorithm notification message to the neighboring routing node.
In the embodiment of the present invention, the local routing node may send the load sharing algorithm notification packet to the neighboring routing node at regular time (e.g., periodically), or the local routing node may send the load sharing algorithm notification packet to the neighboring routing node when the load sharing algorithm used by the local routing node changes or a new neighboring routing node is detected to be added.
Step 202, according to the identifier of the first load sharing algorithm, determining a second load sharing algorithm used by the local routing node from the load sharing algorithms supported by the local routing node; the second load sharing algorithm and the first load sharing algorithm are different load sharing algorithms.
In the embodiment of the present invention, when the local routing node receives the load sharing algorithm sent by the neighboring routing node, the identifier of the first load sharing algorithm carried in the received load sharing algorithm may be obtained to determine the load sharing algorithm used by the neighboring routing node, and then, according to the identifier of the first load sharing algorithm, a load sharing algorithm that is not used by the neighboring node is selected from the load sharing algorithms supported by the local routing node, and is determined as the load sharing algorithm used by the local routing node (referred to as the second load sharing algorithm herein), so that the load sharing algorithm used by the local routing node is different from the load sharing algorithm used by the neighboring routing node, and the load sharing effect of the networking is optimized.
It should be noted that, in the embodiment of the present invention, when the local routing node determines, according to the identifier of the first load sharing algorithm, that the load sharing algorithm used by the local routing node is different from the load sharing algorithms used by the neighboring routing nodes, the local routing node may not change the load sharing algorithm used by the local routing node.
Therefore, in the embodiment of the present invention, the load sharing algorithm used by the node is mutually notified among the directly connected routing nodes, and then, the local routing node may select one load sharing algorithm that is not used by the neighboring routing node as the load sharing algorithm used by the local routing node according to the load sharing algorithm used by the neighboring routing node and the load sharing algorithm supported by the local routing node, thereby avoiding a decrease in load sharing effect caused by using the same load sharing algorithm among the directly connected routing nodes, and optimizing the load sharing effect of the networking.
In an embodiment of the present invention, the load sharing algorithm notification packet includes a priority level of the neighboring routing node.
Correspondingly, the determining, according to the identifier of the first load sharing algorithm, a second load sharing algorithm used by the local routing node from the load sharing algorithms supported by the local routing node may include:
when the priority level of the neighbor routing node is higher than that of the local routing node, selecting a load sharing algorithm which is not used by the neighbor routing node from load sharing algorithms supported by the local routing node according to the identification of the first load sharing algorithm;
and determining the selected load sharing algorithm as a second load sharing algorithm used by the local routing node.
In this embodiment, considering that for two directly connected routing nodes, one of the routing nodes may receive a load sharing algorithm notification message sent by the other routing node, and when the load sharing algorithms used by the two routing nodes are the same and the two routing nodes both perform load sharing algorithm updating, the two routing nodes may select the same load sharing algorithm for updating, so that the load sharing algorithms used by the two routing nodes after the load sharing algorithm updating are still the same, and further the two routing nodes need to perform load sharing algorithm updating again, and the load sharing algorithm updating efficiency is low.
For the above problem, in order to improve the updating efficiency of the load sharing algorithm, the load sharing algorithm notification message sent by the routing node may also carry the priority level of the routing node, and when there is a direct connection routing node using the same load sharing algorithm, the routing node with a higher priority level in the direct connection routing node may update the load sharing algorithm by the routing node with a lower priority level instead of updating the load sharing algorithm.
In one example, the priority level of a routing node may be characterized by a Media Access Control (MAC) address of the routing node. The larger the MAC address of the routing node is, the higher the priority level of the routing node is; or, the smaller the MAC address of the routing node, the higher the priority level of the routing node.
It should be noted that, in the embodiment of the present invention, unless otherwise specified, all the MAC addresses of the routing nodes refer to the bridge MAC addresses of the routing nodes, and the following description of the embodiment of the present invention is not repeated.
It should be appreciated that, in the embodiment of the present invention, the priority level of the routing node is not limited to be represented by the MAC address of the routing node, for example, the priority level of the routing node may be configured in each routing node in advance by a user (such as an administrator), or the priority level of the routing node may be represented by information such as a device serial number of the routing node, and details of implementation thereof are not described herein.
Accordingly, in this embodiment, when the local routing node receives the load sharing algorithm notification packet sent by the neighbor routing node, the routing node may determine whether the priority level of the neighbor routing node is higher than the priority level of the local routing node according to the priority level of the neighbor routing node included in the load sharing algorithm notification packet.
When the priority level of the neighboring routing node is higher than the priority level of the local routing node, the local routing node may select a load sharing algorithm that is not used by the neighboring routing node having a priority level higher than the priority level of the local routing node from load sharing algorithms supported by the local routing node, and determine the load sharing algorithm as the load sharing algorithm used by the local routing node (i.e., a second load sharing algorithm).
In an implementation manner of this embodiment, selecting one load sharing algorithm that is not used by the neighboring routing node from the load sharing algorithms supported by the local routing node may include:
and selecting a load sharing algorithm which is not used by the neighbor routing node with the priority level higher than that of the local routing node and has the minimum identifier from the load sharing algorithms supported by the local routing node.
In this embodiment, when the local routing node determines that the priority level of the neighbor routing node is higher than the priority level of the local routing node, the local routing node may select, according to the load sharing algorithm used by the neighbor routing node whose priority level is higher than the priority level of the local routing node, a load sharing algorithm that is not used by the neighbor routing node and has the smallest identifier of the load sharing algorithm from among the load sharing algorithms supported by the local routing node, and use the load sharing algorithm as the load sharing algorithm used by the local routing node, so that controllability of the load sharing algorithm used by each routing node may be improved.
In another implementation manner of this embodiment, selecting one load sharing algorithm that is not used by the neighboring routing node from the load sharing algorithms supported by the local routing node may include:
and selecting a load sharing algorithm which is not used by the neighbor routing node with the priority level higher than that of the local routing node and has the maximum identifier from the load sharing algorithms supported by the local routing node.
For specific implementation of this embodiment, reference may be made to relevant descriptions in the above embodiment, and details are not described herein in this embodiment of the present invention.
It should be appreciated that, in the embodiment of the present invention, when the local routing node selects the load sharing algorithm to be used, the method is not limited to the manner described in the foregoing embodiment, for example, the local routing node may also randomly select a load sharing algorithm that is not used by the neighboring routing node from the load sharing algorithms supported by the local routing node, and details of implementation thereof are not described herein.
In addition, it should be noted that, in the embodiment of the present invention, when the local routing node determines, according to the received load sharing algorithm notification packet sent by the neighbor routing node, that the load sharing algorithm used by the local routing node is different from the load sharing algorithm used by the neighbor routing node whose priority level is higher than the priority level of the local routing node, the local routing node may not change the load sharing algorithm used by the local routing node.
In the embodiment of the invention, considering that when the load sharing algorithms supported by the local routing node are less and the number of the neighbor routing nodes of the local routing node is more, the situation that the load sharing algorithms supported by the local routing node are all used by the neighbor routing node may exist, under the situation, in order to reduce the influence of the same load sharing algorithm used by the directly connected routing node on the networking load sharing effect as much as possible, the local routing node may select a load sharing algorithm with the least use frequency from the load sharing algorithms supported by the local routing node as the load sharing algorithm used by the local routing node.
Accordingly, in an embodiment of the present invention, the determining, according to the identifier of the first load sharing algorithm, a second load sharing algorithm used by the local routing node from among load sharing algorithms supported by the local routing node may further include:
when the priority level of the neighbor routing node is higher than the priority level of the local routing node and no load sharing algorithm which is not used by the neighbor routing node with the priority level higher than the priority level of the local routing node exists in the load sharing algorithms supported by the local routing node, selecting a load sharing algorithm with the least use frequency from the load sharing algorithms supported by the local routing node, and determining the selected load sharing algorithm as the load sharing algorithm used by the local routing node (i.e. a second load sharing algorithm).
In this embodiment, when the routing node receives a load sharing algorithm notification message sent by a neighboring routing node, and determines that the priority level of the neighboring routing node is higher than the priority level of the local routing node according to the priority level included in the received load sharing algorithm notification message, the local routing node may determine, according to the identifier of the negative first load sharing algorithm, the load sharing algorithm used by the neighboring routing node.
If there is no load sharing algorithm that is not used by the neighboring routing node whose priority level is higher than that of the local routing node in the load sharing algorithms supported by the local routing node, the local routing node may count the number of times of use of each load sharing algorithm supported by the local routing node, and select a load sharing algorithm with the least number of times of use from the load sharing algorithms supported by the local routing node as the load sharing algorithm used by the local routing node.
In this implementation, for any load sharing algorithm supported by the local routing node, the number of times of using the load sharing algorithm may be the number of neighboring routing nodes that use the load sharing algorithm and have priority levels higher than that of the local routing node.
Further, in the embodiment of the present invention, in order to implement information synchronization of the entire networking, ensure that each routing node in the networking participates in updating of the load sharing algorithm, and optimize the load sharing effect of the entire networking, the load sharing algorithm notification message may further include full network MAC address information, where the full network MAC address information is used to record MAC address information of the routing node with the largest (or smallest, hereinafter, the largest example) MAC address in the networking; the load sharing algorithm informs that the initial value of the whole network MAC address information included in the message is the MAC address of the node of the message sender.
Correspondingly, in one embodiment of the present invention, after receiving the load sharing algorithm notification packet sent by the neighbor routing node, the method may further include:
comparing the size of the full-network MAC address recorded by the local routing node with the size of the full-network MAC address contained in the received load sharing algorithm notification message;
and if the full-network MAC address recorded by the local routing node is smaller than the full-network MAC address included in the received load sharing algorithm notification message, updating the full-network MAC address recorded by the local routing node to the full-network MAC address included in the received load sharing algorithm notification message.
In this embodiment, the determining, according to the identifier of the first load sharing algorithm, a second load sharing algorithm used by the local routing node from among load sharing algorithms supported by the local routing node may include:
and when the whole network MAC address included in the received load sharing algorithm notification message is the same as the whole network MAC address recorded by the local routing node, determining a second load sharing algorithm used by the local routing node from the load sharing algorithms supported by the local routing node according to the identifier of the first load sharing algorithm.
In this embodiment, the local routing node may record a full-network MAC address, the initial value of which is the MAC address of the local routing node.
When the local routing node receives a load sharing algorithm notification message sent by a neighbor routing node, the local routing node can acquire a full-network MAC address (hereinafter referred to as a first full-network MAC address) included in the message, and compare the full-network MAC address with a full-network MAC address (hereinafter referred to as a second full-network MAC address) recorded by the local routing node; and if the first full-network MAC address is larger than the second full-network MAC address, updating the full-network MAC address recorded by the local routing node into the first full-network MAC address.
Through the above processing, finally, the whole network MAC address included in each load sharing algorithm notification message can be updated to the MAC address of the routing node with the largest MAC address in the networking.
In this embodiment, when the full-network MAC address included in the notification message of the load sharing algorithm received by the local routing node is the same as the full-network MAC address recorded by the local routing node, the local routing node determines that the full-network information is synchronized, and at this time, the local routing node may determine the load sharing algorithm used by the local routing node according to the received notification message of the load sharing algorithm and the load sharing algorithm supported by the local routing node, and a specific implementation manner of the load sharing algorithm may refer to the related description in the above embodiment, which is not described herein again in the embodiments of the present invention.
It should be noted that, in the embodiment of the present invention, when the local routing node updates the load sharing algorithm in the above manner and detects that the full-network MAC address included in the received load sharing algorithm notification message is updated, the local routing node may update the load sharing algorithm again in the manner described in the above embodiment, and details of implementation of the method are not described herein.
In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present invention, the technical solutions provided by the embodiments of the present invention are described below with reference to specific examples.
In this embodiment, the priority level of the routing node is characterized by the MAC address of the routing node, wherein the higher the MAC address of the routing node, the higher the priority level of the routing node.
In this embodiment, the LLDP protocol is expanded, and a new TLV is added, where the TLV carries information such as a full network MAC address, a local MAC address, and a load sharing algorithm value.
The whole network MAC address is used for recording the MAC address of the routing node with the maximum MAC address in the whole network, and the initial value of the MAC address is consistent with the MAC address of the local machine;
the local MAC address is used for recording the MAC address of a routing node which sends an LLDP message (an expanded LLDP message);
and the load sharing algorithm value is used for recording the number of the load sharing algorithm used by the routing node for sending the LLDP message, wherein the number of the load sharing algorithm corresponds to the load sharing algorithm one by one.
In this embodiment, the local routing node may periodically send an LLDP packet through an interface enabling an LLDP protocol, and receive an LLDP packet sent by a neighbor routing node.
And if the full-network MAC address contained in the LLDP message received by the local routing node is larger than the full-network MAC address recorded by the local routing node, updating the full-network MAC address recorded by the local routing node into the full-network MAC address contained in the received LLDP message.
When the full-network MAC address included in the LLDP message received by the local routing node is the same as the full-network MAC address recorded by the local routing node, the local routing node may record the load sharing algorithm value included in the received LLDP message (i.e., the number of the load sharing algorithm used by each neighboring routing node).
The local routing node may record the number of the load sharing algorithm used by each neighboring routing node as a neighboring load burden state table, and the format of the table may be as follows:
MAC address of neighbor routing node Numbering of load sharing algorithms
MAC1 Number 1
MAC2 Number 2
The MAC address of the neighbor routing node may be determined according to a local MAC address included in the LLDP message received by the local routing node, and the number of the load sharing algorithm may be determined according to a load sharing algorithm value included in the LLDP message received by the local routing node.
In this embodiment, the local routing node may compare the MAC address of the local routing node with the MAC addresses of the neighboring routing nodes in the neighboring load burden state table recorded by the local routing node, and when it is determined that there is an entry in which the recorded MAC address of the neighboring routing node is greater than the MAC address of the local routing node, determine, according to the number of the load sharing algorithm recorded in the entry and the load sharing algorithm supported by the local routing node, whether there is a load sharing algorithm that is not used by a neighboring routing node whose MAC address is greater than the local routing node in the load sharing algorithm supported by the local routing node.
If the local routing node exists, selecting a load sharing algorithm which is not used by the neighbor routing node with the MAC address larger than the local routing node and has the minimum number from the load sharing algorithms supported by the local routing node as the load sharing algorithm used by the local routing node;
and if the local routing node does not exist, selecting a load sharing algorithm with the least use times from the load sharing algorithms supported by the local routing node as the load sharing algorithm used by the local routing node.
In this embodiment, when the load sharing algorithm used by the local routing node changes, the local routing node may update the load sharing algorithm value included in the LLDP packet sent by itself.
As can be seen from the above description, in the technical solution provided in the embodiment of the present invention, by receiving the load sharing algorithm notification packet sent by the neighboring routing node, and further, according to the identifier of the first load sharing algorithm included in the received load sharing algorithm notification packet, determining the second load sharing algorithm used by the local routing node from the load sharing algorithms supported by the local routing node, so that the load sharing algorithm used by the local routing node is different from the load sharing algorithm used by the neighboring routing node, thereby avoiding a decrease in load sharing effect caused by using the same load sharing algorithm between the neighboring routing nodes, and optimizing the load sharing effect of the networking.
Referring to fig. 3, a schematic structural diagram of a load sharing implementation apparatus is provided for an embodiment of the present invention, where the apparatus may be applied to a routing node in the foregoing method embodiment, as shown in fig. 3, the load sharing implementation apparatus may include:
a receiving unit 310, configured to send a load sharing algorithm notification packet, where the load sharing algorithm notification packet includes an identifier of a first load sharing algorithm used by a neighboring routing node;
a control unit 320, configured to determine, according to the identifier of the first load sharing algorithm, a second load sharing algorithm used by the local routing node from among the load sharing algorithms supported by the local routing node; the second load sharing algorithm and the first load sharing algorithm are different load sharing algorithms.
In an optional embodiment, the load sharing algorithm notification packet further includes a priority level of the neighbor routing node;
the control unit 320 is specifically configured to, when the priority level of the neighboring routing node is higher than the priority level of the local routing node, select a load sharing algorithm that is not used by the neighboring routing node from the load sharing algorithms supported by the local routing node according to the identifier of the first load sharing algorithm; and determining the selected load sharing algorithm as a second load sharing algorithm used by the local routing node.
In an optional embodiment, the control unit 320 is specifically configured to select, from the load sharing algorithms supported by the local routing node, a load sharing algorithm that is not used by the neighboring routing node and has a smallest identifier of the load sharing algorithm; or the like, or, alternatively,
the control unit 320 is specifically configured to select one load sharing algorithm that is not used by the neighboring routing node and has the largest identifier of the load sharing algorithm, from the load sharing algorithms supported by the local routing node.
In an optional embodiment, the control unit 320 is further configured to, when the priority level of the neighboring routing node is higher than the priority level of the local routing node, and a load sharing algorithm that is not used by the neighboring routing node does not exist in the load sharing algorithms supported by the local routing node, select a load sharing algorithm with the least number of usage times from the load sharing algorithms supported by the local routing node according to the identifier of the first load sharing algorithm; determining the selected load sharing algorithm as a second load sharing algorithm used by the local routing node;
the number of times of using the load sharing algorithm is the number of neighbor routing nodes using the load sharing algorithm and having priority levels higher than that of the local routing node.
In an optional embodiment, the load sharing algorithm notification message further includes a full-network MAC address, and an initial value of the full-network MAC address is an MAC address of a message sender node;
accordingly, please refer to fig. 4 together, which is a schematic structural diagram of another load sharing implementation apparatus provided in the embodiment of the present invention, as shown in fig. 4, on the basis of the load sharing implementation apparatus shown in fig. 3, the load sharing implementation apparatus shown in fig. 4 may further include:
a recording unit 330, configured to record a full-network MAC address;
a comparing unit 340, configured to compare the size of the full-network MAC address included in the load sharing algorithm notification message sent by the local routing node with the size of the full-network MAC address included in the received load sharing algorithm notification message;
the recording unit 330 is further configured to update the recorded full-network MAC address to the full-network MAC address included in the received load sharing algorithm notification message if the recorded full-network MAC address is smaller than the full-network MAC address included in the received load sharing algorithm notification message;
or the like, or, alternatively,
the recording unit 330 is further configured to update the recorded full-network MAC address to the full-network MAC address included in the received load sharing algorithm notification message if the recorded full-network MAC address is smaller than the full-network MAC address included in the received load sharing algorithm notification message;
the control unit 320 is specifically configured to determine, according to the identifier of the first load sharing algorithm, a second load sharing algorithm used by the local routing node from the load sharing algorithms supported by the local routing node when all the full-network MAC addresses included in the received load sharing algorithm notification message are the same as the recorded full-network MAC addresses.
Please refer to fig. 5, which is a schematic diagram of a hardware structure of a load sharing implementation apparatus according to an embodiment of the present application. The load sharing implementation may include a processor 501, a machine-readable storage medium 502 storing machine-executable instructions. The processor 501 and the machine-readable storage medium 502 may communicate via a system bus 503. Also, the processor 501 may perform the load sharing implementation method described above by reading and executing machine executable instructions in the machine readable storage medium 502 corresponding to the load sharing implementation logic.
The machine-readable storage medium 502 referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
Embodiments of the present application also provide a machine-readable storage medium, such as the machine-readable storage medium 502 in fig. 5, comprising machine-executable instructions, which can be executed by the processor 501 in the load sharing implementation apparatus to implement the load sharing implementation method described above.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the invention. One of ordinary skill in the art can understand and implement it without inventive effort.
As can be seen from the above embodiments, by receiving the load sharing algorithm notification message sent by the neighboring routing node, and further, according to the identifier of the first load sharing algorithm included in the received load sharing algorithm notification message, determining the second load sharing algorithm used by the local routing node from the load sharing algorithms supported by the local routing node, so that the load sharing algorithm used by the local routing node is different from the load sharing algorithm used by the neighboring routing node, thereby avoiding a decrease in load sharing effect caused by using the same load sharing algorithm between the neighboring routing nodes, and optimizing the load sharing effect of networking.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A method for realizing load sharing is applied to a local routing node, and is characterized in that the method comprises the following steps:
receiving a load sharing algorithm notification message sent by a neighbor routing node, wherein the load sharing algorithm notification message comprises an identifier of a first load sharing algorithm used by the neighbor routing node;
determining a second load sharing algorithm used by the local routing node from the load sharing algorithms supported by the local routing node according to the identifier of the first load sharing algorithm;
the second load sharing algorithm and the first load sharing algorithm are different load sharing algorithms;
wherein, the load sharing algorithm notification message further includes the priority level of the neighbor routing node;
when the same load sharing algorithm is used by the directly connected routing nodes, the routing node with the higher priority level in the directly connected routing nodes does not update the load sharing algorithm, but the routing node with the lower priority level updates the load sharing algorithm.
2. The method as claimed in claim 1, wherein said determining a second load sharing algorithm used by the local routing node from among the load sharing algorithms supported by the local routing node according to the identifier of the first load sharing algorithm comprises:
when the priority level of the neighbor routing node is higher than the priority level of the local routing node, selecting a load sharing algorithm which is not used by the neighbor routing node from load sharing algorithms supported by the local routing node according to the identifier of the first load sharing algorithm;
and determining the selected load sharing algorithm as a second load sharing algorithm used by the local routing node.
3. The method as claimed in claim 2, wherein the selecting a load sharing algorithm that is not used by the neighboring routing node from among the load sharing algorithms supported by the local routing node comprises:
selecting a load sharing algorithm which is not used by the neighbor routing node and has the minimum identifier from the load sharing algorithms supported by the local routing node;
or the like, or, alternatively,
and selecting one load sharing algorithm which is not used by the neighbor routing node and has the maximum identifier from the load sharing algorithms supported by the local routing node.
4. The method according to claim 2, wherein said determining a second load sharing algorithm used by the local routing node from among the load sharing algorithms supported by the local routing node according to the identifier of the first load sharing algorithm further comprises:
when the priority level of the neighbor routing node is higher than that of the local routing node and no load sharing algorithm which is not used by the neighbor routing node exists in the load sharing algorithms supported by the local routing node, selecting a load sharing algorithm with the least use times from the load sharing algorithms supported by the local routing node according to the identifier of the first load sharing algorithm;
determining the selected load sharing algorithm as a second load sharing algorithm used by the local routing node;
the number of times of using the load sharing algorithm is the number of neighbor routing nodes using the load sharing algorithm and having priority levels higher than that of the local routing node.
5. The method according to claim 2, wherein the load sharing algorithm notification message further includes a full-network MAC address, and an initial value of the full-network MAC address is a MAC address of a message sender node;
after receiving the load sharing algorithm notification message sent by the neighbor routing node, the method further includes:
comparing the size of the full-network MAC address recorded by the local routing node with the size of the full-network MAC address contained in the received load sharing algorithm notification message;
if the recorded full-network MAC address is smaller than the full-network MAC address included in the received load sharing algorithm notification message, updating the recorded full-network MAC address to the full-network MAC address included in the received load sharing algorithm notification message;
or the like, or, alternatively,
if the recorded full-network MAC address is larger than the full-network MAC address included in the received load sharing algorithm notification message, updating the recorded full-network MAC address to the full-network MAC address included in the received load sharing algorithm notification message;
the determining, according to the identifier of the first load sharing algorithm, a second load sharing algorithm used by the local routing node from among the load sharing algorithms supported by the local routing node includes:
and when the full-network MAC address included in the received load sharing algorithm notification message is the same as the recorded full-network MAC address, determining a second load sharing algorithm used by the local routing node from the load sharing algorithms supported by the local routing node according to the identifier of the first load sharing algorithm.
6. A load sharing implementation device applied to a local routing node is characterized in that the device comprises:
the system comprises a receiving unit, a sending unit and a receiving unit, wherein the receiving unit is used for receiving a load sharing algorithm notification message sent by a neighbor routing node, and the load sharing algorithm notification message comprises an identifier of a first load sharing algorithm used by the neighbor routing node;
a control unit, configured to determine, according to the identifier of the first load sharing algorithm, a second load sharing algorithm used by the local routing node from among load sharing algorithms supported by the local routing node; the second load sharing algorithm and the first load sharing algorithm are different load sharing algorithms;
wherein, the load sharing algorithm notification message further includes the priority level of the neighbor routing node;
when the same load sharing algorithm is used by the directly connected routing nodes, the routing node with the higher priority level in the directly connected routing nodes does not update the load sharing algorithm, but the routing node with the lower priority level updates the load sharing algorithm.
7. The apparatus of claim 6,
the control unit is specifically configured to select, according to the identifier of the first load sharing algorithm, one load sharing algorithm that is not used by the neighbor routing node from the load sharing algorithms supported by the local routing node when the priority level of the neighbor routing node is higher than the priority level of the local routing node; and determining the selected load sharing algorithm as a second load sharing algorithm used by the local routing node.
8. The apparatus of claim 7,
the control unit is specifically configured to select a load sharing algorithm that is not used by the neighboring routing node and has a minimum identifier from load sharing algorithms supported by the local routing node; or the like, or, alternatively,
the control unit is specifically configured to select a load sharing algorithm that is not used by the neighboring routing node and has a maximum identifier from load sharing algorithms supported by the local routing node.
9. The apparatus of claim 7,
the control unit is further configured to select a load sharing algorithm with the least number of usage times from the load sharing algorithms supported by the local routing node according to the identifier of the first load sharing algorithm when the priority level of the neighboring routing node is higher than the priority level of the local routing node and no load sharing algorithm that is not used by the neighboring routing node exists in the load sharing algorithms supported by the local routing node; determining the selected load sharing algorithm as a second load sharing algorithm used by the local routing node;
the number of times of using the load sharing algorithm is the number of neighbor routing nodes using the load sharing algorithm and having priority levels higher than that of the local routing node.
10. The apparatus according to claim 6, wherein the load sharing algorithm notification message further includes a full-network MAC address, and an initial value of the full-network MAC address is a MAC address of a message sender node;
the device further comprises:
a recording unit for recording the whole network MAC address;
a comparing unit, configured to compare the full-network MAC address recorded by the local routing node with the size of the full-network MAC address included in the received load sharing algorithm notification message;
the recording unit is further configured to update the recorded full-network MAC address to the full-network MAC address included in the received load sharing algorithm notification message if the recorded full-network MAC address is smaller than the full-network MAC address included in the received load sharing algorithm notification message;
or the like, or, alternatively,
the recording unit is further configured to update the recorded full-network MAC address to the full-network MAC address included in the received load sharing algorithm notification message if the recorded full-network MAC address is smaller than the full-network MAC address included in the received load sharing algorithm notification message;
the control unit is specifically configured to determine, according to the identifier of the first load sharing algorithm, a second load sharing algorithm used by the local routing node from the load sharing algorithms supported by the local routing node when all the full-network MAC addresses included in the received load sharing algorithm notification message are the same as the recorded full-network MAC addresses.
CN201810384852.3A 2018-04-26 2018-04-26 Load sharing implementation method and device Active CN108540399B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810384852.3A CN108540399B (en) 2018-04-26 2018-04-26 Load sharing implementation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810384852.3A CN108540399B (en) 2018-04-26 2018-04-26 Load sharing implementation method and device

Publications (2)

Publication Number Publication Date
CN108540399A CN108540399A (en) 2018-09-14
CN108540399B true CN108540399B (en) 2022-03-01

Family

ID=63479132

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810384852.3A Active CN108540399B (en) 2018-04-26 2018-04-26 Load sharing implementation method and device

Country Status (1)

Country Link
CN (1) CN108540399B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104486236A (en) * 2014-11-28 2015-04-01 华为技术有限公司 Load sharing method and routing equipment
CN104601487A (en) * 2014-12-31 2015-05-06 北京华为数字技术有限公司 Method and SDN (self-defending network) controller for realizing multistage load sharing
CN104718730A (en) * 2012-10-05 2015-06-17 思科技术公司 Segment routing techniques

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104718730A (en) * 2012-10-05 2015-06-17 思科技术公司 Segment routing techniques
CN104486236A (en) * 2014-11-28 2015-04-01 华为技术有限公司 Load sharing method and routing equipment
CN104601487A (en) * 2014-12-31 2015-05-06 北京华为数字技术有限公司 Method and SDN (self-defending network) controller for realizing multistage load sharing

Also Published As

Publication number Publication date
CN108540399A (en) 2018-09-14

Similar Documents

Publication Publication Date Title
EP3451592B1 (en) Packet transmission between vxlan domains
EP3657740B1 (en) Message forwarding
EP3767880B1 (en) Optimizing information related to a route and/or a next hop for multicast traffic
JP2012209944A (en) Versatile source port enforcement for data networks
WO2018099394A1 (en) Packet transmission
CN112367257B (en) Route notification method and device
CN112367254A (en) Cross-device link aggregation method and device and electronic device
CN108540386B (en) Method and device for preventing service flow interruption
US11310147B2 (en) Advertising route
CN108322376B (en) Route synchronization method, device and machine-readable storage medium
US20180234934A1 (en) Anchor master am management method and node
CN110708275B (en) Protocol message processing method and device
WO2022048646A1 (en) Virtual ip management method and apparatus, electronic device and storage medium
CN110768917A (en) Message transmission method and device
US11902380B1 (en) Liveness detection for an authenticated client session
CN108540399B (en) Load sharing implementation method and device
CN113574834B (en) Route updating method and device
US10958554B2 (en) Monitoring flow activity on a network device
CN106817254B (en) Address refreshing method and device
CN111556179B (en) ARP (Address resolution protocol) table entry updating method and device
CN108600075B (en) Fault processing method and device
CN107566302A (en) Message forwarding method and device
CN109218207B (en) Multicast traffic processing method and device and routing equipment
CN107070787B (en) Default route revocation method and device
US10623916B2 (en) Terminal management method and network device for context cluster processing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant