A method, device, and medium for establishing a BGP neighbor

By configuring BPG network segment neighbors and peer groups, and automatically creating BGP neighbors using ARP tables and BGP packets, the problem of complex manual configuration of BGP neighbors is solved, and simple and flexible BGP neighbor management is achieved.

CN119383126BActive Publication Date: 2025-11-28INSPUR NETWORK TECH (SHANDONG) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411520951.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-11-28
Estimated Expiration
2044-10-29

AI Technical Summary

Technical Problem

In BGP networks, changes in network IP addresses or a large number of devices make manual configuration of BGP neighbors complex and error-prone, especially when the network environment is complex and difficult to manage.

Method used

By configuring BPG network segment neighbors, peer groups can be created, and BGP neighbors can be automatically created using ARP tables and BGP open messages, simplifying the configuration process and supporting both active and passive establishment mechanisms.

Benefits of technology

It enables BGP neighbor configuration without the need for prior planning of detailed neighbor IP addresses. The configuration is simple and flexible, and it supports batch creation of BGP neighbors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119383126B_ABST
    Figure CN119383126B_ABST
Patent Text Reader

Abstract

The application discloses a BGP neighbor establishing method, device and equipment and a medium, wherein the method comprises the following steps: configuring a BGP network segment neighbor through the IP address of a physical interface; creating a peer group under the instance of the BGP network segment neighbor; adding the configuration of the BGP network segment neighbor to the peer group; creating a BGP neighbor for the IP address belonging to the BGP network segment neighbor through the peer group, and adding the newly created BGP neighbor to the peer list of the peer group. The detailed neighbor IP address of the BGP does not need to be planned in advance, and the device interface IP address only needs to be in the network segment after the network segment is configured. Meanwhile, the BGP neighbor is established through the method provided by the application, the configuration is simple, the flexibility is high, and the batch BGP neighbor is supported.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of dynamic routing, in particular to a method and device for establishing BGP neighbor, equipment and medium. BACKGROUND

[0002] In a network using BGP as a dynamic routing protocol, network engineers need to pre-plan how to establish BGP neighbors, such as using IBGP or EBGP neighbors. However, under the complexity of actual deployment and the factors of the use environment, network IP addresses may be changed at any time, or the number of network devices is large and the networking is complex, and a network device needs to establish multiple BGP neighbors to meet the actual network requirements. At this time, the manual configuration of each neighbor is more complex and prone to errors, and when the network IP address is changed, the neighbor configuration also needs to be modified. SUMMARY

[0003] In order to solve the above problems, the present application provides a method and device for establishing BGP neighbor, equipment and medium, wherein the method comprises:

[0004] Configure the BPG network segment neighbor through the IP address of the opposite physical interface; create a peer group under the instance of the BPG network segment neighbor; add the configuration of the BPG network segment neighbor to the peer group; create a BGP neighbor for the IP address belonging to the BPG network segment neighbor through the peer group, and add the newly created BGP neighbor to the peer list of the peer group.

[0005] In one example, the BGP neighbor creation through the peer group for the IP address belonging to the BPG network segment neighbor includes at least one of active creation of BGP neighbor and passive creation of BGP neighbor.

[0006] In one example, the active creation of BGP neighbor specifically includes: checking the ARP table learned by the device from the remote end; if the IP address of the ARP in the ARP table belongs to the BPG network segment neighbor, connecting the IP address of the ARP using TCP; if the connection is successful, creating a BGP neighbor for the IP address of the ARP and adding the newly created BGP neighbor to the peer list of the peer group; if the connection is not successful, starting a timer and trying to connect again after a preset time period, until the connection times reach a preset connection times.

[0007] In one example, after the checking the ARP table learned by the device from a remote end, the method further comprises: configuring a default start timing task in the BPG network segment neighbor; checking whether there is an ARP update in the ARP table every preset time interval through the timing task; if there is an ARP update, repeating the connection process.

[0008] In one example, the passively creating a BGP neighbor specifically comprises: receiving a BGP open message; parsing the BGP open message to obtain a peer IP address; and creating a BGP neighbor based on the peer IP address.

[0009] In one example, the creating a BGP neighbor based on the peer IP address specifically comprises: judging whether the peer IP address is in the BPG network segment neighbor; if the peer IP address is in the BPG network segment neighbor, creating a BGP neighbor according to the peer IP address and adding the newly created BGP neighbor to a peer list of the peer group.

