Method and device for preventing unknown transmissible attribute attack of BGP (Border Gateway Protocol)

By constructing an unknown transitive attribute subscription rule table and setting an upper limit in ASBR, the problem of BGP unknown transitive attribute attacks is solved, and the integrity and availability of network routing are protected.

CN121125257AActive Publication Date: 2025-12-12FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511337372.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-18
Publication Date
2025-12-12
Estimated Expiration
2045-09-18

AI Technical Summary

Technical Problem

BGP unknown transitive attribute attacks threaten the integrity and availability of network routing, and existing technologies lack effective protection mechanisms.

Method used

In the Autonomous System Border Router (ASBR), a subscription rule table for unknown transitible attributes is constructed, attribute entries and memory limits are set, and the propagation of unknown transitible attributes is controlled through a filtering mechanism to ensure the normal transmission of legitimate attributes and the discarding of malicious attributes.

Benefits of technology

It effectively blocks malicious attackers from spreading unknown transmissible attributes in the network, protects network resources within the autonomous domain, and improves the autonomy and targeting of protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121125257A_ABST
    Figure CN121125257A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of network communication security, and provides a method and device for preventing unknown transmissible attribute attack of a BGP (Border Gateway Protocol), and the method comprises the steps: determining that a received update message contains an unknown transmissible attribute; reading unknown transmissible attribute data content of the update message, and determining that the number of items with unknown transmissible attributes reaches a set upper limit of the number of items or the memory sales volume reaches a set upper limit of memory overhead; searching the read unknown transmissible attribute data content from an unknown transmissible attribute subscription rule table maintained for each neighbor; when the read unknown transmittable attribute data content is not found, discarding the unknown transmittable attribute data content in the update message, and storing the update message; and when the read unknown transmittable attribute data content is found, storing the update message. The method can effectively prevent malicious attackers from diffusing malicious attributes in the network by using BGP unknown transmissible attributes, and provides a security barrier for the network in the autonomous domain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure belongs to the field of network communication security technology, and in particular relates to a method and apparatus for preventing BGP unknown transitive attribute attacks. Background Technology

[0002] BGP (Border Gateway Protocol), as a core routing protocol of the Internet, enables global network interconnection through the exchange of routing information across Autonomous Systems (AS). Its core functions include route reachability announcement, path selection, and control. To achieve these core functions, BGP introduces two core concepts: Network Layer Reachability Information (NLRI) and Attributes. NLRI identifies routes by using the IP prefix of the target network; Attributes, on the other hand, use TLV (Type-Length-Value) encoding to attach policy control and path identification data to route entries.

[0003] According to RFC 4271, BGP attributes are categorized into generally accepted mandatory attributes, generally accepted self-determined attributes, unknown transitive attributes, and optional non-transitive attributes. Unknown transitive attributes refer to attributes that, when the BGP protocol receives a route update containing, it will forward it to other BGP neighbors even if it doesn't support the attribute itself. This allows attributes to be propagated across multiple ASs, enabling cross-AS routing policy control. Generally accepted mandatory and generally accepted self-determined attributes are recognizable by all BGP implementations. Optional non-transitive attributes are not forwarded to other BGP neighbors, therefore these three types of attributes pose relatively low security risks. Unknown transitive attributes, with their flexible propagation mechanism, meet the needs of complex network policies; however, their global propagation also introduces potential security risks. A detailed analysis follows: The type codes for BGP attributes range from 0 to 255, but only about forty have been assigned so far, leaving more than two hundred in an "unassigned" state. These unassigned type codes do not trigger errors by default in existing BGP implementations, and their design was intended to reserve space for future protocol extensions. However, this design inadvertently provides attackers with a "stealth channel" that they can exploit.

[0004] Attackers exploit the core logic of unassigned attribute type codes by leveraging the protocol's tolerant handling of unknown attributes. They can construct BGP Update messages containing unassigned type codes to forge seemingly legitimate unknown transitive attributes. Specifically, attackers combine unassigned type codes with attribute values ​​of arbitrary length and content within the BGP Update message, thus disguising them as unknown transitive attributes. Since the receiving router cannot recognize the unassigned type code, it will treat it as an unknown transitive attribute according to the BGP protocol specification and continue forwarding it to other neighbors, thereby bypassing the attribute verification mechanism. Furthermore, because unassigned type codes lack a clear definition, their attribute values ​​can be arbitrarily constructed. Attackers can use this to embed excessively long attribute values, inducing the receiving router to trigger resource exhaustion.

