Disclosure of Invention
The embodiment of the invention provides a method and equipment for establishing an LSP in an MPLS network, which are used for reducing software and hardware resources consumed by the LSP.
In order to achieve the above object, an embodiment of the present invention provides a method for establishing a label switched path LSP in a multi-protocol label switching MPLS network, where the method is applied in the MPLS network, and includes:
when the node-in device calculates the route, the loop-back port route of the node-out device corresponding to the route is obtained;
if the route is matched with the loopback interface route, the ingress node equipment establishes an LSP corresponding to the loopback interface route of the egress node equipment;
if the route is not matched with the loopback interface route, the access node equipment checks whether a public network general label corresponding to the access node equipment is recorded locally;
if the public network general label corresponding to the egress node device is recorded, when the ingress node device establishes the LSP corresponding to the loopback interface route of the egress node device, the ingress node device establishes the LSP corresponding to the route by using the LSP corresponding to the loopback interface route of the egress node device, so that the egress label of the LSP corresponding to the route is the public network general label corresponding to the egress node device, and the next hop of the LSP corresponding to the route is the LSP corresponding to the loopback interface route of the egress node device.
The routing protocol of the MPLS network is open shortest path first OSPF, and for 1 type, 2 type, 3 type and 7 type routes, the loop back port route of the out-node equipment is the loop back port route of the issuing equipment of the link state broadcast LSA corresponding to the route; for the 5-class routing, when the autonomous system border router ASBR is in the area, the loop-back port routing of the egress node device is the loop-back port routing of the release device corresponding to the LSA of the routing, and when the ASBR is in other areas, the loop-back port routing of the egress node device is the loop-back port routing of the last device on the shortest path first SPF path where the routing is located.
The method for detecting whether the public network universal label corresponding to the node-out device is recorded locally by the node-in device specifically includes:
when the public network universal label is configured on each device, the node-in device checks whether the public network universal label corresponding to the node-out device is recorded locally or not according to the configuration information of the node-in device.
The method for detecting whether the public network universal label corresponding to the node-out device is recorded locally by the node-in device specifically includes:
when each device notifies the corresponding public network universal label to other devices through the label mapping message, the node-in device maintains the public network universal label of each device according to the label mapping message received by the node-in device, and checks whether the public network universal label corresponding to the node-out device is recorded locally or not by utilizing the maintenance information.
The access node device maintains the public network general label of each device according to the label mapping message received by the access node device, and further comprises:
when the access node equipment receives a label mapping message, if the U bit position of the label mapping message is known as a designated identifier and the prefix of a first forwarding equivalence class FEC element is a specific address, acquiring a loop back port route corresponding to the label mapping message from a second FEC element;
if the public network general label corresponding to the loopback interface route is not stored currently, the access node equipment records the corresponding relation among the public network general label carried in the label mapping message, the loopback interface route and the instance number in the third FEC element in the label mapping message;
if the public network general label corresponding to the loopback interface route is stored currently, the access node equipment compares the size relationship between the instance number in the third FEC element in the label mapping message and the instance number corresponding to the currently stored public network general label; if the former is larger than the latter, the access node equipment updates the currently stored public network general label through the public network general label carried in the label mapping message, and updates the currently stored instance number through the instance number in the third FEC element in the label mapping message; if the former is smaller than the latter, the ingress node device discards the label mapping message.
Establishing, by the ingress node device, an LSP corresponding to the loopback interface route of the egress node device, where the ingress node device establishes an LSP corresponding to the route by using the LSP corresponding to the loopback interface route of the egress node device, and before further including:
the node-in device checks whether the route and the loop-back port route of the node-out device have the same next hop; if the same next hop exists, further executing a process of establishing the LSP corresponding to the loopback interface route of the egress node device on the ingress node device, and the ingress node device establishing the LSP corresponding to the route by using the LSP corresponding to the loopback interface route of the egress node device.
The method further comprises: when the LSP corresponding to the loopback interface route of the egress node device is not established on the ingress node device, the ingress node device searches for the farthest whole label switching router LSR on the path from itself to the egress node device according to the SPF tree, and establishes the LSP corresponding to the route by using the LSP corresponding to the loopback interface route of the farthest whole LSR, so that the egress label of the LSP corresponding to the route is the public network general label corresponding to the farthest whole LSR, and the next hop of the LSP corresponding to the route is the LSP corresponding to the loopback interface route of the farthest whole LSR.
The method for searching the farthest complete LSR on the path from the node entering device to the node exiting device according to the SPF tree includes:
on the path from the ingress node device to the egress node device, the ingress node device starts to search backwards from the direct connection next hop, and obtains a device R1 of a first LSP without a device on the path of an SPF tree in the direction of the egress node device, and searches from the previous hop of the device R1 in the direction of the ingress node device against the path of the SPF tree, and obtains a first LSR corresponding to a public network generic label, and determines that the LSR is the farthest complete LSR.
A routing device for an ingress node device in a multiprotocol label switching, MPLS, network, the routing device comprising:
an obtaining module, configured to obtain a loopback interface route of an egress node device corresponding to a route when the route is calculated;
a first establishing module, configured to establish a label switched path LSP corresponding to the loopback interface route of the egress node device when the route matches the loopback interface route;
the query module is used for checking whether the equipment records a public network universal label corresponding to the node-out equipment or not when the route is not matched with the loop-back port route;
a second establishing module, configured to, when the public network general label corresponding to the egress node device is recorded and when an LSP corresponding to the loopback interface route of the egress node device is established on the device, establish the LSP corresponding to the route by using the LSP corresponding to the loopback interface route of the egress node device, so that the egress label of the LSP corresponding to the route is the public network general label corresponding to the egress node device, and a next hop of the LSP corresponding to the route is the LSP corresponding to the loopback interface route of the egress node device.
The routing protocol of the MPLS network is open shortest path first OSPF, and for 1 type, 2 type, 3 type and 7 type routes, the loop back port route of the out-node equipment is the loop back port route of the issuing equipment of the link state broadcast LSA corresponding to the route; for the 5-class routing, when the autonomous system border router ASBR is in the area, the loop-back port routing of the egress node device is the loop-back port routing of the release device corresponding to the LSA of the routing, and when the ASBR is in other areas, the loop-back port routing of the egress node device is the loop-back port routing of the last device on the shortest path first SPF path where the routing is located.
The query module is specifically configured to, when a public network universal label is configured on each device in the MPLS network, check whether the public network universal label corresponding to the egress node device is recorded on the device according to the configuration information of the device.
The query module is specifically configured to, when each device in the MPLS network notifies the other device of the public network universal tag corresponding to the device through the tag mapping message, maintain the public network universal tag of each device according to the tag mapping message received by the device, and check whether the public network universal tag corresponding to the egress node device is recorded on the device by using the maintenance information of the device.
The query module is further configured to, when receiving a label mapping message, obtain a loopback interface route corresponding to the label mapping message from a second FEC element if it is known that a U bit position of the label mapping message is a designated identifier and a prefix of a first forwarding equivalence class FEC element is a specific address;
if the public network general label corresponding to the loopback interface route is not stored currently, recording the corresponding relation among the public network general label carried in the label mapping message, the loopback interface route and the instance number in the third FEC element in the label mapping message;
if the public network general label corresponding to the loopback interface route is stored currently, comparing the size relationship between the example number in the third FEC element in the label mapping message and the example number corresponding to the currently stored public network general label; if the former is larger than the latter, updating the currently stored public network general label through the public network general label carried in the label mapping message, and updating the currently stored instance number through the instance number in the third FEC element in the label mapping message; if the former is smaller than the latter, the label mapping message is discarded.
The second establishing module is specifically configured to, after checking whether the route and the loopback interface route of the egress node device have the same next hop, if the route and the loopback interface route of the egress node device have the same next hop, further execute a process of establishing an LSP corresponding to the loopback interface route of the egress node device on the device, and establish an LSP corresponding to the route by using the LSP corresponding to the loopback interface route of the egress node device.
Further comprising: a third establishing module, configured to, when an LSP corresponding to a loopback interface route of the egress node device is not established on the device, find a farthest whole label switch router LSR on a path from the device to the egress node device according to the SPF tree, and establish an LSP corresponding to the route by using the LSP corresponding to the loopback interface route of the farthest whole LSR, so that an egress label of the LSP corresponding to the route is a public network general label corresponding to the farthest whole LSR, and a next hop of the LSP corresponding to the route is an LSP corresponding to the loopback interface route of the farthest whole LSR.
The third establishing module is further configured to search backwards from a next hop directly connected to the device on a path from the device to the node-out device, obtain a device R1 of an LSP corresponding to a first loop-back port route without a device on an SPF tree path in the direction of the node-out device, search from a previous hop of the device R1 in the direction opposite to the SPF tree path to the device, obtain a first LSR corresponding to a public network common label, and determine that the LSR is the farthest complete LSR.
Compared with the prior art, the embodiment of the invention at least has the following advantages: in the embodiment of the invention, under the condition that a large number of routes exist, the routes which travel the same path in the MPLS domain can be carried on the same LSP, thereby not only realizing the forwarding of the MPLS label, but also reducing the software and hardware resources consumed by the LSP.
Detailed Description
For the networking situation of the MPLS network, an Open Shortest Path First (OSPF) routing protocol is usually used in the MPLS domain to learn and publish the routes, and as shown in fig. 2, after performing route calculation by using OSPF (e.g., performing calculation by using SPF (shortest path First) algorithm), the network topology is as shown in fig. 3.
For the network topology shown in fig. 3, IP network 2 and IP network 1 are hung under Egress LSR, so the paths from Ingress LSR to IP network 2 and IP network 1 are: IngressLSR- > T1- > T2- > EgressLSR- > IP network 2 and IngressLSR- > T1- > T2- > EgressLSR- > IP network 1; i.e. the paths from Ingress LSR to IP network 2 and IP network 1 are the same within the MPLS domain and can thus be forwarded over the same LSP within the MPLS domain.
Based on the above discovery, embodiments of the present invention provide a method and an apparatus for establishing an LSP in an MPLS network, so that, in the presence of a large number of routes, routes that travel the same path in an MPLS domain can be carried on the same LSP (i.e., an LSP corresponding to a loopback interface route of an egress node device), thereby implementing MPLS label forwarding and reducing software and hardware resources consumed by the LSP.
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
The embodiment of the invention provides a method for establishing an LSP in an MPLS network, which can be applied to an MPLS network including at least an Ingress node device (i.e., Ingress LSR in fig. 3) and an Egress node device (i.e., Egress LSR in fig. 3), where a routing protocol of the MPLS network includes but is not limited to: open shortest path first, OSPF, as shown in fig. 4, the method comprises the steps of:
in step 401, when the ingress node device calculates a route (i.e. a route issued by the egress node device), it obtains a loopback interface route (i.e. an IP address of a loopback interface) of the egress node device corresponding to the route.
In the embodiment of the invention, when the node-entering equipment carries out route calculation through OSPF, the network topology can be calculated through SPF algorithm, and the source LSR of each route can be obtained through topology calculation; therefore, for a route issued by an egress node device, when calculating through OSPF, in addition to obtaining a prefix and next hop information of the route, it is also necessary to obtain a loopback interface route of the egress node device corresponding to the route (i.e., source LSR information of the route, which is an ID of the egress node device) when calculating the route.
It should be noted that, for the type 1, type 2, type 3 and type 7 routes, the ring-back port route of the out-node device is the ring-back port route of the publishing device (i.e. source LSR) of the LSA (Link State Advertisement) corresponding to the route; for the 5-class routing, when an ASBR (Autonomous system border Router) is in the local area, the loop-back port route of the egress node device is the loop-back port route of the release device of the LSA corresponding to the routing, and when the ASBR is in another area, the loop-back port route of the egress node device is the loop-back port route of the last Router on the SPF path where the routing is located.
Step 402, the access node device determines whether the calculated route matches the obtained loopback interface route, if the route matches the loopback interface route (i.e. the obtained route is the loopback interface route), step 403 is executed, and if the route does not match the loopback interface route, step 404 is executed.
When the routing prefix is the same as the IP address of the loopback interface route, the route is matched with the loopback interface route; otherwise, the route is not matched with the loop-back interface route.
Step 403, the ingress node device establishes an LSP corresponding to a loopback interface route of the egress node device; after obtaining the loopback interface route of the egress node device, the ingress node device may establish the LSP corresponding to the loopback interface route of the egress node device, and details of the specific establishment process are not described in this embodiment of the present invention.
Step 404, the node entering device checks whether a public network universal label corresponding to the node exiting device is recorded locally; if the public network general label corresponding to the node-out device is recorded, executing step 405; otherwise, the processing is determined to be implemented or stopped according to the existing user policy, which is not described in detail.
In the embodiment of the present invention, the public network universal tag may be obtained by one or any combination of the following methods:
a first mode and a manual configuration mode, wherein in the mode, a user manually configures public network general labels on each device, and all LSRs supporting the mode have the same public network general labels; for the first mode, the node entering device checks whether a public network universal label corresponding to the node exiting device is recorded locally, and the method specifically includes: when the public network universal tag is configured on each device, the node-in device can check whether the public network universal tag corresponding to the node-out device is recorded locally according to the configuration information of the node-in device.
And a second mode is a network synchronization mode, in which each LSR (Egress corresponding to LSP, i.e. an Egress node device) automatically selects a public network universal label used locally, synchronizes its own public network universal label to each device in the network through a direct-connected LDP neighbor, and finally sends the public network universal label to an ingress node device.
And a third mode is a remote neighbor mode, in which each LSR (Egress corresponding to LSP, i.e. an Egress node device) automatically selects a public network general label used locally, and directly sends the public network general label to an opposite end device (i.e. an ingress node device) through a remote neighbor, which can be applied to a situation where a part of devices in a network support the present mode.
It should be noted that, for the above-mentioned second and third modes, the public network universal tag is notified to other devices through the tag mapping message; the difference between the two is that: after receiving the public network general label sent by the neighbor, the device using the network synchronization mode needs to forward the label mapping message to other direct-connected neighbors, and the device using the remote neighbor mode does not need to forward the label mapping message to other direct-connected neighbors.
For the second and third modes, the step of the node entering device checking whether the public network universal label corresponding to the node exiting device is recorded locally specifically includes: when each device informs the corresponding public network universal label to other devices through the label mapping message, so that the node-in device can finally receive the label mapping message sent by each device, the node-in device maintains the public network universal label of each device according to the received label mapping message, and checks whether the public network universal label corresponding to the node-out device is recorded locally or not by utilizing the maintenance information.
In this embodiment of the present invention, a public network generic label transmitted in LDP may use a label mapping message, U bit positions of the label mapping message are designated identifiers (e.g., identifier 1, etc.), a prefix in a first FEC element in a FEC TLV (type length Value ) is a specific address (these specific addresses are not present in routing as unicast routing information, such as 127.0.0.1, or 255.255.255.255.255, etc.), a second FEC element is a loopback interface route of a source LSR (i.e., an egress node device), and a position of the prefix in a third FEC element fills in an instance number.
Based on the design mode of the label mapping message, the access node device maintains the public network universal label of each device according to the label mapping message received by the access node device, and the method further comprises the following steps:
when the ingress node device receives the label mapping message, if it is known that the U bit position of the label mapping message is a specific identifier (e.g., identifier 1) and the prefix of the first FEC element is a specific address (e.g., 127.0.0.1, or 255.255.255.255, etc.), the ingress node device obtains a loopback interface route corresponding to the label mapping message from the second FEC element (i.e., the loopback interface route of the issuing device of the label mapping message);
if the public network general label corresponding to the loopback interface route is not stored currently, the node-in device records the corresponding relation among the public network general label carried in the label mapping message, the loopback interface route (which is the identifier of the node-out device), and the instance number in the third FEC element in the label mapping message;
if the public network general label corresponding to the loop-back port route is currently stored, the access node equipment compares the size relationship between the instance number in the third FEC element in the label mapping message and the instance number corresponding to the currently stored public network general label; if the former is larger than the latter, the access node equipment updates the currently stored public network universal label through the public network universal label carried in the label mapping message, and updates the currently stored instance number through the instance number in the third FEC element in the label mapping message; if the former is smaller than the latter, the ingress node device discards the label mapping message.
Step 405, when an LSP corresponding to the loopback interface route of the egress node device is established on the ingress node device, the ingress node device establishes an LSP corresponding to the route (which is the route issued by the egress node device, that is, the route calculated in step 401) by using the LSP corresponding to the loopback interface route of the egress node device, so that the egress label of the LSP corresponding to the route is the public network general label corresponding to the egress node device, and the next hop of the LSP corresponding to the route is the LSP corresponding to the loopback interface route of the egress node device.
In a preferred implementation manner of the embodiment of the present invention, before performing step 405, the ingress node device may further check whether the route and a loopback interface route of the egress node device have the same next hop; if there is the same next hop, go to step 405; if there is no same next hop, the processing is determined to be implemented or stopped according to the existing user policy, and details of the process are not described again.
In a preferred embodiment of the present invention, when an LSP corresponding to a loopback interface route of an egress node device is not established on an ingress node device, the ingress node device searches for a farthest complete LSR on a path from the ingress node device to the egress node device according to an SPF tree, establishes an LSP corresponding to the route by using an LSP corresponding to the loopback interface route of the farthest complete LSR, makes an egress label of the LSP corresponding to the route a public network general label corresponding to the farthest complete LSR, and makes a next hop of the LSP corresponding to the route a LSP corresponding to the loopback interface route of the farthest complete LSR; in addition, if the ingress node device does not find the farthest complete LSR on the path from itself to the egress node device according to the SPF tree, the ingress node device determines to implement the processing or stop the processing according to the existing user policy, which is not described in detail herein.
Further, the method for searching the farthest complete LSR on the path from the node entering device to the node exiting device according to the SPF tree includes: on the path from the ingress node device to the egress node device, the ingress node device starts to search backwards from the direct connection of the next hop, obtains a device R1 (no longer searching backwards at this time) of the LSP corresponding to the first loop-back router without the device on the SPF tree path to the egress node device, searches from the previous hop of the device R1 towards the ingress node device against the SPF tree path, obtains a first LSR corresponding to a public network common label, and determines that the LSR is the farthest complete LSR.
In summary, after the above processing, all the non-loopback interface routes of the egress node device use the public network common label to generate the LSP; that is, if router R (e.g., an ingress node device) learns 1 loopback interface route and N other routes (non-loopback interface routes) from a source router a (e.g., an egress node device), router R only needs to generate two types of LSPs: 1 loop back interface route corresponding LSP; the LSP corresponding to the N other routes has the same next hop and label, so that the consumption of MPLS resources is less, and only one LSP resource is occupied on the resources, thereby reducing the software and hardware resources consumed by the LSP.
In addition, when the packet is matched to a non-loopback interface route, based on the LSP established above, a layer of MPLS inner label (i.e., a public network common label) may be marked on the packet according to the public network common label corresponding to the route, and then a next hop is found to be an LSP (i.e., an LSP corresponding to a loopback interface route of the egress interface device corresponding to the route), and then a layer of outer label (i.e., a label of the LSP corresponding to the loopback interface route) is added according to the LSP and then forwarded; on the intermediate forwarding equipment, the message is forwarded according to the outer layer label; and after the message reaches a source router (namely, the exit node equipment), popping up the outer layer label, finding that the inner layer label is a public network general label, and then, the exit node equipment searches a routing table and carries out forwarding processing according to the routing.
Based on the same inventive concept as the above method, the present invention provides a routing device for an ingress node device in a multi-protocol label switching MPLS network, as shown in fig. 5, where the routing device includes:
an obtaining module 11, configured to obtain a loopback interface route of an egress node device corresponding to a route when the route is calculated;
a first establishing module 12, configured to establish a label switched path LSP corresponding to the loopback interface route of the egress node device when the route matches the loopback interface route;
the query module 13 is configured to check whether the device records a public network universal tag corresponding to the egress node device when the route is not matched with the loopback interface route;
the second establishing module 14 is configured to, when the public network general label corresponding to the egress node device is recorded and when the LSP corresponding to the loopback interface route of the egress node device is established on the present device, establish the LSP corresponding to the route by using the LSP corresponding to the loopback interface route of the egress node device, so that the egress label of the LSP corresponding to the route is the public network general label corresponding to the egress node device, and a next hop of the LSP corresponding to the route is the LSP corresponding to the loopback interface route of the egress node device.
In the embodiment of the present invention, a routing protocol of the MPLS network is open shortest path first OSPF, and for type 1, type 2, type 3 and type 7 routes, a loop back port route of the egress node device is a loop back port route of an issuing device that broadcasts LSA in a link state corresponding to the route; for the 5-class routing, when the autonomous system border router ASBR is in the area, the loop-back port routing of the egress node device is the loop-back port routing of the release device corresponding to the LSA of the routing, and when the ASBR is in other areas, the loop-back port routing of the egress node device is the loop-back port routing of the last device on the shortest path first SPF path where the routing is located.
The query module 13 may check whether the device records the public network universal tag corresponding to the egress node device in the following two ways:
the query module 13 is specifically configured to, when a public network universal label is configured on each device in the MPLS network, check whether the public network universal label corresponding to the egress node device is recorded on the device according to the configuration information of the device.
Or,
the query module 13 is specifically configured to, when each device in the MPLS network notifies the public network universal label corresponding to the device to another device through the label mapping message, maintain the public network universal label of each device according to the label mapping message received by the device, and check whether the public network universal label corresponding to the egress node device is recorded on the device by using the maintenance information of the device.
The query module 13 is further configured to, when receiving the label mapping message, if it is known that the U bit position of the label mapping message is the designated identifier and the prefix of the first forwarding equivalence class FEC element is the specific address, obtain a loopback interface route corresponding to the label mapping message from the second FEC element;
if the public network general label corresponding to the loopback interface route is not stored currently, recording the corresponding relation among the public network general label carried in the label mapping message, the loopback interface route and the instance number in the third FEC element in the label mapping message;
if the public network general label corresponding to the loopback interface route is stored currently, comparing the size relationship between the example number in the third FEC element in the label mapping message and the example number corresponding to the currently stored public network general label; if the former is larger than the latter, updating the currently stored public network general label through the public network general label carried in the label mapping message, and updating the currently stored instance number through the instance number in the third FEC element in the label mapping message; if the former is smaller than the latter, the label mapping message is discarded.
The second establishing module 14 is specifically configured to, after checking whether the route and the loopback interface route of the egress node device have the same next hop, if the route and the loopback interface route of the egress node device have the same next hop, further execute a process of establishing an LSP corresponding to the loopback interface route of the egress node device on the device, and establishing an LSP corresponding to the route by using the LSP corresponding to the loopback interface route of the egress node device.
The routing device further comprises: a third establishing module 15, configured to, when an LSP corresponding to a loopback interface route of the egress node device is not established on the device, search, according to an SPF tree, a farthest whole label switch router LSR on a path from the device to the egress node device, and establish, by using the LSP corresponding to the loopback interface route of the farthest whole LSR, an LSP corresponding to the route, so that an egress label of the LSP corresponding to the route is a public network general label corresponding to the farthest whole LSR, and a next hop of the LSP corresponding to the route is an LSP corresponding to the loopback interface route of the farthest whole LSR.
The third establishing module 15 is further configured to, on a path from the present device to the egress node device, start backward search from a direct connection of the present device to a next hop of the present device, obtain a device R1 of an LSP corresponding to a first loop-back port route without a device on a path of an SPF tree in the direction of the egress node device, search in the direction from the previous hop of the device R1 to the present device against the path of the SPF tree, obtain a first LSR corresponding to a public network common label, and determine that the LSR is the farthest complete LSR.
The modules of the device can be integrated into a whole or can be separately deployed. The modules can be combined into one module, and can also be further split into a plurality of sub-modules.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present invention may be implemented by hardware, or by software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
Those skilled in the art will appreciate that the drawings are merely schematic representations of one preferred embodiment and that the blocks or flow diagrams in the drawings are not necessarily required to practice the present invention.
Those skilled in the art will appreciate that the modules in the devices in the embodiments may be distributed in the devices in the embodiments according to the description of the embodiments, and may be correspondingly changed in one or more devices different from the embodiments. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
The above-mentioned serial numbers of the present invention are for description only and do not represent the merits of the embodiments.
The above disclosure is only for a few specific embodiments of the present invention, but the present invention is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present invention.