[0010] In one example, the peer group is used to provide a unified configuration template for subsequent BGP neighbors in a BPG network segment.

[0011] The application further provides a device for establishing a BGP neighbor, comprising: a configuration module configured to configure a BPG network segment neighbor through a peer IP address; a peer group module configured to create a peer group under an instance of the BPG network segment neighbor; an adding module configured to add a configuration for the BPG network segment neighbor to the peer group; and a creating module configured to create a BGP neighbor for an IP address belonging to the BPG network segment neighbor through the peer group and add the newly created BGP neighbor to a peer list of the peer group.

[0012] The application further provides a device for establishing a BGP neighbor, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform: configuring a BPG network segment neighbor through a peer IP address; creating a peer group under an instance of the BPG network segment neighbor; adding a configuration for the BPG network segment neighbor to the peer group; and creating a BGP neighbor for an IP address belonging to the BPG network segment neighbor through the peer group and adding the newly created BGP neighbor to a peer list of the peer group.

[0013] The application further provides a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are configured to: configure a BPG network segment neighbor through an IP address of a physical interface; create a peer group under an instance of the BPG network segment neighbor; add the configuration of the BPG network segment neighbor to the peer group; create a BGP neighbor for the IP address belonging to the BPG network segment neighbor through the peer group, and add the newly created BGP neighbor to a peer list of the peer group.

[0014] The method provided by the application can bring the following beneficial effects: the detailed neighbor IP address does not need to be planned for the BGP in advance, and after the network segment is configured, only the device interface IP address in the network segment is needed, meanwhile, the method provided by the application supports batch BGP neighbor establishment, and the configuration is simple and flexible. BRIEF DESCRIPTION OF DRAWINGS

[0015] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and serve to explain the principles of the application, and do not limit the application. In the drawings:

[0016] Figure 1 FIG. 1 is a flowchart of a BGP neighbor establishment method according to an embodiment of the application;

[0017] Figure 2 FIG. 2 is a flowchart of an active BGP neighbor creation method according to an embodiment of the application;

[0018] Figure 3 FIG. 3 is a flowchart of a passive BGP neighbor creation method according to an embodiment of the application;

[0019] Figure 4 FIG. 4 is a structural diagram of a BGP neighbor establishment device according to an embodiment of the application;

[0020] Figure 5 FIG. 5 is a structural diagram of a BGP neighbor establishment device according to an embodiment of the application. DETAILED DESCRIPTION

[0021] To make the objectives, technical solutions and advantages of the application clearer, the following will describe the technical solutions of the application with reference to the embodiments of the application and the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of the application, but not all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the application.

[0022] Generally, the establishment of BGP neighbor depends on TCP message, and network devices directly interact with TCP message first to establish TCP connection. The establishment of TCP connection depends on the connection of socket program, and a socket connection needs to know the IP address of the opposite end and the network must be reachable, where the reachability refers to two-layer or three-layer reachability. Therefore, generally, when configuring BGP, the IP address of the opposite end and the local end for establishing the neighbor needs to be known. Generally, the BGP neighbor is configured by using the command of neighbor A.B.C.D, where A.B.C.D is the IP address of the opposite end device. This configuration method uses explicit IP address information, that is, the opposite end must exist the IP address, otherwise the neighbor cannot be established.

[0023] The technical solutions provided by the embodiments of the present application are described in detail below with reference to the drawings.

[0024] Figure 1 A flowchart of a BGP neighbor establishment method provided by one or more embodiments of the present specification is shown. The flowchart can be executed by a computing device in the corresponding field, and some input parameters or intermediate results in the flowchart allow manual intervention to adjust to help improve accuracy.

[0025] The analysis method related to the embodiments of the present application can be a terminal device or a server, and the present application does not make special limitations thereon. For the convenience of understanding and description, the following embodiments are described in detail by taking the server as an example.

[0026] It should be noted that the server can be a single device or a system composed of multiple devices, that is, a distributed server, and the present application does not make specific limitations thereon.

[0027] As shown in Figure 1 The embodiments of the present application provide a BGP neighbor establishment method, which comprises:

[0028] S101: Configure BPG network segment neighbor through the IP address of the opposite end physical interface.

[0029] Configure BGP network segment neighbor neighbor A.B.C.D / Mremote-as AS through the IP address of the opposite end physical interface.

[0030] S102: Create a peer group under the instance of the BPG network segment neighbor.

[0031] A Peer Group named A.B.C.D / M is created by default under the BGP instance.