[0005] The following example illustrates this: Under normal circumstances, the BGP protocol typically presents a many-to-one mapping between route prefixes and route attributes, meaning one attribute corresponds to multiple route prefixes. This design helps to efficiently manage and propagate routing information, ensuring network routing stability. However, if... Figure 1 As shown, the route update messages sent by a malicious attacker distort this mapping relationship into a one-to-one relationship—the attacker configures different unknown transitive attributes for each route prefix, making previously reusable attributes unshareable. The receiver must then allocate independent memory space for each route prefix and its corresponding attribute. Since BGP message length is limited to 4KB, an attacker might fill the message with the content of unknown transitive attributes, causing the receiver to consume approximately 4KB of memory to store each such attribute. Given the large routing capacity of the BGP protocol, receiving and storing 100,000 such routes would require approximately 400MB of memory resources, which is clearly unacceptable. As the attack continues, memory resources will eventually be exhausted, leading to serious consequences such as Denial of Service (DoS). Furthermore, because these malicious attributes are unknown transitive attributes, their unrestricted propagation mechanism can cause them to rapidly spread to devices throughout the network.

[0006] In summary, in existing technologies, BGP unknown transitive attributes can be propagated across multiple autonomous systems during route updates. Attackers may exploit this wide propagation range and weak verification mechanisms to launch attacks by forging or tampering with attribute values, thereby threatening the integrity and availability of network routing. Therefore, there is an urgent need for a method to prevent attacks on BGP unknown transitive attributes to ensure the integrity and availability of network routing. Summary of the Invention

[0007] To address the aforementioned issues, this disclosure provides a method and apparatus for preventing attacks on unknown transitive attributes in BGP. By determining the requirements for unknown transitive attributes in BGP and constructing a filtering mechanism, the integrity and availability of network routing can be ensured.

[0008] The application provides a method for preventing BGP unknown transitive attribute attack, which is applied in ASBR and includes the following steps. Determining that the received Update message contains unknown transitive attribute; Reading the unknown transitive attribute data content of the Update message and determining whether the number of unknown transitive attribute entries reaches the set upper limit of the number of entries or the memory cost reaches the set upper limit of the memory cost; Searching the read unknown transitive attribute data content from the unknown transitive attribute subscription rule table maintained for each neighbor, wherein the unknown transitive attribute subscription rule table is constructed according to the Route Refresh message received from the neighbor and containing the unknown transitive attribute data content required by the neighbor; When the read unknown transitive attribute data content is not found, discarding the unknown transitive attribute data content in the Update message and storing the Update message; When the read unknown transitive attribute data content is found, storing the Update message.

[0009] Further, when it is determined that the number of unknown transitive attribute entries does not reach the set upper limit of the number of entries and the memory cost does not reach the set upper limit of the memory cost, allocating memory resources for the read unknown transitive attribute data content and updating the total number of unknown transitive attribute entries and the memory cost statistical data.

[0010] Further, each entry in the unknown transitive attribute subscription rule table maintained for each neighbor includes three fields of AttrCode, min len and max len. After storing the Update message, the method further includes the following steps. Determining the type of BGP neighbor to which the Update message is sent; If the receiver is an IBGP neighbor, reading the attr code and attr len fields of the unknown transitive attribute and searching the unknown transitive attribute subscription table of the IBGP neighbor using the attr code; If there is no matching subscription or there is a matching subscription but the attr len is not within the min len and max len range of the entries in the subscription rule table, discarding the unknown transitive attribute and continuing to forward the Update message; If there is a matching subscription and the attr len is within the min len and max len range of the entries in the subscription rule table, directly forwarding the Update message.

