Method and device for acquiring source address verification table item

By leveraging the effective relationship between AS and multiple database verification methods, the accuracy of source address verification table entries is improved, the problem of insufficient accuracy of source address verification in the prior art is solved, and network security is enhanced.

CN119011167APending Publication Date: 2024-11-22HUAWEI TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202310568074.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-18
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

In the prior art, the accuracy of the source address verification table entry is insufficient, resulting in a high probability of errors during the source address verification process, and it is impossible to effectively block the attack traffic.

Method used

By obtaining prefixes based on valid relationships between AS, multiple databases (such as ASPA database and IRR database) are used to verify the validity of relationships between ASs, and improve the accuracy of source address verification table entries.

Benefits of technology

Improve the accuracy of source address verification table entries, reduce the probability of error, enhance network security, and effectively block attack traffic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119011167A_ABST
    Figure CN119011167A_ABST
Patent Text Reader

Abstract

The invention discloses a source address verification table item obtaining method and device, and the method comprises the steps: obtaining a first prefix of a second AS based on an identifier of a first AS and a first corresponding relation, the first corresponding relation comprises the identifier of the first AS, the identifier of the second AS and a first effective relation, and the second AS is located at the downstream of the first AS; and obtaining a source address verification table entry based on an interface communicating with the first AS and the first prefix, the source address verification table entry comprising the first prefix and an identifier of the interface. The prefix is obtained by using the effective relationship between the ASs, so that the error caused by the invalid relationship between the ASs to the prefix obtaining process is reduced, the accuracy of the prefix is improved, and the accuracy of the source address verification table item obtained based on the prefix is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular to a method and device for obtaining source address verification table entries. Background Art

[0002] Source address validation (SAV) is an important means of defending against source address forgery attacks. Many defense schemes, such as unicast reverse path forwarding (uRPF), are based on source address verification. During the source address verification process, the network device verifies the authenticity of the source Internet Protocol (IP) address of the received message based on the source address verification table. If the message does not match the source address verification table entry, the network device will discard the received message, thereby reducing the probability of attack traffic being further forwarded to the network through the network device, helping to block attack traffic and improve network security. At present, the accuracy of the source address verification table entry is insufficient, resulting in a high probability of errors in the source address verification process. Summary of the invention

[0003] The present application provides a method and device for obtaining a source address verification entry, which helps to improve the accuracy of the source address verification entry. The technical solution is as follows.

[0004] In the first aspect, a method for obtaining a source address verification table entry is provided, the method comprising: obtaining a first prefix of a second AS based on an identifier of a first AS and a first corresponding relationship, the first corresponding relationship comprising an identifier of the first AS, an identifier of the second AS and the first valid relationship, the second AS being located downstream of the first AS; obtaining a source address verification table entry based on an interface communicating with the first AS and the first prefix, the source address verification table entry comprising the first prefix and the identifier of the interface. Through the method provided in the first aspect, the prefix is ​​obtained by utilizing the valid relationship between ASs, thereby reducing the error caused by the invalid relationship between ASs in the prefix acquisition process, thereby improving the accuracy of the prefix, and further improving the accuracy of the source address verification table entry obtained based on the prefix.

[0005] In a possible implementation, the first valid relationship is that the area corresponding to the relationship between the two upstream and downstream ASs matches the area corresponding to the customer group, and the customer group includes the two upstream and downstream ASs. In this way, the validity of the relationship between the ASs can be verified based on whether the areas match.

[0006] In a possible implementation, before obtaining the first prefix of the second AS based on the identifier of the first AS and the first corresponding relationship, the method further includes: determining that the first AS and the second AS have the first valid relationship based on the matching of the area corresponding to the first AS with the valid area corresponding to the relationship between the first AS and the second AS. Through the above implementation, the validity of the relationship between ASs is confirmed based on the characteristics of area matching, and then the prefix is ​​obtained using the AS with area matching, thereby eliminating the error caused by the AS with unmatched area in the prefix acquisition process as much as possible, avoiding the prefix of the AS with unmatched area from being mistakenly included in the prefix set, thereby improving the accuracy of the prefix, and then improving the accuracy of the source address verification table entry obtained based on the prefix.

[0007] In a possible implementation, the first valid relationship is a relationship between ASs that have been verified by multiple databases, and at least one of the registration volume, deployment time, digital signature, and certificate authentication of the multiple databases is different. Through the above method, the validity of the relationship between ASs can be verified by combining multiple databases, thereby further improving the reliability of the process of obtaining the source address verification table entry.

[0008] In a possible implementation, before obtaining the first prefix of the second AS based on the identifier of the first AS and the first correspondence, the method further includes: determining that the first AS and the second AS have the first valid relationship based on matching the second correspondence with the third correspondence, the second correspondence includes the identifier of the first AS, the identifier of the second AS, and the relationship between the first AS and the second AS, and the third correspondence includes the identifier of the first AS, the identifier of the second AS, and the relationship between the first AS and the second AS. Through the above implementation, since the validity of the relationship between ASs is verified based on multiple databases, and then the prefix is ​​obtained using the AS verified by multiple databases, the error caused by the AS with mismatched areas in the prefix acquisition process is eliminated as much as possible, thereby improving the accuracy of the prefix, and then improving the accuracy of the source address verification table entry obtained based on the prefix.

[0009] In a possible implementation, the second correspondence is obtained by searching the downstream AS in the ASPA database authorized by the autonomous system service provider based on the identifier of the first AS, and the third correspondence is obtained by searching the downstream AS in the Internet Routing Registration IRR database based on the identifier of the first AS; or the second correspondence is obtained by searching the upstream AS in the ASPA database authorized by the autonomous system service provider based on the identifier of the second AS, and the third correspondence is obtained by searching the upstream AS in the Internet Routing Registration IRR database based on the identifier of the second AS.

[0010] In a possible implementation, the obtaining of the first prefix of the second AS based on the identifier of the first AS and the first corresponding relationship includes: obtaining the identifier of the second AS based on the identifier of the first AS and the first corresponding relationship; obtaining the first prefix based on the identifier of the second AS and a fourth corresponding relationship, wherein the fourth corresponding relationship includes the identifier of the second AS, the first prefix, and the second valid relationship. In the above manner, since the prefix is ​​obtained by utilizing the valid relationship between the AS and the prefix, the error caused by the invalid relationship between the AS and the prefix in the prefix acquisition process is reduced, thereby improving the accuracy of the prefix, and further improving the accuracy of the source address verification table entry obtained based on the prefix.

[0011] In a possible implementation, the second valid relationship is that the area corresponding to the relationship between the prefix and the AS to which the prefix belongs matches the area corresponding to the customer group, and the customer group includes the AS to which the prefix belongs. Through the above implementation, the validity of the relationship between the AS and the prefix is ​​confirmed based on the characteristics of regional matching, thereby eliminating the error caused by the prefix acquisition process due to the prefix that does not match the area as much as possible, avoiding the prefix that does not match the area from being mistakenly included in the prefix set, thereby improving the accuracy of the prefix, and further improving the accuracy of the source address verification table entry obtained based on the prefix.

[0012] In a possible implementation, before obtaining the first prefix based on the identifier of the second AS and the fourth corresponding relationship, the method also includes: determining that the second AS and the first prefix have the second valid relationship based on matching the area corresponding to the second AS with the valid area corresponding to the relationship between the second AS and the first prefix.

[0013] In a possible implementation, the second valid relationship is a relationship between ASs that have been verified by multiple databases, and at least one of the registration volume, deployment time, digital signature, and certificate authentication of the multiple databases is different. In the above manner, the validity of the relationship between the AS and the prefix can be verified based on whether multiple databases have all been verified.

[0014] In a possible implementation, before obtaining the first prefix based on the identifier of the second AS and the fourth correspondence, the method further includes: determining that the second AS has the second valid relationship with the first prefix based on matching the fifth correspondence with the sixth correspondence, the fifth correspondence including the identifier of the second AS, the first prefix, and the relationship between the second AS and the first prefix, and the sixth correspondence including the identifier of the second AS, the first prefix, and the relationship between the second AS and the first prefix. Through the above implementation, since the validity of the relationship between the AS and the prefix is ​​verified based on multiple databases, the accuracy of the prefix is ​​improved, thereby improving the accuracy of the source address verification table entry obtained based on the prefix.

[0015] In a possible implementation, the fifth correspondence is obtained by searching the prefix from the ROA database based on the identifier of the second AS, and the sixth correspondence is obtained by searching the prefix from the IRR database based on the identifier of the second AS; or the fifth correspondence is obtained by searching the belonging AS from the ROA database based on the first prefix, and the sixth correspondence is obtained by searching the belonging AS from the IRR database based on the first prefix.

[0016] In a possible implementation, the first corresponding relationship includes a customer group of the first AS, and the customer group of the first AS includes the first AS and the second AS.

[0017] In a possible implementation, the method is executed by a network device, the network device includes the interface, and the network device is located at an edge of a third AS, where the third AS is located upstream of the first AS.

[0018] In a possible implementation, the method is executed by a control device, and after obtaining the source address verification table entry based on the interface communicating with the first AS and the first prefix, the method further includes: the control device sends the protocol message to a network device, the network device includes the interface, the network device is located at the edge of a third AS, the third AS is located upstream of the first AS, and the protocol message includes the source address verification table entry. Through the above implementation, it is supported that the control device automatically sends the source address verification table entry to the network device.

[0019] In a possible implementation, the protocol message is a Border Gateway Protocol BGP message or a Path Computation Element Protocol PCEP message.

[0020] In a possible implementation, the protocol message is a Border Gateway Protocol Flow Rule BGP FS message, and the BGPFS message includes a Network Layer Reachability Information NLRI field and an extended community attribute field, the NLRI field includes the first prefix, and the extended community attribute field includes an identifier of the interface.

[0021] In the second aspect, a device for acquiring a source address verification table item is provided, and the device for acquiring a source address verification table item has the function of implementing the above-mentioned first aspect or any one of the optional methods of the first aspect. The device for acquiring a source address verification table item includes at least one unit, and the at least one unit is used to implement the method provided by the above-mentioned first aspect or any one of the optional methods of the first aspect. In some embodiments, the unit in the device for acquiring a source address verification table item is implemented by software, and the unit in the device for acquiring a source address verification table item is a program module. In other embodiments, the unit in the device for acquiring a source address verification table item is implemented by hardware or firmware. The specific details of the device for acquiring a source address verification table item provided by the second aspect can be found in the above-mentioned first aspect or any one of the optional methods of the first aspect, and will not be repeated here.

[0022] In a third aspect, a network device is provided, the network device comprising a processor and a network interface, the processor is used to execute instructions so that the network device performs the method provided by the first aspect or any optional manner of the first aspect, and the network interface is used to receive or send a message. The specific details of the network device provided by the third aspect can be found in the first aspect or any optional manner of the first aspect, and will not be repeated here.

[0023] In a fourth aspect, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium. When the instruction is executed on a computer, the computer executes the method provided by the first aspect or any optional manner of the first aspect.

[0024] In a fifth aspect, a computer program product is provided, which includes one or more computer program instructions. When the computer program instructions are loaded and executed by a computer, the computer executes the method provided by the first aspect or any optional manner of the first aspect.

[0025] In a sixth aspect, a chip is provided, comprising a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call and run the computer instructions from the memory to execute the method in the above-mentioned first aspect and any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0027] Figure 2 This is a schematic diagram of a source address verification scenario provided by an embodiment of the present application;

[0028] Figure 3 A flowchart of a BAR-SAV method provided in an embodiment of the present application;

[0029] Figure 4 A flowchart of another BAR-SAV method provided in an embodiment of the present application;

[0030] Figure 5 A flowchart of another BAR-SAV method provided in an embodiment of the present application;

[0031] Figure 6 A schematic diagram of a TLV format provided in an embodiment of the present application;

[0032] Figure 7 A schematic diagram of another TLV format provided in an embodiment of the present application;

[0033] Figure 8 A schematic diagram of another TLV format provided in an embodiment of the present application;

[0034] Fig. 9 A schematic diagram of another TLV format provided in an embodiment of the present application;

[0035] Fig.10 This is a schematic diagram of the format of an NLRI field provided in an embodiment of the present application;

[0036] Fig.11 This is a schematic diagram of the format of an NLRI field provided in an embodiment of the present application;

[0037] Fig.12 This is a schematic diagram of the format of an extended group attribute field provided in an embodiment of the present application;

[0038] Fig.13 It is a flow chart of a method for obtaining a source address verification table entry provided in an embodiment of the present application;

[0039] Fig.14 It is a structural diagram of a device for obtaining a source address verification table entry provided in an embodiment of the present application;

[0040] Fig.15 It is a structural schematic diagram of a device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0042] The following is an explanation of some terminology concepts involved in the embodiments of the present application.

[0043] Source address forgery attack: refers to an attacker disguising himself as a legitimate network device and carrying a forged address in the source address field of the message sent, thereby helping the attacker conceal his identity, deceive other network devices, and perform malicious actions.

[0044] Prefix: It can also be called a network prefix, a network segment, or an IP address segment. The prefix is ​​a part of an IP address, and the prefix indicates the network to which the IP address belongs. Prefixes include the Internet Protocol version 4 (IPv4) prefix and the Internet Protocol version 6 (IPv6) prefix. For example, there is an IPv4 address 192.168.1.50, the subnet mask is 255.255.255.0 (the length of the prefix is ​​24 bits), the prefix of the IPv4 address is 192.168.1.0, and the host number is 50, that is, this IPv4 address belongs to the network 192.168.1.0, and the host number of the host to which this IPv4 address belongs in the network 192.168.1.0 is 50. For the sake of simplicity, the embodiments of the present application will use the form of "P+number" to simplify the specific prefix, where P represents prefix, such as a prefix simplified as P5.

[0045] Autonomous system (AS): refers to a group of network devices with the same routing policy, which are managed by the same entity. Each AS is assigned an AS number (autonomous system number) in the Internet, so that other network devices can find the corresponding AS based on the AS number. For the sake of simplicity, the embodiments of this application will use the form of "AS+number" to simplify the specific AS, such as an AS is simplified as AS 1.

[0046] AS identifier: refers to the data used to identify the AS. For example, the AS identifier is the AS number or the name of the AS. The AS number is also called the AS number. The AS number is a positive integer, and the AS number value range is usually from 1 to 65535.

[0047] Autonomous system path (AS_path): is an AS sequence. AS_path is used to record all ASs that a border gateway protocol (BGP) route passes through from the source AS to the destination AS. Based on AS_path, the relationship between each BGP route sender and its upstream AS can be determined. For example, a pair of adjacent ASs in AS_path represents the upstream AS of the current AS. If the upstream AS is the provider of the current AS, then this pair of ASs has a C2P relationship. For example, in the BGP update message, the AS_path corresponding to prefix P6 is [AS 3AS 1AS 6], which means that prefix P6 originates from AS6, and then prefix P6 passes through AS 1 and AS 3 in turn. AS 6 has a C2P relationship with AS 1, and AS 1 has a C2P relationship with AS 3.

[0048] AS relationship: refers to the relationship between two neighboring ASs. The AS relationship affects the traffic forwarding method and routing selection method between the two ASs. AS relationships include peer to peer (P2P), provider to customer (P2C), customer to provider (C2P), and sibling to sibling (S2S). AS relationships are usually a kind of business relationship, which depends on the business contract signed between the Internet service providers (ISPs) to which the ASs belong.

[0049] A P2P relationship indicates that the status of two neighboring ASs is equal. Two ASs with a P2P relationship will advertise the routes of the AS and the routes of the customer ASs directly connected to the AS to each other. Normally, two ASs with a P2P relationship do not need to pay each other. Normally, two ASs with a P2P relationship will not exchange the routes of the customer ASs of the customer ASs of the AS, thus preventing the other party from accessing the Internet through themselves.

[0050] The C2P relationship indicates that two ASs have a customer-provider relationship. The provider AS provides access to the Internet and forwards business traffic for the customer AS. The customer AS communicates with other parts of the Internet through the provider AS. Usually, the customer AS needs to pay for the bandwidth and network connection services of the provider AS. The routes exchanged between ASs in a C2P relationship are more extensive than those exchanged between ASs in a P2P relationship. Usually, in a C2P relationship, the provider AS sends the routes of its own AS, the routes of its customer ASs, and the routes of the customer ASs (next-level ASs) of its customer ASs to the customer AS. The customer AS sends the routes of its own AS to the provider AS. In this way, the customer AS can obtain a relatively complete routing table through the routes sent by the provider AS, so that it can determine how to send traffic to the network connected to the provider AS; based on the routes sent by the customer AS, the provider AS can determine which traffic should be sent to which customer AS. In the process of traffic forwarding, the customer AS is usually located downstream of the provider AS, and the customer AS can select the provider AS as the next hop to forward the traffic to the destination through the provider AS.

[0051] P2C relationship: It is equivalent to the reverse description of C2P relationship. C2P relationship is described from the perspective of customer AS, while P2C relationship is described from the perspective of provider AS. The contents described in C2P relationship and P2C relationship are consistent.