[0032] S103: Add the configuration of the BPG network segment neighbor to the peer group.

[0033] All subsequent configurations under this neighbor are automatically added to this Peer Group, providing a unified configuration template for subsequent neighbors of this network segment.

[0034] S104: Create a BGP neighbor for the IP address belonging to the BPG network segment neighbor through the peer group, and add the newly created BGP neighbor to the peer list of the peer group.

[0035] In one embodiment, when creating a BGP neighbor, the detailed neighbor establishment process is divided into active establishment and passive establishment.

[0036] As shown in Figure 2 , when actively establishing a BGP neighbor, it is necessary to check the ARP table learned by the device from the remote end; if the IP address of the ARP in the ARP table belongs to the BPG network segment neighbor, the TCP is used to connect the IP address of the ARP; if the connection is successful, a BGP neighbor is created for the IP address of the ARP, and the newly created BGP neighbor is added to the peer list of the peer group; if the connection is not successful, a timer is started, and after a preset time period, the connection is tried again until the connection times reach the preset connection times.

[0037] Specifically, after the network segment neighbor is configured, the BGP checks the ARP table learned by the device from the remote end, and if the IP address of the ARP in the ARP table belongs to the A.B.C.D / M network segment, the TCP is used to connect the IP address, and if the connection is successful, a BGP neighbor is created for the IP, and the neighbor is added to the peer list of the peer group, and the subsequent process is the normal BGP packet processing process, and if the connection is not successful, the connection is tried again after a period of time until the connection is stopped after three times. At the same time, the BGP will start a timing task by default, and check whether there is ARP update every period of time and repeat the connection process.

[0038] As shown in Figure 3 , when passively establishing a BGP neighbor, after receiving a BGP open packet, the content of the packet is parsed to obtain the IP address of the opposite end, and it is judged whether the IP address is in the A.B.C.D network segment, if it is in the network segment, the neighbor is added to the peer list of the PeerGroup, and the BGP packet processing state machine is started, and if it is not in the network segment, the packet is ignored.

[0039] As shown in Figure 4 , the embodiment of the application further provides a BGP neighbor establishment device, comprising:

[0040] The configuration module 401 configures the BPG network segment neighbor through the IP address of the opposite end physical interface.

[0041] The peer group module 402 creates a peer group under the instance of the BPG network segment neighbor.

[0042] The adding module 403 adds the configuration of the BPG network segment neighbor to the peer group.

[0043] The creating module 404 creates a BGP neighbor for the IP address belonging to the BPG network segment neighbor through the peer group, and adds the newly created BGP neighbor to the peer list of the peer group.

[0044] As shown in Figure 5 The embodiment of the present application further provides a BGP neighbor establishing device, which comprises:

[0045] at least one processor; and

[0046] a memory connected with the at least one processor in communication; wherein

[0047] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:

[0048] configure a BPG network segment neighbor through the IP address of a peer physical interface; create a peer group under the instance of the BPG network segment neighbor; add the configuration of the BPG network segment neighbor to the peer group; and create a BGP neighbor for the IP address belonging to the BPG network segment neighbor through the peer group, and add the newly created BGP neighbor to the peer list of the peer group.

[0049] The embodiment of the present application further provides a nonvolatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are set to:

[0050] configure a BPG network segment neighbor through the IP address of a peer physical interface; create a peer group under the instance of the BPG network segment neighbor; add the configuration of the BPG network segment neighbor to the peer group; and create a BGP neighbor for the IP address belonging to the BPG network segment neighbor through the peer group, and add the newly created BGP neighbor to the peer list of the peer group.

[0051] Each of the embodiments of the present application is described in a progressive manner, and the same or similar parts of each of the embodiments can be referred to each other. Each of the embodiments mainly describes the difference from other embodiments. Especially, the device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.

[0052] The device and medium provided by the embodiments of the present application are one-to-one corresponding, and therefore the device and medium also have similar beneficial technical effects to the corresponding method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the device and medium will not be described here again.

[0053] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. In addition, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.

[0054] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus generate a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the functions specified in one or more flows and / or blocks.

[0055] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction apparatus, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the functions specified in one or more flows and / or blocks.

[0056] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable data processing apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable data processing apparatus provide a process for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that carries out the functions specified in one or more flows and / or blocks.

[0057] In one typical arrangement, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0058] The memory can include non-persistent memory, Random Access Memory (RAM), and / or non-volatile memory, such as Read Only Memory (ROM) or flash memory, in a computer readable medium. The memory is an example of computer readable media.

