Validation information sending method and apparatus, validation table entry acquisition method and apparatus, and device

By obtaining and transmitting the verification information of the autonomous domain and neighboring autonomous domains in the first network device, and only sending the verification information to the corresponding autonomous domain, the problem of high communication and calculation overhead in inter-domain source address verification is solved, and false discarding of reports is reduced. It reduces the risk of writing and improves the accuracy of verification table items.

WO2024193420A1PCT designated stage expired Publication Date: 2024-09-26HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/081566
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-29
Filing Date
2024-03-14
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

In inter-domain source address verification, the existing technology has large communication overhead and computational overhead, especially when multiple autonomous domains are involved, resulting in an increased risk of accidentally discarding packets.

Method used

By obtaining the verification information of the autonomous domain to which it belongs and the neighbor autonomous domain used for verification in the first network device, only sending the verification information and neighbor AS to the corresponding neighbor autonomous domain, reducing communication overhead, and reporting through the sequence number verification document legality to ensure the timeliness of the notice.

Benefits of technology

It effectively reduces the communication overhead and calculation overhead in inter-domain source address verification, reduces the risk of accidentally discarding packets, and improves the accuracy of verification entries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024081566_26092024_PF_FP
    Figure CN2024081566_26092024_PF_FP
Patent Text Reader

Abstract

Disclosed in the present application are a validation information sending method and apparatus, a validation table entry acquisition method and apparatus, and a device. The validation information sending method comprises: a first network device in a first autonomous system (AS), which serves as an initial AS, acquiring validation information corresponding to the first AS and a neighboring AS corresponding to a second AS, which is used for validation, wherein the neighboring AS refers to a previous-hop AS of the second AS in the direction from the first AS to the second AS; the first network device sending the validation information and the neighboring AS to the second AS; and then a validation AS obtaining a validation table entry on the basis of the validation information and the neighboring AS, and validating a source address of a received service message on the basis of the validation table entry. That is, in the present application, a first AS can send, to a validation AS, validation information and a neighboring AS that corresponds to the validation AS, without the need to send the validation information to all ASs on a path on which the first AS serves as an initial AS, thereby reducing the communication overheads.
Need to check novelty before this filing date? Find Prior Art

Description

A verification information sending method, verification table item acquisition method, device and equipment

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 17, 2023, with application number 202310293070.X, and with the invention name “A method for sending verification information, a method for obtaining verification items, an apparatus and equipment”, as well as the Chinese patent application filed with the China Patent Office on October 10, 2023, with application number 202311309136.6, and with the invention name “A method for sending verification information, a method for obtaining verification items, an apparatus and equipment”, and the Chinese patent application filed with the China Patent Office on December 29, 2023, with application number 2023118660293, and with the invention name “A method for sending verification information, a method for obtaining verification items, an apparatus and equipment”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of communication technology, and in particular to a method for sending verification information, a method for obtaining verification items, an apparatus and a device. Background Art

[0003] Typically, after receiving a packet, a device on a network determines the destination address of the packet and searches for a forwarding route for that address. If a route is found, the packet is forwarded normally; otherwise, the packet is discarded. Therefore, when forwarding packets, network devices do not consider the source address of the packet, creating an opportunity for source address spoofing attacks. A source address spoofing attack occurs when an intruder constructs a series of packets with forged source addresses and frequently attempts to access the device or host at the destination address. Even if the victim's response packets cannot be returned to the intruder, the victim can still suffer a degree of damage.

[0004] To prevent source address-based network attacks, a source address verification scheme, such as unicast reverse path forwarding (URPF), has been proposed. URPF obtains the source address and inbound interface of a packet, uses the source address as the destination address, and searches the forwarding table to see if the interface corresponding to the source address matches the inbound interface. If there is a mismatch, the source address is assumed to be spoofed and the packet is discarded. In this way, URPF effectively prevents malicious attacks that modify the source address. Because URPF relies on the forwarding table, it is prone to erroneous packet discarding when routing asymmetry exists in the network. To address this, a distributed source address validation (DSAV) scheme has been proposed. When implementing this scheme, the device responsible for verifying the source address establishes a source address validation table (SAV) that records the source address and the corresponding valid inbound interface. If the inbound interface of a packet does not match the valid inbound interface corresponding to the source address, the source address of the packet is assumed to be spoofed and the packet is discarded. However, when source address verification is performed in different autonomous systems (AS), a large number of ASs may be involved, resulting in large computational and communication overheads.

[0005] Summary of the Invention

[0006] The present application provides a verification information sending method, a verification table entry acquisition method, an apparatus and a device to reduce communication overhead when verifying source addresses between domains.

[0007] In a first aspect of the present application, a method for sending verification information is provided. The method comprises: a first network device obtains verification information of a first AS to which it belongs and a neighbor AS of a second AS used for verification; and the first network device sends the verification information and the neighbor AS to the second AS. The neighbor AS is the previous hop of the second AS in the direction from the first AS to the second AS. That is, in the present application, the first AS can send the verification information and the neighbor AS corresponding to the verifying AS to the verifying AS, without having to send the verification information to all ASs along the path originating from the first AS, thereby reducing communication overhead.

[0008] The first network device may be a controller, a border network device, or a route reflector (RR) in the first AS. For example, the border network device may be an autonomous system boundary router (ASBR). The verification information may include a source prefix corresponding to the first AS and / or an identifier of the first AS. When the verification information includes the identifier of the first AS, after obtaining the verification information, the second AS obtains the source prefix that needs to be verified based on the identifier of the first AS.

[0009] Specifically, the first network device may obtain the neighbor AS in the following manner:

[0010] In one embodiment, a first network device obtains a first AS path with a first AS as an endpoint, where the first AS path includes a second AS; and the first network device obtains a neighbor AS of the second AS based on the first AS path.

[0011] In fast rerouting or load balancing scenarios, there are primary / backup paths, or paths for load balancing. To avoid inadvertent filtering of legitimate packets, when obtaining a neighboring AS of a second AS, the first network device can also obtain a second AS path with the first AS as an endpoint. This second AS path includes the second AS and is the backup path and / or load balancing path corresponding to the first AS path.

[0012] In one embodiment, a first network device receives a neighbor AS of a second AS sent by a border network device of the first AS, wherein the neighbor AS of the second AS sent by the border network device of the first AS is an AS determined by the border network device in the first AS according to its own routing table and / or redirection path.

[0013] In one embodiment, a first network device obtains a neighbor AS of a second AS according to at least one of its own routing table, a redirection path, or an AS topology library, where the AS topology library includes identifiers of ASs having neighbor relationships.

[0014] In a possible implementation, the first network device receives a neighbor AS of the second AS sent by a border network device in the first AS, including: the first network device receives a first message sent by a border network device in the first AS, the first message including an identifier of the second AS and an identifier of the neighbor AS.

[0015] In one possible implementation, the first message also includes a first sequence number and an identifier of a border network device in the first AS. Before the first network device sends the verification information and the neighbor AS to the second AS, the method further includes: the first network device obtains the second sequence number based on the identifier of the border network device in the first AS and a first correspondence, wherein the first correspondence includes the identifier of the border network device of the first AS and the second sequence number; and the first network device determines that the first sequence number is greater than the second sequence number. Since the legitimacy of the first message is verified based on the sequence number in the first message, it is equivalent to the first network device notifying the second network device of the neighbor AS in the first message only after confirming that the first message is the latest message, so that the neighbor AS notified by the first network device is time-sensitive and the neighbor AS notified by the first network device is the latest neighbor AS, thereby reducing the risk of the second network device obtaining an inaccurate source address verification table entry or even mistakenly discarding a message due to the first network device notifying the second network device of an invalid and expired neighbor AS.

[0016] In one possible implementation, the first network device sending verification information and neighboring ASs to the second AS may include: the first network device obtaining the address of the second network device in the second AS; and the first network device sending the verification information and neighboring ASs to the second network device based on the address of the second network device. The second network device may be a controller, a RR, or a border network device in the second AS. That is, when the first network device sends the verification information and neighboring ASs to the second AS, it may first obtain the address of the second network device and then send the verification information and neighboring ASs to the network device indicated by the address.

[0017] In one possible implementation, the verification information includes the identifier of the first AS, and the first network device sends the verification information and the neighbor AS to the second network device based on the address of the second network device, including: the first network device sends a second message to the second network device, and the second message includes the identifier of the first AS and the identifier of the neighbor AS.

[0018] In a possible implementation, the second message further includes a third serial number and an identifier of the first network device.

[0019] In a possible implementation, the first network device may further send a third message to the second network device, where the third message includes an identifier of the first AS, an identifier of the second AS, and an identifier of a neighboring AS.

[0020] Specifically, the third message may include an originating AS identification field, a verification AS identification field, and a neighbor AS identification field, wherein the originating AS identification field includes the identification of the first AS, the verification AS identification field includes the identification of the second AS, and the neighbor AS identification field includes the identification of the neighbor AS.

[0021] In one possible implementation, before sending the authentication information and the neighboring AS to the second AS, the first network device may also obtain the second AS's identifier and the next-hop address. The next-hop address may be a controller in the second AS, a border network device in the second AS, or a route reflector in the second AS. In a specific implementation, the second AS's identifier and the next-hop address may be preconfigured on the first network device.

[0022] In one possible implementation, the method further includes: the first network device obtains an identifier of a third AS, the third AS being a downstream AS of the first AS; and the first network device sends the identifier of the third AS to the target AS, the target AS including the second AS and / or a neighboring AS of the first AS. By notifying the target AS of the AS identifier of the third AS that the first network device can perceive, the first network device helps to solve the problem of the third AS becoming a hidden AS of the verification AS, the verification AS being unable to perceive the third AS, resulting in the absence of the originating prefix of the third AS in the prefix whitelist (verification table entry), and thus causing inaccurate verification entries in the verification AS and failure of traffic transmission from the third AS.

[0023] In one possible implementation, the first network device obtains the identifier of the third AS, including: the first network device obtains the identifier of the third AS based on the first AS set and the second AS set, the first AS set includes the identifiers of the ASs historically received by the first network device and the identifier of the first AS, the second AS set includes the identifiers of the ASs that the first network device has sent to the target AS, the first AS set includes the identifier of the third AS and the second AS set does not include the identifier of the third AS. The AS numbers included in the first AS set and not included in the second AS set are equivalent to ASs that can be perceived by the local end but have not been announced historically. By determining these ASs as hidden ASs, the accuracy of identifying the hidden AS is improved, so that the verification AS can perceive the existence of the hidden AS.

[0024] In one possible implementation, the first network device sends the identifier of the third AS to the target AS, including: the first network device obtains and sends a fourth message to the target AS, the fourth message including the identifier of the third AS and the attributes of the third AS, the attributes of the third AS including the source of the identifier of the third AS, the destination of the identifier of the third AS, the reason type, and at least one of the connection relationship flags, the reason type indicating the reason why the identifier of the third AS was not announced in a historical time period, and the connection relationship flag indicating the connection relationship between the third AS and the first AS. By sending at least one of the attributes of the third AS, it is helpful to verify that the AS constructs a visual topology based on the attributes of the third AS.

[0025] In one possible implementation, the fourth message includes a BGP undate message, the BGP undate message includes a multi-protocol reachability network layer routing information MP_REACH_NLRI field, the MP_REACH_NLRI field includes an address family identifier, a sub-address family identifier and a network layer routing information NLRI field, the address family identifier or the sub-address family identifier is used to indicate the generation of a verification table entry or the notification AS, the NLRI field includes the identifier of the third AS and the attributes of the third AS, and the NLRI field is encapsulated in the inner layer of the address family identifier or the sub-address family identifier.

[0026] In one possible implementation, the fourth message includes a BGP route-refresh message, which includes an address family identifier, a sub-address family identifier, an identifier of the third AS, and attributes of the third AS. The address family identifier or the sub-address family identifier is used to indicate the generation of a verification table entry or to notify the AS.

[0027] In one possible implementation, the first network device obtains the identifier of the third AS, including: the network device receives a fifth message from the third AS, the fifth message includes the identifier of the third AS, the address prefix corresponding to the third AS, and the no-export attribute; the first network device obtains and sends a fourth message to the target AS, including: the network device obtains and sends the fourth message to the target AS based on the fifth message, the target AS includes the identifier of the third AS and a path attribute, the path attribute includes a first tag, and the first identifier indicates that the identifier of the third AS is used to generate a verification table entry.

[0028] In one possible implementation, before the first network device sends the identifier of the third AS to the target AS, the method further includes: the first network device obtains a BGP open message, the BGP open message includes a capability identifier, and the capability identifier indicates support for notifying downstream AS; the first network device sends the BGP open message to the target AS.

[0029] In the second aspect of the present application, a method for obtaining a verification table entry is provided, the method comprising: a second network device in a second AS for verification receives verification information of the first AS and a neighbor AS of the second AS sent by a first network device in a first AS; the second network device obtains a verification table entry based on the verification information and the neighbor AS. The verification table entry includes a source prefix corresponding to the first AS and an input interface for communicating with the neighbor AS. That is, after receiving the verification information and the neighbor AS sent by the first network device, the second network device in the verification AS will use the verification information and the neighbor AS to generate a verification table entry, so as to use the verification table entry to verify the legitimacy of the received service message.

[0030] In a possible implementation, when the second AS includes a border network device, the second network device may further send the received verification information and neighbor AS to the border network device, so that each border network device may obtain a verification entry based on the verification information and neighbor AS.

[0031] The verification information may include a source prefix and / or an identifier of the first AS. If the verification information includes the source prefix, the second network device may obtain the verification entry in the following manner: the second network device obtains the AS to which the third network device communicating with the interface belongs; if the AS to which the third network device belongs is a neighboring AS, the second network device determines that the interface is an inbound interface; and the second network device obtains the verification entry based on the source prefix and the inbound interface.

[0032] If the verification information includes the identifier of the first AS, the second network device may verify the entry in the following manner: the second network device obtains the AS to which the third network device communicating with the interface belongs; if the AS to which the third network device belongs is a neighboring AS, the second network device determines that the interface is an inbound interface; the second network device obtains a source prefix based on the identifier of the first AS and the corresponding relationship; and the second network device obtains the verification entry based on the source prefix and the inbound interface, where the corresponding relationship includes the identifier of the first AS and the source prefix.

[0033] In one possible implementation, the second network device may further perform the following operations: the second network device receives a service message, the service message including a source Internet Protocol (IP) address; and the second network device determines the legitimacy of the service message based on the verification table entry, the source IP address, and the interface used to receive the service message. For example, after receiving the service message, the second network device determines a source prefix based on the source IP address in the service message, and uses the source prefix to search the verification table for an inbound interface corresponding to the source prefix. If the inbound interface matches the interface used by the second network device to receive the service message, the service message may be deemed legitimate.

[0034] In one possible implementation, the method also includes: the second network device receives an identifier of a third AS from the first network device, and the third AS is a downstream AS of the first AS; the second network device obtains a second verification table entry based on the identifier of the third AS, and the second verification table entry includes the address prefix corresponding to the third AS and the input interface of the second AS for communicating with the third AS.

[0035] In the third aspect of the present application, a verification information sending device is provided, which is applied to a first network device, and the device includes: a processing unit, used to obtain verification information of the first autonomous domain AS to which it belongs and a neighbor AS of the second AS used for verification, wherein the neighbor AS is the previous hop of the second AS in the direction from the first AS to the second AS; a sending unit, used to send the verification information and the neighbor AS to the second AS.

[0036] In a possible implementation, the processing unit is specifically configured to obtain a first AS path with the first AS as an endpoint, where the first AS path includes the second AS; and obtain a neighbor AS of the second AS based on the first AS path.

[0037] In a possible implementation, the processing unit is specifically configured to obtain a second AS path with the first AS as an endpoint, where the second AS path includes the second AS, and the second AS path is a backup path or a load sharing path of the first AS path.

[0038] In one possible implementation, the processing unit is specifically used to receive the neighbor AS of the second AS sent by the border network device in the first AS. The neighbor AS of the second AS sent by the border network device in the first AS is the AS determined by the border network device in the first AS based on its own routing table and / or redirection path.

[0039] In a possible implementation manner, the processing unit is specifically configured to receive a first message sent by a border network device in the first AS, where the first message includes an identifier of the second AS and an identifier of the neighbor AS.

[0040] In one possible implementation, the first message also includes a first serial number and an identifier of a border network device in the first AS, and the processing unit is further used to obtain the second serial number based on the identifier of the border network device in the first AS and a first correspondence, wherein the first correspondence includes the identifier of the border network device of the first AS and the second serial number; and determine that the first serial number is greater than the second serial number.

[0041] In a possible implementation, the processing unit is specifically configured to enable the first network device to obtain a neighbor AS of the second AS according to its own routing table and / or redirection path.

[0042] In a possible implementation, the first network device is a controller, a RR, or a border network device.

[0043] In a possible implementation, the sending unit is specifically used to obtain the address of a second network device in the second AS, where the second network device is a controller, RR, or border network device; and send the verification information and the neighbor AS to the second network device according to the address of the second network device.

[0044] In a possible implementation, the verification information includes an identifier of the first AS, and the sending unit is configured to send a second message to the second network device, where the second message includes the identifier of the first AS and an identifier of the neighbor AS.

[0045] In a possible implementation, the second message further includes a third serial number and an identifier of the first network device.

[0046] In a possible implementation, the sending unit is further configured to send a third message to the second network device, where the third message includes an identifier of the first AS, an identifier of the second AS, and an identifier of the neighbor AS.

[0047] In one possible implementation, the originating AS identification field in the third message includes the identification of the first AS, the verification AS identification field in the third message includes the identification of the second AS, and the neighbor AS identification field in the third message includes the identification of the neighbor AS.

[0048] In a possible implementation, the processing unit is further configured to obtain an identifier of the second AS and an address of a next hop, where the next hop is one of a controller in the second AS, a border network device in the second AS, or a route reflector in the second AS.