[0011] Further, unknown transitive attribute subscription rule table is maintained for each neighbor in the following way: receiving an Open message sent by a neighbor node in the autonomous system, and establishing a neighbor relationship, wherein an ORF Type field in an ORF Capability carried in the Open message is filled with a set unknown transitive attribute ORF type, and the set unknown transitive attribute ORF type is selected from a reserved Type value; receiving a Route Refresh message sent by a neighbor node in the autonomous system, wherein an ORF Type field in an existing ORF entry carried in the Route Refresh message is filled with a set unknown transitive attribute ORF type, and a Type specifi part in an existing ORF entry code is filled with an Attr Code, a min len, and a max len configured by the device when the neighbor node is not another ASBR, and is filled with 0 when the neighbor node is another ASBR; maintaining an unknown transitive attribute subscription rule table for each neighbor according to a Route Refresh message received from the neighbor node, and each entry including an Attr Code, a min len, and a max len.

[0012] Further, an unknown transitive attribute subscription rule table is maintained for each neighbor according to a Route Refresh message received from the neighbor node, and including: Step 1: reading AFI / SAFI content in the message, and finding an unknown transitive attribute subscription rule table corresponding to the neighbor for the AFI / SAFI; Step 2: reading an ORF Type field in the message, and judging whether it is a set unknown transitive attribute ORF type, if yes, continuing Step 3, if not, processing according to rules of other ORF types; Step 3: reading an ORF entry in the message, and then reading an Action field in the ORF entry, and judging a corresponding action according to a value of the Action; Step 4: processing entries in the unknown transitive attribute subscription rule table in Step 1 according to the corresponding action judged.

[0013] Further, processing entries in the unknown transitive attribute subscription rule table in Step 1 according to the corresponding action judged, and including: if the Action is delete all, clearing entries in the unknown transitive attribute subscription rule table in Step 1; If the Action is add, read the Type specific part, and apply the structure of <Attrtype, Max len, Min len> of the unknown transitive attribute, read the corresponding value; use the Attr type to search the unknown transitive attribute subscription rule table in the first step, to find whether the table contains the type of filter rule, if not, add the type of entry to the unknown transitive attribute subscription rule table; if already exists, use the read Max len, Min len to modify the found entry; If the Action is delete, read the Type specific part, and apply the structure of <Attrtype, Max len, Min len> of the unknown transitive attribute, read the corresponding value; use the Attr type to search the unknown transitive attribute subscription rule table in the first step, to find whether the table contains the type of filter rule, if not, add the type of entry to the unknown transitive attribute subscription rule table; if already exists, use the read Max len, Min len to modify the found entry.

[0014] Further, after finding the read unknown transitive attribute data content, the method further comprises: determining the Update message containing the unknown transitive attribute to be forwarded; when determining that the receiver belongs to an IBGP neighbor, taking out the attr code and attr len fields of the unknown transitive attribute; using the attr code to search the unknown optional transitive attribute subscription table of the neighbor; when finding the subscription of the type of attribute and the attr len is within the min len and max len range of the entry in the subscription rule table, sending the Update message according to the normal BGP processing flow; when finding the subscription of the type of attribute and the attr len is not within the min len and max len range of the entry in the subscription rule table, discarding the unknown optional transitive attribute and continuing to forward the Update message.

[0015] The application also provides a device for preventing BGP unknown transitive attribute attack, applied in an ASBR, comprising: an attribute determining unit, configured to determine that the received Update message contains an unknown transitive attribute; an upper limit determining unit, configured to read the unknown transitive attribute data content of the Update message, and determine whether the number of entries of the unknown transitive attribute reaches a set entry upper limit or the memory cost reaches a set memory cost upper limit; The search unit is configured to search for the read unknown transitive attribute data content from an unknown transitive attribute subscription rule table maintained for each neighbor, wherein the unknown transitive attribute subscription rule table is constructed according to a Route Refresh message received from the neighbor and containing unknown transitive attribute data content required by the neighbor; The processing unit is configured to discard the unknown transitive attribute data content in the Update message and store the Update message when the read unknown transitive attribute data content is not found, and store the Update message when the read unknown transitive attribute data content is found.

[0016] The application further provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus. The memory is configured to store a computer program. The processor is configured to execute the program stored on the memory to implement the above method.

[0017] The application further provides a computer storage medium, wherein the computer storage medium stores a computer program, and the computer program is executed by the processor to implement the above method.

[0018] Compared with the prior art, the present application has the following advantages: The autonomous domain border node has the ability to selectively store attributes according to the needs of neighbors in the autonomous domain, and can accurately control the number or byte size of BGP unknown transitive attributes passing through. This feature can effectively block the way for malicious attackers to spread malicious attributes in the network using BGP unknown transitive attributes, and provides a solid security barrier for the network in the autonomous domain.

