A method and apparatus for preventing bpg unknown transitive attribute attacks

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, enabling the filtering of malicious attributes and the normal transmission of legitimate attributes, thus protecting the integrity and availability of the network within the autonomous system.

CN121125257BActive Publication Date: 2026-07-07FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
Filing Date
2025-09-18
Publication Date
2026-07-07

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 that legitimate attributes are transmitted normally and malicious attributes are discarded.

Benefits of technology

It effectively blocks the spread of malicious, unknown, and transmissible attributes in the network, protects node resources within the autonomous system, enhances the autonomy and targeting of protection, and ensures the integrity and availability of network routing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121125257B_ABST
    Figure CN121125257B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of network communication security, and provides a method and device for preventing BGP unknown transitive attribute attack, the method comprising: 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 entries of the unknown transitive attribute reaches a set upper limit of the number of entries or the memory cost reaches a set upper limit of the memory cost; searching for the read unknown transitive attribute data content from the unknown transitive attribute subscription rule table maintained for each 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; and when the read unknown transitive attribute data content is found, storing the update message. The method can effectively block the approach of malicious attackers to spread malicious attributes in the network by using BGP unknown transitive attribute, and provides a security barrier for the network in an 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:

[0004] 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.

[0005] 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.

[0006] 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.

[0007] 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

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

[0009] This invention provides a method for preventing attacks on unknown transitive properties of BGP, applied in ASBR, including:

[0010] It was determined that the received Update message contained an unknown transitive attribute;

[0011] 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.

[0012] 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.

[0013] 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;

[0014] When the unknown transitive attribute data content is found, the Update message is stored.

[0015] Furthermore, when it is determined that the number of entries for unknown transitive attributes has not reached the set upper limit for the number of entries and the memory consumption has not reached the set upper limit for memory consumption, memory resources are allocated for the read data content of unknown transitive attributes, and the total number of entries for unknown transitive attributes and the memory consumption statistics are updated.

[0016] Furthermore, in the unknown transitive attribute subscription rule table maintained for each neighbor, each entry includes three fields: AttrCode, min len, and max len;

[0017] After storing the Update message, the method also includes:

[0018] Determine what type of BGP neighbor the recipient of the Update message belongs to;

[0019] 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;

[0020] 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;

[0021] 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.

[0022] Furthermore, maintain the subscription rule table for unknown transitive attributes for each neighbor in the following way:

[0023] Receive Open messages sent by neighboring nodes within this autonomous system and establish neighbor relationships. In the Open message, the ORF Type field in ORF Capability is filled with the set ORF type of the unknown transitive attribute. The set ORF type of the unknown transitive attribute is selected from the reserved Type values.

[0024] When receiving Route Refresh messages from neighboring nodes within the Autonomous System, the ORF Type field of 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.

[0025] Based on the Route Refresh messages received from neighbor nodes, maintain an unknown transitive attribute subscription rule table for each neighbor. Each entry includes three fields: Attr Code, min len, and max len.

[0026] Furthermore, based on the Route Refresh messages received from neighboring nodes, an unknown transitive attribute subscription rule table is maintained for each neighbor, including:

[0027] Step 1: Read the AFI / SAFI content in the message and find the unknown transitible attribute subscription rule table corresponding to this AFI / SAFI for this neighbor;

[0028] 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.

[0029] 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;

[0030] Step 4: Process the entries in the unknown transitive attribute subscription rule table from Step 1 according to the determined corresponding actions.

[0031] Furthermore, the entries in the unknown transitive attribute subscription rule table from the first step are processed according to the determined corresponding actions, including:

[0032] If the Action is to delete all, then clear the entries in the Unknown Transitive Property Subscription Rule Table from the first step.

[0033] 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.

[0034] 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.

[0035] Furthermore, after storing the Update message upon finding the unknown transitive attribute data content to be read, the method also includes:

[0036] Identify the Update message containing unknown optional transit attributes to be forwarded;

[0037] 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;

[0038] Use the attr code to look up the unknown optional transitive attribute subscription table of that neighbor;

[0039] When a subscription of this type of attribute is found and attr len is within the range of min len and maxlen of the entry in the subscription rule table, the Update message is sent according to the normal BGP processing procedure.

[0040] If a subscription with this type of attribute is found and attr len is not within the range of min len and maxlen of the entry in the subscription rule table, discard the unknown optional transit attribute and continue forwarding this Update message.

