Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the disclosure and are not intended to limit the disclosure.
Fig. 2 is a second schematic diagram of a network for sending a message according to the embodiment of the present disclosure, and fig. 3 is a schematic diagram of a flow of a method for sending a message according to the embodiment of the present disclosure, as shown in fig. 2 and fig. 3, the method includes:
step S101, obtaining a message, and determining an equivalent routing group according to a routing table and a destination address of message data.
Specifically, when a receives message data sent by the master control server, according to a destination address of the message data, looking up routing table information, determining an equivalent link sent to a router corresponding to the same destination address, if an equivalent link is found, looking up a next-hop device, and sending a message requesting to collect an equivalent route of the next-hop device to the next-hop device according to a preset protocol, for example: and B and C, the next hop of A, wherein AB and AC are equivalent links, namely the equivalent routing table of A comprises AB and AC, and the next hop of C, D and E, wherein CD and CE are equivalent links, namely the equivalent routing table of C comprises CD and CE, when A collects the equivalent routing tables of all the next hop devices with the same destination address, an equivalent routing group is constructed together with the equivalent routing table of A.
Step S102, determining a next hop value of the shared message data according to the equivalent routing group, and calculating the shared flow of the message data and the corresponding next hop based on the next hop value.
Specifically, as shown in fig. 2, there are three equivalent links between a and G, where three equivalent links are corresponding to ABFG, ACDG, and ACEG, that is, after the packet data arrives at a, the packet data arrives at G through the three equivalent links, it is described in the previous step that a can collect an equivalent routing group with the same destination address, because an outgoing interface connected to a and C can receive an equivalent routing table of C, and the equivalent routing table of C includes two next hops D and E, it can be determined that the next hop value shared by the packet data from a to the bottom is 3, that is, modulo 3 by the hash algorithm is performed to obtain packet data corresponding to hash0, hash1, and hash2, and calculate hash0, hash1, and hash2, the next hops corresponding to the packet data are B, D and E, respectively, where a specific process of the hash operation determines that a specific process of the corresponding next hop is consistent with the prior art, and will not be described in detail herein.
It should be noted that, when the packet data reaches C, C may repeat the above steps again, and may determine that the next hop value shared by the packet data from C is 2, that is, modulo 2 by the hash algorithm is performed to obtain hash0 and hash1, respectively, so as to determine that the next hop of the packet data shared by C is D and E, where a specific process of determining the corresponding next hop by hash operation is consistent with the prior art, and is not described herein again.
And step S103, sending the sharing flow through the outgoing interface corresponding to the next hop.
Specifically, as shown in fig. 2, it is determined that the egress interface corresponding to a is the egress interface corresponding to a according to the determined next hops B, D and E, that is, the sharing port of the hash0 message data (flow 1) is interface 1 (not shown in the figure) on a, and the sharing ports of the hash1 message data (flow 2) and the hash2 message data (flow 3) are interface 2 (not shown in the figure) on a, the message (flow 1) of the hash0 is sent to B through interface 1, the calculated message (flow 2) of the hash1 and the message (flow 3) of the hash2 are sent to C through interface 2 (not shown in the figure), C repeats the hash calculation again, the calculated message data (flow 2) of the hash0 is sent to D through interface 3 (not shown in the figure), the calculated message data (flow 3) of the hash1 is sent to E through interface 4 (not shown in the figure), and for the next hop F only of B, the message data (flow 1) is directly sent to F, that is, the message data received by a can be reasonably shared and sent to G through three equivalent links, namely, ABFG, ACDG, and ACEG, so that the load balance of message data sending can be realized.
It should be noted that the above-mentioned message data transmission network is not only applicable to routers, but also applicable to devices such as switches and servers, and the method provided by the present disclosure is described with routers as a specific embodiment, but also applicable to switches and servers, and is not limited thereto.
In the embodiment of the disclosure, an equivalent routing group in which the message data reaches the same destination address is obtained, a next hop value of the shared message data in the equivalent routing group is determined, the shared flow and the corresponding next hop of the message data are calculated according to the next hop value, and the shared flow is sent through an outgoing interface corresponding to the next hop, so that the next hop value of the shared message data can be automatically obtained, and the shared port is determined through hash calculation, thereby realizing load balancing of the message data and improving the use efficiency of the link.
Fig. 4 is a schematic flow chart of another packet sending method provided by the embodiment of the present disclosure, where table 1 is a first equivalent routing table of the router a provided by the embodiment of the present disclosure, and as shown in fig. 2, fig. 4, and table 1, determining an equivalent routing group according to the routing table and a destination address of packet data includes:
step S201, inquiring a routing table to obtain a first equivalent routing table with the same destination address;
step S202, an outlet interface connected with the next hop equipment is determined according to the first equivalent routing table, and a second equivalent routing table of the next hop equipment is obtained through the outlet interface according to a preset message protocol;
step S203, establishing an equivalent routing group reaching the corresponding equipment of the same destination address according to the first equivalent routing table and the second equivalent routing table.
When the router a receives the message data, the first equivalent routing table with the same destination address is obtained by looking up the routing table entry, if the destination addresses of the router B and the router C are both the same as the destination address of the router a, the AB and the AC form an equivalent route, and the first equivalent routing table including the addresses, ports and other identifiers of the router a and the next hop device can be established as follows:
TABLE 1
| Member 1 | Router A | Address of next hop B | Interface 1 | 
| Member 2 | Router A | Address of next hop C | Interface 2 | 
Table 2 is the second equivalent routing table of the router C provided in the embodiment of the present disclosure, as shown in table 2, the router C may also obtain the second equivalent routing table with the same destination address by looking up the routing table entry, if the destination addresses of the router D and the router E are both the same as the destination address of the router C, the CD and the CE form an equivalent route, and then the second equivalent routing table including the addresses and ports of the router C and the next hop device may be established, which is specifically as follows:
TABLE 2
| Member 1 | Router C | Address of next hop D | Interface 3 | 
| Member 2 | Router C | Address of next hop E | Interface 4 | 
Table 3 is a protocol packet provided by the embodiment of the present disclosure, and table 4 is another protocol packet provided by the embodiment of the present disclosure, as shown in tables 3 and 4, when the router a obtains the second equivalent routing table of the next hop device, it needs to obtain according to the protocol packet, the protocol may be called as a new balanced NewBalance protocol, the destination address is a multicast protocol address M to support and establish a complete equivalent routing group, at first, there is an equivalent route on the router a, the destination address is K, at this time, the routing table is checked, two equivalent routes are found, the outgoing interfaces are respectively an interface 1 and an interface 2, and then, through these two ports, the protocol packet is transmitted to the router B and the router C, the content includes an equivalent routing request type, the mac address of the router a is used as a source address, the destination address of the equivalent route K, the existing member port interface 1 and interface 2, the following protocol messages are finally formed as follows:
TABLE 3
After both the router B and the router C receive the protocol packet of the request type, they will search their own routing tables, and if the destination address is K and there is an equivalent route with the same destination address K, then C reports a response packet type reply a from the interface 2 that receives the packet type request a, and the contents include: the destination address K, the existing member port interface 3 and the existing member port interface 4, finally form the following protocol message as shown below:
TABLE 4
Table 5 is an equivalent routing group provided in this disclosure, as shown in fig. 2 and table 5, the router C reports the second equivalent routing table to the router a through the interface 2 of the router a, and the router B does not have an equivalent route below the router B, so that the router a does not respond to the message request of the router a, so that the router a can learn two next-hop information of the router C, and further can construct an equivalent routing group reaching a device corresponding to the same destination address according to the first equivalent routing table of the router a and the second equivalent routing table of the router C, where the equivalent routing group includes identifiers of routers and ports having equivalent routes and addresses of devices of next hops, and the specific details are as follows:
TABLE 5
| Member 1 | Router A | Address of next hop B | Interface 1 | 
| Member 2 | Router A | Address of next hop C | Interface 2 | 
| Member 3 | Router C | Address of next hop D | Interface 3 | 
| Member 4 | Router C | Address of next hop E | Interface 4 | 
Fig. 5 is a schematic flow chart of another message sending method provided by the embodiment of the present disclosure, and as shown in fig. 5, determining a next hop value for sharing message data according to an equivalent routing group, and calculating a sharing flow and a corresponding next hop of the message data based on the next hop value, includes:
step S301, acquiring the equipment information and the outgoing interface information of all next hops in the equivalent routing group;
step S302, determining a next hop value of the shared message data according to the equipment information of the next hop and the output interface information;
step S303, obtaining a hash value corresponding to the message data sharing flow through a hash algorithm, and determining a corresponding next hop according to a modulo of the hash value on a next hop value.
Specifically, as shown in table 5, the equivalent routing group may obtain device information of all next hops of a, including member information, address information of a next-hop device, and corresponding egress interface information, and according to these information, determine whether each egress interface receives a protocol packet of a second equivalent routing table sent by the next-hop device, if the protocol packet is received, determine that the next-hop device connected to the egress interface does not participate in sharing, and accumulate next hops corresponding to other egress interfaces in the equivalent routing group to obtain a next-hop value of shared packet data, so as to determine that the next-hop value of packet data shared from a is 3, that is, modulo 3 by a hash algorithm to obtain packet data corresponding to hash0, hash1, and hash2, and calculate next hops corresponding to hash0, hash1, hash2 that correspond to packet data is B, D and E, respectively, the specific process of determining the corresponding next hop for the specific process of the hash operation is consistent with the prior art, and is not described herein again.
Fig. 6 is a schematic flow chart of another message sending method provided by the embodiment of the present disclosure, and as shown in fig. 5, determining a next hop value for sharing message data according to the next hop device information and the egress interface information includes:
step S401, judging whether the interface receives a protocol message of a second equivalent routing table sent by the next hop equipment;
step S402, if receiving the protocol message, determining that the next hop equipment connected with the output interface does not participate in sharing;
step S403, accumulating the next hop devices participating in the sharing in the equivalent routing group to obtain the next hop value of the shared message data.
Specifically, the number of the outgoing interfaces of a is two, i.e. interface 1 (not shown in the figure) and interface 2 (not shown in the figure), respectively determines whether interface 1 and interface receive the protocol message of the second equivalent routing table sent by the next-hop device, wherein, the interface 1 is connected with the B, the B has no equivalent route, therefore, the report can not be carried out through the interface 1, interface 2 is connected with C, C has equivalent routes CD and CE, and reports the second equivalent routing table to a through interface 2, therefore, it can be determined that interface 2 simply forwards a's data to C, shared by C's next hops D and E, thus, the next hop device C of the interface 2 connection is not participating, and B, D and E are participating next hop devices, and then accumulating the next hop equipment participating in the sharing in the equivalent routing group to obtain a next hop numerical value of the shared message data, namely 3.
After determining that the next hop device connected to the outbound interface is not participating in the sharing, the method further comprises:
and respectively carrying out role identification on all the outgoing interfaces in the equivalent routing group according to the judgment result, wherein the role identification is used for distinguishing whether the next hop corresponding to the outgoing interface participates in the Hash calculation.
Table 6 is another equivalent routing group provided in this disclosure, as shown in fig. 2 and table 6, interface 2 of a is connected to C, and equivalent routes CD and CE below C are connected, that is, it can be determined that the outgoing interfaces of the packet sent by C are interface 3 (not shown in the figure) and interface 4 (not shown in the figure), and the next hop C corresponding to interface 2 of a does not need to participate in hash operation, so that a role can be set for the port, for example: super port (support) and hash port (hash port), support is the next hop not participating in hash calculation, but data traffic can pass through the port, hash port is the next hop participating in hash calculation, therefore, after the equivalent routing group is identified by role, the final element is specifically as follows:
TABLE 6
| Member 1 | Router A | Interface 1 | PORTA1 | HASHPORT | 
| Member 2 | Router A | Interface 2 | PORTA2 | SUPERPORT | 
| Member 3 | Router C | Interface 2 | PORTC2 | HASHPORT | 
| Member 4 | Router C | Interface 3 | PORTC3 | HASHPORT | 
As shown in fig. 2, after data traffic enters router a, looking up equivalent routing group information as shown in table 6, determining that there are 3 next hops identified as hash port, recalculating bandwidth traffic of shared packet data according to a hash algorithm, and determining that the value of the next hop of the packet data from a to be shared is 3, that is, modulo 3 by the hash algorithm to obtain packet data corresponding to hash0, hash1, and hash2, respectively, and calculating hash0, hash1, next hops corresponding to packet data corresponding to hash2 are B, D and E, respectively, sending a packet (traffic 1) of hash0 to B through interface 1 (not shown), sending calculated hash1 (traffic 2) and hash2 (traffic 3) to C through interface 2 (not shown), and sending the calculated packet data (traffic 2) of hash0 to C through interface 3 (not shown) again, the calculated message data (flow 3) of the hash1 is sent to E through the interface 4 (not shown in the figure), so that the technical problem that the message data cannot be reasonably balanced due to the hash polarization phenomenon is solved.
Fig. 7 is a schematic structural diagram of a message sending apparatus according to an embodiment of the present disclosure, and as shown in fig. 7, the apparatus includes:
the obtainingmodule 10 is configured to obtain a packet, and determine an equivalent routing group according to a routing table and a destination address of packet data.
Theprocessing module 20 is configured to determine a next hop value of the shared packet data according to the equivalent routing group, and calculate a shared flow and a corresponding next hop of the packet data based on the next hop value.
And a sendingmodule 30, configured to send the shared traffic through an egress interface corresponding to the next hop.
The above-mentioned apparatus is used for executing the foregoing method embodiments, and the implementation principle and technical effects thereof may refer to the foregoing method embodiments, which are not described herein again.
Optionally, fig. 8 is a schematic structural diagram of another message sending apparatus provided in the embodiment of the present disclosure, and as shown in fig. 8, the obtainingmodule 10 includes:
a first equivalent routingtable obtaining module 11, configured to obtain a query routing table, and obtain a first equivalent routing table with the same destination address;
and a second equivalent routingtable obtaining module 12, configured to determine an outgoing interface connected to the next hop according to the first equivalent routing table, and obtain the second equivalent routing table of the next hop through the outgoing interface according to a preset message protocol.
And the equivalent routinggroup obtaining module 13 is configured to establish an equivalent routing group to reach the devices corresponding to the same destination address according to the first equivalent routing table and the second equivalent routing table.
The above-mentioned apparatus is used for executing the foregoing method embodiments, and the implementation principle and technical effects thereof may refer to the foregoing method embodiments, which are not described herein again.
Optionally, fig. 9 is a schematic structural diagram of another message sending apparatus provided in the embodiment of the present disclosure, and as shown in fig. 9, theprocessing module 20 includes:
aninformation obtaining module 21, configured to obtain device information and egress interface information of all next hops in the equivalent routing group;
the judging module 22 is configured to determine a next hop value of the shared message data according to the next hop device information and the outgoing interface information;
and the calculating module 23 is configured to obtain a hash value corresponding to the packet data sharing traffic through a hash algorithm, and determine a corresponding next hop by modulo the next hop value according to the hash value.
The above-mentioned apparatus is used for executing the foregoing method embodiments, and the implementation principle and technical effects thereof may refer to the foregoing method embodiments, which are not described herein again.
Specifically, the determining module 22 is configured to determine a next hop value of the shared message data according to the next hop device information and the outgoing interface information, and specifically includes:
judging whether the interface receives a protocol message of a second equivalent routing table sent by the next hop equipment;
if the protocol message is received, determining that the next hop equipment connected with the output interface does not participate in sharing;
and accumulating the next hop equipment participating in the sharing in the equivalent routing group to obtain the next hop value of the shared message data.
The above-mentioned apparatus is used for executing the foregoing method embodiments, and the implementation principle and technical effects thereof may refer to the foregoing method embodiments, which are not described herein again.
Optionally, fig. 10 is a schematic structural diagram of another message sending apparatus provided in the embodiment of the present disclosure, and as shown in fig. 10, the apparatus further includes:
and theidentification module 40 is configured to perform role identification on all outgoing interfaces in the equivalent routing group according to the determination result after determining that the next hop device connected to the outgoing interface does not participate in sharing, where the role identification is used to distinguish whether the next hop corresponding to the outgoing interface participates in hash calculation.
The above-mentioned apparatus is used for executing the foregoing method embodiments, and the implementation principle and technical effects thereof may refer to the foregoing method embodiments, which are not described herein again.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
As shown in fig. 11, the electronic device includes amemory 1002 and aprocessor 1001, thememory 1002 stores a computer program that can be executed on theprocessor 1001, and theprocessor 1001 implements the steps of the disk array deployment method when executing the computer program. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the business system analysis method.
In the several embodiments provided in the present disclosure, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and in actual implementation, there may be other divisions, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present disclosure may be integrated into one processing module, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware form, and can also be realized in a form of hardware and a software functional module.
The integrated module implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (english: processor) to execute some steps of the methods according to the embodiments of the present disclosure. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only a preferred embodiment of the present disclosure, and not intended to limit the scope of the present disclosure, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present disclosure and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present disclosure.