[0052] S2S relationship: Two ASs with an S2S relationship can freely exchange all routes. A typical example is that two ASs of the same organization (such as two ASs managed by the same city or the same ISP) have an S2S relationship.

[0053] For example, please refer to Table 1, which shows legal AS relationships.

[0054] Table 1

[0055]

[0056]

[0057] Customer cone: The customer cone of an AS is the set consisting of the AS itself, all customer ASs directly connected to the AS, and all customer ASs indirectly connected to the AS. The customer cone of an AS can be constructed by determining the customer AS set of an AS and tracing back to the customer AS set of each AS in the customer AS set. For example, please refer to the attached Figure 1 , attached Figure 1 A circle is used to represent the customer group of AS 3. Each AS within the circle belongs to the customer group of AS 3. Figure 1 As shown, when determining the customer group of AS 3, AS 3 itself can be first determined as an AS in the customer group, and then starting from AS 3, traverse downward step by step to find the ASs at each level, and finally obtain a set of all ASs that can be reached through AS 3. In this set, the AS at the last level no longer has a customer AS. In this example, the customer group of AS 3 is {AS 3, AS 1, AS 2, AS 5, AS 6, AS 7, AS 8}. The customer group is usually an unordered set, and each AS represents the same meaning at any position in the set. For the convenience of description, when describing the customer group, this embodiment puts the owner of the customer group, AS 3, at the front of the customer group, and other ASs other than the owner of the customer group are arranged in increasing order in the customer group from small to large. In addition, this embodiment uses "{}" to represent a set.

[0058] Figure 1 "C2P" is marked between AS 1 and AS 3, indicating that AS 1 is the customer AS of AS 3 and there is a C2P relationship between AS 1 and AS 3. Figure 1 In the P2[AS 2]community:AS 9, it means that the BGP update message sent by AS 2 to AS 3 includes prefix P2 and community attribute, and the value of community attribute is AS 9. P2[AS 2]community:AS 9 means that after AS 2 publishes prefix P2 to AS 3, AS 3 is allowed to further publish prefix P2 to AS 9, but AS 3 is not allowed to further publish prefix P2 to other ASes except AS 9. Figure 1 In the example, P5[AS 5]NO_EXPORT means that after AS 5 publishes prefix P5 to AS 1, AS 1 is not allowed to publish prefix P5 to other ASs. Figure 1 In the example, P8[AS 8]NO_EXPORT means that after AS 8 publishes prefix P8 to AS 2, AS 2 is not allowed to publish prefix P8 to other ASs.

[0059] Autonomous system provider authorization (ASPA) database: a database jointly maintained by ISPs and the Internet Engineering Task Force (IETF). The ASPA database is used to record and manage ASs and the authorized providers corresponding to ASs in the global Internet. For example, the ASPA database includes the identifier of the customer AS and the set of authorized provider ASs. The set of authorized provider ASs includes the identifiers of one or more authorized provider ASs. The authorized provider AS is, for example, an AS that is authorized and allowed to propagate routes received from the customer AS. If a customer AS has multiple authorized provider ASs, the identifier of the customer AS and the identifier of each authorized provider AS in the multiple authorized provider ASs are usually registered in the same record in the ASPA database. For example, AS 1 and provider Y signed a contract; provider Y added a record in the ASPA database, in which the customer AS includes the AS number of AS 1, and the authorized provider list in the record includes the AS number of provider Y, which indicates that AS 1 is managed by provider Y and that provider Y has the right to further publish the prefixes published by AS 1 to the network. The ASPA database is managed based on the resource public key infrastructure (RPKI). RPKI is a technology that verifies the authorization relationship between an IP address and an AS through digital signatures. The ASPA database contains authorization certificates for all ASs in the world. These certificates can help ISPs and other network operators verify whether the AS they are connected to is authorized to connect to a certain area.

[0060] Internet routing registry (IRR) database: a database used to determine and share routing information. In addition, the IRR database records the network topology and the relationship between ASs. The IRR database uses the routing policy specification language (RPSL) to describe the stored data. RPSL is an object-oriented language that defines 13 objects. The autonomous system number (aut-num) is one of the objects used to describe ASs. The AS relationship can be extracted through the routing policy attribute of aut-num. The IRR database allows ISPs, content delivery networks (CDNs) or other network operators to register, publish and maintain routing information in the database. The IRR database provides various tools and query interfaces so that devices can access the data stored in the IRR database through tools or query interfaces. The query interfaces of the IRR database include the World Wide Web Information Query Service (WHOIS) and the RPSL interface. By calling the query interface of the IRR database, the router will send a query request to the IRR database to access the IRR database, thereby obtaining the data stored in the IRR database.

[0061] Route origin authorization (ROA) database: a database that records the correspondence between prefixes and ASs. By querying the ROA database, you can get the prefixes owned by an AS. The ROA database stores ROA records issued by each AS. ROA records contain information such as prefixes owned by the AS and validity period. ROA records are equivalent to a digital certificate. ROA records can prove that a prefix is ​​owned and managed by a specific AS. For example, AS 1 holds the prefix 10.0.0.0 / 24. AS 1 creates a record in the ROA database. The record contains the AS number of AS 1 and the prefix 10.0.0.0 / 24. The record indicates that the prefix 10.0.0.0 / 24 is announced by AS 1, thereby reducing the risk of malicious attacks caused by the prefix owned by AS being announced by other unauthorized ASs. If you need to query which IP address prefixes an AS owns, you can call the query interface provided by the ROA database based on the AS number of the AS to obtain the prefixes owned by the AS. In a possible implementation, considering that the information stored in the ROA database is usually submitted by the AS itself, and not all ASes will submit ROA records, the information in the ROA database may not be complete. When the router queries the prefix, it verifies or supplements the prefix corresponding to the AS in combination with other data sources outside the ROA database, so that the prefix of the AS obtained is more accurate.

[0062] The source address verification table includes one or more source address verification entries (SAV entries). The source address verification entry is used to indicate the correspondence between the prefix and the legal input interface. The source address verification entry includes the prefix and the identifier of the legal input interface. The prefix in the source address verification entry can be an IPv4 prefix or an IPv6 prefix. When the input interface receives a data message, the network device matches the source address of the data message with the prefix in each source address verification entry. If there is a source address verification entry that matches the source address of the data message (the source address of the data message includes the prefix in the source address verification entry), the network device considers that the source address of the data message is legal and forwards the data message; if there is no source address verification entry that matches the source address of the data message, the network device considers that the source address of the data message is illegal and discards the data message.

[0063] The interface identifier may include, for example, the name of the interface, the IP address of the interface, the card number of the interface card where the interface is located, the ID of the interface, the tag of the interface or the group ID of the interface, the board number of the service board where the interface is located, the slot number where the interface is located, the interface number, etc.

[0064] The terms "first correspondence", "second correspondence", "third correspondence" and "fourth correspondence" in the specification and claims of the embodiments of the present application distinguish and describe the correspondence between different data. The following "first correspondence", "second correspondence", "third correspondence" and "fourth correspondence" may all come from a database, for example, where a correspondence is a record in a database. For example, the first correspondence comes from an ASPA database or an IRR database, and the second correspondence comes from a ROA database or an IRR database. For example, the first correspondence comes from the following second ASPA database, and the application of the first correspondence can refer to Embodiment 1-a and Embodiment 1-b. For example, the second correspondence comes from the following second ROA database, and the application of the second correspondence can refer to Embodiment 3-a and Embodiment 3-b.

[0065] The term "first area" in the description and claims of the embodiments of the present application describes an area where the relationship between ASs is related, and the "second area" describes an area where the relationship between prefixes and ASs is related. The first area and the second area can be the same area or different areas.

[0066] Some embodiments of the present application involve correcting customer groups based on regions or multiple databases. In order to distinguish and describe customer groups before and after correction, the term "first customer group" is used below to describe the customer group before correction, such as the initial customer group obtained based on the standard ASPA database, and the term "second customer group" is used below to describe the customer group after correction, such as the first customer group obtained by correcting the first customer group based on regions or multiple databases.

[0067] Some embodiments of the present application involve correcting a prefix set based on a region or multiple databases. In order to distinguish and describe the prefix sets before and after the correction, a "first prefix set" is used below to describe the customer group before the correction, such as an initial prefix set obtained based on a standard ROA database, and a "second prefix set" is used to describe the prefix set after the correction. The second prefix set is obtained by correcting the first prefix set based on a region or multiple databases.

[0068] The following is an example of an application scenario provided in the embodiments of the present application.

[0069] The embodiment of the present application can be applied to the scenario of source address verification. For example, please refer to Figure 2 , Figure 2 This is a schematic diagram of a source address verification scenario provided by an embodiment of the present application. A source address verification table entry is stored on router R2, and the source address verification table entry includes a source prefix and a legal inbound interface. In the source address verification table entry, the content of the source prefix entry is prefix P1, and the content of the legal inbound interface entry is the identifier of interface a. Figure 2The character "a" is used to indicate the identifier of interface a in the source address verification table. Figure 2 The meaning of the source address verification table entry is that, for router R2, the legal inbound interface of the message whose source address in the message header contains the source prefix P1 is interface a.

[0070] As a specific example of successful source address verification, host H1 is the legal holder of prefix P1, and the IP address of host H1 includes prefix P1. Host H1 sends message 1 to host H3, and the source address of message 1 is the IP address of host H1. Message 1 arrives at interface a of router R2. Router R2 matches the source address of message 1 (IP address of host H1) with the source prefix in the source address verification table. Router R2 determines that the source address of message 1 includes prefix P1, and further queries the inbound interface corresponding to prefix P1 to obtain inbound interface a. Router R2 determines that the interface on which message 1 is received is the same as the inbound interface queried from the source address verification table. Router R2 passes the source address verification of message 1, allowing message 1 to pass through router R2.

[0071] As a specific example of source address verification failure, the attacker controls host H2 to send message 2. The source address of message 2 includes a forged source IP address, which also includes prefix P1. Message 2 arrives at interface b of router R2. Router R2 matches the source address of message 2 with the source prefix in the source address verification table. Router R2 determines that the source address of message 2 includes prefix P1, and then further queries the inbound interface corresponding to prefix P1 to obtain inbound interface a. Router R2 determines that the interface (interface b) on which message 2 is received is different from the interface (interface a) queried from the source address verification table. Router R2 fails to verify the source address of message 2, and router R2 discards message 2, making it impossible for message 2 to be further forwarded through router R2.

[0072] Considering the strong connectivity of the Internet today, by adopting a source address verification solution to verify the inbound interface corresponding to the source address of the message, inbound interface anomalies can be detected to a great extent, reducing the risk caused by source address forgery.

[0073] Source address validation using BGP UPDATEs, ASPA, and ROA (BAR-SAV) is a method of using BGP update messages, ASPA database, and ROA database to perform source address validation. This method obtains more accurate source address validation entries through BGP update messages, ASPA database, and ROA database. Therefore, based on the address validation entries, routers that deploy source address validation can more accurately determine which inbound interface or interfaces of the device a message carrying a legitimate source address will arrive at, thereby reducing the probability of errors in the source address validation process.

[0074] Attached Figure 3 The flowchart of the BAR-SAV method provided in the embodiment of the present application includes the following steps S32 to S38.

[0075] The execution subject of the following steps S32 to S38 is, for example, a network device that performs source address verification. The network device is, for example, a router, a switch, or a firewall. The network device is, for example, deployed at the border of an AS, and the network device is, for example, called an autonomous system boundary router (ASBR). The object of source address verification is the customer group of the AS connected to the input interface of the network device on which source address verification is deployed. The "first AS" is used below to describe the AS connected to the input interface of the network device that performs source address verification, and the first AS may also be called the verified AS. For example, in the attached Figure 1 In the network topology shown, there is a C2P relationship between AS 3 and AS 4. Router R2 is deployed in AS 4. Router R2 includes interface a, and interface a is connected to AS 3. Interface a is deployed with source address verification. By performing source address verification, router R2 can filter out source address forged traffic from AS 3's customer group from the traffic received on interface a. In this scenario, router R2 is a network device and AS 3 is the first AS.

[0076] The execution subject of the following steps S32 to S38 is also a control device. The control device is used to control and manage the network device that performs source address verification. The control device is, for example, a controller, a centralized diagnostic device, or a centralized management device. The control device communicates with the network device that performs source address verification through a control plane protocol or a management plane protocol. For example, the control device communicates with the network device that performs source address verification through BGP, path computation element protocol (PCEP), BGP monitoring protocol (BMP), or netstream protocol.

[0077] Step S32: Acquire the customer group of the first AS.

[0078] For example, the network device is a router R2 deployed in AS 4, the first AS is AS 3 connected to the router R2, and the router R2 obtains the customer group of AS 3 based on the ASPA database and the BGP update message received by the router R2.

[0079] Illustratively, the publicly available ASPA database is shown in Table 2 below.

[0080] Table 2

[0081] Customer AS identification Authorization provider AS collection AS 3 {AS 4,AS 9} AS 5 {AS 1} AS 6 {AS 1} AS 8 {AS 2} AS 10 {AS 11,AS 12} AS 20 {AS 21,AS 22,AS 23}

[0082] The network device queries the ASPA database shown above based on AS 3. For example, the network device determines whether the authorized provider AS set in each record in the ASPA database includes AS 3, so as to learn which ASs have registered AS 3 as the authorized provider of this AS in the ASPA database. In this example, the network device does not query the client AS of AS 3 in the ASPA database, indicating that no AS has registered AS 3 as the authorized provider of this AS in the ASPA database.

[0083] Exemplarily, the BGP update message received by the network device from AS 3 includes the content shown in Table 3 below.

[0084] Table 3

[0085] Prefix AS_path P6 [AS 3AS 1AS 6] P7 [AS 3AS 1AS 7]

[0086] The network device traverses all received BGP update messages. The network device determines whether the AS_path in the received BGP update message contains AS 3, obtains the BGP update message whose AS_path contains AS 3 from all received BGP update messages, such as P2 [AS 9AS 3AS 2] in the following table, and summarizes the BGP update message set shown in Table 4 below.

[0087] Table 4

[0088] Prefix AS_path P2 [AS 9AS 3AS 2] P6 [AS 3AS 1AS 6] P7 [AS 3AS 1AS 7]

[0089] After the network device obtains the BGP update message set whose AS_path includes AS3, based on the AS_path in each BGP update message in the BGP update message set, the network device obtains the AS located downstream of AS 3 from the AS_path as the AS in the customer group of AS 3. For example, the network device obtains AS2 from the AS_path [AS 9AS 3AS 2] according to the first entry in Table 4 above; the network device obtains AS 1 and AS 6 from the AS_path [AS 3AS 1AS 6] according to the second entry in Table 4 above; the network device obtains AS 1 and AS 7 from the AS_path [AS 3AS 1AS 7] according to the third entry in Table 4 above. Therefore, the network device determines that {AS 3,AS 1,AS 2,AS 6,AS 7} is a subset of the customer group of AS 3. The network device uses the set {AS3, AS 1, AS 2, AS 6, AS 7} as the initial customer group of AS 3, traverses the ASPA database according to the AS in the initial customer group, and executes the following steps (1) to (7).

[0090] Step (1) The network device uses the first AS AS 3 in the initial customer group as the provider AS and searches for the customer AS in the publicly available ASPA database. Specifically, for a record in the ASPA database, it is determined whether the authorized provider AS set in the record includes AS 3. If the authorized provider AS set includes AS 3, the customer AS in the record is further obtained. After the query, it returns empty, which means that no AS in the ASPA database has registered AS 3 as the provider AS of the cost AS.

[0091] Step (2) The network device uses the next AS AS 1 in the customer group as the provider AS, queries the customer AS in the ASPA database, and obtains AS 5 and AS 6. AS 6 is already in the AS3 customer group, and the network device adds the newly added AS 5 to the end of the initial customer group, and updates the initial customer group of AS 3 to {AS 3,AS 1,AS 2,AS 6,AS 7,AS 5}.

[0092] Step (3) The network device uses the next AS AS 2 in the initial customer group as provider A to query the customer AS in the ASPA database and obtains AS 8. AS 8 is not yet in the AS 3 customer group. The network device adds the newly added AS 8 to the end of the initial customer group and refreshes the AS 3 customer group to {AS 3, AS 1, AS 2, AS 6, AS 7, AS 5, AS 8}.

[0093] Step (4) The network device uses the next AS AS 6 in the customer group as the provider AS, queries the customer AS in the ASPA database, and returns null.

[0094] Step (5) The network device uses the next AS AS 7 in the customer group as the provider AS, queries the customer AS in the ASPA database, and returns nothing.

[0095] Step (6) The network device uses the next AS AS 5 in the customer group as the provider AS, queries the customer AS in the ASPA database, and returns nothing.

[0096] Step (7) The network device uses the next AS AS 8 in the customer group as the provider AS, queries the customer AS in the ASPA database, and returns null.

[0097] AS 8 is already the last AS in the AS 3 customer group {AS 3,AS 1,AS 2,AS 5,AS 6,AS 7,AS 8}. The network device ends the query process and uses the AS 3 customer group {AS 3,AS 1,AS 2,AS 5,AS6,AS 7,AS 8} obtained after the query as the AS 3 customer group.