[0019] Other nodes in the autonomous domain can actively send their own required unknown transitive attribute filtering rules to the border node of the autonomous domain. Through this active interaction mechanism, each node can customize personalized filtering strategies according to its business characteristics and security requirements, avoid attacks caused by receiving and processing unnecessary unknown transitive attributes, and significantly improve the autonomy and pertinence of each node in the autonomous domain in defending BGP unknown transitive attribute related attacks.

[0020] Other features and advantages of the present application will be described in the following description, and some will become apparent from the description, or will be learned by practice of the present application. The purpose and other advantages of the present application can be achieved and obtained by the structure indicated in the specification, claims and drawings. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present disclosure, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0022] Figure 1 A malicious attack diagram of unknown optional transitive attribute of BGP protocol is shown; Figure 2 A construction process diagram of unknown transitive attribute subscription rule table provided by the embodiments of the present disclosure is shown; Figure 3 A diagram of ASBR collecting unknown optional transitive attributes in the autonomous system and subscribing provided by the embodiments of the present disclosure is shown; Figure 4 A diagram of ORF Capability structure provided by BGP protocol RFC5291 provided by the embodiments of the present disclosure is shown; Figure 5 A diagram of unknown optional transitive attribute ORF structure provided by the embodiments of the present disclosure is shown; Figure 6 A diagram of unknown optional transitive attribute subscription rule constructed by ASBR provided by the embodiments of the present disclosure is shown; Figure 7 A diagram of ASBR for received unknown optional transitive attribute statistics and filtering process provided by the embodiments of the present disclosure is shown; Figure 8 A diagram of ASBR forwarding unknown optional transitive attribute process provided by the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0023] In the scheme of the embodiments of the present disclosure, the existing BGP ORF (Outbound Route Filtering) framework rule is used as the basis for the extension operation of the TLV structure. With the extended TLV structure, the device first sends the type and attribute size information of the unknown transmissible attribute required by the node to the ASBR. After the ASBR collects the above information, the unknown transmissible attribute filtering rule in the autonomous system is constructed. Next, in terms of the unknown transmissible attribute entering the local autonomous system, the ASBR sets the upper limit of the number of entries of the unknown transmissible attribute and the upper limit of the consumed memory resources, and does not do the inbound filtering of the unknown transmissible attribute before reaching the upper limit, to ensure that the normal unknown transmissible attribute can be correctly transmitted to other downstream AS. When the unknown transmissible attribute reaches any of the above upper limits, the ASBR starts the filtering mechanism, and discards the unknown transmissible attribute that needs to continue to increase the memory overhead, to ensure that the resources of the ASBR itself are not excessively consumed. When the ASBR forwards the unknown optional transmissible attribute to other devices in the local autonomous system, according to the filtering rule constructed in advance, the unknown optional transmissible attribute is accurately forwarded to the device subscribing to this type of attribute, to ensure that the unknown optional transmissible attribute can accurately reach the target device, and will not be forwarded to the device not subscribing to this type of attribute, to avoid the unknown transmissible attribute passing through and excessively consuming the resources of other nodes in the autonomous system.

[0024] To make the purposes, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are some, but not all of the embodiments of the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present disclosure.

[0025] In the scheme of the embodiments of the present disclosure, the ASBR needs to first construct and maintain the unknown transmissible attribute subscription rule table for each neighbor in the autonomous system, that is, to construct the unknown transmissible attribute filtering rule in the autonomous system. The construction process of the unknown transmissible attribute subscription rule table will be described below. As shown in Figure 2 The specific steps include the following steps: Step 201: The ASBR receives the Open message sent by the neighbor node in the autonomous system, and establishes a neighbor relationship. The ORF Type field in the ORF Capability carried in the Open message is filled with the set unknown transmissible attribute ORF type selected from the reserved Type value.

[0026] It should be noted that the BGP protocol indicates in the Open message that it is willing to receive or send ORF entries to its neighbor by using the ORF capability. The ORF capability negotiation of this type is successful only when both parties support the same ORF. Subsequent BGP neighbors can exchange actual ORF entries of this type through Route Refresh messages. Therefore, in step 201, the ORF Type field in the ORF Capability carried in the Open message is first described, which is set as the ORF type of the unknown optional transmissible attribute.