[0049] In a possible implementation manner, the verification information includes at least one of a source prefix corresponding to the first AS and an identifier of the first AS.

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

[0051] The processing unit is further configured to obtain an identifier of a third AS, where the third AS is a downstream AS of the first AS;

[0052] The sending unit is further configured to send the identifier of the third AS to the target AS, where the target AS includes the second AS and / or a neighboring AS of the first AS.

[0053] In one possible implementation, the processing unit is used to obtain the identifier of a third AS based on a first AS set and a second AS set, wherein the first AS set includes the identifiers of the ASs historically received by the first network device and the identifier of the first AS, the second AS set includes the identifiers of the ASs that the first network device has sent to the target AS, the first AS set includes the identifier of the third AS and the second AS set does not include the identifier of the third AS.

[0054] In one possible implementation, the sending unit is used to obtain and send a fourth message to the target AS, where the fourth message includes the identifier of the third AS and the attributes of the third AS. The attributes of the third AS include at least one of the source of the identifier of the third AS, the destination of the identifier of the third AS, the reason type, and a connection relationship flag. The reason type indicates the reason why the identifier of the third AS was not announced in a historical time period, and the connection relationship flag indicates the connection relationship between the third AS and the first AS.

[0055] In one possible implementation, the fourth message includes a BGP undate message, the BGP undate message includes a multi-protocol reachability network layer routing information MP_REACH_NLRI field, the MP_REACH_NLRI field includes an address family identifier, a sub-address family identifier, and a network layer routing information NLRI field, the address family identifier or the sub-address family identifier is used to indicate the generation of a verification table entry or the notification AS, the NLRI field includes the identifier of the third AS and the attributes of the third AS, and the NLRI field is encapsulated in an inner layer of the address family identifier or the sub-address family identifier; or

[0056] The fourth message includes a BGP route-refresh message, which includes an address family identifier, a sub-address family identifier, an identifier of the third AS, and attributes of the third AS. The address family identifier or the sub-address family identifier is used to indicate the generation of a verification table entry or to notify the AS.

[0057] In a fourth aspect of the present application, a verification table entry acquisition device is provided, which is arranged in a second network device in a second AS to be verified, and the device includes: a receiving unit for receiving verification information of the first AS and a neighbor AS of the second AS sent by a first network device in the first AS; a processing unit for obtaining a verification table entry based on the verification information and the neighbor AS, wherein the verification table entry includes a source prefix corresponding to the first AS and an input interface for communicating with the neighbor AS.

[0058] In a possible implementation manner, the apparatus further includes: a sending unit; the sending unit is configured to send the verification information and the neighbor AS to a border network device in the second AS.

[0059] In one possible implementation, the verification information includes the source prefix, and the processing unit is specifically used to obtain the AS to which the third network device that communicates with the interface belongs; if the AS to which the third network device belongs is the neighbor AS, determine that the interface is the input interface; and obtain the verification table entry based on the source prefix and the input interface.

[0060] In one possible implementation, the verification information includes the identifier of the first AS, and the processing unit is specifically used to obtain the AS to which the third network device that communicates with the interface belongs; if the AS to which the third network device belongs is the neighbor AS, determine that the interface is the input interface; obtain the source prefix based on the identifier and the corresponding relationship of the first AS, and the corresponding relationship includes the identifier of the first AS and the source prefix; obtain the verification table entry based on the source prefix and the input interface.

[0061] In one possible implementation, the receiving unit is further used to receive a business message, which includes a source Internet Protocol IP address; the processing unit is further used to determine the legitimacy of the business message based on the verification table entry, the source IP address and the interface for receiving the business message.

[0062] In a possible implementation, the receiving unit is further configured to receive an identifier of a third AS from the first network device, where the third AS is a downstream AS of the first AS;

[0063] The processing unit is further configured to obtain a second verification entry based on the identifier of the third AS, where the second verification entry includes an address prefix corresponding to the third AS and an inbound interface of the second AS used to communicate with the third AS.

[0064] In a fifth aspect of the present application, a network device is provided, comprising: a processor and a memory;

[0065] The memory is used to store instructions or computer programs;

[0066] The processor is used to execute the instructions or computer programs in the memory to enable the network device to execute the first aspect or any possible implementation method of the first aspect, or to execute the second aspect or any possible implementation method of the second aspect.

[0067] In the sixth aspect of the present application, a network system is provided, comprising: a first network device and a second network device; the first network device is used to execute the first aspect or any possible implementation method of the first aspect; the second network device is used to execute the second aspect or any possible implementation method of the second aspect.

[0068] In the seventh aspect of the present application, a computer-readable storage medium is provided, comprising instructions, which, when executed on a computer, causes the computer to execute the first aspect or any possible implementation method of the first aspect, or to execute the second aspect or any possible implementation method of the second aspect.

[0069] In the eighth aspect of the present application, a computer program product is provided, which includes a program. When the program runs on a processor, it enables a computer or a network device to execute the first aspect or any possible implementation method of the first aspect, or execute the second aspect or any possible implementation method of the second aspect.

[0070] Through the technical solution provided by the present application, the first network device in the first AS, which is the originating AS, obtains the verification information corresponding to the first AS and the neighbor AS corresponding to the second AS used for verification. The neighbor AS refers to the previous hop AS of the second AS in the direction from the first AS to the second AS. The first network device sends the verification information and the neighbor AS to the second AS, and then the verification AS verifies the source address of the received service message based on the verification information and the neighbor AS. That is, in the present application, the first AS can send the verification information and the neighbor AS corresponding to the verification AS to the verification AS, without sending the verification information to all ASs on the path with the first AS as the originating AS, thereby reducing communication overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0072] FIG1a is a diagram of a network architecture provided by an embodiment of the present application;

[0073] FIG1b is another network architecture diagram provided in an embodiment of the present application;

[0074] FIG2 is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0075] FIG3 is a signaling interaction diagram for obtaining a verification entry provided in an embodiment of the present application;

[0076] FIG4 is a schematic diagram of a DPP protocol message structure provided in an embodiment of the present application;

[0077] FIG5 is a schematic diagram of another DPP protocol message structure provided in an embodiment of the present application;

[0078] FIG6 is a schematic diagram of a DPP protocol message structure provided in an embodiment of the present application;

[0079] FIG7 is a schematic diagram of another application scenario provided by an embodiment of the present application;

[0080] FIG8 is a schematic diagram of another application scenario provided by an embodiment of the present application;

[0081] FIG9 is a schematic diagram of an application scenario of notifying a hidden AS according to an embodiment of the present application;

[0082] FIG10 is a schematic diagram of another application scenario of notifying a hidden AS according to an embodiment of the present application;

[0083] FIG11 is a schematic diagram of a protocol message structure for notifying a hidden AS according to an embodiment of the present application;

[0084] FIG12 is a schematic diagram of the structure of a path attribute in a BGP update message provided in an embodiment of the present application;

[0085] FIG13 is a schematic diagram of the structure of a single NLRI in a path attribute provided in an embodiment of the present application;

[0086] FIG14 is a schematic diagram of a BGP (route-refresh) message structure provided in an embodiment of the present application;

[0087] FIG15 is a schematic structural diagram of a verification information sending device provided in an embodiment of the present application;

[0088] FIG16 is a schematic diagram of the structure of a verification entry acquisition device provided in an embodiment of the present application;

[0089] FIG17 is a schematic diagram of a network device structure provided in an embodiment of the present application;

[0090] FIG18 is a schematic diagram of another network device structure provided in an embodiment of the present application. DETAILED DESCRIPTION

[0091] In order to enable people in this technical field to better understand the solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in combination with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0092] Currently, DSAV methods can be divided into two scenarios: intra-domain and inter-domain. The inter-domain solution primarily verifies source addresses at the autonomous domain (AS) level, with the smallest deployment node being a single AS. In practice, the SAV table is dynamically generated and updated based on learned routing information, and then used to check the source addresses in received packets.

[0093] For example, Figure 1a shows a schematic diagram of inter-domain source address verification. In this application scenario, the source prefix corresponding to AS1 is P1, the source prefix corresponding to AS2 is P2, and the source prefix corresponding to AS3 is P3. Taking the verification of source prefixes P1 and P2 as an example, a SAV table is created in AS2. As shown in Figure 1a, the border network device in AS2 is connected to the border network device in AS1 via the a1 interface, and the border network device in AS2 is connected to the border network device in AS2 via the a2 interface. The SAV table established in AS2 records the correspondence between P1 and a1, and the correspondence between P2 and a2. When AS2 receives a message sent by AS1, it uses the above-mentioned SAV table to determine the legitimacy of the source address in the received message.

[0094] When implementing the DSAV solution between domains, the following protocol messages are usually involved.

[0095] Source prefix advertisement (SPA) protocol message. This SPA protocol message mainly contains two fields: the originating AS's AS identifier (origin ASN) field and the legitimate source prefixes corresponding to the originating AS. The originating AS sends the SPA protocol message to inform the authenticating AS of the source prefixes that need to be verified.

[0096] A Destination Prefix Probing (DPP) protocol message consists of five fields: the source address field, the destination address field, the originating AS identifier (origin ASN), the AS_path set (AS_path_set) selected by the originating AS based on its routing table, and the sequence number field. The origin ASN and AS_path_set fields are key fields for generating the SAV table.

[0097] To facilitate understanding of the inter-domain DSAV implementation process, refer to the application scenario diagram shown in Figure 1b. In Figure 1b, AS1 through AS5, respectively, have source prefixes P1 through P5. Each AS has deployed an inter-domain DSAV verification mechanism on the network devices bordering their respective autonomous domains. This mechanism, running the inter-domain DSAV protocol, prevents other ASs from forging their source addresses. AS1 serves as the originating AS, while the other ASes serve as validating ASes. The validating AS receives SPA and DPP messages from AS1 and generates a source address verification table, recording AS1's source prefix and the corresponding valid inbound interface, to prevent the receipt of messages with forged AS1's source address. The detailed workflow is as follows.

[0098] 1. AS1, as the originating AS, generates and broadcasts SPA protocol messages through a border network device, such as an autonomous system boundary router (ASBR). For example, the SPA protocol messages broadcast by AS1 are shown in Table 1.

[0099] Table 1

[0100] After AS1 broadcasts the SPA protocol message to AS2 to AS8, other ASs in the network receive the SPA protocol message and generate source address record entries as shown in Table 2 below.

[0101] Table 2

[0102] 2. The border network device of AS1 obtains the AS_path set based on the routing information base (RIB), generates and sends the DPP protocol message. Specifically, the RIB is shown in Table 3 below:

[0103] Table 3

[0104] The border network device constructs a DPP protocol message as shown in Figure 1b, including the AS identifier of the originating AS and all AS_paths in the RIB table. Among them, the shorter AS_path is included in the longer AS_path and does not need to be included in the DPP protocol message.

[0105] 3. AS2, acting as the verification AS, generates a source address verification table after receiving the DPP protocol message from AS1. The source address verification table generated by AS2's border network device is shown in Table 4 below.

[0106] Table 4

[0107] P1 is the source IP prefix of AS1, which can be obtained from the source address record table. The inbound interface is all interfaces connecting AS2 and AS1, determined based on the previous hop AS of the DPP message.

[0108] 4. AS2, acting as the verification AS, generates a source address verification table and then relays the DPP protocol message to the next-hop AS.

[0109] The origin_ASN field in the relayed DPP message generated by AS2 remains unchanged, but its own AS identifier is removed from the AS_path. Then, a new DPP message is constructed and sent to the next-hop AS in the AS_path. For example, if the AS_path is [AS2, AS3], after removing AS2, the next-hop AS is AS3. If the AS_path is [AS2, AS4, AS5], after removing AS2, the next-hop AS is AS4.

[0110] 5. After receiving the DPP protocol message, other ASs generate SAV tables and relay the DPP message according to steps 3 and 4 until the AS_path is empty. At this point, AS2 through AS5 have all generated SAV tables for AS1's source prefix.

[0111] 6. After receiving the service message, other ASs verify the authenticity of the source IP address of the service message based on the SAV table. Currently, there are two verification modes: whitelist verification mode and graylist verification mode.

[0112] Whitelist verification mode: blocks any packets with unknown or illegal source addresses that arrive at the interface.

[0113] Greylist verification mode: only packets with known source addresses but illegally arriving at the interface are discarded. Data packets with unknown source addresses are accepted in this mode.

[0114] Specifically, the two verification modes process messages as follows.

[0115] As can be seen above, to ensure that the verifying AS generates an accurate SAV table, the inter-domain DSAV solution employs a method where the originating AS sends a DPP message, and other ASs generate SAV tables and relay the DPP messages. This solution requires that the border network devices of all ASs along the AS_path deploy the inter-domain DSAV mechanism and generate new DPP protocol messages. This implementation has the following issues: 1. The protocol overhead is significant. If there are a large number of ASs, the AS_path they comprise is even larger, and it is not possible to transport all of them within the DPP protocol message. In addition, each ASBR in the source AS must generate a DPP message, and the ASBR of the verifying AS must generate and relay DPP messages, resulting in additional computational and communication overhead. 2. The inter-domain DSAV solution uses an AS_path hop-by-hop relay detection method, requiring all ASs along the AS_path selected by the originating AS to sequentially generate SAV tables. This requires that the border network devices of all ASs along the AS_path deploy the inter-domain DSAV mechanism.

[0116] In view of this, the present application provides a method for sending verification information. In this solution, the AS used for verification, that is, the second AS, can be predetermined. The network device in the originating AS, that is, the first network device in the first AS, first obtains the verification information of the first AS and the neighbor AS of the second AS, and the neighbor AS refers to the previous hop of the second AS in the direction from the first AS to the second AS. That is, the traffic direction from the originating AS to the verification AS is indicated by the neighbor AS. Then, the first network device sends the verification information and the neighbor AS to the second AS. That is, the first network device only needs to send the verification information and the neighbor AS to the second AS, without sending the verification information to all ASs on the AS_path, and without deploying the inter-domain DSAV mechanism on the boundary network devices of all ASs on the AS_path, which not only reduces the communication overhead, but also can be adapted to more network scenarios. Among them, the verification information can be the AS identifier of the first AS or the source prefix corresponding to the first AS.

[0117] The following is an example of the system architecture of the embodiment of the present application.

[0118] Figure 2 is a diagram of a network system architecture provided by an embodiment of the present application. The network system shown in Figure 2 includes 7 ASs, namely AS1 to AS7. Among them, AS1 is the originating AS, the source prefix that needs to be verified is P1, AS3 is the verification AS, and the network device in AS3 generates a SAV table to prevent AS5 to AS7 from forging AS1's traffic. The network device in AS1 can determine that all AS forwarding paths with AS1 as the originating AS are [AS1,AS2,AS3,AS5], [AS1,AS2,AS3,AS6], [AS1,AS2,AS3,AS7], [AS1,AS2,AS4,AS3,AS5], [AS1,AS2,AS4,AS3,AS6], and [AS1,AS2,AS4,AS3,AS7] based on the AS_path attribute in the RIB table or the AS forwarding path of the collected redirected traffic. After obtaining the above forwarding path, the network device in AS1 can determine that the neighbor ASs of the verification AS are AS2 and AS4. Then, the network device in AS1 sends the collected verification information and the neighbor ASs corresponding to AS3 (for example, AS2 and AS4) to AS3, so that the network device in AS3 generates a SAV table based on the received verification information and the neighbor ASs.

[0119] To facilitate understanding of the technical solution provided in the embodiment of the present application, the application scenario shown in Figure 2 will be described below.

[0120] Refer to FIG3 , which is a flowchart of a verification entry acquisition method provided in an embodiment of the present application. The method includes S301 to S303 .

[0121] S301: A first network device obtains authentication information of a first AS to which it belongs and a neighboring AS of a second AS used for authentication.

[0122] In this embodiment, a network device in the originating AS, i.e., the first AS, i.e., the first network device, collects verification information about the first AS and the neighbor AS corresponding to the verifying AS, i.e., the second AS. The neighbor AS is the previous-hop AS corresponding to the second AS in the direction from the first AS to the second AS, and the verification information includes the AS identifier of the first AS and / or the source prefix corresponding to the first AS. The source prefix is, for example, the prefix of an IP address, and is used for source address verification. For example, in the application scenario shown in FIG2 , the first AS is represented as AS1 and the second AS is represented as AS3. In the direction from AS1 to AS3, the neighbor ASs corresponding to AS3 are AS2 and AS4.

[0123] Before obtaining the neighbor AS corresponding to the second AS, the first network device first obtains the identifier of the second AS, and then determines the neighbor AS corresponding to the second AS. The identifier of the second AS for verification can be pre-configured on the first network device, or the first network device selects an AS as a verification AS from the AS path with the first AS as the endpoint according to a pre-configured selection rule. The selection rule can be set according to the actual application situation, and this embodiment does not limit it here. For example, the selection rule is that the AS with the most neighbor ASs in the AS path with the first AS as the endpoint is used as the verification AS. For example, in the application scenario shown in Figure 2, AS3 has the most neighbor ASs, including AS2, AS4, AS5, AS6 and AS7, so AS3 is the verification AS.

[0124] The first network device may be a border network device, a controller, or a RR in the first AS, and is configured to collect verification information from the first AS and neighboring ASs corresponding to the second AS. For example, when the verification information is a source prefix corresponding to the first AS, the source prefix to be verified may be pre-configured on the first network device. When the verification information is an AS identifier of the first AS, a correspondence between the AS identifier of the first AS and the source prefix may be pre-configured on the first network device, and the first network device may send the correspondence to the second AS.

[0125] The first network device may obtain the neighbor AS of the second AS in the following manner.

[0126] In a first manner, a first network device obtains a first AS path with a first AS as an endpoint, where the first AS path includes a second AS; and the first network device obtains a neighbor AS of the second AS based on the first AS path.

