Summary of the invention
The technical problem to be solved in the present invention is: how to provide a kind of method and system of network traffic sharing, to realize load balancing by dynamically adjusting service traffics.
In order to solve the problems of the technologies described above, the embodiment of the invention discloses following technical scheme:
First aspect provides a kind of network traffic sharing method, and described method comprises:
The collection network topology information is that VLAN in the network selects root bridge based on described network topological information, and specifies backup root bridge;
The situation that adds VLAN according to node, calculate the spanning tree that comprises described root bridge and corresponding described VLAN, being connected between the port of setting up nonroot bridge node in the described spanning tree and the described root bridge, and, calculate the backup spanning tree that comprises described backup root bridge and corresponding described VLAN;
When monitoring the overload of local link, the nonroot bridge node of the corresponding VLAN of described local link is switched to corresponding backup spanning tree.
In the possible implementation of the first of first aspect, described is that VLAN in the network selects in the step of root bridge based on described network topological information, is that VLAN in the network selects root bridge by the configuration stp system priority.
In the possible implementation of the second of first aspect, described is in the step of the VLAN selection root bridge in the network based on described network topological information, selecting the convergence switch in the network to consist of the root bridge pond, is that VLAN in the network selects root bridge by configuring described root bridge pond.
In the possible implementation of the first of first aspect, described is in the step of the VLAN selection root bridge in the network, the root bridge of different VLAN to be carried out the hash setting based on described network topological information.
In the possible implementation of the first of first aspect, being connected between the port of setting up nonroot bridge node in the described spanning tree and the described root bridge specifically comprises:
Generate the port of nonroot bridge node in the described spanning tree and the mapping table of the affiliated VLAN of this nonroot bridge node;
Described mapping table is handed down to described nonroot bridge node, and described nonroot bridge node is transmitted according to described mapping table executing data.
In the possible implementation of the first of first aspect, the described backup spanning tree that comprises described backup root bridge and corresponding described VLAN that calculates also comprises afterwards:
When the root bridge of spanning tree breaks down, the nonroot bridge node of the corresponding VLAN of fault spanning tree is switched to corresponding backup spanning tree.
Second aspect provides another kind of network traffic sharing system, and described system comprises:
The root bridge unit is suitable for the collection network topology information, is that VLAN in the network selects root bridge based on described network topological information, and specifies backup root bridge;
The spanning tree unit, be suitable for adding according to node the situation of VLAN, calculate the spanning tree that comprises described root bridge and corresponding described VLAN, being connected between the port of setting up nonroot bridge node in the described spanning tree and the described root bridge, and, calculate the backup spanning tree that comprises described backup root bridge and corresponding described VLAN;
The overload processing unit is suitable for when monitor the overload of local link, and the node of described local link correspondence VLAN is switched to corresponding backup spanning tree.
In the possible implementation of the first of second aspect, described root bridge unit comprises:
The information module is suitable for the collection network topology information;
The root bridge module is suitable for based on described network topological information, and is that VLAN in the network selects root bridge by the configuration stp system priority;
The backup root bridge module, being suitable for based on described network topological information is that VLAN in the network specifies backup root bridge.
In the possible implementation of the first of second aspect, described root bridge module also is suitable for selecting the convergence switch in the network to consist of the root bridge pond, is that VLAN in the network selects root bridge by configuring described root bridge pond.
In the possible implementation of the first of second aspect, described root bridge module is carried out the hash setting with the root bridge of different VLAN.
In the possible implementation of the first of second aspect, described spanning tree unit comprises:
The spanning tree module is suitable for the situation according to node adding VLAN, calculates the spanning tree that comprises described root bridge and corresponding described VLAN;
Being connected between the link block, the port that is suitable for setting up nonroot bridge node in the described spanning tree and described root bridge;
Backup spanning tree module is suitable for calculating the backup spanning tree that comprises described backup root bridge and corresponding described VLAN.
In the possible implementation of the first of second aspect, described link block comprises:
Build the table submodule, be suitable for generating the port of nonroot bridge node in the described spanning tree and the mapping table of the affiliated VLAN of this nonroot bridge node;
List issues submodule, is suitable for described mapping table is handed down to described nonroot bridge node, and described nonroot bridge node is transmitted according to described mapping table executing data.
In the possible implementation of the first of second aspect, described system also comprises:
Fault processing unit is suitable for when the root bridge of spanning tree breaks down, and the node of the corresponding VLAN of fault spanning tree is switched to corresponding backup spanning tree.Network traffic sharing method and system of the present invention, network topological information based on the whole network is selected root bridge for each VLAN, calculate spanning tree, and specify backup root bridge and back up spanning tree, thereby when link overload or root bridge fault occurring, can make spanning tree reselect root bridge, realize load balancing by dynamic adjustment service traffics, this kind adjustment mode is regulated spanning tree based on the granularity of VLAN, can not interrupt the converting flow of other VLAN, and can reduce former MSTP agreement computing time, realize that switch in the spanning tree path fast.
Embodiment
Below in conjunction with drawings and Examples, the specific embodiment of the present invention is described in further detail.Following examples are used for explanation the present invention, but are not used for limiting the scope of the invention.
The described network traffic sharing method and system of the application by collecting full mesh topology at controller (Controller), select convergence switch to consist of the root bridge pond, select root bridge for each VLAN in the root bridge pond when VLAN creates.Described method and system can also detect the flow of each VLAN on the link, when service traffics among the VLAN are transshipped, thereby reselect the load balancing that root bridge can dynamic adjustments VLAN service traffics, and be that VLAN specifies backup root bridge, calculate in advance backup spanning tree path, when main spanning tree root bridge fault, can switch to fast the backup spanning tree like this.
Embodiment 1
Fig. 1 is the embodiment of the invention 1 described network traffic sharing method flow diagram, and as shown in Figure 1, described method comprises:
S100, collection network topology information are that VLAN in the network selects root bridge based on described network topological information, and specify backup root bridge.
Among the S100, can be that VLAN in the network selects root bridge by the configuration stp system priority; Can be that VLAN in the network selects root bridge by configuration root bridge pond also, wherein said root bridge pond have comprised all convergence switches in the current network.
Wherein, when being that VLAN in the network is when selecting root bridge by the configuration stp system priority, be each node configuration stp system priority corresponding to node place VLAN at first, the numerical value of this STP system priority is 4096 integral multiple, can be 0,4096,8192 according to priority from height to the low numerical value of arranging this STP system priority ..., and the node that arbitrary moment has the highest STP system priority is the root bridge of its place VLAN.
When being that VLAN in the network selects root bridge by configuration root bridge pond, need to be each node configuration stp system priority corresponding to node place VLAN at first also, then be that 0 and 4096 node is put into the root bridge pond with the numerical value of STP system priority among each VLAN, wherein, the numerical value of STP system priority is the root bridge that 0 node will be selected as its place VLAN, and the numerical value of STP system priority is the backup root bridge that 4096 node will be selected as its place VLAN.
Referring to Fig. 2, network topological information shows that node R B3, RB4, RB5 and RB6 are positioned at lower floor, node R B1 and RB2 are positioned at the upper strata, and comprise two virtual LAN VLAN 1 and VLAN2 in this network, controller is set to 0 according to the STP system priority of above-mentioned network topological information RB1 in VLAN1, the STP system priority of RB2 in VLAN1 is set to 4096, simultaneously, the STP system priority of RB2 in VLAN2 is set to the STP system priority of 0, RB1 in VLAN2 and is set to 4096.According to above-mentioned setting, RB1 will be as the root bridge of VLAN1, and RB2 will be as the backup root bridge of VLAN1; RB2 will be as the root bridge of VLAN2, and RB1 will be as the backup root bridge of VLAN1.
Generally speaking, preferably the root bridge of different VLAN is carried out the hash setting, as shown in Figure 2, with the root bridge of RB1 as VLAN1, with the root bridge of RB2 as VLAN2, can realize better load balancing like this, reduce the situation of local link appearance overload in the network.
S200, add the situation of VLAN according to node, calculate the spanning tree that comprises described root bridge and corresponding described VLAN, being connected between the port of setting up nonroot bridge node in the described spanning tree and the described root bridge, and, calculate the backup spanning tree that comprises described backup root bridge and corresponding described VLAN.
Referring to Fig. 3, node R B3 belongs to VLAN1 and VLAN2, and node R B4 belongs to VLAN1, and node R B5 belongs to VLAN1 and VLAN2, and node R B6 belongs to VLAN2.According to the corresponding situation of above-mentioned each node with corresponding VLAN, (RB1 is root bridge can to obtain the spanning tree of VLAN1, RB3, RB4 and RB5 are for pointing to the nonroot bridge node of RB1), and the spanning tree of VLAN2 (RB2 is root bridge, and RB3, RB5 and RB6 are for pointing to the nonroot bridge node of RB2).
Wherein, being connected between the port of setting up nonroot bridge node in the described spanning tree and the described root bridge specifically comprises:
The mapping table of VLAN under P1, the port that generates nonroot bridge node in the described spanning tree and this nonroot bridge node.
P2, described mapping table is handed down to described nonroot bridge node, described nonroot bridge node is transmitted according to described mapping table executing data.
Table 1 is the mapping table of node R B3, and wherein, node R B3 belongs to VLAN1 and VLAN2.Port a on this node R B3 is corresponding to VLAN1, connects RB1, and being used for will be from the data retransmission of VLAN1 to RB1; Port b on this node R B3 is corresponding to VLAN2, connects RB2, and being used for will be from the data retransmission of VLAN2 to RB2.This mapping table is generally generated by the situation of controller according to VLAN under the nonroot bridge node, and is issued to this nonroot bridge node, inquires about during for this nonroot bridge node for data forwarding.
Table 1 mapping table example
Port |
Corresponding VLAN |
Connect root bridge |
Port a |
VLAN1 |
RB1 |
Port b |
VLAN2 |
RB2 |
S300, when monitoring the overload of local link, the nonroot bridge node of the corresponding VLAN of described local link is switched to corresponding backup spanning tree.
Referring to Fig. 4 a, suppose among the VLAN1 overload between the node R B3 and node R B1, node R B1 is the root bridge of VLAN1, node R B2 is the backup root bridge of VLAN1.Referring to Fig. 4 b, through after the processing of above-mentioned S300, the STP system priority of node R B2 in VLAN1 is revised as 0, the STP system priority of node R B1 in VLAN1 is revised as 4096, node R B2 replaces node R B1 to become the root bridge of VLAN1 like this, correspondingly, the port of nonroot bridge node among the VLAN1 (RB3, RB4, RB5) and the corresponding relation of VLAN change, namely among the VLAN1 nonroot bridge node by with the port repeat that is connected of the root bridge RB2 data from VLAN1.As shown in table 2 below, former of the port b of node R B3 is corresponding to VLAN2, switch to the backup spanning tree after, the port b of node R B3 is simultaneously corresponding to VLAN1 and VLAN2, node R B3 will cross port b from the data communication device of VLAN1 and be forwarded to RB2 like this.
Mapping table example after table 2 changes
Port |
Corresponding VLAN |
Connect root bridge |
Port a |
? |
RB1 |
Port b |
VLAN1/VLAN2 |
RB2 |
Need to prove, if RB2 is originally the root bridge of VLAN2, after then switching, as the root bridge of VLAN1 and VLAN2, RB2's RB2 originates by the VLAN label area divided data in the message after receiving data simultaneously.In addition, after the switching, RB1 becomes the backup root bridge of VLAN1, after the quantity flow between RB3 and RB1 is replied normally, can again switch, and makes RB1 again become the root bridge of VLAN1.
Embodiment 2
Fig. 5 is the embodiment of the invention 2 described network traffic sharing method flow diagrams, as shown in Figure 2, the described method of this embodiment and embodiment 1 described method are basic identical, its difference is, be S300 ' after the described S200: when the root bridge of spanning tree breaks down, the nonroot bridge node of the corresponding VLAN of fault spanning tree is switched to corresponding backup spanning tree.
The processing procedure of S300 ' and described S300 are similar, do not repeat them here.
Embodiment 3
Fig. 6 is the modular structure schematic diagram of the described network traffic sharing of the embodiment of the invention 3 system, and as shown in Figure 6, described system comprises: root bridge unit 100, spanning tree unit 200 and overload processing unit 300.
Described root bridge unit 100 is suitable for the collection network topology information, is that VLAN in the network selects root bridge based on described network topological information, and specifies backup root bridge.
Referring to Fig. 7, described root bridge unit 100 comprises: information module 110, root bridge module 120 and backup root bridge module 130.
Described information module 110 is suitable for the collection network topology information;
Described root bridge module 120 is suitable for based on described network topological information, and is that VLAN in the network selects root bridge by the configuration stp system priority.In addition, described root bridge module 120 also is suitable for selecting the convergence switch in the network to consist of the root bridge pond, is that VLAN in the network selects root bridge by configuring described root bridge pond.And described root bridge module is carried out the hash setting with the root bridge of different VLAN, the purpose of sharing to reach offered load.
Described backup root bridge module 130, being suitable for based on described network topological information is that VLAN in the network specifies backup root bridge.
Described spanning tree unit 200, be suitable for adding according to node the situation of VLAN, calculate the spanning tree that comprises described root bridge and corresponding described VLAN, being connected between the port of setting up nonroot bridge node in the described spanning tree and the described root bridge, and, calculate the backup spanning tree that comprises described backup root bridge and corresponding described VLAN.
Referring to Fig. 8, described spanning tree unit 200 comprises: spanning tree module 210 and link block 220.
Described spanning tree module 210 is suitable for the situation according to node adding VLAN, calculates the spanning tree that comprises described root bridge and corresponding described VLAN.
Being connected between the described link block 220, the port that is suitable for setting up nonroot bridge node in the described spanning tree and described root bridge.
Referring to Fig. 9, described link block 220 comprises: build table submodule 221 and list and issue submodule 222.
The described table submodule 221 of building is suitable for generating the port of nonroot bridge node in the described spanning tree and the mapping table of the affiliated VLAN of this nonroot bridge node.
Described list issues submodule 222, is suitable for described mapping table is handed down to described nonroot bridge node, and described nonroot bridge node is transmitted according to described mapping table executing data.
Described backup spanning tree module 230 is suitable for calculating the backup spanning tree that comprises described backup root bridge and corresponding described VLAN.
Described overload processing unit 300 is suitable for when monitoring the overload of local link, and the node of the corresponding VLAN of described local link is switched to corresponding backup spanning tree.
Embodiment 4
Figure 10 is the modular structure schematic diagram of the described network traffic sharing of the embodiment of the invention 4 system, and as shown in figure 10, the described system of this embodiment and embodiment 3 described systems are basic identical, and its difference is, the described system of this embodiment also comprises:
Fault processing unit 400 is suitable for when the root bridge of spanning tree breaks down, and the node of the corresponding VLAN of fault spanning tree is switched to corresponding backup spanning tree.
Embodiment 5
Figure 11 is the hardware configuration schematic diagram of the described network traffic sharing of the embodiment of the invention 5 system, and as shown in figure 11, described system comprises: control appliance 500 and a plurality of switch 600.
Referring to Figure 12, described control appliance 500 comprises: root bridge device 510, spanning tree device 520, overload processing unit 530 and fault treating apparatus 540.
Described root bridge device 510 is suitable for the collection network topology information, is that VLAN in the network selects root bridge based on described network topological information, and specifies backup root bridge.Described root bridge is respectively different described switches 600 with backup root bridge.
Referring to Figure 13, described root bridge device 510 comprises: information collector 511, root bridge selector 512 and backup root bridge selector 513.
Described information collector 511 is suitable for the collection network topology information;
Described root bridge selector 512 is suitable for based on described network topological information, and is that VLAN in the network selects root bridge by the configuration stp system priority.In addition, described root bridge selector 512 also is suitable for selecting the convergence switch in the network to consist of the root bridge pond, is that VLAN in the network selects root bridge by configuring described root bridge pond.And described root bridge selector 512 carries out the hash setting with the root bridge of different VLAN, the purpose of sharing to reach offered load.
Described backup root bridge selector 513, being suitable for based on described network topological information is that VLAN in the network specifies backup root bridge.
Described spanning tree device 520, be suitable for adding according to node the situation of VLAN, calculate the spanning tree that comprises described root bridge and corresponding described VLAN, being connected between the port of setting up nonroot bridge node in the described spanning tree and the described root bridge, and, calculate the backup spanning tree that comprises described backup root bridge and corresponding described VLAN.
Referring to Figure 14, described spanning tree device 520 comprises: spanning tree calculator 521, connector 522 and backup spanning tree calculator 523.
Described spanning tree calculator 521 is suitable for the situation according to node adding VLAN, calculates the spanning tree that comprises described root bridge and corresponding described VLAN.
Being connected between the described connector 522, the port that is suitable for setting up nonroot bridge node in the described spanning tree and described root bridge.
Described connector 522 comprises: build list cell spare and list issues element.
The described list cell spare of building is suitable for generating the port of nonroot bridge node in the described spanning tree and the mapping table of the affiliated VLAN of this nonroot bridge node.
Described list issues element, is suitable for described mapping table is handed down to described nonroot bridge node, and described nonroot bridge node is transmitted according to described mapping table executing data.
Described backup spanning tree calculator 523 is suitable for calculating the backup spanning tree that comprises described backup root bridge and corresponding described VLAN.
Described overload processing unit 530 is suitable for when monitoring the overload of local link, and the node of the corresponding VLAN of described local link is switched to corresponding backup spanning tree.
Described fault treating apparatus 540 is suitable for when the root bridge of spanning tree breaks down, and the node of the corresponding VLAN of fault spanning tree is switched to corresponding backup spanning tree.
The described network traffic sharing method and system of the embodiment of the invention, network topological information based on the whole network is selected root bridge for each VLAN, calculate spanning tree, and specify backup root bridge and back up spanning tree, thereby when link overload or root bridge fault occurring, can make spanning tree reselect root bridge, realize load balancing by dynamic adjustment service traffics, this kind adjustment mode is regulated spanning tree based on the granularity of VLAN, can not interrupt the converting flow of other VLAN, and can reduce former MSTP agreement computing time, realize that switch in the spanning tree path fast.
The possible implementation that one of ordinary skill in the art will appreciate that various aspects of the present invention or various aspects can be embodied as system, method or computer program.Therefore, the possible implementation of each aspect of the present invention or various aspects can adopt complete hardware implementation example, complete implement software example (comprising firmware, resident software etc.), perhaps the form of the embodiment of integration software and hardware aspect all is referred to as " circuit ", " module " or " system " here.In addition, the possible implementation of each aspect of the present invention or various aspects can adopt the form of computer program, and computer program refers to be stored in the computer readable program code in the computer-readable medium.
Computer-readable medium can be computer-readable signal media or computer-readable recording medium.Computer-readable recording medium is including but not limited to electronics, magnetic, optics, electromagnetism, infrared or semiconductor system, equipment or device, perhaps aforesaid any appropriate combination is such as random access memory (RAM), read-only memory (ROM), Erasable Programmable Read Only Memory EPROM (EPROM or flash memory), optical fiber, portable read-only memory (CD-ROM).
Processor in the computer reads the computer readable program code that is stored in the computer-readable medium, so that processor can be carried out setting function action in the combination of in flow chart each step or each step; Generation is implemented in the device of setting function action in the combination of each piece of block diagram or each piece.
Computer readable program code can be fully carried out at user's computer, part is carried out at user's computer, as on independent software kit, the computer of part the user and part on remote computer, perhaps carry out at remote computer or server fully.Also should be noted that in some alternate embodiment, the function that each piece indicated in each step or the block diagram in flow chart may be not according to occurring in sequence of indicating among the figure.For example, depend on related function, in fact two steps or two pieces of illustrating in succession may roughly be carried out simultaneously, and perhaps these pieces sometimes may be carried out with reverse order.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.