[0027] The ASBR establishes a BGP neighbor relationship with the device in the autonomous system, collects the unknown optional transmissible attribute in the autonomous system, and subscribes, as shown in Figure 3 Specifically, as shown in Figure 4 , the ASBR1 and the R2, and the ASBR1 and the ASBR2 carry the ORF Capability in the Open message, in which the ORF Type field is filled with the unknown optional transmissible attribute ORF type provided by the application, that is, the ORF type of the unknown transmissible attribute set, which is selected from the reserved Type value. The remaining fields are filled according to the existing specification requirements, and are used for capability negotiation between the device R2 and the ASBR to inform the ASBR that the node supports the unknown optional transmissible attribute ORF function.

[0028] Specifically, the meanings and filling methods of the fields are as follows: Address Family Identifier (AFI) indicates the address family identifier, Subsequent Address Family Identifier (SAFI) indicates the sub-address family identifier, for example, IPv4-Unicast, which needs to be filled according to the actual situation of the routing service; the Number of ORF Types field indicates the number of filter types (Filter Types) to be listed in the subsequent field; the ORF Type is the ORF type code, in the application scenario described in the application, this field is filled with the unknown optional transmissible attribute ORF type provided by the application; the Send / Receive field indicates whether the sender is willing to receive ORF entries from its peer (value 1), whether it hopes to send ORF entries to its peer (value 2), or both (value 3).

[0029] Step 202: The ASBR receives the Route Refresh message sent by the neighbor node in the autonomous system.

[0030] The ORF Type field of the ORF entry carried in the Route Refresh message is filled with the set unknown optional transitive attribute ORF type, and the Type specific part in the existing ORF entry coding is filled with the Attr Code, min len and max len configured by the device when the neighbor node is not another ASBR, and is filled with 0 when the neighbor node is another ASBR.

[0031] On the node needing to perceive the specific unknown optional transitive attribute, such as R2, the attr code, min len and max len information of the related attribute are configured, and the BGP protocol uses these data to encode the unknown optional transitive attribute ORF structure according to Figure 5 The structure shown in the figure corresponds to the unknown optional transitive attribute ORF structure, and is filled into the Route Refresh message and sent to ASBR1. For ASBR1 and ASBR2, since they are on the border of the autonomous system and are responsible for the exchange of route information with other autonomous systems, the unknown optional transitive attribute needs to be processed. ASBR1 and ASBR2 themselves cannot know in advance which specific optional transitive attribute type needs to be processed, so the corresponding attr code, min len and max len are all filled with 0 when the unknown optional transitive attribute ORF structure is configured between ASBRs, indicating that all unknown optional transitive attributes need to be perceived, and is filled into the Route Refresh message and sent to the opposite node. Figure 5 The structure shown in the figure corresponds to the unknown optional transitive attribute ORF structure, and is filled into the Route Refresh message and sent to ASBR1. For ASBR1 and ASBR2, since they are on the border of the autonomous system and are responsible for the exchange of route information with other autonomous systems, the unknown optional transitive attribute needs to be processed. ASBR1 and ASBR2 themselves cannot know in advance which specific optional transitive attribute type needs to be processed, so the corresponding attr code, min len and max len are all filled with 0 when the unknown optional transitive attribute ORF structure is configured between ASBRs, indicating that all unknown optional transitive attributes need to be perceived, and is filled into the Route Refresh message and sent to the opposite node.

[0032] As shown in Figure 5 The unknown optional transitive attribute ORF coding includes three aspects: (1) The existing Route Refresh message carries the ORF entry, wherein the ORF Type field is filled with the unknown optional transitive attribute ORF type provided by the application, and the remaining fields are filled according to the description of RFC5291. Different ORF filtering rules can be encoded, which will not be described here.

[0033] (2) The Type specific part in the existing ORF entry coding is filled according to the “unknown optional transitive attribute ORF entry coding of the application”.

[0034] (3) The unknown optional transitive attribute ORF entry coding of the application is filled with the corresponding fields in the message according to the locally configured Attr code, Min len and Max len.

[0035] In order to explain the operation of the receiver of the subsequent ORF for the addition, deletion and modification of the local unknown optional delivery attribute subscription rule table, the value and meaning of the Action field are described as follows: when the value is 0, it means adding an ORF entry; when the value is 1, it means deleting an ORF entry; and when the value is 2, it means deleting all ORF entries.