[0041] This invention also provides a device for preventing BGP unknown transitive attribute attacks, applied in ASBR, comprising:

[0042] The attribute determination unit is used to determine whether the received Update message contains unknown transitive attributes.

[0043] 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.

[0044] 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.

[0045] 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.

[0046] The present invention also provides an electronic device, including 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;

[0047] Memory, used to store computer programs;

[0048] The processor implements the above method when executing programs stored in memory.

[0049] The present invention also provides a computer storage medium storing a computer program, which, when executed by a processor, implements the above-described method.

[0050] Compared with the prior art, this disclosure has the following advantages:

[0051] Autonomous system (AS) boundary nodes have the ability to selectively store attributes based on the needs of their AS's neighbors, precisely controlling the number or bytes of BGP unknown transitive attributes transmitted through the network. This feature effectively blocks malicious attackers from using BGP unknown transitive attributes to spread malicious attributes within the network, providing a robust security barrier for the AS's internal network.

[0052] Other nodes within an autonomous system (AS) can proactively send their required filtering rules for unknown transitible attributes to the AS's boundary nodes. Through this proactive interaction mechanism, each node can customize its own filtering strategies based on its business characteristics and security needs, avoiding attacks caused by receiving and processing unnecessary unknown transitible attributes. This significantly improves the autonomy and targeted nature of each node's protection against attacks related to BGP unknown transitible attributes within the AS.

[0053] Other features and advantages of this disclosure will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the disclosure. The objects and other advantages of this disclosure may be realized and obtained by means of the structures pointed out in the description, claims and drawings. Attached Figure Description

[0054] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0055] Figure 1 This diagram illustrates a malicious attack targeting unknown optional transit attributes of the BGP protocol.

[0056] Figure 2 A schematic diagram illustrating the construction process of the unknown transitive attribute subscription rule table provided in an embodiment of this disclosure is shown.

[0057] Figure 3 This illustration shows an ASBR collecting and subscribing to unknown optional transitive attributes within the autonomous system, as provided in an embodiment of this disclosure.

[0058] Figure 4 This illustration shows a schematic diagram of the ORF Capability structure provided by the BGP protocol RFC5291 in an embodiment of this disclosure;

[0059] Figure 5 A schematic diagram of the ORF structure for unknown optional communicable attributes provided in an embodiment of this disclosure is shown;

[0060] Figure 6The following is a schematic diagram of the unknown optional transitive attribute subscription rule constructed by ASBR according to the embodiments of this disclosure;

[0061] Figure 7 The present disclosure provides an embodiment of the ASBR's statistical and filtering process for received unknown optional transit attributes.

[0062] Figure 8 The present invention provides a schematic diagram of the ASBR forwarding process with unknown optional transmission attributes according to an embodiment of the present disclosure. Detailed Implementation

[0063] In the scheme of this embodiment, the existing BGP ORF (Outbound Route Filtering) framework rules are used as a basis to extend the TLV structure. With this extended TLV structure, the device first sends the type and size information of the unknown transitible attributes required by the node to the ASBR. After collecting the above information, the ASBR constructs the filtering rules for unknown transitible attributes within its autonomous system. Next, regarding the entry of unknown transitible attributes into the local autonomous system, the ASBR sets an upper limit on the number of unknown transitible attribute entries and an upper limit on memory resource consumption. Before reaching the upper limit, no inbound filtering is performed on unknown transitible attributes, ensuring that normally passing unknown transitible attributes can be correctly transmitted to other downstream ASs. When the number of unknown transitible attributes reaches any of the above upper limits, the ASBR activates the filtering mechanism, discarding unknown transitible attributes that require further memory overhead, ensuring that the ASBR's own resources are not excessively consumed. When the ASBR forwards an unknown optional transitive attribute to other devices in the local autonomous system, it accurately forwards the unknown optional transitive attribute to the devices that have subscribed to this type of attribute according to the pre-built filtering rules. This ensures that the unknown optional transitive attribute can accurately reach the target device and will not be forwarded to devices that have not subscribed to this type of attribute, thus avoiding the excessive consumption of resources of other nodes in the autonomous system due to the transitive attribute.