[0098] The network device performs the above-mentioned process of obtaining the authorized provider list step by step by determining the initial customer group based on the BGP update message, so that it can obtain the identifiers of some customer ASs that cannot be obtained through the received BGP routing information, making the obtained customer group more complete. For example, for AS 5 in the AS 3 customer group, since the network device has not received the BGP update message whose AS_path includes AS 5 and AS 3, the network device cannot obtain AS 5 as an AS in the AS 3 customer group based only on the BGP routing information. However, the network device can determine that the customer ASs of AS 1 include AS 5 by querying the authorized provider list based on AS 1 in the BGP update message, thereby obtaining AS 5 as an AS in the AS 3 customer group.

[0099] When the network device queries the ASPA database based on the initial customer group determined by the BGP update message, the ASPA database of the customer group of AS 3 used is shown in Table 5 below.

[0100] Table 5

[0101] Customer AS identification Authorization provider AS collection AS 5 {AS 1} AS 6 {AS 1} AS 8 {AS 2}

[0102] The first column in the above table is the customer AS, and the second column is the set of authorized providers of the customer AS.

[0103] Step S34, obtaining the IP address prefix set of the customer group belonging to the first AS.

[0104] An example of a publicly available ROA database is shown in Table 6 below.

[0105] Table 6

[0106]

[0107] Exemplarily, the network device starts to query the IP address prefix set belonging to the customer group {AS 3, AS 1, AS 2, AS 5, AS 6, AS 7, AS 8} of AS3 that has been found. The process of querying the IP address prefix set includes steps A to D.

[0108] Step A, the network device obtains the customer group of AS3 {AS 3,AS 1,AS 2,AS 5,AS 6,AS 7,AS 8}.

[0109] Step B: The network device obtains the full BGP update message whose AS_path includes AS 3, as shown in Table 6 above.

[0110] Step C: The network device obtains the ROA data of the customer group of AS 3. For example, the network device uses each AS in the customer group of AS 3 to query the prefix corresponding to the AS in the ROA database one by one, and the obtained results are shown in Table 7 below.

[0111] Table 7

[0112]

[0113] In step D, the network device traverses the ASs in the customer group of AS 3 one by one. For the traversed AS, the prefix corresponding to the AS is obtained from the BGP update message obtained in step B, and the prefix corresponding to the AS is obtained from the ROA data obtained in step C. Based on this, the full prefix of the customer group belonging to AS 3 is queried, as shown in Table 8 below.

[0114] Table 8

[0115] Query AS Prefix obtained from BGP update message Prefix obtained from ROA database AS 3 none none AS 1 none none AS 2 P2 P3 AS 5 none P5 AS 6 P6 P6 AS 7 P7 none AS 8 none P8

[0116] Step S38: Acquire a source address verification entry based on the interface on the network device connected to the first AS and the prefix set.

[0117] For example, the network device generates a source address verification entry based on the prefix set {P2, P3, P5, P6, P7, P8} obtained in step S34 and the interface (such as interface a in the figure) connected to AS 3 on the network device. A source address verification entry is, for example, a row in Table 9 below.

[0118] Table 9

[0119]

[0120]

[0121] Optionally, the BAR-SAV method further includes the following step S40.

[0122] Step S40: The network device performs source address verification on the data message received from the client group of the first AS according to the source address verification table entry.

[0123] The source address verification process can be found in the above Figure 2 Description.

[0124] In the process of executing step S32 to obtain the customer base of AS, the AS relationship processing is oversimplified, and it is believed that there is only a single relationship between a pair of ASs. For example, it is believed that the AS relationship can only be one of P2P, C2P, P2C or S2S. However, in different regions, there may be different relationships between ASs. In other words, the relationship between ASs may change depending on the region. For example, a pair of ASs may have a C2P relationship only in a specific region, but not in other regions. Therefore, in the process of obtaining the customer base, if the region is not taken into consideration, the obtained customer base may be wrong.

[0125] For example, in area A, the network performance of AS 2 is better than that of AS 1, AS 1 is a customer of AS 2, AS 1 accesses AS 2, AS 1 accesses the Internet through AS 2, AS 2 charges AS 1, and AS 1 and AS 2 have a C2P relationship in area A. In area B, the network of AS 2 is weaker than that of AS 1, AS 2 is a customer of AS 1, AS 2 accesses AS 1, AS 1 charges AS 2, AS 2 accesses the Internet through AS 1, and AS 1 and AS 2 have a P2C relationship in area B. If AS 1 and AS 2 are registered as a C2P relationship in the ASPA database, but the C2P relationship is not reflected in the ASPA database as corresponding to region A, then when AS 2 is in region B, the customer base of AS 2 is collected through the ASPA database, and AS 1 is treated as a customer of AS 2, which is wrong. If the relationship between AS 1 and AS 2 is not registered in the ASPA database, when AS 2 is in region A, the result that AS 1 is a customer of AS 2 cannot be obtained from the ASPA database.

[0126] In view of this, in some embodiments of the present application, in the BAR-SAV processing flow, in the process of obtaining the customer group, based on the ASPA database that reflects the region, the customer AS that does not match the region is deleted from the customer group of the first AS, thereby correcting the obtained customer group to a certain extent, improving the accuracy of the customer group, and thereby improving the accuracy of the source address verification.

[0127] In order to distinguish whether the description reflects the ASPA database of the region, the "first ASPA database" is used to describe the standard ASPA database without the regional identification, and the "second ASPA database" is used to describe the ASPA database containing the regional identification.

[0128] Please refer to the above description for the first ASPA database. The second ASPA database includes the correspondence between the identifier of the customer AS, the set of authorized provider ASs, and the regional identifier. The regional identifier is used to identify the region, specifically to identify the region where the C2P relationship between two ASs is valid. The data form of the regional identifier is, for example, the name of the region, the number assigned to the region, or the location coordinates of the region.

[0129] For example, the second ASPA database includes at least one record, each record includes a customer AS field, an authorized provider AS set field, and a region field. For example, AS 1 and AS 2 register a C2P relationship in Europe, then a record is created in the second ASPA database, in which the customer AS field includes the identifier of AS 1, the authorized provider AS set field includes the identifier of AS 2, and the region field includes Europe, which means that AS 1 and AS 2 have a C2P relationship in Europe.

[0130] Compared with the first ASPA database, the second ASPA database has an additional area identifier, so it can determine in which area two neighbor ASs register the C2P relationship, or in which area the C2P relationship between the two neighbor ASs is valid.

[0131] Regarding the method of obtaining the second ASPA database, for example, the network device locally stores the second ASPA database. In a possible implementation, the network device collects the registration areas of the C2P relationship between ASs, the network device obtains the area identifier corresponding to the registration area, and the network device adds the area identifier corresponding to the registration area to the first ASPA database stored in the network device. For another example, the second ASPA database is stored on a storage device connected to the network device via a communication network, the network device sends a query request to the storage device, and the storage device sends the data stored in the second ASPA database to the network device in response to the query request.

[0132] The following uses Example 1-a to Example 1-b to illustrate the process of acquiring a customer group. The execution subject of the following Example 1-a to Example 1-b is, for example, a network device or a control device.

[0133] Example 1-a

[0134] Step S321: Based on the first ASPA database, obtain the identifier of each AS in the first customer group of the first AS and the authorized provider list corresponding to each AS in the first customer group.

[0135] The first customer group includes at least one customer AS of the first AS. By way of example, the process of obtaining the first customer group includes steps (1) to (3).

[0136] Step (1) takes the first AS as the authorization provider AS and searches the first AS's customer AS in the first ASPA database.

[0137] Step (2) based on the BGP update message, obtain the downstream AS of the first AS in the AS_path;

[0138] Step (3) takes the downstream AS of the first AS as the authorized provider AS and searches the first ASPA database for the customer AS corresponding to the downstream AS of the verification AS.

[0139] The above step (3) can be performed once or multiple times. Performing multiple times means that the queried customer AS is used as the authorized provider AS again to query the corresponding customer AS in the first ASPA database.

[0140] The first customer group includes the customer AS obtained in step (1) and the customer AS obtained in step (3).

[0141] Step (1) may be performed first, and then steps (2) to (3); steps (2) to (3) may be performed first, and then step (1); or steps (2) and (1) may be performed simultaneously. For details of the query, please refer to the description of step S32.

[0142] For example, the network device is in AS 4, and the first AS is AS 3 connected to the inbound interface of the network device. The network device uses the first ASPA database to obtain the AS in the customer group belonging to AS 3; for example, the network device queries the customer AS corresponding to AS 3 in the first ASPA database based on AS 3, but does not find the customer AS corresponding to AS 3; the network device queries the downstream AS of AS 3 in the received BGP update message based on AS 3, and obtains AS 1 and AS 2. Based on AS 1 and AS 2, the network device queries the customer AS corresponding to AS 1 and the customer AS corresponding to AS 2 in the first ASPA database, and obtains the customer group {AS5AS 6AS 8} of AS 3 and the authorized provider list corresponding to the first customer group, as shown in Table 10 below.

[0143] Table 10

[0144]

[0145]

[0146] Step S322: Based on the first customer group, the authorized provider list and the second ASPA database, obtain the first area identifier corresponding to each AS in the first customer group.

[0147] The following takes the process of obtaining the first area identifier for an AS (third AS) in the first customer group as an example, and the process of obtaining the first area identifier for other ASs in the first customer group is the same as the process of obtaining the first area identifier for the third AS. The first customer group includes the third AS, the authorized provider AS set in the first ASPA database includes the second AS, and the third AS is obtained by querying the customer AS in the first ASPA database based on the AS identifier of the second AS.

[0148] For example, in the process of executing step S322, based on the AS identifier of the third AS and the AS identifier of the second AS, the second ASPA database is searched. If the customer AS field in a record in the second ASPA database includes the AS identifier of the third AS, and the authorized provider AS set field in the record includes the identifier of the second AS, the first area identifier in the record is further queried as the first area identifier corresponding to the third AS.

[0149] As a specific example, the network device executes step S321, and obtains that the customer group of AS 3 includes {AS 5AS 6AS8}. For AS 6 in the customer group, AS 6 is a customer AS obtained based on the query of AS 1. The network device queries the second ASPA database based on the AS number of AS 6 and the AS number of AS 1, and obtains the results shown in Table 11 below. The meaning of Table 11 below is that AS 6 and AS 1 have a C2P relationship in Europe. Among them, AS 3 is a specific example of the first AS, AS 1 is a specific example of the second AS, AS 6 is a specific example of the third AS, and Europe is a specific example of the identifier of the first region.

[0150] Table 11

[0151]

[0152] In a possible implementation, if no record corresponding to the third AS is found in the second ASPA database, indicating that the third AS registers a global entry, it is determined that the C2P relationship between the third AS and the second AS is globally valid, and the third AS is retained in the first customer group.

[0153] Step S323: Based on the region where the first AS is located and the first region identifier corresponding to each AS in the first customer group, correct the first customer group to obtain a second customer group.

[0154] Regarding the method of determining the area where the first AS is located, when the network device and the first AS are in the same area, the network device can determine the area where the device is currently located as the area where the first AS is located. When the network device and the first AS are in different areas, the network device can communicate with the first AS and receive the area where the first AS is located sent by the first AS.

[0155] In a possible implementation, if the first AS is located in the area indicated by the first area identifier, it is determined that the AS corresponding to the first area identifier is accurate, and the AS corresponding to the first area identifier is retained in the customer group. If the first AS is not located in the area indicated by the first area identifier, it is determined that the AS corresponding to the first area identifier is inaccurate, and the AS corresponding to the first area identifier is deleted from the customer group. Based on this method, the customer group is corrected, and the AS in the first customer group whose area does not conform to the actual situation is excluded, so as to obtain a more accurate second customer group.

[0156] The following is an example of determining whether to delete the third AS from the customer group. The logic of determining whether to delete other ASs from the customer group is similar. For example, the first customer group includes the third AS, and the third AS is obtained by querying the customer AS in the first ASPA database using the second AS as the authorized provider AS. The second ASPA database records that the third AS and the second AS have a C2P relationship in the first area. For example, the second ASPA database includes the correspondence between the AS identifier of the third AS, the AS identifier of the second AS, and the first area identifier. If the first AS is located in the first area, it is determined that the third AS is a suitable AS in the customer group, and the third AS is retained, so the third AS is included in the determined second customer group. If the first AS is not located in the first area, the third AS is deleted from the first customer group, so the third AS is not included in the determined second customer group. Based on the above method, it is equivalent to verifying the accuracy of the ASs in the customer group one by one in combination with the area where the first AS is located, thereby reducing the probability of an erroneous AS appearing in the customer group.

[0157] For example, the network device executes step S321 and obtains that the customer group of AS 3 includes {AS 5AS 6AS 8}. Among them, AS6 is the customer AS obtained based on the query of AS 1. The network device uses AS 6 as the customer AS and queries the second ASPA database to obtain the results shown in Table 11 above. Table 11 above shows that the authorized provider AS set corresponding to AS 6 includes {AS 1}, and the first region identifier corresponding to AS 6 is Europe. If AS 3 is not currently in Europe, it is determined that AS 6 verification fails, and AS 6 is deleted from the customer group of AS 3. If AS 3 is not currently in Europe, it is determined that AS 6 verification passes, and AS 6 is retained from the customer group of AS 3.

[0158] In the above implementation, the first area identifier is obtained from the second ASPA database based on the two parameters of the customer group and the authorized provider. In another possible implementation, the first area identifier can also be obtained from the second ASPA database based on one of the customer group or the authorized provider list. For example, embodiment 1-a can also be implemented through the following steps S321' to S323'.

[0159] Step S321': based on the first ASPA database, obtain the first customer group of the first AS.

[0160] Step S322': based on the first customer group and the second ASPA database, obtain the first area identifier corresponding to each AS in the first customer group.

[0161] In an exemplary scenario, an ISP announces that the AS managed by the ISP only appears in a specific area, and the AS is illegal if it appears in other areas. In this scenario, when obtaining the first area identifier, it is not necessary to consider the authorized provider list. For example, for the third AS, when obtaining the first area identifier, the first area identifier can be searched from the second ASPA database based on the AS identifier of the third AS, without considering the authorized provider AS of the third AS.

[0162] Step S323': based on the area where the first AS is located and the first area identifier corresponding to each AS in the first customer group, correct the first customer group to obtain a second customer group.

[0163] The method provided in this embodiment verifies the AS in the customer group based on the area where the first AS is located and the second ASPA database, and deletes the AS that fails the verification from the customer group, thereby reducing the probability of erroneous AS that does not match the area appearing in the customer group, improving the accuracy of the customer group, and reducing the probability of errors in the subsequent source address verification process.

[0164] Example 1-a describes the process of obtaining a customer base based on two databases (a first ASPA database and a second ASPA database). In Example 1-a, the global ASPA database (the first ASPA database) and the ASPA database (the second ASPA database) containing the first regional identifier are separated from each other, thereby reducing the difficulty of implementing changes to the global ASPA database. In other embodiments, the two databases (the first ASPA database and the second ASPA database) are merged into one database, such as merging the first regional identifier with the global ASPA database to form a unified ASPA database, thereby saving one database search operation in the process of obtaining a customer base, which is illustrated below by Example 1-b.

[0165] Example 1-b

[0166] Step S321″: based on the second ASPA database, obtain the first customer group of the first AS and the first area identifier corresponding to each AS in the first customer group.

[0167] For example, the process of acquiring the first customer group includes steps (1) to (3).

[0168] Step (1) takes the first AS as the authorized provider AS, and searches the second ASPA database for the customer AS corresponding to the first AS and the first area identifier corresponding to the customer AS.

[0169] Step (2) obtains the downstream AS of the first AS in the AS_path based on the BGP update message.

[0170] Step (3) takes the downstream AS of the first AS as the authorized provider AS, and searches the second ASPA database for the customer AS corresponding to the downstream AS of the first AS and the first area identifier corresponding to the customer AS.

[0171] The first customer group includes the customer AS obtained in step (1) and the customer AS obtained in step (3).

[0172] Step S322', based on the area where the first AS is located and the first area identifier corresponding to each AS in the first customer group, correct the first customer group to obtain a second customer group.

[0173] The above step S322" is similar to step S323, and reference may be made to the description of step S323.

[0174] The method provided in this embodiment simplifies the process of obtaining a customer group based on two databases in Embodiment 1-a to obtaining a customer group based on one database, thereby not only excluding ASs in the customer group that do not match the region and obtaining a more accurate customer group, but also simplifies the process of searching the database twice to searching the database once, thereby saving the process of querying the database once, reducing the operational complexity caused by searching the database twice, and improving the efficiency of obtaining the customer group.

[0175] Example 1-a and Example 1-b describe a method for improving the accuracy of customer groups based on an ASPA database containing a first regional identifier. The ASPA database containing the first regional identifier in Example 1-a and Example 1-b can also be replaced by other databases that record AS relationships and the areas where the AS relationships are located. For example, the ASPA database containing the first regional identifier is replaced by an IRR database containing the first regional identifier. For example, a record in the IRR database includes an AS identifier field, a relationship field, and an area field, the AS identifier field includes the AS identifier of each AS in two neighboring ASs, the relationship field is used to describe the relationship between the two neighboring ASs, and the area field includes the first area identifier. Alternatively, the ASPA database containing the first regional identifier is replaced by other forms of correspondence outside the database, including the identifier of the customer AS, the identifier of the authorized provider AS, and the first regional identifier, the first regional identifier can be obtained from the IRR database, and the customer group can be obtained based on the first regional identifier. In the case of adopting this method, the record in the IRR database is an example of the first corresponding relationship.