[0036] Step 203: According to the Route Refresh message received from the neighbor node, an unknown deliverable attribute subscription rule table is maintained for each neighbor, and each entry includes the Attr Code, min len and max len fields. Here, an unknown deliverable attribute subscription rule table is maintained for each neighbor as shown in Figure 6

[0037] This step 203 specifically includes: First step: reading the AFI / SAFI content in the message, and finding the unknown deliverable attribute subscription rule table of the neighbor corresponding to the AFI / SAFI; Second step: reading the ORF Type field in the message, and judging whether it is the set unknown deliverable attribute ORF type. If yes, continue the third step; if not, process according to the rules of other ORF types; Third step: reading the ORF entry in the message, and then reading the Action field in the ORF entry. According to the value of the Action, the corresponding action is judged; Fourth step: processing the entries in the unknown deliverable attribute subscription rule table described in the first step according to the corresponding action judged.

[0038] The fourth step specifically includes: If the Action is to delete all, the entries in the unknown deliverable attribute subscription rule table described in the first step are emptied; If the Action is to add, the Type specific part is read, and the structure of the unknown deliverable attribute <Attrtype, Max len, Min len> is applied to read the corresponding values. The Attr type is used to search the unknown deliverable attribute subscription rule table in the first step to find out whether it contains the type of filtering rule. If not, the type of entry is added to the unknown deliverable attribute subscription rule table. If it already exists, the Max len and Min len read are used to modify the found entry; ​If the Action is delete, read the Type specific part, and apply the structure of <Attrtype, Max len, Min len> of the unknown transitive attribute, read the corresponding value; use the Attr type to the unknown transitive attribute subscription rule table in the first step, find whether the entry contains the Attr type, if it exists, then delete the entry from the unknown transitive attribute subscription rule table.

[0039] Figure 7 A method flow diagram for preventing BGP unknown transitive attribute attack according to an embodiment of the present disclosure is shown, as shown in the figure, the method for preventing BGP unknown transitive attribute attack according to an embodiment of the present disclosure comprises: Figure 7 Step 701: set the upper limit of the BGP unknown transitive attribute entry and the upper limit of the memory overhead; Step 702: receive the BGP neighbor UPDATE message; Step 703: determine whether the received Update message contains an unknown transitive attribute; if yes, execute step 704; if no, execute step 709; The specific determination process is as follows: parse the attribute list in the Update message, check whether the attribute is "optional and transitive", verify whether the local recognizes the attribute, if both "optional and transitive + local not recognized" are met, the attribute is an "unknown transitive attribute".

[0040] Step 704: read the unknown transitive attribute data content of the Update message; Step 705: find the read unknown transitive attribute data content from the unknown transitive attribute subscription rule table maintained for each neighbor; determine whether it is found, if yes, execute step 709; if no, execute step 706; In this step 705, the unknown transitive attribute subscription rule table is constructed according to the Route Refresh message received from the neighbor, which contains the unknown transitive attribute data content required by the neighbor, and the specific construction process will be described in detail below.

[0041] Step 706: determine whether the number of entries of the unknown transitive attribute reaches the set upper limit of the number of entries or the amount of memory overhead reaches the set upper limit of the memory overhead; if yes, execute step 707; if no, execute step 708; Step 707: discard the unknown transitive attribute data content in the Update message, and store the Update message.

[0042] ​Step 708: Allocate memory resources for the read unknown transitive attribute data content, and update the total number of unknown transitive attribute entries and memory overhead statistics.

[0043] Step 709: Process according to the normal BGP procedure.

[0044] After completing the aforementioned process of receiving and storing Update messages containing unknown optional transmission attributes locally, the ASBR needs to forward this routing information to other neighbors.

[0045] like Figure 8 As shown, this is the process by which the ASBR forwards an Update message containing unknown optional delivery attributes, including the following steps: Step 801: Determine the Update message containing unknown optional transit attributes to be forwarded; Step 802: Determine what type of BGP neighbor the receiver is. If the receiver is an IBGP neighbor, proceed to step 803. If the receiver is an EBGP neighbor, proceed to step 807. Step 803: Retrieve the attr code and attr len fields of the unknown transitive attribute; Step 804: Use the attr code to search the unknown optional transitive attribute subscription table of the neighbor and determine whether a subscription of this type of attribute is found; if yes, proceed to step 805; if no, proceed to step 806. Step 805: Determine if attr len is within the range of min len and max len of the entry in the subscription rule table. If yes, proceed to step 807; otherwise, proceed to step 806. Step 805 is to determine whether the length of the optional transitive attribute meets the range described by the neighbor.