[0064] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0065] In the scheme of this embodiment, the ASBR needs to first construct and maintain an unknown transitive attribute subscription rule table for each neighbor within the autonomous system, that is, to construct the unknown transitive attribute filtering rules within the autonomous system. The construction process of the unknown transitive attribute subscription rule table is described below. Figure 2 As shown, the specific steps include:

[0066] Step 201: The ASBR receives Open messages from neighboring nodes within its autonomous system and establishes neighbor relationships;

[0067] In the Open message, the ORF Type field in the ORF Capability is filled with a set unknown transitive attribute ORF type, which is selected from the reserved Type values.

[0068] It should be noted that in the BGP Open message, the ORF capability indicates to its neighbors that it is willing to receive or send ORF entries. Only when both parties support the same type of ORF is the negotiation of that type of ORF capability successful, and subsequently, the BGP neighbors can exchange actual ORF entries of this type via Route Refresh messages. Therefore, in step 201, the ORF Type field in the ORF Capability carried in the Open message needs to be defined as an ORF type with a set unknown transitive attribute.

[0069] ASBR establishes BGP neighbor relationships with devices within the autonomous system, collects and subscribes to unknown optional transitive attributes within the autonomous system, such as... Figure 3 As shown, specifically, it refers to the communication between ASBR1 and R2, and between ASBR1 and ASBR2, where the Open message carries information such as... Figure 4 The ORF Capability field shown is filled with the ORF Type field, which is filled with the unknown optional transitive attribute ORF type provided by this invention. That is, it is filled with the set unknown transitive attribute ORF type, which is selected from the reserved Type values. The remaining fields are filled in according to existing specifications and are used for capability negotiation between device R2 and ASBR to inform ASBR that this node supports the unknown optional transitive attribute ORF function.

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

[0071] Step 202: ASBR receives Route Refresh messages sent by neighboring nodes within its autonomous system.

[0072] 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, and 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 neighbor node is not another ASBR, and is filled with 0 when the neighbor node is another ASBR.

[0073] On nodes that need to be aware of specific unknown optional transitive attributes, such as R2, the attrcode, min len, and max len information of the relevant attributes are configured. The BGP protocol uses this data according to... Figure 5 The diagram shows the construction of the corresponding unknown optional transitive attribute (ORF) structure, which is then filled into the Route Refresh message and sent to ASBR1. Between ASBR1 and ASBR2, since they are located at the boundary of their respective autonomous systems and are responsible for exchanging routing information with other autonomous systems, they need to handle unknown optional transitive attributes for transit points. ASBR1 and ASBR2 themselves cannot know in advance which specific optional transitive attribute types are required for transit points; therefore, they process the unknown optional transitive attributes between ASBRs according to... Figure 5 When constructing the unknown optional transitive attribute ORF structure as shown, the corresponding attr code, minlen, and maxlen are all filled with 0, indicating that all unknown optional transitive attributes need to be detected and filled into the Route Refresh message before being sent to the other party.

[0074] like Figure 5 As shown, ORF encoding for unknown optional attributes includes three aspects:

[0075] (1) The existing Route Refresh message carries an ORF entry, in which the ORF Type field is filled with the unknown optional transmission attribute ORF type provided by the present invention, and the other fields are filled in according to the description of RFC5291. Different ORF filtering rules can be encoded, which will not be elaborated here.

[0076] (2) The Type specific part in the existing ORF entry coding should be filled in according to “OCF entry coding for unknown optional transit attributes in this invention”.

[0077] (3) For the encoding of unknown optional transmission attributes ORF entries, the present invention fills in the corresponding fields in the message according to the locally configured Attr code, Min len, and Max len.

[0078] To explain the subsequent operations of the ORF receiver on adding, deleting, and modifying the subscription rule table for local unknown optional transitive attributes, the values ​​and meanings of the Action field are explained here. A value of 0 indicates adding an ORF entry, a value of 1 indicates deleting an ORF entry, and a value of 2 indicates deleting all ORF entries.

[0079] Step 203: Based on the Route Refresh messages received from neighbor nodes, maintain an unknown transitive attribute subscription rule table for each neighbor. Each entry includes three fields: Attr Code, min len, and max len. Maintaining an unknown transitive attribute subscription rule table for each neighbor can be done as follows: Figure 6 As shown.

[0080] This step 203 specifically includes:

