UNICOM's routing search method of the destination node collection in band specified services path
Technical field
The present invention relates to routing search method, a kind of UNICOM's routing search method of the destination node collection with the specified services path is provided especially.
Background technology
EPLn (Ethernet Private LAN, ether private local area network) be that SDH (SynchronousDigital Hierarchy is arranged, SDH (Synchronous Digital Hierarchy)) Cheng Zai ether private local area network, service layer's route of EPLn is TRUNK, TRUNK is the service layer path that has encapsulated the SDH channel data business of certain bandwidth, in the EPLn constructive process, at first will the user specify some wings by situation under search out the TRUNK route that can connect into all nodes that the user selects a figure of UNICOM, wherein the limit can only take a TRUNK, can not stride many TRUNK.If explain with mathematical linguistics, then be: the user has selected plurality of nodes on a non-directed graph, and specify some two ends all must be included in the Search Results on the limit in destination node set, under condition like this, search out wing that these destination nodes can UNICOM be got up by.
In data structure associated class books, all can mention the Di Jiesitela algorithm, this algorithm solves be search a pair of internodal shortest path by.Can to this algorithm make amendment or encapsulate solve band specify must through wing by EPLn UNICOM route search problem, specific implementation is as follows:
1, it is right at first N destination node to be formed N (N-1)/2 node;
2, the node at the two ends of the M bar of user's appointment service TRUNK to as the node of finishing search to mark in addition;
3, use the Di Jiesitela algorithm to search for remaining N (N-1)/2-M node to needs, if certain is not to searching for success between node, current route search returns failure;
4, all in twos node to searched route of coming out altogether, and the route that repeats of deletion has just obtained UNICOM's route of EPLn.
The shortcoming of prior art is that time complexity is O (n3), and search performance is bad, and UNICOM's route that search is come out has bulk redundancy.
Summary of the invention
The invention provides band specify wing by UNICOM's routing search method of destination node collection, make UNICOM's route search more easy to be reliable.
A kind of destination node UNICOM routing search method with the specified services path, realize through the following steps:
A: all the available service paths in the query aim set of node between any two destination nodes are the topological diagram that described destination node collection is constructed on the limit with described service path;
B: a plurality of UNICOMs of structure subgraph in described topological diagram makes each UNICOM's subgraph only comprise a specified services path;
C: will have UNICOM's subgraph of common node to merge into UNICOM's subgraph respectively;
D: search and the UNICOM subgraph node that has the available service path to be connected respectively, and these nodes are merged to respectively in the UNICOM's subgraph that is connected, write down the available service path of these nodes of connection and UNICOM's subgraph;
E: judge whether to exist isolated node, described isolated node is the node that does not have the available service path to be connected with any one UNICOM's subgraph, if, then concentrate the UNICOM's route that does not have band specified services path at described destination node, finish search; Otherwise, continue step F;
F: UNICOM's subgraph that will have the available service path to connect is respectively merged into UNICOM's subgraph, and record connects the available service path of any two UNICOM's subgraphs;
G: judge whether to exist the isolated UNICOM subgraph that can not merge, there is not the available service path to be connected between described isolated UNICOM subgraph and other UNICOM's subgraph, if, then concentrate the UNICOM's route that does not have band specified services path at described destination node, finish search; Otherwise, continue step H;
H: determine UNICOM's route of described destination node collection, described UNICOM route comprises described specified services path and all available service paths of being write down in step D and step F.
Based on UNICOM's routing search method in a kind of destination node collection band specified services path of same design, realize through the following steps:
A: all the available service paths in the query aim set of node between any two destination nodes are the topological diagram that described destination node collection is constructed on the limit with described service path;
B: a plurality of UNICOMs of structure subgraph in described topological diagram makes each UNICOM's subgraph only comprise a specified services path;
C: will have UNICOM's subgraph of common node to merge into UNICOM's subgraph respectively;
D: search and the UNICOM subgraph node that has the available service path to be connected respectively, and these nodes are merged to respectively in the UNICOM's subgraph that is connected, write down the available service path of these nodes of connection and UNICOM's subgraph;
E: UNICOM's subgraph that will have the available service path to connect is respectively merged into UNICOM's subgraph, and record connects the available service path of any two UNICOM's subgraphs;
F: judge whether all UNICOM's subgraphs have been merged into the figure of UNICOM, and the described figure of UNICOM comprises all destination nodes, if then continue step g; Otherwise, concentrate the UNICOM's route that does not have band specified services path at described destination node, finish search;
G: determine UNICOM's route of described destination node collection, described UNICOM route comprises described specified services path and the available service path that is recorded.
The service path that described method also is included in the described topological diagram deletion or the described appointed service path of mark or has write down is not used it in the search of back.
Described method also comprises the step of returning the route search result, and described route search result is: described destination node is concentrated the UNICOM's route that does not have band specified services path, definite UNICOM's route.
When described method was used in ether private local area network, described service path was the service layer path that has encapsulated the SDH (Synchronous Digital Hierarchy) passage of certain bandwidth.
The difference of above-mentioned two kinds of methods is that first method is compared second method, when merging UNICOM's subgraph, judges that stage by stage whether route search is successful, can improve user-responsiveness.
Use the method for the invention and can receive following beneficial effect:
1, during first step initialization composition directly at the target joint, the some composition has been avoided dispersing in the later stage route search, is very beneficial for improving search performance;
2, the topology of searching for out according to mode like this is a sparse graph, has reduced UNICOM's route cost;
3, utilize first method, the search wing by process in, can judge stage by stage that wing by search failure, improves user's response speed.
Description of drawings
Fig. 1 is an embodiment of the invention flow chart;
Fig. 2 is a step S1 schematic diagram;
Fig. 3 is a step S2 schematic diagram;
Fig. 4 is a step S3 schematic diagram;
Fig. 5 is a step S4 schematic diagram;
Fig. 6 merges schematic diagram for the first time for step S6;
Fig. 7 merges schematic diagram for the second time for step S6.
Embodiment
Below with a concrete example and be described with reference to the accompanying drawings UNICOM's route search process.Use-case explanation: extremely shown in Figure 7 as Fig. 2, the destination node collection that node1~node6 need search for for the user, internodal limit is all available service TRUNK that does not have the carrying client path (the service layer path of EPLn) on the destination node collection that inquires from database, between wherein the node2 and node3, between node3 and the node4, between node5 and the node6 and the TRUNK between node7 and the node8 be user's appointment must be through TRUNK.Solid line among the figure is alternative available service TRUNK, and dotted line is occupied TRUNK in search procedure.
As shown in Figure 1, whole search procedure can be divided into seven steps:
Step S1: from available service TRUNK database, inquire all available TRUNK service paths on the destination node collection, standard form map<int shown in leaving in, MOC_EDGE_C〉in the mapId2Trunk data structure, form topological relation figure, also can select other data structure to preserve this topological relation.
As shown in Figure 2, utilize available TRUNK service path to form the topological structure graph of a relation of destination node, the limit among Fig. 2 is the available TRUNK service path that inquires in this step.
Step S2: leave set<set<int in specified services path configuration SCC (Subgraph Connected, UNICOM's subgraph)〉〉 in the setSubConnectedComponent data structure, also can select other data structure to preserve.
As shown in Figure 3, that uses appointment must construct four subgraph SCC1 of UNICOM, SCC2, SCC3, SCC4 through TRUNK, wherein the limit of appointment becomes dotted line, dotted line is represented that this service path is searched and is arrived, the record searching result, simultaneously can in topological diagram, carry out mark or deletion, in the route search step of back, not re-use this service path, below will be by merging the service path that searches out other step by step.
class?MOC_EDGE_C
{
public:
MOC_EDGE_C(_EDGEID?id,_MO_ID_src_node,
_MO_ID?dst_node,int?cost,PL_LEVEL_E?level,int?res,
_EDGEID?pair_id,_PATH?path);
MOC_EDGE_C(MOC_EDGE_C*new_one);
protected:
_EDGEID _id;
_MO_ID _src_node;
_MO_ID _dst_node;
int _cost;
PL_LEVEL_E?_level;
int _res;
_EDGEID _pair_id;
_PATH _path;
public:
_EDGEID?Getld()const{return_id;}
...
MOC_EDGE_C&?operator=(const?MOC_E?DGE_C
&);
};
Table one: topological data structure
If this method be used for searching for do not specify wing by the UNICOM route of destination node the time, can be in this step, the wing that any TRUNK available more than two is assumed to appointment is by structure SCC, step by the back still can obtain the route search result of UNICOM, and the appointment wing of supposing is selected according to actual conditions by number.
Step S3: the SCC that is associated with common node.
As shown in Figure 4, in this step, the SCC that common node is arranged is merged, merged among the SCC1 by the node among the current merging SCC2, so far remaining three SCC1, SCC3, SCC4 do not have in twos to occur simultaneously.
Step S4: the isolated node that does not belong to SCC is merged among the SCC that has existed.
As shown in Figure 5, in this step, it is this node that isolated node merges to principle among the SCC has the limit to link to each other with certain node among the SCC, merges through this minor node, and nodel has merged among the SCC1.The limit that connects is one the service path that searches, if isolated node connects more than one of the limit of UNICOM's subgraph, selects map<int, MOC_EDGEC〉ordering among mapId2Trunk service path the preceding.
Step S5: judge whether, to illustrate the isolated node that can not merge not have the UNICOM's route that comprises the specified services path, finish search and also return the result of wing by the search failure if having.
In this step, if find to have the isolated node that can not merge among any SCC that has existed, then return in this search and do not find qualified UNICOM route.
Step S6: merge SCC.
The combination principle of this step is: if there is the limit to link to each other between two SCC, then these two SCC just can merge, if there are many Connection Service paths, selection map<int, MOC_EDGE_C〉ordering among mapId2Trunk service path the preceding.
Step S7: judge whether to search for successfully.
Final this step wing by the successful criterion of search is: all SCC merge into one at last, and all destination nodes are all in that last SCC.
As shown in Figure 6, during the SCC first time of step 6 merged, SCC4 was integrated among the SCC3; As shown in Figure 7, during the SCC second time of this step merges, SCC3 is integrated among the SCC1, so far all SCC have merged and have finished, and the destination node of appointment all in SCC1, is recorded as the service path that searches with the fillet of using at every turn, the record searching result, simultaneously can in topological diagram, carry out mark or deletion, in the route search step of back, not re-use this service path.As shown in phantom in FIG., all service paths that search by top step and specified services path together UNICOM all destination nodes, so wing by searching for successfully, dotted line is exactly all service paths that UNICOM's route comprises.
Carrying out in the process existing and not having the limit to connect between two SCC at step S6, perhaps step S6 does not comprise all nodes after having merged all SCC that has the limit to connect, form a complete figure of UNICOM, then do not find qualified UNICOM route in this search.
The of the present invention convergence by UNICOM's subgraph realized the method for wing by search, is not limited to the EPLn business, all is suitable for for other networks with similar characteristics, and present embodiment does not limit protection scope of the present invention.