[0046] Step 806: Discard the unknown optional transit attribute and continue forwarding this Update message; Step 807: Send the Update message according to the normal BGP processing procedure.

[0047] Based on the above method, this disclosure also provides an apparatus for preventing BGP unknown transitive attribute attacks, corresponding to the above method, applied in ASBR, including: The attribute determination unit is used to determine whether the received Update message contains unknown transitive attributes. The upper limit determination unit is used to read the unknown transitible attribute data content of the Update message and determine whether the number of unknown transitible attribute entries reaches the set upper limit or the memory usage reaches the set upper limit. The searching unit is configured to search the read unknown transitive attribute data content from an unknown transitive attribute subscription rule table maintained for each neighbor, wherein the unknown transitive attribute subscription rule table is constructed according to a Route Refresh message received from the neighbor and containing unknown transitive attribute data content required by the neighbor. The processing unit is configured to discard the unknown transitive attribute data content in the Update message and store the Update message when the read unknown transitive attribute data content is not found, and store the Update message when the read unknown transitive attribute data content is found.

[0048] Based on the same inventive concept as disclosed above, the disclosure also provides an electronic device. The electronic device of the embodiments of the disclosure includes at least one processor and at least one memory electrically connected to each other, 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 method as described above.

[0049] It should be noted that the electrical connection between the above-mentioned units does not necessarily mean the connection between the lines, and the indirect connection mode can also be applicable to the embodiments of the disclosure as long as the purpose of the disclosure is achieved.

[0050] Based on the same inventive concept, the disclosure also provides a computer storage medium, wherein the computer storage medium stores a computer program, and the computer program is executed by a processor to implement the method described above.

[0051] Although the disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalent features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the disclosure.

Claims

1. A method for preventing BGP unknown transitive attribute attacks, characterized in that, Applications in ASBR include: It was determined that the received Update message contained an unknown transitive attribute; Read the unknown transitive attribute data content of the Update message, and determine whether the number of unknown transitive attribute entries has reached the set entry limit or the memory usage has reached the set memory consumption limit. The unknown transitive attribute subscription rule table maintained for each neighbor is used to search for the unknown transitive attribute data content to be read. The unknown transitive attribute subscription rule table is constructed based on the Route Refresh message received from the neighbor that contains the unknown transitive attribute data content required by that neighbor. If the unknown transitive attribute data content to be read is not found, discard the unknown transitive attribute data content in the Update message and store the Update message; When the unknown transitive attribute data content is found, the Update message is stored.

2. The method according to claim 1, characterized in that, When the number of entries for unknown transitive attributes does not reach the set limit for the number of entries and the memory usage does not reach the set limit for memory overhead, memory resources are allocated for the read data content of unknown transitive attributes, and the total number of entries for unknown transitive attributes and memory overhead statistics are updated.

3. The method according to claim 1, characterized in that, In the unknown transitive attribute subscription rule table maintained for each neighbor, each entry includes three fields: Attr Code, min len, and max len. After storing the Update message, the method further includes: Determine what type of BGP neighbor the recipient of the Update message belongs to; If the receiver is an IBGP neighbor, then read the attr code and attr len fields of the unknown transitive attribute, and use the attr code to look up the unknown transitive attribute subscription table of the IBGP neighbor; If no matching subscription exists, or if a matching subscription exists but attr len is not within the range of min len and max len of the entry in the subscription rule table, then discard the unknown transitive attribute and continue forwarding this Update message; If a matching subscription exists, and attr len is within the range of min len and max len of the entry in the subscription rule table, then this Update message is forwarded directly.