[0127] In this embodiment, the first network device may first obtain a first AS path with the first AS as an endpoint, and determine the neighbor ASs of the second AS from the ASs included in the first AS path. The first AS path with the first AS as an endpoint may include an AS path with the first AS as the originating AS and an AS path with the first AS as the endpoint AS. For example, in the application scenario shown in FIG2 , the first AS path may include [AS1->AS2->AS3…], [AS1->AS2->AS4->AS3…], [AS5->AS3->AS4->AS2->AS1], [AS5->AS3->AS2->AS1], [AS6->AS3->AS4->AS2->AS1], [AS6->AS3->AS2->AS1], and so on. Since the neighbor ASs of the second AS are the previous hops corresponding to the second AS in the direction from the first AS to the second AS, the neighbor ASs corresponding to the second AS can be determined as AS2 and AS4 from [AS1->AS2->AS3…] and [AS1->AS2->AS4->AS3…] in the first AS path. It should be noted that, as can be seen from Table 3, when the first network device obtains the first AS path with AS1 as the originating AS through the RIB table, the obtained first AS path does not include the originating AS, ie, AS1.

[0128] Among them, the first network device obtains the first AS path with the first AS as the endpoint, which may include the first network device obtaining the first AS path with the first AS as the endpoint based on the AS_path attribute and / or redirect path in the local routing table, and / or other network devices in the first AS obtaining the first AS path with the first AS as the endpoint based on the AS_path attribute in the local routing table, the redirect path or at least one item in the AS topology library, and then the other network devices sending the obtained first AS path to the first network device.

[0129] For example, when the first AS includes multiple border network devices, a certain border network device can be pre-configured as a designated router (DR), or a border network device can be selected from the multiple border network devices as the DR based on a selection rule. The selection rule can be configured based on actual application scenarios. For example, the selection rule is to prioritize border network devices that have a Border Gateway Protocol (BGP) neighbor relationship with the second AS as the DR. For example, in the application scenario shown in Figure 2, assuming that AS1 includes three border network devices, namely ASBR1, ASBR2, and ASBR3, where ASBR2 has a BGP neighbor relationship with AS2, ASBR2 is selected as the DR. Alternatively, when the first AS includes a border network device, a controller, or a RR, the controller or RR can be selected as the DR. After the DR is selected, each border network device in the first AS can obtain the first AS path based on the AS_path attribute and / or redirect path in its corresponding local routing table, and send the first AS path to the DR. The DR then obtains the neighboring AS of the second AS based on the first AS path.

[0130] In some application scenarios, fast reroute (FRR) can be used to provide redundant links in the form of backup routes, allowing for rapid route switching in the event of a failure, ensuring uninterrupted packet forwarding and enhancing network reliability. Alternatively, in load balancing scenarios, both primary and backup paths may be used to forward packets. Ignoring the above scenario when obtaining the neighboring ASs of a second AS may result in missing information from the collected neighboring ASs of the second AS, leading to the inadvertent filtering of legitimate packets. Based on this, when obtaining the neighboring ASs of the second AS, the first network device can also obtain a second AS path with the first AS as an endpoint. This second AS path includes the second AS and is the backup path and / or load balancing path corresponding to the first AS path. Specifically, the first network device can obtain a backup path or load balancing path by querying a routing table. If a neighboring AS corresponding to the second AS exists in the backup path or load balancing path, the first network device obtains the neighboring AS. In the presence of a route reflector, the first network device may be unable to determine the complete forwarding path. In this case, the route reflector can enable the add-path feature to notify the first network device of the complete forwarding path. The add-path feature advertises multiple paths for the same source prefix. Typically, network devices advertise the optimal path when advertising BGP routes. By enabling the add-path feature, network devices advertise both the optimal and suboptimal paths when advertising BGP routes.

[0131] In a second manner, the first network device receives a neighbor AS of the second AS sent by a border network device in the first AS, wherein the neighbor AS of the second AS sent by the border network device in the first AS is an AS determined by the border network device in the first AS based on its own routing table and / or redirection path.

[0132] In this embodiment, the border network device in the first AS can determine the neighbor AS of the second AS based on its own routing table and / or redirection path, and send the neighbor AS of the second AS to the first network device. For example, the border network device in the first AS can obtain the AS path with the first AS as the endpoint based on its own routing table and / or redirection path, and determine the neighbor AS of the second AS from the AS path, and then send the determined neighbor AS of the second AS to the first network device. The AS path obtained by the border network device may include a primary path and a backup path with the first AS as the endpoint, and / or at least two AS paths with the first AS as the endpoint for achieving load sharing. The above-mentioned AS path includes the second AS, specifically, the primary path and the backup path both include the second AS, and the at least two AS paths for achieving load sharing both include the second AS.

[0133] In one possible implementation of a first AS's border network device notifying the first network device of a neighbor AS, the first AS's border network device receives a first message and sends the first message to the first network device. The first message includes an identifier of a second AS and an identifier of a neighbor AS of the second AS. For example, the first message includes a validation AS field and an ingress neighbor AS field, where the validation AS field includes the identifier of the second AS. The neighbor AS field includes the identifier of a neighbor AS of the second AS. The first network device receives the first message. The first network device parses the first message and obtains the identifier of the second AS and the identifier of the neighbor AS of the second AS carried in the first message. Because the validation AS identifier and the neighbor AS identifier are carried in the same message, this indicates which AS the neighbor AS in the message is a neighbor AS of, or indicates the corresponding relationship between the validation AS and the neighbor AS. For example, because the first message carries the identifier of the second AS and the neighbor AS identifier, it indicates that the neighbor AS in the first message is a neighbor AS of the second AS, rather than a neighbor AS of another AS. In addition, the first message transmitted within the first AS does not need to carry the identifier of the first AS, which helps to save message transmission overhead.

[0134] In one possible implementation, a border network device of the first AS establishes an Interior Border Gateway Protocol (IBGP) connection with the first network device. In other words, the first network device is an IBGP neighbor of the border network device of the first AS. The border network device of the first AS sends authentication information and the neighboring AS to the first network device via the IBGP connection.

[0135] Optionally, the first message also includes a sequence number. The sequence number is used to indicate the newness of the first message. For example, the larger the sequence number, the newer the message. After the first network device receives the first message, the first network device also obtains the sequence number carried in the first message and verifies the legitimacy of the first message based on the sequence number in the first message. For example, the first network device compares the sequence number in the first message with the sequence number locally recorded by the first network device. If the sequence number in the first message is greater than the sequence number locally recorded by the first network device, the first network device determines that the first message is legal, and the first network device further performs the step of sending the neighbor AS in the first message to the second network device. If the sequence number in the first message is less than or equal to the sequence number locally recorded by the first network device, the first network device determines that the first message is illegal, and the first network device discards the first message. The first network device does not need to record the neighbor AS in the first message, nor does it need to further perform the step of sending the neighbor AS in the first message to the second network device. Since the legitimacy of the first message is verified based on the serial number in the first message, it is equivalent to the first network device notifying the second network device of the neighbor AS in the first message only when it confirms that the first message is the latest DPP message, so that the neighbor AS notified by the first network device is timely, and the neighbor AS notified by the first network device is the latest neighbor AS, thereby reducing the risk of the second network device obtaining an inaccurate source address verification table entry or even causing the wrong discard of the message due to the first network device notifying the invalid and expired neighbor AS to the second network device.

[0136] Optionally, if the sequence number in the first message is greater than the sequence number recorded locally by the first network device, the first network device updates the locally recorded sequence number to the sequence number in the first message, so that the locally recorded sequence number is time-sensitive, and the locally recorded sequence number can be dynamically updated with the regular notification process of the neighbor AS, so as to facilitate verification of the legitimacy of the message the next time a message carrying the neighbor AS and sequence number is received.

[0137] In order to distinguish different serial numbers, the "first serial number" is used below to describe the serial number carried in the message received by the first network device from the border network device of the first AS, the "second serial number" is used to describe the serial number locally recorded by the first network device, the "third serial number" is used to describe the serial number carried in the message sent by the first network device to the second network device, and the "fourth serial number" is used to describe the serial number locally recorded by the second network device.

[0138] Regarding the implementation details of comparing serial numbers of the first network device, in a possible implementation, the first message includes the identifier of the border network device of the first AS and the first serial number. After the first network device receives the first message, the first network device obtains the identifier of the border network device of the first AS and the first serial number carried in the first message. The first network device obtains the second serial number based on the identifier of the border network device of the first AS and the first corresponding relationship. The first corresponding relationship includes the identifier of the border network device of the first AS and the second serial number. The first network device can use the identifier of the border network device of the first AS as an index (key) to search the first corresponding relationship to obtain the second serial number. The first network device compares the first serial number carried in the message with the second serial number obtained in the first corresponding relationship.

[0139] Regarding the source of the first correspondence on the first network device, in one possible implementation, when the first network device receives a message including a starting sequence number, an identifier of a border network device of the first AS, and a neighbor AS, the first network device responds to the message including the starting sequence number, and establishes a first correspondence based on the starting sequence number in the message and the identifier of the border network device of the first AS. The first correspondence includes the starting sequence number and the identifier of the border network device of the first AS. The starting sequence number is the minimum value in the value range of the sequence number, and the minimum value of the sequence number indicates the first notification to the neighbor AS. For example, the starting sequence number is zero or a positive integer. Subsequently, when the first message including the sequence number, the identifier of the border network device of the first AS, and the neighbor AS is received, if the sequence number in the first message is larger than the starting sequence number, the first network device updates the starting sequence number in the first correspondence to the sequence number in the first message, thereby maintaining the timeliness of the locally recorded sequence number. By analogy, whenever the first network device subsequently receives a message including a serial number, the identifier of the border network device of the first AS, and the neighbor AS, if the serial number in the received message is greater than the serial number in the first corresponding relationship, the serial number in the first corresponding relationship will be updated to the serial number in the received message.

[0140] In one possible implementation, the first network device sends the neighbor AS in the first message to the second network device based on the sequence number in the first message being the initial sequence number, without performing the step of comparing the sequence number in the message with the locally recorded sequence number.

[0141] In one possible implementation, the border network device of the first AS periodically sends the neighbor AS and sequence number of the second AS to the first network device. When the border network device of the first AS sends the neighbor AS of the second AS to the first network device for the first time, it adds the neighbor AS and the starting sequence number to the message. Every time the border network device of the first AS sends the neighbor AS of the second AS to the first network device, it increments the sequence number (such as adding one to the sequence number), and sends the incremented sequence number and the neighbor AS to the first network device, so that the sequence number sent to the first network device this time is larger than the sequence number sent to the first network device last time. For example, the sequence number in the first message sent by the border network device of the first AS to the first network device for the first time is the starting sequence number. The sequence number in the first message sent by the border network device of the first AS to the first network device for the second time is the sequence number after the starting sequence number is incremented (such as adding one to the starting sequence number). By analogy, the sequence number in the first message sent by the border network device of the first AS to the first network device for the i-th time is obtained by incrementing the sequence number in the first message sent to the first network device for the (i-1)th time. For example, the sequence number sent for the i-th time is the sequence number sent for the (i-1)th time plus one.

[0142] The first message is, for example, a DPP protocol message. The first message is, for example, a first type of DPP message. For example, the first message includes a type field, and the type field is used to identify the first type of DPP message.

[0143] A first-type DPP message is a DPP message transmitted within a source AS. A first-type DPP message is used to notify a neighboring AS of the validation AS (e.g., a neighboring AS of a second AS) within the source AS. Please refer to Figure 4, which is a schematic diagram of the format of a DPP message provided in an embodiment of the present application. The DPP message provided in Figure 4 is, for example, a first-type DPP message. A first-type DPP message includes a message type (type) field, a message length (length) field, a validation AS (validation AS) field, and an ingress neighbor AS (ingress neighbor AS) field. For example, a value of 1 in the type field indicates that the message type is a DPP message transmitted within the source AS. The length field indicates the message length. The validation AS field includes the AS number of the validation AS. The neighbor AS field includes the AS number of the neighboring AS of the validation AS. Optionally, the first-type DPP message also includes a sequence number (sequence number) field. The sequence number field includes a sequence number. Optionally, the first-type DPP message also includes an origin router identifier (origin router-id) field. The origin router-id field includes the identifier of the network device that sends the DPP message.

[0144] In a third manner, the first network device obtains the neighbor AS of the second AS according to its own routing table and / or redirection path.

[0145] For example, a first network device may obtain an AS path with a first AS as an endpoint based on its own routing table and / or redirection path, and determine a neighbor AS of a second AS from the AS path. The AS path may include a primary path and a backup path with the first AS as an endpoint, and / or at least two AS paths with the first AS as an endpoint for load balancing. The aforementioned AS paths include the second AS; specifically, both the primary path and the backup path include the second AS, and both the at least two AS paths for load balancing include the second AS.

[0146] In a fourth manner, the first network device obtains the neighbor AS of the second AS based on the AS topology library. The AS topology library is used to indicate the topological relationship between ASs. For example, the AS topology library includes the identifiers of ASs with neighbor relationships. For example, the AS topology library includes the identifiers of the second AS and the identifiers of the neighbor ASs. The first network device uses the identifier of the second AS as the key to search the AS topology library to obtain the neighbor AS of the second AS. The AS topology library can be any publicly available database of AS neighbor relationships. For example, the AS topology library is a database managed based on a resource public key infrastructure (RPKI). The AS topology library is, for example, an autonomous system provider authorization (ASPA) database, an internet routing registry (IRR) database, or a route origin authorization (ROA) database.

[0147] S302: The first network device sends verification information and a neighbor AS to the second AS.

[0148] After the first network device obtains the verification information of the first AS and the neighbor AS corresponding to the second AS, it sends the verification information and the neighbor AS to the second AS. For example, the first network device sends the verification information and the neighbor AS to a network device in the second AS.

[0149] In one possible implementation, a first network device obtains the address of a second network device in a second AS; based on the address of the second network device, the first network device sends verification information and a neighboring AS to the second network device. The second network device may be a controller, a RR, or a border network device in the second AS. In a specific implementation, the address of the second network device may be preconfigured in the first network device. When the first network device sends verification information and a neighboring AS to the second AS, the first network device obtains the configured address of the second network device and sends the verification information and the neighboring AS to the network device indicated by the address. Alternatively, the first network device obtains the address of the second network device in the second AS with which it has established a BGP neighbor relationship, and sends the verification information and the neighboring AS to the network device indicated by the address.

[0150] In one possible implementation of notifying a first AS of a neighboring AS of a second AS between a first AS and a second AS, a first network device receives a second message and sends the second message to a second network device. The second message includes an identifier of the first AS and an identifier of an ingress neighbor AS of the second AS. For example, the second message includes a source AS field and an ingress neighbor AS field. The source AS field includes the identifier of the first AS. The neighbor AS field includes the identifier of an ingress neighbor AS of the second AS. Furthermore, the second message transmitted within the second AS does not need to carry the identifier of the second AS, thereby helping to reduce message transmission overhead.

[0151] Optionally, the second message also includes a third sequence number. The third sequence number is used to indicate the newness of the second message. For example, a larger third sequence number indicates a newer message. For the specific use of the third sequence number in the second message, please refer to the description in S303.

[0152] Optionally, the second message also includes the identifier of the first AS. The identifier of the first AS helps distinguish the AS from which the second message originates. When the second AS (authentication AS) establishes connections with multiple source ASs, network devices within the second AS can determine, based on the identifier of the first AS, that the neighboring AS is the one announced by the identifier of the first AS, thereby reducing the risk of network devices within the second AS confusing neighboring ASs announced by different source ASs.

[0153] Optionally, the second message also includes an identifier of the first network device. For example, the second message includes the router ID of the first network device, where the router ID of the first network device is, for example, the IP address of a specific interface of the first network device. The inclusion of the identifier of the first network device facilitates distinguishing the device from which the second message originates.

[0154] For the specific usage process of the identifier of the first AS and the identifier of the first network device in the second message, please refer to the description in S303.

[0155] The second message is, for example, a DPP protocol message. The second message is, for example, a second type of DPP message. For example, the second message includes a type field, and the type field is used to identify the second type of DPP message.

[0156] In one possible implementation of obtaining the second message, the first network device obtains the second message based on the first message. For example, after receiving the first message, the first network device replaces the type in the first message from the first type to the second type, and replaces the AS identifier in the first message from the identifier of the second AS to the identifier of the first AS, thereby obtaining the second message. By replacing the type and AS identifier, the DPP message of the first type is converted into a DPP message of the second type.

[0157] The second type of DPP message is a DPP message transmitted between a source AS and a verification AS, or a DPP message transmitted within a verification AS. The second type of DPP message is used to notify the verification AS's neighboring ASs (such as a neighboring AS of a second AS) between the source AS and the verification AS, or within the verification AS. Please refer to Figure 5, which is a schematic diagram of the format of a DPP message provided in an embodiment of the present application. The DPP message provided in Figure 5 is, for example, a second type of DPP message. The second type of DPP message includes a message type (type) field, a length (length) field, a source AS (source AS) field, and a neighbor AS (ingress neighbor AS) field. A value of 2 in the type field, for example, indicates that the message type is a DPP message transmitted between a source AS and a verification AS, or a DPP message transmitted within a verification AS. The length field indicates the message length. The source AS field includes the AS number of the source AS. The neighbor AS field includes the AS number of the neighbor AS of the verification AS. Optionally, the second type of DPP message also includes a sequence number field. The sequence number field includes a sequence number. Optionally, the second type of DPP message further includes an origin router identifier field. The origin router-id field includes an identifier of a network device that sends the DPP message.