[0081] Step 1: Read the AFI / SAFI content in the message and find the unknown transitible attribute subscription rule table corresponding to this AFI / SAFI for this neighbor;

[0082] 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.

[0083] 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;

[0084] Step 4: Process the entries in the unknown transitive attribute subscription rules described in Step 1 according to the corresponding actions determined.

[0085] The fourth step mentioned above specifically includes:

[0086] If the Action is to delete all, then clear the entries in the Unknown Transitable Property Subscription Rule Table described in the first step;

[0087] 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.

[0088] 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.

[0089] Figure 7 A schematic flowchart of a method for preventing BGP unknown transitive attribute attacks according to an embodiment of this disclosure is shown, such as... Figure 7 As shown in this disclosure, a method for preventing BGP unknown transitive attribute attacks includes: application in ASBR, including:

[0090] Step 701: Set the upper limit for unknown transitive attribute entries and the upper limit for memory overhead in BGP;

[0091] Step 702: Receive BGP neighbor UPDATE message;

[0092] Step 703: Determine whether the received Update message contains an unknown transitive attribute; if yes, proceed to step 704; if no, proceed to step 709.

[0093] The specific judgment process is as follows: parse the attribute list in the Update message, check whether the attribute is "optional and transitive", verify whether the local machine recognizes the attribute, if it satisfies both "optional and transitive" and "not recognized by the local machine", then the attribute is an "unknown transitive attribute".

[0094] Step 704: Read the unknown transitive attribute data content of the Update message;

[0095] Step 705: Search for the unknown transitive attribute data content to be read from the unknown transitive attribute subscription rule table maintained for each neighbor; determine whether it is found. If yes, proceed to step 709; otherwise, proceed to step 706.

[0096] In step 705, the unknown transitive attribute subscription rule table is constructed based on the Route Refresh message received from the neighbor, which contains the unknown transitive attribute data required by the neighbor. The specific construction process will be described in detail below.

[0097] Step 706: Determine whether the number of entries with unknown transitive attributes has reached the set limit for the number of entries or the memory usage has reached the set limit for memory consumption; if yes, proceed to step 707; if no, proceed to step 708.

[0098] Step 707: Discard the unknown transitive attribute data in the Update message and store the Update message.

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

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

[0101] 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.

[0102] 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:

[0103] Step 801: Determine the Update message containing unknown optional transit attributes to be forwarded;

[0104] 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.

[0105] Step 803: Retrieve the attr code and attr len fields of the unknown transitive attribute;

[0106] 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.

[0107] 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.

[0108] Step 805 determines whether the length of the optional transitive attribute meets the range described by the neighbor.

[0109] Step 806: Discard the unknown optional transit attribute and continue forwarding this Update message;

[0110] Step 807: Send the Update message according to the normal BGP processing procedure.

[0111] 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:

[0112] The attribute determination unit is used to determine whether the received Update message contains unknown transitive attributes.

[0113] 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.

[0114] 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.

[0115] 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.

[0116] Based on the same inventive concept as the above disclosure, this disclosure also provides an electronic device. The electronic device of this disclosure includes at least one processor and at least one memory electrically connected to the processor. The memory is electrically connected to the processor, wherein the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method described above.

[0117] It should be noted that the electrical connection between the above-mentioned units does not necessarily mean the connection between lines. The indirect connection method can be applied to the embodiments of this disclosure as long as it achieves the purpose of this disclosure.

[0118] Based on the same inventive concept, this disclosure also provides a computer storage medium storing a computer program, which, when executed by a processor, implements the above-described method.

[0119] Although the present disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and such modifications or substitutions 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 present 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; 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 system receives Route Refresh messages sent by neighboring nodes within the 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 messages received from neighbor nodes, maintain an unknown transitive attribute subscription rule table for each neighbor. Each entry includes three fields: Attr Code, min len, and max len.

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, 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 unknown transitible attribute subscription rule table 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.

5. The method according to claim 4, 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; 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 a filter rule of that type. If not, an entry of that type is added to the unknown transitive attribute subscription rule table; if it already exists, the found entry is modified using the read Max len and Min len. 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.

6. 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.

7. An apparatus for preventing BGP unknown transitive attribute attacks, used to implement the method of claim 1, characterized in that, Applications in ASBR include: 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 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.

8. 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 of any one of claims 1-6.

9. 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-6.