4. The method according to claim 1, characterized in that, Maintain the subscription rule table for unknown transitive attributes for each neighbor in the following way: Receive Open messages sent by neighboring nodes within this autonomous system and establish neighbor relationships. In the Open message, the ORF Type field in the ORF Capability is filled with a set ORF type of an unknown transitive attribute, which is selected from reserved Type values. The device receives Route Refresh messages from neighboring nodes within its autonomous system. The ORF Type field of the existing ORF entries carried in the Route Refresh message is filled with the set unknown transitive attribute ORF type. Furthermore, the Type specification part in the existing ORF entry encoding is filled with the Attr Code, min len, and max len configured by the device when the neighboring node is not another ASBR, and is filled with 0 when the neighboring node is another ASBR. Based on the Route Refresh message received from the neighbor node, maintain an unknown transitive attribute subscription rule table for each neighbor. Each entry includes three fields: Attr Code, min len, and max len.

5. The method according to claim 4, characterized in that, Based on the Route Refresh messages received from neighbor nodes, maintain an unknown transitive attribute subscription rule table for each neighbor, including: Step 1: Read the AFI / SAFI content in the message and find the subscription rule table of the unknown transitible attribute corresponding to this AFI / SAFI for this neighbor; Step 2: Read the ORF Type field in the message and determine whether it is the set unknown transitive attribute ORF type. If it is, continue to step 3. If not, process it according to the rules of other ORF types. Step 3: Read the ORF entry in the message, then read the Action field in the ORF entry, and determine the corresponding action based on the value of Action; Step 4: Process the entries in the unknown transitive attribute subscription rule table described in Step 1 according to the corresponding actions determined.

6. The method according to claim 5, characterized in that, The entries in the unknown transitive attribute subscription rule table described in the first step are processed according to the determined corresponding actions, including: If the Action is to delete all, then clear the entries in the Unknown Transitable Property Subscription Rule Table described in the first step; If the Action is an addition, then read the Type-specific part and apply the unknown transitive property.<Attrtype、Max len、Min len> The structure is read, and the corresponding value is read. The Attr type is used to check the unknown transitive attribute subscription rule table in the first step to see if it contains an overfiltering rule of this type. If not, an entry of this type is added to the unknown transitive attribute subscription rule table. If it already exists, the read Max len and Min len are used to modify the found entry. If the Action is deletion, then read the Type-specific part and apply the unknown transitive property.<Attrtype、Max len、Min len> The structure is used to read the corresponding value; the Attr type is used to check the unknown transitive attribute subscription rule table from the first step to see if there is an entry containing that Attr type. If it exists, the entry is deleted from the unknown transitive attribute subscription rule table.

7. The method according to claim 1, characterized in that, After storing the Update message upon finding the unknown transitive attribute data to be read, the method further includes: Identify the Update message containing unknown optional transit attributes to be forwarded; When it is determined that the receiver belongs to an IBGP neighbor, the attr code and attr len fields of the unknown transitive attribute are extracted; Use the attr code to look up the unknown optional transitive attribute subscription table of that neighbor; When a subscription of this type of attribute is found and attr len is within the range of min len and max len of the entry in the subscription rule table, the Update message is sent according to the normal BGP processing procedure. If a subscription with this type of attribute is found and attr len is not within the range of min len and max len of the entry in the subscription rule table, discard the unknown optional transit attribute and continue forwarding this Update message.

8. A device for preventing BGP unknown transitive attribute attacks, characterized in that, Applications in ASBR include: The attribute determination unit is used to determine whether the received Update message contains unknown transitible attributes. The upper limit determination unit is used to read the unknown transitible attribute data content of the Update message and determine whether the number of unknown transitible attribute entries reaches the set upper limit of the number of entries or the memory consumption reaches the set upper limit of memory consumption. The lookup unit is used to look up the unknown transitive attribute data content to be read from the unknown transitive attribute subscription rule table maintained for each neighbor. The unknown transitive attribute subscription rule table is constructed based on the Route Refresh message received from the neighbor that contains the unknown transitive attribute data content required by that neighbor. The processing unit is configured to discard the unknown transitive attribute data content in the Update message and store the Update message when the unknown transitive attribute data content to be read is not found; and to store the Update message when the unknown transitive attribute data content to be read is found.

9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-7.

10. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1-7.

Citation Information

Patent Citations

  • Network-situation-awareness-oriented multi-level network system and building method thereof

    CN104168154A

  • Message processing method and message processing device

    CN108566344A

  • Abnormal / attack message processing method, storage medium and equipment

    CN117527324A

  • Definition of logical router service rules

    US20250080630A1