[0176] In summary, the methods of the above-mentioned embodiments 1-a and 1-b, since the correspondence between the AS relationship and the first area identifier is recorded, in the process of obtaining the customer group, based on the area where the first AS is located and the area indicated by the first area identifier, verify whether the AS relationship corresponding to the first area identifier is established, delete the AS for which the C2P relationship is not established from the customer group, and retain the customer AS for which the C2P relationship is established in the customer group, thereby avoiding the AS that does not have a C2P relationship in the area where the first AS is located from being mistakenly included in the customer group, thereby improving the accuracy of the customer group.

[0177] Furthermore, based on a more accurate customer base, it helps to obtain more accurate source address verification entries, thereby improving the accuracy of source address verification and reducing the security risks caused by attackers launching source address attacks.

[0178] The above describes an implementation method for improving the accuracy of the customer group by considering the region. In another possible implementation method, using IRR data to supplement the customer group can also improve the accuracy of the customer group to a certain extent. The following example is illustrated by Example 2-a. The execution subject of the following Example 2-a is, for example, a network device, or a control device.

[0179] Example 2-a

[0180] Step S321a: Based on the ASPA database, obtain the first customer group of the first AS and the authorized provider list corresponding to the first customer group.

[0181] The ASPA database is, for example, a standard global ASPA database without a region identifier (a first ASPA database), or an ASPA database with a region identifier (a second ASPA database). For step S321a, reference may be made to the description of step S321.

[0182] Step S322b: Based on the IRR database, obtain the AS relationship between the first customer group and the authorized provider list.

[0183] The query method of the IRR database includes the following query method A and query method B. The following is described by taking the process of querying the IRR database for an AS (third AS) in the first customer group as an example. The query process for other ASs in the first customer group is the same as the query process for the third AS. Among them, the first customer group includes the third AS, the authorized provider AS set in the first ASPA database includes the second AS, and the third AS is obtained by querying the customer AS in the first ASPA database based on the second AS.

[0184] The first query method of the IRR database is to use the identifiers of a pair of ASs to query the relationship between the two ASs.

[0185] For example, in the process of executing step S322b, based on the identifier of the third AS and the identifier of the second AS (such as the AS number of the third AS and the AS number of the second AS), a query is performed in the AS identifier field in each record in the IRR database. If the AS identifier field in a record includes the identifier of the third AS and the identifier of the second AS, the relationship field in the record is further queried to obtain the relationship between the third AS and the second AS from the relationship field.

[0186] The query results (AS relations) obtained from the IRR database include three cases.

[0187] Case 1: Confirm that the relationship between a pair of neighboring ASs is a C2P relationship.

[0188] Case 2: Confirm that the relationship between a pair of neighboring ASs is not a C2P relationship.

[0189] Case 3: There is no relationship description of a pair of neighboring ASs in the IRR database.

[0190] For example, the network device is in AS 4, and the first AS is AS 3 to which the network device is connected. The network device obtains the first customer group based on the first ASPA database with the authorized provider AS set as shown in Table 10. The network device uses each AS in the customer group {AS 5AS 6AS 8} of AS 3 shown in Table 10 to query in the IRR database to verify whether the authorized provider AS set shown in Table 10 is accurate. The network device queries the relationship between AS 5 and AS 1 recorded in the IRR database based on the identifier of AS 5 and the identifier of AS 1, and the query result obtained is used to describe the C2P relationship. The network device queries the relationship between AS 6 and AS 1 recorded in the IRR database based on the identifier of AS 6 and the identifier of AS 1, and the query result obtained is used to describe the non-C2P relationship. The network device queries the relationship between AS 8 and AS 2 recorded in the IRR database based on the identifier of AS 8 and the identifier of AS 2, and no relationship between AS 8 and AS 2 is found. The query result is shown in Table 12. Among them, AS 3 is a specific example of the first AS, AS 1 is a specific example of the second AS, AS 5 is a specific example of the third AS, and the C2P relationship is a specific example of the relationship between AS 1 and AS 5.

[0191] Table 12

[0192] The ID of the customer AS Authorization provider AS collection IRR database query results (relationships between ASs) AS 5 {AS 1} AS 5 and AS 1 are in a C2P relationship AS 6 {AS 1} AS 6 and AS 1 are not in a C2P relationship AS 8 {AS 2} No description of the relationship between AS 8 and AS 2

[0193] The second query method of IRR database is to use the customer AS to query the service provider AS.

[0194] For example, in the process of executing step S322b, the third AS is taken as the client AS, and the authorized provider AS set corresponding to the third AS is queried in the IRR database. It is determined whether the authorized provider AS set corresponding to the third AS in the IRR database includes the second AS. If the authorized provider AS set corresponding to the third AS in the IRR database includes the second AS, it is determined that the IRR database records that there is a C2P relationship between the third AS and the second AS. If the authorized provider AS set corresponding to the third AS in the IRR database does not include the second AS, it is determined that the IRR database records that there is no C2P relationship between the third AS and the second AS.

[0195] For example, the network device is in AS 4, and the first AS is AS 3 to which router R2 is connected. The network device obtains a first customer group based on the first ASPA database with an authorized provider AS set as shown in Table 10. The network device uses each AS in the customer group {AS 5AS 6AS 8} of AS3 shown in Table 10 to query in the IRR database. AS 5 is used to find an authorized provider AS set in the IRR database, for example, {AS 5AS 11AS 12}. Since the authorized provider AS set found in the IRR database includes AS 5, it is determined that the IRR database records that AS 5 has a C2P relationship with the second AS; AS 5 is used to find an authorized provider AS set in the IRR database, for example, {AS 1AS 11AS 12}. Since the authorized provider AS set {AS 1AS 11AS 12} found in the IRR database includes AS 1, it is determined that the IRR database records that AS 5 has a C2P relationship with AS1; AS 6 is used to find an authorized provider AS set in the IRR database, for example, {AS 11AS12}. Since the authorized provider AS set {AS 11AS 11} found in the IRR database includes AS 1, it is determined that the IRR database records that AS 5 has a C2P relationship with AS1. 12} does not include AS 1, it is determined that there is no description of the relationship between AS 6 and AS 1 in the IRR database or the IRR database records that there is no C2P relationship between AS 6 and AS 1.

[0196] Step S323c: Based on the AS relationship obtained from the IRR database, the first customer group is corrected to obtain a second customer group.

[0197] The following takes the logic of determining whether to retain the third AS in the first customer group as an example, and the logic of determining whether to retain other ASs in the first customer group is similar. The third AS is obtained based on the second AS querying the customer AS in the first ASPA database.

[0198] Case 1: The relationship between the third AS and the second AS obtained from the IRR database is a C2P relationship.

[0199] Case 1 is equivalent to the ASPA database and the IRR database having the same description of the relationship between the third AS and the second AS, and both the ASPA database and the IRR database confirm that there is a C2P relationship between the third AS and the second AS. In case 1, it is determined that the third AS is a suitable AS in the customer group, and the third AS is retained, so that the second customer group still includes the third AS.

[0200] Case 2: The relationship between the third AS and the second AS obtained from the IRR database is not a C2P relationship.

[0201] Case 2 is equivalent to the ASPA database and the IRR database having inconsistent descriptions of the relationship between the third AS and the second AS. The ASPA database confirms that there is a C2P relationship between the third AS and the second AS, while the IRR database denies that there is a C2P relationship between the third AS and the second AS. In case 2, the IRR database can be trusted first and the third AS can be deleted from the first customer group so that the second customer group does not include the third AS. Alternatively, the ASPA database can be trusted first and the third AS can be retained so that the obtained second customer group still includes the third AS. For example, a policy is configured on a network device. In case 2, whether to delete the third AS from the first customer group is determined based on the policy.

[0202] Case 3: There is no description of the relationship between the third AS and the second AS in the IRR database.

[0203] In case 3, the third AS can be deleted from the first customer group, and the obtained second customer group does not include the third AS; or the third AS can be retained, and the obtained second customer group still includes the third AS. For example, a policy is configured on the network device, and in case 3, the network device determines whether to delete the third AS from the first customer group according to the policy.

[0204] In a possible implementation, the policy includes the priority of the IRR database and the priority of the ASPA database, and the network device determines whether to delete the third AS from the first customer group according to the priority of the IRR database and the priority of the ASPA database. For example, if the priority of the IRR database is higher than the priority of the ASPA database, the network device deletes the third AS from the first customer group. If the priority of the IRR database is lower than the priority of the ASPA database, the network device retains the third AS from the first customer group.

[0205] For example, the AS3 customer group obtained by the network device at AS4 from the ASPA database is {AS 5AS 6AS 8}, and the specific query results are shown in Table 10. The query results obtained from the IRR database using each AS in the customer group {AS 5AS 6AS 8} are shown in Table 12. The C2P relationship between AS 5 and AS 1 has been reconfirmed by the IRR data, so AS 5 continues to remain in the AS 3 customer group; the AS relationship between AS 6 and AS 1 has been verified as a non-C2P relationship by the IRR data, and the network device can determine whether AS 6 should be retained in the AS 3 customer group through the policy; no relationship record between AS 8 and AS 2 is found in the IRR data, and the network device can determine whether AS 8 should be retained in the AS 3 customer group through the policy.

[0206] The above strategies include, for example, the following strategy 1 or strategy 2.

[0207] Strategy 1: If the relationship between the third AS and the second AS obtained from the IRR database is a C2P relationship, keep the third AS in the first customer group. If the relationship between the third AS and the second AS obtained from the IRR database is not a C2P relationship, delete the third AS from the first customer group. If there is no relationship description between the third AS and the second AS in the IRR database, delete the third AS from the first customer group.

[0208] For example, the first customer group is {AS 5AS 6AS 8}, and the query results obtained from the IRR database are shown in Table 12. The IRR database has records of a C2P relationship between AS 5 and AS 1, and records of a non-C2P relationship between AS 6 and AS 1, but no relationship description between AS 8 and AS 2. Therefore, the network device retains AS 5, deletes AS 6 and AS 8, and obtains the customer group of AS 3 as {AS 5} (the second customer group).

[0209] Strategy 2: If the relationship between the third AS and the second AS obtained from the IRR database is a C2P relationship, the third AS in the first customer group is retained. If the relationship between the third AS and the second AS obtained from the IRR database is not a C2P relationship, the third AS is deleted from the first customer group. If there is no description of the relationship between the third AS and the second AS in the IRR database, the third AS in the first customer group is retained.

[0210] For example, the first customer group is {AS 5AS 6AS 8}, and the query results obtained from the IRR database are shown in Table 12. The IRR database has records of a C2P relationship between AS 5 and AS 1, and records of a non-C2P relationship between AS 6 and AS 1, but no relationship description between AS 8 and AS 2. Therefore, the network device retains AS 5 and AS 8, deletes AS 6, and obtains the customer group of AS 3 as {AS 5AS 8} (the second customer group).

[0211] The method provided in this embodiment corrects the customer base obtained based on the ASPA database by introducing the IRR database. Compared with the ASPA database, the IRR database was deployed earlier and is more mature. The IRR database currently has a larger amount of registered data than the ASPA database, and the IRR database records more AS relationships. Therefore, using the IRR database as a data source for correcting the customer base can help reduce the impact of insufficient data registered in the ASPA database, improve the accuracy of the customer base to a certain extent, and reduce the probability of errors in the subsequent source address verification process.

[0212] The above embodiment focuses on introducing the IRR database to correct the customer group obtained based on the ASPA database. In another possible implementation, the ASPA database is introduced to correct the customer group obtained based on the IRR database, which is illustrated by Example 2-b below. Example 2-b is equivalent to replacing the IRR database with the ASPA database in Example 2-a. The implementation details of each step in Example 2-b can refer to Example 2-a.

[0213] Example 2-b

[0214] Step S321a: Based on the IRR database, obtain the first customer group of the first AS and the authorized provider list corresponding to the first customer group.

[0215] Step S322b: Based on the ASPA database, obtain the AS relationship between the first customer group and the authorized provider list.

[0216] Step S323c: Based on the AS relationship obtained from the ASPA database, the first customer group is corrected to obtain a second customer group.

[0217] The method provided in this embodiment corrects the customer group obtained based on the IRR database by introducing the ASPA database. Since the IRR database is independently registered by the operators of each AS, the accuracy of the data in the IRR database is guaranteed by the operators themselves, and the ASPA database is centrally managed based on RPKI. The registration and authentication process of the ASPA database is more stringent than that of the IRR database. Therefore, using the ASPA database as a data source for correcting the customer group helps to reduce the negative impact of the IRR database on accuracy based on the operator's independent registration, improve the accuracy of the customer group to a certain extent, and reduce the probability of errors in the subsequent source address verification process.

[0218] In summary, Example 2-a and Example 2-b obtain customer groups by referring to multiple available data sources (ASPA database and IRR database), which to some extent makes up for the shortcomings of customer groups obtained from a single data source and improves the accuracy of customer groups.

[0219] The above-mentioned embodiments 1-a, 1-b, 2-a and 2-b all focus on describing the method of obtaining customer groups. The present application embodiment also provides a method of obtaining a prefix set. The above-mentioned method of obtaining customer groups and the following method of obtaining a prefix set can be used independently or in combination.

[0220] When the above-mentioned method for obtaining a customer group is used in combination with the following method for obtaining a prefix set, the second customer group determined by the above-mentioned method embodiment is the customer group in the following method embodiment. For example, after the first customer group is corrected by the above-mentioned method embodiment to obtain the second customer group, the prefix set of the second customer group is further corrected by the following method embodiment. Since both the method for obtaining the customer group and the method for obtaining the prefix set are improved, the accuracy of the prefix set is further improved.

[0221] When the above-mentioned method for obtaining a customer group and the following method for obtaining a prefix set are used separately, the customer group of the following method embodiment does not depend on the acquisition of the above-mentioned method embodiment. For example, a prefix set is obtained by the following method embodiment for the customer group of the first AS obtained in the existing manner, or a prefix set is obtained based on the first customer group obtained in the above-mentioned method embodiment. Since the prefix set is corrected by the following method embodiment, the accuracy of the prefix set can also be improved to a certain extent.

[0222] In the process of executing step S34 to obtain the IP address prefix set of the customer group, if the area where the AS is located when publishing the prefix is ​​not taken into account, the accuracy of the obtained prefix set will be affected. For example, the same AS may publish different prefixes owned by the AS in different areas. For example, AS 2 publishes prefix P2 in area A and diffuses prefix P2 to the global Internet. AS 2 publishes prefix P3 in area B and diffuses prefix P3 to the global Internet. If the ROA database only records that prefix P2 and prefix P3 correspond to AS 2, but does not reflect that prefix P2 corresponds to area A and prefix P3 corresponds to area B, when the customer group of AS 3 is in area A, using the ROA database will cause prefix P3 to be counted in the prefix set of the customer group of AS 3, which is wrong.

[0223] In view of this, in some embodiments of the present application, in the BAR-SAV processing flow, in the process of obtaining the prefix set of the customer group, based on the ROA database containing the area identifier, the prefixes that do not match the area are deleted from the customer group of the first AS, thereby correcting the obtained prefix set to a certain extent, improving the accuracy of the prefix set of the customer group, and further improving the accuracy of the source address verification.

[0224] In order to distinguish whether to describe an ROA database containing a region identifier or not, the standard ROA database without a region identifier is described as “a first ROA database”, and the ROA database containing a region identifier is described as “a second ROA database”.

[0225] Please refer to the above description for the first ROA database. The second ROA database includes the correspondence between the AS identifier, prefix, and regional identifier. Through the second ROA database, it is possible to determine which AS publishes the prefix in which region, or in which region the attribution relationship between the prefix and the AS is valid. For example, the second ROA database includes at least one record, and a record includes the identifier of AS 1, prefix P1, and Europe. The meaning of this record is that AS 1 publishes prefix P1 in Europe, or prefix P1 belongs to AS 1 in Europe, or the attribution relationship between prefix P1 and AS 1 in Europe is valid.

[0226] Regarding the method of obtaining the second ROA database, for example, the network device locally stores the second ROA database. In a possible implementation, the network device obtains the area identifier of the area where the prefix and the AS belong to, and the network device adds the area identifier corresponding to the registration area to the first ROA database stored in the network device. For another example, the second ROA database is stored on a storage device connected to the network device via a communication network, the network device sends a query request to the storage device, and the storage device sends the data stored in the second ROA database to the network device in response to the query request.

[0227] The following examples 3-a and 3-b are used to illustrate the process of obtaining a prefix set. The execution subject of the following examples 3-a and 3-b is, for example, a network device or a control device.

[0228] Example 3-a

[0229] Step S341: Based on the first ROA database, a first prefix set of a customer group of the first AS is obtained.