[0158] In one possible implementation, the first network device may further send a third message to the second network device, wherein the third message includes an identifier of the first AS, an identifier of the second AS, and an identifier of a neighboring AS. The third message may be a DPP protocol message, the format of which is shown in FIG6 , including a message type (type) field, a length (length) field, an originating AS identifier (origin ASN) field, a validation AS identifier (validation ASN) field, and an ingress neighbor AS identifier (ingress neighbor ASN) field. The message type (type) field is used to indicate the type of the message. For example, the message type field indicates that the third message is a message for notifying a neighboring AS. The originating AS identifier field in the message includes an identifier of the first AS, the validation AS identifier field in the message includes an identifier of the second AS, and the neighbor AS identifier field in the message includes an identifier of a neighboring AS. When the second AS has multiple neighboring ASs, the neighbor AS identifier field will include multiple neighboring ASs. For example, in the application scenario shown in Figure 2, AS3 corresponds to two neighboring ASs, AS2 and AS4, and the neighbor AS identification field will include AS2 and AS4. The first network device can periodically send DPP protocol messages to the second network device, so that the second network device updates the verification table entry based on the most recently received DPP protocol message.

[0159] S303: The second network device in the second AS receives the authentication information and the neighbor AS, and obtains an authentication entry based on the authentication information and the neighbor AS.

[0160] In this embodiment, after receiving the verification information and neighboring AS from the first network device, the second network device uses the verification information and the neighboring AS to generate a verification entry. The verification entry includes the source prefix corresponding to the first AS and the inbound interface used for communication with the neighboring AS. The inbound interface used for communication with the neighboring AS refers to the interface on the second AS in the direction from the neighboring AS to the second AS.

[0161] In one possible implementation, when the second network device is the DR in the second AS, to enable all border network devices in the second AS to generate verification entries and implement source prefix verification, the second network device, after receiving the verification information and the neighboring AS, will send the verification information and the neighboring AS to the border network devices in the second AS. For example, in the application scenario shown in Figure 2, assume that AS3 includes five ASBRs, namely ASBR1, ASBR2, ASBR3, ASBR4, and ASBR5, where ASBR1 is the second network device. ASBR1 establishes a BGP connection with AS2, ASBR2 establishes a BGP connection with AS4, ASBR3 establishes a BGP connection with AS5, ASBR4 establishes a BGP connection with AS6, and ASBR5 establishes a BGP connection with AS7. After ASBR1 receives the verification information and the neighboring AS sent by AS1, it forwards the verification information and the neighboring AS to other ASBRs.

[0162] The second network device obtaining a verification entry based on the verification information and the neighboring AS may include: the second network device obtaining the AS to which the third network device communicating with the interface belongs; if the AS to which the third network device belongs is a neighboring AS, the second network device determining the interface as an inbound interface; and the second network device obtaining the verification entry based on the verification information and the inbound interface. In other words, the second network device determines the network device to which each of its corresponding interfaces is connected and obtains the AS to which the network device belongs. If the AS is a neighboring AS, the interface connected to the network device is designated as the inbound interface.

[0163] In one possible implementation of receiving the verification information and the neighboring AS, the second network device receives a second message from the second network device. The second network device parses the second message to obtain an identifier of the first AS (the identifier of the first AS is a specific example of the verification information) and an identifier of a neighboring AS of the second AS carried in the second message.

[0164] In one possible implementation, before obtaining the verification entry, the second network device further performs a step of verifying the legitimacy of the message based on a sequence number. For example, the second message includes a sequence number. After receiving the second message, the second network device obtains the sequence number carried in the second message and verifies the legitimacy of the second message based on the sequence number in the second message. For example, the second network device compares the sequence number in the second message with a sequence number locally recorded by the second network device. If the sequence number in the second message is greater than the sequence number locally recorded by the second network device, the second network device determines that the second message is legitimate. The second network device then further performs the step of obtaining a verification entry based on the verification information and the neighboring AS. Optionally, the second network device also forwards the second message to a border network device of the second AS. If the sequence number in the second message is less than or equal to the sequence number locally recorded by the second network device, this indicates that the second message is not the latest. The second network device determines that the second message is illegitimate and discards the second message. There is no need to further perform the step of obtaining a verification entry based on the verification information and the neighboring AS, nor to forward the second message to a border network device in the second AS. Since the legitimacy of the second message is verified based on the serial number in the second message, it is equivalent to the second network device notifying the neighbor AS in the second message to the second network device only when it confirms that the second message is the latest DPP message, so that the neighbor AS notified by the second network device is timely, thereby reducing the risk of inaccurate verification entries or even erroneous message discarding due to the verification entries obtained by the second network device based on the invalid and expired neighbor AS.

[0165] Optionally, if the sequence number in the second message is greater than the sequence number recorded locally by the second network device, the second network device updates the locally recorded sequence number to the sequence number in the second message, thereby maintaining the timeliness of the locally recorded sequence number, making it easier to verify the legitimacy of the message the next time a message carrying the neighbor AS and sequence number is received.

[0166] Regarding the implementation details of the second network device comparing serial numbers, in order to distinguish different serial numbers, the "third serial number" is used below to describe the serial number carried in the message sent by the first network device to the second network device, and the "fourth serial number" is used to describe the serial number locally recorded by the second network device. In one possible implementation, the second message also includes the third serial number. Optionally, the second message also includes the identifier of the first AS and the identifier of the first network device. After the second network device receives the second message, the second network device obtains the identifier of the first AS, the identifier of the first network device, and the third serial number carried in the second message. The second network device obtains the fourth serial number based on the identifier of the first AS, the identifier of the first network device, and the second corresponding relationship. The second corresponding relationship includes the identifier of the first AS, the identifier of the first network device, and the fourth serial number. The second network device can use the identifier of the first AS and the identifier of the first network device as an index (key) to search the second corresponding relationship to obtain the fourth serial number. The second network device compares the third serial number carried in the message with the fourth serial number obtained in the second corresponding relationship.

[0167] Regarding the source of the second correspondence on the second network device, in one possible implementation, when the second network device receives a message including a starting sequence number, an identifier of the first AS, and an identifier of the first network device, the second network device establishes a second correspondence based on the identifier of the first AS and the identifier of the first network device in the message in response to the starting sequence number included in the message. The second correspondence includes the starting sequence number, the identifier of the first AS, and the identifier of the first network device. Subsequently, upon receiving a first message including the sequence number, the identifier of the first AS, the identifier of the first network device, and a neighboring AS, if the sequence number in the first message is greater than the starting sequence number, the second network device updates the starting sequence number in the second correspondence to the sequence number in the first message, thereby maintaining the timeliness of the locally recorded sequence number. By analogy, whenever the second network device subsequently receives a message including the sequence number, the identifier of the first AS, the identifier of the first network device, and a neighboring AS, if the sequence number in the received message is greater than the sequence number in the second correspondence, the sequence number in the second correspondence will be updated to the sequence number in the received message.

[0168] In one possible implementation, the second network device uses the serial number in the second message as the initial serial number, without performing the step of comparing the serial number in the message with the locally recorded serial number, and obtains the verification table entry based on the verification information in the second message and the neighbor AS.

[0169] In one possible implementation, after receiving the second message, the second network device sends the second message to the border network device of the second AS, thereby transmitting the identifier of the first AS and the identifier of the neighboring AS to the border network device of the second AS via the second message. In one possible implementation, during the process of forwarding the second message, the second network device does not need to modify the sequence number in the second message. In other words, the sequence number in the second message sent by the second network device to the border network device of the second AS is the same as the sequence number in the second message received by the second network device from the first network device. After receiving the second message from the second network device, the border network device of the second AS may verify the legitimacy of the second message based on the sequence number in the second message. If the verification is successful, the border network device of the second AS generates a verification entry based on the identifier of the first AS and the identifier of the neighboring AS in the second message, and updates the locally recorded sequence number to the sequence number in the second message. For details on the sequence number verification method used by the border network device of the second AS, please refer to the sequence number verification method used by the second network device.

[0170] In one possible implementation, the second network device obtains the AS to which the third network device in communication with the interface belongs, including: the second network device obtains the AS to which the connected third network device belongs based on configuration information on the interface. The configuration information includes the AS to which the third network device connected to the interface belongs. That is, an AS identifier of the AS to which the third network device in communication with the interface belongs can be configured on the interface, and the second network device determines the AS to which the third network device in communication with the interface belongs based on the above configuration. Alternatively, the second network device determines a third network device with which the interface has established an External Border Gateway Protocol (EBGP) neighbor relationship; and the second network device obtains the AS to which the third network device belongs.

[0171] The second network device obtains the authentication entry based on the authentication information and the inbound interface, including:

[0172] If the verification information includes the source prefix, the second network device establishes a correspondence between the inbound interface and the source prefix and obtains the verification entry. That is, if the verification information includes the source prefix that needs to be verified, the second network device can obtain the verification entry based on the inbound interface and the source prefix.

[0173] If the verification information includes the identifier of the first AS, the second network device obtains the source prefix based on the identifier of the first AS and the corresponding relationship; the second network device obtains the verification table entry based on the source prefix and the inbound interface. The corresponding relationship includes the AS identifier of the first AS and the source prefix. Specifically, the above-mentioned corresponding relationship can be pre-configured on the second network device, or the first network device, after determining the source prefix requiring source address verification, sends the corresponding relationship including the AS identifier of the first AS and the source prefix to the second network device.

[0174] After the second network device obtains the verification table entry, it can perform source address verification on the received service message. Specifically, the second network device receives a service message, which includes a source IP address; the second network device determines the legitimacy of the service message based on the verification table entry, the source IP address, and the interface that receives the service message. That is, after receiving the service message, the second network device obtains the source IP address by parsing the service message, and obtains the source prefix by analyzing the source IP address. After obtaining the source prefix corresponding to the service message, the input interface corresponding to the source prefix is ​​searched from the verification table entry. The second network device determines that the service message is legal based on the interface that receives the service message and the found input interface. After the second network device determines that the service message is a legal message, it can forward the service message.

[0175] From the above, it can be seen that the source address verification mode includes the whitelist verification mode and the graylist verification mode. Under different verification modes, the verification results obtained by the second network device may be different. For example, if the verification mode configured by the second network device is the whitelist verification mode, if the verification table item includes the source prefix corresponding to the service message and the interface for receiving the service message matches the found input interface, then the service message is a legal message; if the verification table item includes the source prefix corresponding to the service message, but the interface for receiving the service message does not match the found input interface, then the service message is an illegal message; if the verification table item does not include the source prefix corresponding to the service message, then the service message is an illegal message. If the verification mode configured by the second network device is the gray list verification mode, if the verification table item includes the source prefix corresponding to the business message and the interface for receiving the business message matches the found input interface, then the business message is a legal message; if the verification table item includes the source prefix corresponding to the business message, but the interface for receiving the business message does not match the found input interface, then the business message is an illegal message; if the verification table item does not include the source prefix corresponding to the business message, then the business message is a legal message.

[0176] It can be seen that the first network device in the first AS, which is the originating AS, obtains the verification information corresponding to the first AS and the neighbor AS corresponding to the second AS used for verification. The neighbor AS refers to the previous hop AS of the second AS in the direction from the first AS to the second AS. The first network device sends the verification information and the neighbor AS to the second AS, and then the verification AS verifies the source address of the received service message based on the verification information and the neighbor AS. That is, in this application, the first AS can send the verification information and the neighbor AS corresponding to the verification AS to the verification AS, without sending the verification information to all ASs on the path with the first AS as the originating AS, thereby reducing communication overhead.

[0177] As can be seen from the foregoing, the first network device can be a controller, RR, or edge network device in the first AS, and the second network device can be a controller, RR, or edge network device in the first AS. The representation of the first network device and the representation of the second network device can be arbitrarily combined. To facilitate understanding of the technical implementation of this application, the following examples will be described using the case where both the first network device and the second network device are edge network devices, and the case where both the first network device and the second network device are controllers.

[0178] In the first scenario, the first network device and the second network device are both border network devices.

[0179] In this scenario, a BGP neighbor relationship is established between a border network device in the first AS and a border network device in the second AS. The border network device in the first AS sends DPP protocol messages to the border network device in the second AS to inform the border network device of the neighboring AS. This allows the border network device in the second AS to generate a SAV table based on the neighboring AS. For ease of understanding, the following explanation uses an ASBR as the border network device.

[0180] For example, when the first AS includes multiple border network devices, in order to avoid each border network device in the first AS sending SPA messages and DPP messages to the second network device and reduce communication overhead, a border network device can be selected as the DR from multiple border network devices through manual configuration or selection rules, that is, the first network device. Similarly, when the second AS includes multiple border network devices, a border network device can also be selected as the DR from multiple border network devices through manual configuration or selection rules, that is, the second network device. Based on this, an eBGP neighbor relationship can be established between the first network device and the second network device. Specifically, the AS identifier of the second AS and the address of the second network device can be configured on the first network device, and the AS identifier of the first AS and the address of the first network device can be configured on the second network device, so that the first network device and the second network device can communicate with each other.

[0181] For example, as shown in Figure 7, AS1 is the first AS, and AS4 is the second AS. AS1 includes three border network devices: ASBR1, ASBR2, and ASBR3; AS3 includes five border network devices: ASBR4 through ASBR8. ASBR1 and ASBR4 are each selected as the DR. That is, the first network device is ASBR1, and the second network device is ASBR4.

[0182] The specific interaction process is as follows

[0183] (1) ASBR1 collects source prefixes from the first AS, generates an SPA protocol message, and sends the SPA protocol message to the second network device. The SPA protocol message includes the AS identifier and source prefix of the first AS. Specifically, ASBR1 can be pre-configured with a source prefix that requires source address verification, or ASBR1 can determine the IP address prefix in the route corresponding to the first AS in the AS_path as the source prefix.

[0184] (2) After receiving the SPA protocol message, ASBR4 forwards it to other border network devices, so that each border network device in the second AS can receive the SPA protocol message sent by ASBR1 and generate a source address record table, as shown in Table 2.

[0185] (3) The border network device in the first AS collects all AS paths forwarded by traffic in the local domain and determines the neighboring AS corresponding to the second AS based on the collected AS paths. The AS paths collected by the border network device are derived from two sources: one is the AS_path attribute (including backup paths such as FRR) in the BGP route advertisement in the local routing table; the other is the AS path after inter-domain traffic redirection.

[0186] (4) The border network device sends the neighbor AS corresponding to the second AS to ASBR1. That is, ASBR1 integrates the neighbor ASs sent by various border network devices.

[0187] For example, the border network device generates a first type of DPP protocol message (eg, the DPP protocol message of type=1 shown in FIG4 ) based on the second AS and the neighboring AS, and sends the first type of DPP protocol message to ASBR1.

[0188] In a possible implementation, the neighbor ASs integrated by ASBR1 include neighbor ASs sent by each border network device through the first type of DPP protocol message, neighbor ASs obtained by ASBR1 through the AS path, and neighbor ASs obtained by ASBR1 through the AS topology database.

[0189] (5) ASBR1 generates a DPP protocol message based on the integrated neighbor ASs and sends it to ASBR4. The DPP protocol message includes the AS number identifier of the first AS, the AS identifier of the second AS, and a list of neighbor ASs. For example, in the application scenario shown in Figure 7, the DPP protocol message includes AS1 (the AS identifier of the originating AS), AS3 (the AS identifier of the verifying AS), and a list of neighbor ASs [AS2, AS4].

[0190] In one possible implementation, ASBR1 receives a first-type DPP protocol message from a border network device. ASBR1 verifies the validity of the message. If the message passes the validity verification, ASBR1 generates a second-type DPP protocol message (e.g., the type=2 DPP protocol message shown in FIG. 5 ) based on the integrated neighbor AS and the identifier of the first AS (source AS number), and sends the second-type DPP protocol message to ASBR4.

[0191] The step of ASBR1 verifying the legitimacy of the message includes verifying that the first type of DPP protocol message comes from the IBGP neighbor of ASBR1 and that the sequence number in the first type of DPP protocol message is greater than the sequence number in the corresponding relationship stored locally by ASBR1.

[0192] (6) After receiving the DPP protocol message, ASBR4 spreads it to other border network devices in the second AS.

[0193] In one possible implementation, ASBR4 receives the second type of DPP protocol message. ASBR4 searches for a corresponding relationship based on the originating router identifier and the source AS in the second type of DPP protocol message to obtain a sequence number. If the sequence number in the second type of DPP protocol message is greater than the sequence number obtained from the corresponding relationship, ASBR4 executes the step of generating the SAV table in (7) and sends the second type of DPP protocol message to other border network devices in the second AS. In addition, ASBR4 updates the sequence number in the corresponding relationship based on the sequence number in the second type of DPP protocol message.

[0194] If the sequence number in the second type of DPP protocol message is less than or equal to the sequence number obtained from the corresponding relationship, ASBR4 cancels the step of generating the SAV table in (7) and does not need to send the second type of DPP protocol message to other border network devices in the second AS.

[0195] (7) When ASBR4 or other border network devices in the second AS receive the DPP protocol message, they all generate a SAV table. When ASBR4 generates the SAV table based on the DPP protocol message, it queries the source address record table based on the originating AS number in the DPP protocol message to determine the source prefix that needs to be verified. ASBR4 checks the neighbor AS list. If ASBR4 uses a direct connection interface (physical interface) to establish an eBGP neighbor relationship with a neighbor AS, it can be determined that the physical interface connected to the neighbor AS is a legal input interface. If ASBR4 uses a loopback interface to establish an eBGP neighbor relationship with a neighbor AS, the second network device will determine the output interface obtained through the route iteration to the neighbor AS as the physical interface for communicating with the neighbor AS, and determine the physical interface as a legal input interface.

[0196] It should be noted that, in this embodiment, when ASBR4 forwards SPA protocol messages and DPP protocol messages to other border network devices, intermediate forwarding devices that cannot recognize the above protocol messages will forward the above protocol messages as ordinary BGP messages without processing the above protocol messages.

[0197] In the second scenario, both the first network device and the second network device are controllers.

[0198] In this scenario, the controller in the first AS communicates with the controller in the second AS, transmitting SPA and DPP protocol messages, and forwarding these protocol messages to the border network device in the second AS to generate the SAV table. For example, in the application scenario shown in Figure 8, AS1 is the first AS, including border network device R1 and controller C1; AS3 is the second AS, including border network device R2 and controller C2.

