Source address validation table entry acquisition method and apparatus
By acquiring valid relationships between autonomous systems and multiple database verifications, the accuracy of source address verification entries is improved, the problem of incorrect identification during source address verification is solved, the ability of network devices to identify legitimate packets is enhanced, and the probability of attack traffic being forwarded is reduced.
Patent Information
- Application Number
- PCT/CN2024/088221
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-18
- Filing Date
- 2024-04-17
- Publication Date
- 2024-11-21
AI Technical Summary
The accuracy of source address verification entries in existing technologies is insufficient, resulting in a high probability of errors during the source address verification process, which cannot effectively block attack traffic.
By obtaining valid relationships between autonomous systems, and utilizing region matching between ASs and multiple database verifications, more accurate source address verification entries can be obtained.
It improves the accuracy of source address verification entries, reduces the security risks caused by source address spoofing attacks, and enhances the ability of network devices to identify legitimate packets.
Smart Images

Figure CN2024088221_21112024_PF_FP_ABST
Abstract
Description
Method and device for obtaining source address verification table entries
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on May 18, 2023, with application number 2023105680744 and invention name “Method and Device for Obtaining Source Address Verification Table Entries”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of communications, and in particular to a method and device for obtaining source address verification entries. Background Art
[0003] Source address validation (SAV) is an important defense against source address forgery attacks. Many defense solutions, such as unicast reverse path forwarding (uRPF), are based on source address validation. During the source address verification process, network devices verify 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. Currently, the accuracy of the source address verification table entry is insufficient, resulting in a high probability of errors during the source address verification process.
[0004] Summary of the Invention
[0005] The present application provides a method and apparatus for obtaining source address verification entries, which helps to improve the accuracy of source address verification entries. The technical solution is as follows.
[0006] 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 the identifier of the first AS, the 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, since the prefix is obtained by utilizing the valid relationship between ASs, the error caused by the invalid relationship between ASs 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.
[0007] In one possible implementation, the first valid relationship is that the region corresponding to the relationship between the two upstream and downstream ASs matches the region 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 regions match.
[0008] In one 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 matching 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, since the validity of the relationship between ASs is confirmed based on the characteristics of area matching, the prefix is obtained using the AS with area matching, thereby eliminating as much as possible the errors caused by the AS with non-matching area in the prefix acquisition process, and avoiding the prefix of the AS with non-matching 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.
[0009] In one possible implementation, the first valid relationship is a relationship between ASes verified by multiple databases, where the multiple databases differ in at least one of the following: number of registrations, deployment time, digital signature, and certificate authentication. This approach enables the validation of the relationship between ASes across multiple databases, thereby further improving the reliability of the process of obtaining source address verification entries.
[0010] 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 thus improving the accuracy of the source address verification table entry obtained based on the prefix.
[0011] In a possible implementation, the second correspondence is obtained by searching the downstream AS from 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 from 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 from 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 from the Internet Routing Registration IRR database based on the identifier of the second AS.
[0012] In one 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, wherein the fourth corresponding relationship includes the identifier of the second AS, the first prefix, and a 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.
[0013] In one possible implementation, the second valid relationship is a relationship between a prefix and the AS to which the prefix belongs, where the region corresponding to the relationship matches the region 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 region matching, thereby eliminating errors in the prefix acquisition process caused by prefixes that do not match the region as much as possible, preventing prefixes that do not match the region from being incorrectly included in the prefix set, thereby improving the accuracy of the prefix and, in turn, improving the accuracy of the source address verification table entries obtained based on the prefix.
[0014] In a possible implementation, before obtaining the first prefix based on the identifier of the second AS and the fourth corresponding relationship, the method further includes: determining 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.
[0015] In one possible implementation, the second valid relationship is a relationship between ASs that has been verified by multiple databases, where the multiple databases differ in at least one of the following: number of registrations, deployment time, digital signature, and certificate authentication. This approach enables verification of the validity of the relationship between the AS and the prefix based on whether the multiple databases have been verified.
[0016] In one 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 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. 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.
[0017] In one 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 home AS from the ROA database based on the first prefix, and the sixth correspondence is obtained by searching the home AS from the IRR database based on the first prefix.
[0018] 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.
[0019] In a possible implementation, the method is performed 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.
[0020] In one possible implementation, the method is performed by a control device, and after obtaining a source address verification entry based on the interface for communicating with the first AS and the first prefix, the method further includes: the control device sending the protocol message to a network device, the network device including the interface, the network device being located at the edge of a third AS, the third AS being upstream of the first AS, the protocol message including the source address verification entry. This implementation supports the control device automatically sending the source address verification entry to the network device.
[0021] In a possible implementation, the protocol message is a Border Gateway Protocol (BGP) message or a Path Computation Element Protocol (PCEP) message.
[0022] In one 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 the identifier of the interface.
[0023] In the second aspect, a device for obtaining a source address verification table entry is provided, and the device for obtaining a source address verification table entry has the function of implementing the above-mentioned first aspect or any optional method of the first aspect. The device for obtaining a source address verification table entry 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 optional method of the first aspect. In some embodiments, the unit in the device for obtaining a source address verification table entry is implemented by software, and the unit in the device for obtaining a source address verification table entry is a program module. In other embodiments, the unit in the device for obtaining a source address verification table entry is implemented by hardware or firmware. The specific details of the device for obtaining a source address verification table entry provided by the second aspect can be found in the above-mentioned first aspect or any optional method of the first aspect, and will not be repeated here.
[0024] In a third aspect, a network device is provided, comprising a processor and a network interface. The processor is configured to execute instructions so that the network device performs the method provided in the first aspect or any optional embodiment of the first aspect, and the network interface is configured to receive or send messages. Specific details of the network device provided in the third aspect can be found in the first aspect or any optional embodiment of the first aspect and are not further described here.
[0025] In a fourth aspect, a computer-readable storage medium is provided, which stores at least one instruction. When the instruction is executed on a computer, the computer executes the method provided by the first aspect or any optional embodiment of the first aspect.
[0026] 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 run by a computer, the computer executes the method provided by the first aspect or any optional method of the first aspect.
[0027] 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
[0028] FIG1 is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0029] FIG2 is a schematic diagram of a source address verification scenario provided by an embodiment of the present application;
[0030] FIG3 is a flow chart of a BAR-SAV method provided in an embodiment of the present application;
[0031] FIG4 is a flow chart of another BAR-SAV method provided in an embodiment of the present application;
[0032] FIG5 is a flow chart of another BAR-SAV method provided in an embodiment of the present application;
[0033] FIG6 is a schematic diagram of a TLV format provided in an embodiment of the present application;
[0034] FIG7 is a schematic diagram of another TLV format provided in an embodiment of the present application;
[0035] FIG8 is a schematic diagram of another TLV format provided in an embodiment of the present application;
[0036] FIG9 is a schematic diagram of another TLV format provided in an embodiment of the present application;
[0037] FIG10 is a schematic diagram of the format of an NLRI field provided in an embodiment of the present application;
[0038] FIG11 is a schematic diagram of the format of an NLRI field provided in an embodiment of the present application;
[0039] FIG12 is a schematic diagram of the format of an extended community attribute field provided in an embodiment of the present application;
[0040] 13 is a flowchart of a method for obtaining a source address verification entry according to an embodiment of the present application;
[0041] 14 is a schematic structural diagram of a device for obtaining a source address verification entry according to an embodiment of the present application;
[0042] FIG15 is a schematic structural diagram of a device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] 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.
[0044] The following is an explanation of some terminology concepts involved in the embodiments of this application.
[0045] Source address spoofing attack: An attacker disguises himself as a legitimate network device and carries a forged address in the source address field of the message he sends. This helps the attacker conceal his identity, deceive other network devices, and perform malicious actions.
[0046] Prefix: It can also be called a network prefix, network segment, or IP address segment. The prefix is a part of the 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 with a subnet mask of 255.255.255.0 (the prefix is 24 bits long). The prefix of this IPv4 address is 192.168.1.0, and the host number is 50. In other words, 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 this application will use the form of "P+number" to simplify the specific prefix, where P represents prefix, such as a prefix simplified as P5.
[0047] An autonomous system (AS) is a group of network devices with the same routing policy, managed by the same entity. Each AS on the Internet is assigned an AS number, allowing other network devices to find the corresponding AS based on the AS number. For simplicity, the following examples of this application use the "AS+number" format to simplify the representation of specific ASs. For example, an AS is simply represented as AS 1.
[0048] AS identifier: This is data used to identify an AS. For example, an AS identifier is an AS number or an AS name. An AS number, also called an AS number, is a positive integer typically ranging from 1 to 65535.
[0049] An autonomous system path (AS_path) is a sequence of ASs that records all ASs that a Border Gateway Protocol (BGP) route passes through from its source AS to its destination AS. Based on the AS_path, the relationship between each BGP route sender and its upstream AS can be determined. For example, a pair of adjacent ASs in an 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 a BGP update message, the AS_path corresponding to prefix P6 is [AS 3 AS 1 AS 6], indicating that prefix P6 originates from AS 6, then passes through AS 1 and AS 3 in sequence. AS 6 has a C2P relationship with AS 1, and AS 1 has a C2P relationship with AS 3.
[0050] AS relationships refer to the relationship between two neighboring ASs. These relationships influence how traffic is forwarded and how routing is selected between the two ASes. These relationships include peer-to-peer (P2P), provider-to-customer (P2C), customer-to-provider (C2P), and sibling-to-sibling (S2S). AS relationships are typically business relationships, governed by the commercial contracts between the Internet Service Providers (ISPs) to which the ASes belong.
[0051] A P2P relationship indicates that two neighboring ASs are equal. Two ASs in a P2P relationship advertise their own routes and the routes of their directly connected customer ASs to each other. Typically, two ASs in a P2P relationship do not pay each other any fees. They typically do not exchange routes for the ASes of their customer ASes, thus preventing the other AS from accessing the Internet through them.
[0052] A C2P relationship represents a customer-provider relationship between two ASs. The provider AS provides access to the Internet and forwards traffic for the customer AS. The customer AS communicates with the rest of the Internet through the provider AS. Typically, the customer AS pays for the provider AS's bandwidth and network connectivity. The routes exchanged between ASs in a C2P relationship are more extensive than those exchanged between ASs in a P2P relationship. Typically, in a C2P relationship, the provider AS sends the customer AS its own routes, routes for its customer ASs, and routes for its customer ASs (next-level ASs). The customer AS then sends its own routes to the provider AS. This allows the customer AS to obtain a more complete routing table based on the routes sent by the provider AS, allowing it to determine how to route 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. During traffic forwarding, the customer AS is typically downstream of the provider AS and can select the provider AS as the next hop to forward traffic through the provider AS to its destination.
[0053] P2C relationship: This is equivalent to the reverse description of the C2P relationship. The C2P relationship is described from the perspective of the customer AS, while the P2C relationship is described from the perspective of the provider AS. The content described in the C2P relationship is consistent with that in the P2C relationship.
[0054] S2S relationship: Two ASes in an S2S relationship can freely exchange all routes. A typical example is an S2S relationship between two ASes in the same organization (such as two ASes managed by the same city or ISP).
[0055] For example, please refer to Table 1, which shows the legal AS relationships.
[0056] Table 1
[0057] Customer cone: The customer cone of an AS is the set consisting of the AS itself, all customer ASs directly connected to it, and all customer ASs indirectly connected to it. By identifying the set of customer ASs for an AS and tracing back to the set of customer ASs at the next level down for each AS in the customer AS set, the customer cone of that AS can be constructed. For example, refer to Figure 1, which uses a circle to represent the customer cone of AS 3. Every AS within the circle belongs to AS 3's customer cone. As shown in Figure 1, to determine the customer cone of AS 3, we first identify AS 3 itself as an AS in the customer cone. Then, starting from AS 3, we traverse down through each level, identifying the ASs at each level, ultimately obtaining the set of all ASs reachable through AS 3. In this set, the AS at the last level no longer has any customer ASs. In this example, the customer cone of AS 3 is {AS 3, AS 1, AS 2, AS 5, AS 6, AS 7, AS 8}. A customer cone is typically an unordered set; each AS represents the same meaning regardless of its position in the set. For ease of description, this embodiment places the owner of the customer group, AS 3, at the front of the customer group. Other ASs other than the owner of the customer group are arranged in ascending order within the customer group. Furthermore, this embodiment uses "{}" to represent a set.
[0058] In Figure 1, "C2P" is marked between AS 1 and AS 3, indicating that AS 1 is a customer AS of AS 3 and that a C2P relationship exists between them. In Figure 1, P2[AS 2]community:AS 9 means that the BGP update message sent by AS 2 to AS 3 includes prefix P2 and a community attribute, with the value of the community attribute being AS 9. P2[AS 2]community:AS 9 indicates that after AS 2 advertises prefix P2 to AS 3, AS 3 is permitted to further advertise prefix P2 to AS 9, but is prohibited from further advertising prefix P2 to other ASes except AS 9. In Figure 1, P5[AS 5]NO_EXPORT indicates that after AS 5 advertises prefix P5 to AS 1, AS 1 is prohibited from advertising prefix P5 to other ASes. In Figure 1, P8[AS 8]NO_EXPORT indicates that after AS 8 advertises prefix P8 to AS 2, AS 2 is not allowed to advertise prefix P8 to other ASs.
[0059] The Autonomous System Provider Authorization (ASPA) database is a database jointly maintained by ISPs and the Internet Engineering Task Force (IETF). The ASPA database is used to record and manage ASs and their corresponding authorized providers in the global Internet. For example, the ASPA database includes the identifier of a customer AS and a set of authorized provider ASs. The set of authorized provider ASs includes the identifiers of one or more authorized provider ASs. An authorized provider AS is, for example, an AS authorized to propagate routes received from a customer AS. If a customer AS has multiple authorized provider ASs, the identifier of the customer AS and the identifiers of each of the multiple authorized provider ASs are typically registered in the same record in the ASPA database. For example, AS 1 and Provider Y sign a contract; Provider Y adds a record to the ASPA database containing the AS number of AS 1 in the customer AS list and the AS number of Provider Y in the authorized provider list. This record indicates that AS 1 is managed by Provider Y and that Provider Y has the authority to further distribute prefixes advertised by AS 1 on the Internet. The ASPA database is managed based on the Resource Public Key Infrastructure (RPKI). RPKI is a technology that verifies the authorized relationship between an IP address and an AS through digital signatures. The ASPA database contains the authorization certificates of all ASes worldwide. These certificates can help ISPs and other network operators verify that the ASes they connect to are authorized to connect to a particular region.
[0060] The Internet Routing Registry (IRR) database is a database used to determine and share routing information. In addition, the IRR database records network topology and relationships between autonomous systems (ASs). The IRR database uses the Routing Policy Specification Language (RPSL) to describe stored data. RPSL is an object-oriented language that defines 13 objects, one of which is the autonomous system number (aut-num) used to describe an AS. AS relationships can be extracted using the routing policy attribute of the 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 data stored in the IRR database through these tools or query interfaces. Examples of IRR database query interfaces include the World Wide Web Information Service (WHOIS) and the RPSL interface. Routers access the IRR database by invoking its query interface and sending query requests to the IRR database, thereby obtaining data stored in the IRR database.
[0061] The route origin authorization (ROA) database records the correspondence between prefixes and ASs. By querying the ROA database, you can obtain the prefixes owned by an AS. The ROA database stores ROA records issued by each AS. ROA records contain information such as the prefixes owned by the AS and their validity period. A ROA record is equivalent to a digital certificate, proving 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 containing AS 1's AS number and the prefix 10.0.0.0 / 24. This record indicates that prefix 10.0.0.0 / 24 was advertised by AS 1, thereby reducing the risk of malicious attacks caused by unauthorized ASs advertising their own prefixes. To query which IP address prefixes an AS owns, you can use the query interface provided by the ROA database based on the AS number to obtain the prefixes owned by that AS. In one possible implementation, the information stored in the ROA database is typically submitted by ASes themselves, and not all ASes submit ROA records. Therefore, the information in the ROA database may be incomplete. When a router queries a prefix, it verifies or supplements the AS prefix with data sources other than the ROA database, making the obtained AS prefix 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 packet, the network device matches the source address of the data packet 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 packet (the source address of the data packet includes the prefix in the source address verification entry), the network device considers that the source address of the data packet is legal and forwards the data packet; if there is no source address verification entry that matches the source address of the data packet, the network device considers that the source address of the data packet is illegal and discards the data packet.
[0063] The interface identifier includes, 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 description 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" can all come from a database, for example, such as 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 Example 1-a and Example 1-b. For example, the second correspondence comes from the following second ROA database, and the application of the second correspondence can refer to Example 3-a and Example 3-b.
[0065] The term "first area" in the description and claims of the embodiments of this application describes an area where the relationship between ASs is related, and the term "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 "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 "second customer group" is used to describe the customer group after correction, such as the second customer group obtained by correcting the first customer group based on regions or multiple databases.
[0067] Some embodiments of the present application involve correcting prefix sets based on regions or multiple databases. To distinguish between prefix sets before and after correction, a "first prefix set" is used below to describe the customer base before correction, such as an initial prefix set obtained based on a standard ROA database. A "second prefix set" is used below to describe the prefix set after correction, such as the first prefix set obtained by correcting the prefix set based on regions or multiple databases.
[0068] The following is an example of the 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, which is a schematic diagram of a scenario of source address verification provided by the embodiment of the present application. A source address verification table entry is stored on the router R2, and the source address verification table entry includes a source prefix and a legal input interface. In the source address verification table entry, the content of the source prefix entry is the prefix P1, and the content of the legal input interface entry is the identifier of interface a. In Figure 2, the character "a" is used to represent the identifier of interface a in the source address verification table entry. The meaning of the source address verification table entry in Figure 2 is that, for the router R2, the legal input 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 then passes the source address verification of message 1, allowing message 1 to pass through router R2.
[0071] As a specific example of a 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 then 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 by router R2.
[0072] Considering the strong connectivity of the Internet today, using a source address verification solution to verify the inbound interface corresponding to the source address of the message can greatly detect inbound interface anomalies and reduce the risk caused by source address forgery.
[0073] Source address validation using BGP UPDATEs, ASPA, and ROA (BAR-SAV) is a method for performing source address validation using BGP update messages, the ASPA database, and the ROA database. This method uses BGP update messages, the ASPA database, and the ROA database to obtain more accurate source address validation entries. Therefore, routers equipped with source address validation can more accurately determine which inbound interface or interfaces a message carrying a valid source address will arrive at based on the address validation entries, thereby reducing the probability of errors during the source address validation process.
[0074] FIG3 is a flow chart of the BAR-SAV method provided in an embodiment of the present application. The BAR-SAV method 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 boundary of an AS, and the network device is 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 can also be called the verified AS. For example, in the network topology shown in Figure 1, there is a C2P relationship between AS 3 and AS 4. Router R2 is deployed in AS 4, and router R2 includes interface a, which 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 the customer group of AS 3 from the traffic received at 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 via a control plane protocol or a management plane protocol. For example, the control device communicates with the network device that performs source address verification via BGP, the Path Computation Element Protocol (PCEP), the BGP Monitoring Protocol (BMP), or the Netstream protocol.
[0077] Step S32: Acquire the customer group of the first AS.
[0078] For example, the network device is router R2 deployed in AS 4, the first AS is AS 3 connected to router R2, and router R2 obtains the customer group of AS 3 based on the ASPA database and the BGP update message received by router R2.
[0079] Illustratively, the publicly available ASPA database is shown in Table 2 below.
[0080] Table 2
[0081] 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, thereby determining which ASs have registered AS 3 as an authorized provider for this AS in the ASPA database. In this example, the network device does not find any client ASs for AS 3 in the ASPA database, indicating that no AS has registered AS 3 as an authorized provider for this AS in the ASPA database.
[0082] Illustratively, the BGP update message received by the network device from AS 3 includes the content shown in Table 3 below.
[0083] Table 3
[0084] The network device traverses all received BGP update messages. It determines whether the AS_path in the received BGP update message contains AS 3. It obtains the BGP update messages whose AS_path contains AS 3 from all received BGP update messages, such as P2[AS 9 AS 3 AS 2] in the following table. The network device summarizes the BGP update messages to form the set shown in Table 4.
[0085] Table 4
[0086] After receiving a set of BGP update messages whose AS_path includes AS3, the network device then determines, based on the AS_path in each BGP update message in the set, the ASs downstream of AS 3 from the AS_paths, as the ASs in AS 3's customer group. For example, based on the first entry in Table 4 above, the network device determines AS 2 from the AS_path [AS 9 AS 3 AS 2]; based on the second entry in Table 4 above, the network device determines AS 1 and AS 6 from the AS_path [AS 3 AS 1 AS 6]; and based on the third entry in Table 4 above, the network device determines AS 1 and AS 7 from the AS_path [AS 3 AS 1 AS 7]. Therefore, the network device determines that {AS 3, AS 1, AS 2, AS 6, AS 7} is a subset of AS 3's customer group. The network device takes the set {AS 3, 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).
[0087] Step (1) The network device uses AS 3, the first AS in the initial customer group, as the provider AS and queries the publicly available ASPA database for customer ASs. Specifically, for a record in the ASPA database, the network device determines whether the authorized provider AS set in the record includes AS 3. If the authorized provider AS set does include AS 3, the network device further retrieves the customer AS in the record. If the query returns empty, this indicates that no AS in the ASPA database has registered AS 3 as a provider AS for the cost AS.
[0088] Step (2) The network device uses the next AS in the customer group, AS 1, as the provider AS and queries the ASPA database for customer ASs, obtaining AS 5 and AS 6. AS 6 is already in the AS3 customer group, so the network device adds AS 5 to the end of the initial customer group, updating AS 3's initial customer group to {AS 3, AS 1, AS 2, AS 6, AS 7, AS 5}.
[0089] 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}.
[0090] Step (4) The network device uses the next AS in the customer group, AS 6, as the provider AS and queries the customer AS in the ASPA database, which returns nothing.
[0091] Step (5) The network device uses the next AS AS 7 in the customer group as the provider AS and queries the customer AS in the ASPA database, which returns nothing.
[0092] Step (6) The network device uses the next AS AS 5 in the customer group as the provider AS and queries the customer AS in the ASPA database, which returns nothing.
[0093] Step (7) The network device uses the next AS AS 8 in the customer group as the provider AS and queries the customer AS in the ASPA database, which returns nothing.
[0094] AS 8 is 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, AS 6, AS 7, AS 8} obtained after the query as the AS 3 customer group.
[0095] By executing the aforementioned step-by-step process of obtaining the authorized provider list based on the initial customer group determined by the BGP update message, the network device 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, with respect to AS 5 in the AS 3 customer group, because the network device did not receive a BGP update message whose AS_path includes both AS 5 and AS 3, the network device cannot identify AS 5 as an AS in the AS 3 customer group based solely on the BGP routing information. However, by querying the authorized provider list based on AS 1 in the BGP update message, the network device can determine that AS 1's customer ASs include AS 5, thereby identifying AS 5 as an AS in the AS 3 customer group.
[0096] 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.
[0097] Table 5
[0098] 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.
[0099] Step S34: Acquire the IP address prefix set of the customer group belonging to the first AS.
[0100] An example of a publicly available ROA database is shown in Table 6 below.
[0101] Table 6
[0102] For example, 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 based on the customer group that has been found. The process of querying the IP address prefix set includes steps A to D.
[0103] In 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}.
[0104] In step B, the network device obtains a full BGP update message whose AS_path includes AS 3, as shown in Table 6 above.
[0105] In step C, the network device obtains ROA data for 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. The obtained results are shown in Table 7 below.
[0106] Table 7
[0107] In step D, the network device traverses each AS in AS 3's customer group. For each AS traversed, the network device obtains the prefix corresponding to the AS from the BGP update message obtained in step B and the prefix corresponding to the AS from the ROA data obtained in step C. Based on this, the network device queries the full set of prefixes belonging to AS 3's customer group, as shown in Table 8 below.
[0108] Table 8
[0109] Step S38: Obtain a source address verification entry based on the interface connected to the first AS on the network device and the prefix set.
[0110] 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 on the network device connected to AS 3 (e.g., interface a in the figure). A source address verification entry is, for example, a row in Table 9 below.
[0111] Table 9
[0112] Optionally, the BAR-SAV method further includes the following step S40.
[0113] Step S40: The network device performs source address verification on the data packets received from the client group of the first AS according to the source address verification entry.
[0114] The source address verification process can refer to the description of FIG2 above.
[0115] During step S32, when obtaining the customer base of an AS, the AS relationship is oversimplified, assuming that only a single relationship exists between a pair of ASs. For example, it is assumed that the AS relationship can only be P2P, C2P, P2C, or S2S. However, in different regions, ASs may have different relationships. In other words, the relationship between ASs may vary depending on the region. For example, a pair of ASs may only have a C2P relationship in a specific region, but not in other regions. Therefore, if the region is not taken into account during the process of obtaining the customer base, the obtained customer base may contain errors.
[0116] For example, in area A, AS 2's network performance is better than AS 1's. AS 1 is a customer of AS 2, accesses AS 2, and accesses the Internet through AS 2. AS 2 charges AS 1, so AS 1 and AS 2 have a C2P relationship in area A. In area B, AS 2's network is weaker than AS 1's. AS 2 is a customer of AS 1, accesses AS 1, and AS 1 charges AS 2, and accesses the Internet through AS 1. 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 regarded as a customer of AS 2, which is incorrect. 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.
[0117] 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.
[0118] In order to distinguish whether the description reflects the ASPA database of a region or not, the term "first ASPA database" is used below to describe a standard ASPA database without a region identifier, and the term "second ASPA database" is used to describe an ASPA database with a region identifier.
[0119] The first ASPA database is described above. The second ASPA database contains the correspondence between the identifiers of customer ASs, the set of authorized provider ASs, and region identifiers. Region identifiers are used to identify regions, specifically regions where C2P relationships between two ASs are valid. Region identifiers can take the form of, for example, a region name, an assigned region number, or the region's location coordinates.
[0120] For example, the second ASPA database includes at least one record, each of which includes a customer AS field, an authorized provider AS set field, and a region field. For example, if AS 1 and AS 2 register a C2P relationship in Europe, a record is created in the second ASPA database. In this record, 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. This record indicates that AS 1 and AS 2 have a C2P relationship in Europe.
[0121] Compared with the first ASPA database, the second ASPA database has an additional area identifier, so it can determine in which area two neighboring ASs register the C2P relationship, or in which area the C2P relationship between the two neighboring ASs is valid.
[0122] Regarding the method for obtaining the second ASPA database, for example, the network device locally stores the second ASPA database. In one possible implementation, the network device collects registration areas of C2P relationships between ASes, obtains area identifiers corresponding to the registration areas, and adds the area identifiers corresponding to the registration areas to the first ASPA database stored on the network device. In 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 responds to the query request by sending data stored in the second ASPA database to the network device.
[0123] The following examples 1-a and 1-b illustrate the process of acquiring a customer group. The execution subjects of the following examples 1-a and 1-b are, for example, network devices or control devices.
[0124] Example 1-a
[0125] 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.
[0126] The first customer group includes at least one customer AS of the first AS. For example, the process of obtaining the first customer group includes steps (1) to (3).
[0127] Step (1) takes the first AS as the authorization provider AS and searches the first AS's customer AS in the first ASPA database.
[0128] Step (2) obtaining the downstream AS of the first AS in the AS_path based on the BGP update message;
[0129] Step (3) takes the downstream AS of the first AS as the authorization provider AS and searches the first ASPA database for the customer AS corresponding to the downstream AS of the verification AS.
[0130] 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.
[0131] The first customer group includes the customer AS obtained in step (1) and the customer AS obtained in step (3).
[0132] 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.
[0133] For example, a network device is in AS 4, and the first AS is AS 3, to which the network device's inbound interface is connected. The network device uses the first ASPA database to obtain the ASs in AS 3's customer group. For example, based on AS 3, the network device queries the first ASPA database for the customer ASs corresponding to AS 3, but no customer ASs corresponding to AS 3 are found. Based on AS 3, the network device queries AS 3's downstream ASs in the received BGP update message and obtains AS 1 and AS 2. Based on AS 1 and AS 2, the network device queries the first ASPA database for the customer ASs corresponding to AS 1 and the customer ASs corresponding to AS 2, obtaining AS 3's customer group {AS 5, AS 6, AS 8} and the authorized provider list corresponding to the first customer group, as shown in Table 10 below.
[0134] Table 10
[0135] 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.
[0136] The following describes obtaining a first area identifier for an AS (the third AS) in the first customer group as an example. The process for obtaining the first area identifier for other ASs in the first customer group is similar to the process for 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.
[0137] For example, during step S322, a search is performed in the second ASPA database based on the AS identifier of the third AS and the AS identifier of the second AS. 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 region identifier in the record is further searched and used as the first region identifier corresponding to the third AS.
[0138] As a specific example, the network device executes step S321 and obtains that the customer group of AS 3 includes {AS 5, AS 6, AS 8}. Regarding AS 6 in the customer group, AS 6 is a customer AS obtained by querying AS 1. Based on the AS numbers of AS 6 and AS 1, the network device queries the second ASPA database and obtains the results shown in Table 11 below. Table 11 indicates that AS 6 and AS 1 have a C2P relationship in Europe. 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.
[0139] Table 11
[0140] 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.
[0141] 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.
[0142] Regarding the method for determining the area where the first AS is located, if the network device and the first AS are in the same area, the network device may determine the area where the device is currently located as the area where the first AS is located. If the network device and the first AS are in different areas, the network device may communicate with the first AS and receive the area where the first AS is located from the first AS.
[0143] In one possible implementation, if the first AS is located in the area indicated by the first area identifier, the AS corresponding to the first area identifier is determined to be accurate and retained in the customer group. If the first AS is not located in the area indicated by the first area identifier, the AS corresponding to the first area identifier is determined to be inaccurate and removed from the customer group. This approach corrects the customer group by excluding ASs from the first customer group whose areas do not match the actual situation, resulting in a more accurate second customer group.
[0144] The following example uses the determination of whether to delete the third AS from the customer group as an example. The logic for determining whether to delete other ASs from the customer group is similar. For example, the first customer group includes a third AS. 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 region. For example, the second ASPA database includes a correspondence between the AS identifier of the third AS, the AS identifier of the second AS, and the first region identifier. If the first AS is located in the first region, the third AS is determined to be a suitable AS in the customer group and is retained. Therefore, the third AS is included in the determined second customer group. If the first AS is not located in the first region, the third AS is deleted from the first customer group. Therefore, the third AS is not included in the determined second customer group. Based on the above method, the accuracy of the ASs in the customer group is verified one by one in combination with the region where the first AS is located, thereby reducing the probability of incorrect ASs appearing in the customer group.
[0145] For example, the network device executes step S321 and obtains that the customer group of AS 3 includes {AS 5 AS 6 AS 8}. Among them, AS 6 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.
[0146] In the above implementation, the first region identifier is obtained from the second ASPA database based on two parameters: the customer group and the authorized provider. In another possible implementation, the first region identifier can also be obtained from the second ASPA database based on either the customer group or the authorized provider list. For example, Example 1-a can also be implemented through the following steps S321' to S323'.
[0147] Step S321 ′: Based on the first ASPA database, obtain the first customer group of the first AS.
[0148] 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.
[0149] In one exemplary scenario, an ISP announces that an AS managed by the ISP only exists in a specific area and is illegal in other areas. In this scenario, the authorized provider list can be disregarded when obtaining the first area identifier. For example, when obtaining the first area identifier for a third AS, the first area identifier can be searched from the second ASPA database based on the third AS's AS identifier, without considering the third AS's authorized provider AS.
[0150] 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, the first customer group is corrected to obtain a second customer group.
[0151] The method provided in this embodiment verifies the AS in the customer group based on the region 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 ASs that do not match the region 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.
[0152] Example 1-a describes a process for 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 containing the first regional identifier (the second ASPA database) are separated, thereby reducing the implementation difficulty associated with modifying the global ASPA database. In other embodiments, the two databases (the first ASPA database and the second ASPA database) are merged into a single database, for example, by merging the first regional identifier with the global ASPA database to form a unified ASPA database. This saves one database search operation during the process of obtaining a customer base, as illustrated below by Example 1-b.
[0153] Example 1-b
[0154] 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.
[0155] For example, the process of obtaining the first customer group includes steps (1) to (3).
[0156] Step (1) takes the first AS as the authorization 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.
[0157] Step (2) obtains the downstream AS of the first AS in the AS_path based on the BGP update message.
[0158] 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.
[0159] The first customer group includes the customer AS obtained in step (1) and the customer AS obtained in step (3).
[0160] Step S322': Based on the region where the first AS is located and the first region identifier corresponding to each AS in the first customer group, the first customer group is corrected to obtain a second customer group.
[0161] The above step S322" is similar to step S323, and reference may be made to the description of step S323.
[0162] 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. This not only eliminates ASs in the customer group that do not match the region and obtain a more accurate customer group, but also simplifies the process of searching the database twice to searching the database once, thereby saving one database query process, reducing the operational complexity brought about by searching the database twice, and improving the efficiency of obtaining the customer group.
[0163] Example 1-a and Example 1-b describe a method for improving the accuracy of the customer base 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 that include 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 base can be obtained based on the first regional identifier. When this method is adopted, the record in the IRR database is an example of the first corresponding relationship.
[0164] In summary, the methods of the above-mentioned embodiments 1-a and 1-b, since the correspondence between the AS relationship and the first regional 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 regional identifier, verify whether the AS relationship corresponding to the first regional identifier is established, delete the AS with no C2P relationship from the customer group, and retain the customer AS with a C2P relationship in the customer group, thereby avoiding the AS without 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.
[0165] 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.
[0166] The above describes an implementation method for improving customer segment accuracy by considering regions. In another possible implementation, supplementing customer segments with IRR data can also improve customer segment accuracy to a certain extent. This is illustrated below using Example 2-a. The execution entity of Example 2-a below may be, for example, a network device or a control device.
[0167] Example 2-a
[0168] 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.
[0169] 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.
[0170] Step S322b: Based on the IRR database, obtain the AS relationship between the first customer group and the authorized provider list.
[0171] The IRR database query methods include the following query method A and query method B. The following describes the process of querying the IRR database for one AS (the third AS) in the first customer group as an example. The query process for other ASs in the first customer group is similar to the query process 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 second AS.
[0172] IRR database query method 1: Use the identifiers of a pair of ASs to query the relationship between the two ASs.
[0173] 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.
[0174] The query results (AS relations) obtained from the IRR database include three cases.
[0175] Case 1: Confirm that the relationship between a pair of neighboring ASs is a C2P relationship.
[0176] Case 2: Confirm that the relationship between a pair of neighboring ASs is not a C2P relationship.
[0177] Case 3: The IRR database does not contain a description of the relationship between a pair of neighboring ASs.
[0178] 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, and uses the authorized provider AS set as shown in Table 10. The network device uses each AS in the customer group {AS 5 AS 6 AS 8} of AS 3 shown in Table 10 to query 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. The query result 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. The query result 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. No relationship between AS 8 and AS 2 is found. The query result is shown in Table 12. Here, 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.
[0179] Table 12
[0180] The second query method of the IRR database is to use the customer AS to query the service provider AS.
[0181] For example, during the execution of step S322b, the third AS is treated as a client AS, and the authorized provider AS set corresponding to the third AS is queried in the IRR database. A determination is made as to 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 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 no C2P relationship between the third AS and the second AS.
[0182] 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 the first customer group based on the first ASPA database and the authorized provider AS set as shown in Table 10. The network device uses each AS in the customer group {AS 5 AS 6 AS 8} of AS3 shown in Table 10 to query the IRR database. AS 5 is used to find the authorized provider AS set in the IRR database, for example, {AS 5 AS 11 AS 12}. Since the authorized provider AS set found in the IRR database includes AS 5, it is determined that the IRR database records a C2P relationship between AS 5 and the second AS; AS 5 is used to find the authorized provider AS set in the IRR database, for example, {AS 1 AS 11 AS 12}. Since the authorized provider AS set {AS 1 AS 11 AS 12} found in the IRR database includes AS 1, it is determined that the IRR database records a C2P relationship between AS 5 and AS 1; AS 6 is used to find the authorized provider AS set in the IRR database, for example, {AS 11 AS 12}. Since the authorized provider AS set {AS 11 AS 12} found in the IRR database includes AS 1, it is determined that the IRR database records a C2P relationship between AS 5 and AS 1. 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.
[0183] Step S323c: Based on the AS relationship obtained from the IRR database, the first customer group is corrected to obtain a second customer group.
[0184] The following uses the logic of determining whether to retain the third AS in the first customer group as an example to illustrate the logic of determining whether to retain other ASs in the first customer group. The third AS is obtained based on the second AS querying the customer AS in the first ASPA database.
[0185] Case 1: The relationship between the third AS and the second AS obtained from the IRR database is a C2P relationship.
[0186] Case 1 corresponds to the ASPA and IRR databases describing the relationship between the third AS and the second AS in the same way. Both databases confirm a C2P relationship between the third AS and the second AS. In case 1, the third AS is determined to be a suitable AS in the customer group and is retained, resulting in the second customer group still including the third AS.
[0187] Case 2: The relationship between the third AS and the second AS obtained from the IRR database is not a C2P relationship.
[0188] Case 2 is equivalent to the ASPA and IRR databases having inconsistent descriptions of the relationship between the third AS and the second AS. The ASPA database confirms a C2P relationship between the third AS and the second AS, while the IRR database denies such a relationship. In Case 2, you can prioritize the IRR database and remove the third AS from the first customer group, resulting in a second customer group that does not include the third AS. Alternatively, you can prioritize the ASPA database and retain the third AS, resulting in a second customer group that still includes the third AS. For example, by configuring a policy on a network device, in Case 2, the policy determines whether to remove the third AS from the first customer group.
[0189] Case 3: There is no description of the relationship between the third AS and the second AS in the IRR database.
[0190] In case 3, the third AS can be removed from the first customer group, resulting in a second customer group that does not include the third AS. Alternatively, the third AS can be retained, resulting in a second customer group that still includes the third AS. For example, a policy can be configured on a network device. In case 3, the network device determines whether to remove the third AS from the first customer group based on the policy.
[0191] In one possible implementation, the policy includes a priority in the IRR database and a priority in the ASPA database. The network device determines whether to remove the third AS from the first customer group based on the priorities in the IRR database and the ASPA database. For example, if the priority in the IRR database is higher than the priority in the ASPA database, the network device removes the third AS from the first customer group. If the priority in the IRR database is lower than the priority in the ASPA database, the network device retains the third AS from the first customer group.
[0192] For example, the network device at AS4 obtains the AS3 customer group {AS 5 AS 6 AS 8} from the ASPA database. 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 5 AS 6 AS 8} are shown in Table 12. The C2P relationship between AS 5 and AS 1 is reconfirmed by the IRR data, so AS 5 remains in the AS 3 customer group. The AS relationship between AS 6 and AS 1 is verified as a non-C2P relationship by the IRR data, so the network device can determine whether AS 6 should be retained in the AS 3 customer group based on policy. No relationship record is found between AS 8 and AS 2 in the IRR data, so the network device can determine whether AS 8 should be retained in the AS 3 customer group based on policy.
[0193] The above strategies include, for example, the following strategy 1 or strategy 2.
[0194] Strategy 1: If the relationship between the third AS and the second AS is a C2P relationship as determined in the IRR database, retain the third AS in the first customer group. If the relationship between the third AS and the second AS is not a C2P relationship as determined in the IRR database, remove the third AS from the first customer group. If the IRR database does not contain a description of the relationship between the third AS and the second AS, remove the third AS from the first customer group.
[0195] For example, the first customer group is {AS 5 AS 6 AS 8}. The query results obtained from the IRR database are shown in Table 12. The IRR database contains records of a C2P relationship between AS 5 and AS 1, and a non-C2P relationship between AS 6 and AS 1. There is no relationship description between AS 8 and AS 2. Therefore, the network device retains AS 5 and deletes AS 6 and AS 8. The customer group of AS 3 is {AS 5} (the second customer group).
[0196] Strategy 2: If the relationship between the third AS and the second AS is a C2P relationship as determined in the IRR database, the third AS is retained in the first customer group. If the relationship between the third AS and the second AS is not a C2P relationship as determined in the IRR database, the third AS is removed from the first customer group. If the relationship between the third AS and the second AS is not described in the IRR database, the third AS is retained in the first customer group.
[0197] For example, the first customer group is {AS 5 AS 6 AS 8}. The query results obtained from the IRR database are shown in Table 12. The IRR database contains records of a C2P relationship between AS 5 and AS 1, and a non-C2P relationship between AS 6 and AS 1. There is no relationship description between AS 8 and AS 2. Therefore, the network device retains AS 5 and AS 8 and deletes AS 6. The customer group of AS 3 is {AS 5 AS 8} (the second customer group).
[0198] The method provided in this embodiment corrects the customer base obtained based on the ASPA database by introducing the IRR database. Since the IRR database was deployed earlier and is more mature than the ASPA database, the IRR database currently has a larger amount of registered data than the ASPA database and records more AS relationships. Therefore, using the IRR database as a data source for correcting the customer base helps to 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.
[0199] The above embodiment focuses on introducing an IRR database to correct the customer base obtained based on the ASPA database. In another possible implementation, an ASPA database is introduced to correct the customer base obtained based on the IRR database. This is illustrated below using Example 2-b. 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 be found in Example 2-a.
[0200] Example 2-b
[0201] 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.
[0202] Step S322b: Based on the ASPA database, obtain the AS relationship between the first customer group and the authorized provider list.
[0203] Step S323c: Based on the AS relationship obtained from the ASPA database, the first customer group is corrected to obtain a second customer group.
[0204] 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, while 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's independent registration based on the operators on accuracy, improves the accuracy of the customer group to a certain extent, and reduces the probability of errors in the subsequent source address verification process.
[0205] 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.
[0206] While the above embodiments 1-a, 1-b, 2-a, and 2-b all focus on methods for obtaining customer groups, the present application also provides methods for obtaining prefix sets. The above methods for obtaining customer groups and the following methods for obtaining prefix sets can be used independently or in combination.
[0207] 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 correcting the first customer group to obtain the second customer group through the above-mentioned method embodiment, the prefix set of the second customer group is further corrected through 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.
[0208] 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, for the customer group of the first AS obtained by the existing method, the prefix set is obtained by the following method embodiment, or the 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.
[0209] 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 prefix P2 and prefix P3 corresponding 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 AS 3's customer group, which is incorrect.
[0210] In view of this, in some embodiments of the present application, in the BAR-SAV process, when obtaining the prefix set of the customer group, prefixes that do not match the region are deleted from the customer group of the first AS based on the ROA database containing the region identifier, 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 source address verification.
[0211] In order to distinguish between ROA databases containing or not containing region identifiers, “first ROA database” is used below to describe a standard ROA database without region identifiers, and “second ROA database” is used below to describe an ROA database containing region identifiers.
[0212] Please refer to the description above for the first ROA database. The second ROA database includes the correspondence between AS identifiers, prefixes, and region identifiers. The second ROA database can be used to determine which AS publishes prefixes in which region, or in other words, the region in which the attribution relationship between prefixes and ASs is valid. For example, the second ROA database includes at least one record, which includes the identifier of AS 1, prefix P1, and Europe. This record indicates that AS 1 publishes prefix P1 in Europe, that prefix P1 belongs to AS 1 in Europe, or that the attribution relationship between prefix P1 and AS 1 is valid in Europe.
[0213] Regarding the method for obtaining the second ROA database, for example, the network device locally stores the second ROA database. In one possible implementation, the network device obtains the area identifier of the area where the prefix and AS belong, and then adds the area identifier corresponding to the registration area to the first ROA database stored on the network device. In 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 responds to the query request by sending the data stored in the second ROA database to the network device.
[0214] The following examples 3-a and 3-b 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.
[0215] Example 3-a
[0216] Step S341: Acquire a first prefix set of a customer group of a first AS based on a first ROA database.
[0217] 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.
[0218] For example, the network device is in AS 4, and the first AS is AS 3, to which the network device's inbound interface is connected. After obtaining AS 3's customer group, the network device uses the first ROA database to obtain the prefix corresponding to each AS in AS 3's customer group. For example, if AS 3's customer group is {AS 2 AS 5 AS 6 AS 8}, the network device queries the first ROA database shown in Table 13 below for the prefix corresponding to AS 2 based on the identifier of AS 2, and obtains prefix P3. The network device queries the first ROA database shown in Table 13 below for the prefix corresponding to AS 5 based on the identifier of AS 5, and obtains prefix P5. The network device queries the first ROA database shown in Table 13 below for the prefix corresponding to AS 6 based on the identifier of AS 6, and obtains prefix P6. The network device queries the first ROA database shown in Table 13 below for the prefix corresponding to AS 8 based on the identifier of AS 8, and obtains prefix P8.
[0219] Table 13
[0220] Step S342: Acquire a second area identifier based on the customer group, the first prefix set, and the second ROA database.
[0221] For example, if 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. This yields 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.
[0222] As a specific example, the customer group of AS 3 includes {AS 2 AS 5 AS 6 AS 8}, and the first prefix set of AS 3 includes {P3 P5 P6 P8}. The correspondence between the customer group 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 any corresponding table entries in the second ROA database. The query results are shown in Table 14 below. Table 14 below means that AS 2 has published prefix P3 in Europe, or that the affiliation between prefix P3 and AS 2 is valid in Europe, and the affiliation between prefix P3 and AS 2 is invalid in other regions outside of 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 a prefix belonging to the second AS, and Europe is a specific example of the identifier of the second region.
[0223] Table 14
[0224] 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.
[0225] In one possible implementation, if the first AS is located in the area indicated by the second area identifier, the prefix corresponding to the second area identifier is determined to be 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, the prefix corresponding to the second area identifier is determined to be inaccurate, and the prefix corresponding to the second area identifier is deleted from the first prefix set.
[0226] The following example illustrates 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.
[0227] 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.
[0228] For example, for the prefix set shown in Table 13, the network device queries the second ROA database and obtains the results shown in Table 14 above. Table 14 above indicates 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, prefix P3 is determined to be accurate and retained in the first prefix set, resulting in the second prefix set {P3 P5 P6 P8}. If AS 3 is not currently in Europe, prefix P3 is determined to be inaccurate and removed from the first prefix set {P3 P5 P6 P8}, resulting in the second prefix set {P5 P6 P8}.
[0229] For example, if the area in which the first AS resides is the same as the area indicated by the second area identifier corresponding to the third AS, the third AS is suitable and 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 in which the first AS resides, the third AS is removed from the first customer group. The verification method for ASs other than the third AS in the first customer group can refer to the verification method for the third AS.
[0230] Regarding the method for determining the area where the first AS is located, if the network device and the first AS are in the same area, the network device may determine the area where the device is currently located as the area where the first AS is located. If the network device and the first AS are in different areas, the network device may communicate with the first AS and receive the area where the first AS is located from the first AS.
[0231] The method provided in this embodiment verifies the AS in the customer group based on the region 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 region 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.
[0232] In the above implementation, the second region identifier is obtained from the second ASPA database based on the customer group and prefix parameters. In another possible implementation, the second region identifier may also be obtained from the second ASPA database based on either the customer group or the prefix.
[0233] Example 3-a describes the process of obtaining a customer base based on two databases (a first ROA database and a second ROA database).
[0234] In Example 3-a, the global ROA database (first ROA database) and the ROA database containing the second regional identifier (second ROA database) are separated, thereby reducing the implementation difficulty associated with modifying the global ROA database. In other embodiments, the two databases (the first ROA database and the second ROA database) are merged into a single database. For example, the second regional identifier is merged 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. This is illustrated below using Example 1-b.
[0235] Example 3-b
[0236] Step S341″: Based on the second ROA database, obtain a first prefix set and a second area identifier of the customer group of the first AS.
[0237] 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.
[0238] 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, the first prefix set is corrected to obtain a second prefix set.
[0239] The above step S342" is similar to step S343, and reference may be made to the description of step S343.
[0240] The method provided in this embodiment can not only exclude prefixes that do not match the region in the prefix set, but also save the process of querying the database once. 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 can a more accurate prefix set be obtained, but the operations required to obtain the prefix set can also be saved and simplified, thereby improving the efficiency of obtaining the prefix set.
[0241] 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.
[0242] In summary, the methods of the above-mentioned embodiments 3-a and 3-b, since the correspondence between the affiliation relationship between the prefix and the AS and the second area identifier is recorded, in the process of obtaining the prefix set, based on the area where the first AS is located and the area indicated by the second area identifier, verify whether the affiliation relationship between the prefix and the AS is established, 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.
[0243] The above describes an implementation method for improving prefix set accuracy by considering regions. In another possible implementation, supplementing the prefix set with IRR data can also improve prefix set accuracy to a certain extent. This is illustrated below using Example 4-a. The execution subject of Example 4-a below, for example, may be a network device or a control device.
[0244] Example 4-a
[0245] Step S341a: Based on the ROA database, obtain a first prefix set of the customer group of the first AS.
[0246] 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. Implementation details of step S341a can be found in the description of step S341.
[0247] 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.
[0248] The following describes the process of querying the IRR database for a prefix (the first prefix) in the first prefix set as an example, 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, during step S342b, based on the AS identifier of the third AS and the first prefix, the IRR database is queried for the relationship between the third AS and the first prefix. The query process for other prefixes in the first prefix set is similar to the query process for the first prefix.
[0249] The query results obtained from the IRR database include three cases.
[0250] Case 1: Confirm that a prefix belongs to a certain AS.
[0251] Case 2: Confirm that a prefix does not belong to a certain AS.
[0252] Case 3: There is no AS relationship description for the prefix in the IRR database.
[0253] As a specific example, the network device is in AS 4, and the first AS to which the network device is connected is AS 3. The network device obtains a first prefix set based on the ROA database as shown in Table 13. The network device uses each prefix in the prefix set {P3 P5 P6 P8} for AS 3 shown in Table 13 to query the IRR database to verify the accuracy of the correspondence between prefixes and ASs shown in Table 13. Specifically, based on the identifier of AS 2 and prefix P3, the network device queries the IRR database for the relationship between prefix P3 and AS 2. The query result indicates that prefix P3 belongs to AS 2. Based on the identifier of AS 5 and prefix P5, the network device queries the IRR database for the relationship between AS 5 and prefix P5. The query result indicates that prefix P5 does not belong to AS 5 but to another AS.
[0254] Based on the identifier of AS 6 and prefix P6, the network device queries the IRR database for the relationship between AS 6 and prefix P6. The query result indicates that prefix P6 belongs to AS 6. Based on the identifier of AS 8 and prefix P8, the network device queries the IRR database for the relationship between AS 8 and prefix P8. No description is found regarding the AS to which prefix P8 belongs.
[0255] Table 15
[0256] Step S343c: Based on the query result obtained from the IRR database, correct the first prefix set to obtain a second prefix set.
[0257] The following uses the logic of determining whether to retain the first prefix in the first prefix set as an example for explanation. 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 first ROA database by the third AS.
[0258] Case 1: The relationship between the first prefix and the third AS obtained from the IRR database is a belonging relationship.
[0259] Case 1 corresponds to the ROA database and the IRR database describing the relationship between the first prefix and the second prefix in a consistent manner. Both the ROA database and the IRR database confirm that the first prefix is affiliated with the third AS. In case 1, the first prefix is determined to be a suitable prefix in the prefix set, and the first prefix is retained. The resulting second prefix set still includes the first prefix.
[0260] Case 2: The relationship between the first prefix and the third AS obtained from the IRR database is not an affiliation relationship.
[0261] For example, the IRR database records that the first prefix does not belong to the third AS but to the second AS.
[0262] Case 2 is equivalent to the ROA database and the IRR database having inconsistent descriptions of the relationship between the first prefix and the third AS. The ROA database confirms that the first prefix and the third AS have an affiliation relationship, while the IRR database denies such a relationship. In Case 2, you can prioritize trusting the IRR database and remove the first prefix from the first prefix set, resulting in a second prefix set that does not include the first prefix. Alternatively, you can prioritize trusting the ROA database and retain the first prefix, resulting in a second prefix set that still includes the first prefix. For example, if a policy is configured on a network device, in Case 2, whether to remove the first prefix from the first prefix set is determined based on the policy.
[0263] Case 3: There is no description of the relationship between the first prefix and the second prefix in the IRR database.
[0264] In case 3, the first prefix can be deleted from the first prefix set, resulting in a second prefix set that does not include the first prefix; alternatively, the first prefix can be retained, resulting in a second prefix set that still includes the first prefix. For example, a policy is configured on a network device. In case 3, whether to delete the first prefix from the first prefix set is determined based on the policy.
[0265] In one possible implementation, the policy includes a priority in the IRR database and a priority in the ROA database. The network device determines whether to remove the first prefix from the first prefix set based on the priorities in the IRR database and the ROA database. For example, if the priority in the IRR database is higher than the priority in the ROA database, the network device removes the first prefix from the first prefix set. If the priority in the IRR database is lower than the priority in the ROA database, the network device retains the first prefix in the first prefix set.
[0266] As a specific example, the AS 3 prefix set obtained by a network device in AS 4 from the ROA database is {P3 P5 P6 P8}. The specific query results are shown in Table 13. The query results obtained from the IRR database using each prefix in the prefix set {P3 P5 P6 P8} are shown in Table 15. The affiliation relationship between prefix P3 and AS 2 is reconfirmed by the IRR data, so prefix P3 remains in the prefix set of AS 3's customer group. The affiliation relationship between prefix P6 and AS 6 is reconfirmed by the IRR data, so prefix P6 remains in the prefix set of AS 3's customer group. The IRR data confirms that prefix P5 does not belong to AS 5, and the network device can determine whether prefix P5 should be retained in the prefix set of AS 3's customer group based on policy. The IRR data does not query the AS to which prefix P8 belongs, and the network device can determine whether prefix P8 should be retained in the prefix set of AS 3's customer group based on policy.
[0267] The above strategies include, for example, the following strategy 1 or strategy 2.
[0268] Strategy 1: If the relationship between the first prefix and the third AS obtained from the IRR database is an affiliation relationship, retain the first prefix in the first prefix set. If the relationship between the first prefix and the third AS obtained from the IRR database is not an affiliation relationship, delete the first prefix from the first prefix set. If the IRR database does not contain a description of the relationship between the first prefix and the third AS, delete the first prefix from the first prefix set. For example, the first prefix set is {P3 P5 P6 P8}. The query results obtained from the IRR database are shown in Table 15. The IRR database contains records indicating an affiliation relationship between prefix P3 and AS 2, affiliation relationship between prefix P6 and AS 6, and affiliation relationship between prefix P5 and any AS other than AS 5 (equivalent to explicitly denying the affiliation relationship between prefix P5 and AS 5). There is no record indicating an affiliation relationship between prefix P8 and AS 8 (equivalent to no record). Therefore, the network device retains prefixes P3 and P6 and deletes prefixes P5 and P8, resulting in the prefix set for prefix 3 being {P3 P6}.
[0269] Strategy 2: If the relationship between the first prefix and the third AS obtained from the IRR database is an affiliation relationship, retain the first prefix in the first prefix set. If the relationship between the first prefix and the third AS obtained from the IRR database is not an affiliation relationship, delete the first prefix from the first prefix set. If the IRR database does not describe the relationship between the first prefix and the third AS, retain the first prefix in the first prefix set. For example, the first prefix set is {P3 P5 P6 P8}. The query results obtained from the IRR database are shown in Table 15. The IRR database contains records indicating an affiliation relationship between prefix P3 and AS 2, affiliation relationship between prefix P6 and AS 6, and affiliation relationship between prefix P5 and any AS other than AS 5 (equivalent to explicitly denying the affiliation relationship between prefix P5 and AS 5). There is no record indicating an affiliation relationship between prefix P8 and AS 8 (equivalent to no record). Therefore, the network device retains prefixes P3, P6, and P8 and deletes prefix P5, resulting in the prefix set for prefix 3 being {P3 P6 P8}.
[0270] The method provided in this embodiment corrects the prefix set obtained based on the ROA database by introducing the IRR database. Since the IRR database was deployed earlier and is more mature than the ROA database, the IRR database currently has a larger amount of registered data than the ROA database and records more prefix relationships. Therefore, using the IRR database as a data source for correcting the prefix set helps to reduce the impact of insufficient registered data 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.
[0271] The above embodiment focuses on introducing an 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. This is illustrated below using Example 4-b. Example 4-b is equivalent to replacing the IRR database with the ROA database in Example 4-a. For implementation details of each step in Example 4-b, refer to Example 4-a.
[0272] Example 4-b
[0273] Step S341a: Based on the IRR database, obtain a first prefix set of the customer group of the first AS.
[0274] 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.
[0275] Step S343c: Based on the relationship between the AS and the prefix obtained from the ROA database, the first prefix set is corrected to obtain a second prefix set.
[0276] For example, if the ROA data records that the first prefix belongs to the 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.
[0277] 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, while 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 the data source for correcting the prefix set helps to reduce the negative impact of the IRR database's autonomous registration based on operators on accuracy, improves the accuracy of the prefix set to a certain extent, and reduces the probability of errors in the subsequent source address verification process.
[0278] In summary, Example 4-a and Example 4-b obtain prefix sets by referring to multiple available data sources (ROA database and IRR database), which to some extent makes up for the shortcomings of the prefix sets obtained from a single data source and improves the accuracy of the prefix sets.
[0279] Furthermore, based on a more accurate prefix set, it is helpful 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.
[0280] The process of obtaining the source address verification entry in step S38 is further detailed below through Example 5.
[0281] Example 5
[0282] The process of obtaining the source address verification table entry in step S38 can be performed by the network device, by the control device, or by the network device and the control device in collaboration. These three methods are respectively described with examples below.
[0283] Method 1 for obtaining a source address verification entry: The network device performs 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; based on the interface on the device connected to the first AS and the prefix set, the network device obtains a source address verification entry.
[0284] Among them, the network device can execute step S32 in the manner provided in Example 1-a; or, the network device can execute step S32 in the manner provided in Example 1-b; or, when executing step S32, the network device can also use both the manner provided in Example 1-a and the manner provided in Example 1-b.
[0285] Method 2 for obtaining source address verification table entries: The control device executes the process described above for obtaining the customer group of the first AS and the process described above for obtaining the prefix set of the customer group; the control device determines the interface on the device connected to the first AS. Based on the network topology, the control device determines the interface on the network device connected to the first AS; as shown in FIG4 , the control device executes step S36 to send the prefix set, the identifier of the interface on the network device connected to the first AS, 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.
[0286] The action identifier is used to indicate the generation of a source address verification entry. The action identifier can be in the form of a number or a string of characters. For example, different numbers represent different actions, and the action represented by each number is specified by a protocol.
[0287] 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.
[0288] In one possible implementation, a 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 a network device. The first protocol message includes the prefix set, the interface identifier, and the action identifier. The network device receives the first protocol message and obtains the prefix set, the interface identifier, and the action identifier from the first protocol message.
[0289] The first protocol message may be any control plane protocol message or management plane protocol message. For example, the first protocol message may be a BGP message or a PCEP message. For example, the first protocol message may be a Border Gateway Protocol Flow Spec (BGP Flow Specification, BGP Flow Spec or BGP FS) message.
[0290] Regarding the message format of the first protocol message, in one 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 on the network device connected to the first AS. The second TLV includes an IP address prefix. The IP address prefix included in the second TLV is, for example, a prefix from the prefix set determined by the above-described method embodiment. The third TLV includes an action identifier.
[0291] The first TLV is, for example, an interface name TLV. An interface name TLV is a TLV used to carry an interface name. Please refer to Figure 6, which shows 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 entire interface name TLV. The interface name field includes the interface name. The length of the interface name field is variable.
[0292] The first TLV is, for example, an interface ID TLV. Referring to FIG. 7 , FIG. 7 illustrates the format of an interface ID TLV. The interface ID TLV includes a type field, a length field, and an interface ID field. The type field includes a type value used to identify the interface ID. The length field includes the length of the interface ID TLV. The interface ID field includes the interface ID, and the length of the interface ID segment is, for example, 4 bytes.
[0293] For example, the first TLV is a tag / group ID TLV. Referring to FIG8 , FIG8 illustrates the format 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 value for identifying the type of the tag / group ID. The length field includes the length of the tag / group ID TLV. The tag / group ID field includes the tag / group ID.
[0294] The second TLV, for example, includes 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 item TLV. Please refer to Figure 9, which is a format diagram of the source address verification table item TLV. The first protocol message includes the source address verification table item TLV as shown in Figure 9. The source address verification table item TLV 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 source address verification table item mask length. The IP prefix field includes the prefix in the source address verification table item. The mode field includes the mode of source address verification table item verification. The mode of source address verification includes but is not limited to whitelist verification, blacklist verification, and graylist verification.
[0295] 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.
[0296] In one possible implementation, the IP address prefix and action identifier are carried in two separate TLVs. For example, the second and third TLVs are different TLVs. In another possible implementation, the IP address prefix and action identifier are carried in the same TLV. For example, the second and third TLVs 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 entry, and the IP address prefix is carried in the value field of the TLV.
[0297] Regarding the method of sending the interface identifier, IP address prefix, and action identifier via BGP FS, in one possible implementation, the first protocol message is a BGP FS message, and the BGP FS message includes an NLRI field, a first extended community attribute, and a second extended community attribute. The NLRI field includes the IP address prefix. The network layer reachability information (NLRI) field is, for example, a specific example of the second TLV described above. The first extended community attribute includes the interface identifier. The second extended community attribute includes the action identifier.
[0298] For an example of the format of the NLRI field, please refer to Figure 10. Figure 10 is a schematic diagram of the format of an NLRI field provided in an embodiment of the present application. The NLRI field in Figure 10 is used to carry the source IPv4 address prefix. The NLRI field includes a type field, a prefix length field, and a 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 Figure 11. Figure 11 is a schematic diagram of the format of an NLRI field provided in an embodiment of the present application. The NLRI field shown in Figure 11 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 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 padding field.
[0299] For an example of the format of the extended community attribute field, please refer to Figure 12. Figure 12 is a schematic diagram of the format of an extended community attribute field provided in an embodiment of the present application. The community attribute field includes a sub-type field, a global administrator field, and a local administrator field. In one possible implementation, the type value 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.
[0300] In another possible implementation, the interface identifier and action identifier are carried by the same extended community attribute. For example, the BGP FS message includes a network layer reachability information (NLRI) field and an extended community attribute field. The NLRI field includes an IP address prefix. The extended community 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 community attribute field is the action identifier. The global administrator field or the local administrator field includes the interface identifier.
[0301] In the above implementation, the control device sends the prefix set, the interface identifier, and the action identifier through the same protocol message. In another possible implementation, the control device sends the prefix set, the interface identifier, and the action identifier respectively 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 the prefix set and the action identifier. Protocol message B includes the interface identifier and the action identifier. The network device receives protocol message A and protocol message B. The network device obtains the prefix set and the action identifier from protocol message A. The network device obtains the interface identifier and the 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.
[0302] Method 3 for obtaining a source address verification entry: The control device executes the above-described process for obtaining the customer group of the first AS and the above-described process for obtaining the prefix set of the customer group; the control device determines the interface on the device connected to the first AS. Based on the network topology, the control device determines the interface on the network device connected to the first AS; the control device obtains the source address verification entry based on the interface on the network device connected to the first AS and the prefix set.
[0303] In a possible implementation, as shown in FIG5 , the control device executes step S39 to send the obtained source address verification entry to the network device. The network device receives the source address verification entry sent by the control device and executes step S40 based on the source address verification entry.
[0304] In the three acquisition methods described above, when a network device or controller acquires a source address verification entry, it can generate one or more source address verification entries based on the interface granularity. For example, a network device has a first interface and a second interface, the first interface being connected to a first AS, and the second interface also being 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 entry and a second source address verification entry. The first source address verification entry includes the first interface and the prefix set, and the second source address verification entry includes the second interface and the prefix set.
[0305] 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, and the network device receives the second protocol message and obtains the source address verification entry from the second protocol message.
[0306] 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.
[0307] In one possible implementation, the first protocol message includes an address family identifier, which is used to indicate a source address verification entry. Carrying the address family identifier in 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.
[0308] FIG13 is a flowchart of a method for obtaining a source address verification entry provided in an embodiment of the present application.
[0309] Optionally, the network deployment scenario underlying the method shown in FIG13 is as shown in FIG1 . For example, referring to FIG1 , the method shown in FIG13 is executed by router R2 located at the edge of AS 4 in FIG1 . The first AS in the method shown in FIG13 is AS 3 in FIG1 , and the interface for communicating with the first AS in the method shown in FIG13 is interface a in FIG1 . The second AS in the method shown in FIG13 is, for example, AS 1 in FIG1 . The second AS is, for example, AS 2 in FIG1 , and the first prefix is, for example, P3 in FIG1 . The second AS is, for example, AS 5 in FIG1 , and the first prefix is, for example, P5 in FIG1 . The second AS is, for example, AS 6 in FIG1 , and the first prefix is, for example, P6 in FIG1 . The second AS is, for example, AS 7 in FIG1 , and the first prefix is, for example, P7 in FIG1 . The second AS is, for example, AS 8 in FIG1 , and the first prefix is, for example, P8 in FIG1 .
[0310] Optionally, in conjunction with FIG3 , the first AS in the method shown in FIG13 is the authenticated AS in the embodiment of FIG3 , the second AS in the method shown in FIG13 is an AS in the customer group in the embodiment of FIG3 , the first prefix in the method shown in FIG13 is a prefix included in the prefix set in the embodiment of FIG3 , and the interface for communicating with the first AS in the method shown in FIG13 is the interface on the authentication device connected to the authenticated AS in the embodiment of FIG3 . The method shown in FIG13 includes the following S510 to S520 .
[0311] S510: Obtain a first prefix of a second AS based on an identifier of the first AS and a first correspondence relationship. The first correspondence relationship includes the identifier of the first AS, the identifier of the second AS, and a first validity relationship.
[0312] The second AS is 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 the customer group of the first AS. For example, the identifier of the first AS is the index used to search for the first correspondence. The first correspondence is, for example, a table entry in a database.
[0313] 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.
[0314] By using the above method, 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.
[0315] 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.
[0316] For example, a first valid relationship is defined as the relationship between two upstream and downstream ASs, where the region corresponding to the relationship is the same as the region corresponding to the customer group. For example, referring 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 AS 3's customer group is also Europe. Therefore, the relationship between AS 6 and AS 1 can be defined as a first valid relationship. For another example, a first valid relationship is defined as the relationship between two upstream and downstream ASs, where the region corresponding to the relationship is within the coverage of the region corresponding to the customer group. For another example, referring to Table 11 above, where the region corresponding to the relationship between AS 6 and AS 1 is Europe, and the region corresponding to AS 3's customer group is Global, and Europe is within the coverage of Global, the relationship between AS 6 and AS 1 can be defined as a first valid relationship. For another example, a first valid relationship is defined as the relationship between two upstream and downstream ASs, where the coverage of the region corresponding to the relationship includes the region corresponding to the customer group. For example, where the region corresponding to the relationship between AS 6 and AS 1 is Global, and the region corresponding to AS 3's customer group is Europe, the relationship between AS 6 and AS 1 can be defined as a first valid 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 a 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 a first valid relationship. In the above manner, the validity of the relationship between ASs can be verified based on whether the areas match.
[0317] In one 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 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.
[0318] 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.
[0319] Through the above implementation method, the validity of the relationship between ASs is confirmed based on the characteristics of area matching, and the prefix is obtained by using the AS with area matching, thereby eliminating as much as possible the errors caused by the AS with area mismatch in the prefix acquisition process, and avoiding the prefix of the AS with area mismatch from being incorrectly 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.
[0320] In a possible implementation, the first valid relationship is a relationship between ASs that have passed verification in multiple databases, and at least one of the registration quantity, deployment time, digital signature, and certificate authentication of the multiple databases is different.
[0321] The aforementioned multiple databases include, but are not limited to, the ASPA database and the IRR database, and may also be other available databases. For example, a first valid relationship is a relationship between ASs that has been verified by the ASPA database and the IRR database. For example, referring to Table 12 above, AS 5 and AS 1 are in a C2P relationship in the ASPA database, and AS 5 and AS 1 are also in a C2P relationship in the IRR database. Therefore, the relationship between AS 5 and AS 1 can be defined as a first valid relationship. For another example, AS 6 and AS 1 are in a C2P relationship in the ASPA database, but not in a C2P relationship in the IRR database. Therefore, it can be determined that there is no first valid relationship between AS 6 and AS 1. Through the above-described 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 source address verification entries.
[0322] In one 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 a match between the second correspondence and the third correspondence, wherein the second correspondence includes the identifier of the first AS, the identifier of the second AS, and the relationship between the first and second ASs, and the third correspondence includes the identifier of the first AS, the identifier of the second AS, and the relationship between the first and second ASs. For example, the second correspondence is an entry in the first database, and the third correspondence is an entry in the second database, and the first and second databases differ in at least one of the registration volume, deployment time, digital signature, and certificate authentication. 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 an entry with a format similar to that of the entry in Table 10 but derived from another database. The second correspondence matches the third correspondence, for example, when the relationship between the first and second ASs in the second correspondence is the same as the relationship between the first and second ASs in the third correspondence. For example, if 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, then the second correspondence is determined to match the third correspondence, and the C2P relationship between the second AS and the first AS is valid. Another example of a match between the second correspondence and the third correspondence is that a relationship between the first AS and the second AS exists in the second correspondence, but no relationship between the first AS and the second AS is found in the third correspondence. Alternatively, a match between the second correspondence and the third correspondence occurs when 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 some relationships between ASs may not be described due to incomplete data in the database, it is possible to determine that the data describing the relationship is reliable.
[0323] For technical details on determining the first valid relationship based on matching across multiple databases, please refer to the descriptions of Example 2-a and Example 2-b in this specification.
[0324] Through the above implementation method, since the validity of the relationship between ASs is verified based on multiple databases, and 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 thus improving the accuracy of the source address verification table entry obtained based on the prefix.
[0325] In one possible implementation, the second correspondence is obtained by searching the downstream AS from 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 from 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 from 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 from the Internet Routing Registration IRR database based on the identifier of the second AS.
[0326] In one 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, 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.
[0327] In one possible implementation, the second valid relationship is that the region corresponding to the relationship between a prefix and the AS to which the prefix belongs matches the region corresponding to the customer group, and the customer group includes the AS to which the prefix belongs. For example, the region corresponding to the second valid relationship between a prefix and the AS to which the prefix belongs is the same as the region corresponding to the customer group. For example, referring to Table 14 above, prefix P3 and AS 2 are a specific example of a relationship between a prefix and an AS to which the prefix belongs. The region corresponding to the relationship between prefix P3 and AS 2 is Europe, and the region corresponding to AS 3's customer group is also Europe. The relationship between prefix P3 and AS 2 can be defined as a second valid relationship. For another example, the region corresponding to the second valid relationship between a prefix and the AS to which the prefix belongs falls within the coverage of the region corresponding to the customer group. For another example, referring to Table 11 above, the region corresponding to the relationship between prefix P3 and AS 2 is Europe, and the region corresponding to AS 3's customer group is global. Europe falls within the global coverage. The relationship between prefix P3 and AS 2 can be defined as a second valid relationship. For another example, the region corresponding to the second valid relationship between a prefix and the AS to which the prefix belongs covers an area that includes the region corresponding to the customer group. For example, the relationship between prefix P3 and AS 2 corresponds to the global region, and the customer base of AS 3 corresponds to the European region. Since the global scope covers Europe, the relationship between prefix P3 and AS 2 can be defined as the second valid relationship.
[0328] Conversely, 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, if the region corresponding to the relationship between prefix P3 and AS 2 is Europe, and the region corresponding to AS 3's customer group is Asia, it can be determined that prefix P3 and AS 2 do not have a second valid relationship.
[0329] Through the above implementation method, the validity of the relationship between AS and prefix is confirmed based on the characteristics of area matching, thereby eliminating as much as possible the errors caused by area-mismatched prefixes in the prefix acquisition process, avoiding area-mismatched prefixes from being incorrectly included in the prefix set, and thus improving the accuracy of the prefix set.
[0330] In one possible implementation, before obtaining the first prefix based on the identifier of the second AS and the fourth corresponding relationship, the method further includes: determining that the second AS has a second valid relationship with the first prefix 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.
[0331] In one 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, referring to Table 15 above, prefix P3 and AS 2 have an affiliation relationship in the ROA database, and prefix P3 and AS 2 also have an affiliation relationship in the IRR database. The relationship between prefix P3 and AS 2 can be defined as a second valid relationship. For another example, prefix P5 and AS 5 have an affiliation relationship in the ROA database, but prefix P5 and AS 5 do not have an affiliation relationship in the IRR database. In the IRR database, prefix P5 and AS other than AS 5 have an affiliation relationship. It can be determined that there is no second valid relationship between prefix P5 and AS 5.
[0332] 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.
[0333] In the above manner, the validity of the relationship between the AS and the prefix can be verified based on whether multiple databases are all verified.
[0334] In one 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 and the first prefix have a second valid relationship based on a match between a fifth correspondence and a sixth correspondence, wherein 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 a first database, and the sixth correspondence is an entry in a second database. The first and second databases differ in at least one of the number of registrations, deployment time, digital signature, and certificate authentication. 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 an entry with a format similar to that of the entry in Table 13 but derived from another database. The matching of the fifth and sixth correspondences, for example, means that 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, if 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, then the fifth correspondence is determined to match the sixth correspondence, and the affiliation relationship between the second AS and the first prefix is valid. Another example of a match between the fifth and sixth correspondences is that a relationship between the second AS and the first prefix exists in the fifth correspondence, while no relationship between the second AS and the first prefix is found in the sixth correspondence. Alternatively, a match between the fifth and sixth correspondences is that no relationship between the second AS and the first prefix is found in the fifth correspondence, while a relationship between the second AS and the first prefix exists 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, it is possible to determine that the data describing the relationship is credible.
[0335] For technical details on determining the second valid relationship based on matching across multiple databases, please refer to the descriptions of Example 4-a and Example 4-b in this specification.
[0336] 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.
[0337] In a possible implementation, the fifth correspondence is obtained by searching for prefixes in the ROA database based on the identifier of the second AS, and the sixth correspondence is obtained by searching for prefixes in the IRR database based on the identifier of the second AS; or,
[0338] The fifth correspondence is obtained by searching the ROA database for the home AS based on the first prefix, and the sixth correspondence is obtained by searching the IRR database for the home AS based on the first prefix.
[0339] In a possible implementation, the first correspondence includes a customer group of the first AS, and the customer group of the first AS includes the first AS and the second AS.
[0340] In one possible implementation, the method shown in FIG13 is performed by a network device. For example, the method shown in FIG13 is performed by a network device deployed at the edge of an AS. For example, the method shown in FIG13 is performed at the edge of a third AS, which is upstream of the first AS.
[0341] In one possible implementation, the method shown in FIG13 is executed by a control device. After obtaining a source address verification entry based on the interface for communicating with the first AS and the first prefix, the method shown in FIG13 further includes:
[0342] 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 entry.
[0343] For details on the differences in execution methods under different execution entities, please refer to the description of Example 5 in this specification.
[0344] Through the above implementation, it is supported that the control device automatically sends the source address verification table entry to the network device.
[0345] In a possible implementation, the protocol message is a Border Gateway Protocol (BGP) message or a Path Computation Element Protocol (PCEP) message.
[0346] In a possible implementation, the protocol message is a Border Gateway Protocol Flow Rules BGP FS message, which 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 interface identifier.
[0347] For the formats of the protocol messages, please refer to the descriptions of Figures 6, 7, 8, 9, 10, 11, and 12.
[0348] 14 is a schematic diagram of a source address verification entry acquisition device according to an embodiment of the present invention. The source address verification entry acquisition device 600 includes a first acquisition unit 601 and a second acquisition unit 602.
[0349] Optionally, in combination with the scenario shown in FIG. 1 , the apparatus 600 shown in FIG. 14 is disposed in the router R2 located at the edge of AS4 shown in FIG. 1 .
[0350] Optionally, in combination with the scenario shown in FIG. 2 , the device 600 shown in FIG. 14 is provided in the router R2 shown in FIG. 2 .
[0351] Optionally, in combination with FIG3 , the device 600 for obtaining the source address verification entry shown in FIG14 is used to execute the method shown in FIG3 .
[0352] Optionally, in conjunction with FIG4 , the device 600 for obtaining the source address verification table entry shown in FIG14 is provided in the control device in FIG4 , and the device 600 shown in FIG14 is used to execute S32 to S36 .
[0353] 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 correspondence, wherein the first correspondence includes the identifier of the first AS, the identifier of the second AS, and the first validity relationship, and the second AS is located downstream of the first AS;
[0354] 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.
[0355] 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; or
[0356] 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.
[0357] In a possible implementation, the apparatus 600 further includes:
[0358] 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.
[0359] In a possible implementation, the apparatus 600 further includes:
[0360] 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 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.
[0361] In a possible implementation, the second correspondence is obtained by searching for the downstream AS from the autonomous system provider authorized ASPA database based on the identifier of the first AS, and the third correspondence is obtained by searching for the downstream AS from the Internet Routing Registry (IRR) database based on the identifier of the first AS; or
[0362] The second correspondence is obtained by searching for an upstream AS from an ASPA database authorized by an autonomous system service provider based on the identifier of the second AS. The third correspondence is obtained by searching for an upstream AS from an Internet Routing Registry (IRR) database based on the identifier of the second AS.
[0363] In a possible implementation, the first obtaining unit 601 is configured to obtain the identifier of the second AS based on the identifier of the first AS and the first corresponding relationship; and obtain the first prefix 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 the second valid relationship.
[0364] In a possible implementation, the second valid relationship is a relationship between a prefix and an AS to which the prefix belongs, wherein a corresponding area matches a corresponding area of a customer group, and the customer group includes the AS to which the prefix belongs; or
[0365] 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.
[0366] In a possible implementation, the apparatus 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 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.
[0367] In one 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.
[0368] In a possible implementation, the fifth correspondence is obtained by searching for a prefix in an ROA database based on the identifier of the second AS, and the sixth correspondence is obtained by searching for a prefix in an IRR database based on the identifier of the second AS; or
[0369] The fifth correspondence is obtained by searching the ROA database for the home AS based on the first prefix, and the sixth correspondence is obtained by searching the IRR database for the home AS based on the first prefix.
[0370] 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.
[0371] 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.
[0372] In a possible implementation, the apparatus 600 is provided in a control device, and the apparatus 600 further includes:
[0373] The sending unit is configured to send the protocol message to a network device, where the network device includes the interface and is located at an edge of a third AS, where the third AS is located upstream of the first AS, and the protocol message includes the source address verification entry.
[0374] In a possible implementation, the protocol message is a Border Gateway Protocol (BGP) message or a Path Computation Element Protocol (PCEP) message.
[0375] In a possible implementation, the protocol message is a Border Gateway Protocol Flow Rule BGP FS message, which 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 the identifier of the interface.
[0376] The device embodiment described in FIG14 is merely illustrative. For example, the division of the units described above represents only a logical functional division. In actual implementation, other divisions may be employed. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented. The functional units in the various embodiments of the present application may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit.
[0377] Each unit in the source address verification table entry acquisition device 600 is implemented entirely or partially by software, hardware, firmware, or any combination thereof.
[0378] In conjunction with the device 600 described below, some possible implementations of various functional units in the apparatus 600 for obtaining source address verification entries using hardware or software are described below.
[0379] In the case of software implementation, for example, the first obtaining unit 601 and the second obtaining unit 602 are implemented by software functional units generated after at least one processor 601 in FIG. 15 reads the program code stored in the memory 602 .
[0380] The above-mentioned units in FIG14 are respectively implemented by different hardware in the network device or control device. For example, the first obtaining unit 601 is implemented by a portion of the processing resources of at least one processor 601 in FIG15 (e.g., one or two cores in a multi-core processor), while the second obtaining unit 602 is implemented by the remaining processing resources of at least one processor 601 in FIG15 (e.g., other cores in a multi-core processor), or by programmable devices such as field-programmable gate arrays (FPGAs) or coprocessors. The receiving unit and the sending unit are implemented by the network interface 603 in FIG15.
[0381] Figure 15 is a schematic diagram of the structure of a device 600 provided in an embodiment of the present application. The device 600 can be a network device or a control device.
[0382] Optionally, in conjunction with the application scenario shown in FIG. 1 , device 600 shown in FIG. 15 is router R2 located at the edge of AS4 in FIG. Optionally, in conjunction with FIG. 3 , device 600 shown in FIG. 15 is configured to execute the method flow shown in FIG. 3 . Optionally, in conjunction with FIG. 4 , device 600 shown in FIG. 15 is configured to execute steps S32 to S36 of the method shown in FIG. 4 . Optionally, in conjunction with FIG. 13 , device 600 shown in FIG. 15 is configured to execute the method flow shown in FIG. 13 .
[0383] 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 type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of 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, an optical disc storage (including a compact 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 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 via 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 and 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.
[0384] In some embodiments, processor 601 includes one or more CPUs, such as CPU0 and CPU1 shown in FIG. 15 .
[0385] In some embodiments, device 600 may optionally include multiple processors, such as processor 601 and processor 605 shown in FIG15 . Each of these processors may be, for example, a single-CPU or a multi-CPU. A processor herein may optionally refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0386] In some embodiments, device 600 further includes internal connections 604. Processor 601, memory 602, and at least one network interface 603 are connected via internal connections 604. Internal connections 604 include pathways that transmit information between these components. Internal connections 604 may optionally be a single board or bus. Internal connections 604 may optionally be divided into an address bus, a data bus, a control bus, and the like.
[0387] 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 .
[0388] 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 internally stored program code. 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 program code 610 that implements the method provided in the embodiment of the present application.
[0389] 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.
[0390] The various embodiments in this specification are described in a progressive manner. 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.
[0391] A refers to B, which means that A is the same as B or A is a simple variant of B.
[0392] The terms "first" and "second" in the description and claims of the embodiments of this application are used to distinguish different objects, not to describe a specific order of objects, and should not be understood to indicate or imply relative importance. For example, the terms "first protocol packet" and "second protocol packet" are used to distinguish different protocol packets, not to describe a specific order of protocol packets, and should not be understood to mean that the first protocol packet is more important than the second protocol packet.
[0393] 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 the relevant countries and regions. For example, the ASPA data, ROA data, and IRR data involved in this application were all obtained with full authorization.
[0394] 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.
[0395] 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, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. 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 integrations. 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 drive (SSD)).
[0396] 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, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate 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, 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, characterized in that: The area corresponding to the relationship between the two upstream and downstream ASs of the first valid relationship matches the area corresponding to the 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, 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, 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, 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, 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, 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, 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 and the first prefix have the second valid relationship.
9. The method according to claim 4, 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, 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, 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, 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, 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, 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, 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, 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, characterized in that The area corresponding to the relationship between the two upstream and downstream ASs of the first valid relationship matches the area corresponding to the 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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
Patent Citations
Method and device for acquiring source address verification table item
CN119011167A
Inter-domain source address verification method and device, electronic equipment and storage medium
CN112565253A
Route verification method and device, data sending method and device, equipment and storage medium
CN115208600A
Inter-domain source address anomaly detection method and device, storage medium and network equipment
CN116055120A
Prefix distribution-based table performance optimization in SDN
US20160014028A1
Cited By
Intra-domain BGP (Border Gateway Protocol) routing source verification method
CN120128519A