[0230] For example, for each AS in the customer group of the first AS, a prefix corresponding to the AS identifier is searched in the first ROA database based on the AS identifier of the AS to obtain a first prefix set.

[0231] For example, the network device is in AS 4, and the first AS is AS 3 connected to the input interface of the network device. After the network device obtains the customer group of AS 3, the network device uses the first ROA database to obtain the prefix corresponding to each AS in the customer group of AS3; for example, the customer group of AS 3 is {AS 2AS 5AS 6AS 8}, the network device queries the prefix corresponding to AS 2 in the first ROA database shown in Table 13 below based on the identifier of AS 2, and obtains prefix P3; the network device queries the prefix corresponding to AS 5 in the first ROA database shown in Table 13 below based on the identifier of AS 5, and obtains prefix P5; the network device queries the prefix corresponding to AS 6 in the first ROA database shown in Table 13 below based on the identifier of AS 6, and obtains prefix P6; the network device queries the prefix corresponding to AS 8 in the first ROA database shown in Table 13 below based on the identifier of AS 8, and obtains prefix P8.

[0232] Table 13

[0233]

[0234] Step S342: Acquire a second area identifier based on the customer group, the first prefix set, and the second ROA database.

[0235] For example, the customer group includes the third AS, and the prefix set includes the first prefix. The second area identifier is searched in the second ROA database using the AS identifier of the third AS and the first prefix as indexes, thereby obtaining the second area identifier corresponding to the third AS and the first prefix. Similarly, the second area identifier corresponding to each AS in the customer group and each prefix in the first prefix set is searched in the second ROA database.

[0236] As a specific example, the customer groups of AS 3 include {AS 2AS 5AS 6AS 8}, and the first prefix set of AS 3 includes {P3 P5 P6 P8}. The correspondence between the customer groups and the first prefix set is shown in Table 13. Based on the AS number of AS 2 and the prefix P3, the network device queries Europe in the second ROA database. In addition, based on the AS number of AS 5, the AS number of AS 6, and the AS number of AS 8, the network device does not find the corresponding table items in the second ROA database. The query results are shown in Table 14 below. The meaning of Table 14 below is that AS 2 has released prefix P3 in Europe, or the relationship between prefix P3 and AS 2 is valid in Europe, and the relationship between prefix P3 and AS 2 is invalid in other regions outside Europe. Among them, AS 3 is a specific example of the first AS, AS 2 is a specific example of the second AS, prefix P3 is a specific example of the prefix belonging to the second AS, and Europe is a specific example of the identifier of the second region.

[0237] Table 14

[0238] AS Identification Prefix Region (Asia, Europe, North America, South America, Africa) AS 2 P3 Europe

[0239] Step S343: Based on the area where the first AS is located and the second area identifier, correct the first prefix set to obtain a second prefix set.

[0240] In a possible implementation, if the first AS is located in the area indicated by the second area identifier, it is determined that the prefix corresponding to the second area identifier is accurate, and the prefix corresponding to the second area identifier is retained in the first prefix set. If the first AS is not located in the area indicated by the second area identifier, it is determined that the prefix corresponding to the second area identifier is inaccurate, and the prefix corresponding to the second area identifier is deleted from the first prefix set.

[0241] The following is an example of determining whether to delete the first prefix from the prefix set. The logic for determining whether to delete other prefixes from the prefix set is the same. For example, the second ROA database includes the correspondence between the AS identifier of the third AS, the first prefix, and the second area identifier. If the first AS is located in the first area, it is determined that the first prefix is ​​a suitable prefix in the prefix set, and the first prefix is ​​retained. If the first AS is not located in the first area, it is determined that the first prefix is ​​not a suitable prefix in the prefix set, and the first prefix is ​​deleted from the prefix set. Based on the above method, it is equivalent to verifying the accuracy of each prefix in the prefix set one by one in combination with the area where the first AS is located, thereby reducing the probability of erroneous prefixes appearing in the prefix set.

[0242] In a possible implementation, if the AS identifier of the third AS and the record corresponding to the first prefix are not found in the second ROA database, it is determined that the records of the third AS and the first prefix in the first ROA database are accurate, or that the attribution relationship between the first prefix and the third AS is globally valid, then the network device retains the third AS in the first customer group.

[0243] For example, for the prefix set shown in Table 13, the network device queries the second ROA database to obtain the result shown in Table 14 above. Table 14 above shows that the prefixes corresponding to AS 2 include P3, and the second region identifier corresponding to AS 2 is Europe. If AS 3 is currently in Europe, it is determined that prefix P3 is accurate, and prefix P3 is retained in the first prefix set, and the obtained second prefix set is {P3 P5 P6 P8}. If AS 3 is not currently in Europe, it is determined that prefix P3 is inaccurate, and prefix P3 is deleted from the first prefix set {P3 P5 P6 P8} to obtain the second prefix set {P5 P6 P8}.

[0244] For example, if the area where the first AS is located is the same as the area indicated by the second area identifier corresponding to the third AS, it indicates that the third AS is suitable and the third AS is retained in the first customer group; if the area indicated by the second area identifier corresponding to the third AS is different from the area where the first AS is located, the third AS is deleted from the first customer group. The verification method of other ASs other than the third AS in the first customer group can refer to the verification method of the third AS.

[0245] Regarding the method of determining the area where the first AS is located, when the network device and the first AS are in the same area, the network device can determine the area where the device is currently located as the area where the first AS is located. When the network device and the first AS are in different areas, the network device can communicate with the first AS and receive the area where the first AS is located sent by the first AS.

[0246] The method provided in this embodiment verifies the AS in the customer group based on the area where the first AS is located and the second ROA database, and deletes the AS that fails the verification from the customer group, thereby reducing the probability of erroneous ASs that do not match the area appearing in the customer group, improving the accuracy of the customer group, and reducing the probability of errors in subsequent source address verification processing.

[0247] In the above implementation, the second area identifier is obtained from the second ASPA database based on the two parameters of customer group and prefix. In another possible implementation, the second area identifier can also be obtained from the second ASPA database based on one of the customer group or prefix.

[0248] Example 3-a describes the process of obtaining a customer base based on two databases (a first ROA database and a second ROA database). In Example 3-a, the global ROA database (the first ROA database) and the ROA database containing the second regional identifier (the second ROA database) are separated from each other, thereby reducing the difficulty of implementing changes to the global ROA database. In other embodiments, the two databases (the first ROA database and the second ROA database) are merged into one database, such as merging the second regional identifier with the global ROA database to form a unified ROA database, thereby omitting the process of obtaining a customer base based on the first ROA database, and obtaining a customer base based on the second ROA database, which is illustrated below by Example 1-b.

[0249] Example 3-b

[0250] Step S341″: based on the second ROA database, obtain a first prefix set and a second area identifier of a customer group of the first AS.

[0251] For example, for each AS in the customer group of the first AS, the AS identifier of the AS is used as an index to search for the corresponding prefix and the second area identifier in the first ROA database to obtain the first prefix set and the second area identifier.

[0252] Step S342″: based on the area where the first AS is located and the second area identifier corresponding to each AS in the first prefix set, correct the first prefix set to obtain a second prefix set.

[0253] The above step S342" is similar to step S343, and reference may be made to the description of step S343.

[0254] The method provided in this embodiment can not only exclude prefixes that do not match the region in the prefix set, but also save a process of querying the database. It is equivalent to simplifying the process of obtaining the prefix set based on two databases in Example 3-a to obtaining the prefix set based on one database. Therefore, not only a more accurate prefix set can be obtained, but also the operations required to be performed in the prefix set acquisition process can be saved and simplified, thereby improving the efficiency of obtaining the prefix set.

[0255] Example 3-a and Example 3-b describe a method for improving the accuracy of a prefix set based on a ROA database containing a second area identifier. The ROA database containing the second area identifier in Example 3-a and Example 3-b can also be replaced with other databases that can describe the area where the relationship between the prefix and the AS is located. For example, the ROA database containing the second area identifier is replaced with an IRR database containing the second area identifier. For example, a record in the IRR database includes an AS identifier field, a prefix field, a relationship field, and an area field, the AS identifier field includes the AS identifier of the AS, the prefix field includes the prefix, the relationship field is used to describe the relationship between the prefix and the AS, and the area field includes the second area identifier.

[0256] In summary, the methods of the above-mentioned embodiments 3-a and 3-b, since they record the correspondence between the affiliation relationship between the prefix and the AS and the second area identifier, in the process of obtaining the prefix set, verify whether the affiliation relationship between the prefix and the AS is established based on the area where the first AS is located and the area indicated by the second area identifier, delete the prefixes whose affiliation relationship is not established in the area where the first AS is located from the prefix set, and retain the prefixes whose affiliation relationship is established in the area where the first AS is located in the prefix set, thereby avoiding prefixes that do not match the area from being erroneously included in the prefix set, thereby improving the accuracy of the prefix set.

[0257] The above describes an implementation method for improving the accuracy of prefix sets by considering regions. In another possible implementation method, using IRR data to supplement prefix sets can also improve the accuracy of prefix sets to a certain extent. The following example is illustrated by Example 4-a. The execution subject of the following Example 4-a is, for example, a network device, or a control device.

[0258] Example 4-a

[0259] Step S341a: Based on the ROA database, a first prefix set of the customer group of the first AS is obtained.

[0260] The ROA database is, for example, a standard global ROA database (first ROA database) without the second region identifier, or a ROA database (second ROA database) with the second region identifier. The implementation details of step S341a may refer to the description of step S341.

[0261] Step S342b: Based on the IRR database, the customer group and the first prefix set, obtain the relationship between the AS in the customer group and the prefixes in the first prefix set.

[0262] The following is a description of the process of querying the IRR database for a prefix (first prefix) in the first prefix set, where the customer group includes a third AS, the first prefix set includes the first prefix, and the ROA database records that the first prefix belongs to the third AS. For example, in the process of executing step S342b, based on the AS identifier of the third AS and the first prefix, the relationship between the third AS and the first prefix is ​​queried in the IRR database. The query process for other prefixes in the first prefix set is the same as the query process for the first prefix.

[0263] The query results obtained from the IRR database include three cases.

[0264] Case 1: Confirm that a prefix belongs to a certain AS.

[0265] Case 2: Confirm that a prefix does not belong to a certain AS.

[0266] Case 3: There is no relationship description of the prefix's AS in the IRR database.

[0267] As a specific example, the network device is in AS 4, and the first AS is AS 3 to which the network device is connected. The first prefix set obtained by the network device based on the ROA database is shown in Table 13, and the network device uses each prefix in the prefix set {P3 P5 P6 P8} of AS 3 shown in Table 13 to query in the IRR database, so as to verify whether the correspondence between the prefix and the AS shown in Table 13 is accurate. Specifically, the network device queries the relationship between prefix P3 and AS 2 recorded in the IRR database based on the identifier of AS 2 and prefix P3, and the query result obtained indicates that prefix P3 belongs to AS 2. The network device queries the relationship between AS 5 and prefix P5 recorded in the IRR database based on the identifier of AS5 and prefix P5, and the query result obtained describes that prefix P5 does not belong to AS 5, but belongs to another AS.

[0268] Based on the identifier of AS 6 and prefix P6, the network device queries the relationship between AS 6 and prefix P6 recorded in the IRR database, and the query result obtained describes that prefix P6 belongs to AS 6. Based on the identifier of AS 8 and prefix P8, the network device queries the relationship between AS 8 and prefix P8 recorded in the IRR database, and no description about the AS to which prefix P8 belongs is found.

[0269] Table 15

[0270]

[0271] Step S343c: Based on the query result obtained from the IRR database, correct the first prefix set to obtain a second prefix set.

[0272] The following takes the logic of determining whether to retain the first prefix in the first prefix set as an example for explanation, and the logic of determining whether to retain other prefixes in the first prefix set is similar. The first prefix is ​​a prefix obtained by querying the third AS in the first ROA database.

[0273] Case 1: The relationship between the first prefix and the third AS obtained from the IRR database is an affiliation relationship.

[0274] Case 1 is equivalent to the ROA database and the IRR database describing the relationship between the first prefix and the second prefix in a consistent manner, and both the ROA database and the IRR database confirm that the first prefix has an attribution relationship with the third AS. In case 1, it is determined that the first prefix is ​​a suitable prefix in the prefix set, the first prefix is ​​retained, and the second prefix set still includes the first prefix.

[0275] Case 2: The relationship between the first prefix and the third AS obtained from the IRR database is not an affiliation relationship.

[0276] For example, the IRR database records that the first prefix does not belong to the third AS but to the second AS.

[0277] Case 2 is equivalent to the inconsistency between the descriptions of the relationship between the first prefix and the third AS by the ROA database and the IRR database. The ROA database confirms that there is an affiliation relationship between the first prefix and the third AS, while the IRR database denies that there is an affiliation relationship between the first prefix and the third AS. In case 2, the IRR database can be trusted first, and the first prefix can be deleted from the first prefix set so that the second prefix set does not include the first prefix. Alternatively, the ROA database can be trusted first, and the first prefix can be retained so that the obtained second prefix set still includes the first prefix. For example, a policy is configured on a network device. In case 2, whether to delete the first prefix from the first prefix set is determined based on the policy.

[0278] Case 3: There is no description of the relationship between the first prefix and the second prefix in the IRR database.

[0279] In case 3, the first prefix may be deleted from the first prefix set, and the obtained second prefix set does not include the first prefix; or the first prefix may be retained, and the obtained second prefix set still includes the first prefix. For example, a policy is configured on a network device, and in case 3, whether to delete the first prefix from the first prefix set is determined according to the policy.

[0280] In a possible implementation, the policy includes a priority of the IRR database and a priority of the ROA database, and the network device determines whether to delete the first prefix from the first prefix set according to the priority of the IRR database and the priority of the ROA database. For example, if the priority of the IRR database is higher than the priority of the ROA database, the network device deletes the first prefix from the first prefix set. If the priority of the IRR database is lower than the priority of the ROA database, the network device retains the first prefix in the first prefix set.

[0281] As a specific example, the AS 3 prefix set obtained by the network device located in AS 4 from the ROA database is {P3P5P6P8}, and the specific query results are shown in Table 13. The query results obtained from the IRR database using each prefix in the prefix set {P3P5P6P8} are shown in Table 15. The attribution relationship between prefix P3 and AS 2 is reconfirmed by the IRR data, so prefix P3 continues to remain in the prefix set of the customer group of AS 3; the attribution relationship between prefix P6 and AS 6 is reconfirmed by the IRR data, so prefix P6 continues to remain in the prefix set of the customer group of AS 3; the IRR data confirms that prefix P5 does not belong to the prefix of AS 5, and the network device can determine whether prefix P5 should be retained in the prefix set of the customer group of AS 3 through a policy; the AS to which prefix P8 belongs is not queried in the IRR data, and the network device can determine whether prefix P8 should be retained in the prefix set of the customer group of AS 3 through a policy.

[0282] The above strategies include, for example, the following strategy 1 or strategy 2.

[0283] Strategy 1: If the relationship between the first prefix and the third AS obtained from the IRR database is an affiliation relationship, the first prefix in the first prefix set is retained. If the relationship between the first prefix and the third AS obtained from the IRR database is not an affiliation relationship, the first prefix is ​​deleted from the first prefix set. If there is no description of the relationship between the first prefix and the third AS in the IRR database, the first prefix is ​​deleted from the first prefix set. For example, the first prefix set is {P3 P5 P6 P8}, and the query result obtained from the IRR database is shown in Table 15. The IRR database has a record of an affiliation relationship between prefix P3 and AS 2, a record of an affiliation relationship between prefix P6 and AS 6, and a record of an affiliation relationship between prefix P5 and other ASs except AS 5 (equivalent to explicitly denying the affiliation relationship between prefix P5 and AS 5). There is no record of an affiliation relationship between prefix P8 and AS 8 (equivalent to no record). Therefore, the network device retains prefix P3 and prefix P6, deletes prefix P5 and prefix P8, and obtains the prefix set of prefix 3 as {P3 P6}.

[0284] Strategy 2: If the relationship between the first prefix and the third AS obtained from the IRR database is an affiliation relationship, the first prefix in the first prefix set is retained. If the relationship between the first prefix and the third AS obtained from the IRR database is not an affiliation relationship, the first prefix is ​​deleted from the first prefix set. If there is no description of the relationship between the first prefix and the third AS in the IRR database, the first prefix in the first prefix set is retained. For example, the first prefix set is {P3 P5 P6 P8}, and the query result obtained from the IRR database is shown in Table 15. The IRR database has a record of an affiliation relationship between prefix P3 and AS 2, a record of an affiliation relationship between prefix P6 and AS 6, and a record of an affiliation relationship between prefix P5 and other ASs except AS 5 (equivalent to explicitly denying the affiliation relationship between prefix P5 and AS 5). There is no record of an affiliation relationship between prefix P8 and AS 8 (equivalent to no record). Therefore, the network device retains prefixes P3, P6, and P8, deletes prefix P5, and obtains the prefix set of prefix 3 as {P3 P6 P8}.