[0199] The specific interaction process is as follows

[0200] (1) Establish a communication connection. For example, AS1's controller C1 establishes a connection with the AS's border network device R1; AS3's controller C2 establishes a connection with the AS's border network device R2; a Transmission Control Protocol (TCP) connection can be established between AS1's controller C1 and AS3's controller C2 to transmit protocol messages. Controller C1 and border routing device R1 can communicate via protocols such as BGP and BGP monitoring protocol (BMP); controller C2 and border routing device R2 can also communicate via protocols such as BGP and BMP.

[0201] (2) Controller C1 collects source prefixes in AS1. For example, controller C1 can collect source prefixes in AS1 in the following ways: one way is to manually configure and add source prefixes in controller C1; another way is for controller C1 to collect BGP routes from border network devices in AS1 and determine the source prefix based on routes with AS1 as the originating AS.

[0202] (3) Controller C1 constructs an SPA protocol message and sends it to controller C2. The SPA protocol message includes the AS identifier of the first AS and the corresponding source prefix.

[0203] (4) The controller C2 synchronizes the SPA protocol message to the border network device R2, and the border network device R2 then generates a source address record table.

[0204] (5) The controller C2 collects all AS paths of traffic in the local domain and determines the neighbor AS list corresponding to the second AS based on the AS path; or receives the neighbor AS list sent by each border network device.

[0205] (6) Controller C1 constructs a DPP protocol message and sends it to controller C2. The DPP protocol message includes the AS identifier of the first AS, the AS identifier of the second AS, and the AS identifier of the neighboring AS.

[0206] (7) The controller C2 synchronizes the DPP protocol message to all edge network devices in the second AS, so that each edge network device generates a SAV table.

[0207] It should be noted that when the first network device is a border network device and the second network device is a controller or RR, or when the first network device is RR and the second network device is a border network device, a controller or RR; or when the first network device is a controller and the second network device is a border network device or RR, the specific implementation of the first network device sending verification information and neighbor AS to the second network device can be referred to the embodiments shown in Figure 3, Figure 7 or Figure 8, and this embodiment will not be repeated here.

[0208] Hide AS notifications

[0209] The scenario of hidden AS announcement involves the source AS, the verification AS, and the intermediate AS located between the source AS and the verification AS. To distinguish and describe different ASs, the following examples use "AS A" to describe the source AS, "network device A" to describe the network device deployed at the edge of AS A, "AS B" to describe the intermediate AS, "network device B" to describe the network device deployed at the edge of AS B, "AS C" to describe the verification AS, and "network device C" to describe the network device deployed at the edge of AS C. Network device A is, for example, the egress device of AS A. Network device B is, for example, the ingress device or egress device of AS B. Network device C is, for example, the ingress device of AS C. AS A is a customer AS of AS B, and AS B is a customer AS of AS C.

[0210] To facilitate understanding of the solution, the following first explains the basic terminology and application scenarios related to source address verification and AS hiding notification.

[0211] Enhanced feasible path unicast reverse path forwarding (EFP-uRPF) is a technology used for inter-domain source address verification. EFP-uRPF includes two algorithms, referred to below as Algorithm A and Algorithm B. Both Algorithm A and Algorithm B aim to generate a prefix whitelist on the customer interface or the peer interface.

[0212] The prefix whitelist is a verification table entry (SAV table), also known as a verification rule, or an RFP list. The prefix whitelist is used to save legal source prefixes or source addresses. The source prefix is, for example, the prefix of the IP address owned by the source AS. The source IP address is, for example, the IP address owned by the source AS. The prefix whitelist corresponds to an interface. For example, when a message arrives at an interface in a network device, the network device determines whether the source address of the message is in the prefix whitelist or the source address of the message is covered by at least one prefix in the prefix whitelist; if the source address of the message is in the prefix whitelist or the source address of the message is covered by at least one prefix in the prefix whitelist, the network device determines that the message is a legal message; if the source address of the message is not in the prefix whitelist and the source address of the message is not covered by any prefix in the prefix whitelist, the network device determines that the message is an illegal message.

[0213] Provider AS and customer AS: Provider AS and customer AS are two roles of an AS and also the relationship between a pair of adjacent ASs. In two adjacent ASs, if one AS is a provider AS, the other AS is a customer AS. The provider AS provides the customer AS with services that connect to the upstream Internet. 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 usually located downstream of the provider AS. The customer AS can select the provider AS as the next hop to forward traffic to the destination through the provider AS. Taking the scenario shown in Figure 9 as an example, AS 4 is the provider AS for AS 2 and AS 3. AS 4 is used to provide Internet connectivity services for AS 2 and AS 3. AS 2 is the provider AS for AS1. In other words, AS1 is the customer AS of AS 2, and AS 2 is the customer AS of AS 4.

[0214] Peer AS: A peer AS is a role within an AS and also represents the relationship between a pair of adjacent ASes. If one AS is a peer AS, the other is also a peer AS. Peer ASes can exchange traffic between themselves and their customer ASes, but do not provide each other with upstream Internet connectivity.

[0215] Originating prefix: refers to the IP address block owned by the autonomous system (AS). AS can apply for IP address blocks from some international organizations and allocate the applied IP address blocks to network devices deployed within the AS or terminals or servers accessed by the network devices. An AS announces the IP address block owned by the AS to other ASs. When other ASs want to communicate with the devices associated with the IP address block, the other ASs initiate data flows with the IP addresses in the IP address block as the destination IP addresses, so that the data flows are forwarded to the AS through IP routing. For example, in the scenario shown in Figure 9, AS1 announces prefix P1, prefix P2, and prefix P3 so that AS 4 initiates data flows with prefix P1, prefix P2, or prefix P3 as the destination IP address. Among them, prefix P1, prefix P2, and prefix P3 are specific examples of originating prefixes.

[0216] A customer cone (also called a customer group) includes multiple ASes downstream of an AS. A customer cone comprises all customer ASes directly connected to an AS, as well as all customer ASes indirectly connected to it. For example, in the scenario shown in Figure 9, AS 4's customer cone includes ASs 2, 3, and 1.

[0217] The no-export attribute is a BGP path attribute that is used to control the distribution scope of routes. When an AS announces a route with the no-export attribute to its neighboring ASs, the route will not be forwarded by these neighboring ASs to other neighboring ASs. In other words, the no-export attribute limits the scope of route delivery. For example, if AS1 has a route with an address of 10.0.0.0 / 24, the route carries the no-export attribute. When AS1 announces this route to its neighbor AS2, AS2 determines based on the no-export attribute that this AS cannot further inform other neighboring ASs of the route, so that the route is only shared between AS1 and AS2, and will not be further propagated to a wider network range.

[0218] AS identifier: a parameter used to identify the identity of an AS. For example, the AS identifier is the AS number.

[0219] FIG9 is a schematic diagram of an application scenario provided by an embodiment of the present application. In the scenario shown in FIG9 , the route advertisement situation is that AS 4 receives routes originating from AS 1 from three directions: AS 2, AS 3, and AS 5.

[0220] Specifically, AS1 sends protocol message A to AS2. Message A includes the address prefix P1 and the AS_path attribute, which includes AS1's AS number. The contents of message A are hereinafter simplified as P1[AS1]. AS2 receives message A from AS1 and, based on P1[AS1], learns that if AS2 wishes to access an IP address containing prefix P1, it can send a data message to AS1. The network equipment within AS1 forwards the data message to the terminal or server corresponding to prefix P1. AS2 adds its AS number to the AS_path attribute in message A to generate message B. Message B includes prefix P1 and the AS_path attribute, which includes both AS1's and AS2's AS numbers. Message B is hereinafter simplified as P1[AS2,AS1]. AS 4 receives protocol message B from AS 2 via interface A. Based on P1 [AS 2, AS 1], AS 4 learns that if AS 4 wishes to access an IP address containing prefix P1, it can send a data message to AS 2, which then forwards the data message to AS 1. Thus, AS 4 receives the advertisement originating from AS 1 for prefix P1. Similarly, AS 1 sends prefix P2 and the AS_path attribute [AS1] to AS 3. AS 3 adds AS 3's AS number to the AS_path attribute [AS1]. AS 3 then sends prefix P2 and the AS_path attribute [AS 3, AS1] to AS 4. AS 4 receives prefix P2 and the AS_path attribute [AS 3, AS1] via interface B, allowing AS 4 to receive the advertisement originating from AS 3 for prefix P2. Similarly, AS1 sends prefix P3 and the AS_path attribute [AS1] to AS5. AS5 adds its AS number to the AS_path attribute [AS1]. AS5 then sends prefix P3 and the AS_path attribute [AS5, AS1] to AS4. AS5 receives prefix P3 and the AS_path attribute [AS5, AS1] via interface C, allowing AS4 to receive the advertisement for prefix P3 originating from AS1 from AS5. Route advertisements not described in the figure follow common rules. For example, a provider AS advertises all routes to a customer AS.

[0221] As shown in the scenario shown in Figure 9, as the AS_path attribute is transmitted through various ASs, the AS number of each AS it passes through is added to the AS_path attribute. Each AS can add its own AS number to the received AS_path attribute during the AS_path attribute transmission process and send an AS_path attribute including its own AS number and the AS numbers of its downstream ASs to the upstream AS.

[0222] In AS4, for southbound traffic, the outbound interface for traffic with the destination IP address including prefix P1 is interface A, the outbound interface for traffic with the destination IP address including prefix P2 is interface B, and the outbound interface for traffic with the destination IP address including prefix P3 is interface C. For northbound traffic, any of interfaces A, B, and C may receive any packet with source IP addresses including prefix P1, P2, or P3.

[0223] EFP-uRPF Algorithm A is used to obtain all originating prefixes within the customer cone and all customer interfaces corresponding to each customer AS in the customer cone to generate a prefix whitelist. For example, AS 4 uses EFP-uRPF Algorithm A to obtain the correspondence between prefix P1 and interface A that received prefix P1, the correspondence between prefix P2 and interface B that received prefix P2, and the correspondence between prefix P3 and interface C that received prefix P3. Exemplarily, EFP-uRPF Algorithm A includes steps 1 to 4.

[0224] Step 1: Obtain the customer cone. Specifically, the verification AS determines the AS number received by the verification AS's customer interface to obtain the customer cone connected to the verification AS's customer interface. For example, AS 4 determines that customer interface A receives the AS numbers of AS1 and AS2, and AS 4 determines that customer interface B receives the AS numbers of AS1 and AS3, constructing the customer cone connected to customer interface A and the customer cone connected to customer interface B. The customer cone connected to customer interface A includes AS1 and AS2, and the customer cone connected to customer interface B includes AS1 and AS3.

[0225] Step 2, obtain the originating prefix set. Specifically, the verification AS determines the originating prefix corresponding to each AS in the customer cone based on the AS number of each AS in the customer cone to obtain the originating prefix set. For example, the verification AS uses the AS number of each AS in the customer cone as an index to search the library Adj-RIBs-In to obtain the originating prefix corresponding to each AS stored in the library Adj-RIBs-In. Adj-RIBs-in is a routing information base in the connection state of the neighbor relationship input, which can be understood as a database for storing routes announced by the BGP protocol. Adj-RIBs-In includes a transit interface, a customer interface, and a lateral peer interface.

[0226] For example, AS 4 searches Adj-RIBs-In based on AS1's AS number to obtain the originating prefix corresponding to AS1. AS 4 searches Adj-RIBs-In based on AS2's AS number to obtain the originating prefix corresponding to AS2. AS 4 searches Adj-RIBs-In based on AS3's AS number to obtain the originating prefix corresponding to AS3.

