CN110730127A - BGP session establishing method, device and computer storage medium - Google Patents
BGP session establishing method, device and computer storage medium Download PDFInfo
- Publication number
- CN110730127A CN110730127A CN201910811196.5A CN201910811196A CN110730127A CN 110730127 A CN110730127 A CN 110730127A CN 201910811196 A CN201910811196 A CN 201910811196A CN 110730127 A CN110730127 A CN 110730127A
- Authority
- CN
- China
- Prior art keywords
- connection
- bgp
- connection request
- equipment
- session
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/302—Route determination based on requested QoS
- H04L45/308—Route determination based on user's profile, e.g. premium users
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/02—Topology update or discovery
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/02—Topology update or discovery
- H04L45/04—Interdomain routing, e.g. hierarchical routing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/30—Routing of multiclass traffic
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a BGP session establishing method, a device and a computer storage medium, wherein the method comprises the following steps: distributing a preset number of AS numbers of the connection devices for the connection request devices, setting the priority levels of connection between the preset number of AS numbers of the connection devices and the connection request devices, and interconnecting and establishing session connection between the AS numbers of the connection devices and BGP addresses corresponding to the first connection levels in the priority level list and the connection request device BGP addresses and AS numbers of the connection request devices; and when the session connection is abnormal, establishing new session connection according to the information of the next ranking connection level in the priority level form. The invention configures the AS numbers and BGP addresses corresponding to a plurality of service connection devices for the connection request device, prevents the reconnection from needing to wait for a longer time when the connection request device is disconnected with the current service connection device, can rapidly switch the AS numbers and BGP addresses corresponding to the service connection devices, and improves the service processing efficiency.
Description
Technical Field
The present invention relates to the technical field of BGP session processing, and in particular, to a BGP session establishment method, apparatus, and computer storage medium.
Background
BGP (Border Gateway Protocol) is a dynamic routing Protocol used by network devices between different ASs (Autonomous systems) to exchange routing information. Network administrators may use a variety of means to control the establishment of BGP sessions and the transfer of routing information. The conventional BGP connection requires a network administrator to manually set an address of the peer device, then establish a TCP (Transmission Control Protocol) connection, and establish a BGP session based on the TCP connection.
The BGP protocol has been widely applied to enterprise networks, but in the event of abnormal session connection, it needs to wait for a long time to reconnect, and there is no effective measure to solve the above situation, which causes service interruption.
Disclosure of Invention
The invention provides a BGP session establishing method, a BGP session establishing device and a computer storage medium, aiming at the defects of the prior art.
The technical scheme for solving the technical problems is as follows: a BGP session establishment method comprises the following steps:
receiving a registration request message of a connection request device, wherein the registration request message carries a connection request device BGP address and a connection request device AS number;
distributing a preset number of connection devices for the connection request device, obtaining corresponding AS numbers of the connection devices according to the connection devices, setting the priority levels of connection establishment between the AS numbers of the connection devices and the connection request device, obtaining a priority level list, generating registration confirmation messages by the AS numbers of the connection devices and BGP addresses of the connection devices corresponding to the AS numbers, and sending the registration confirmation messages to the connection request device;
interconnecting according to the connection equipment AS number and connection equipment BGP address corresponding to the first connection level in the priority level list and the connection request equipment BGP address and connection request equipment AS number of the connection request equipment, and establishing session connection between the router of the connection request equipment and the router of the connection equipment based on a BGP protocol when the interconnection is successful;
and monitoring whether the session connection is abnormal in real time, if so, interconnecting the connection request equipment BGP address and the connection request equipment AS number of the connection request equipment according to the connection equipment AS number and the connection equipment BGP address corresponding to the next ranked connection level in the priority level list, and establishing new session connection.
Another technical solution of the present invention for solving the above technical problems is as follows: a BGP session establishment apparatus, comprising:
a receiving module, configured to receive a registration request message of a connection request device, where the registration request message carries a connection request device BGP address and a connection request device AS number;
the processing module is used for distributing a preset number of connection devices for the connection request device, obtaining corresponding AS numbers of the connection devices according to the connection devices, setting the priority levels of connection establishment between the AS numbers of the connection devices and the connection request device, obtaining a priority level list, generating registration confirmation messages by the AS numbers of the connection devices and the BGP addresses of the connection devices corresponding to the AS numbers, and sending the registration confirmation messages to the connection request device;
a session establishing module, configured to interconnect according to the connection device AS number and the connection device BGP address corresponding to the first connection level in the priority level table, and the connection request device BGP address and the connection request device AS number of the connection request device, and establish session connection between the router of the connection request device and the router of the connection device based on a BGP protocol when the interconnection is successful;
and the system is also used for monitoring whether the session connection is abnormal in real time, if so, the system is interconnected with the connection request equipment BGP address and the connection request equipment AS number of the connection request equipment according to the connection equipment AS number and the connection equipment BGP address corresponding to the next ranked connection level in the priority level list, and new session connection is established.
Another technical solution of the present invention for solving the above technical problems is as follows: a BGP session establishment apparatus comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program, when executed by the processor, implementing the BGP session establishment method as described above.
Another technical solution of the present invention for solving the above technical problems is as follows: a computer readable storage medium storing a computer program which, when executed by a processor, implements a BGP session establishment method as described above.
The invention has the beneficial effects that: the AS numbers and the BGP addresses corresponding to the service connection devices are configured for the connection request device, so that the situation that the connection request device needs to wait for a long time to reconnect when being disconnected with the current service connection device is prevented, the AS numbers and the BGP addresses corresponding to the service connection devices can be rapidly switched, and the service processing efficiency is improved.
Drawings
Fig. 1 is a schematic flowchart of a BGP session establishment method according to an embodiment of the present invention;
fig. 2 is a block diagram of a BGP session establishment apparatus according to an embodiment of the present invention.
Detailed Description
The principles and features of this invention are described below in conjunction with the following drawings, which are set forth by way of illustration only and are not intended to limit the scope of the invention.
Fig. 1 is a schematic flowchart of a BGP session establishment method according to an embodiment of the present invention;
as shown in fig. 1, a BGP session establishment method includes the following steps:
receiving a registration request message of a connection request device, wherein the registration request message carries a connection request device BGP address and a connection request device AS number;
distributing a preset number of connection devices for the connection request device, obtaining corresponding AS numbers of the connection devices according to the connection devices, setting the priority levels of connection establishment between the AS numbers of the connection devices and the connection request device, obtaining a priority level list, generating registration confirmation messages by the AS numbers of the connection devices and BGP addresses of the connection devices corresponding to the AS numbers, and sending the registration confirmation messages to the connection request device;
interconnecting according to the connection equipment AS number and connection equipment BGP address corresponding to the first connection level in the priority level list and the connection request equipment BGP address and connection request equipment AS number of the connection request equipment, and establishing session connection between the router of the connection request equipment and the router of the connection equipment based on a BGP protocol when the interconnection is successful;
and monitoring whether the session connection is abnormal in real time, if so, interconnecting the connection request equipment BGP address and the connection request equipment AS number of the connection request equipment according to the connection equipment AS number and the connection equipment BGP address corresponding to the next ranked connection level in the priority level list, and establishing new session connection.
Specifically, the connection device AS numbers and the connection device BGP addresses corresponding to the multiple connection levels are sorted in the priority level table according to a predetermined order. The ordering rule may be ordering according to the stability of the service connection device or ordering according to the data transmission speed of the service connection device.
It should be understood that the device corresponding to the first connection level is the primary service connection device, and the device corresponding to the connection level after the first is the standby service connection device.
In the above embodiment, the AS numbers and BGP addresses corresponding to the multiple service connection devices are configured for the connection request device, so that it is prevented that a longer time is required to wait for reconnection when the connection request device is disconnected from the current service connection device, the AS numbers and BGP addresses corresponding to the service connection devices can be quickly switched, and the service processing efficiency is improved.
Optionally, as an embodiment of the present invention, the process of establishing a new session connection includes:
generating an update message according to the AS number of the connecting device corresponding to the next ranked connection level in the priority level form and the BGP address of the connecting device corresponding to the AS number, and sending the update message to the connection request device;
when the updating message is successfully sent, establishing new session connection;
and when the establishment of the new session connection is completed, disconnecting the original session connection.
It should be understood that, when the new session connection is unsuccessful, the connection device AS number corresponding to the next ranked connection level and the connection device BGP address corresponding to the next ranked connection level may be continuously selected from the priority level table for the new session connection. The update message is sent to the connection request equipment, so that the new session connection can be established quickly, and after the new session connection is established, the original session connection is disconnected, thereby preventing service interruption.
Specifically, the original session disconnection process includes that the connection device generates a notification message and sends the notification message to the connection request device of the opposite terminal, and the original session is disconnected according to the notification message.
In the above embodiment, the validity of the connection to the connection request device can be ensured, and the service interruption can be prevented.
Optionally, as an embodiment of the present invention, the process of monitoring whether the session connection is abnormal in real time includes:
and if the router of the connection request equipment does not receive the data sent by the router of the connection request equipment within the preset time length, or if the router of the connection request equipment does not receive the data sent by the router of the connection request equipment within the preset time length, the connection is abnormal.
In the embodiment, whether the abnormal connection condition occurs can be timely and effectively monitored.
Optionally, as an embodiment of the present invention, when the original session is disconnected, the method further includes the steps of:
and deleting the AS number of the connecting equipment corresponding to the abnormal connection level and the BGP address of the connecting equipment corresponding to the abnormal connection level from the priority level list.
In the above embodiment, the AS number of the connection device and the BGP address of the abnormal connection are deleted in time, so AS to prevent the abnormal device from being repeatedly connected.
Optionally, AS an embodiment of the present invention, when deleting the AS number of the connecting device and the BGP address corresponding to the AS number, the method further includes:
and judging whether the number of the residual AS numbers of the connecting devices in the priority level form is smaller than a preset number, if so, generating alarm information, and sending the alarm information to a designated terminal, wherein the alarm information comprises the information of the residual AS numbers of the connecting devices and the corresponding BGP addresses of the connecting devices.
It should be understood that when the number of the remaining AS numbers of the connection devices in the priority level table is too small, the designated terminal may be notified to process in time, and add a new AS number of the connection device and a BGP address of the connection device, so AS to prevent a service interruption.
Fig. 2 is a block diagram of a BGP session establishment apparatus according to an embodiment of the present invention.
Optionally, as another embodiment of the present invention, as shown in fig. 2, a BGP session establishment apparatus includes:
a receiving module, configured to receive a registration request message of a connection request device, where the registration request message carries a connection request device BGP address and a connection request device AS number;
the processing module is used for distributing a preset number of connection devices for the connection request device, obtaining corresponding AS numbers of the connection devices according to the connection devices, setting the priority levels of connection establishment between the AS numbers of the connection devices and the connection request device, obtaining a priority level list, generating registration confirmation messages by the AS numbers of the connection devices and the BGP addresses of the connection devices corresponding to the AS numbers, and sending the registration confirmation messages to the connection request device;
a session establishing module, configured to interconnect according to the connection device AS number and the connection device BGP address corresponding to the first connection level in the priority level table, and the connection request device BGP address and the connection request device AS number of the connection request device, and establish session connection between the router of the connection request device and the router of the connection device based on a BGP protocol when the interconnection is successful;
and the system is also used for monitoring whether the session connection is abnormal in real time, if so, the system is interconnected with the connection request equipment BGP address and the connection request equipment AS number of the connection request equipment according to the connection equipment AS number and the connection equipment BGP address corresponding to the next ranked connection level in the priority level list, and new session connection is established.
Optionally, as an embodiment of the present invention, the session establishing module is specifically configured to:
generating an updating message according to the AS number of the connecting equipment corresponding to the next ranking connection level in the priority level form and the BGP address of the connecting equipment corresponding to the AS number, and sending the updating message to the connection request equipment;
when the updating message is successfully sent, establishing new session connection;
and when the establishment of the new session connection is completed, disconnecting the original session connection.
Optionally, as an embodiment of the present invention, the apparatus further includes a deletion module, configured to:
and when the original session is disconnected, deleting the AS number corresponding to the abnormal connection level and the BGP address corresponding to the AS number from the priority level list.
Optionally, as an embodiment of the present invention, the system further includes an early warning module, configured to:
and judging whether the number of the residual AS numbers of the connecting devices in the priority level form is smaller than a preset number, if so, generating alarm information, and sending the alarm information to a designated terminal, wherein the alarm information comprises the information of the residual AS numbers of the connecting devices and the corresponding BGP addresses of the connecting devices.
As another embodiment of the present invention, a BGP session establishment apparatus includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the BGP session establishment apparatus implements the BGP session establishment method described above. The device may be a computer or the like.
As an embodiment of the present invention, a computer-readable storage medium stores a computer program which, when executed by a processor, implements a BGP session establishment method as described above.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
While the invention has been described with reference to specific embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A BGP session establishment method is characterized by comprising the following steps:
receiving a registration request message of a connection request device, wherein the registration request message carries a connection request device BGP address and a connection request device AS number;
distributing a preset number of connection devices for the connection request device, obtaining corresponding AS numbers of the connection devices according to the connection devices, setting priority levels of connection between the AS numbers of the connection devices and the connection request device, obtaining a priority level list, generating registration confirmation messages by the AS numbers of the connection devices and BGP addresses of the connection devices corresponding to the AS numbers, and sending the registration confirmation messages to the connection request device;
interconnecting according to the connection equipment AS number and connection equipment BGP address corresponding to the first connection level in the priority level list and the connection request equipment BGP address and connection request equipment AS number of the connection request equipment, and establishing session connection between the router of the connection request equipment and the router of the connection equipment based on a BGP protocol when the interconnection is successful;
and monitoring whether the session connection is abnormal in real time, if so, interconnecting the connection request equipment BGP address and the connection request equipment AS number of the connection request equipment according to the connection equipment AS number and the connection equipment BGP address corresponding to the next ranked connection level in the priority level list, and establishing new session connection.
2. The BGP session establishment method according to claim 1, wherein said process of establishing a new session connection includes:
generating an updating message according to the AS number of the connecting equipment corresponding to the next ranking connection level in the priority level form and the BGP address of the connecting equipment corresponding to the AS number, and sending the updating message to the connection request equipment;
when the updating message is successfully sent, establishing new session connection;
and when the establishment of the new session connection is completed, disconnecting the original session connection.
3. The BGP session establishment method according to claim 2, further comprising, when the original session is disconnected, the steps of:
and deleting the AS number of the connecting equipment corresponding to the abnormal connection level and the BGP address of the connecting equipment corresponding to the abnormal connection level from the priority level list.
4. The BGP session establishment method according to claim 1, wherein the process of monitoring in real time whether the session connection is abnormal includes:
and if the router of the connection request equipment does not receive the data sent by the router of the connection request equipment within the preset time length, or the router of the connection request equipment does not receive the data sent by the router of the connection request equipment within the preset time length, the connection is abnormal.
5. The BGP session establishment method of claim 4, wherein, when deleting the AS number of the connected device and its corresponding BGP address, further comprising the steps of:
and judging whether the number of the residual AS numbers of the connecting devices in the priority level form is smaller than a preset number, if so, generating alarm information, and sending the alarm information to a designated terminal, wherein the alarm information comprises the information of the residual AS numbers of the connecting devices and the corresponding BGP addresses of the connecting devices.
6. A BGP session establishment apparatus, comprising:
a receiving module, configured to receive a registration request message of a connection request device, where the registration request message carries a connection request device BGP address and a connection request device AS number;
the processing module is used for distributing a preset number of connection devices for the connection request device, obtaining corresponding AS numbers of the connection devices according to the connection devices, setting the priority levels of connection establishment between the AS numbers of the connection devices and the connection request device, obtaining a priority level list, generating registration confirmation messages by the AS numbers of the connection devices and the BGP addresses of the connection devices corresponding to the AS numbers, and sending the registration confirmation messages to the connection request device;
a session establishing module, configured to interconnect according to the connection device AS number and the connection device BGP address corresponding to the first connection level in the priority level table, and the connection request device BGP address and the connection request device AS number of the connection request device, and establish session connection between the router of the connection request device and the router of the connection device based on a BGP protocol when the interconnection is successful;
and the system is also used for monitoring whether the session connection is abnormal in real time, if so, the system is interconnected with the connection request equipment BGP address and the connection request equipment AS number of the connection request equipment according to the connection equipment AS number and the connection equipment BGP address corresponding to the next ranked connection level in the priority level list, and new session connection is established.
7. The BGP session establishment apparatus of claim 6, wherein the session establishment module is specifically configured to:
generating an updating message according to the AS number of the connecting equipment corresponding to the next ranking connection level in the priority level form and the BGP address of the connecting equipment corresponding to the AS number, and sending the updating message to the connection request equipment;
when the updating message is successfully sent, establishing new session connection;
and when the establishment of the new session connection is completed, disconnecting the original session connection.
8. The BGP session establishment apparatus of claim 6, further comprising a deletion module for:
and when the original session is disconnected, deleting the AS number corresponding to the abnormal connection level and the BGP address corresponding to the AS number from the priority level list.
9. A BGP session establishment apparatus comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that when the computer program is executed by the processor, the BGP session establishment method according to any of claims 1 to 5 is implemented.
10. A computer-readable storage medium storing a computer program, the computer program, when executed by a processor, implementing the BGP session establishment method according to any of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910811196.5A CN110730127A (en) | 2019-08-30 | 2019-08-30 | BGP session establishing method, device and computer storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910811196.5A CN110730127A (en) | 2019-08-30 | 2019-08-30 | BGP session establishing method, device and computer storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110730127A true CN110730127A (en) | 2020-01-24 |
Family
ID=69218875
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910811196.5A Withdrawn CN110730127A (en) | 2019-08-30 | 2019-08-30 | BGP session establishing method, device and computer storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110730127A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113301097A (en) * | 2020-12-30 | 2021-08-24 | 阿里巴巴集团控股有限公司 | Data transmission method and device |
-
2019
- 2019-08-30 CN CN201910811196.5A patent/CN110730127A/en not_active Withdrawn
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113301097A (en) * | 2020-12-30 | 2021-08-24 | 阿里巴巴集团控股有限公司 | Data transmission method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2321908B1 (en) | Method and system for message processing | |
US8908603B2 (en) | MME restoration | |
EP3544232B1 (en) | Processing method, device and system for nf component abnormality | |
CN111510325B (en) | Alarm information pushing method, server, client and system | |
CN109495530B (en) | Real-time traffic data transmission method, transmission device and transmission system | |
US10931529B2 (en) | Terminal device management method, server, and terminal device for managing terminal devices in local area network | |
CN110932876B (en) | Communication system, method and device | |
EP2587774B1 (en) | A method for sip proxy failover | |
CN107707689A (en) | A kind of DHCP message processing method, Dynamic Host Configuration Protocol server and gateway device | |
EP1652352A1 (en) | System and method for path failure recovery in a communications environment | |
CN113037599A (en) | Message processing method, device and storage medium | |
WO2017000625A1 (en) | Dynamic host configuration protocol (dhcp) server management method and apparatus | |
CN110730127A (en) | BGP session establishing method, device and computer storage medium | |
CN111092934A (en) | Method for updating client routing and storage medium | |
CN108667640B (en) | Communication method and device, and network access system | |
CN110198221A (en) | A kind of implementation method of load balancing, apparatus and system | |
CN116545840A (en) | Communication mode determining method and device | |
CN113821342B (en) | Method, device, equipment and readable medium for balancing cluster websocket service load | |
CN113890885B (en) | Internet of things control method and device for industrial personal computer and computer readable medium | |
CN110572290B (en) | Master device determination method, master device determination device, electronic device, storage medium, and network system | |
KR101407597B1 (en) | System and method for providing push service | |
JP7261759B2 (en) | Alive monitoring method between planes in mobile communication network, PGW-C and program | |
CN110890989A (en) | Channel connection method and device | |
CN114745221B (en) | Modbus communication system and communication method | |
CN110011914B (en) | Management message forwarding method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20200124 |