[0285] The method provided in this embodiment corrects the prefix set obtained based on the ROA database by introducing the IRR database. Compared with the ROA database, the IRR database was deployed earlier and is more mature. The IRR database currently has a larger amount of registered data than the ROA database, and the IRR database records more prefix relationships. Therefore, using the IRR database as a data source for correcting the prefix set helps to reduce the impact caused by the insufficient amount of data registered in the ROA database, improve the accuracy of the prefix set to a certain extent, and reduce the probability of errors in the subsequent source address verification process.

[0286] The above embodiment focuses on introducing the IRR database to correct the prefix set obtained based on the ROA database. In another possible implementation, the ROA database is introduced to correct the prefix set obtained based on the IRR database, which is illustrated by Example 4-b below. Example 4-b is equivalent to replacing the IRR database with the ROA database in Example 4-a. The implementation details of each step in Example 4-b can refer to Example 4-a.

[0287] Example 4-b

[0288] Step S341a: Based on the IRR database, obtain a first prefix set of the customer group of the first AS.

[0289] Step S342b: Based on the ROA database, the customer group and the first prefix set, obtain the relationship between the AS in the customer group and the prefixes in the first prefix set.

[0290] Step S343c: Based on the relationship between the AS and the prefix obtained from the ROA database, correct the first prefix set to obtain a second prefix set.

[0291] For example, if the ROA data records that the first prefix belongs to a third AS, the first prefix is ​​retained so that the second prefix set includes the first prefix; if the ROA data records that the first prefix does not belong to the third AS, the first prefix is ​​deleted so that the second prefix set does not include the first prefix; if the ROA data does not record the AS to which the first prefix belongs, determine whether to delete the first prefix based on the priority relationship between the IRR data and the ROA data.

[0292] The method provided in this embodiment corrects the prefix set obtained based on the IRR database by introducing the ROA database. Since the IRR database is independently registered by the operators of each AS, the accuracy of the data in the IRR database is guaranteed by the operators themselves, and the ROA database is centrally managed based on RPKI. The registration and authentication process of the ROA database is more stringent than that of the IRR database. Therefore, using the ROA database as a data source for correcting the prefix set helps to reduce the negative impact of the IRR database on accuracy based on the operator's autonomous registration, improve the accuracy of the prefix set to a certain extent, and reduce the probability of errors in the subsequent source address verification process.

[0293] In summary, Example 4-a and Example 4-b obtain prefix sets by referring to multiple available data sources (ROA database and IRR database), thus making up for the shortcomings of the prefix sets obtained from a single data source to a certain extent and improving the accuracy of the prefix sets.

[0294] Furthermore, based on a more accurate prefix set, it is helpful to obtain a more accurate source address verification table entry, thereby improving the accuracy of source address verification and reducing the security risk caused by attackers launching source address attacks.

[0295] The process of obtaining the source address verification table entry in step S38 is further described in detail below through Example 5.

[0296] Example 5

[0297] The process of obtaining the source address verification table entry in step S38 may be performed by the network device, by the control device, or by the collaboration of the network device and the control device. These three methods are respectively described below with examples.

[0298] Method 1 for obtaining source address verification table entries: The network device executes the process of obtaining the customer group of the first AS in step S32, and the process of obtaining the prefix set of the customer group described in step S34; the network device determines the interface on the device connected to the first AS. The network device determines the interface on the device connected to the first AS; the network device obtains the source address verification table entry based on the interface on the device connected to the first AS and the prefix set.

[0299] Among them, the network device can execute step S32 in the manner provided in Example 1-a; or, the network device can also execute step S32 in the manner provided in Example 1-b; or, the network device can also use both the manner provided in Example 1-a and the manner provided in Example 1-b when executing step S32.

[0300] Method 2 for obtaining source address verification table entries: The control device executes the process of obtaining the customer group of the first AS and the process of obtaining the prefix set of the customer group described above; the control device determines the interface on the device connected to the first AS. The control device determines the interface on the network device connected to the first AS based on the network topology; as shown in the attached Figure 4 As shown, the control device executes step S36 to send a prefix set, an identifier of the interface connected to the first AS on the network device, and an action identifier to the network device; the network device executes step S37 to receive the prefix set, the interface identifier, and the action identifier from the control device; the network device obtains the source address verification table entry based on the prefix set, the interface identifier, and the action identifier.

[0301] The action identifier is used to indicate the generation of a source address verification table entry. The data form of the action identifier is, for example, a number or a string. For example, different numbers represent different actions, and the action represented by each number is specified by a protocol.

[0302] Among them, the control device can execute step S32 in the manner provided in Example 1-a; or, the control device can also execute step S32 in the manner provided in Example 1-b; or, the control device can also use both the manner provided in Example 1-a and the manner provided in Example 1-b when executing step S32.

[0303] In a possible implementation, the control device obtains a first protocol message based on a prefix set, an interface identifier, and an action identifier. The control device sends the first protocol message to the network device. The first protocol message includes a prefix set, an interface identifier, and an action identifier. The network device receives the first protocol message, and the network device obtains the prefix set, the interface identifier, and the action identifier from the first protocol message.

[0304] The first protocol message may be any control plane protocol message or management plane protocol message. For example, the first protocol message is a BGP message or a PCEP message. For example, the first protocol message is a border gateway protocol flow rule (bordergateway protocol flow spec, BGP flow specification, referred to as BGP flow spec or BGP FS) message.

[0305] With respect to the message format of the first protocol message, in a possible implementation, the first protocol message includes a first type-length-value (TLV), a second TLV, and a third TLV. The first TLV includes an identifier of an interface connected to the first AS on the network device. The second TLV includes an IP address prefix. The IP address prefix included in the second TLV is, for example, a prefix in a prefix set determined by the above method embodiment. The third TLV includes an action identifier.

[0306] The first TLV is, for example, an interface name TLV. An interface name TLV is a TLV used to carry an interface name. Figure 6 , attached Figure 6 This is a schematic diagram of the format of an interface name TLV. The interface name TLV includes a type field, a length field, and an interface name field. The type field includes a type value used to identify the interface name. The length field includes the length of the interface name or the length of the entire interface name TLV. The interface name field includes the interface name. The length of the interface name field is variable.

[0307] The first TLV is the interface ID TLV. Figure 7 , attached Figure 7 This is a format diagram of an interface ID TLV. The interface ID TLV includes a type field, a length field, and an interface ID (interface ID) field. The type field includes a type value for identifying an interface ID. The length field includes a length value of the interface ID TLV. The interface ID field includes an interface ID, and the length of the interface ID segment is, for example, 4 bytes.

[0308] The first TLV is the tag / group ID TLV. Figure 8 , attached Figure 8This is a format diagram of a tag / group ID TLV. The tag / group ID TLV includes a type field, a length field, and a tag / group ID field. The type field includes a type value for identifying a tag / group ID. The length field includes a length value of the tag / group ID TLV. The tag / group ID field includes a tag / group ID.

[0309] The second TLV includes, for example, one or more address prefix units, each of which includes an IP address prefix and the length of the IP address prefix. For example, the second TLV is a source address verification table entry TLV. Fig. 9 , attached Fig. 9 is a schematic diagram of the format of the source address verification table entry TLV, the first protocol message includes the following Fig. 9 The source address verification table item TLV shown includes a type field, a length field, a prefix length field, an IP prefix field, and a mode field. The type field includes a type value for identifying the source address verification table item. The type value in the type field is, for example, an action identifier. The length field includes the length value of the source address verification table item TLV. The prefix length field includes the mask length of the source address verification table item. The IP prefix field includes the prefix in the source address verification table item. The mode field includes the mode of verification of the source address verification table item, and the mode of source address verification includes but is not limited to whitelist verification, blacklist verification, and graylist verification.

[0310] The third TLV is, for example, an extended community attribute. For example, the type value in the type field in the third TLV indicates generating a source address verification entry, and the type value in the type field in the third TLV is an action identifier.

[0311] In one possible implementation, the IP address prefix and the action identifier are carried by two TLVs respectively. For example, the second TLV and the third TLV are two different TLVs. In another possible implementation, the IP address prefix and the action identifier are carried by the same TLV. For example, the second TLV and the third TLV are the same TLV. For example, the type value in the type field of a TLV is used to indicate the generation of a source address verification table entry, and the IP address prefix is ​​carried in the Value field of the TLV.

[0312] Regarding the method of sending the interface identifier, IP address prefix and action identifier through BGP FS, in a possible implementation, the first protocol message is a BGP FS message, and the BGP FS message includes an NLRI field, a first extended group attribute and a second extended group attribute. The NLRI field includes the IP address prefix. The network layer reachability information (NLRI) field is, for example, a specific example of the above-mentioned second TLV. The first extended group attribute includes the interface identifier. The second extended group attribute includes the action identifier.

[0313] For the format of the NLRI field and examples, please refer to Fig.10 , Fig.10 is a schematic diagram of the format of an NLRI field provided in an embodiment of the present application. Fig.10 The NLRI field in is used to carry the source IPv4 address prefix. The NLRI field includes the type field, the prefix length field, and the prefix field. The value of the type field is type 2, which is used to identify the source prefix. The prefix field is used to carry the source IPv4 address prefix, and the prefix length field is used to indicate the length of the source IPv4 address prefix carried by the prefix field. For another example, please refer to Fig.11 , Fig.11 is a schematic diagram of the format of an NLRI field provided in an embodiment of the present application. Fig.11 The NLRI field shown is used to carry the source IPv6 address prefix. The NLRI field includes a type field, a prefix length field, an offset field, a pattern field, and a padding field. The value of the type field is type 2, which is used to identify the source IPv6 prefix. The pattern field and the padding field are used to carry the source IPv6 address prefix. The prefix length field is used to indicate the length of the source IPv6 address prefix carried by the pattern field and the padding field.

[0314] For an example of the format of the extended community attribute field, please refer to Fig.12 , Fig.12This is a format diagram of an extended group attribute field provided in an embodiment of the present application. The group attribute field includes a sub-type field, a global administrator field, and a local administrator field. In one possible implementation, the value of the type in the sub-type field is an action identifier. In another possible implementation, the global administrator field or the local administrator field includes an action identifier.

[0315] In another possible implementation, the interface identifier and action identifier are carried by the same extended group attribute. For example, the BGP FS message includes a network layer reachability information (NLRI) field and an extended group attribute field. The NLRI field includes an IP address prefix. The extended group attribute field includes the interface identifier and the action identifier. For example, the value of the type in the sub-type field in the extended group attribute field is the action identifier. The global administrator field or the local administrator field includes the interface identifier.

[0316] In the above implementation, the control device sends a prefix set, an interface identifier, and an action identifier through the same protocol message. In another possible implementation, the control device sends a prefix set, an interface identifier, and an action identifier through different protocol messages. For example, the control device sends protocol message A and protocol message B to the network device. Protocol message A includes a prefix set and an action identifier. Protocol message B includes an interface identifier and an action identifier. The network device receives protocol message A and protocol message B. The network device obtains a prefix set and an action identifier from protocol message A. The network device obtains an interface identifier and an action identifier from protocol message B. Based on the action identifier, the network device determines that the prefix set obtained from protocol message A and the interface identifier obtained from protocol message B have a corresponding relationship.

[0317] Method 3 for obtaining source address verification table entries: The control device executes the process of obtaining the customer group of the first AS described above, and the process of obtaining the prefix set of the customer group described above; the control device determines the interface on the device connected to the first AS. The control device determines the interface on the network device connected to the first AS based on the network topology; the control device obtains the source address verification table entry based on the interface on the network device connected to the first AS and the prefix set.

[0318] In one possible implementation, as shown in the attached Figure 5As shown, the control device executes step S39 to send the obtained source address verification table entry to the network device. The network device receives the source address verification table entry sent by the control device, so as to execute step S40 based on the source address verification table entry.

[0319] In the above three acquisition methods, when a network device or controller acquires a source address verification table entry, one or more source address verification table entries can be generated based on the interface granularity. For example, the network device has a first interface and a second interface, the first interface is connected to the first AS, and the second interface is also connected to the first AS. Based on the first interface, the second interface, and the prefix set, the network device generates a first source address verification table entry and a second source address verification table entry, the first source address verification table entry includes the first interface and the prefix set, and the second source address verification table entry includes the second interface and the prefix set.

[0320] In a possible implementation, the control device sends a second protocol message to the network device. The second protocol message includes a source address verification entry. The network device receives the second protocol message and obtains the source address verification entry from the second protocol message.

[0321] The second protocol message may be any control plane protocol message or management plane protocol message. For example, the second protocol message is a BGP message or a PCEP message. For example, the second protocol message is a BGP FS message.

[0322] In a possible implementation, the first protocol message includes an address family identifier, which is used to indicate a source address verification entry. By carrying the address family identifier, the first protocol message can indicate that the first protocol message includes a source address verification entry, making it easier for the device to distinguish the first protocol message from protocol messages carrying other content.

[0323] Fig.13 It is a flowchart of a method for obtaining source address verification table entries provided in an embodiment of the present application.

[0324] Optionally, attach Fig.13 The network deployment scenario based on the method shown is as follows: Figure 1 For example, in combination with the Figure 1 Come and see, Fig.13 The method shown is Figure 1 Router R2 at the edge of AS 4 executes the following Fig.13 In the method shown, the first AS is Figure 1 AS 3 in Fig.13 The interface for communicating with the first AS in the method shown is Figure 1 Interface a in Attachment Fig.13 In the method shown, the second AS is, for example, Figure 1 The second AS is Figure 1 In AS 2, the first prefix is, for example, Figure 1 The second AS is Figure 1 In AS 5, the first prefix is, for example, Figure 1 The second AS is Figure 1 In AS 6, the first prefix is, for example, Figure 1 The second AS is Figure 1 In AS 7, the first prefix is, for example, Figure 1 The second AS is Figure 1 In AS 8, the first prefix is, for example, Figure 1 P8 in.

[0325] Optionally, in combination with Figure 3 Come and see, Fig.13 In the method shown, the first AS is Figure 3 The verified AS in the embodiment is attached Fig.13 In the method shown, the second AS is Figure 3 The AS in the customer group in the embodiment, Fig.13 The first prefix in the method shown is Figure 3 The prefix set in the embodiment includes prefixes, Fig.13 The interface for communicating with the first AS in the method shown is Figure 3 In the embodiment, the verification device is connected to an interface of the verified AS. Fig.13 The method shown includes the following S510 to S520.

[0326] S510: Obtain a first prefix of a second AS based on an identifier of the first AS and a first corresponding relationship. The first corresponding relationship includes an identifier of the first AS, an identifier of the second AS, and a first valid relationship.

[0327] The second AS is located downstream of the first AS. For example, the second AS is the next-hop AS of the first AS. For example, the second AS is a customer AS of the first AS. For example, the second AS is an AS in a customer group of the first AS. For example, the identifier of the first AS is an index based on which the first corresponding relationship is searched. The first corresponding relationship is, for example, a table entry in a database.

[0328] S520, based on the interface communicating with the first AS and the first prefix, obtain a source address verification entry, where the source address verification entry includes the first prefix and an identifier of the interface.

[0329] By using the above method, the prefix is ​​obtained by using the valid relationship between ASs, thereby reducing the error caused by the invalid relationship between ASs in the prefix acquisition process, thereby improving the accuracy of the prefix, and further improving the accuracy of the source address verification table entry obtained based on the prefix.

[0330] In a possible implementation, the first valid relationship is that an area corresponding to the relationship between two upstream and downstream ASs matches an area corresponding to a customer group, and the customer group includes the two upstream and downstream ASs.

[0331] For example, the region corresponding to the relationship between the two upstream and downstream ASs is the same as the region corresponding to the customer group. For example, please refer to Table 11 above. AS 6 and AS 1 are specific examples of two upstream and downstream ASs. The region corresponding to the relationship between AS 6 and AS 1 is Europe, and the region corresponding to the customer group of AS 3 is also Europe. The relationship between AS 6 and AS 1 can be defined as the first effective relationship. For another example, the region corresponding to the relationship between the two upstream and downstream ASs belongs to the coverage of the region corresponding to the customer group. For another example, please refer to Table 11 above. The region corresponding to the relationship between AS 6 and AS 1 is Europe, and the region corresponding to the customer group of AS 3 is the world. Europe belongs to the coverage of the world. The relationship between AS 6 and AS1 can be defined as the first effective relationship. For another example, the region corresponding to the relationship between the two upstream and downstream ASs includes the region corresponding to the customer group. For another example, the region corresponding to the relationship between AS 6 and AS 1 is the world, and the region corresponding to the customer group of AS 3 is Europe. The relationship between AS 6 and AS 1 can be defined as the first effective relationship. For another example, the first valid relationship is that the area corresponding to the relationship between the two upstream and downstream ASs does not conflict with the area corresponding to the customer group. On the contrary, if the area corresponding to the relationship between the two upstream and downstream ASs does not match the area corresponding to the customer group, or in other words, the area corresponding to the relationship between the two upstream and downstream ASs conflict with the area corresponding to the customer group, it can be determined that the two upstream and downstream ASs do not have the first valid relationship, and the prefix of the AS with mismatched areas can be deleted. For example, the area corresponding to the relationship between AS 6 and AS 1 is Europe, and the area corresponding to the customer group of AS 3 is Asia. It can be confirmed that AS 6 and AS 1 do not have the first valid relationship. In the above manner, the validity of the relationship between ASs can be verified based on whether the areas match.

