Summary of the invention
In view of this, the invention provides a kind of BGP route processing method, the mutual of update message between neighbours can be greatly reduced when large routing neighbor frequently shakes, effectively reduces the burden of CPU.
Present invention also offers a kind of BGP routing device, the mutual of update message between neighbours can be greatly reduced when large routing neighbor frequently shakes, effectively reduces the burden of CPU.
In order to achieve the above object, the technical scheme that the present invention proposes is:
A kind of Border Gateway Protocol (BGP) route processing method, be applied to employ BGP routing device between, the method comprises:
First routing device receives the neighbours that can consult BGP router ID ability sent by secondary route equipment and the 3rd routing device respectively and sets up request message and the neighbours that can consult BGP router ID ability set up request message sends to secondary route equipment and the 3rd routing device respectively, to set up bgp neighbor;
First routing device receives the route updating packet comprising secondary route equipment B GP router ID sent by secondary route equipment, is carried in the route updating packet received by the BGP router ID of self and sends to the 3rd routing device;
When the first via is shaken by the neighbours of device-aware and secondary route equipment room, after the invalid route received from secondary route equipment, send to the 3rd routing device and produce for cancelling the route withdraw message that neighbours shake route, the BGP router ID of the first routing device and secondary route equipment is comprised in described route withdraw message, when the BGP router ID in the described route withdraw message that the 3rd routing device receives mates with the BGP router ID in route updating packet, the route of being shaken by the invalid described generation neighbours of the 3rd routing device.
After the invalid route received from secondary route equipment of described first routing device, the method also comprises: the first routing device arranges the timing of the route of invalid described generation neighbours concussion;
After the route of described 3rd routing device invalid described generation neighbours concussion, the method also comprises: the 3rd routing device arranges the timing of the route of invalid described generation neighbours concussion.
In described timing, when the route of described generation neighbours concussion is not updated, the described first via is by the route producing neighbours' concussion described in device revocation.
In described timing, described generation neighbours concussion routing update time,
Described first routing device receives the route resend by secondary route equipment;
When the route that described first routing device receives again is identical with the route that the described neighbours of generation are shaken, sending to described 3rd routing device the route updating packet for upgrading comprising the first routing device and secondary route equipment B GP router ID, making the 3rd routing device using the route of this renewal as normal route processing;
When the route that described first routing device receives again is less than the route of described generation neighbours concussion, for the route do not had in the route again received in invalid route, described first routing device sends the route withdraw message for cancelling these routes to the 3rd routing device; For the route had in the route again received in invalid route, described first routing device sends the route updating packet for upgrading comprising the first routing device and secondary route equipment B GP router ID to the 3rd routing device, make the 3rd routing device using these routes upgraded as normal route processing;
When the route that the route that described first routing device receives again is shaken more than described generation neighbours, for the route do not had in route invalid in the route again received, described first routing device sends the route updating packet for upgrading these routes to the 3rd routing device; For the route had in route invalid in the route again received, described first routing device sends the route updating packet for upgrading comprising the first routing device and secondary route equipment B GP router ID to the 3rd routing device, make the 3rd routing device using these routes upgraded as normal route processing.
Described neighbours are set up request message and are sent by OPEN message, and described route updating packet and route withdraw message are sent by update message.
A kind of Border Gateway Protocol (BGP) routing device, this routing device is applied to as the first routing device and employs in the network of BGP, secondary route equipment and the 3rd routing device is also comprised in described network, this routing device comprises neighbours and sets up unit, routing update unit and route invalid unit, wherein
Described neighbours set up unit, request message is set up and the neighbours that can consult BGP router ID ability set up request message sends to secondary route equipment and the 3rd routing device respectively, to set up bgp neighbor for receiving the neighbours that can consult BGP router ID ability sent by secondary route equipment and the 3rd routing device;
Described routing update unit, for receive by secondary route equipment send comprise the route updating packet of secondary route equipment B GP router ID after, the BGP router ID of self is carried in the route updating packet received and sends to the 3rd routing device;
Described route invalid unit, when the neighbours establishing the secondary route equipment room of bgp neighbor for setting up unit as self perception and described neighbours are shaken, after the invalid route received from secondary route equipment, send to the 3rd routing device and produce for cancelling the route withdraw message that neighbours shake route, the BGP router ID of self and secondary route equipment is comprised in described route withdraw message, when the BGP router ID of the described route withdraw message that the 3rd routing device receives mates with the BGP router ID of the route updating packet received in routing update unit, the route of being shaken by the invalid described generation neighbours of the 3rd routing device.
This routing device also comprises set of time unit, for arranging the timing of the route of described route invalid unit invalid described generation neighbours concussion.
This routing device also comprises route withdraw unit, in the timing of described set of time unit setting, when the route of described generation neighbours concussion is not updated, cancels the route of the invalid generation neighbours concussion of described route invalid unit.
Described routing update unit, also in the timing of described set of time unit setting, when the route of described generation neighbours concussion is updated, receives the route resend by secondary route equipment;
When the route again received is identical with the route that the described neighbours of generation are shaken, sending to described 3rd routing device the route updating packet for upgrading comprising the first routing device and secondary route equipment B GP router ID, making the 3rd routing device using the route of this renewal as normal route processing;
When the route that described first routing device receives again is less than the route of described generation neighbours concussion, for the route do not had in the route again received in route invalid in described route invalid unit, described first routing device sends the route withdraw message for cancelling these routes to the 3rd routing device; For the route had in the route again received in route invalid in described route invalid unit, described first routing device sends the route updating packet for upgrading comprising the first routing device and secondary route equipment B GP router ID to the 3rd routing device, make the 3rd routing device using these routes upgraded as normal route processing;
When the route that the route that described first routing device receives again is shaken more than described generation neighbours, for the route do not had in route invalid in route invalid unit described in the route again received, described first routing device sends the route updating packet for upgrading these routes to the 3rd routing device; For the route had in route invalid in route invalid unit described in the route again received, described first routing device sends the route updating packet for upgrading comprising the first routing device and secondary route equipment B GP routere ID to the 3rd routing device, make the 3rd routing device using these routes upgraded as normal route processing.
Described neighbours are set up request message and are sent by OPEN message, and described route updating packet and route withdraw message are sent by update message.
In sum, BGP route processing method of the present invention and BGP routing device, by when setting up bgp neighbor, the BGP router ID ability of carrying and can consult each routing device is set up in request message to set up neighbours neighbours, after neighbours have set up, the BGP routerID of self can be sent to bgp neighbor by route updating packet, and then between routing device, there are neighbours when shaking, the BGP router ID also carrying routing device in route message is cancelled what send, and when BGP router ID mates with BGP router ID received during routing update, the i.e. route of invalid described generation neighbours concussion.Because BGP route processing method of the present invention can the route of invalid generation neighbours concussion, thus route updating packet and route withdraw message mutual between neighbours when neighbours are shaken frequently under also just decreasing large route, thus effectively reduce the burden of CPU.
Embodiment
In order to solve the technical problem that the present invention proposes, the specific implementation of scheme of the present invention comprises:
First routing device receives the neighbours that can consult BGP router ID ability sent by secondary route equipment and the 3rd routing device respectively and sets up request message and the neighbours that can consult BGP router ID ability set up request message sends to secondary route equipment and the 3rd routing device respectively, to set up bgp neighbor; First routing device receives the route updating packet comprising secondary route equipment B GP router ID sent by secondary route equipment, is carried in the route updating packet received by the BGP router ID of self and sends to the 3rd routing device; When the first via is shaken by the neighbours of device-aware and secondary route equipment room, after the invalid route received from secondary route equipment, send to the 3rd routing device and produce for cancelling the route withdraw message that neighbours shake route, the BGP router ID of the first routing device and secondary route equipment is comprised in described route withdraw message, when the BGP router ID in the described route withdraw message that the 3rd routing device receives mates with the BGP router ID in route updating packet, the route of being shaken by the invalid described generation neighbours of the 3rd routing device.
For making the object, technical solutions and advantages of the present invention clearly, the present invention is described in further detail below in conjunction with the accompanying drawings and the specific embodiments.
Fig. 2 is the workflow diagram of BGP route processing method of the present invention.This flow process is set up neighborhood to illustrate with these three routing devices of the first routing device, secondary route equipment and the 3rd routing device, and as shown in Figure 2, this flow process comprises:
Step 201: the first routing device receives the neighbours that can consult BGP router ID ability sent by secondary route equipment and the 3rd routing device respectively and sets up request message and the neighbours that can consult BGP router ID ability set up request message sends to secondary route equipment and the 3rd routing device respectively, to set up bgp neighbor.
It should be noted that, in this step, described neighbours are set up request message and are sent by OPEN message.
Step 202: first routing device receive by secondary route equipment send comprise the route updating packet of secondary route equipment B GP router ID after, the BGP router ID of self is carried in the route updating packet received and sends to the 3rd routing device.
In this step, described route updating packet is sent by update message.
Step 203: when the first via is shaken by the neighbours of device-aware and secondary route equipment room, after the invalid route received from secondary route equipment, first routing device sends to the 3rd routing device and produces for cancelling the route withdraw message that neighbours shake route, the BGP router ID of the first routing device and secondary route equipment is comprised in described route withdraw message, when the BGP router ID in the described route withdraw message that the 3rd routing device receives mates with the BGP router ID in route updating packet, the route of being shaken by the invalid described generation neighbours of the 3rd routing device.
Wherein, described route withdraw message is sent by update message.
Step 204: the timing that the route of invalid described generation neighbours concussion is set.
It should be noted that, in this step, after the route received from secondary route equipment when the first routing device is invalid, need the timing of the route that invalid described generation neighbours concussion is set; After the route of the 3rd routing device invalid described generation neighbours concussion, also need the timing of the route that invalid described generation neighbours concussion is set.
Also it should be noted that, described timing is determined according to actual needs, is as the criterion with the realization not affecting the embodiment of the present invention.
Step 205: judge in the timing of described setting, whether the route of invalid described generation neighbours concussion is updated, and if so, performs step 207; Otherwise, perform step 206.
Step 206: in described timing, when the route of described generation neighbours concussion is not updated, the first via is by the route producing neighbours' concussion described in device revocation.
Step 207: in described timing, when the route of described generation neighbours concussion is updated, the first via is by the route producing neighbours' concussion described in renewal of the equipment.
It should be noted that, in this step, the described first via is comprised by the route producing neighbours' concussion described in renewal of the equipment:
Described first routing device receives the route resend by secondary route equipment;
When the route that described first routing device receives again is identical with the route that the described neighbours of generation are shaken, sending to described 3rd routing device the route updating packet for upgrading comprising the first routing device and secondary route equipment B GP router ID, making the 3rd routing device using the route of this renewal as normal route processing;
When the route that described first routing device receives again is less than the route of described generation neighbours concussion, for the route do not had in the route again received in invalid route, described first routing device sends the route withdraw message for cancelling these routes to the 3rd routing device; For the route had in the route again received in invalid route, described first routing device sends the route updating packet for upgrading comprising the first routing device and secondary route equipment B GP router ID to the 3rd routing device, make the 3rd routing device using these routes upgraded as normal route processing;
When the route that the route that described first routing device receives again is shaken more than described generation neighbours, for the route do not had in route invalid in the route again received, described first routing device sends the route updating packet for upgrading these routes to the 3rd routing device; For the route had in route invalid in the route again received, described first routing device sends the route updating packet for upgrading comprising the first routing device and secondary route equipment B GP router ID to the 3rd routing device, make the 3rd routing device using these routes upgraded as normal route processing.
Also it should be noted that, neighbours described in the present embodiment are set up request message and are sent by OPEN message, and described route updating packet and route withdraw message are all sent by update message.
So far, the whole workflow of BGP route processing method of the present invention is namely completed.The specific implementation of the inventive method is described with the structure shown in Fig. 1 below, and wherein, RTB, RTA, RTC are respectively the first routing device, secondary route equipment, the 3rd routing device, and implementation procedure is as follows:
When bgp neighbor is set up, configure enable by order line peer x.x.x.x capability-advertise rid, make the two ends setting up neighbours can both consult BGP router ID ability, and then make the neighbours of successful negotiation BGP router ID ability can bring local BGP router ID when sending route.Be specially: RTB receives the route that RTA starts, BGP router ID sequence is 1.1.1.1, RTC receives the route that RTA starts, BGP router ID sequence is 2.2.2.2,1.1.1.1, RTD receives the route that RTC starts, BGP router ID sequence is 3.3.3.3,2.2.2.2,1.1.1.1.
When bgp neighbor between RTA and RTB shakes, RTB perceives, route withdraw message is sent to RTF, RTC, owing to having consulted BGP router ID ability, when RTB sends route withdraw message to RTC, RTF, BGP router ID sequence (the BGP router ID sequence+local BGP router ID of route) can be carried in described route withdraw message.Thus, after RTC receives the route withdraw message of band BGP router ID sequence, the BGP router ID sequence properties of exact matching local routing, it is invalid that the route of coupling is put, then carry out route withdraw to the route withdraw message of RTD, RTE transmit band BGP router ID sequence.
Further, RTB is for putting invalid route, and start a timer to arrange invalid timing, such as timing can be 5 minutes.Within 5 minutes, the way of escape is by not being updated, and just directly cancelling route, thus, when there being a large amount of route withdraw, greatly reducing the route withdraw message of cancelling route and sending.Accordingly, route put invalid after, within 5 minutes, bgp neighbor between RTA and RTB re-establishes, RTA sends route updating packet to RTB, after RTB receives and upgrades route message, put invalid route with this locality and carry out matching check, there will be three kinds of situations: one, the route that receives from RTA of RTB is completely the same with the route previously received, RTB sends the route updating packet carrying BGP router ID sequence to RTC, RTC receives this route updating packet, is re-set as effectively, as normal route processing by originally putting invalid route; Two, RTB is less than the route previously received from the route that RTA receives, for originally there being the part route not receiving now renewal, first send normal route withdraw message to RTC, RTE cancels part route, after RTC receives route withdraw message, directly by part route withdraw to RTB; RTB also needs to send to RTC the route updating packet carrying BGP router ID sequence, and RTC receives this route updating packet, is re-set as effectively, as normal route processing by originally putting invalid route; Three, the route that receives from RTA of RTB is more than the route previously received, for originally not receiving the part route receiving now renewal, RTB first sends normal route updating packet to RTC, RTE and upgrades part route, after RTB receives normal route updating packet, route processing is received by original normal flow, RTB sends the route updating packet carrying BGP router ID sequence again to RTC, RTC receives this route updating packet, be re-set as effectively, as normal route processing by originally putting invalid route.After above-mentioned process, when there being a large amount of routing update, also greatly reducing and upgrading the route updating packet that sends of route and route withdraw message, also namely adopted here update message.
Also it should be noted that, when there is hypo-optimal route, can be handled as follows when the neighbours of optimum route are shaken:
As can be seen from Figure 1, RTC learns from two paths the route that RTA starts, and one is: RTA, RTB to RTC, and BGP router ID sequence is 2.2.2.2,1.1.1.1; Another is RTA, RTB, RTE, RTF to RTC, and BGP router ID sequence is 6.6.6.6,5.5.5.5,2.2.2.2,1.1.1.1, and the route acquired from RTB is preferential, and sends to RTD.
When neighbours between RTB and RTC are shaken, RTC perception, the route acquired from RTB is put invalidation, and local triggering route is again preferred, the BGP route that traversal is local, if from the route that neighbours' RTF is come, exist and the route of putting invalid route same prefix, then this route preferred, for this part route, RTC sends general update to RTD and upgrades message, RTD receives route updating packet and does routing update process; If from the route that neighbours' RTF is come, do not exist and the route of putting invalid route same prefix, then for this part route, RTC sends the route withdraw message carrying BGP router ID sequence to RTD, RTD receives the route withdraw message carrying BGP router ID sequence, the route of correspondence is put invalidation, and processes after starting timing.
It should be noted that, in the present embodiment, the form of described update message is as shown in table 1 below.
Table 1
Wherein, each field meanings is as follows:
Unfeasible Routes Len:(2 byte signless integer) unreachable route length;
Withdrawn Routes:(is elongated) exit route;
Path Attribute Len:(2 byte signless integer) path attribute is long;
Path Attributes:(is elongated) path attribute;
Network Layer Reachability Information:(is elongated) network can reach information (stay of two nights).
Generally, if route updating packet, Unfeasible Routes Len and the Withdrawn Routes field of update message are 0; If route withdraw message, Path Attribute Len, Path Attributes, the Network Layer Reachability Information field of update message are 0.
Also it should be noted that, in the present embodiment, the update message filling method that the carrying out of carrying BGP router ID sequence cancels route is: Path Attributes field fills in BGP router ID sequence, Unfeasible Routes Len field fills in the length of BGP router ID sequence, and other fields all set to 0; Carrying the update message filling method that BGP router ID sequence carries out routing update is: Path Attributes field fills in BGP router ID sequence, Path Attributes Len field fills in the length of BGP router ID sequence, and other fields all set to 0.
Based on said method, Fig. 3 gives the structural representation of BGP routing device of the present invention.This BGP routing device is applied to as the first routing device and employs in the network of BGP, secondary route equipment and the 3rd routing device is also comprised in described network, this BGP routing device comprises neighbours and sets up unit 31 routing update unit 32 and route invalid unit 33, wherein
Described neighbours set up unit 31, request message is set up and the neighbours that can consult BGP router ID ability set up request message sends to secondary route equipment and the 3rd routing device respectively, to set up bgp neighbor for receiving the neighbours that can consult BGP router ID ability sent by secondary route equipment and the 3rd routing device;
Described routing update unit 32, for receive by secondary route equipment send comprise the route updating packet of secondary route equipment B GP router ID after, the BGP router ID of self is carried in the route updating packet received and sends to the 3rd routing device;
Described route invalid unit 33, neighbours are produced when shaking between the secondary route equipment establishing bgp neighbor for setting up unit 31 as self perception and described neighbours, after the invalid route received from secondary route equipment, send to the 3rd routing device and produce for cancelling the route withdraw message that neighbours shake route, the BGP router ID of self and secondary route equipment is comprised in described route withdraw message, when the BGP router ID in the described route withdraw message that the 3rd routing device receives mates with the BGP router ID in the route updating packet received in routing update unit 32, the route of being shaken by the invalid described generation neighbours of the 3rd routing device.
Further, this routing device also comprises set of time unit 34, for arranging the timing of the route of described route invalid unit 33 invalid described generation neighbours concussion.
Further, this routing device also comprises route withdraw unit 35, for in the timing of described set of time unit 34 setting, when the route of described generation neighbours concussion is not updated, cancel the route of the invalid generation neighbours concussion of described route invalid unit 33.
Further, described routing update unit 32, also in the timing of described set of time unit 34 setting, when the route of described generation neighbours concussion is updated, for receiving the route resend by secondary route equipment;
When the route again received is identical with the route that the described neighbours of generation are shaken, sending to described 3rd routing device the route updating packet for upgrading comprising the first routing device and secondary route equipment B GP router ID, making the 3rd routing device using the route of this renewal as normal route processing;
When the route that described first routing device receives again is less than the route of described generation neighbours concussion, for the route do not had in the route again received in route invalid in described route invalid unit 33, described first routing device sends the route withdraw message for cancelling these routes to the 3rd routing device; For the route had in the route again received in route invalid in described route invalid unit 33, described first routing device sends the route updating packet for upgrading comprising the first routing device and secondary route equipment B GP router ID to the 3rd routing device, make the 3rd routing device using these routes upgraded as normal route processing;
When the route that the route that described first routing device receives again is shaken more than described generation neighbours, for the route do not had in route invalid in route invalid unit 33 described in the route again received, described first routing device sends the route updating packet for upgrading these routes to the 3rd routing device; For the route had in route invalid in route invalid unit 33 described in the route again received, described first routing device sends the route updating packet for upgrading comprising the first routing device and secondary route equipment B GP routere ID to the 3rd routing device, make the 3rd routing device using these routes upgraded as normal route processing.
It should be noted that, in the present embodiment, described neighbours are set up request message and are sent by the OPEN message in BGP, and described route updating packet and route withdraw message are sent by update message.
So far, BGP routing device of the present invention is namely obtained.
In a word, BGP route processing method of the present invention and BGP routing device, by when setting up bgp neighbor, the BGP router ID ability of carrying and can consult each routing device is set up in request message to set up neighbours neighbours, after neighbours have set up, the BGP router ID of self can be sent to bgp neighbor by route updating packet, and then between routing device, there are neighbours when shaking, the BGP router ID also carrying routing device in route message is cancelled what send, and when BGP router ID mates with BGP router ID received during routing update, the i.e. route of invalid described generation neighbours concussion.Because BGP route processing method of the present invention can the route of invalid generation neighbours concussion, thus route updating packet and route withdraw message mutual between neighbours when neighbours are shaken frequently under also just decreasing large route, thus effectively reduce the burden of CPU.
Further, BGP route processing method of the present invention, can also arrange timing for the invalid route producing neighbours' concussion, in described timing, route is not updated, then cancel described invalid route; Otherwise, then described invalid route is again upgraded.Because the inventive method is provided with update time for invalid route, when there being a large amount of route to be updated, route only in timing just can be updated, also greatly reduce and upgrade the mutual of route updating packet needed for route and route withdraw message, thus further reduce the burden of CPU.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within the scope of protection of the invention.