Embodiment
Hereinafter will and combine embodiment to specify the present invention with reference to accompanying drawing.Need to prove that under the situation of not conflicting, embodiment and the characteristic among the embodiment among the application can make up each other.
With reference to Fig. 2, show flow chart of steps according to a kind of method for searching route of the embodiment of the invention one, may further comprise the steps:
Step S202: in the backward compatible coupling in earlier strict coupling back with service attribute is that constraints is when carrying out routing inquiry; The link that matees fully for the service attribute that exists in the multilink to be checked and the service attribute in the constraints is provided with the first link mark, for the incomplete link of coupling is provided with the second link mark;
Present embodiment is applicable to that the backward compatible coupling in strict earlier coupling back with service attribute is the routing inquiry of constraints.Through in carrying out the routing inquiry process; Need from a plurality of nodes, select the route that satisfies condition; And all can have a link between any two nodes that directly link to each other, then there is multilink between a plurality of nodes, in this step; For the link of those service attributes of existing in the multilink and the service attribute in the constraints (promptly coupling) fully in full accord is provided with the first link mark, for the link of not quite identical (promptly not exclusively mating) is provided with the second link mark.
Wherein, the service attribute when service attribute can be for arbitrarily suitable Route Selection, like the link protection type, perhaps, like the level of security of link etc.
Step S204: the route of confirming to satisfy constraints according to the first link mark and the second link mark.
In this step, the link mark according to being provided with comprises the first link mark and the second link mark, confirms to satisfy the strict earlier route of mating the backward compatible matching constraints in back of service attribute.As, because of a route possibly comprise a plurality of links, so in a plurality of available routes; Select those all link marks wherein to be that route of the first link mark; As the route that satisfies constraints, if there is not such route, then from all available routes; Select one according to setting rule, like the minimum rule of link cost etc.
In the correlation technique, when carrying out the routing inquiry of belt restraining condition, when not fully during the route of coupling, need readjustment inquiry again once more, thereby inquiry times is more, search efficiency is lower.Through present embodiment, be adopted as the link that matees fully the first link mark is set, for the link that not exclusively matees is provided with the second link mark; Make when carrying out the routing inquiry of belt restraining condition, can at first judge whether the route of coupling fully according to the link mark, if do not have; Then select to satisfy the route of constraints, and needn't adjust back inquiry, thereby it is more to have solved route query times according to the first link mark and the second link mark; The problem that search efficiency is lower; And then only reached and need one query just can obtain the route that satisfies constraints, make inquiry times reduce, improved the effect of routing inquiry efficient significantly.
With reference to Fig. 3, show flow chart of steps according to a kind of method for searching route of the embodiment of the invention two.In the present embodiment; To the long defective of ASON constraint shortest path query time; Provide the shortest path of the belt restraining condition that a kind of ASON of raising uses to look into the method for searching route of road efficient, made ASON can in the shorter time, return identical result when retraining the shortest path inquiry.
The method for searching route of present embodiment may further comprise the steps:
Step S302: when source node carries out routing inquiry, in the full mesh topology database of this node being preserved according to the protection type of ASON issuing service on every link newly-increased complete match flag of link protection type.
For example, if the protection type of link is consistent with professional protection type, then the complete match flag of link protection type of this link is set to 0; If the protection type of link and professional protection Type-Inconsistencies, but the link protection type of this link is greater than the protection type of business, and then the complete match flag of link protection type of this link is set to 1; If the protection type of link and professional protection Type-Inconsistencies; And the protection type of link is less than the protection type of business; Then the complete match flag of link protection type of this link can not be provided with; Also careless settings, but this value should be in traditional CSPF and can this link be changed to disabled value.Be set to 0 through the complete match flag of link protection type; The link protection type is set to 1 greater than the complete match flag of link protection type of the protection type of business; When carrying out the complete matched and searched of link protection type; Whether be 0 can determine whether fully mate, be very easy to and search if only needing according to the complete match flag of link protection type of this route, improved search efficiency.
Need to prove; Also can the complete match flag of link protection type be set to other value; At this moment, when judging whether to mate fully, only need know the number of the link of coupling fully; Judge that whether the complete match flag sum of link protection type of route equals the product of the value of link number and setting, can determine whether to mate fully.
Step S304: with the root node of source node as shortest path tree.
When initial, source node is the root node of shortest path tree.At this moment; Each comparing unit all is 0 (wherein; Comparing unit is used to obtain the next node that links to each other with this node and metric (degree) value of this node, and for example source node is to total metric value in next-hop node path, or the weighted value of source node and next-hop node etc.; In the present embodiment, can be summation of the link protection type matching sign among the step S302 etc.).
Because initial, so this moment, next-hop node still was this node.
Step S306:, use dijkstra's algorithm to obtain next-hop node according to the complete match flag of link protection type.
In the present embodiment, if in the link of this node and the next-hop node that links to each other, it is 0 link that the complete match flag of link protection type is arranged, and then chooses that node that links to each other with this node in this link.
Need to prove; When the utilization dijkstra's algorithm obtains next-hop node; Traditional comparative approach is that the priority orders according to the comparison strategy of setting compares successively, is higher than link cost priority like link protection type priority level, then earlier carries out Route Selection according to the link protection type; If it is a plurality of that the route of selecting has, in the route of selecting, select again according to link cost.And in the present embodiment; It then is practical application scene according to each comparing unit; Not strict comparing when each comparing unit compares, but when certain comparing unit arrives to a certain degree, reduce priority-level and carry out ensuing comparison according to traditional priority level.(as, with the link protection type relatively be example, when the link protection type summation of two paths all more than or equal to 1; As be all 2 o'clock, think that this two paths is identical, this moment, the weight to this two paths compared; The selection cost is less, i.e. that less paths of weighted value.)
Step S308: repeating step S306, acquisition arrives the shortest path tree of destination node.
Pass through present embodiment; Realizing that having broken through traditional CSPF on the details is pressing the comparative approach of fixed priority order to each constraints (comparing unit); But compare according to the practical application scene adjustment priority of constraints; Improve the method that traditional C PF module realizes the link protection type matching, improved the routing inquiry efficient that ASON carries out the belt restraining condition.
With reference to Fig. 4, show according to the route sketch map in a kind of method for searching route of the embodiment of the invention three.Among Fig. 4, the protection type link that representative of black fine rule and routing inquiry request are mated fully, the representative of heavy black line section can compatible routing inquiry request be protected type link, the digitized representation link weight on the line segment.
The method for searching route of present embodiment may further comprise the steps:
Step S402:ASON issues the route requests of query node 1 to the belt restraining condition of node 4 to CSPF, and this constraints is: the backward compatible coupling in link protection type strict earlier coupling back.
Step S404:CSPF according to the link protection type whether with constraints in the link protection type mate fully, link is stamped the link mark, whether this link of mark is to mate fully.
In the present embodiment, the link of setting node 1-2 is labeled as 1, and the link of node 1-3 is labeled as 0, and the link of node 2-3 is labeled as 1, and the link of node 2-4 is labeled as 0, and the link of node 3-4 is labeled as 0.Wherein, 0 expression is coupling fully, and 1 expression is not exclusively mated and the link protection type is higher than the link protection type in the constraints.
Step S406: the link protection type matching mark of all links of node 1 on node 4 routes is added up.
In the present embodiment, node 1 has four available routes to node 4, is respectively: node 1-2-4, node 1-3-4, node 1-2-3-4, node 1-3-2-4.Wherein, The adding up and be 1 of the link protection type matching mark of node 1-2-4; The adding up and be 0 of the link protection type matching mark of node 1-3-4; The adding up and be 2 of the link protection type matching mark of node 1-2-3-4, the adding up and be 1 of the link protection type matching mark of node 1-3-2-4.
Step S408: relatively the link protection type matching of route add up with, confirm optimum route results.
In the present embodiment, the adding up and be 0 of the link protection type mark of route 1-3-4, expression link protection type is mated fully.Suppose that link protection type matching priority is higher than other routing strategy priority, confirm that then route 1-3-4 is optimum route results.
Pass through present embodiment; The link protection type identification of coupling is 0 to the CSPF module through being provided with fully; Through judging adding up and be 0 whether of link protection type mark, can judge whether there is the shortest path that satisfies constraints fast, thereby improved ASON significantly look into road efficient.
With reference to Fig. 5, show according to the route sketch map in a kind of method for searching route of the embodiment of the invention four.Among Fig. 5, the protection type link that representative of black fine rule and routing inquiry request are mated fully, the representative of heavy black line section can compatible routing inquiry request be protected type link, the digitized representation link weight on the line segment.
The method for searching route of present embodiment may further comprise the steps:
Step S502:ASON issues the route requests of query node 1 to the belt restraining condition of node 4 to CSPF, and this constraints is: the backward compatible coupling in link protection type strict earlier coupling back.
Step S504:CSPF according to the link protection type whether with constraints in the link protection type mate fully, link is stamped the link mark, whether this link of mark is to mate fully.
In the present embodiment, the link of setting node 1-2 is labeled as 1, and the link of node 1-3 is labeled as 0, and the link of node 2-3 is labeled as 1, and the link of node 2-4 is labeled as 0, and the link of node 3-4 is labeled as 1.Wherein, 0 expression is coupling fully, and 1 expression is not exclusively mated and the link protection type is higher than the link protection type in the constraints.
Step S506: the link protection type matching mark of all links of node 1 on node 4 routes is added up.
In the present embodiment, node 1 has four available routes to node 4, is respectively: node 1-2-4, node 1-3-4, node 1-2-3-4, node 1-3-2-4.Wherein, The adding up and be 1 of the link protection type matching mark of node 1-2-4; The adding up and be 1 of the link protection type matching mark of node 1-3-4; The adding up and be 3 of the link protection type matching mark of node 1-2-3-4, the adding up and be 1 of the link protection type matching mark of node 1-3-2-4.
Step S508: relatively the link protection type matching of route add up with, confirm optimum route results.
In the present embodiment, all there is not the link protection type to mate fully in four routes, at this moment; Then reduce link protection type matching priority; Promptly no longer carry out the comparison (just thinking that the link protection type matching had just compare at 0 o'clock in adding up) of link protection type matching, but continue to select route, to compare the link cost of each route according to the routing rules of setting; Promptly the minimum route of inquiry link cost is an example from a plurality of routes; Then continue the relatively weight summation of four routes, according to comparative result, it is optimum route results that CSPF returns 1-2-3-4.
In this case, constraints requires if comprise the link that surpasses 1 backward compatible coupling of link protection type in the mulitpath, and when not considering other constraintss, mulitpath is regarded as identical.At this moment, can from mulitpath, finally select qualified path according to other constraintss again.Retrain the interface that provides to the outside or coupling fully with present CSPF for the link protection type matching; Or backward compatible coupling; If the routing inquiry that ASON issues requires the strict earlier coupling of link protection type matching constraint,, must inquire about to CSPF and just can return route for twice and compare if not then during backward compatible coupling; The ASON of present embodiment only need once promptly can protect the backward compatible route in the strict earlier back of type matching by return link to the CSPF inquiry; And need not adjust back inquiry, and reduced inquiry times, improved search efficiency.
Certainly, when in all routes, all not having route that the link protection type matees fully, those skilled in the art also can set other comparison condition, and to select suitable route, the present invention does not limit this.
With reference to Fig. 6, show structured flowchart according to a kind of routing inquiring device of the embodiment of the invention five, comprising:
Module 602 is set; Being used in the backward compatible coupling in earlier strict coupling back with service attribute is that constraints is when carrying out routing inquiry; The link that matees fully for the service attribute that exists in the multilink to be checked and the service attribute in the constraints is provided with the first link mark, for the incomplete link of coupling is provided with the second link mark; Enquiry module 604 is used for confirming to satisfy according to the first link mark and the second link mark route of constraints.
Preferably, service attribute is the link protection type; Module 602 is set the second link mark is set for the link that not exclusively coupling and link protection type are higher than the link protection type in the constraints.
Preferably, enquiry module 604 comprises: judge module 6042, be used for judging all available routes, and whether exist all link marks to be the route of the first link mark; Executive Module 6044 is used for if the judged result of judge module 6042 is for being that then definite this route is to satisfy the route of constraints; If the judged result of judge module 6042 is then confirmed a route according to preset rule, for satisfying the route of constraints for not from all available routes.
Preferably, above-mentioned preset rule is the minimum rule of link cost.
Preferably, enquiry module 604 also comprises: select module, be used for if the route of confirming that satisfies constraints comprises a plurality ofly, then from a plurality of routes, select one according to the rule of setting.Preferably, the rule of this setting is the Route Selection priority rule, and the Route Selection priority rule is used for carrying out Route Selection according to the different priorities of a plurality of routing strategies.
Preferably, the first link mark is set to 0, the second link mark and is set to 1; Judge module 6042 is used for judging all available routes, and whether having link mark sum is zero route; Executive Module 6044 is used for if the judged result of judge module 6042 is for being that then definite this route is to satisfy the route of constraints; If the judged result of judge module 6044 is then confirmed a route according to preset rule, for satisfying the route of constraints for not from all available routes.
Need to prove that a plurality of embodiment of the present invention all are example with ASON, but method for searching route of the present invention and device are not only applicable to the ASON network, are applicable to the network that other uses routing inquiry yet.In addition; Constraints among a plurality of embodiment of the present invention is example with the backward compatible coupling in strict earlier coupling back of link protection type all; But be not limited thereto; All require all applicable method and apparatus of the present invention of the strict earlier coupling backward compatible matching constraints in back, and the present invention does not limit this.And a plurality of embodiment of the present invention use dijkstra's algorithm to search shortest path, but are not limited thereto, and those skilled in the art can also select other suitable shortest path searching algorithm according to actual needs, and the present invention does not limit this yet.
It is long to the present invention is directed in the prior art belt restraining routing inquiry time, and inquiry times is many, and the defective that search efficiency is low provides a kind of routing inquiry scheme of belt restraining condition.This scheme is when inquiring about route; The service attribute of all links of the route that requirement is returned preferably with constraints in service attribute mate fully; If there is not such path, the service attribute of some link also can not exclusively mate with the service attribute of constraints on the path.According to the mode of traditional this constraints of realization, then in routing inquiry, need adjust back twice during about the earlier strict coupling back backward compatible matching constraint of service attribute and just can inquire the path that meets the demands.And, can realize that one query just can return the path of satisfying constraints through technical scheme of the present invention, and make route query times reduce, improved significantly and looked into road efficient.
Obviously, it is apparent to those skilled in the art that above-mentioned each module of the present invention or each step can realize with the general calculation device; They can concentrate on the single calculation element; Perhaps be distributed on the network that a plurality of calculation element forms, alternatively, they can be realized with the executable program code of calculation element; Thereby; Can they be stored in the storage device and carry out, and in some cases, can carry out step shown or that describe with the order that is different from here by calculation element; Perhaps they are made into each integrated circuit modules respectively, perhaps a plurality of modules in them or step are made into the single integrated circuit module and realize.Like this, the present invention is not restricted to any specific hardware and software combination.
The above is merely the preferred embodiments of the present invention, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.All within spirit of the present invention and principle, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.