[0332] In a possible implementation, before obtaining the first prefix of the second AS based on the identifier of the first AS and the first corresponding relationship, the method further includes: determining that the first AS and the second AS have a first valid relationship based on matching the area corresponding to the first AS with the valid area corresponding to the relationship between the first AS and the second AS.

[0333] For technical details on determining the first valid relationship based on region matching, please refer to the description of Example 1-a and Example 1-b in this specification.

[0334] Through the above implementation method, the validity of the relationship between ASs is confirmed based on the characteristics of area matching, and then the prefix is ​​obtained by using the AS with area matching, so as to eliminate the error caused by the AS with unmatched area in the prefix acquisition process as much as possible, and avoid the prefix of the AS with unmatched area from being erroneously included in the prefix set, thereby improving the accuracy of the prefix, and then improving the accuracy of the source address verification table entry obtained based on the prefix.

[0335] In a possible implementation, the first valid relationship is a relationship between ASs that have passed verification by multiple databases, and at least one of the registration quantity, deployment time, digital signature, and certificate authentication of the multiple databases is different.

[0336] The above-mentioned multiple databases include but are not limited to the ASPA database and the IRR database, and of course may also be other available databases. For example, the first valid relationship is the relationship between ASs that have been verified by the ASPA database and the IRR database. For example, please refer to Table 12 above. AS 5 and AS 1 in the ASPA database are in a C2P relationship, and AS 5 and AS 1 in the IRR database are also in a C2P relationship. The relationship between AS 5 and AS 1 can be defined as the first valid relationship. For another example, AS 6 and AS 1 in the ASPA database are in a C2P relationship, and AS 6 and AS 1 in the IRR database are not in a C2P relationship. It can be determined that there is no first valid relationship between AS 6 and AS 1. In the above manner, multiple databases can be combined to verify the validity of the relationship between ASs, thereby further improving the reliability of the process of obtaining the source address verification table entry.

[0337] In a possible implementation, before obtaining the first prefix of the second AS based on the identifier of the first AS and the first correspondence, the method further includes: determining that the first AS and the second AS have a first valid relationship based on the matching of the second correspondence and the third correspondence, the second correspondence includes the identifier of the first AS, the identifier of the second AS, and the relationship between the first AS and the second AS, and the third correspondence includes the identifier of the first AS, the identifier of the second AS, and the relationship between the first AS and the second AS. For example, the second correspondence is an entry in the first database, and the third correspondence is an entry in the second database, and at least one of the registration volume, deployment time, digital signature, and certificate authentication of the first database and the second database is different. For example, the second correspondence is an entry in the ASPA database, and the third correspondence is an entry in the IRR database. For example, the second correspondence is an entry in Table 10, and the third correspondence is a table entry with a format similar to that of the entry in Table 10, but is derived from another database. The second correspondence matches the third correspondence, for example, the relationship between the first AS and the second AS in the second correspondence is the same as the relationship between the first AS and the second AS in the third correspondence. For example, the relationship between the second AS and the first AS in the second correspondence is a C2P relationship, and the relationship between the second AS and the first AS in the third correspondence is also a C2P relationship. In this case, it is determined that the second correspondence matches the third correspondence, and the C2P relationship between the second AS and the first AS is valid. The second correspondence matches the third correspondence if there is a relationship between the first AS and the second AS in the second correspondence, but no relationship between the first AS and the second AS is found in the third correspondence. Alternatively, the second correspondence matches the third correspondence if no relationship between the first AS and the second AS is found in the second correspondence, but a relationship between the first AS and the second AS exists in the third correspondence. In this case, considering that the relationship between some ASs may not be described due to incomplete data in the database, in this case, it can be selected to determine that the data describing the relationship is credible.

[0338] For technical details on determining the first valid relationship based on matching of multiple databases, please refer to the description of Example 2-a and Example 2-b in this specification.

[0339] Through the above implementation method, since the validity of the relationship between ASs is verified based on multiple databases, and the prefix is ​​obtained by using the AS verified by multiple databases, the error caused by the AS with mismatched areas in the prefix acquisition process is eliminated as much as possible, thereby improving the accuracy of the prefix, and then improving the accuracy of the source address verification table items obtained based on the prefix.

[0340] In a possible implementation, the second correspondence is obtained by searching the downstream AS in the ASPA database authorized by the autonomous system service provider based on the identifier of the first AS, and the third correspondence is obtained by searching the downstream AS in the Internet Routing Registration IRR database based on the identifier of the first AS; or the second correspondence is obtained by searching the upstream AS in the ASPA database authorized by the autonomous system service provider based on the identifier of the second AS, and the third correspondence is obtained by searching the upstream AS in the Internet Routing Registration IRR database based on the identifier of the second AS.

[0341] In a possible implementation, obtaining the first prefix of the second AS based on the identifier of the first AS and the first corresponding relationship includes: obtaining the identifier of the second AS based on the identifier of the first AS and the first corresponding relationship; obtaining the first prefix based on the identifier of the second AS and a fourth corresponding relationship, the fourth corresponding relationship including the identifier of the second AS, the first prefix and the second valid relationship. In the above manner, since the prefix is ​​obtained by utilizing the valid relationship between the AS and the prefix, the error caused by the invalid relationship between the AS and the prefix in the prefix acquisition process is reduced, thereby improving the accuracy of the prefix, and further improving the accuracy of the source address verification table entry obtained based on the prefix.

[0342] In a possible implementation, the area corresponding to the relationship between the second effective relationship and the AS to which the prefix belongs matches the area corresponding to the customer group, and the customer group includes the AS to which the prefix belongs. For example, the area corresponding to the relationship between the second effective relationship and the AS to which the prefix belongs is the same as the area corresponding to the customer group. For example, please refer to Table 14 above, prefix P3 and AS 2 are specific examples of the relationship between a prefix and the AS to which the prefix belongs, the area corresponding to the relationship between prefix P3 and AS 2 is Europe, and the area corresponding to the customer group of AS 3 is also Europe. The relationship between prefix P3 and AS 2 can be defined as the second effective relationship. For another example, the area corresponding to the relationship between the second effective relationship and the AS to which the prefix belongs belongs to the scope of coverage of the area corresponding to the customer group. For another example, please refer to Table 11 above, the area corresponding to the relationship between prefix P3 and AS 2 is Europe, and the area corresponding to the customer group of AS 3 is global, and Europe belongs to the scope of global coverage, and the relationship between prefix P3 and AS 2 can be defined as the second effective relationship. For another example, the scope of coverage of the area corresponding to the relationship between the second effective relationship and the AS to which the prefix belongs includes the area corresponding to the customer group. For example, the region corresponding to the relationship between prefix P3 and AS 2 is the world, and the region corresponding to the customer group of AS 3 is Europe. The global scope covers Europe, and the relationship between prefix P3 and AS 2 can be defined as the second valid relationship.

[0343] On the contrary, if the region corresponding to the relationship between the prefix and the AS to which the prefix belongs does not match the region corresponding to the customer group, it can be determined that the relationship between the prefix and the AS to which the prefix belongs does not have a second valid relationship. For example, the region corresponding to the relationship between prefix P3 and AS2 is Europe, and the region corresponding to the customer group of AS 3 is Asia, so it can be confirmed that prefix P3 and AS 2 do not have a second valid relationship.

[0344] Through the above implementation method, since the validity of the relationship between the AS and the prefix is ​​confirmed based on the characteristics of area matching, the errors caused by area-mismatched prefixes in the prefix acquisition process are eliminated as much as possible, and the area-mismatched prefixes are prevented from being erroneously included in the prefix set, thereby improving the accuracy of the prefix set.

[0345] In a possible implementation, before obtaining the first prefix based on the identifier of the second AS and the fourth corresponding relationship, the method also includes: determining that the second AS has a second valid relationship with the first prefix based on matching the area corresponding to the second AS with the valid area corresponding to the relationship between the second AS and the first prefix.

[0346] In a possible implementation, the second valid relationship is a relationship between an AS and a prefix that has been verified by multiple databases, and at least one of the registration volume, deployment time, digital signature, and certificate authentication of the multiple databases is different. For example, the second valid relationship is a relationship between an AS and a prefix that has been verified by the ROA database and the IRR database. For example, please refer to Table 15 above. Prefix P3 and AS 2 in the ROA database have an affiliation relationship, and prefix P3 and AS 2 in the IRR database also have an affiliation relationship. The relationship between prefix P3 and AS 2 can be defined as a second valid relationship. For another example, prefix P5 and AS5 in the ROA database have an affiliation relationship, prefix P5 and AS 5 in the IRR database do not have an affiliation relationship, and prefix P5 in the IRR database has an affiliation relationship with other ASs other than AS 5. It can be determined that there is no second valid relationship between prefix P5 and AS 5.

[0347] For technical details on determining the second valid relationship based on region matching, please refer to the description of Example 3-a and Example 3-b in this specification.

[0348] Through the above manner, the validity of the relationship between the AS and the prefix can be verified based on whether multiple databases are verified.

[0349] In a possible implementation, based on the identifier of the second AS and the fourth correspondence, before obtaining the first prefix, the method further includes: based on the matching of the fifth correspondence and the sixth correspondence, determining that the second AS and the first prefix have a second valid relationship, the fifth correspondence includes the identifier of the second AS, the first prefix, and the relationship between the second AS and the first prefix, and the sixth correspondence includes the identifier of the second AS, the first prefix, and the relationship between the second AS and the first prefix. For example, the fifth correspondence is an entry in the first database, the sixth correspondence is an entry in the second database, and at least one of the registration volume, deployment time, digital signature, and certificate authentication of the first database and the second database is different. For example, the first database is an ROA database, and the second database is an IRR database. For example, the fifth correspondence is an entry in Table 13, and the sixth correspondence is a table entry that is similar in format to the entry in Table 13 but is derived from another database. The matching of the fifth correspondence and the sixth correspondence is, for example, the relationship between the second AS and the first prefix in the fifth correspondence is the same as the relationship between the second AS and the first prefix in the sixth correspondence. For example, the relationship between the second AS and the first prefix in the fifth correspondence is an affiliation relationship, and the relationship between the second AS and the first prefix in the sixth correspondence is also an affiliation relationship. In this case, it is determined that the fifth correspondence matches the sixth correspondence, and the affiliation relationship between the second AS and the first prefix is ​​valid. The fifth correspondence matches the sixth correspondence if there is a relationship between the second AS and the first prefix in the fifth correspondence, while the relationship between the second AS and the first prefix is ​​not found in the sixth correspondence. Alternatively, the fifth correspondence matches the sixth correspondence if there is no relationship between the second AS and the first prefix in the fifth correspondence, while there is a relationship between the second AS and the first prefix in the sixth correspondence. In this case, considering that the relationship between some prefixes and ASs may not be described due to incomplete data in the database, in this case, it can be selected to determine that the data describing the relationship is credible.

[0350] For technical details on determining the second valid relationship based on multiple database matching, please refer to the description of Example 4-a and Example 4-b in this specification.

[0351] Through the above implementation, since the validity of the relationship between the AS and the prefix is ​​verified based on multiple databases, the accuracy of the prefix is ​​improved, and thus the accuracy of the source address verification table entry obtained based on the prefix is ​​improved.

[0352] In a possible implementation, the fifth correspondence is obtained by searching for a prefix from the ROA database based on the identifier of the second AS, and the sixth correspondence is obtained by searching for a prefix from the IRR database based on the identifier of the second AS; or,

[0353] The fifth corresponding relationship is obtained by searching the home AS from the ROA database based on the first prefix, and the sixth corresponding relationship is obtained by searching the home AS from the IRR database based on the first prefix.

[0354] In a possible implementation, the first corresponding relationship includes a customer group of the first AS, and the customer group of the first AS includes the first AS and the second AS.

[0355] In one possible implementation, Fig.13 The method shown is performed by a network device. For example, Fig.13 The method shown is executed by a network device deployed at the edge of the AS. Fig.13 The method shown is located at the edge of a third AS, which is located upstream of the first AS.

[0356] In one possible implementation, Fig.13 The method shown is executed by a control device, based on an interface communicating with a first AS and a first prefix, after obtaining a source address verification entry, Fig.13 The method shown also includes:

[0357] The control device sends a protocol message to a network device, the network device includes an interface, the network device is located at an edge of a third AS, the third AS is located upstream of the first AS, and the protocol message includes a source address verification table entry.

[0358] For details on the differences in execution methods under different execution entities, please refer to the description of Example 5 in this specification.

[0359] Through the above implementation, it is supported that the control device automatically sends the source address verification table entry to the network device.

[0360] In a possible implementation, the protocol message is a Border Gateway Protocol BGP message or a Path Computation Element Protocol PCEP message.

[0361] In a possible implementation, the protocol message is a Border Gateway Protocol Flow Rule BGP FS message, the BGP FS message includes a Network Layer Reachability Information NLRI field and an extended community attribute field, the NLRI field includes a first prefix, and the extended community attribute field includes an interface identifier.

[0362] For the format of the protocol message, please refer to Figure 6 , Figure 7 , Figure 8 , Fig. 9 , Fig.10 , Fig.11 and Fig.12 Description.

[0363] Fig.141 is a schematic diagram of a structure of a device for obtaining a source address verification entry provided in an embodiment of the present application. The device 600 for obtaining a source address verification entry includes a first obtaining unit 601 and a second obtaining unit 602.

[0364] Optionally, in combination with Figure 1 According to the scenario shown, Fig.14 The device 600 shown is provided in the attached Figure 1 Router R2 is shown located at the edge of AS4.

[0365] Optionally, in combination with Figure 2 According to the scenario shown, Fig.14 The device 600 shown is provided in the attached Figure 2 Router R2 is shown.

[0366] Optionally, in combination with Figure 3 Come and see, Fig.14 The acquisition device 600 of the source address verification table entry shown is used to perform the attached Figure 3 The method shown.

[0367] Optionally, in combination with Figure 4 Come and see, Fig.14 The device 600 for obtaining the source address verification table entry is arranged at Figure 4 The control device in Fig.14 The device 600 is used to execute S32 to S36.

[0368] A first obtaining unit 601 is configured to obtain a first prefix of a second AS based on an identifier of the first AS and a first corresponding relationship, wherein the first corresponding relationship includes an identifier of the first AS, an identifier of the second AS, and the first valid relationship, and the second AS is located downstream of the first AS;

[0369] The second obtaining unit 602 is configured to obtain a source address verification entry based on the interface communicating with the first AS and the first prefix, where the source address verification entry includes the first prefix and an identifier of the interface.

[0370] In a possible implementation, the first valid relationship is that an area corresponding to a relationship between two upstream and downstream ASs matches an area corresponding to a customer group, and the customer group includes the two upstream and downstream ASs; or,

[0371] The first valid relationship is a relationship between ASs that have passed verification by multiple databases, and at least one of the registration quantity, deployment time, digital signature, and certificate authentication of the multiple databases is different.

[0372] In a possible implementation, the apparatus 600 further includes:

[0373] A first determining unit is configured to determine that the first AS and the second AS have the first valid relationship based on a match between an area corresponding to the first AS and a valid area corresponding to the relationship between the first AS and the second AS.

[0374] In a possible implementation, the apparatus 600 further includes:

[0375] The second determination unit is used to determine that the first AS and the second AS have the first valid relationship based on matching the second correspondence relationship with the third correspondence relationship, the second correspondence relationship includes the identifier of the first AS, the identifier of the second AS, and the relationship between the first AS and the second AS, and the third correspondence relationship includes the identifier of the first AS, the identifier of the second AS, and the relationship between the first AS and the second AS.

[0376] In a possible implementation, the second correspondence is obtained by searching the downstream AS from the autonomous system service provider authorized ASPA database based on the identifier of the first AS, and the third correspondence is obtained by searching the downstream AS from the Internet Routing Registration IRR database based on the identifier of the first AS; or,

[0377] The second corresponding relationship is obtained by searching the upstream AS from the autonomous system service provider authorized ASPA database based on the identifier of the second AS, and the third corresponding relationship is obtained by searching the upstream AS from the Internet Routing Registration IRR database based on the identifier of the second AS.

[0378] In a possible implementation, the first obtaining unit 601 is used to obtain the identifier of the second AS based on the identifier of the first AS and the first corresponding relationship; obtain the first prefix based on the identifier of the second AS and a fourth corresponding relationship, and the fourth corresponding relationship includes the identifier of the second AS, the first prefix and the second valid relationship.

[0379] In a possible implementation, the area corresponding to the relationship between the second valid relationship and the AS to which the prefix belongs matches the area corresponding to the customer group, and the customer group includes the AS to which the prefix belongs; or,

[0380] The second valid relationship is a relationship between ASs that have passed verification by multiple databases, and at least one of the registration quantity, deployment time, digital signature and certificate authentication of the multiple databases is different.

[0381] In a possible implementation, the device 600 further includes: a third determining unit, configured to determine that the second AS has the second valid relationship with the first prefix based on matching an area corresponding to the second AS with a valid area corresponding to the relationship between the second AS and the first prefix.