[0059] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.

[0060] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not include only those elements recited, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without further limitation, an element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0061] The above description is merely illustrative of the application, and not restrictive. Various modifications and changes can become apparent to those skilled in the art. Incorporating any modification, equivalent substitution, improvement, etc. within the spirit and principle of the application shall be included in the scope of claims of the application.

Claims

1. A method for establishing a BGP neighbor, the method comprising: The method comprises the following steps: configuring a BPG network segment neighbor through an IP address of a physical interface at a far end; creating a peer group under an instance of the BPG network segment neighbor; adding the configuration of the BPG network segment neighbor to the peer group; creating a BGP neighbor for an IP address belonging to the BPG network segment neighbor through the peer group, and adding the newly created BGP neighbor to a peer list of the peer group; the step of creating a BGP neighbor for an IP address belonging to the BPG network segment neighbor through the peer group comprises at least one of the following steps: actively creating a BGP neighbor, and passively creating a BGP neighbor; the step of actively creating a BGP neighbor comprises the following steps: checking an ARP table learned by the device from a far end; if an IP address of an ARP in the ARP table belongs to the BPG network segment neighbor, connecting the IP address of the ARP using TCP; if the connection is successful, creating a BGP neighbor for the IP address of the ARP, and adding the newly created BGP neighbor to the peer list of the peer group; if the connection is not successful, starting a timer, and trying to connect again after a preset time period, until the number of connection attempts reaches a preset number of connection attempts; the step of passively creating a BGP neighbor comprises the following steps: receiving a BGP open packet; 2. The method of claim 1, wherein, parsing the BGP open packet to obtain an IP address at a far end; based on the IP address at the far end, creating a BGP neighbor. after the step of checking the ARP table learned by the device from the far end, the method further comprises the following steps: configuring a default start timing task in the BPG network segment neighbor; 3. The method of claim 1, wherein, through the timing task, checking whether there is an ARP update in the ARP table every preset time interval; if there is an ARP update, repeating the connection process. the step of creating a BGP neighbor based on the IP address at the far end comprises the following steps:

4. The method of claim 1, wherein, judging whether the IP address at the far end is within the BPG network segment neighbor; 5. An apparatus for establishing a BGP neighbor, the apparatus comprising: if the IP address at the far end is within the BPG network segment neighbor, creating a BGP neighbor according to the IP address at the far end, and adding the newly created BGP neighbor to the peer list of the peer group. the peer group is used to provide a unified configuration template for subsequent BPG neighbors in a BPG network segment. The device comprises: a configuration module configured to configure a BPG network segment neighbor through an IP address of a physical interface at a far end; a peer group module configured to create a peer group under an instance of the BPG network segment neighbor; an adding module configured to add the configuration of the BPG network segment neighbor to the peer group; a creating module configured to create a BGP neighbor for an IP address belonging to the BPG network segment neighbor through the peer group, and add the newly created BGP neighbor to a peer list of the peer group; the step of creating a BGP neighbor for an IP address belonging to the BPG network segment neighbor through the peer group comprises at least one of the following steps: actively creating a BGP neighbor, and passively creating a BGP neighbor; the step of actively creating a BGP neighbor comprises the following steps: checking an ARP table learned by the device from a far end; if an IP address of an ARP in the ARP table belongs to the BPG network segment neighbor, connecting the IP address of the ARP using TCP; if the IP address of the ARP exists in the ARP table and belongs to the BPG network segment neighbor, connecting the IP address of the ARP using TCP; if the connection is successful, creating a BGP neighbor for the IP address of the ARP and adding the newly created BGP neighbor to the peer list of the peer group; if the connection is not successful, starting a timer and trying to connect again after a preset time period until the connection is stopped after the preset number of connection times; the passive creation of the BGP neighbor specifically includes: receiving a BGP open message; parsing the BGP open message to obtain a peer IP address; based on the peer IP address, creating a BGP neighbor.

6. A device for establishing a BGP neighbor, the device comprising: comprise: at least one processor; and a memory in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the method according to any one of claims 1-4.

7. A non-transitory computer storage medium storing computer-executable instructions that, when executed, cause a computer to perform: the computer executable instructions are configured to perform the steps of the method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Establishment method and device of BGP (Border Gateway Protocol) neighbor

    CN109525512A

  • Routing information updating method and equipment between BGP peers, and medium

    CN113852560A