[0227] Step 3: Generate a prefix whitelist. Specifically, the verification AS generates a prefix whitelist based on the customer interface and the set of originating prefixes. For example, an RFP list targeting AS1's customer interface is constructed. AS1's originating prefixes are allowed to enter through any customer interface (any customer interface that receives AS1's routing advertisement).

[0228] Step 4: Repeat steps 2 and 3 to traverse the customer AS collection.

[0229] Scenario constraints of Algorithm A: It is required to verify that each interface of the network device at each entrance of the AS receives at least one AS number announced from the AS in the customer cone. For the end stub AS in the customer cone, the end stub AS needs to announce at least one AS number of this AS to each transit provider AS. The intermediate AS needs to announce at least one customer route to all transit providers of the intermediate AS for the received customer route. For example, in the scenario shown in Figure 10, the end stub AS is AS1, and the transit provider AS of AS1 is AS 2 and AS 3. AS 4 determines which originating ASs announce the routes received by each interface. For example, if the routes received by interface A are from AS1 and AS 2, AS 4 determines the originating prefix owned by AS1 and the originating prefix owned by AS 2 based on the routing information from all directions. AS 4 adds the originating prefix owned by AS1 and the originating prefix owned by AS 2 to the whitelist of interface A. If AS1 has not sent AS1-owned prefixes to AS4's interface A in the past, AS4's interface A will be unaware of AS1's presence, resulting in AS1's prefixes not being included in the prefix whitelist generated by AS4. However, since AS1 is AS4's customer AS and needs to access the internet through AS4, AS1 will send data traffic to AS4. However, AS1's prefixes are not included in AS4's prefix whitelist, preventing AS1's data traffic from being successfully transmitted.

[0230] As shown in Figure 10, because the address prefix sent by AS1 to AS 2 carries the no-export attribute, after AS 2 receives the address prefix from AS1, AS 2 does not further notify AS 4 of the address prefix originating from AS1 based on the no-export attribute. As a result, AS 4's interface A does not receive any originating prefix notifications from AS1. AS 4's prefix whitelist on interface A does not include prefix P1. When a legitimate message generated by AS1 with a source address including prefix P1 arrives at AS 4's interface A via AS2, AS 4 queries the prefix whitelist based on the source address. AS 4 determines that prefix P1 does not exist in the prefix whitelist. AS 4 then mistakenly identifies the message from AS1 as an illegal message and discards the message from AS1.

[0231] EFP-uRPF Algorithm B addresses the scenario limitation of EFP-uRPF Algorithm A, which requires verifying that each interface of a network device at each entrance to an AS receives at least one prefix advertisement from an AS within the customer cone. EFP-uRPF Algorithm B attempts to identify all originating prefixes from the customer AS from all possible directions, assuming that these prefixes are valid regardless of the customer interface they enter. Furthermore, EFP-uRPF Algorithm B obtains a customer cone based on the AS, not the interface. Algorithm B is equivalent to merging the cones connected to each customer interface in Algorithm A to obtain the customer cone.

[0232] EFP-uRPF algorithm B includes the following steps 1 to 5.

[0233] Step 1: The verification AS determines all directly connected customer interfaces, regardless of whether the customer interfaces receive advertised routes, to obtain a customer interface set. For example, in the scenario shown in FIG10 , AS 4 determines interface A and interface B.

[0234] Step 2: The verification AS determines the originating prefix corresponding to the customer interface from Adj-RIBs-In to obtain the prefix set of the customer interface. For example, in the scenario shown in FIG10 , AS 4 determines prefix P1 and prefix P2.

[0235] Step 3: The verifying AS determines the originating AS corresponding to the customer interface from Adj-RIBs-In to obtain the originating AS set of the customer interface. For example, in the scenario shown in FIG10 , AS 4 determines AS1.

[0236] In step 4, the verification AS determines all prefixes associated with the corresponding originating AS from the Adj-RIBs-In data in the direction of the transit and peer interfaces to obtain the prefix set of the originating AS. For example, AS 4 determines prefix P3 from the peer interface direction.

[0237] In step 5, the verification AS combines the prefixes obtained in step 2 with the prefixes obtained in step 4 to obtain a prefix whitelist associated with the customer interface. For example, the prefix whitelist obtained by the verification AS includes the mapping between prefixes P1, P2, and P3 and interfaces A and B.

[0238] When using EFP-uRPF algorithm B, the customer cone source prefixes cover an excessively wide range of interfaces, resulting in a prefix whitelist that may include prefixes unreachable by the interface, leading to loose regulation or routing control. For example, AS 4's interface A does not receive AS1's AS number, while AS 4's interface B does. Both interfaces A and B are AS 4's customer interfaces. Therefore, AS 4 integrates the AS numbers received by interface A and interface B, effectively adding AS1's AS number received by interface B to interface A's prefix whitelist. This results in interface A's prefix whitelist including AS1's AS number, prefix P1, prefix P2, and prefix P3. Furthermore, if the prefix sent by the source AS to the upstream AS carries the no-export attribute, each customer interface of the validating AS may fail to receive the source AS's AS number, rendering the validating AS unaware of the source AS's existence. For example, as shown in Figure 10, if the prefix sent by AS1 to AS2 carries the no-export attribute, and the prefix sent by AS1 to AS3 also carries the no-export attribute, AS2 will not announce AS1's AS number and AS1's prefix to AS4, and AS3 will not announce AS1's AS number and AS1's prefix to AS4. As a result, AS4 will not be able to receive AS1's AS number from either interface A or interface B, making AS1 a hidden AS of AS4. In addition, there is a case of source address spoofing within the customer cone.

[0239] For example, if a member of a customer cone impersonates another member, while AS 2 can guarantee that the source address of traffic leaving the cone originates from within the cone, it cannot guarantee that members cannot impersonate each other. For example, in Figure 10, AS 2 sends a message to AS 4 with a source address that includes a prefix originating from AS 3. AS 4 cannot intercept this forged traffic on interface A.

[0240] To address the issue where both EFP-uRPF Algorithm A and EFP-uRPF Algorithm B cannot support the authenticating AS to perceive the source AS, causing the source AS to become a hidden AS, some embodiments of this application provide a method for announcing a hidden AS. A hidden AS is, for example, an AS that is perceived by an intermediate AS but has not historically been announced to the authenticating AS. A hidden AS is a customer AS of the authenticating AS within a customer cone.

[0241] Methods for announcing the hidden AS include hop-by-hop announcement and point-to-point announcement.

[0242] For example, a point-to-point AS notification method involves the source AS directly notifying the verification AS of its AS number. For example, AS1 notifies AS4 of its AS number, allowing AS4 to detect the presence of AS1. In other embodiments of the present application, a hop-by-hop AS notification method is used, where an intermediate AS helps the source AS notify the verification AS of its AS number. In some embodiments of the intermediate AS determining the verification AS, the intermediate AS records all AS numbers received by the intermediate AS in a historical time period and the intermediate AS's own AS number to obtain a first AS set, which includes all AS numbers received by the intermediate AS and the intermediate AS's own AS number; the intermediate AS records all AS numbers announced by the intermediate AS to neighboring ASs in a historical time period to obtain a second AS set; the intermediate AS compares the first AS set with the second AS set to obtain AS numbers included in the first AS set and not included in the second AS set, the AS numbers included in the first AS set and not included in the second AS set are equivalent to the AS numbers received historically compared to the AS numbers announced historically to neighboring ASs, which can be understood as AS numbers of ASs that have not been announced, and the intermediate AS determines the AS numbers included in the first AS set and not included in the second AS set as hidden ASs, and the intermediate AS sends the hidden ASs to the neighboring ASs of the intermediate AS so that the verification AS can perceive the existence of the hidden AS.

[0243] For example, AS 2 records each AS number included in the AS_path attribute received from AS 1 during a historical period to obtain a first AS set. AS 2 also records each AS number included in the AS_path attribute sent by AS 2 to AS 4 during a historical period to obtain a second AS set. AS 2 compares the first AS set with the second AS set and determines that the first AS set includes AS 1's AS number but the second AS set does not. AS 2 thus identifies AS 1 as a hidden AS. Therefore, AS 2 notifies AS 4 of AS 1's AS number, allowing AS 4 to detect the existence of AS 1.

[0244] For example, a hop-by-hop AS-hidden method involves an intermediate AS announcing the source AS's AS number to the hidden AS. For example, in the scenario shown in Figure 10, AS1 sends AS1's AS number to AS2. After receiving the AS number from AS1, AS2 further sends AS1's AS number to AS4, so that AS1's AS number is transmitted to AS4 sequentially through AS1 and AS2. For example, a point-to-point AS-hidden method involves the source AS announcing its AS number to the verifying AS. For example, in the scenario shown in Figure 10, AS1 sends AS1's AS number to AS4. Using point-to-point AS-hidden methods reduces deployment complexity and enhances security. Using hop-by-hop AS-hidden methods reduces the number of connections an AS needs to establish. For example, in sparse deployments (e.g., a network with a small number of ASs), point-to-point AS-hidden methods are used. In dense deployments (e.g., a network with a large number of ASs), hop-by-hop AS-hidden methods are used.

[0245] In some implementations, the AS sends an AS identifier that the AS can perceive to all legitimate neighbors of the AS at least once.

[0246] The target party for the AS hidden notification (the recipient of the AS identifier, or a legitimate neighbor of the AS) is, for example, an AS with which the AS meets the requirements for a business relationship. For example, the AS and the target AS for AS hidden notification have a customer-to-provider (C2P) or peer-to-peer (P2P) relationship. For example, the AS identifier that the AS can perceive is the AS identifier of its customer AS.

[0247] As an example, this AS announces the AS identifier of at least one customer AS that this AS can perceive to the provider AS and / or peer AS of this AS. For example, in the scenario shown in FIG10 , any AS downstream of AS 4, such as AS 2, detects the AS identifier of the customer AS that AS 2 can perceive, obtains the identifier of AS1, and AS 2 announces the identifier of AS1 to AS 4 upstream of AS 2. Alternatively, the source AS announces the AS identifier of this AS to the verification AS. For example, AS1 announces the identifier of AS1 to AS 4. The verification AS can receive the AS identifier of the source AS from the customer AS of the verification AS or the peer AS of the verification AS. Due to the use of the method of announcing the customer AS, the verification AS can generate a more accurate prefix whitelist. Specifically, taking the use of EFP-uRPF algorithm A to generate a prefix whitelist as an example, when executing step 1, if the verification AS does not receive the AS identifier of a customer AS, then when executing step 2, the verification AS will not use the AS identifier of the customer AS as an index to look up the Adj-RIBs-In library, and will not add the originating prefix from the customer AS to the prefix whitelist. Therefore, the prefix whitelist is incomplete and inaccurate due to the lack of the originating prefix of the customer AS. After the customer AS is announced, the verification AS receives the identifier of the customer AS through an inbound interface of the verification AS, and is able to know that the traffic corresponding to the originating prefix of the customer AS may subsequently arrive at the inbound interface. Then, when executing step 2, the verification AS can add the originating prefix of the customer AS to the prefix whitelist, thereby solving the problem of inaccuracy caused by the lack of the originating prefix of the customer AS in the customer cone in the prefix whitelist.

[0248] In some embodiments, the hidden AS (the identifier of the AS to be sent) is determined based on the AS_path attribute. For example, network device B records the AS_path attribute sent by network device B to AS C in a historical time period. If the AS_path attribute does not include the identifier of an AS that network device B has obtained, network device B determines that the identifier of the AS is a hidden AS, so network device B further sends the identifier of the AS to AS C. For example, network device B obtains the first AS path received by network device B from AS A and the second AS path sent by network device B to AS C, and network device B compares the content of the first AS path with the content of the second AS path. If network device B determines that the identifier of AS A exists in the first AS path and the identifier of AS A does not exist in the second AS path, this situation indicates that the identifier of AS A is missing from the upstream AS. Therefore, network device B sends the identifier of AS A to AS C, which is equivalent to reissuing the identifier of AS A, so that AS C can perceive the existence of AS A.

[0249] For example, in the scenario shown in FIG10 , the network device in AS 2 detects that the AS number of AS1 has never appeared in the AS_path attribute advertised by the network device to AS 4. In this case, the network device proactively advertises AS1's AS number to AS 4, enabling AS 4 to detect the existence of AS1 based on the received AS number of AS1 and thereby add prefixes P1, P2, and P3 originating from AS1 to the prefix whitelist on interface A. As a specific example of determining a hidden AS, the network device in AS 2 compares the AS_path attribute received from AS1 with the AS_path attribute advertised by the network device to AS 4. Based on the presence of AS1's AS number in the received AS_path attribute and the absence of AS1's AS number in the AS_path attribute advertised to AS 4, the network device detects that AS1 is a hidden AS.

[0250] In some implementations, the network device not only sends the AS identifier of the hidden AS to the verification AS, but also sends the attributes of the hidden AS to the verification AS. The attributes of the hidden AS include parameters of other dimensions besides the AS identifier. The following example illustrates the attributes of the hidden AS that the network device may optionally announce.

[0251] Exemplarily, the network device further sends the source of the AS identifier of the hidden AS to the verification AS. The source of the AS identifier is, for example, the customer AS.

[0252] Exemplarily, the network device further sends a destination of the AS identifier of the hidden AS to the verification AS. The destination of the AS identifier of the hidden AS is, for example, a provider AS or a peer AS.

[0253] Exemplarily, the network device also sends a reason type to the verification AS. The reason type indicates the reason for hiding the AS. In other words, the reason type indicates why the network device did not send the AS identifier of the hidden AS to the verification AS during a historical period. For example, if the reason type is the no-export attribute, this reason type indicates that the reason for hiding the AS is that the hidden AS sent the no-export attribute. For example, because the hidden AS sent routing information along with the no-export attribute to the network device, the network device recognized the no-export attribute and therefore did not previously notify the verification AS of the hidden AS. Another example is a locally configured policy on the network device.

[0254] Exemplarily, the network device also sends a connection relationship flag to the verification AS. The connection relationship flag is used to indicate the connection relationship between the hidden AS and the AS where the network device is located. For example, the connection relationship flag is a direct connection flag or an indirect connection flag. The direct connection flag is used to indicate that the hidden AS has a direct connection relationship with the AS where the network device is located. The indirect connection flag is used to indicate that the hidden AS has an indirect connection relationship with the AS where the network device is located. For example, in the scenario shown in FIG10 , the network device in AS 2 determines the connection relationship between AS 2 and AS1. If AS 2 has a direct connection relationship with AS1, the network device also notifies the direct connection flag when notifying AS 4 of the AS number of AS1. If AS 2 has an indirect connection relationship with AS1, the network device also notifies AS 4 of the AS number of AS1.

[0255] For example, please refer to Figure 11, which shows a schematic diagram of a message structure. The message structure shown in Figure 11 is suitable for announcing a hidden AS. The message structure shown in Figure 11 is, for example, a portion of a BGP protocol message. The message includes a hidden AS number (hidden AS number field), a from field, a go field, a reason field, and a flags field. The hidden AS number field carries the AS identifier of the hidden AS. The from field carries the direction from which the hidden AS's AS identifier comes, such as the source of the hidden AS's AS identifier. For example, the from field carries the customer AS. The go field carries the direction from which the hidden AS's AS identifier goes, such as the destination of the hidden AS's AS identifier. For example, the go field carries the provider AS or peer AS. The reason field carries the type of reason for the hidden AS. The most significant bit in the flags field is the connection relationship flag, indicating whether the hidden AS is a directly connected AS or an indirectly connected AS. Bits other than the most significant bit in the flags field are reserved. For example, the hidden AS number field occupies 4 bytes, and the from field, go field, reason field, and flags field each occupy 1 byte.

[0256] In some embodiments, the verification AS visualizes the routing topology based on the attributes of the hidden AS. For example, the verification AS generates the topology of the customer cone of the verification AS based on the identifier of the hidden AS, and the verification AS annotates the attributes of the hidden AS to the topology of the customer cone. For example, the verification AS determines the path between the verification AS and the hidden AS based on the AS identifier source carried by the From field and the connection relationship flag carried by the Flags field, and the verification AS adds the path between the verification AS and the hidden AS to the routing topology. For example, AS C receives the identifier of AS A, the source of AS identifier, and the connection relationship flag from AS B, and the AS identifier source is the customer AS, so AS C determines that AS A is the customer AS of AS B, and AS C adds AS A downstream of AS B in the topology of the customer cone. If the connection relationship flag is a direct connection flag, AS C adds a direct link between AS B and AS A in the topology of the customer cone. If the connection relationship flag is a non-direct connection flag, AS C adds a non-direct link between AS B and AS A in the topology of the customer cone.

[0257] For example, in the scenario shown in Figure 10, when AS 2 announces AS 1's identifier to AS 4, AS 2 also announces the interface on AS 2 connected to AS 1 and the direct connection flag, which indicates that AS 2 and AS 1 have a direct connection. When AS 4 constructs the customer cone topology, based on AS 1's identifier, the interface on AS 2 connected to AS 4, and the direct connection flag, it adds a direct link to the interface on AS 2 in the topology and marks the endpoint of the direct link as AS 1.

[0258] There are multiple ways to notify a hidden AS. The following uses three notification methods as examples to illustrate.

[0259] Method 1 for announcing a hidden AS: Extend the path attribute in the BGP update message to carry the AS identifier of the hidden AS.

[0260] In some embodiments, the path attributes in the BGP update message generated and sent by the network device carry the AS identifier of the hidden AS and the attributes of the hidden AS. For example, the BGP update message includes path attributes, and the path attributes include an attribute type field, an attribute length field, and an attribute value field, and the attribute value field includes the AS identifier of the hidden AS and the attributes of the hidden AS. A path attribute field includes one or more NLRI fields. When a path attribute field includes multiple NLRI fields, each NLRI field is used to carry the AS identifier of a hidden AS and the attributes of the hidden AS, and different NLRI fields are used to carry the AS identifiers and attributes of different hidden ASs. Since the identifiers and attributes of multiple hidden ASs are carried in the same BGP update message, the efficiency of notifying multiple hidden ASs is improved.

[0261] In some embodiments, the extended multi-protocol reachable network layer routing information (multi-protocol reachable NLRI, MP_REACH_NLRI) or / and the multi-protocol unreachable network layer routing information (multi-protocol unreachable NLRI, MP_UNREACH_NLRI) carries the AS identifier of the hidden AS and the attributes of the hidden AS. For example, the BGP update message generated and sent by the network device includes MP_REACH_NLRI, and MP_REACH_NLRI includes AFI (address family identifier, address family identifier), SAFI (subsequent address family identifier, sub-address family identifier), the AS identifier of the hidden AS and the attributes of the hidden AS. The address family identifier or sub-address family identifier is used to indicate the generation of a verification table entry or / and the announcement of the hidden AS. MP_REACH_NLRI is used to announce the hidden AS. The AS identifier of the hidden AS and the attributes of the hidden AS are encapsulated in the inner layer of AFI and SAFI. Optionally, a sub type is also defined to indicate source address verification and / or the announcement of the hidden AS.

[0262] Alternatively, the BGP update message generated and sent by the network device includes the MP_UNREACH_NLRI, which includes the address family identifier, the sub-address family identifier, the AS identifier of the hidden AS, and the attributes of the hidden AS. The MP_UNREACH_NLRI is used to identify the hidden AS for revocation notification.

[0263] Through implementation method one, while the hidden AS is announced to the verification AS, since a predetermined address family or address subfamily is used to indicate the generation of verification entries or / and the announcement of the hidden AS, the network device in the verification AS as the receiving end can clearly identify the AS identifier carried in the received message to indicate the generation of verification entries, without having to use the AS identifier for path selection, thereby achieving better isolation between the function of announcing the hidden AS and other functions such as routing. In addition, since the hidden AS is announced using a BGP update message, the incremental update mechanism in the BGP protocol can be utilized, and only the hidden AS that has changed is announced. When a new hidden AS is detected, the AS identifier of the new hidden AS is sent to the verification AS once, without having to send all the detected hidden ASes. When a hidden AS disappears and is no longer valid, it can be quickly revoked by sending MP_UNREACH_NLRI, so the efficiency of updating the hidden AS is high, reducing the probability of useless announcements.

[0264] For example, please refer to Figure 12, which shows a schematic diagram of the format of MP_REACH_NLRI in a BGP update message provided in an embodiment of the present application. MP_REACH_NLRI includes an AFI field, a SAFI field, a next hop network address length (length of next hop network address, NHP length) field, a next hop network address (network address of next hop) field, and one or more network layer reachability information (NLRI) fields. The value of the length of next hop network address field is 0, indicating that the network address of next hop field does not exist, or that the length of the network address of next hop field is 0, and the network address of next hop field does not need to be packaged and parsed.

[0265] For example, please refer to FIG13, which is a schematic diagram of the format of the NLRI in FIG12. The NLRI includes a route type field, a length field, and the hidden AS number field, from field, go field, reason field, and flags field shown in FIG11.

[0266] In some embodiments, before network device B announces a hidden AS to network device C, network device B negotiates with network device C about its ability to announce a hidden AS. For example, network device B generates and sends a BGP start (open) message to network device C, where the BGP open message includes a capability identifier. Network device C receives the BGP open message. If network device C supports receiving announced hidden ASs, network device C sends a BGP open confirmation message to network device B, where the BGP open confirmation message includes a flag indicating support for the ability to announce hidden ASs. Network device C receives the BGP open confirmation message and establishes a BGP neighbor relationship with network device B based on confirming the other party's ability to support hidden ASs. Alternatively, if network device C does not support receiving announced hidden ASs, network device C sends a BGP open confirmation message to network device B, where the BGP open confirmation message includes a flag indicating support for the ability to announce hidden ASs. Network device C then disconnects the BGP neighbor relationship with network device B based on the BGP open confirmation message.

[0267] The capability identifier indicates support for announcing a hidden AS. For example, the capability identifier indicates support for carrying the AS identifier of the hidden AS in the NLRI. Optionally, the capability identifier is an address family identifier or a sub-address family identifier. For example, a BGP open message includes an optional parameter field, the optional parameter field includes a capability field, and the capability field includes a capability identifier. Taking the scenario shown in FIG10 as an example, AS2 and AS4 negotiate to establish a BGP neighbor relationship based on a new capability, which is carrying a hidden AS in the NLRI. The new capability is identified by a new address family or address sub-family.

[0268] The second method of announcing a hidden AS is to extend the BGP route-refresh message to carry the AS identifier of the hidden AS.

[0269] For example, a network device uses a point-to-point method to announce the AS identifier and AS attributes of a hidden AS by sending a BGP route-refresh message. Optionally, the BGP route-refresh message also includes an address family identifier or a sub-address family identifier, which indicates that the BGP route-refresh message is used for source address verification and / or announcement of the hidden AS. The AS identifier and AS attributes of the hidden AS are encapsulated within the address family identifier or the sub-address family identifier.

[0270] Optionally, the BGP route-refresh message further includes a subtype field, where the subtype field is used to indicate that the BGP route-refresh message is used for source address verification and / or notification of a hidden AS.

[0271] For example, please refer to Figure 14, which shows a format diagram of a BGP route-refresh message provided in an embodiment of the present application. The BGP route-refresh message includes an AFI field, a SAFI field, a sub type field, and the hidden AS number field, from field, go field, reason field, and flags field shown in Figure 11.

[0272] Through implementation method 2, while the hidden AS is announced to the verification AS, the use of a predetermined address family or address subfamily to indicate the generation of verification entries and / or the announcement of the hidden AS allows the network device in the verification AS as the receiving end to clearly identify the AS identifier carried in the received message to indicate the generation of verification entries, without having to use the AS identifier for path selection. This allows for better isolation between the function of announcing the hidden AS and other functions such as routing. In addition, because the hidden AS is announced using a BGP route-refresh message, the revocation of a hidden AS that has disappeared and is no longer valid is relatively slow, reducing the probability of route oscillation caused by the overly rapid revocation of the hidden AS and providing higher security.

[0273] Hidden AS Announcement Method 3: Follow Router Announcement Hidden AS (Customer AS)

[0274] In some implementations, when forwarding a route from a source AS, the intermediate AS advertises the existence of the source AS. Furthermore, when forwarding the route, the intermediate AS adds a tag to the route-containing message to indicate that the source AS's identifier is not involved in route selection but is used to generate a verification entry. For example, the intermediate AS adds a path attribute to the route-containing message, where the path attribute includes the aforementioned tag.

[0275] For example, network device A generates and sends message A to network device B based on one or more address prefixes belonging to AS A. Message A includes one or more address prefixes of AS A, the no-export attribute, and the AS path, and the AS path includes the identifier of AS A. Message A is equivalent to one or more routes. Network device B receives message A, saves one or more address prefixes of AS A and the AS path into the routing table of network device B, adds a first tag to message A, and optionally deletes the no-export attribute from message A to obtain message B. Network device B sends message B to network device C. Message B includes the identifier of AS A and the first tag, and optionally also includes one or more address prefixes of AS A. Network device C receives message B and obtains the first tag and the identifier of AS A carried in message B. Network device C determines that AS A exists in the customer cone of AS C based on the identifier of AS A. Network device C determines that AS A does not need to use the address prefix of AS A to determine the forwarding path based on the first tag, and uses the identifier of AS A to generate a verification table entry (such as a prefix whitelist / SAV table entry).

[0276] The first flag is used to indicate that the AS identifier carried in the message does not participate in forwarding path selection. Alternatively, the first flag is used to indicate that the AS identifier is used to generate a verification entry (e.g., a SAV entry, such as a prefix whitelist). Alternatively, the first flag is used to indicate the presence of a notification AS.

[0277] Taking the scenario shown in Figure 10 as an example, AS1 generates and sends message A to AS 2. Message A includes AS1's address prefix P1, AS1's AS number, and the no-export attribute. AS 2 receives message A, adds a first tag to message A, and obtains message B. AS 2 sends message B to AS 4. The first tag indicates that AS1's AS number does not participate in routing, but is used to generate source address verification rules. AS 4 receives message B, obtains the first tag and AS1's AS number carried in message B. Based on AS1's AS number, AS 4 determines that AS 4's customer cone includes AS1. Based on the first tag, AS 4 adds AS1's AS number to the prefix whitelist.

[0278] In other embodiments, when the source AS advertises a route, the source AS adds a first tag and a no-export attribute to the route. The intermediate AS further forwards the route from the source AS to the verification AS. For example, AS1 generates and sends a protocol message A to AS2. Protocol message A includes AS1's address prefix P1, AS1's AS number, a first tag, and a no-export attribute. AS2 obtains protocol message B based on protocol message A. Protocol message B includes AS1's AS number and the first tag. AS2 sends protocol message B to AS4. Optionally, AS2 removes the no-export attribute from protocol message A to obtain protocol message B.

[0279] Based on the above method embodiment, the embodiment of the present application provides a verification information sending device and a verification table item obtaining device, which will be described below with reference to the accompanying drawings.

[0280] Referring to Figure 15 , this figure is a structural diagram of a verification information sending device 700 provided in an embodiment of the present application. This device is applied to a first network device, or can implement the functions of ASBR1, ASBR2, or ASBR3 in the embodiment shown in Figure 7 , or can implement the functions of controller C1 in the embodiment shown in Figure 8 . Device 700 may include a processing unit 701 and a sending unit 702. Processing unit 701 may execute S301 in the above-described method embodiment, and sending unit 702 may execute S302 in the above-described method embodiment.

[0281] Specifically, the processing unit 701 is configured to obtain verification information of the first autonomous domain AS to which it belongs and a neighbor AS of the second AS used for verification, where the neighbor AS is the previous hop of the second AS in the direction from the first AS to the second AS;

[0282] The sending unit 702 is configured to send the verification information and the neighbor AS to the second AS.

[0283] In a possible implementation, the processing unit 701 is specifically configured to obtain a first AS path with a first AS as an endpoint, where the first AS path includes a second AS; and obtain a neighbor AS of the second AS based on the first AS path.

[0284] In a possible implementation, the processing unit 701 is specifically configured to obtain a second AS path with the first AS as an endpoint, where the second AS path includes the second AS and is a backup path or a load sharing path of the first AS path.

[0285] In one possible implementation, the processing unit 701 is specifically used to receive a neighbor AS of the second AS sent by a border network device in the first AS. The neighbor AS of the second AS sent by the border network device in the first AS is an AS determined by the border network device in the first AS based on its own routing table and / or redirection path.

[0286] In a possible implementation, the processing unit 701 is specifically configured to receive a first message sent by a border network device in a first AS, where the first message includes an identifier of the second AS and an identifier of a neighboring AS.

[0287] In one possible implementation, the first message also includes a first serial number and an identifier of a border network device in the first AS, and the processing unit 701 is also used to obtain a second serial number based on the identifier of the border network device in the first AS and a first correspondence, wherein the first correspondence includes the identifier of the border network device of the first AS and the second serial number; and determine that the first serial number is greater than the second serial number.

[0288] In a possible implementation, the processing unit 701 is specifically configured for the first network device to obtain a neighbor AS of the second AS according to its own routing table and / or redirection path.

[0289] In a possible implementation, the first network device is a controller, a route reflector RR, or an edge network device.

[0290] In a possible implementation, the sending unit 702 is specifically configured to obtain an address of a second network device in the second AS, where the second network device is a controller, RR, or border network device; and send verification information and a neighbor AS to the second network device according to the address of the second network device.

[0291] In a possible implementation, the verification information includes an identifier of the first AS, and the sending unit is configured to send a second message to the second network device, where the second message includes the identifier of the first AS and an identifier of a neighboring AS.

[0292] In a possible implementation, the second message further includes a third sequence number and an identifier of the first network device.

[0293] In a possible implementation, the sending unit 702 is further configured to send a message to the second network device, where the message includes the identifier of the first AS, the identifier of the second AS, and the identifier of the neighbor AS.

[0294] In a possible implementation, the originating AS identification field in the message includes the identification of the first AS, the verification AS identification field in the message includes the identification of the second AS, and the neighbor AS identification field in the message includes the identification of the neighbor AS.

[0295] In a possible implementation, the processing unit 701 is further configured to obtain an identifier of the second AS and an address of a next hop, where the next hop is one of a controller in the second AS, a border network device in the second AS, or a route reflector in the second AS.

[0296] In a possible implementation manner, the verification information includes at least one of a source prefix corresponding to the first AS and an identifier of the first AS.

[0297] In this embodiment, the implementation of each unit can refer to the specific implementation process of the first network device in the above method embodiment, which will not be repeated here.

[0298] Referring to Figure 16 , Figure 16 is a schematic diagram of the structure of a verification table entry acquisition device 800 provided in an embodiment of the present application. This device 800 is used for a second network device in a second AS for verification, or this device 800 can implement the functions of any device among ASBR4-ASABR8 in the embodiment shown in Figure 7 , or this device can implement the functions of controller C2 in the embodiment shown in Figure 8 . This device 800 may include: a receiving unit 801 and a processing unit 802. The receiving unit 801 is configured to receive the verification information and neighboring AS sent by the first network device in S302, and the processing unit 802 is configured to execute S303 in the above method embodiment.

[0299] A receiving unit 801 is configured to receive verification information of a first AS and a neighbor AS of the second AS sent by a first network device in the first AS;

[0300] The processing unit 802 is configured to obtain a verification entry based on the verification information and the neighbor AS, where the verification entry includes a source prefix corresponding to the first AS and an inbound interface used for communicating with the neighbor AS.

[0301] In a possible implementation, the verification information includes an identifier of the first AS, and the receiving unit 801 is configured to receive, by the second network device, a second message sent by the first network device in the first AS, where the second message includes the identifier of the first AS and the identifier of the neighbor AS;

[0302] In one possible implementation, the second message also includes a third sequence number and an identifier of the first network device. The processing unit 802 is further used to obtain a fourth sequence number based on the identifier of the first AS, the identifier of the first network device, and a second correspondence, wherein the second correspondence includes the identifier of the first AS, the identifier of the first network device, and the fourth sequence number; and determine that the third sequence number is greater than the fourth sequence number.

[0303] In a possible implementation, the apparatus further includes: a sending unit (not shown in FIG. 16 ), which is connected to the receiving unit and configured to send the verification information and the neighbor AS to a border network device in the second AS.

[0304] In one possible implementation, the verification information includes the source prefix, and the processing unit 802 is specifically used to obtain the AS to which the third network device that communicates with the interface belongs; if the AS to which the third network device belongs is the neighbor AS, determine that the interface is the input interface; and obtain the verification table entry based on the source prefix and the input interface.

[0305] In one possible implementation, the verification information includes the identifier of the first AS, and the processing unit 802 is specifically used to obtain the AS to which the third network device that communicates with the interface belongs; if the AS to which the third network device belongs is the neighbor AS, determine that the interface is the input interface; obtain the source prefix based on the identifier and the corresponding relationship of the first AS, and the corresponding relationship includes the identifier of the first AS and the source prefix; obtain the verification table entry based on the source prefix and the input interface.

[0306] In a possible implementation, the receiving unit 801 is further configured to receive a service message, where the service message includes a source Internet Protocol IP address;

[0307] The processing unit 802 is further configured to determine the legitimacy of the service message according to the verification entry, the source IP address, and the interface for receiving the service message.

[0308] In this embodiment, the implementation of each unit can refer to the specific implementation process of the second network device in the above method embodiment, which will not be repeated here.

[0309] It should be noted that the division of units in the embodiments of the present application is schematic and is only a logical functional division. In actual implementation, there may be other division methods. The functional units in the embodiments of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. For example, in the above embodiment, the processing unit and the sending unit can be the same unit or different units. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0310] The hardware structure of the aforementioned devices 700 and 800 may be the structure shown in Figure 17. Figure 17 is a structural diagram of a network device provided in an embodiment of the present application. The network device may be, for example, the first network device or the second network device in the above-mentioned method embodiment.