[0382] In a possible implementation, the device 600 also includes: a fourth determination unit, used to determine that the second AS and the first prefix have the second valid relationship based on matching the fifth correspondence with the sixth correspondence, the fifth correspondence including the identifier of the second AS, the first prefix, and the relationship between the second AS and the first prefix, and the sixth correspondence including the identifier of the second AS, the first prefix, and the relationship between the second AS and the first prefix.

[0383] In a possible implementation, the fifth correspondence is obtained by searching for a prefix from an ROA database based on an identifier of the second AS, and the sixth correspondence is obtained by searching for a prefix from an IRR database based on an identifier of the second AS; or,

[0384] The fifth corresponding relationship is obtained by searching the ROA database for the home AS based on the first prefix, and the sixth corresponding relationship is obtained by searching the IRR database for the home AS based on the first prefix.

[0385] In a possible implementation, the first corresponding relationship includes a customer group of the first AS, and the customer group of the first AS includes the first AS and the second AS.

[0386] In a possible implementation, the apparatus 600 is executed by a network device, the network device includes the interface, and the network device is located at an edge of a third AS, where the third AS is located upstream of the first AS.

[0387] In a possible implementation, the apparatus 600 is provided in a control device, and the apparatus 600 further includes:

[0388] The sending unit is used to send the protocol message to a network device, the network device includes the interface, the network device is located at the edge of a third AS, the third AS is located upstream of the first AS, and the protocol message includes the source address verification table entry.

[0389] In a possible implementation, the protocol message is a Border Gateway Protocol BGP message or a Path Computation Element Protocol PCEP message.

[0390] In a possible implementation, the protocol message is a Border Gateway Protocol Flow Rule BGP FS message, and the BGP FS message includes a Network Layer Reachability Information NLRI field and an extended community attribute field, the NLRI field includes the first prefix, and the extended community attribute field includes an identifier of the interface.

[0391] Fig.14The device embodiments described are merely illustrative. For example, the division of the above units is only a logical functional division. There may be other division methods in actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. The functional units in the various embodiments of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0392] Each unit in the device 600 for obtaining source address verification entries is implemented in whole or in part by software, hardware, firmware or any combination thereof.

[0393] In conjunction with the device 600 described below, some possible implementations of various functional units in the device 600 for acquiring source address verification entries using hardware or software are described below.

[0394] In the case of software implementation, for example, the first obtaining unit 601 and the second obtaining unit 602 are composed of Fig.15 At least one processor 601 in the processor 601 reads the program code stored in the memory 602 and generates a software function unit to implement it.

[0395] Fig.14 The above-mentioned units are implemented by different hardware in the network device or the control device, for example, the first obtaining unit 601 is implemented by Fig.15 The second obtaining unit 602 is implemented by a part of the processing resources in at least one processor 601 (for example, one core or two cores in a multi-core processor). Fig.15 The receiving unit and the sending unit are composed of the remaining processing resources of at least one processor 601 (such as other cores in a multi-core processor), or a programmable device such as a field-programmable gate array (FPGA) or a coprocessor. Fig.15 The network interface 603 in is implemented.

[0396] Fig.15 6 is a schematic diagram of the structure of a device 600 provided in an embodiment of the present application. The device 600 may be a network device or a control device.

[0397] Optionally, in combination with Figure 1 From the application scenario shown, Fig.15 The device 600 shown is Figure 1 The router R2 located at the edge of AS4. Figure 3 Come and see, Fig.15 The device 600 is shown for performing the following Figure 3Optionally, in combination with the attached Figure 4 Come and see, Fig.15 The device 600 is shown for performing the following Figure 4 S32 to S36 in the method shown. Optionally, in combination with the attached Fig.13 Come and see, Fig.15 The device 600 is shown for performing the following Fig.13 The method flow is shown.

[0398] The device 600 includes at least one processor 601, a memory 602, and at least one network interface 603. The processor 601 is, for example, a general-purpose central processing unit (CPU), a network processor (NP), a graphics processing unit (GPU), a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the solution of the present application. For example, the processor 601 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The memory 602 is, for example, a read-only memory (ROM) or other static storage device that can store static information and instructions, a random access memory (RAM) or other dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. Optionally, the memory 602 exists independently and is connected to the processor 601 through an internal connection 604. Alternatively, the memory 602 and the processor 601 are optionally integrated together. The network interface 603 uses any transceiver-like device for communicating with other devices or communication networks. The network interface 603 includes, for example, at least one of a wired network interface or a wireless network interface, wherein the wired network interface is, for example, an Ethernet interface.The Ethernet interface is, for example, an optical interface, an electrical interface or a combination thereof. The wireless network interface is, for example, a wireless local area network (WLAN) interface, a cellular network interface or a combination thereof.

[0399] In some embodiments, the processor 601 includes one or more CPUs, such as Fig.15 CPU0 and CPU1 are shown in the figure.

[0400] In some embodiments, the device 600 optionally includes multiple processors, such as Fig.15 601 and processor 605 are shown in FIG. Each of these processors is, for example, a single-core processor (single-CPU), or a multi-core processor (multi-CPU). The processor herein optionally refers to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).

[0401] In some embodiments, the device 600 further includes an internal connection 604. The processor 601, the memory 602, and the at least one network interface 603 are connected via the internal connection 604. The internal connection 604 includes a path to transmit information between the above components. Optionally, the internal connection 604 is a single board or a bus. Optionally, the internal connection 604 is divided into an address bus, a data bus, a control bus, etc.

[0402] In some embodiments, the device 600 further includes an input-output interface 606. The input-output interface 606 is connected to the internal connection 604.

[0403] Optionally, the processor 601 implements the method in the above embodiment by reading the program code stored in the memory 602, or the processor 601 implements the method in the above embodiment by the program code stored internally. In the case where the processor 601 implements the method in the above embodiment by reading the program code stored in the memory 602, the memory 602 stores the program code 610 that implements the method provided in the embodiment of the present application.

[0404] For more details on how the processor 601 implements the above functions, please refer to the descriptions in the previous method embodiments, which will not be repeated here.

[0405] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0406] A refers to B, which means that A is the same as B or A is a simple variant of B.

[0407] The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of objects, and cannot be understood as indicating or implying relative importance. For example, the first protocol message and the second protocol message are used to distinguish different protocol messages, rather than to describe a specific order of protocol messages, and cannot be understood as the first protocol message being more important than the second protocol message.

[0408] The information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the ASPA data, ROA data and IRR data involved in this application are all obtained with full authorization.

[0409] In the embodiments of the present application, unless otherwise specified, "at least one" means one or more, and "a plurality" means two or more. For example, a plurality of databases means two or more databases.

[0410] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in accordance with the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0411] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for obtaining a source address verification table entry, It is characterized in that The method comprises: Based on the identifier of the first autonomous system AS and the first corresponding relationship, obtaining a first prefix of the second AS, where the first corresponding relationship includes the identifier of the first AS, the identifier of the second AS, and the first valid relationship, and the second AS is located downstream of the first AS; Based on the interface communicating with the first AS and the first prefix, a source address verification entry is obtained, where the source address verification entry includes the first prefix and an identifier of the interface.

2. The method according to claim 1, It is characterized in that The first valid relationship is that an area corresponding to a relationship between two upstream and downstream ASs matches an area corresponding to a customer group, and the customer group includes the two upstream and downstream ASs; or, The first valid relationship is a relationship between ASs that have been verified by multiple databases, and at least one of the registration quantity, deployment time, digital signature and certificate authentication of the multiple databases is different.

3. The method according to claim 1, It is characterized in that Before obtaining the first prefix of the second AS based on the identifier of the first AS and the first corresponding relationship, the method further includes: Based on a match between an area corresponding to the first AS and a valid area corresponding to a relationship between the first AS and the second AS, it is determined that the first AS and the second AS have the first valid relationship.

4. The method according to claim 1, It is characterized in that Before obtaining the first prefix of the second AS based on the identifier of the first AS and the first corresponding relationship, the method further includes: Based on the matching of the second correspondence and the third correspondence, it is determined that the first AS and the second AS have the first valid relationship, the second correspondence includes the identifier of the first AS, the identifier of the second AS, and the relationship between the first AS and the second AS, and the third correspondence includes the identifier of the first AS, the identifier of the second AS, and the relationship between the first AS and the second AS.

5. The method according to claim 4, It is characterized in that The second correspondence is obtained by searching for a downstream AS from an ASPA database authorized by an autonomous system service provider based on the identifier of the first AS, and the third correspondence is obtained by searching for a downstream AS from an Internet Routing Registration IRR database based on the identifier of the first AS; or The second correspondence is obtained by searching for the upstream AS from the autonomous system service provider authorized ASPA database based on the identifier of the second AS, and the third correspondence is obtained by searching for the upstream AS from the Internet Routing Registration IRR database based on the identifier of the second AS.

6. The method according to any one of claims 1 to 5, It is characterized in that The obtaining, based on the identifier of the first AS and the first corresponding relationship, the first prefix of the second AS includes: Based on the identifier of the first AS and the first corresponding relationship, obtain the identifier of the second AS; The first prefix is ​​obtained based on the identifier of the second AS and a fourth corresponding relationship, where the fourth corresponding relationship includes the identifier of the second AS, the first prefix, and a second valid relationship.

7. The method according to claim 6, It is characterized in that The area corresponding to the relationship between the second valid relationship and the AS to which the prefix belongs matches the area corresponding to the customer group, and the customer group includes the AS to which the prefix belongs; or The second valid relationship is a relationship between ASs that have passed verification by multiple databases, and at least one of the registration quantity, deployment time, digital signature and certificate authentication of the multiple databases is different.

8. The method according to claim 6, It is characterized in that Before obtaining the first prefix based on the identifier of the second AS and the fourth corresponding relationship, the method further includes: Based on a match between an area corresponding to the second AS and a valid area corresponding to a relationship between the second AS and the first prefix, it is determined that the second AS has the second valid relationship with the first prefix.

9. The method according to claim 4, It is characterized in that Before obtaining the first prefix based on the identifier of the second AS and the fourth corresponding relationship, the method further includes: Based on the matching of the fifth correspondence and the sixth correspondence, it is determined that the second AS and the first prefix have the second valid relationship, the fifth correspondence includes the identifier of the second AS, the first prefix, and the relationship between the second AS and the first prefix, and the sixth correspondence includes the identifier of the second AS, the first prefix, and the relationship between the second AS and the first prefix.

10. The method according to claim 1, It is characterized in that The fifth correspondence is obtained by searching for a prefix from a routing source authorization ROA database based on the identifier of the second AS, and the sixth correspondence is obtained by searching for a prefix from an IRR database based on the identifier of the second AS; or The fifth corresponding relationship is obtained by searching the home AS from the ROA database based on the first prefix, and the sixth corresponding relationship is obtained by searching the home AS from the IRR database based on the first prefix.

11. The method according to claim 1, It is characterized in that The first corresponding relationship includes a customer group of the first AS, and the customer group of the first AS includes the first AS and the second AS.

12. The method according to claim 1, It is characterized in that The method is performed by a network device, the network device comprises the interface, and the network device is located at an edge of a third AS, where the third AS is located upstream of the first AS.

13. The method according to claim 1, It is characterized in that The method is executed by a control device, and after obtaining a source address verification entry based on an interface communicating with the first AS and the first prefix, the method further includes: The control device sends the protocol message to a network device, the network device includes the interface, the network device is located at the edge of a third AS, the third AS is located upstream of the first AS, and the protocol message includes the source address verification table entry.

14. The method according to claim 13, It is characterized in that The protocol message is a Border Gateway Protocol BGP message or a Path Computation Element Protocol PCEP message.

15. The method according to claim 13 or 14, It is characterized in that The protocol message is a Border Gateway Protocol Flow Rules BGP FS message, and the BGP FS message includes a Network Layer Reachability Information NLRI field and an Extended Community Attribute field, the NLRI field includes the first prefix, and the Extended Community Attribute field includes an identifier of the interface.

16. A device for obtaining a source address verification entry, It is characterized in that The device comprises: A first obtaining unit, configured to obtain a first prefix of a second AS based on an identifier of a first autonomous system AS and a first corresponding relationship, wherein the first corresponding relationship includes an identifier of the first AS, an identifier of the second AS, and the first valid relationship, and the second AS is located downstream of the first AS; The second obtaining unit is used to obtain a source address verification entry based on the interface communicating with the first AS and the first prefix, wherein the source address verification entry includes the first prefix and an identifier of the interface.

17. The device according to claim 16, It is characterized in that The first valid relationship is that an area corresponding to a relationship between two upstream and downstream ASs matches an area corresponding to a customer group, and the customer group includes the two upstream and downstream ASs; or, The first valid relationship is a relationship between ASs that have been verified by multiple databases, and at least one of the registration quantity, deployment time, digital signature and certificate authentication of the multiple databases is different.

18. The device according to claim 16, It is characterized in that The device also includes: A first determining unit is configured to determine that the first AS and the second AS have the first valid relationship based on a match between an area corresponding to the first AS and a valid area corresponding to the relationship between the first AS and the second AS.

19. The device according to claim 16, It is characterized in that The device also includes: The second determination unit is used to determine that the first AS and the second AS have the first valid relationship based on matching the second correspondence relationship with the third correspondence relationship, the second correspondence relationship includes the identifier of the first AS, the identifier of the second AS, and the relationship between the first AS and the second AS, and the third correspondence relationship includes the identifier of the first AS, the identifier of the second AS, and the relationship between the first AS and the second AS.

20. The device according to claim 19, It is characterized in that The second correspondence is obtained by searching for a downstream AS from an ASPA database authorized by an autonomous system service provider based on the identifier of the first AS, and the third correspondence is obtained by searching for a downstream AS from an Internet Routing Registration IRR database based on the identifier of the first AS; or The second correspondence is obtained by searching for the upstream AS from the autonomous system service provider authorized ASPA database based on the identifier of the second AS, and the third correspondence is obtained by searching for the upstream AS from the Internet Routing Registration IRR database based on the identifier of the second AS.

21. The device according to any one of claims 16 to 20, It is characterized in that The first obtaining unit is used to obtain the identifier of the second AS based on the identifier of the first AS and the first corresponding relationship; obtain the first prefix based on the identifier of the second AS and a fourth corresponding relationship, and the fourth corresponding relationship includes the identifier of the second AS, the first prefix and the second valid relationship.

22. The device according to claim 21, It is characterized in that The area corresponding to the relationship between the second valid relationship and the AS to which the prefix belongs matches the area corresponding to the customer group, and the customer group includes the AS to which the prefix belongs; or The second valid relationship is a relationship between ASs that have passed verification by multiple databases, and at least one of the registration quantity, deployment time, digital signature and certificate authentication of the multiple databases is different.

23. The device according to claim 21, It is characterized in that The device also includes: A third determining unit is configured to determine that the second AS and the first prefix have the second valid relationship based on a match between an area corresponding to the second AS and a valid area corresponding to the relationship between the second AS and the first prefix.

24. The device according to claim 19, It is characterized in that The device also includes: The fourth determination unit is used to determine that the second AS and the first prefix have the second valid relationship based on matching the fifth correspondence with the sixth correspondence, the fifth correspondence including the identifier of the second AS, the first prefix, and the relationship between the second AS and the first prefix, and the sixth correspondence including the identifier of the second AS, the first prefix, and the relationship between the second AS and the first prefix.

25. The device according to claim 16, It is characterized in that The fifth correspondence is obtained by searching for a prefix from a routing source authorization ROA database based on the identifier of the second AS, and the sixth correspondence is obtained by searching for a prefix from an IRR database based on the identifier of the second AS; or The fifth corresponding relationship is obtained by searching the home AS from the ROA database based on the first prefix, and the sixth corresponding relationship is obtained by searching the home AS from the IRR database based on the first prefix.

26. The device according to claim 16, It is characterized in that The first corresponding relationship includes a customer group of the first AS, and the customer group of the first AS includes the first AS and the second AS.

27. The device according to claim 16, It is characterized in that The apparatus is executed by a network device, the network device includes the interface, and the network device is located at an edge of a third AS, where the third AS is located upstream of the first AS.

28. The device according to claim 16, It is characterized in that The device is provided in a control device, and the device further comprises: A sending unit is used to send the protocol message to a network device, the network device includes the interface, the network device is located at the edge of a third AS, the third AS is located upstream of the first AS, and the protocol message includes the source address verification table entry.

29. The device according to claim 28, It is characterized in that The protocol message is a Border Gateway Protocol BGP message or a Path Computation Element Protocol PCEP message.

30. The device according to claim 28 or 29, It is characterized in that The protocol message is a Border Gateway Protocol Flow Rules BGP FS message, and the BGP FS message includes a Network Layer Reachability Information NLRI field and an Extended Community Attribute field, the NLRI field includes the first prefix, and the Extended Community Attribute field includes an identifier of the interface.

Citation Information

Cited By

  • Inter-domain source address verification method and device based on multiple information sources, equipment and medium

    CN120185933A

  • Source address validation table entry acquisition method and apparatus

    EP4701132A1

  • Source address validation table entry acquisition method and apparatus

    WO2024234907A1