Summary of the invention
The invention provides a kind of BGP route management method, device and system, accept the waste resource that excess BGP route causes, conserve system resources to avoid equipment.
For achieving the above object, the invention provides a kind of BGP route management method, be applied to carry out routing forwarding between the autonomous networks system, comprise at least one BGP local terminal equipment and a BGP opposite equip., comprise the steps:
Local terminal equipment obtains the maximum acceptable BGP number of routes of opposite equip.;
Local terminal equipment judges whether number of routes to be sent surpasses the opposite equip. maximum and can accept the BGP number of routes, continues when not surpassing to send route to opposite equip., otherwise stops to send route to opposite equip. before sending route.
Wherein, the described local terminal equipment step of obtaining the maximum acceptable BGP number of routes of opposite equip. is specially:
Local terminal equipment is can accept the BGP number of routes and realize by obtaining the maximum of carrying in the OPEN message that described opposite equip. sends over.
Wherein, the described maximum of carrying in the OPEN message that opposite equip. sends over of obtaining can be accepted the step of BGP number of routes and is specially: described maximum can be accepted the BGP number of routes and be carried by the optional parameters in the OPEN message, local terminal equipment is by resolving the optional parameters field of described OPEN message, obtaining maximum and can accept the BGP number of routes.
Wherein, the method that described local terminal equipment adopts and opposite equip. is same sends to described opposite end and carries the OPEN message that the local terminal maximum can be accepted the BGP number of routes.
The present invention also provides a kind of management devices of realizing the BGP route of said method, comprising:
Receiving element is used to receive the message that maximum can be accepted the BGP number of routes that carries that opposite equip. sends, and this message is sent to the message parse unit;
The message parse unit, the maximum that is used for parsing from the message that described receiving element sends over opposite equip. can be accepted the BGP number of routes;
Judging unit, be used for before described opposite equip. sends route, judge that the maximum whether number of routes to be sent has surpassed the opposite equip. that the message parse unit resolves goes out can accept the BGP number of routes, then do not continue to send route if surpass, otherwise stop to send route to described opposite equip. to described opposite equip..
Wherein, also comprise:
Memory cell, the maximum that is used to store the opposite equip. that described message parse unit sends over can be accepted the BGP number of routes, and offers described judging unit.
Wherein, also comprise:
Negotiation element, the maximum that is used for consulting to pass through with described opposite equip. can be accepted the BGP number of routes, and negotiation result is sent to message generation unit;
Message generation unit is used for that the maximum that described negotiation element sends can be accepted the BGP number of routes and adds message to and send to transmitting element;
Transmitting element is used for carrying the maximum that can pass through and can accepting the message of BGP number of routes and sends to described opposite equip. what described message generation unit generated, with the acceptable BGP number of routes of the relevant local terminal equipment maximum of notice opposite equip.; In addition, also be used for sending route to described opposite equip..
The present invention also provides a kind of autonomous system that realizes the BGP route of said method and management devices, described BGP local terminal peer device is before BGP opposite end peer device sends route, judge whether local terminal number of routes to be sent can accept the BGP number of routes above the maximum of the described opposite end peer device that obtains in advance, continue when not surpassing to send route, otherwise stop to send route to described opposite end peer device to described opposite end peer device.
Wherein, the management devices that has the BGP route on the described BGP peer device, described management devices comprises:
Receiving element is used to receive the message that maximum can be accepted the BGP number of routes that carries that described opposite end peer device sends, and this message is sent to the message parse unit;
The message parse unit, the maximum that is used for parsing from the message that described receiving element sends described opposite end peer device can be accepted the BGP number of routes;
Judging unit, be used for when described opposite end peer device sends route, judge that desire sends the maximum whether number of routes surpassed the opposite end peer device that the message parse unit resolves goes out and can accept the BGP number of routes, then do not continue to send route if surpass, otherwise stop to send route to described opposite end peer device to described opposite end peer device.
Compared with prior art, the present invention has the following advantages:
By in BGP message, carrying the number of routes limiting parameter, carry out route at transmitting terminal and send restriction, thereby can avoid sending the two-way wasting of resources that excess BGP route causes sender and recipient.In addition, avoided causing BGP to connect interruption repeatedly, protected BGP attachment security and device security effectively because of sending excess BGP route.Need not to change existing realization mechanism during realization, realize simple.
Embodiment
The BGP route management method that the present invention discloses, be the forwarding that is used for route between the autonomous networks system equally, wherein this system comprises at least one BGP local terminal equipment and a BGP opposite equip., when carrying out routing forwarding, compared with prior art, the present invention will carry out following steps:
Step s101, local terminal equipment obtain the maximum acceptable BGP number of routes of opposite equip..
Step s102, local terminal equipment judge whether number of routes to be sent surpasses the opposite equip. maximum and can accept the BGP number of routes before sending route, carry out step s103 when not surpassing, otherwise carry out step s104.
Step s103, local terminal equipment continue to send route to opposite equip..
Step s104, local terminal equipment stop to send route to opposite equip..
In specific implementation of the present invention, the negotiation of the maximum acceptable BGP number of routes of local terminal equipment and opposite equip. is to carry out in the prior art the OPEN message.After host-host protocol (BGP) connected between local terminal equipment and opposite equip., first message that this two equipment room sends was OPEN message, and two equipment carry out the negotiation of ability by this OPEN message.The concrete grammar that the present invention proposes is exactly newly-increased TLV (Type/Length/Value in OPEN message, type) option field, in this field contents, carry the maximum BGP route of the local terminal equipment N that limits the number, in the OPEN interacting message, announce to the opposite end.
The form of the OPEN message of stipulating in the prior art mainly comprises following field as shown in Figure 2:
Version (version): 1 byte signless integer is represented protocol of messages version number.
My Autonomous System (my autonomous system): 2 byte signless integers indications sender autonomous system number.
Hold Time (retention time): the signless integer of 2 bytes has been indicated the second number of the Hold timer of sender's expectation.After receiving OPEN message, the BGP sender must use the Hold timer of configuration and the Hold timer received calculates the value of Hold timer.The Hold timer is necessary for 0 or minimum 3 seconds.The recipient can refuse to connect according to the Hold timer.Calculate good value and indicated the maximum number of seconds that between continuous KEEPALIVE and/or UPDATE message, can pass.
BGP Identifier (BGP identifier): 4 byte signless integers have been indicated BGP sender's indications.BGP sender operated by rotary motion BGP indications is the IP address, promptly determines the BGP identifier when starting, and is the same to each local port with each opposite end.
OP Length (optional parameters length): the byte total length in 1 byte signless integer indication optional parameters territory.If this territory is 0, illustrating does not have optional parameters.
Optional Parameters (optional parameters): this territory has comprised the optional parameters inventory, and each parameter coding is<Type (parameter type) Length (parameter length), Value (parameter value)〉tlv triple.Wherein, the length of Type (parameter type) is 1 byte, has clearly indicated the type of parameter.The length of Length (parameter length) is 1 son joint, has represented the byte length of parameter value, and Value (parameter value) is elongated territory, comprises different contents according to parameter type.
The present invention defines a new TLV field, concrete<Type (parameter type), Length (parameter length), Value (parameter value)〉tlv triple numerical value is as follows:
The length of Type is 1 byte, is set at 48, is 30 with hexadecimal representation in message, is expressed as Route Limit Optional Parameter (route restriction optional parameters);
The length of Length is a byte, according to the physical length of Value, if Value accounts for 4 bytes, is 04 with hexadecimal representation in message then;
The length of Value is 4 bytes, and setting range is 0~FFFFFFFE, represents maximum acceptable BGP number of routes, and corresponding decimal system numerical value is 0~4294967295.
When using BGP OPEN message described in the invention, the flow process that the BGP route is managed is an example with local terminal equipment as shown in Figure 3, comprises the steps:
Step s301, local terminal equipment and opposite equip. are consulted maximum by OPEN message can accept the BGP number of routes.
Step s302, local terminal equipment receive the OPEN message that opposite equip. sends, and carry the maximum that opposite equip. sets and can accept the BGP number of routes in OPEN message.
The maximum that step s303, local terminal equipment send opposite equip. can be accepted the BGP number of routes and store.
Step s304, local terminal equipment send in the routing procedure, check that desire sends number of routes and whether can accept the BGP number of routes above maximum, then do not carry out step s305 if surpass, otherwise stop to send.
Step s305, local terminal equipment continue to send route to opposite equip..
Need to prove, in above-mentioned steps s302, local terminal equipment is except that the maximum BGP number of routes OPEN message of carrying the opposite equip. setting that receives the opposite equip. transmission, also send the OPEN message of the maximum BGP number of routes of carrying the local terminal apparatus settings to opposite equip., opposite equip. is also controlled according to the number of routes that the flow process subtend local terminal equipment of above-mentioned steps s303~s305 sends, and realizes the management to the BGP route.This local terminal equipment and opposite equip. are adjacent bgp peer.
By the BGP management method of using the foregoing description to provide, in BGP message, carry the number of routes limiting parameter, carry out route at transmitting terminal and send restriction, thereby can avoid sending the two-way wasting of resources that excess BGP route causes sender and recipient.In addition, avoided causing BGP to connect interruption repeatedly, protected BGP attachment security and device security effectively because of sending excess BGP route.Need not to change current mechanism during realization, realize simple.
The present invention also provides a kind of management devices of BGP route, be applied between BGP autonomous networks system, wherein comprise 1 local terminal BGP routing management device and 1 opposite end BGP routing management device in this BGP autonomous networks system at least, below be example with local terminal BGP routing management device, its structure comprises as shown in Figure 4: negotiation element 10, message generation unit 20, transmitting element 30, receiving element 40, message parse unit 50, memory cell 60 and judging unit 70.As follows to each cell descriptions:
Wherein, negotiation element 10 is used for consulting maximum with opposite end BGP routing management device by OPEN message and can accepts the BGP number of routes, and negotiation result is sent to message generation unit 20.
Message generation unit 20 is used for that the maximum that local terminal negotiation element 10 sends can be accepted the BGP number of routes and adds OPEN message to, and sends to local terminal transmitting element 30.
Transmitting element 30 is used for sending to opposite end BGP routing management device carrying the OPEN message that maximum can accept the BGP number of routes, and the maximum acceptable BGP number of routes of notice opposite end BGP routing management device local terminal BGP routing management device; This transmitting element also is used for sending route to the opposite end in addition.
Receiving element 40 is used to receive the OPEN message that maximum can be accepted the BGP number of routes that carries that opposite end BGP routing management device sends, and this OPEN message is sent to local terminal message parse unit 50.
Message parse unit 50, the maximum that is used for parsing from OPEN message opposite end BGP routing management device can be accepted the BGP number of routes, and sends to memory cell 60.
Memory cell 60, the maximum that is used for the opposite end BGP routing management device of storing message resolution unit 50 transmissions can be accepted the BGP number of routes, and offers judging unit 70.
Judging unit 70, be used for before opposite end BGP routing management device sends route, judge that the maximum whether number of routes to be sent has surpassed in the memory cell 60 the opposite end BGP routing management device of storage can accept the BGP number of routes, then do not continue to send route to the opposite end if surpass, otherwise stop to send route to the opposite end by transmitting element 30.
The present invention also provides a kind of autonomous system that adopts the BGP route of said method, comprise at least two BGP peer devices, wherein, BGP local terminal peer device is before BGP opposite end peer device sends route, judge whether number of routes to be sent can accept the BGP number of routes above the maximum of the opposite end peer device that sets in advance, continue when not surpassing to send route, otherwise stop to send route to the opposite end peer device to described opposite end peer device.The management devices that has the BGP route on each BGP peer device, the structure of this management devices is not repeated in this description at this as shown in Figure 4.
By using the methods, devices and systems of the BGP routing management that the foregoing description provides, by in BGP message, carrying the number of routes limiting parameter, carry out route at transmitting terminal and send numerical limitations, thereby can avoid on local terminal equipment because of sending the two-way wasting of resources that excess BGP route causes sending ending equipment and receiving terminal equipment.In addition; also avoided causing being connected repeatedly and interruption between BGP local terminal equipment and opposite equip. because of local terminal equipment sends excess BGP route; the attachment security of protecting the BGP equipment room effectively is with stable; and because the present invention only can accept the BGP number of routes by the maximum of carrying setting in OPEN message; thereby need not to change existing realization mechanism when realizing, realize simple.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential general hardware platform, can certainly pass through hardware, or realizes with the form of software product merely.Any those skilled in the art can think variation all should fall into protection scope of the present invention.