[0311] The network device 900 includes a processor 910, a communication interface 920, and a memory 930. The network device 900 may include one or more processors 910, with one processor being used as an example in FIG17 . In the embodiment of the present application, the processor 910, the communication interface 920, and the memory 930 may be connected via a bus system or other means, with FIG17 using a bus system 940 as an example.

[0312] The processor 910 may be a CPU, an NP, or a combination of a CPU and an NP. The processor 910 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0313] Memory 930 may include volatile memory, such as random-access memory (RAM); non-volatile memory, such as flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); or a combination of these types of memory. Memory 930 may, for example, store the aforementioned verification entries.

[0314] Optionally, the memory 930 stores an operating system and programs, executable modules or data structures, or subsets thereof, or extended sets thereof, wherein the programs may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and processing hardware-based tasks. The processor 910 can read the programs in the memory 930 to implement the methods provided in the embodiments of the present application.

[0315] The memory 930 may be a storage device in the communication device 900 , or may be a storage device independent of the communication device 900 .

[0316] Bus system 940 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. Bus system 940 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, FIG17 shows only one thick line, but this does not mean that there is only one bus or only one type of bus.

[0317] The hardware structure of the aforementioned devices 700 and 800 may be the structure shown in Figure 18. Figure 18 is a structural diagram of a network device provided in an embodiment of the present application. The network device may be, for example, the first network device or the second network device in the above-mentioned method embodiment.

[0318] The network device 1000 includes a main control board 1010 and an interface board 1030 .

[0319] Main control board 1010, also known as the main processing unit (MPU) or route processor card, controls and manages various components in network device 1000, including routing calculations, device management, device maintenance, and protocol processing. Main control board 1010 includes a central processing unit (CPU) 1011 and memory 1012.

[0320] Interface board 1030 is also known as a line processing unit (LPU), line card, or service board. It provides various service interfaces and implements data packet forwarding. Service interfaces include, but are not limited to, Ethernet interfaces and POS (Packet over SONET / SDH) interfaces. Ethernet interfaces, for example, are Flexible Ethernet Clients (FlexE Clients). Interface board 1030 includes a central processing unit (CPU) 1031, a network processor (NPU) 1032, a forwarding table memory 1034, and a physical interface card (PIC) 1033.

[0321] The central processing unit 1031 on the interface board 1030 is used to control and manage the interface board 1030 and communicate with the central processing unit 1011 on the main control board 1010 .

[0322] The network processor 1032 is used to implement packet forwarding processing. The network processor 1032 can be in the form of a forwarding chip. Specifically, the processing of uplink packets includes: processing of the packet input interface and forwarding table lookup; the processing of downlink packets includes forwarding table lookup, etc.

[0323] The physical interface card 1033 implements the physical layer interconnection function. Raw traffic enters the interface board 1030 through this card, and processed messages are sent from this physical interface card 1033. The physical interface card 1033 includes at least one physical interface, also known as a physical port. Physical interface card 1033, also known as a daughter card, can be installed on the interface board 1030. It is responsible for converting optical and electrical signals into messages, performing a validity check on the messages, and forwarding them to the network processor 1032 for processing. In some embodiments, the central processing unit 1031 of the interface board 1003 can also perform the functions of the network processor 1032, such as implementing software forwarding based on a general-purpose CPU, thus eliminating the need for the network processor 1032 in the physical interface card 1033.

[0324] Optionally, the network device 1000 includes multiple interface boards. For example, the network device 1000 further includes an interface board 1040 . The interface board 1040 includes a central processing unit 1041 , a network processor 1042 , a forwarding table entry memory 1044 , and a physical interface card 1043 .

[0325] Optionally, the network device 1000 further includes a switching fabric board 1020. The switching fabric board 1020 may also be referred to as a switch fabric unit (SFU). If the network device includes multiple interface boards 1030, the switching fabric board 1020 is used to exchange data between the interface boards. For example, the interface board 1030 and the interface board 1040 can communicate via the switching fabric board 1020.

[0326] The main control board 1010 and the interface board 1030 are coupled. For example, the main control board 1010, the interface board 1030, the interface board 1040, and the switching network board 1020 are connected to the system backplane via a system bus to achieve intercommunication. In one possible implementation, an inter-process communication (IPC) channel is established between the main control board 1010 and the interface board 1030, and communication between the main control board 1010 and the interface board 1030 is performed via the IPC channel.

[0327] Logically, network device 1000 includes a control plane and a forwarding plane. The control plane includes a main control board 1010 and a central processing unit 1031. The forwarding plane includes various components that perform forwarding, such as a forwarding table entry memory 1034, physical interface cards 1033, and a network processor 1032. The control plane performs routing functions, generates forwarding tables, processes signaling and protocol messages, and configures and maintains device status. The control plane sends the generated forwarding tables to the forwarding plane. On the forwarding plane, the network processor 1032 forwards messages received by the physical interface card 1033 based on the forwarding tables sent by the control plane. The forwarding tables sent by the control plane can be stored in the forwarding table entry memory 1034. In some embodiments, the control plane and forwarding plane can be completely separate and not located on the same device.

[0328] It should be understood that the operations on the interface board 1040 in the embodiment of the present application are consistent with the operations on the interface board 1030. For the sake of brevity, detailed description is omitted. It should be understood that the network device 1000 in this embodiment may correspond to the first network device in each of the above-mentioned method embodiments. The main control board 1010, interface board 1030, and / or interface board 1040 in the network device 1000 may implement the various steps in each of the above-mentioned method embodiments. For the sake of brevity, detailed description is omitted here.

[0329] It should be understood that there may be one or more main control boards, and when there are multiple boards, they may include a primary main control board and a backup main control board. There may be one or more interface boards. The stronger the data processing capability of the network device, the more interface boards are provided. There may also be one or more physical interface cards on the interface board. There may be no switching network board, or there may be one or more switching network boards. When there are multiple switching network boards, they can jointly achieve load sharing and redundant backup. In a centralized forwarding architecture, the network device may not need a switching network board, and the interface board is responsible for processing the business data of the entire system. In a distributed forwarding architecture, the network device can have at least one switching network board, which realizes data exchange between multiple interface boards through the switching network board, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of network devices with a distributed architecture are greater than those of devices with a centralized architecture. Alternatively, a network device can consist of a single card, without a switching fabric board (SFB), integrating the functions of the interface board and the main control board. In this case, the CPUs on the interface board and the main control board can be combined into a single CPU, performing the combined functions of the two. This type of device has lower data exchange and processing capabilities (for example, low-end network devices such as switches or routers). The specific architecture used depends on the specific network deployment scenario.

[0330] In some possible embodiments, the above-mentioned network device can be implemented as a virtualized device. For example, the virtualized device can be a virtual machine (VM) running a program for sending message functions, and the virtual machine is deployed on a hardware device (for example, a physical server). A virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment. The virtual machine can be configured as a network device. For example, a network device can be implemented based on a general physical server in combination with network function virtualization (NFV) technology. The network device is a virtual host, a virtual router or a virtual switch. Those skilled in the art can virtualize a network device with the above-mentioned functions on a general physical server in combination with NFV technology by reading this application, and will not be repeated here.

[0331] It should be understood that the network devices in the various product forms described above have any functions of the first network device or the second network device in the above method embodiments, which will not be described in detail here.

[0332] The present application also provides a chip including a processor and an interface circuit, wherein the interface circuit is configured to receive instructions and transmit them to the processor; the processor, for example, may be a specific implementation of the processing unit in the apparatus 800 shown in FIG16 , and may be configured to execute the above-described method. The processor is coupled to a memory configured to store programs or instructions. When the programs or instructions are executed by the processor, the chip system implements the method in any of the above-described method embodiments.

[0333] Optionally, there may be one or more processors in the chip system. The processor may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.

[0334] Optionally, the memory in the chip system may be one or more memories. The memory may be integrated with the processor or may be provided separately from the processor, which is not limited in this application. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or provided on different chips. This application does not specifically limit the type of memory or the configuration of the memory and the processor.

[0335] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.

[0336] An embodiment of the present application further provides a network device system, including a first network device and a second network device, wherein the first network device executes the relevant methods corresponding to S301-S302 of the above embodiments; and the second network device executes the relevant method corresponding to S303 of the above embodiments.

[0337] The embodiments of the present application also provide a computer-readable storage medium, including instructions or computer programs, which, when executed on a computer, enable the computer to execute the methods provided in the above embodiments.

[0338] The embodiments of the present application also provide a computer program product comprising instructions or a computer program, which, when executed on a computer, enables the computer to execute the method provided in the above embodiments.

[0339] The terms "first," "second," "third," "fourth," and the like (if any) in the specification and claims of this application and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0340] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0341] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical business division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0342] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0343] In addition, each business unit in each embodiment of the present application can be integrated into a processing unit, each unit can exist physically separately, or two or more units can be integrated into a single unit. The above-mentioned integrated units can be implemented in the form of hardware or software business units.

[0344] If the integrated unit is implemented in the form of a software business unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0345] Those skilled in the art will appreciate that, in one or more of the examples above, the services described herein may be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these services may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of computer programs from one location to another. Storage media may be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0346] The above specific implementation methods further describe in detail the purpose, technical solutions and beneficial effects of this application. It should be understood that the above are only specific implementation methods of this application.

[0347] 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 sending verification information, It is characterized in that The method comprises: The first network device obtains verification information of the first autonomous domain AS to which it belongs and a neighbor AS of the second AS used for verification, where the neighbor AS is the previous hop of the second AS in the direction from the first AS to the second AS; The first network device sends the verification information and the neighbor AS to the second AS.

2. The method according to claim 1, It is characterized in that The first network device obtains a neighbor AS of the second AS for verification, including: The first network device acquires a first AS path with the first AS as an endpoint, where the first AS path includes the second AS; The first network device acquires a neighbor AS of the second AS based on the first AS path.

3. The method according to claim 2, It is characterized in that The first network device obtains a neighbor AS of the second AS for verification, including: The first network device obtains a second AS path with the first AS as an endpoint, where the second AS path includes the second AS, and the second AS path is a backup path or a load sharing path of the first AS path.

4. The method according to claim 1, It is characterized in that The first network device obtains a neighbor AS of the second AS for verification, including: The first network device receives the neighbor AS of the second AS sent by the border network device in the first AS. The neighbor AS of the second AS sent by the border network device in the first AS is the AS determined by the border network device in the first AS according to its own routing table, redirection path or AS topology library, and the AS topology library includes the identifiers of ASs with neighbor relationships.

5. The method according to claim 4, It is characterized in that The first network device receives a neighbor AS of the second AS sent by a border network device in the first AS, including: The first network device receives a first message sent by a border network device in the first AS, where the first message includes an identifier of the second AS and an identifier of the neighbor AS.

6. The method according to claim 5, It is characterized in that The first message also includes a first sequence number and an identifier of a border network device in the first AS. Before the first network device sends the verification information and the neighbor AS to the second AS, the method further includes: The first network device obtains the second serial number based on an identifier of a border network device in the first AS and a first corresponding relationship, where the first corresponding relationship includes an identifier of the border network device of the first AS and the second serial number; The first network device determines that the first sequence number is greater than the second sequence number.

7. The method according to claim 1, It is characterized in that The first network device obtains a neighbor AS corresponding to the second AS for verification, including: The first network device obtains a neighbor AS of the second AS according to its own routing table and / or redirection path.

8. The method according to any one of claims 1 to 7, It is characterized in that The first network device is a controller, a route reflector RR or a border network device.

9. The method according to any one of claims 1 to 8, It is characterized in that The first network device sending the verification information and the neighbor AS to the second AS includes: The first network device obtains an address of a second network device in the second AS, where the second network device is a controller, a RR, or a border network device; The first network device sends the verification information and the neighbor AS to the second network device according to the address of the second network device.

10. The method according to claim 9, It is characterized in that The verification information includes an identifier of the first AS, and the first network device sends the verification information and the neighbor AS to the second network device according to the address of the second network device, including: The first network device sends a second message to the second network device, where the second message includes the identifier of the first AS and the identifier of the neighbor AS.

11. The method according to claim 10, It is characterized in that The second message also includes a third sequence number and an identifier of the first network device.

12. The method according to claim 9, It is characterized in that The first network device sending the verification information and the neighbor AS to the second network device according to the address of the second network device includes: The first network device sends a third message to the second network device, where the third message includes the identifier of the first AS, the identifier of the second AS, and the identifier of the neighbor AS.

13. The method according to claim 12, It is characterized in that The originating AS identification field in the third message includes the identification of the first AS, the verification AS identification field in the third message includes the identification of the second AS, and the neighbor AS identification field in the third message includes the identification of the neighbor AS.

14. The method according to any one of claims 1 to 13, It is characterized in that The method further comprises: The first network device obtains the identifier of the second AS and the address of the next hop, where the next hop is one of a controller in the second AS, a border network device in the second AS, or a route reflector in the second AS.

15. The method according to any one of claims 1 to 14, It is characterized in that The verification information includes at least one of a source prefix corresponding to the first AS and an identifier of the first AS.

16. The method according to claim 1, It is characterized in that The method further comprises: The first network device obtains an identifier of a third AS, where the third AS is a downstream AS of the first AS; The first network device sends the identifier of the third AS to the target AS, where the target AS includes the second AS and / or a neighbor AS of the first AS.

17. The method according to claim 16, It is characterized in that The first network device obtains the identifier of the third AS, including: The first network device obtains the identifier of the third AS based on the first AS set and the second AS set, the first AS set includes the identifier of the AS historically received by the first network device and the identifier of the first AS, the second AS set includes the identifier of the AS that the first network device has sent to the target AS, the first AS set includes the identifier of the third AS and the second AS set does not include the identifier of the third AS.

18. The method according to claim 16 or 17, It is characterized in that The first network device sending the identifier of the third AS to the target AS includes: The first network device obtains and sends a fourth message to the target AS, the fourth message including the identifier of the third AS and the attributes of the third AS, the attributes of the third AS including at least one of the source of the identifier of the third AS, the destination of the identifier of the third AS, a reason type, and a connection relationship flag, the reason type indicating the reason why the identifier of the third AS was not announced in a historical time period, and the connection relationship flag indicating the connection relationship between the third AS and the first AS.

19. The method according to claim 18, It is characterized in that The fourth message includes a BGP undate message, the BGP undate message includes a multi-protocol reachability network layer routing information MP_REACH_NLRI field, the MP_REACH_NLRI field includes an address family identifier, a sub-address family identifier and a network layer routing information NLRI field, the address family identifier or the sub-address family identifier is used to indicate the generation of a verification table entry or the notification AS, the NLRI field includes the identifier of the third AS and the attributes of the third AS, and the NLRI field is encapsulated in an inner layer of the address family identifier or the sub-address family identifier; or The fourth message includes a BGP route-refresh message, and the BGP route-refresh message includes an address family identifier, a sub-address family identifier, an identifier of the third AS, and attributes of the third AS. The address family identifier or the sub-address family identifier is used to indicate generation of a verification table entry or notification AS.

20. A method for obtaining a verification table item, It is characterized in that The method comprises: A second network device in a second AS for verification receives verification information of the first AS and a neighbor AS of the second AS sent by a first network device in the first AS; The second network device obtains a first verification table entry based on the verification information and the neighbor AS, where the first verification table entry includes a source prefix corresponding to the first AS and an inbound interface for communicating with the neighbor AS.

21. The method according to claim 20, It is characterized in that The verification information includes an identifier of the first AS, and the second network device receives the verification information of the first AS and a neighbor AS of the second AS sent by the first network device in the first AS, including: The second network device receives a second message sent by the first network device in the first AS, where the second message includes an identifier of the first AS and an identifier of the neighbor AS.

22. The method according to claim 21, It is characterized in that The second message further includes a third sequence number and an identifier of the first network device. Before the second network device obtains the first verification table entry based on the verification information and the neighbor AS, the method further includes: The second network device obtains a fourth serial number based on the identifier of the first AS, the identifier of the first network device, and a second corresponding relationship, where the second corresponding relationship includes the identifier of the first AS, the identifier of the first network device, and the fourth serial number; The second network device determines that the third sequence number is greater than the fourth sequence number.

23. The method according to claim 20, It is characterized in that The method further comprises: The second network device sends the verification information and the neighbor AS to a border network device in the second AS.

24. The method according to claim 20 or 23, It is characterized in that The verification information includes the source prefix, and the second network device obtains a first verification table entry based on the verification information and the neighbor AS, including: The second network device obtains the AS to which the third network device communicating with the interface belongs; If the AS to which the third network device belongs is the neighboring AS, the second network device determines that the interface is the inbound interface; The second network device obtains the first verification entry based on the source prefix and the inbound interface.

25. The method according to any one of claims 20 to 24, It is characterized in that The verification information includes an identifier of the first AS, and the second network device obtains a first verification entry based on the verification information and the neighbor AS, including: The second network device obtains the AS to which the third network device communicating with the interface belongs; If the AS to which the third network device belongs is the neighboring AS, the second network device determines that the interface is the inbound interface; The second network device obtains the source prefix based on the identifier of the first AS and a corresponding relationship, where the corresponding relationship includes the identifier of the first AS and the source prefix; The second network device obtains the first verification entry based on the source prefix and the inbound interface.

26. The method according to any one of claims 20 to 25, It is characterized in that The method further comprises: The second network device receives a service message, wherein the service message includes a source Internet Protocol IP address; The second network device determines the legitimacy of the service message according to the first verification table entry, the source IP address, and the interface for receiving the service message.

27. The method according to claim 20, It is characterized in that The method further comprises: The second network device receives an identifier of a third AS from the first network device, where the third AS is a downstream AS of the first AS; The second network device obtains a second verification entry based on the identifier of the third AS, where the second verification entry includes an address prefix corresponding to the third AS and an inbound interface of the second AS used to communicate with the third AS.

28. A verification information sending device, It is characterized in that The device is provided in a first network device, and comprises: A processing unit, configured to obtain verification information of a first autonomous domain AS to which it belongs and a neighbor AS of a second AS used for verification, wherein the neighbor AS is a previous hop of the second AS in a direction from the first AS to the second AS; A sending unit is used to send the verification information and the neighbor AS to the second AS.

29. The device according to claim 28, It is characterized in that The processing unit is specifically used for: Acquire a first AS path with the first AS as an endpoint, where the first AS path includes the second AS; A neighbor AS of the second AS is acquired based on the first AS path.

30. The device according to claim 29, It is characterized in that The processing unit is specifically configured to obtain a second AS path with the first AS as an endpoint, where the second AS path includes the second AS, and the second AS path is a backup path or a load sharing path of the first AS path.

31. The device according to claim 28, It is characterized in that The processing unit is specifically used to receive the neighbor AS of the second AS sent by the border network device in the first AS, and the neighbor AS of the second AS sent by the border network device in the first AS is the AS determined by the border network device in the first AS according to its own routing table and / or redirection path.

32. The device according to claim 31, It is characterized in that The processing unit is specifically configured to receive a first message sent by a border network device in the first AS, where the first message includes an identifier of the second AS and an identifier of the neighbor AS.

33. The device according to claim 32, It is characterized in that The first message also includes a first sequence number and an identifier of a border network device in the first AS, and the processing unit is further configured to obtain the second sequence number based on the identifier of the border network device in the first AS and a first corresponding relationship, wherein the first corresponding relationship includes the identifier of the border network device of the first AS and the second sequence number; It is determined that the first sequence number is greater than the second sequence number.

34. The device according to claim 33, It is characterized in that The processing unit is specifically configured for the first network device to obtain a neighbor AS of the second AS according to its own routing table and / or redirection path.

35. The device according to any one of claims 28 to 34, It is characterized in that The first network device is a controller, a route reflector RR or a border network device.

36. The device according to any one of claims 28 to 35, It is characterized in that The sending unit is specifically used for: Obtain an address of a second network device in the second AS, where the second network device is a controller, a RR, or a border network device; The verification information and the neighbor AS are sent to the second network device according to the address of the second network device.

37. The device according to claim 36, It is characterized in that The verification information includes an identifier of the first AS, and the sending unit is used to send a second message to the second network device, where the second message includes the identifier of the first AS and the identifier of the neighbor AS.

38. The device according to claim 37, It is characterized in that The second message also includes a third sequence number and an identifier of the first network device.

39. The device according to claim 36, It is characterized in that The sending unit is further configured to send a third message to the second network device, wherein the third message includes an identifier of the first AS, an identifier of the second AS, and an identifier of the neighbor AS.

40. The device according to claim 39, It is characterized in that The originating AS identification field in the third message includes the identification of the first AS, the verification AS identification field in the third message includes the identification of the second AS, and the neighbor AS identification field in the third message includes the identification of the neighbor AS.

41. The device according to any one of claims 28 to 40, It is characterized in that The processing unit is further configured to obtain an identifier of the second AS and an address of a next hop, where the next hop is one of a controller in the second AS, a border network device in the second AS, or a route reflector in the second AS.

42. The device according to any one of claims 28 to 41, It is characterized in that The verification information includes at least one of a source prefix corresponding to the first AS and an identifier of the first AS.

43. The device according to claim 28, It is characterized in that The device also includes: The processing unit is further configured to obtain an identifier of a third AS, where the third AS is a downstream AS of the first AS; The sending unit is further configured to send the identifier of the third AS to the target AS, where the target AS includes the second AS and / or a neighbor AS of the first AS.

44. The device according to claim 43, It is characterized in that The processing unit is used to obtain the identifier of the third AS based on the first AS set and the second AS set, the first AS set includes the identifier of the AS historically received by the first network device and the identifier of the first AS, the second AS set includes the identifier of the AS that the first network device has sent to the target AS, the first AS set includes the identifier of the third AS and the second AS set does not include the identifier of the third AS.

45. The device according to claim 43 or 44, It is characterized in that The sending unit is used to obtain and send a fourth message to the target AS, wherein the fourth message includes the identifier of the third AS and the attributes of the third AS, and the attributes of the third AS include at least one of the source of the identifier of the third AS, the destination of the identifier of the third AS, a reason type, and a connection relationship flag, wherein the reason type indicates the reason why the identifier of the third AS was not notified in a historical time period, and the connection relationship flag indicates the connection relationship between the third AS and the first AS.

46. ​​The device according to claim 45, It is characterized in that The fourth message includes a BGP undate message, the BGP undate message includes a multi-protocol reachability network layer routing information MP_REACH_NLRI field, the MP_REACH_NLRI field includes an address family identifier, a sub-address family identifier and a network layer routing information NLRI field, the address family identifier or the sub-address family identifier is used to indicate the generation of a verification table entry or the notification AS, the NLRI field includes the identifier of the third AS and the attributes of the third AS, and the NLRI field is encapsulated in an inner layer of the address family identifier or the sub-address family identifier; or The fourth message includes a BGP route-refresh message, and the BGP route-refresh message includes an address family identifier, a sub-address family identifier, an identifier of the third AS, and attributes of the third AS. The address family identifier or the sub-address family identifier is used to indicate generation of a verification table entry or notification AS.

47. A verification entry acquisition device, It is characterized in that The device is provided in a second network device in a second AS for verification, and the device comprises: A receiving unit, configured to receive verification information of the first AS and a neighbor AS of the second AS sent by a first network device in the first AS; A processing unit is used to obtain a verification table entry based on the verification information and the neighbor AS, where the verification table entry includes a source prefix corresponding to the first AS and an inbound interface for communicating with the neighbor AS.

48. The device according to claim 47, It is characterized in that The verification information includes the identifier of the first AS, and the receiving unit is used for the second network device to receive a second message sent by the first network device in the first AS, and the second message includes the identifier of the first AS and the identifier of the neighbor AS.

49. The device according to claim 48, It is characterized in that The second message also includes a third sequence number and an identifier of the first network device. The processing unit is further used to obtain a fourth sequence number based on the identifier of the first AS, the identifier of the first network device and a second corresponding relationship, wherein the second corresponding relationship includes the identifier of the first AS, the identifier of the first network device and the fourth sequence number; and determine that the third sequence number is greater than the fourth sequence number.

50. The device according to claim 47, It is characterized in that The device also includes: A sending unit is used to send the verification information and the neighbor AS to the border network device in the second AS.

51. The device according to claim 47 or 50, It is characterized in that The verification information includes the source prefix, and the processing unit is specifically configured to: Obtaining the AS to which the third network device communicating with the interface belongs; If the AS to which the third network device belongs is the neighbor AS, determining that the interface is the inbound interface; The verification entry is obtained based on the source prefix and the inbound interface.

52. The device according to any one of claims 47 to 51, It is characterized in that The verification information includes an identifier of the first AS, and the processing unit is specifically configured to: Obtaining the AS to which the third network device communicating with the interface belongs; If the AS to which the third network device belongs is the neighbor AS, determining that the interface is the inbound interface; Obtaining the source prefix based on the identifier of the first AS and a corresponding relationship, where the corresponding relationship includes the identifier of the first AS and the source prefix; The verification entry is obtained based on the source prefix and the inbound interface.

53. The device according to any one of claims 47 to 52, It is characterized in that The receiving unit is further used to receive a service message, wherein the service message includes a source Internet Protocol IP address; The processing unit is further configured to determine the legitimacy of the service message according to the verification entry, the source IP address, and the interface for receiving the service message.

54. The device according to claim 47, It is characterized in that The receiving unit is further configured to receive an identifier of a third AS from the first network device, where the third AS is a downstream AS of the first AS; The processing unit is further configured to obtain a second verification entry based on the identifier of the third AS, where the second verification entry includes an address prefix corresponding to the third AS and an inbound interface of the second AS for communicating with the third AS.

Citation Information

Patent Citations

  • Verification information sending method, verification table item obtaining method, device and equipment

    CN116436648A

  • Verification information sending method, verification table item obtaining method, device and equipment

    CN118802247A

  • Distributed generation method and device of Internet inter-domain source address verification table

    CN112929269A

  • Actual IPv6 source address verification method based on autonomy system interconnecting relation

    CN1921394A

  • CN202311309136A