Route advertisement method, packet forwarding method, device, and system
By assigning the same VPN identifier to VPN routes with the same route prefix and RD but different next hops, the method enhances network transmission performance through fast route changes and load balancing, addressing the inefficiencies of the one-label-per-next-hop scheme in inter-AS VPN scenarios.
Patent Information
- Application Number
- JP2024519451
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-01-07
- Filing Date
- 2022-06-27
- Publication Date
- 2024-09-12
- Estimated Expiration
- Not applicable · inactive patent
Smart Images

Figure 2024533780000001
Abstract
Description
[Technical field]
[0001] This application claims priority to Chinese Patent Application No. 202111162731.2, entitled “Communication Method, Device and System for Supporting FRR in One Label Per Next Hop Manner in BGP,” filed with the State Intellectual Property Office of China on September 30, 2021, and Chinese Patent Application No. CN202210018493.6, entitled “Route Advertisement Method, Packet Forwarding Method, Device and System,” filed with the State Intellectual Property Office of China on January 7, 2022, both of which are incorporated herein by reference in their entireties. Technical Field The present application relates to the field of communications, and in particular to a route advertisement method, a packet forwarding method, a device, and a system. [Background technology]
[0002] With the expansion of virtual private network (VPN) application scenarios, VPNs need to be deployed across different autonomous system (AS) boundaries in a network. There are three common inter-AS methods, namely option A, option B, and option C. When option B is used, an autonomous system border router (ASBR) can obtain routes advertised by a provider edge (PE) device in the AS to which the ASBR belongs, or obtain routes advertised by an ASBR in another AS that is connected to the ASBR, and assign labels to the obtained routes. The ASBR advertises the routes obtained from the PE device to an ASBR in the other AS, or the ASBR advertises the routes obtained from an ASBR in the other AS to a PE device. Inter-AS data transmission can be performed based on the routes advertised by the ASBRs across those ASes.
[0003] In option B, the ASBR may assign labels to the obtained routes based on a one-label-per-next-hop scheme. The ASBR can assign the same label to routes with the same next hop, thereby saving label resources. However, in the one-label-per-next-hop label distribution scheme, when a network device is faulty, the network needs to perform route convergence again, and the speed of resuming normal network transmission is low. As a result, the network transmission quality is affected. Alternatively, when the amount of packets to be transmitted is large, it is difficult to quickly complete packet transmission. As a result, the network transmission quality is affected. Summary of the Invention [Problem to be solved by the invention]
[0004] The embodiments of the present application provide a route advertisement method, a packet forwarding method, a device, and a system that can support fast route changes or load balancing based on multiple VPN routes that have the same route prefix and the same RD but different next hops, and can improve the transmission performance of the network. [Means for solving the problem]
[0005] According to a first aspect, the present application provides a route advertisement method. The method is applied to a first network device. The first network device is a tunnel endpoint of a first tunnel, a tunnel endpoint of a second tunnel, and a tunnel endpoint of a third tunnel. The first network device communicates with a second network device through the first tunnel, communicates with a third network device through the second tunnel, and communicates with a fourth network device through the third tunnel. Specifically, the method includes the following steps: The first network device receives a first VPN route sent by the second network device and a second VPN route sent by the third network device. The first VPN route includes a first VPN identifier, a route prefix, an RD, and a first next hop. The first next hop is the second network device. The first VPN identifier is associated with the first VPN instance. The second VPN route includes a second VPN identifier, the route prefix, the RD, and a second next hop. The second next hop is a third network device. The second VPN identifier is associated with a second VPN instance. The first VPN instance and the second VPN instance are associated with the same VPN. The first VPN route and the second VPN route include the same route prefix and the same RD. The first VPN route and the second VPN route are routes that belong to the same VPN. In this way, fast rerouting or load balancing can be formed based on these VPN routes that belong to the same VPN.
[0006] The first network device assigns the same VPN identifier to received VPN routes having the same next hop and the same RD based on a one VPN identifier per next hop scheme. The first network device assigns a third VPN identifier to the first VPN route and the second VPN route. The first network device stores, on a forwarding plane, a first correspondence between the third VPN identifier and the first VPN identifier and a second correspondence between the third VPN identifier and the second VPN identifier. When forwarding a packet, the first network device can guide packet forwarding based on the first correspondence and the second correspondence. In a scenario where the first VPN route and the second VPN route form a fast route change, the first network device can quickly switch to using the first correspondence or the second correspondence to guide packet forwarding. In a scenario where the first VPN route and the second VPN route form a load balancing, the first network device can use the first correspondence and the second correspondence to guide packet forwarding.
[0007] The first network device advertises a third VPN route to a fourth network device. The third VPN route includes a third VPN identifier, the route prefix, the RD, and a third next hop. The third next hop is the first network device. The fourth network device can proceed to advertise a route based on the obtained third VPN route, and can forward the packet to the first network device based on the third VPN route.
[0008] In one possible implementation, the first correspondence may be stored in a first forwarding entry. The second correspondence may be stored in a second forwarding entry. The first forwarding entry and the second forwarding entry are entries for guiding packet forwarding. The first forwarding entry and the second forwarding entry may belong to a forwarding table. It should be noted that the forwarding table in this application is a table stored on a forwarding plane and for guiding packet forwarding in a broad sense. The specific type of the forwarding table is not limited in this application.
[0009] In another possible implementation, the first VPN identifier and the third VPN identifier may be stored in a plurality of forwarding tables. The first correspondence is formed based on the correspondence between the plurality of forwarding tables. Similarly, the second VPN identifier and the third VPN identifier may be stored in a plurality of forwarding tables. The second correspondence is formed based on the correspondence between the plurality of forwarding tables.
[0010] In some possible implementations, the first correspondence includes a correspondence between a third VPN identifier, the first VPN identifier, and the first outbound interface information. The second correspondence includes a correspondence between a third VPN identifier, the second VPN identifier, and the second outbound interface information. The first outbound interface information is associated with an outbound interface for forwarding packets including the first VPN identifier, i.e., an outbound interface connected to the first tunnel. The second outbound interface information is associated with an outbound interface for forwarding packets including the second VPN identifier, i.e., an outbound interface connected to the second tunnel. The first network device can determine a tunnel for transmitting the packet based on the first correspondence and the second correspondence.
[0011] In one example, the first outbound interface information may be a first tunnel identifier ID. The first tunnel ID identifies the first tunnel. The second outbound interface information may be a second tunnel identifier ID. The second tunnel ID identifies the second tunnel.
[0012] In another example, the first outbound interface information may be a first outbound interface identifier ID. The first outbound interface ID identifies an outbound interface of the first network device that is connected to the first tunnel. The second outbound interface information may be a second outbound interface identifier ID. The second outbound interface ID identifies an outbound interface of the first network device that is connected to the second tunnel.
[0013] In some possible implementations, the first VPN route, the second VPN route, and the third VPN route are Ethernet Virtual Private Network EVPN routes, Virtual Private Network Version 4 VPNv4 routes, or Virtual Private Network Version 6 VPNv6 routes.
[0014] In some possible implementations, the VPN identifier may specifically be an MPLS label or an SRv6 SID. The MPLS label may be an MPLS label defined in the MPLS technology, or may be an SID defined in the Segment Routing - Multiprotocol Label Switching (SR-MPLS) technology. The SID defined in the SR-MPLS technology is in the format of an MPLS label.
[0015] In one example, the first VPN identifier is a first MPLS label, the second VPN identifier is a second MPLS label, and the third VPN identifier is a third MPLS label.
[0016] In another example, the first VPN identifier is a first MPLS label, the second VPN identifier is a second MPLS label, and the third VPN identifier is a segment identifier (SRv6 SID) for segment routing over Internet Protocol version 6.
[0017] In yet another example, the first VPN identifier is a first SRv6 SID, the second VPN identifier is a second SRv6 SID, and the third VPN identifier is an MPLS label.
[0018] In yet another example, the first VPN identifier is a first SRv6 SID, the second VPN identifier is a second SRv6 SID, and the third VPN identifier is a third SRv6 SID.
[0019] In some possible implementations, the first network device receives a first packet sent by the fourth network device through the third tunnel. The first packet includes a third VPN identifier. The first network device can process the first packet based on the first correspondence to obtain a second packet including the first VPN identifier. The first network device sends the second packet to the second network device through the first tunnel.
[0020] In some possible implementations, the first VPN route and the second VPN route form a fast route change.
[0021] In one example, the first VPN route is an active route and the second VPN route is a standby route, and the first network device forwards the packet based on the active route.
[0022] In another example, the first VPN route and the second VPN route form a fast route change. The first VPN route is a standby route and the second VPN route is an active route. After receiving a first packet and before processing the first packet based on the first correspondence, the first network device determines that the active route is unreachable. The first network device forwards the first packet based on the standby route.
[0023] In some possible implementations, the first VPN route and the second VPN route form a load balancer. The first network device further receives a third packet sent by a fourth network device through a third tunnel. The third packet includes a third VPN identifier. The first network device processes the third packet based on the second correspondence to obtain a fourth packet. The fourth packet includes a second VPN identifier. The first network device transmits the fourth packet to the third network device through the second tunnel.
[0024] In some possible implementations, the first tunnel and the third tunnel form a stitching tunnel. The second tunnel and the third tunnel also form a stitching tunnel.
[0025] In some possible implementations, the first tunnel and the third tunnel form a stitching tunnel between the ASs. The second tunnel and the third tunnel form a stitching tunnel between the ASs.
[0026] In some possible implementations, the first network device is a first Autonomous System Border Router (ASBR), the fourth network device is a second ASBR, and an Exterior Border Gateway Protocol (EBGP) peer is established between the first ASBR and the second ASBR.
[0027] In some possible implementations, the first network device is a third ASBR, the fourth network device is a first provider edge PE device, and an Interior Border Gateway Protocol (IBGP) peer is established between the third ASBR and the first PE device.
[0028] In some possible implementations, the first network device is an extensible gateway xGW, the fourth network device is a second PE device, and an Interior Border Gateway Protocol IBGP peering is established between the xGW and the second PE device.
[0029] According to a second aspect, the present application provides a packet forwarding method. The method is applied to a first network device. The first network device is a tunnel endpoint of a first tunnel, a tunnel endpoint of a second tunnel, and a tunnel endpoint of a third tunnel. The first network device communicates with a second network device through the first tunnel, communicates with a third network device through the second tunnel, and communicates with a fourth network device through the third tunnel. A first correspondence between the first VPN identifier and the third VPN identifier, and a second correspondence between the second VPN identifier and the third VPN identifier are stored on a forwarding plane of the first network device. In a fast route change scenario, the first network device can quickly switch to using the first correspondence or the second correspondence to guide packet forwarding. In a load balancing scenario, the first network device can use the first correspondence and the second correspondence to guide packet forwarding.
[0030] The first network device obtains a first packet sent by the fourth network device, the first packet including a third VPN identifier. The first network device processes the first packet based on the first correspondence to obtain a second packet including the first VPN identifier. The first network device transmits the second packet to the second network device through the first tunnel.
[0031] In some possible implementations, a fast reroute can be formed based on the first tunnel and the second tunnel.
[0032] In one example, the first tunnel is an active tunnel and the second network device is an active next hop, the second tunnel is a standby tunnel and the third network device is a standby next hop.
[0033] In another example, the second tunnel is an active tunnel and the third network device is an active next hop. The first tunnel is a standby tunnel and the second network device is a standby next hop. When determining that the third network device is unreachable, the first network device forwards the packet by using the standby tunnel. Specifically, after the first network device obtains the first packet sent by the fourth network device and before the first network device obtains the second packet based on the first packet and the first correspondence, the first network device determines that the third network device is unreachable.
[0034] In some possible implementations, the first tunnel and the second tunnel form a load balancer.
[0035] The first network device further obtains a third packet including a third VPN identifier. The first network device processes the third packet based on the second correspondence to obtain a fourth packet including the second VPN identifier. The first network device transmits the fourth packet to the third network device through the second tunnel.
[0036] In one possible implementation, the first correspondence may be stored in a first forwarding entry. The second correspondence may be stored in a second forwarding entry. The first forwarding entry and the second forwarding entry are entries for guiding packet forwarding. The first forwarding entry and the second forwarding entry may belong to a forwarding table. It should be noted that the forwarding table in this application is a table stored on a forwarding plane and for guiding packet forwarding in a broad sense. The specific type of the forwarding table is not limited in this application.
[0037] In another possible implementation, the first VPN identifier and the third VPN identifier may be stored in a plurality of forwarding tables. The first correspondence is formed based on the correspondence between the plurality of forwarding tables. Similarly, the second VPN identifier and the third VPN identifier may be stored in a plurality of forwarding tables. The second correspondence is formed based on the correspondence between the plurality of forwarding tables.
[0038] In some possible implementations, the first correspondence includes a correspondence between a third VPN identifier, the first VPN identifier, and the first outbound interface information. The second correspondence includes a correspondence between a third VPN identifier, the second VPN identifier, and the second outbound interface information. The first outbound interface information is associated with an outbound interface for forwarding packets including the first VPN identifier, i.e., an outbound interface connected to the first tunnel. The second outbound interface information is associated with an outbound interface for forwarding packets including the second VPN identifier, i.e., an outbound interface connected to the second tunnel. The first network device can determine a tunnel for transmitting the packet based on the first correspondence and the second correspondence.
[0039] In one example, the first outbound interface information may be a first tunnel identifier ID. The first tunnel ID identifies the first tunnel. The second outbound interface information may be a second tunnel identifier ID. The second tunnel ID identifies the second tunnel.
[0040] In another example, the first outbound interface information may be a first outbound interface identifier ID. The first outbound interface ID identifies an outbound interface of the first network device that is connected to the first tunnel. The second outbound interface information may be a second outbound interface identifier ID. The second outbound interface ID identifies an outbound interface of the first network device that is connected to the second tunnel.
[0041] In some possible implementations, the first VPN route, the second VPN route, and the third VPN route are Ethernet Virtual Private Network EVPN routes, Virtual Private Network Version 4 VPNv4 routes, or Virtual Private Network Version 6 VPNv6 routes.
[0042] In some possible implementations, the VPN identifier may specifically be an MPLS label or an SRv6 SID. The MPLS label may be an MPLS label defined in the MPLS technology, or may be an SID defined in the Segment Routing - Multiprotocol Label Switching (SR-MPLS) technology. The SID defined in the SR-MPLS technology is in the format of an MPLS label.
[0043] In one example, the first VPN identifier is a first MPLS label, the second VPN identifier is a second MPLS label, and the third VPN identifier is a third MPLS label.
[0044] In another example, the first VPN identifier is a first MPLS label, the second VPN identifier is a second MPLS label, and the third VPN identifier is a segment identifier (SRv6 SID) for segment routing over Internet Protocol version 6.
[0045] In yet another example, the first VPN identifier is a first SRv6 SID, the second VPN identifier is a second SRv6 SID, and the third VPN identifier is an MPLS label.
[0046] In yet another example, the first VPN identifier is a first SRv6 SID, the second VPN identifier is a second SRv6 SID, and the third VPN identifier is a third SRv6 SID.
[0047] In some possible implementations, the first packet and the second packet may be MPLS packets.
[0048] Specifically, the first network device removes a third VPN identifier included in the first packet based on the first correspondence. The first network device encapsulates the first VPN identifier in a packet obtained by removing the third VPN identifier to obtain a second packet including the first VPN identifier. The first VPN identifier is an MPLS label.
[0049] In some possible implementations, the first packet and the second packet may be SRv6 packets.
[0050] Specifically, the third VPN identifier is a destination address of the first packet. The first network device replaces the destination address of the first packet with the first VPN identifier based on the first correspondence to obtain a second packet including the first VPN identifier. The first VPN identifier is an SRv6 SID.
[0051] In some possible implementations, the first packet may be an MPLS packet and the second packet may be an SRv6 packet.
[0052] Specifically, the first network device decapsulates the first packet, removes the MPLS packet header, and performs segment routing over Internet Protocol version 6 (SRv6) encapsulation on the decapsulated packet to obtain a second packet. The second packet is an SRv6 packet. The second packet includes a first VPN identifier. The first VPN identifier is an SRv6 segment identifier SID.
[0053] In some possible implementations, the first packet may be an SRv6 packet and the second packet may be an MPLS packet.
[0054] Specifically, the first network device decapsulates the first packet, removes the IPv6 packet header, and performs MPLS encapsulation on the decapsulated packet to obtain a second packet. The second packet may be an MPLS packet. The second packet includes a first VPN identifier. The first VPN identifier is an MPLS label.
[0055] Similarly, in some possible implementations, the third packet and the fourth packet may be MPLS packets.
[0056] Specifically, the first network device removes a third VPN identifier included in the third packet based on the second correspondence. The first network device encapsulates the second VPN identifier in a packet obtained by removing the third VPN identifier to obtain a fourth packet including the second VPN identifier. The second VPN identifier is an MPLS label.
[0057] In some possible implementations, the third packet and the fourth packet may be SRv6 packets.
[0058] Specifically, the third VPN identifier is a destination address of the third packet. The first network device replaces the destination address of the third packet with the second VPN identifier based on the second correspondence to obtain a fourth packet including the second VPN identifier. The second VPN identifier is an SRv6 SID.
[0059] In some possible implementations, the third packet may be an MPLS packet and the fourth packet may be an SRv6 packet.
[0060] Specifically, the first network device decapsulates the third packet, removes the MPLS packet header, and performs segment routing over Internet Protocol version 6 (SRv6) encapsulation on the decapsulated packet to obtain a fourth packet. The fourth packet is an SRv6 packet. The fourth packet includes a second VPN identifier. The second VPN identifier is an SRv6 segment identifier SID.
[0061] In some possible implementations, the third packet may be an SRv6 packet and the fourth packet may be an MPLS packet.
[0062] Specifically, the first network device decapsulates the third packet, removes the IPv6 packet header, and performs MPLS encapsulation on the decapsulated packet to obtain a fourth packet. The fourth packet may be an MPLS packet. The fourth packet includes a second VPN identifier. The second VPN identifier is an MPLS label.
[0063] In some possible implementations, the first correspondence includes a correspondence between a third VPN identifier, the first VPN identifier, and the first outbound interface information. The second correspondence includes a correspondence between a third VPN identifier, the second VPN identifier, and the second outbound interface information. The first outbound interface information is associated with an outbound interface for forwarding packets including the first VPN identifier. The second outbound interface information is associated with an outbound interface for forwarding packets including the second VPN identifier. The first network device can determine a tunnel and / or an outbound interface for transmitting the packet based on the first correspondence and the second correspondence.
[0064] In one example, the first outbound interface information may be a first tunnel identifier ID. The first tunnel ID identifies the first tunnel. The second outbound interface information may be a second tunnel identifier ID. The second tunnel ID identifies the second tunnel.
[0065] In another example, the first outbound interface information may be a first outbound interface identifier ID. The first outbound interface ID identifies an outbound interface of the first network device that is connected to the first tunnel. The second outbound interface information may be a second outbound interface identifier ID. The second outbound interface ID identifies an outbound interface of the first network device that is connected to the second tunnel.
[0066] In some possible implementations, the first tunnel and the third tunnel form a suture tunnel. The second tunnel and the third tunnel form a suture tunnel.
[0067] In some possible implementations, the first tunnel and the third tunnel form a stitching tunnel between the ASs. The second tunnel and the third tunnel form a stitching tunnel between the ASs.
[0068] In some possible implementations, the first network device is a first Autonomous System Border Router (ASBR), the fourth network device is a second ASBR, and an Exterior Border Gateway Protocol (EBGP) peer is established between the first ASBR and the second ASBR.
[0069] In some possible implementations, the first network device is a third ASBR, the fourth network device is a first provider edge PE device, and an Interior Border Gateway Protocol (IBGP) peer is established between the third ASBR and the first PE device.
[0070] In some possible implementations, the first network device is an extensible gateway xGW, the fourth network device is a second PE device, and an Interior Border Gateway Protocol IBGP peering is established between the xGW and the second PE device.
[0071] According to a third aspect, the present application provides a network device for route advertisement, the network device being applied to a first network device, the network device including a transceiver module and a processing module.
[0072] The transceiver module is configured to receive a first virtual private network VPN route transmitted by a second network device and receive a second VPN route transmitted by a third network device, the first VPN route including a first VPN identifier, a route prefix, a route discriminator RD, and a first next hop, the first next hop being the second network device, the first network device communicating with the second network device through a first tunnel, the first network device communicating with a tunnel end of the first tunnel, a first VPN route including a first VPN identifier, a route prefix, an RD, and a second next hop, the second next hop being a third network device, the first network device communicating with the third network device through a second tunnel, the first network device being a tunnel endpoint of the second tunnel, the second VPN identifier being associated with the second VPN instance, and the first VPN instance and the second VPN instance being associated with the same VPN.
[0073] The processing module is configured to assign a third VPN identifier to the first VPN route and store a first correspondence between the third VPN identifier and the first VPN identifier on the forwarding plane, and assign a third VPN identifier to the second VPN route and store a second correspondence between the third VPN identifier and the second VPN identifier on the forwarding plane, and the first network device assigns the same VPN identifier to received VPN routes having the same next hop and the same RD based on a one VPN identifier per next hop scheme.
[0074] The transceiver module is further configured to advertise a third VPN route to the fourth network device, the third VPN route including a third VPN identifier, a route prefix, an RD, and a third next hop, the third next hop being the first network device, the first network device communicating with the fourth network device through the third tunnel, the first network device being a tunnel endpoint of the third tunnel.
[0075] In some possible implementations, the first correspondence includes a correspondence between a third VPN identifier, the first VPN identifier, and the first outbound interface information. The second correspondence includes a correspondence between a third VPN identifier, the second VPN identifier, and the second outbound interface information. The first outbound interface information is associated with an outbound interface for forwarding packets including the first VPN identifier. The second outbound interface information is associated with an outbound interface for forwarding packets including the second VPN identifier. The first network device can determine a tunnel for transmitting the packet based on the first correspondence and the second correspondence.
[0076] In one example, the first outbound interface information may be a first tunnel identifier ID. The first tunnel ID identifies the first tunnel. The second outbound interface information may be a second tunnel identifier ID. The second tunnel ID identifies the second tunnel.
[0077] In another example, the first outbound interface information may be a first outbound interface identifier ID. The first outbound interface ID identifies an outbound interface of the first network device that is connected to the first tunnel. The second outbound interface information may be a second outbound interface identifier ID. The second outbound interface ID identifies an outbound interface of the first network device that is connected to the second tunnel.
[0078] In some possible implementations, the first VPN route, the second VPN route, and the third VPN route are Ethernet Virtual Private Network EVPN routes, Virtual Private Network Version 4 VPNv4 routes, or Virtual Private Network Version 6 VPNv6 routes.
[0079] In some possible implementations, the first VPN identifier is a first MPLS label, the second VPN identifier is a second MPLS label, and the third VPN identifier is a third MPLS label.
[0080] In some possible implementations, the first VPN identifier is a first MPLS label, the second VPN identifier is a second MPLS label, and the third VPN identifier is a segment identifier (SRv6 SID) for Segment Routing over Internet Protocol version 6.
[0081] In some possible implementations, the first VPN identifier is a first SRv6 SID, the second VPN identifier is a second SRv6 SID, and the third VPN identifier is an MPLS label.
[0082] In some possible implementations, the first VPN identifier is a first SRv6 SID, the second VPN identifier is a second SRv6 SID, and the third VPN identifier is a third SRv6 SID.
[0083] In some possible implementations, the transceiver module is further configured to receive a first packet sent by the fourth network device through the third tunnel, the first packet including a third VPN identifier.
[0084] The processing module is further configured to process the first packet based on the first correspondence to obtain a second packet, the second packet including the first VPN identifier.
[0085] The transceiver module is further configured to transmit the second packet through the first tunnel to the second network device.
[0086] In some possible implementations, the first VPN route and the second VPN route form a fast route change.
[0087] In some possible implementations, the first VPN route is an active route and the second VPN route is a standby route.
[0088] In some possible implementations, the first VPN route and the second VPN route form a fast route change, the first VPN route is a standby route and the second VPN route is an active route, and the processing module is further configured to determine that the active route is unreachable after the receiving module receives the first packet and before the processing module processes the first packet based on the first correspondence.
[0089] In some possible implementations, the first VPN route and the second VPN route form a load balancer.
[0090] In some possible implementations, the first VPN route and the second VPN route form a load balancer, and the transceiver module is further configured to receive a third packet transmitted by a fourth network device through the third tunnel, the third packet including a third VPN identifier.
[0091] The processing module is further configured to process the third packet based on the second correspondence to obtain a fourth packet, the fourth packet including the second VPN identifier.
[0092] The transceiver module is further configured to transmit the fourth packet through the second tunnel to the third network device.
[0093] In some possible implementations, the first tunnel and the third tunnel form a suture tunnel.
[0094] In some possible implementations, the first tunnel and the third tunnel are suture tunnels between ASs.
[0095] In some possible implementations, the first network device is a first Autonomous System Border Router (ASBR), the fourth network device is a second ASBR, and an Exterior Border Gateway Protocol (EBGP) peer is established between the first ASBR and the second ASBR.
[0096] In some possible implementations, the first network device is a third ASBR, the fourth network device is a first provider edge PE device, and an Interior Border Gateway Protocol (IBGP) peer is established between the third ASBR and the first PE device.
[0097] In some possible implementations, the first network device is an extensible gateway xGW, the fourth network device is a second PE device, and an Interior Border Gateway Protocol IBGP peering is established between the xGW and the second PE device.
[0098] According to a fourth aspect, the present application provides a network device for packet forwarding, the network device being applied to a first network device, the network device including a transceiver module and a processing module.
[0099] The transceiver module is configured to obtain a first packet transmitted by a fourth network device, the first packet including a third VPN identifier, the first network device communicating with the fourth network device through a third tunnel, the first network device being a tunnel endpoint of the third tunnel, the first network device communicating with a second network device through the first tunnel, the first network device being a tunnel endpoint of the first tunnel, the first network device communicating with a third network device through a second tunnel, the first network device being a tunnel endpoint of the second tunnel, and a first correspondence between the first VPN identifier and the third VPN identifier and a second correspondence between the second VPN identifier and the third VPN identifier are stored on a forwarding plane of the first network device.
[0100] The processing module is configured to process the first packet based on the first correspondence to obtain a second packet, the second packet including the first VPN identifier.
[0101] The transceiver module is further configured to transmit the second packet through the first tunnel to the second network device.
[0102] In some possible implementations, the first tunnel and the second tunnel form a fast reroute.
[0103] In one example, the first tunnel is an active tunnel and the second tunnel is a standby tunnel.
[0104] In another example, the first tunnel is a standby tunnel and the second tunnel is an active tunnel.
[0105] In some possible implementations, the first tunnel is a standby tunnel and the second tunnel is an active tunnel. The processing module is further configured to determine that the third network device is unreachable after the receiving module obtains the first packet transmitted by the fourth network device and before obtaining the second packet based on the first packet and the first correspondence.
[0106] In some possible implementations, the first tunnel and the second tunnel form a load balancer.
[0107] The transceiver module is further configured to obtain a third packet, the third packet including a third VPN identifier.
[0108] The processing module is further configured to process the third packet based on the second correspondence to obtain a fourth packet, the fourth packet including the second VPN identifier.
[0109] The transceiver module is further configured to transmit the fourth packet to the third network device through the second tunnel, the first network device communicating with the third network device through the second tunnel, the first network device being a tunnel endpoint of the second tunnel.
[0110] In some possible implementations, the first packet is a Multiprotocol Label Switching (MPLS) packet, and the processing module is configured to process the first packet based on the first correspondence to obtain the second packet, including:
[0111] The processing module is configured to decapsulate the MPLS packet, remove the MPLS packet header, and perform segment routing over Internet Protocol version 6 (SRv6) encapsulation on the decapsulated packet to obtain a second packet, the second packet including a first VPN identifier, the first VPN identifier being an SRv6 segment identifier SID.
[0112] In some possible implementations, the first packet is an SRv6 packet, and the processing module is configured to process the first packet based on the first correspondence to obtain the second packet, including:
[0113] The processing module is configured to decapsulate the SRv6 packet, remove the IPv6 packet header, and perform MPLS encapsulation on the decapsulated packet to obtain a second packet, the second packet including the first VPN identifier, the first VPN identifier being an MPLS label.
[0114] In some possible implementations, the processing module being configured to process the first packet based on the first correspondence to obtain a second packet includes:
[0115] The processing module is configured to replace the third VPN identifier in the first packet with the first VPN identifier based on the first correspondence to obtain a second packet.
[0116] In some possible implementations, the first packet is an MPLS packet, and the processing module is configured to replace a third VPN identifier in the first packet with the first VPN identifier based on the first correspondence to obtain a second packet, including:
[0117] The processing module is configured to remove a third VPN identifier included in the first packet based on the first correspondence, and encapsulate the first VPN identifier in a packet obtained by removing the third VPN identifier to obtain a second packet, where the first VPN identifier is an MPLS label.
[0118] In some possible implementations, the first packet is an SRv6 packet, the third VPN identifier is a destination address of the SRv6 packet, and the processing module is configured to replace the third VPN identifier in the first packet with the first VPN identifier based on the first correspondence to obtain the second packet, including:
[0119] The first network device replaces a destination address of the SRv6 packet with the first VPN identifier based on the first correspondence to obtain a second packet, where the first VPN identifier is the SRv6 SID.
[0120] In some possible implementations, the first correspondence includes a correspondence between a third VPN identifier, the first VPN identifier, and the first outbound interface information. The second correspondence includes a correspondence between a third VPN identifier, the second VPN identifier, and the second outbound interface information. The first outbound interface information is associated with an outbound interface for forwarding packets including the first VPN identifier. The second outbound interface information is associated with an outbound interface for forwarding packets including the second VPN identifier. The first network device can determine a tunnel for transmitting the packet based on the first correspondence and the second correspondence.
[0121] In one example, the first outbound interface information may be a first tunnel identifier ID. The first tunnel ID identifies the first tunnel. The second outbound interface information may be a second tunnel identifier ID. The second tunnel ID identifies the second tunnel.
[0122] In another example, the first outbound interface information may be a first outbound interface identifier ID. The first outbound interface ID identifies an outbound interface of the first network device that is connected to the first tunnel. The second outbound interface information may be a second outbound interface identifier ID. The second outbound interface ID identifies an outbound interface of the first network device that is connected to the second tunnel.
[0123] According to a fifth aspect, the present application provides a network system, including a first network device, a second network device, a third network device, and a fourth network device. The first network device is a tunnel endpoint of a first tunnel, a tunnel endpoint of a second tunnel, and a tunnel endpoint of a third tunnel. The first network device communicates with the second network device through the first tunnel, communicates with the third network device through the second tunnel, and communicates with the fourth network device through the third tunnel.
[0124] The second network device is configured to send a first VPN route to the first network device, the first VPN route including a first VPN identifier, a route prefix, a route discriminator RD, and a first next hop, the first next hop being the second network device, and the first VPN identifier being associated with the first VPN instance.
[0125] The first network device is configured to receive a first virtual private network VPN route transmitted by the second network device.
[0126] The third network device is configured to send a second VPN route to the first network device, the second VPN route including a second VPN identifier, a route prefix, an RD, and a second next hop, the second next hop is the third network device, the second VPN identifier is associated with the second VPN instance, and the first VPN instance and the second VPN instance are associated with the same VPN.
[0127] The first network device is further configured to receive a second VPN route sent by the third network device.
[0128] The first network device is further configured to assign a third VPN identifier to the first VPN route and store a first correspondence between the third VPN identifier and the first VPN identifier in the forwarding plane, and assign a third VPN identifier to the second VPN route and store a second correspondence between the third VPN identifier and the second VPN identifier on the forwarding plane, where the first network device assigns the same VPN identifier to received VPN routes having the same next hop and the same RD based on a one VPN identifier per next hop scheme.
[0129] The first network device is further configured to advertise a third VPN route to the fourth network device, the third VPN route including a third VPN identifier, a route prefix, an RD, and a third next hop, the third next hop being the first network device.
[0130] The fourth network device is configured to obtain the third VPN route sent by the first network device.
[0131] In some possible implementations, the first correspondence includes a correspondence between a third VPN identifier, the first VPN identifier, and the first outbound interface information. The second correspondence includes a correspondence between a third VPN identifier, the second VPN identifier, and the second outbound interface information. The first outbound interface information is associated with an outbound interface for forwarding packets including the first VPN identifier. The second outbound interface information is associated with an outbound interface for forwarding packets including the second VPN identifier. The first network device can determine a tunnel for transmitting the packet based on the first correspondence and the second correspondence.
[0132] In one example, the first outbound interface information may be a first tunnel identifier ID. The first tunnel ID identifies the first tunnel. The second outbound interface information may be a second tunnel identifier ID. The second tunnel ID identifies the second tunnel.
[0133] In another example, the first outbound interface information may be a first outbound interface identifier ID. The first outbound interface ID identifies an outbound interface of the first network device that is connected to the first tunnel. The second outbound interface information may be a second outbound interface identifier ID. The second outbound interface ID identifies an outbound interface of the first network device that is connected to the second tunnel.
[0134] In some possible implementations, the first VPN route, the second VPN route, and the third VPN route are Ethernet Virtual Private Network EVPN routes, Virtual Private Network Version 4 VPNv4 routes, or Virtual Private Network Version 6 VPNv6 routes.
[0135] In some possible implementations, the first VPN identifier is a first MPLS label, the second VPN identifier is a second MPLS label, and the third VPN identifier is a third MPLS label.
[0136] In some possible implementations, the first VPN identifier is a first MPLS label, the second VPN identifier is a second MPLS label, and the third VPN identifier is a segment identifier (SRv6 SID) for Segment Routing over Internet Protocol version 6.
[0137] In some possible implementations, the first VPN identifier is a first SRv6 SID, the second VPN identifier is a second SRv6 SID, and the third VPN identifier is an MPLS label.
[0138] In some possible implementations, the first VPN identifier is a first SRv6 SID, the second VPN identifier is a second SRv6 SID, and the third VPN identifier is a third SRv6 SID.
[0139] In some possible implementations, the fourth network device is further configured to transmit the first packet to the first network device through the third tunnel, the first packet including the third VPN identifier.
[0140] The first network device is further configured to receive a first packet sent by the fourth network device through the third tunnel, process the first packet based on the first correspondence to obtain a second packet including the first VPN identifier, and send the second packet to the second network device through the first tunnel.
[0141] The second network device is further configured to obtain a second packet transmitted by the first network device through the first tunnel.
[0142] In some possible implementations, the first VPN route and the second VPN route form a fast route change.
[0143] In some possible implementations, the first VPN route is an active route and the second VPN route is a standby route.
[0144] In some possible implementations, the first VPN route and the second VPN route form a fast route change, the first VPN route being a standby route and the second VPN route being an active route.
[0145] After the first network device receives the first packet and before the first network device processes the first packet based on the first correspondence, the first network device is further configured to determine that the active route is unreachable.
[0146] In some possible implementations, the first VPN route and the second VPN route form a load balancer.
[0147] In some possible implementations, the first VPN route and the second VPN route form a load balancer.
[0148] The fourth network device is further configured to send a third packet to the first network device through the third tunnel, the third packet including a third VPN identifier.
[0149] The first network device is further configured to receive a third packet sent by the fourth network device through the third tunnel, process the third packet based on the second correspondence to obtain a fourth packet including the second VPN identifier, and send the fourth packet to the third network device through the second tunnel.
[0150] The third network device is further configured to receive a fourth packet transmitted by the first network device through the second tunnel.
[0151] In some possible implementations, the first tunnel and the third tunnel form a suture tunnel.
[0152] In some possible implementations, the first tunnel and the third tunnel form an inter-AS suture tunnel.
[0153] In some possible implementations, the first network device is a first Autonomous System Border Router (ASBR), the fourth network device is a second ASBR, and an Exterior Border Gateway Protocol (EBGP) peer is established between the first ASBR and the second ASBR.
[0154] In some possible implementations, the first network device is a third ASBR, the fourth network device is a first provider edge PE device, and an Interior Border Gateway Protocol (IBGP) peer is established between the third ASBR and the first PE device.
[0155] In some possible implementations, the first network device is an extensible gateway xGW, the fourth network device is a second PE device, and an Interior Border Gateway Protocol IBGP peering is established between the xGW and the second PE device.
[0156] According to a sixth aspect, the present application provides a network system. The network system includes a first network device, a second network device, a third network device, and a fourth network device. The first network device is a tunnel endpoint of a first tunnel, a tunnel endpoint of a second tunnel, and a tunnel endpoint of a third tunnel. The first network device communicates with the second network device through the first tunnel, communicates with the third network device through the second tunnel, and communicates with the fourth network device through the third tunnel.
[0157] The fourth network device is configured to transmit a first packet to the first network device, the first packet including the third VPN identifier.
[0158] The first network device is configured to process the first packet based on the first correspondence to obtain a second packet including the first VPN identifier, and to transmit the second packet through the first tunnel to the second network device.
[0159] In some possible implementations, the first tunnel and the second tunnel form a fast reroute.
[0160] In some possible implementations, the first tunnel is an active tunnel and the second tunnel is a standby tunnel.
[0161] In some possible implementations, the first tunnel is a standby tunnel and the second tunnel is an active tunnel.
[0162] In some possible implementations, after the first network device obtains the first packet transmitted by the fourth network device and before the first network device obtains the second packet based on the first packet and the first correspondence, the first network device is further configured to determine that the third network device is unreachable.
[0163] In some possible implementations, the first tunnel and the second tunnel form a load balancer.
[0164] The fourth network device is further configured to transmit a third packet including the third VPN identifier to the first network device.
[0165] The first network device is further configured to obtain a third packet including the third VPN identifier, process the third packet based on the second correspondence to obtain a fourth packet including the second VPN identifier, and transmit the fourth packet to the third network device through the second tunnel.
[0166] The third network device is further configured to receive a fourth packet through the second tunnel.
[0167] In some possible implementations, the first packet is a Multiprotocol Label Switching (MPLS) packet, and the first network device is configured to process the first packet based on the first correspondence to obtain a second packet, including:
[0168] The first network device is configured to decapsulate the MPLS packet, remove the MPLS packet header, and perform segment routing over Internet Protocol version 6 (SRv6) encapsulation on the decapsulated packet to obtain a second packet, the second packet including a first VPN identifier, the first VPN identifier being an SRv6 segment identifier SID.
[0169] In some possible implementations, the first packet is an SRv6 packet, and the first network device is configured to process the first packet based on the first correspondence to obtain a second packet, including:
[0170] The first network device is configured to decapsulate the SRv6 packet, remove the IPv6 packet header, and perform MPLS encapsulation on the decapsulated packet to obtain a second packet, the second packet including the first VPN identifier, where the first VPN identifier is an MPLS label.
[0171] In some possible implementations, the first network device being configured to process the first packet based on the first correspondence to obtain a second packet includes:
[0172] The first network device is configured to replace the third VPN identifier in the first packet with the first VPN identifier based on the first correspondence to obtain a second packet.
[0173] In some possible implementations, the first packet is an MPLS packet, and the first network device is configured to replace a third VPN identifier in the first packet with the first VPN identifier based on the first correspondence to obtain a second packet, including:
[0174] The first network device is configured to remove a third VPN identifier included in the first packet based on the first correspondence, and encapsulate the first VPN identifier in a packet obtained by removing the third VPN identifier to obtain a second packet, wherein the second packet includes the first VPN identifier, and the first VPN identifier is an MPLS label.
[0175] In some possible implementations, the first packet is an SRv6 packet, the third VPN identifier is a destination address of the first packet, and the first network device is configured to replace the third VPN identifier in the first packet with the first VPN identifier based on the first correspondence to obtain a second packet, including:
[0176] The first network device is configured to replace a destination address of the first packet with a first VPN identifier based on the first correspondence to obtain a second packet, where the first VPN identifier is an SRv6 SID.
[0177] In some possible implementations, the first correspondence includes a correspondence between a third VPN identifier, a first VPN identifier, and a first tunnel identifier ID, where the first tunnel ID identifies the first tunnel, and the second correspondence includes a correspondence between a third VPN identifier, a second VPN identifier, and a second tunnel identifier ID, where the second tunnel ID identifies the second tunnel.
[0178] According to a seventh aspect, the present application provides a network device. The network device includes a processor and a memory. The memory is configured to store instructions or program code. The processor is configured to retrieve the instructions or program code from the memory and execute the instructions or program code to perform a method according to the first aspect or any one of the possible implementations of the first aspect, or a method according to the second aspect or any one of the possible implementations of the second aspect.
[0179] According to an eighth aspect, the present application provides a network system, the network system including a network device according to the third or fourth aspect.
[0180] According to a ninth aspect, the present application provides a computer-readable storage medium including instructions, programs, or codes, which when executed on a computer, enable the computer to perform a route advertisement method according to the first aspect or any one of the possible implementations of the first aspect, or a packet forwarding method according to the second aspect or any one of the possible implementations of the second aspect. [Brief description of the drawings]
[0181] [Figure 1] 1 is a schematic diagram of a network architecture according to an embodiment of the present application.
[0182] [Diagram 2] 1 is a schematic diagram of a network architecture according to an embodiment of the present application.
[0183] [Diagram 3] FIG. 2 is a schematic diagram of another network architecture according to an embodiment of the present application.
[0184] [Figure 4] FIG. 1 is a schematic diagram of a network architecture in scenario 1 according to an embodiment of the present application.
[0185] [Diagram 5] 1 is a schematic flowchart of a route advertisement method according to an embodiment of the present application;
[0186] [Figure 6a] 1 is a schematic flowchart of a packet forwarding method according to an embodiment of the present application;
[0187] [Figure 6b]4 is a schematic flowchart of another packet forwarding method according to an embodiment of the present application;
[0188] [Figure 7a] FIG. 2 is a schematic diagram of packet transmission according to an embodiment of the present application;
[0189] [Figure 7b] FIG. 2 is another schematic diagram of packet transmission according to an embodiment of the present application;
[0190] [Figure 7c] FIG. 2 is yet another schematic diagram of packet transmission according to an embodiment of the present application;
[0191] [Figure 7d] FIG. 2 is yet another schematic diagram of packet transmission according to an embodiment of the present application;
[0192] [Figure 8] FIG. 1 is a schematic diagram of a network architecture in scenario 2 according to an embodiment of the present application.
[0193] [Figure 9] FIG. 1 is a schematic diagram of a network architecture in scenario 3 according to an embodiment of the present application.
[0194] [Figure 10] 4 is a schematic flowchart of another route advertisement method according to an embodiment of the present application;
[0195] [Figure 11a] 1 is a schematic flowchart of a packet forwarding method according to an embodiment of the present application;
[0196] [Figure 11b] 4 is a schematic flowchart of another packet forwarding method according to an embodiment of the present application;
[0197] [Figure 12]FIG. 1 is a schematic diagram of a network architecture in scenario 4 according to an embodiment of the present application.
[0198] [Figure 13] 1 is a schematic flowchart of a route advertisement method according to an embodiment of the present application;
[0199] [Figure 14a] 1 is a schematic flowchart of a packet forwarding method according to an embodiment of the present application;
[0200] [Figure 14b] 4 is a schematic flowchart of another packet forwarding method according to an embodiment of the present application;
[0201] [Figure 15] 1 is a schematic flowchart of a route advertisement method according to an embodiment of the present application;
[0202] [Figure 16a] 1 is a schematic flowchart of a packet forwarding method according to an embodiment of the present application;
[0203] [Figure 16b] 4 is a schematic flowchart of another packet forwarding method according to an embodiment of the present application;
[0204] [Figure 17] A schematic diagram of the structure of a network device according to an embodiment of the present application.
[0205] [Figure 18] A schematic diagram of the structure of a network device according to an embodiment of the present application.
[0206] [Figure 19] A schematic diagram of the structure of a network system according to an embodiment of the present application.
[0207] [Figure 20]1 is a schematic diagram of the structure of a device according to an embodiment of the present application.
[0208] [Figure 21] 1 is a schematic diagram of the structure of a device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0209] To meet the requirements of inter-AS VPN deployment, in traditional multiprotocol label switching (MPLS) VPN scenarios, there are mainly three inter-AS methods for VPN, namely, option A, option B, and option C. In the option B solution, the AS BR can forward all VPN routes through one link, and there is no need for an interface or VPN instance to be allocated for each VPN route. It is simple to configure.
[0210] FIG. 1 is a schematic diagram of a network architecture according to an embodiment of the present application.
[0211] The network in Figure 1 includes AS 1 and AS 2. AS 1 includes PE 1, PE 2, ASBR 1, and ASBR 2. PE 1 and PE 2 are connected to customer edge (CE) 1 in VPN 1. An interior border gateway protocol (IBGP) peer is established between PE 1 and ASBR 1. An IBGP peer is established between PE 2 and each of ASBR 1 and ASBR 2. An IBGP peer is established between ASBR 1 and ASBR 2.
[0212] AS 2 includes PE 3, PE 4, ASBR 3, and ASBR 4. PE 3 and PE 4 are connected to CE 2 in VPN 1. An IBGP peer is established between ASBR 3 and PE 3. An IBGP peer is established between ASBR 4 and PE 4. An external border gateway protocol (EBGP) peer is established between ASBR 1 and each of ASBR 3 and ASBR 4. An EBGP peer is established between ASBR 2 and ASBR 4.
[0213] In the following, we first describe the VPN route advertisement process in the solution of Option B based on the network architecture shown in Figure 1.
[0214] FIG. 2 is a schematic diagram of a network architecture according to an embodiment of the present application.
[0215] Both AS 1 and AS 2 are MPLS domains.
[0216] CE 1 advertises a VPN route, whose destination address is CE 1's internet protocol (IP) address, to PE 1 and PE 2 separately.
[0217] PE 1 gets VPN routes from CE 1 and stores the routes in VPN instance 1 associated with CE 1. PE 1 uses a one-per-instance VPN identifier allocation scheme. PE 1 assigns VPN identifiers to VPN routes that belong to the same VPN instance. PE 1 belongs to an MPLS domain, and the VPN identifiers assigned to VPN routes are MPLS labels. In the MPLS domain scenario, the one-per-instance VPN identifier allocation scheme is also called one-label-per-instance allocation scheme. PE 1 assigns the same MPLS label L1 to VPN routes that belong to VPN instance 1. Similarly, PE 2 gets VPN routes from CE 1 and stores the VPN routes in VPN instance 2 associated with CE 1. PE 2 uses a one-per-instance VPN identifier allocation scheme. PE 2 assigns VPN identifiers to VPN routes that belong to the same VPN instance. PE 2 belongs to an MPLS domain, and the VPN identifiers assigned to VPN routes are MPLS labels. PE 2 assigns the same MPLS label L2 to VPN routes belonging to VPN instance 2. PE 1 advertises the VPN routes to ASBR 1. The VPN routes advertised by PE 1 include MPLS label L1, route prefix, and next hop PE 1. PE 2 advertises the VPN routes to ASBR 1. The VPN routes advertised by PE 2 include MPLS label L2, route prefix, and next hop PE 2. PE 1 stores the correspondence between the destination address, i.e., the IP address of CE 1, and the next hop CE 1. PE 2 stores the correspondence between the destination address, i.e., the IP address of CE 1, and the next hop CE 1.
[0218] ASBR 1 uses one VPN identifier per next hop allocation scheme. ASBR 1 assigns the same MPLS label to VPN routes that belong to the MPLS domain and have the same next hop. In the MPLS domain scenario, one VPN identifier per next hop allocation scheme is also called one label per next hop allocation scheme. The VPN route advertised by PE 1 and the VPN route advertised by PE 2 obtained by ASBR 1 have the same route prefix. ASBR 1 uses the VPN route advertised by PE 1 as the preferred VPN route. ASBR 1 assigns MPLS label L3 to the VPN route whose next hop is PE 1. MPLS label L3 is the ingress label of ASBR 1. ASBR 1 remembers the correspondence between the ingress label L3, the egress label L1, and the next hop PE 1 on the forwarding plane, and uses the correspondence between L3, L1, and PE 1 to guide forwarding.
[0219] Based on the VPN route obtained from PE 1, ASBR 1 advertises the VPN route to ASBR 3, including MPLS label L3, route prefix, and next hop ASBR 1. ASBR 3 uses a one-next-hop-per-VPN-identifier assignment scheme. ASBR 3 assigns the same MPLS label to VPN routes that belong to the MPLS domain and have the same MPLS label and the same next hop. ASBR 3 assigns MPLS label L5 to the VPN route whose MPLS label is L3 and whose next hop is ASBR 1. ASBR 3 stores the correspondence between outgoing label L3, incoming label L5, and next hop ASBR 1 in the forwarding plane, and uses the correspondence between L3, L5, and ASBR 1 to guide forwarding.
[0220] ASBR 3 modifies the next hop of the obtained VPN to ASBR 3. ASBR 3 advertises the VPN route, including the MPLS label L5, the route prefix, and the next hop ASBR 3, to PE 3.
[0221] Based on the obtained VPN route, PE 3 stores the correspondence between L5, the IP address of CE 1, and ASBR 3 on the forwarding plane. PE 3 proceeds to advertise the VPN route to CE 2.
[0222] CE 2 can obtain the IP address of CE 1 based on the obtained VPN route.
[0223] Based on the above route allocation process, the following describes the process of CE 2 sending a packet to CE 1.
[0224] CE 2 sends a packet whose destination address is the IP address of CE 1 to PE 3. PE 3 performs encapsulation based on the correspondence between L5, the IP address of CE 1, and ASBR 3 to obtain an MPLS packet containing L5, and sends the MPLS packet to ASBR 3.
[0225] Based on the correspondence between L3, L5, and ASBR 1, ASBR 3 replaces L5 contained in the MPLS packet with L3, and sends the MPLS packet including L3 obtained through label replacement to ASBR 1.
[0226] Based on the correspondence between L3, L1, and PE1, ASBR1 replaces L3 contained in the MPLS packet with L1, and sends the MPLS packet including L1 obtained through label replacement to PE1.
[0227] PE 1 removes the MPLS header of the MPLS packet to obtain an IP packet. PE 1 sends the IP packet to CE 1 based on the correspondence between the IP address of CE 1 and CE 1 and the IP address of CE 1 contained in the IP packet. CE 1 can obtain the IP packet for processing.
[0228] In some cases, PE 1 may be unreachable. For example, PE 1 may be down, or the link between PE 1 and ASBR 1 may be down. After realizing that PE 1 is unreachable, ASBR 1 triggers local VPN route convergence. ASBR 1 reselects a VPN route and uses the VPN route advertised by PE 2 as the route to send packets. ASBR 1 assigns MPLS label L4 to the VPN route whose next hop is PE 2. MPLS label L4 is the ingress label of ASBR 1. ASBR 1 performs an update and remembers the correspondence between the ingress label L4, the egress label L2, and the next hop PE 2 on the forwarding plane, and uses the correspondence between L4, L2, and PE 2 to guide forwarding. ASBR 1 advertises the VPN route, including the MPLS label L4, the route prefix, and the next hop ASBR 1, to ASBR 3. ASBR 3 assigns MPLS label L6 to the VPN route whose MPLS label is L4 and whose next hop is ASBR 1. ASBR 3 updates the correspondence stored on the forwarding plane to the correspondence between L4, L6, and ASBR 3. ASBR 3 advertises the VPN route with MPLS label L6 and next hop ASBR 3 to PE 3. PE 3 stores the correspondence between L6, CE 1's IP address, and ASBR 3 on the forwarding plane and advertises the VPN route to CE 2.
[0229] PE 3 encapsulates the IP packet sent by CE 2 into an MPLS packet including L6, and sends the MPLS packet to ASBR 3. ASBR 3 replaces L6 included in the MPLS packet with L4 based on the correspondence between L4, L6, and ASBR 1, and sends the MPLS packet including L4 to ASBR 1. ASBR 1 replaces L4 included in the MPLS packet with L2 based on the correspondence between L2, L4, and PE 2, and sends the MPLS packet including L2 to PE 2. PE 2 removes the MPLS packet header of the obtained MPLS packet to obtain an IP packet. Then, PE 2 sends the IP packet to CE 1 based on the correspondence between CE 1's IP address and CE 1 and the IP address of CE 1 included in the IP packet.
[0230] Based on the above, we can see that when PE 1 is unreachable, the network needs to perform route convergence. In the convergence process, CE 2 cannot send packets to CE 1. However, the convergence takes a long time. As a result, the network transmission quality is affected.
[0231] In another possible scenario, CE 2 sends a large amount of packets to CE 1, so it is difficult to quickly complete the packet transmission through only one transmission path, resulting in the network transmission quality being affected.
[0232] Based on the above problem, the embodiment of the present application provides a route advertisement method and a packet forwarding method. In the route advertisement method provided in the embodiment of the present application, a first network device obtains a first VPN route advertised by a second network device through a first tunnel, and obtains a second VPN route advertised by a third network device through a second tunnel. The first VPN route and the second VPN route have the same route prefix and the same route distinguisher (RD), but have different next hops and different VPN identifiers. The first network device assigns the same third VPN identifier to the first VPN route and the second VPN route. The first network device stores, on the forwarding plane, a first correspondence between the third VPN identifier and the first VPN identifier included in the first VPN route, and a second correspondence between the third VPN identifier and the second VPN identifier included in the second VPN route. The first network device can store the first correspondence and the second correspondence and forward packets based on the first correspondence and the second correspondence, supporting fast route changes or load balancing. The first network device advertises a third VPN route, including a third VPN identifier, a route prefix, an RD, and a third next hop, to the fourth network device through the third tunnel. The third next hop is the first network device. The fourth network device can forward packets to the first network device based on the third VPN route.
[0233] The first VPN route and the second VPN route may form a fast route change. When an active route in the first VPN route and the second VPN route is unreachable, the first network device may quickly switch to a standby route for packet forwarding based on the first correspondence and the second correspondence stored on the forwarding plane to improve the transmission performance of the network. The first VPN route and the second VPN route may alternatively form a load balancing. The first network device may separately forward packets to the second network device and the third network device based on the first correspondence and the second correspondence stored on the forwarding plane to implement load balancing and improve the transmission performance of the network.
[0234] In a packet forwarding method provided in an embodiment of the present application, a first correspondence and a second correspondence are stored on a forwarding plane of a first network device. The first correspondence includes a correspondence between a first VPN identifier and a third VPN identifier. The second correspondence includes a correspondence between a second VPN identifier and a third VPN identifier. The first network device can guide packet forwarding based on the first correspondence and the second correspondence stored in the forwarding plane. In a fast route change scenario, the first network device can switch to use the first correspondence or the second correspondence to support fast switching on the forwarding plane and improve the transmission performance of the network. In a load balancing scenario, the first network device can send packets to the second network device and the third network device separately by using the first correspondence and the second correspondence to improve packet transmission efficiency and improve the transmission performance of the network.
[0235] In the following, first, application scenarios of the route advertisement method and the packet forwarding method provided in the embodiments of the present application will be described.
[0236] In one example, the route advertisement method and the packet forwarding method provided in the embodiment of the present application are applicable to the network architecture shown in Figure 1. Please refer to the above description for the description of the network architecture shown in Figure 1. The details will not be described again in this specification.
[0237] In another example, an embodiment of the present application further provides a possible applicable network architecture. Based on FIG. 3, the following describes another possible application scenario of the route advertisement method and the packet forwarding method provided in the embodiment of the present application.
[0238] 3 is a schematic diagram of another network architecture according to an embodiment of the present application. The network shown in FIG. 3 includes PE 1, PE 2, Gateway 1, Gateway 2, PE 3, and PE 4. PE 1 and PE 2 are connected to CE 1 in VPN 1. An IBGP peer is established between PE 1 and Gateway 1. An IBGP peer is established between PE 2 and each of Gateway 1 and Gateway 2. An IBGP peer is established between Gateway 1 and Gateway 2. An IBGP peer is established between PE 3 and Gateway 1. An IBGP peer is established between PE 4 and each of Gateway 1 and Gateway 2. PE 3 and PE 4 are connected to CE 2 in VPN 1.
[0239] Gateway 1 and Gateway 2 may be extensible gateways (xGWs). PE 1, PE 2, PE 3, and PE 4 may be aggregation site gateways (ASGs).
[0240] It should be noted that the network architectures shown in Figures 1 and 3 are only possible implementations. The route advertisement method and packet forwarding method provided in the embodiments of the present application can be applied to a network device connected to a tunnel and having a VPN identifier allocation function, a route advertisement function, and a packet forwarding function.
[0241] In the following, several application scenarios are used as examples to describe in detail the route advertisement method and packet forwarding method provided in the embodiments of the present application.
[0242] Scenario 1: The network architecture shown in Figure 1 is used as an example. Figure 4 is a schematic diagram of the network architecture in Scenario 1 according to an embodiment of the present application.
[0243] 5 is a schematic flowchart of a route advertisement method 500 according to an embodiment of the present application. The method 500 may be applied to the network scenario shown in FIG 4. The method 500 includes steps S501 to S507.
[0244] S501: PE 1 sends the first VPN route to ASBR 1.
[0245] PE 1 can obtain the VPN routes advertised by CE 1. The VPN routes advertised by CE 1 belong to the first VPN instance created by PE 1. PE 1 can generate a routing table of the first VPN instance based on the obtained VPN routes advertised by CE 1.
[0246] PE1 may assign the same VPN identifier to VPN routes belonging to the same VPN instance in a one-VPN-identifier-per-instance manner. All VPN routes acquired by PE1 and advertised by CE1 belong to the first VPN instance. PE1 may assign a first VPN identifier, i.e., L1, to the VPN routes advertised by CE1. The first VPN identifier is associated with the first VPN instance. In a packet forwarding process, PE1 may query the routing table of the first VPN instance based on the first VPN identifier included in the packet to forward the packet.
[0247] The particular type of the first VPN identifier is associated with a first tunnel for communication between PE 1 and ASBR 1.
[0248] In one example, the first tunnel is an MPLS tunnel and the first VPN identifier is an MPLS label. It should be noted that the MPLS label may be an MPLS label defined in the MPLS technology or may be an SID defined in the segment routing-multiprotocol label switching (SR-MPLS) technology. The SID defined in the SR-MPLS technology is in the format of an MPLS label.
[0249] In another example, the first tunnel is a segment routing over internet protocol version 6 (SRv6) tunnel and the first VPN identifier is an SRv6 segment identifier (SID).
[0250] PE 1 generates a first VPN route and sends the first VPN route to ASBR 1 through the first tunnel.
[0251] The first VPN route includes a first VPN identifier, a route prefix, an RD, and a first next hop.
[0252] It should be noted that in one possible implementation scenario, AS 1 may specifically be an Ethernet virtual private network (EVPN), and the first VPN route may specifically be an EVPN route.
[0253] Additionally, based on the address family to which the IP addresses included in the VPN belong, the first VPN route may alternatively be a virtual private network version 4 (VPNv4) route or a virtual private network version 6 (VPNv6) route.
[0254] The route prefix included in the first VPN route may be a network segment to which the IP addresses included in VPN 1 belong. For example, the first VPN route is a VPNv4 route. The route prefix included in the first VPN route may be an internet protocol version 4 (IPv4) address prefix.
[0255] The RD included in the first VPN route can identify that the first VPN route belongs to VPN 1. A global configuration scheme may be used for the RD, and the VPN instances included in PE 1 and PE 2 corresponding to VPN 1 correspond to the same RD. In this way, the VPN routes advertised by PE 1 and PE 2 and belonging to VPN 1 include the same RD.
[0256] The first next hop included in the first VPN route advertised by PE1 is PE1.
[0257] S502: ASBR 1 receives the first VPN route sent by PE 1.
[0258] ASBR 1 is the tunnel endpoint of the first tunnel. ASBR 1 receives the first VPN route sent by PE 1 through the first tunnel.
[0259] S503: PE 2 sends the second VPN route to ASBR 1.
[0260] PE 2 can also obtain the VPN routes advertised by CE 1. The VPN routes advertised by CE 1 belong to the second VPN instance created by PE 2. PE 2 can generate a routing table for the second VPN instance based on the obtained VPN routes advertised by CE 1. Both the first VPN instance and the second VPN instance are associated with VPN 1.
[0261] PE 2 can assign the same VPN identifier to VPN routes that belong to the same VPN instance in a one-VPN-identifier-per-instance manner. All VPN routes acquired by PE 2 and advertised by CE 1 belong to the second VPN instance. PE 2 can assign a second VPN identifier, i.e., L2, to the VPN routes advertised by CE 1. The second VPN identifier is associated with the second VPN instance. In the packet forwarding process, PE 2 can query the routing table of the second VPN instance based on the second VPN identifier included in the packet to forward the packet.
[0262] The second particular type of VPN identifier is associated with a second tunnel for communication between PE2 and ASBR1.
[0263] In one example, the second tunnel is an MPLS tunnel and the second VPN identifier is an MPLS label, hi another example, the second tunnel is an SRv6 tunnel and the second VPN identifier is an SRv6 SID.
[0264] It should be noted that the type of the second tunnel may be the same as the type of the first tunnel, and correspondingly, the type of the second VPN identifier is the same as the type of the first VPN identifier.
[0265] In one example, the first tunnel and the second tunnel are MPLS tunnels and the first VPN identifier and the second VPN identifier are MPLS labels. In another example, the first tunnel and the second tunnel are SRv6 tunnels and the first VPN identifier and the second VPN identifier are SRv6 SIDs.
[0266] PE 2 generates a second VPN route and sends the second VPN route to ASBR 1 through the second tunnel.
[0267] The second VPN route includes a second VPN identifier, a route prefix, an RD, and a second next hop.
[0268] The second VPN route may alternatively be an EVPN route, a VPNv4 route, or a VPNv6 route. The route type of the second VPN route is the same as the route type of the first VPN route.
[0269] The second VPN route and the first VPN route are generated based on the VPN route belonging to VPN 1 advertised by CE 1, respectively. The route prefix contained in the second VPN route is the same as the route prefix contained in the first VPN route. The RD contained in the second VPN route is the same as the RD contained in the first VPN route.
[0270] The second next hop included in the second VPN route advertised by PE2 is PE2.
[0271] S504: ASBR 1 receives the second VPN route sent by PE 2.
[0272] ASBR 1 is the tunnel endpoint of the second tunnel. ASBR 1 receives the second VPN routes sent by PE 2 through the second tunnel.
[0273] S505: ASBR 1 assigns a third VPN identifier to the first VPN route, and stores the correspondence between the first VPN identifier and the third VPN identifier on the forwarding plane.
[0274] ASBR 1 assigns VPN identifiers to received VPN routes in a one VPN identifier per next hop fashion, i.e., ASBR 1 assigns the same VPN identifier to VPN routes that have the same next hop and the same RD.
[0275] All of the first VPN routes acquired by ASBR 1 have the same next hop as PE 1, and those first VPN routes contain the same RD. ASBR 1 assigns a third VPN identifier, L3, to the first VPN routes.
[0276] ASBR 1 is also the tunnel endpoint of the third tunnel. The third tunnel is a tunnel between ASBR 1 and ASBR 3. In this embodiment of the present application, ASBR 1 and ASBR 3 belong to different autonomous systems, and the third tunnel is an inter-AS tunnel. ASBR 1 can connect the first tunnel and the third tunnel to implement stitching between the first tunnel and the third tunnel. ASBR 1 can also connect the second tunnel and the third tunnel to implement stitching between the second tunnel and the third tunnel.
[0277] The type of the third VPN identifier assigned by ASBR 1 is related to the tunnel type of the third tunnel. The third tunnel may be an MPLS tunnel. Correspondingly, the third VPN identifier is an MPLS label. The third tunnel may alternatively be an SRv6 tunnel. Correspondingly, the third VPN identifier is an SRv6 SID.
[0278] It should be noted that the type of the first tunnel is the same as the type of the second tunnel. The type of the third tunnel may be the same as the type of the first tunnel or may be different. The types of the first tunnel, the second tunnel, and the third tunnel may specifically include the following four cases:
[0279] In the first case, the first tunnel and the second tunnel are MPLS tunnels, and the third tunnel is an MPLS tunnel.
[0280] Correspondingly, the first VPN identifier and the second VPN identifier are MPLS labels, and the third VPN identifier is an MPLS label.
[0281] In the second case, the first tunnel and the second tunnel are MPLS tunnels, and the third tunnel is an SRv6 tunnel.
[0282] Correspondingly, the first VPN identifier and the second VPN identifier are MPLS labels, and the third VPN identifier is an SRv6 SID.
[0283] In a third case, the first tunnel and the second tunnel are SRv6 tunnels, and the third tunnel is an MPLS tunnel.
[0284] Correspondingly, the first VPN identifier and the second VPN identifier are SRv6 SIDs, and the third VPN identifier is an MPLS label.
[0285] In a fourth case, the first tunnel and the second tunnel are SRv6 tunnels, and the third tunnel is an SRv6 tunnel.
[0286] Correspondingly, the first VPN identifier and the second VPN identifier are SRv6 SIDs, and the third VPN identifier is an SRv6 SID.
[0287] The ASBR 1 stores a first correspondence between the first VPN identifier and the third VPN identifier on the forwarding plane, and the ASBR 1 can guide packet forwarding based on the first correspondence stored on the forwarding plane.
[0288] In one possible implementation, ASBR 1 may store a first forwarding entry on the forwarding plane. The first forwarding entry includes a first correspondence. The first forwarding entry may be an entry belonging to a forwarding table. The forwarding table in this embodiment of the present application is a table that can guide packet forwarding in a broad sense. The specific type of the forwarding table is not limited in this embodiment of the present application. For example, both the first VPN identifier and the third VPN identifier are MPLS labels, and the forwarding table that stores the first forwarding entry is a label forwarding information base (LFIB).
[0289] In another possible implementation, the first VPN identifier and the third VPN identifier can be stored separately in different forwarding tables to guide forwarding. The first correspondence between the first VPN identifier and the third VPN identifier is formed based on a correspondence between a plurality of forwarding tables to guide forwarding.
[0290] Note that ASBR 1 may further store a correspondence between the first VPN identifier, the third VPN identifier, and the first interface information. The first interface information is of ASBR 1 and identifies an outbound interface that is connected to the first tunnel. When forwarding a packet, ASBR 1 may process the packet and forward the packet through the first tunnel based on the correspondence between the first VPN identifier, the third VPN identifier, and the first interface information.
[0291] Specifically, in one possible implementation, ASBR 1 may further store a correspondence between the first VPN identifier, the third VPN identifier, and a first interface identifier (ID). The first interface ID may specifically be an interface identifier of an outbound interface of ASBR 1 connected to the first tunnel. In this way, when forwarding a packet, ASBR 1 may process the packet and forward the packet through the first tunnel based on the correspondence between the first VPN identifier, the third VPN identifier, and the first interface ID.
[0292] In another possible implementation, ASBR 1 may further store a correspondence between the first VPN identifier, the third VPN identifier, and the first tunnel ID. The first tunnel ID identifies the first tunnel. When forwarding a packet, ASBR 1 may process the packet and forward the packet through the first tunnel based on the correspondence between the first VPN identifier, the third VPN identifier, and the first tunnel ID.
[0293] S506: ASBR 1 assigns a third VPN identifier to the second VPN route, and stores the correspondence between the second VPN identifier and the third VPN identifier on the forwarding plane.
[0294] All of the second VPN routes acquired by ASBR 1 have a second next hop of PE 2 and contain the same RD. ASBR 1 assigns a third VPN identifier, L3, to the second VPN routes.
[0295] The type of the third VPN identifier assigned by ASBR 1 is related to the tunnel type of the third tunnel. The third tunnel may be an MPLS tunnel. Correspondingly, the third VPN identifier is an MPLS label. The third tunnel may alternatively be an SRv6 tunnel. Correspondingly, the third VPN identifier is an SRv6 SID.
[0296] The ASBR 1 stores a second correspondence between the second VPN identifier and the third VPN identifier on the forwarding plane, and the ASBR 1 can guide packet forwarding based on the second correspondence stored on the forwarding plane.
[0297] In a possible implementation, ASBR 1 can store a second forwarding entry on the forwarding plane. The second forwarding entry includes a second correspondence. The second forwarding entry may be an entry belonging to a forwarding table. The forwarding table in this embodiment of the present application is a table that can guide packet forwarding in a broad sense. The specific type of the forwarding table is not limited in this embodiment of the present application. For example, both the second VPN identifier and the third VPN identifier are MPLS labels, and the forwarding table that stores the second forwarding entry is an LFIB.
[0298] In another possible implementation, the second VPN identifier and the third VPN identifier can be stored separately in different forwarding tables to guide forwarding. A second correspondence between the second VPN identifier and the third VPN identifier is formed based on a correspondence between the multiple forwarding tables to guide forwarding.
[0299] It should be noted that in one possible implementation, ASBR 1 may further store a correspondence between the second VPN identifier, the third VPN identifier, and the second interface identifier ID. The second interface ID may specifically be an interface identifier of an outbound interface of ASBR 1 connected to the second tunnel. In this way, when forwarding a packet, ASBR 1 can process the packet and forward the packet through the second tunnel based on the correspondence between the second VPN identifier, the third VPN identifier, and the second interface ID.
[0300] In another possible implementation, ASBR 1 may further store a correspondence between the second VPN identifier, the third VPN identifier, and the second tunnel ID. The second tunnel ID identifies the second tunnel. When forwarding the packet, ASBR 1 may process the packet and forward the packet through the second tunnel based on the correspondence between the second VPN identifier, the third VPN identifier, and the second tunnel ID.
[0301] S507: ASBR 1 advertises the third VPN route to ASBR 3.
[0302] The third VPN route includes a third VPN identifier, a route prefix, an RD, and a third next hop.
[0303] The route prefix included in the third VPN route is the route prefix included in the first VPN route and is also the route prefix included in the second VPN route. The RD included in the third VPN route is the RD included in the first VPN route and is also the RD included in the second VPN route.
[0304] The third next hop in the third VPN route is ASBR 1.
[0305] The third VPN route may be an EVPN route, a VPNv4 route, or a VPNv6 route.
[0306] It should be noted that the route type of the third VPN route may be the same as or different from the route type of the first VPN route and the route type of the second VPN route.
[0307] For example, in one possible implementation, the route type of the first VPN route and the route type of the second VPN route may be an EVPN route, and the route type of the third VPN route may be a VPNv4 route or a VPNv6 route.
[0308] As another example, in another possible implementation, the route type of the first VPN route and the route type of the second VPN route may be a VPNv4 route or a VPNv6 route, and the route type of the third VPN route may be an EVPN route.
[0309] ASBR 1 sends the third VPN route to ASBR 3 through the third tunnel.
[0310] ASBR 3 may assign VPN identifier L4 to the third VPN route in a one VPN identifier per next hop fashion.
[0311] ASBR 3 advertises the VPN route to network devices in AS 2, such as PE 3. The VPN route advertised by ASBR 3 includes a VPN identifier L4, a route prefix, an RD, and a next hop. The next hop included in the VPN route advertised by ASBR 3 is ASBR 3. ASBR 3 stores the correspondence between L4 and L3 to guide forwarding.
[0312] In one example, ASBR 3 may further store a correspondence between L4, L3, and a third tunnel ID, where the third tunnel ID identifies a third tunnel. Based on the correspondence including the third tunnel ID, ASBR 3 may determine to forward the packet including L3 to the first network device through the third tunnel.
[0313] After obtaining the VPN route advertised by ASBE 3, PE 3 can create a correspondence between L4, ASBR 3, and the IP address of CE 1. The VPN route advertised by ASBE 3 includes the IP address of CE 1.
[0314] Then, PE 3 advertises the learned VPN route to CE 2. CE 2 can send packets to CE 1 based on the learned VPN route.
[0315] With reference to the network architecture shown in FIG. 4, the following describes a packet forwarding method provided in an embodiment of the present application.
[0316] 6a is a schematic flowchart of a packet forwarding method 600 according to an embodiment of the present application. The method 600 may be applied to the network scenario shown in FIG 4. The method 600 includes steps S601 to S604.
[0317] The forwarding plane of ASBR 1 includes a first correspondence and a second correspondence. The first correspondence includes a correspondence between a first VPN identifier and a third VPN identifier. The second correspondence includes a correspondence between the second VPN identifier and a third VPN identifier.
[0318] S601: ASBR 3 sends a first packet to ASBR 1.
[0319] CE 2 can obtain the IP address of CE 1 based on the learned VPN route. CE 2 can generate a packet whose destination address is the IP address of CE 1 and send the packet to PE 3. PE 3 can encapsulate the packet obtained from CE 2 based on the correspondence between L4 and the IP address of CE 1 to obtain a forwarding packet containing L4. PE 3 sends the forwarding packet to ASBR 3 through the tunnel between PE 3 and ASBR 3.
[0320] After obtaining the forwarding packet sent by the PE 3, the ASBR 3 can replace the L4 included in the forwarding packet with the L3 based on the L4 included in the forwarding packet and the stored correspondence between the L4 and the L3 to obtain a first packet. The first packet includes a third VPN identifier, i.e., L3.
[0321] In one possible implementation, ASBR 3 can send the first packet to ASBR 1 through the third tunnel based on a pre-stored correspondence between L4, L3 and the third tunnel ID.
[0322] S602: ASBR 1 obtains the first packet sent by ASBR 3.
[0323] ASBR 1 receives the first packet sent by ASBR 3 through the third tunnel. The first packet includes a third VPN identifier, i.e., L3. ASBR 1 can perform packet forwarding based on the third VPN identifier included in the first packet.
[0324] S603: ASBR 1 processes the first packet according to the first correspondence to obtain a second packet.
[0325] ASBR 1 may process the first packet based on the first packet and the correspondence between the third VPN identifier and the first VPN identifier included in the first correspondence to generate a second packet, where the second packet includes the first VPN identifier, i.e., L1.
[0326] For different types of VPN identifiers, the manner of processing the first packet to generate the second packet is different. This embodiment of the present application provides four possible specific implementations in which the ASBR 1 obtains the second packet based on the first packet and the first correspondence.
[0327] In a first implementation, both the third VPN identifier and the first VPN identifier are MPLS labels.
[0328] In this case, both the first packet and the second packet are MPLS packets. ASBR 1 replaces the third VPN identifier in the first packet with the first VPN identifier.
[0329] FIG. 7a is a schematic diagram of packet transmission according to an embodiment of the present application.
[0330] Specifically, the MPLS packet header of the first packet includes the third VPN identifier L3. ASBR 1 removes the third VPN identifier L3 from the first packet, and encapsulates the first VPN identifier L1 in the packet obtained by removing the third VPN identifier to obtain a second packet, where the second packet includes the first VPN identifier L1.
[0331] In a second implementation, both the third VPN identifier and the first VPN identifier are SRv6 SIDs.
[0332] In this case, both the first packet and the second packet are SRv6 packets. ASBR 1 replaces the third VPN identifier in the first packet with the first VPN identifier.
[0333] FIG. 7b is another schematic diagram of packet transmission according to an embodiment of the present application.
[0334] Specifically, the destination address of the first packet is the third VPN identifier, and the ASBR 1 replaces the destination address L3 of the first packet with the first VPN identifier L1 to obtain the second packet.
[0335] In a third implementation, the third VPN identifier is an MPLS label and the first VPN identifier is an SRv6 SID.
[0336] In this case, the first packet is an MPLS packet and the second packet is an SRv6 packet.
[0337] FIG. 7c is yet another schematic diagram of packet transmission according to an embodiment of the present application.
[0338] Specifically, ASBR 1 decapsulates the first packet and removes the MPLS packet header to obtain a packet payload. ASBR 1 performs SRv6 encapsulation on the resulting packet payload to obtain a second packet. The destination address of the second packet is the first VPN identifier L1.
[0339] In a fourth implementation, the third VPN identifier is an SRv6 SID and the first VPN identifier is an MPLS label.
[0340] In this case, the first packet is an SRv6 packet and the second packet is an MPLS packet.
[0341] FIG. 7d is yet another schematic diagram of packet transmission according to an embodiment of the present application.
[0342] Specifically, ASBR 1 decapsulates the first packet and removes the IPv6 packet header to obtain a packet payload. ASBR 1 performs MPLS encapsulation on the resulting packet payload to obtain a second packet. The MPLS packet header of the second packet includes the first VPN identifier L1.
[0343] In the fourth case, in one example, the third VPN identifier may specifically be END.BM. END.BM indicates that the tunnel endpoint is bound to the SR-MPLS policy. In this embodiment of the present application, ASBR 1 is used as the endpoint of the third tunnel and decapsulates the first packet based on the END.BM included in the first packet. ASBR 1 reencapsulates the packet payload based on the SR-MPLS policy indicating the first tunnel to obtain the second packet.
[0344] S604: ASBR 1 sends the second packet to PE 1.
[0345] ASBR 1 sends the second packet to PE 1 through the first tunnel.
[0346] In one example, ASBR 1 may determine to send the second packet through the first tunnel to PE 1 based on a pre-stored correspondence. The pre-stored correspondence on which ASBR 1 may base may specifically be a correspondence between a first VPN identifier, a third VPN identifier, and a first interface ID, or a correspondence between the first VPN identifier, a third VPN identifier, and a first tunnel ID.
[0347] After obtaining the second packet, PE 1 can process the second packet and send the packet obtained through processing to CE 1 to complete the packet forwarding.
[0348] A fast route change can be formed in the network based on the first VPN route and the second VPN route, one of which is an active route and the other of which is a standby route.
[0349] In one possible implementation, the first VPN route is an active route and PE 1 is an active next hop. Before S603 is executed, ASBR 1 can determine that PE 1 is reachable. ASBR 1 performs packet forwarding based on the first correspondence stored in the forwarding plane.
[0350] In another possible implementation, the second VPN route is an active route, and PE 2 is an active next hop. The first VPN route is a standby route, and PE 1 is a standby next hop. Before S603 is executed, ASBR 1 can determine that PE 2 is unreachable. ASBR 1 performs packet forwarding based on the first correspondence stored on the forwarding plane, thereby implementing fast switching on the forwarding plane and reducing the time during which packet transmission cannot be performed normally in the network because PE 2 is down.
[0351] Based on the first VPN route and the second VPN route, load balancing can be formed in the network.
[0352] See Fig. 6b: In addition to S601-S604, the packet forwarding method provided in this embodiment of the present application may further include S605-S608.
[0353] S605: ASBR 3 sends the third packet to ASBR 1.
[0354] The manner in which ASBR 3 generates the third packet is the same as the manner in which ASBR 3 generates the first packet in S601, and the details will not be described again in this specification.
[0355] S606: ASBR 1 obtains the third packet sent by ASBR 3.
[0356] ASBR 1 receives the third packet sent by ASBR 3 through the third tunnel. The third packet includes a third VPN identifier, i.e., L3. ASBR 1 can perform packet forwarding based on the third VPN identifier included in the third packet.
[0357] S607: ASBR 1 processes the third packet according to the second correspondence to obtain a fourth packet.
[0358] ASBR 1 may process the third packet including the third VPN identifier based on the correspondence between the third VPN identifier and the second VPN identifier in the second correspondence to generate a fourth packet, the fourth packet including the second VPN identifier, i.e., L2.
[0359] For different types of VPN identifiers, the manner in which the third packet is processed to generate the fourth packet is different. The manner in which ASBR 1 generates the fourth packet is similar to the above manner in which ASBR 1 generates the second packet. Please refer to the above description.
[0360] S608: ASBR 1 sends the fourth packet to PE 2.
[0361] ASBR 1 sends the fourth packet to PE 2 through the second tunnel.
[0362] After obtaining the fourth packet, PE 2 can process the fourth packet, and send the packet obtained through processing to CE 1 to complete the packet forwarding.
[0363] Scenario 2: The network architecture shown in Figure 1 is used as an example. Figure 8 is a schematic diagram of the network architecture in Scenario 2 according to an embodiment of the present application.
[0364] The above method 500 describes a process in which ASBR 1 learns a first VPN route advertised by PE 1 in AS 1 and a second VPN route advertised by PE 2 in AS 1, and advertises a third VPN route to ASBR 3 in AS 2. In another possible implementation, ASBR 1 can learn a first VPN route advertised by PE 1 in AS 1 and a second VPN route advertised by ASBR 2 in AS 1, and advertise a third VPN route to ASBR 3 in AS 2.
[0365] Based on the network architecture shown in Fig. 1, an embodiment of the present application provides another route advertisement method 800. The method 800 includes steps A1 to A7.
[0366] A1:PE 1 sends the first VPN route to ASBR 1.
[0367] A2: ASBR 1 receives the first VPN route sent by PE 1.
[0368] In method 800, A1 and A2 are the same as S501 and S502. For details, please refer to the specific description related to S501 and S502 in method 500.
[0369] A3: ASBR 2 sends the second VPN route to ASBR 1.
[0370] ASBR 2 may receive the VPN route advertised by PE 2 and generate a second VPN route based on the received VPN route advertised by PE 2.
[0371] In the following, first, the process in which PE 2 advertises a VPN route will be described.
[0372] PE 2 can obtain the VPN routes advertised by CE 1. The VPN routes advertised by CE 1 belong to a second VPN instance created by PE 2. PE 2 can generate a routing table for the second VPN instance based on the obtained VPN routes advertised by CE 1. The second VPN instance and the first VPN instance are associated with VPN 1.
[0373] PE 2 can assign the same VPN identifier to VPN routes that belong to the same VPN instance in a one-VPN-identifier-per-instance scheme. All VPN routes acquired by PE 2 and advertised by CE 1 belong to the second VPN instance. PE 2 can assign a VPN identifier, i.e., L2, to the VPN routes advertised by CE 1. L2 is associated with the second VPN instance. In the packet forwarding process, PE 2 can query the routing table of the second VPN instance based on the L2 contained in the packet to forward the packet.
[0374] The particular type of L2 relates to the tunnel between PE2 and ASBR2.
[0375] In one example, the tunnel between PE2 and ASBR2 is an MPLS tunnel and L2 is an MPLS label. In another example, the tunnel between PE2 and ASBR2 is an SRv6 tunnel and L2 is an SRv6 SID.
[0376] The type of the tunnel between PE2 and ASBR2 is the same as the type of the first tunnel. Correspondingly, the specific type of L2 is the same as the type of the first VPN identifier.
[0377] The VPN route advertised by PE2 contains the VPN identifier, route prefix, RD, and next hop.
[0378] The VPN route and the first VPN route advertised by PE 2 are generated based on the VPN route from VPN 1 advertised by CE 1, respectively. The route prefix contained in the VPN route advertised by PE 2 is the same as the route prefix contained in the first VPN route. The RD contained in the VPN route advertised by PE 2 is the same as the RD contained in the first VPN route.
[0379] The next hop in the VPN route advertised by PE2 is PE2.
[0380] ASBR 2 may obtain VPN routes advertised by PE 2. ASBR 2 assigns VPN identifiers to the received VPN routes in the manner of one VPN identifier per next hop.
[0381] Specifically, ASBR 2 assigns a second VPN identifier L3 to the acquired VPN route advertised by PE 2. The second VPN identifier is associated with a type of tunnel for communication between ASBR 2 and ASBR 1. The tunnel for communication between ASBR 2 and ASBR 1 may also be referred to as a second tunnel.
[0382] The type of the second tunnel is the same as the type of the first tunnel, and correspondingly, the type of the second VPN identifier is the same as the type of the first VPN identifier.
[0383] ASBR 2 advertises a second VPN route to ASBR 1 through the second tunnel. The second VPN route includes a second VPN identifier L3 assigned by ASBR 2, a route prefix, an RD, and a second next hop. The second VPN route is generated based on the VPN route advertised by PE 2. The route prefix of the second VPN route is the same as the route prefix of the first VPN route. The RD of the second VPN route is the same as the RD of the first VPN route.
[0384] A4: ASBR 1 receives the second VPN route sent by ASBR 2.
[0385] ASBR 1 receives the second VPN route sent by ASBR 2 through the second tunnel.
[0386] A5: ASBR 1 assigns a third VPN identifier to the first VPN route, and stores the correspondence between the first VPN identifier and the third VPN identifier on the forwarding plane.
[0387] A6: ASBR 1 assigns a third VPN identifier to the second VPN route, and stores the correspondence between the second VPN identifier and the third VPN identifier on the forwarding plane.
[0388] A7: ASBR 1 advertises the third VPN route to ASBR 3.
[0389] In the method 800, A5 to A7 are respectively the same as S505 to S507 in the above-mentioned method 500. For details, please refer to the description of S505 to S507 in the method 500. The details will not be described again in this specification.
[0390] An embodiment of the present application further provides a packet forwarding method 900 in scenario 2. Compared with the above-mentioned method 600, the method 900 is only different in the implementation of load balancing. In the method 900, the ASBR 1 sends the generated fourth packet to the ASBR 2 through the second tunnel. The other steps are the same as those in the above-mentioned method 600. The details are not described again in this specification.
[0391] Scenario 3: The network architecture shown in Figure 1 is used as an example. Figure 9 is a schematic diagram of the network architecture in Scenario 3 according to an embodiment of the present application.
[0392] The above method 500 and the above method 800 describe a process in which an ASBR receives a first VPN route and a second VPN route advertised by a network device in AS 1 and advertises a third VPN route to a network device in AS 2. In yet another possible implementation, ASBR 1 can obtain the first VPN route and the second VPN route from AS 2 and advertise a third VPN route to a network device in AS 1.
[0393] 10 is a schematic flowchart of yet another route advertisement method 1000 according to an embodiment of the present application. The method 1000 includes steps S1001 to S1007.
[0394] S1001: ASBR 3 sends the first VPN route to ASBR 1.
[0395] The ASBR 3 may obtain the VPN routes advertised by the PE 3 and generate a first VPN route based on the received VPN routes advertised by the PE 3.
[0396] In the following, we first explain the process by which PE 3 advertises VPN routes.
[0397] For the route type of the VPN route advertised by PE 3, please refer to the relevant description of the route type of the first VPN route advertised by PE 1 in S501. The details will not be described again in this specification.
[0398] The VPN route advertised by PE 3 contains the VPN identifier, route prefix, RD, and next hop.
[0399] The VPN identifier included in the VPN route advertised by the PE 3 is assigned by the PE 3 based on the VPN instance. The PE 3 may create a first VPN instance associated with the VPN 1. The first VPN instance is for storing the VPN routes belonging to the VPN 1.
[0400] The VPN identifier contained in the VPN route advertised by PE 3 is associated with the first VPN instance. The VPN identifier contained in the VPN route advertised by PE 3 is L1.
[0401] The specific type of VPN identifier included in the VPN route advertised by the PE 3 is related to the type of tunnel for communication between the PE 3 and the ASBR 3. The tunnel for communication between the PE 3 and the ASBR 3 may be an MPLS tunnel or an SRv6 tunnel.
[0402] In one example, the tunnel for communication between PE 3 and ASBR 3 is an MPLS tunnel, and the VPN identifier included in the VPN route advertised by PE 3 is an MPLS label.
[0403] In another example, the tunnel for communication between PE 3 and ASBR 3 is an SRv6 tunnel, and the VPN identifier included in the VPN route advertised by PE 3 is an SRv6 SID.
[0404] The next hop contained in the VPN route advertised by PE3 is PE3.
[0405] The ASBR 3 may obtain VPN routes advertised by the PE 3. The ASBR 3 assigns VPN identifiers to the received VPN routes in the manner of one VPN identifier per next hop.
[0406] Specifically, ASBR 3 assigns a first VPN identifier, i.e., L3, to the acquired VPN route advertised by PE 3. The first VPN identifier is associated with a type of tunnel for communication between ASBR 3 and ASBR 1. The tunnel for communication between ASBR 3 and ASBR 1 may also be referred to as a first tunnel.
[0407] The first tunnel may be an MPLS tunnel or an SRv6 tunnel.
[0408] In one example, the first tunnel is an MPLS tunnel, and the first VPN identifier included in the first VPN route is an MPLS label.
[0409] In another example, the first tunnel is an SRv6 tunnel, and the first VPN identifier included in the first VPN route is an SRv6 SID.
[0410] ASBR 3 advertises a first VPN route to ASBR 1 through the first tunnel. The first VPN route includes the first VPN identifier, route prefix, RD, and first next hop assigned by ASBR 3. The route prefix included in the first VPN route is the same as the route prefix included in the VPN route advertised by PE 3. The RD included in the first VPN route is the same as the RD included in the VPN route advertised by PE 3. The first next hop included in the first VPN route is ASBR 3.
[0411] S1002: ASBR 1 receives the first VPN route sent by ASBR 3.
[0412] ASBR 1 receives the first VPN route sent by ASBR 3 through the first tunnel.
[0413] S1003: ASBR 4 sends the second VPN route to ASBR 1.
[0414] ASBR 4 may obtain the VPN routes advertised by PE 4 and generate a second VPN route based on the received VPN routes advertised by PE 4.
[0415] The following describes the process by which PE 4 advertises VPN routes.
[0416] For the route type of the VPN route advertised by PE 4, please refer to the relevant description of the route type of the first VPN route advertised by PE 1 in S501. The details will not be described again in this specification.
[0417] Note that the route type of the VPN route advertised by PE 4 is the same as the route type of the VPN route advertised by PE 3.
[0418] The VPN route advertised by PE4 contains the VPN identifier, route prefix, RD, and next hop.
[0419] The VPN identifier included in the VPN route advertised by PE 4 is assigned by PE 4 based on the VPN instance. PE 4 can create a second VPN instance related to VPN 1. The second VPN instance is for storing the VPN routes belonging to VPN 1.
[0420] The VPN identifier contained in the VPN route advertised by PE 4 is associated with the second VPN instance. The VPN identifier contained in the VPN route advertised by PE 4 is L2. The second VPN instance and the first VPN instance are associated with VPN 1.
[0421] The specific type of VPN identifier included in the VPN route advertised by the PE 4 is related to the type of tunnel for communication between the PE 4 and the ASBR 4. The tunnel for communication between the PE 4 and the ASBR 4 may be an MPLS tunnel or an SRv6 tunnel.
[0422] In one example, the tunnel for communication between PE 4 and ASBR 4 is an MPLS tunnel, and the VPN identifier included in the VPN route advertised by PE 4 is an MPLS label.
[0423] In another example, the tunnel for communication between PE 4 and ASBR 4 is an SRv6 tunnel, and the VPN identifier included in the VPN route advertised by PE 4 is an SRv6 SID.
[0424] The type of the tunnel between PE 4 and ASBR 4 is the same as the type of the tunnel between PE 3 and ASBR 3. Correspondingly, the type of L1 is the same as the type of L2.
[0425] The next hop included in the VPN route advertised by PE4 is PE4.
[0426] ASBR 4 may obtain VPN routes advertised by PE 4. ASBR 4 assigns VPN identifiers to received VPN routes in a one VPN identifier per next hop fashion.
[0427] Specifically, ASBR 4 assigns a second VPN identifier, i.e., L4, to the acquired VPN route advertised by PE 4. The second VPN identifier is associated with a type of tunnel for communication between ASBR 4 and ASBR 1. The tunnel for communication between ASBR 4 and ASBR 1 may also be referred to as a second tunnel.
[0428] The second tunnel may be an MPLS tunnel or an SRv6 tunnel.
[0429] In one example, the second tunnel is an MPLS tunnel, and the second VPN identifier included in the second VPN route is an MPLS label.
[0430] In another example, the second tunnel is an SRv6 tunnel, and the second VPN identifier included in the second VPN route is an SRv6 SID.
[0431] Note that the type of tunnel for communication between ASBR 4 and ASBR 1 may be the same as the type of tunnel for communication between ASBR 3 and ASBR 1. The type of the second VPN identifier included in the second VPN route may be the same as the type of the first VPN identifier included in the first VPN route.
[0432] ASBR 4 advertises a second VPN route to ASBR 1 through the second tunnel. The second VPN route includes a second VPN identifier assigned by ASBR 4, a route prefix, an RD, and a second next hop. The route prefix in the second VPN route is the same as the route prefix in the VPN route advertised by PE 4 and is also the same as the route prefix in the first VPN route. The RD in the second VPN route is the same as the RD in the VPN route advertised by PE 4 and is also the same as the RD in the first VPN route. The second next hop in the second VPN route is ASBR 2.
[0433] S1004: ASBR 1 receives the second VPN route sent by ASBR 4.
[0434] ASBR 1 receives the second VPN route sent by ASBR 4 through the second tunnel.
[0435] S1005: ASBR 1 assigns a third VPN identifier to the first VPN route, and stores the correspondence between the first VPN identifier and the third VPN identifier on the forwarding plane.
[0436] S1006: ASBR 1 assigns a third VPN identifier to the second VPN route, and stores the correspondence between the second VPN identifier and the third VPN identifier on the forwarding plane.
[0437] In the method 1000, S1005 and S1006 are respectively similar to S505 and S506 in the above-mentioned method 500. For details, please refer to the description related to S505 and S506 in the method 500.
[0438] In the method 1000, the third VPN identifier is L5.
[0439] S1007: ASBR 1 advertises the third VPN route to PE 1.
[0440] The third VPN route includes a third VPN identifier, a route prefix, an RD, and a third next hop.
[0441] The route prefix included in the third VPN route is the route prefix included in the first VPN route and is also the route prefix included in the second VPN route. The RD included in the third VPN route is the RD included in the first VPN route and is also the RD included in the second VPN route.
[0442] The third next hop in the third VPN route is ASBR 1.
[0443] For the route type of the third VPN route, please refer to the relevant description of the route type of the third VPN route in S507. The details will not be described again in this specification.
[0444] PE 1 advertises a VPN route to CE 1 based on the obtained third VPN route. PE 1 can memorize the correspondence between L5 and the IP address of CE 2 to guide packet forwarding.
[0445] With reference to the network architecture shown in FIG. 9, the following describes the packet forwarding method provided in the embodiment of the present application.
[0446] 11a is a schematic flowchart of a packet forwarding method 1100 according to an embodiment of the present application. The method 1100 may be applied to the network scenario shown in FIG 9. The method 1100 includes steps S1101 to S1104.
[0447] The forwarding plane of ASBR 1 includes a first correspondence and a second correspondence. The first correspondence includes a correspondence between a first VPN identifier and a third VPN identifier. The second correspondence includes a correspondence between the second VPN identifier and a third VPN identifier.
[0448] S1101: PE 1 sends a first packet to ASBR 1.
[0449] CE 1 can obtain the IP address of CE 2 based on the learned VPN route. CE 1 can generate a packet whose destination address is the IP address of CE 2 and send the packet to PE 1. PE 1 can process the packet obtained from CE 1 based on the correspondence between L5 and the IP address of CE 2 to obtain a packet that includes a third VPN identifier, i.e., L5. PE 1 sends the first packet to ASBR 1 through the tunnel between PE 1 and ASBR 1.
[0450] S1102: ASBR 1 receives the first packet sent by PE 1.
[0451] ASBR 1 receives the first packet sent by PE 1 through the third tunnel. The first packet includes a third VPN identifier, namely L5. ASBR 1 can perform packet forwarding based on the third VPN identifier included in the first packet.
[0452] S1103: ASBR 1 obtains the second packet based on the first packet and the first correspondence.
[0453] ASBR 1 can generate a second packet based on the first packet and the correspondence between the third VPN identifier and the first VPN identifier included in the first correspondence. The second packet includes the first VPN identifier, i.e., L3.
[0454] For different types of VPN identifiers, the manner of processing the first packet to generate a second packet is different. In method 1100, the method for ASBR 1 to generate a second packet is the same as the method for ASBR 1 to generate a second packet in above-mentioned method 600. For details, please refer to the related description in S603.
[0455] S1104: ASBR 1 sends the second packet to ASBR 3.
[0456] ASBR 1 sends the second packet to ASBR 3 through the first tunnel.
[0457] The ASBR 3 can process the second packet based on the correspondence between L3 and L1 to obtain a packet including L1. The ASBR 3 sends the packet including L1 to the PE 3. The PE 3 can send the packet to the CE 2 based on the IP address of the CE 2 contained in the packet to complete the packet transmission.
[0458] In one example, ASBR 1 may determine to send the second packet to ASBR 3 through the first tunnel based on a pre-stored correspondence. The pre-stored correspondence on which ASBR 1 may base may specifically be a correspondence between a first VPN identifier, a third VPN identifier, and a first interface information. The first interface information may be a first tunnel ID or a first interface ID.
[0459] A fast route change can be formed in the network based on the first VPN route and the second VPN route, one of which is an active route and the other of which is a standby route.
[0460] In one possible implementation, the first VPN route is an active route and ASBR 3 is an active next hop. Before S1103 is executed, ASBR 1 can determine that ASBR 3 is reachable. ASBR 1 performs packet forwarding based on the first correspondence stored on the forwarding plane.
[0461] In another possible implementation, the second VPN route is an active route and ASBR 4 is an active next hop. The first VPN route is a standby route and ASBR 3 is a standby next hop. Before S1103 is executed, ASBR 1 can determine that ASBR 4 is unreachable. ASBR 1 performs packet forwarding by switching the correspondence and using the first correspondence stored on the forwarding plane. In this way, a fast switching on the forwarding plane can be implemented, and the time during which packet transmission cannot be performed normally in the network because ASBR 4 is down is reduced.
[0462] Based on the first VPN route and the second VPN route, load balancing can be formed in the network.
[0463] See Fig. 11b: In addition to S1101-S1104, the packet forwarding method provided in this embodiment of the present application may further include S1105-S1108.
[0464] S1105: PE 1 sends the third packet to ASBR 1.
[0465] The manner in which PE 1 generates the third packet is the same as the manner in which PE 1 generates the first packet in S1101, and the details will not be described again in this specification.
[0466] S1106: ASBR 1 obtains the third packet sent by PE 1.
[0467] ASBR 1 receives the third packet sent by PE 1 through the third tunnel. The third packet includes a third VPN identifier, namely L5. ASBR 1 can perform packet forwarding based on the third VPN identifier included in the third packet.
[0468] S1107: ASBR 1 processes the third packet based on the second correspondence to obtain the fourth packet.
[0469] ASBR 1 may process the third packet including the third VPN identifier based on the correspondence between the third VPN identifier and the second VPN identifier included in the second correspondence to generate a fourth packet, the fourth packet including the second VPN identifier, i.e., L4.
[0470] For different types of VPN identifiers, the method of generating the fourth packet is different. The method of ASBR 1 generating the fourth packet is similar to the above method of generating the second packet. Please refer to the above description.
[0471] S1108: ASBR 1 sends the fourth packet to ASBR 4.
[0472] ASBR 1 sends the fourth packet through the second tunnel to ASBR 4.
[0473] The ASBR 4 can process the fourth packet according to the correspondence between L4 and L2 to obtain a packet including L2. The ASBR 4 sends the packet including L2 to the PE 4. The PE 4 can send the packet to the CE 2 based on the IP address of the CE 2 contained in the packet to complete the packet transmission.
[0474] The above-mentioned scenarios 1 to 3 are all based on the network architecture shown in Fig. 1. In another possible implementation, the route advertisement method and packet forwarding method provided in the embodiments of the present application can be further applied to the network architecture shown in Fig. 3.
[0475] Scenario 4: The network architecture shown in Figure 3 is used as an example. Figure 12 is a schematic diagram of the network architecture in Scenario 4 according to an embodiment of the present application.
[0476] 13 is a schematic flowchart of a route advertisement method 1300 according to an embodiment of the present application. The method 1300 may be applied to the network scenario shown in FIG 3. The method 1300 includes steps S1301 to S1307.
[0477] S1301: PE 1 sends the first VPN route to Gateway 1.
[0478] For a description of the generation of the first VPN route by PE 1, please refer to the description of the generation of the first VPN route by PE 1 in the above method 500. The details will not be described again in this specification.
[0479] PE 1 sends the first VPN route to Gateway 1 through the first tunnel.
[0480] S1302: Gateway 1 receives the first VPN route sent by PE 1.
[0481] Gateway 1 is the endpoint of the first tunnel. Gateway 1 receives the first VPN route sent by PE 1 through the first tunnel.
[0482] S1303: PE 2 sends the second VPN route to the gateway 1.
[0483] For a description of generating a second VPN route by PE 2, please refer to the description of generating a second VPN route by PE 2 in the above method 500. The details will not be described again in this specification.
[0484] PE 2 sends the second VPN route through the second tunnel to Gateway 1.
[0485] S1304: The gateway 1 receives the second VPN route sent by the PE 2.
[0486] Gateway 1 is the endpoint of the second tunnel. Gateway 1 receives the second VPN route sent by PE 2 through the second tunnel.
[0487] S1305: The gateway 1 assigns a third VPN identifier to the first VPN route, and stores the correspondence between the first VPN identifier and the third VPN identifier on the forwarding plane.
[0488] S1306: The gateway 1 assigns a third VPN identifier to the second VPN route, and stores the correspondence between the second VPN identifier and the third VPN identifier on the forwarding plane.
[0489] In the method 1300, the process of gateway 1 performing S1305 and S1306 is similar to the process of ASBR 1 performing S505 and S506 in the above-mentioned method 500, respectively. For details, please refer to the description related to S505 and S506 in the method 500.
[0490] S1307: The gateway 1 advertises the third VPN route to the PE 3.
[0491] The third VPN route includes a third VPN identifier, a route prefix, an RD, and a third next hop.
[0492] The route prefix included in the third VPN route is the route prefix included in the first VPN route and is also the route prefix included in the second VPN route. The RD included in the third VPN route is the RD included in the first VPN route and is also the RD included in the second VPN route.
[0493] It should be noted that the route type of the third VPN route may be the same as or different from the route type of the first VPN route and the route type of the second VPN route. For details, please refer to the related description in S507. The details will not be described again in this specification.
[0494] The third next hop in the third VPN route is Gateway 1.
[0495] Gateway 1 is also the endpoint of a third tunnel. Gateway 1 is connected to PE 3 through the third tunnel. Gateway 1 sends a third VPN route to PE 3 through the third tunnel.
[0496] After obtaining the VPN route advertised by Gateway 1, PE 3 can generate a correspondence between L3, Gateway 1, and the IP address of CE 1. The VPN route advertised by ASBE 1 includes the IP address of CE 1.
[0497] Then, PE 3 advertises the learned VPN route to CE 2. CE 2 can send packets to CE 1 based on the learned VPN route.
[0498] With reference to the network architecture shown in FIG. 12, the following describes a packet forwarding method provided in an embodiment of the present application.
[0499] 14a is a schematic flowchart of a packet forwarding method 1400 according to an embodiment of the present application. The method 1400 may be applied to the network scenario shown in FIG 12. The method 1400 includes steps S1401 to S1404.
[0500] The forwarding plane of the gateway 1 includes a first correspondence and a second correspondence. The first correspondence includes a correspondence between a first VPN identifier and a third VPN identifier. The second correspondence includes a correspondence between the second VPN identifier and a third VPN identifier.
[0501] S1401: PE 3 sends a first packet to Gateway 1.
[0502] Based on the learned VPN route, CE 2 can obtain the IP address of CE 1. CE 2 can generate a packet whose destination address is the IP address of CE 1 and send the packet to PE 3. PE 3 can process the packet sent by CE 1 based on the correspondence between L3 and the IP address of CE 1 to obtain the first packet including L3.
[0503] PE 3 sends the first packet to Gateway 1 through the third tunnel.
[0504] S1402: The gateway 1 obtains the first packet sent by the PE 3.
[0505] The gateway 1 receives the first packet sent by the PE 3 through the third tunnel. The first packet includes a third VPN identifier, i.e., L3. The gateway 1 can forward the packet based on the third VPN identifier included in the first packet.
[0506] S1403: The gateway 1 obtains a second packet based on the first packet and the first correspondence.
[0507] The gateway 1 processes the first packet including the third VPN identifier based on the correspondence between the third VPN identifier and the first VPN identifier included in the first correspondence to obtain a second packet, the second packet including the first VPN identifier, i.e., L1.
[0508] For different types of VPN identifiers, the manner of processing the first packet to generate the second packet is different. The manner of gateway 1 generating the second packet is similar to the manner of ASBR 1 generating the second packet in the above-mentioned method 500. For details, please refer to the specific description of S603. The details will not be described again in this specification.
[0509] S1404: Gateway 1 sends the second packet to PE 1.
[0510] Gateway 1 sends the second packet to PE 1 through the first tunnel.
[0511] In one example, the gateway 1 may determine to send the second packet through the first tunnel to the PE 1 based on a pre-stored correspondence. The pre-stored correspondence on which the gateway 1 may base may specifically be a correspondence between a first VPN identifier, a third VPN identifier, and a first interface ID, or a correspondence between the first VPN identifier, a third VPN identifier, and a first tunnel ID.
[0512] The PE 1 may process the second packet, and based on the IP address of the CE 1 contained in the second packet, forward the processed packet to the CE 1 to perform packet transmission.
[0513] A fast route change can be formed in the network based on the first VPN route and the second VPN route, one of which is an active route and the other of which is a standby route.
[0514] In one possible implementation, the first VPN route is an active route and PE 1 is an active next hop. Before S1403 is executed, Gateway 1 can determine that PE 1 is reachable. Gateway 1 performs packet forwarding based on the first correspondence stored in the forwarding plane.
[0515] In another possible implementation, the second VPN route is an active route, and PE 2 is an active next hop. The first VPN route is a standby route, and PE 1 is a standby next hop. Before S1403 is executed, the gateway 1 can determine that PE 2 is unreachable. The gateway 1 performs packet forwarding based on the first correspondence stored on the forwarding plane, thereby implementing fast switching on the forwarding plane and reducing the time during which packet transmission cannot be normally performed in the network due to the failure of PE 2.
[0516] Based on the first VPN route and the second VPN route, load balancing can be formed in the network.
[0517] See Fig. 14b: In addition to S1401-S1404, the packet forwarding method provided in this embodiment of the present application may further include S1405-S1408.
[0518] S1405: PE 3 transmits the third packet to gateway 1.
[0519] The manner in which PE 3 generates the third packet is the same as the manner in which PE 3 generates the first packet in S1401, and the details will not be described again in this specification.
[0520] S1406: Gateway 1 obtains the third packet sent by PE 3.
[0521] The gateway 1 receives the third packet sent by the PE 3 through the third tunnel. The third packet includes a third VPN identifier, i.e., L3. The gateway 1 can forward the packet based on the third VPN identifier included in the third packet.
[0522] S1407: Gateway 1 processes the third packet based on the second correspondence to obtain a fourth packet.
[0523] Gateway 1 can process the third packet based on the correspondence between the third VPN identifier and the second VPN identifier contained in the second correspondence to generate a fourth packet, where the fourth packet includes the second VPN identifier, i.e., L2.
[0524] For different types of VPN identifiers, the manner of generating the fourth packet is different. The manner in which the gateway 1 generates the fourth packet is similar to the above manner of generating the second packet. Please refer to the above description.
[0525] S1408: The gateway 1 sends the fourth packet to the PE 2.
[0526] Gateway 1 sends the fourth packet to PE 2 through the second tunnel.
[0527] PE 2 may process the fourth packet, and based on the IP address of CE 1 contained in the fourth packet, forward the processed packet to CE 1 to perform packet transmission.
[0528] FIG. 15 is a schematic flow chart of a route advertisement method 1500 according to an embodiment of the present application.
[0529] The method 1500 may be applied to the network scenario shown in Figure 4. For example, when the method 1500 is applied to the scenario shown in Figure 4, in the method 1500, the first network device may be the ASBR 1 shown in Figure 4, the second network device may be the PE 1 shown in Figure 4, the third network device may be the PE 2 shown in Figure 4, and the fourth network device may be the ASBR 3 shown in Figure 4.
[0530] The method 1500 may alternatively be applied to the network scenario shown in Figure 8. For example, when the method 1500 is applied to the scenario shown in Figure 8, in the method 1500, the first network device may be ASBR 1 shown in Figure 8, the second network device may be PE 1 shown in Figure 8, the third network device may be ASBR 2 shown in Figure 8, and the fourth network device may be ASBR 3 shown in Figure 8.
[0531] Method 1500 may alternatively be applied to the network scenario shown in Figure 9. For example, when method 1500 is applied to the scenario shown in Figure 9, in method 1500, the first network device may be ASBR 1 shown in Figure 9, the second network device may be ASBR 3 shown in Figure 9, the third network device may be ASBR 4 shown in Figure 9, and the fourth network device may be PE 1 shown in Figure 9.
[0532] The method 1500 may alternatively be applied to the network scenario shown in Figure 12. For example, when the method 1500 is applied to the scenario shown in Figure 12, in the method 1500, the first network device may be the gateway 1 shown in Figure 12, the second network device may be the PE 1 shown in Figure 12, the third network device may be the PE 2 shown in Figure 12, and the fourth network device may be the PE 3 shown in Figure 12.
[0533] The method 1500 includes S1501 to S1505.
[0534] S1501: A first network device receives a first VPN route sent by a second network device.
[0535] The first network device is a network device that can assign VPN identifiers, advertise routes, and forward packets in the network. For example, the first network device may be a network device, such as a router, a switch, or a gateway, that has a VPN identifier assignment function, a route advertisement function, and a packet forwarding function.
[0536] The first network device can connect the first tunnel and the third tunnel, connect the second tunnel and the third tunnel, and perform stitching between the first tunnel and the third tunnel and stitching between the second tunnel and the third tunnel. The first network device can obtain a VPN route through the first tunnel and the second tunnel, and then advertise the VPN route through the third tunnel.
[0537] In one example, the first network device may be an autonomous system boundary device and configured to connect two autonomous systems. The first network device may be an ASBR. For example, in the scenarios shown in Figures 4, 8, and 9, the first network device is ASBR 1.
[0538] In another example, the first network device may be a device in the network, for example, in the scenario shown in FIG.
[0539] The first network device and the second network device are connected through a first tunnel. In one example, the second network device may be an IBGP peer of the first network device. See, for example, the scenarios shown in FIG. 4, FIG. 8, and FIG. 12. In another example, the second network device may be an EBGP peer of the first network device. See, for example, the scenario shown in FIG. 9. When the second network device is an EBGP peer of the first network device, the first tunnel is an inter-AS tunnel. The inter-AS stitching tunnel includes the first tunnel and the third tunnel.
[0540] The first VPN route includes a first VPN identifier, a route prefix, an RD, and a first next hop. The first next hop is a second network device. The first VPN identifier is associated with a first VPN instance. The first VPN instance is a VPN instance created by a network border device, e.g., a PE device, and associated with a VPN. When the second network device is a network border device, the first VPN instance may be created by the second network device. When the second network device is not a network border device, the first VPN instance may be created by a network border device connected to the second network device.
[0541] The type of the first VPN route is not limited in this embodiment of the present application. The first VPN route may be an EVPN route, a VPNv4 route, or a VPNv6 route.
[0542] The type of the first VPN identifier is determined based on the type of the first tunnel.
[0543] In one possible implementation, the first tunnel may be an MPLS tunnel, and the first VPN identifier may be an MPLS label. Note that the MPLS label in this embodiment of the present application may be an MPLS label defined in MPLS technology, or may be an SID defined in SR-MPLS technology. The SID defined in SR-MPLS technology is a format of an MPLS label.
[0544] In another possible implementation, the first tunnel may be an SRv6 tunnel and the first VPN identifier may be an SRv6 SID.
[0545] S1502: The first network device receives a second VPN route sent by a third network device.
[0546] The first network device and the third network device are connected through a second tunnel. The third network device may be an IBGP peer of the first network device. See, for example, the scenarios shown in Figures 4, 8, and 12. The third network device may be an EBGP peer of the first network device. See, for example, the scenario shown in Figure 9. When the third network device is an EBGP peer of the first network device, the second tunnel is an inter-AS tunnel.
[0547] The second VPN route includes a second VPN identifier, a route prefix, an RD, and a second next hop. The second next hop is a third network device. The second VPN identifier is associated with a second VPN instance. The second VPN instance is a VPN instance created by a network border device, e.g., a PE device. When the third network device is a network border device, the second VPN instance may be created by the third network device. When the third network device is not a network border device, the second VPN instance may be created by a network border device connected to the third network device.
[0548] The second VPN instance and the first VPN instance are created by different network devices and are associated with the same VPN.
[0549] The type of the second VPN route is not limited in this embodiment of the present application. The second VPN route may be an Ethernet Virtual Private Network EVPN route, a Virtual Private Network Version 4 VPNv4 route, or a Virtual Private Network Version 6 VPNv6 route. The type of the second VPN route is the same as the type of the first VPN route. The type of the second VPN route may be the same as the type of the first VPN route.
[0550] The type of the second VPN identifier is determined based on the type of the second tunnel.
[0551] In one possible implementation, the second tunnel may be an MPLS tunnel and the second VPN identifier may be an MPLS label.
[0552] In another possible implementation, the second tunnel may be an SRv6 tunnel and the second VPN identifier may be an SRv6 SID.
[0553] Note that the type of the first tunnel is the same as the type of the second tunnel, and correspondingly, the type of the first VPN identifier is the same as the type of the second VPN identifier.
[0554] S1503: The first network device assigns a third VPN identifier to the first VPN route and stores a first correspondence between the third VPN identifier and the first VPN identifier on the forwarding plane.
[0555] The first network device assigns the same VPN identifier to received VPN routes that have the same next hop and the same RD based on a one VPN identifier per next hop scheme.
[0556] The first network device assigns a third VPN identifier to the first VPN route.
[0557] The type of the third VPN identifier is determined based on a type of the third tunnel, the third tunnel being a tunnel between the first network device and a fourth network device.
[0558] In one possible implementation, the third tunnel may be an MPLS tunnel, and the third VPN identifier may be an MPLS label.
[0559] In another possible implementation, the third tunnel may be an SRv6 tunnel and the third VPN identifier may be an SRv6 SID.
[0560] It should be noted that the type of the third tunnel may be the same as or different from the type of the first tunnel. Correspondingly, the type of the third VPN identifier may be the same as or different from the type of the first VPN identifier. This embodiment of the present application provides four possible cases of the first VPN identifier type, the second VPN identifier type, and the third VPN identifier type, as follows:
[0561] In the first case, the first VPN identifier, the second VPN identifier, and the third VPN identifier are all MPLS labels.
[0562] In the second case, the first VPN identifier, the second VPN identifier, and the third VPN identifier are all SRv6 SIDs.
[0563] In a third case, the first VPN identifier and the second VPN identifier are SRv6 SIDs, and the third VPN identifier is an MPLS label.
[0564] In a fourth case, the first VPN identifier and the second VPN identifier are MPLS labels, and the third VPN identifier is an SRv6 SID.
[0565] In the fourth case, it is noted that in one example, the third VPN identifier may specifically be END.BM. END.BM indicates that the tunnel endpoint is bound to the SR-MPLS policy. The first network device may decapsulate the obtained SRv6 packet based on END.BM to obtain a packet payload, and then perform encapsulation based on the packet payload and the SR-MPLS policy to obtain an MPLS packet.
[0566] The first network device stores a first correspondence between the first VPN identifier and the third VPN identifier on a forwarding plane, and the first network device can process the packet including the third VPN identifier based on the first correspondence to obtain the packet including the first VPN identifier.
[0567] In one possible implementation, the first correspondence includes a correspondence between a third VPN identifier, the first VPN identifier, and a first tunnel ID. The first tunnel ID identifies the first tunnel. The first network device can forward packets including the first VPN identifier through the first tunnel based on the first correspondence.
[0568] In another possible implementation, the first correspondence includes a correspondence between the third VPN identifier, the first VPN identifier, and a first interface ID, the first interface ID being of the first network device and identifying an outbound interface connected to the first tunnel, and the first network device can determine to perform packet forwarding through the first tunnel connected to the outbound interface based on the first correspondence.
[0569] S1504: The first network device assigns a third VPN identifier to the second VPN route and stores a second correspondence between the third VPN identifier and the second VPN identifier on the forwarding plane.
[0570] The first network device assigns a third VPN identifier to the second VPN route.
[0571] The first network device stores a second correspondence between the second VPN identifier and the third VPN identifier on the forwarding plane, and the first network device can obtain a packet including the second VPN identifier through encapsulation based on the second correspondence.
[0572] In one possible implementation, the second correspondence includes a correspondence between a third VPN identifier, a second VPN identifier, and a second tunnel ID, the second tunnel ID identifying the second tunnel, and the first network device can obtain a packet including the second VPN identifier through encapsulation based on the second correspondence and forward the packet including the second VPN identifier through the second tunnel.
[0573] In another possible implementation, the second correspondence includes a correspondence between a third VPN identifier, a second VPN identifier, and a second interface ID, the second interface ID identifying an outbound interface of the first network device connected to the second tunnel, and the first network device can determine, based on the second correspondence, to perform packet forwarding through the second tunnel connected to the outbound interface.
[0574] The first VPN route and the second VPN route acquired by the first network device can form a fast route change or load balancing. In the conventional option B, the label assigned by the ASBR can correspond to only one next hop. In comparison, in the route advertisement method provided in this embodiment of the present application, the third VPN identifier can correspond to the first VPN identifier and the second VPN identifier separately. The first network device can support a fast route change or load balancing based on the first correspondence and the second correspondence stored on the forwarding plane to improve network performance.
[0575] S1505: The first network device advertises the third VPN route to the fourth network device.
[0576] The fourth network device may be an IBGP peer of the first network device, see, for example, the scenarios shown in Figure 9 or Figure 12. The fourth network device may be an EBGP peer of the first network device, see, for example, the scenarios shown in Figure 4 or Figure 8. When the fourth network device is an EBGP peer of the first network device, the third tunnel is an inter-AS tunnel.
[0577] The third VPN route includes a third VPN identifier, a route prefix, an RD, and a third next hop. The third next hop is the first network device. The route prefix included in the third VPN route is the same as the route prefix included in the first VPN route and is also the same as the route prefix included in the second VPN route. The RD included in the third VPN route is the same as the RD included in the first VPN route and is also the same as the RD included in the second VPN route.
[0578] The third VPN route is an EVPN route, a VPNv4 route, or a VPNv6 route. The route type of the third VPN route may be the same as or different from the route type of the first VPN route and the route type of the second VPN route.
[0579] For example, in one possible implementation, the route type of the first VPN route and the route type of the second VPN route may be an EVPN route, and the route type of the third VPN route may be a VPNv4 route or a VPNv6 route. As another example, in another possible implementation, the route type of the first VPN route and the route type of the second VPN route may be a VPNv4 route or a VPNv6 route, and the route type of the third VPN route may be an EVPN route.
[0580] The embodiment of the present application further provides a packet forwarding method. The packet forwarding method is applicable to a first network device. The first network device stores a first correspondence and a second correspondence. The first correspondence includes a correspondence between a first VPN identifier and a third VPN identifier. The second correspondence includes a correspondence between a second VPN identifier and a third VPN identifier. In a scenario in which fast route change is implemented based on the first VPN route and the second VPN route, the first network device can switch the correspondence in the first correspondence and the second correspondence to guide packet forwarding. In a scenario in which load balancing is implemented based on the first VPN route and the second VPN route, the first network device can use the first correspondence and the second correspondence to guide packet forwarding. In this way, fast route change or load balancing formed by those routes can be supported, and network performance can be improved.
[0581] FIG. 16a is a schematic flow chart of a packet forwarding method 1600 according to an embodiment of the present application.
[0582] The method 1600 may be applied to the network scenario shown in Figure 4. For example, when the method 1600 is applied to the scenario shown in Figure 4, in the method 1600, the first network device may be the ASBR 1 shown in Figure 4, the second network device may be the PE 1 shown in Figure 4, the third network device may be the PE 2 shown in Figure 4, and the fourth network device may be the ASBR 3 shown in Figure 4.
[0583] The method 1600 may alternatively be applied to the network scenario shown in Figure 8. For example, when the method 1600 is applied to the scenario shown in Figure 8, in the method 1600, the first network device may be ASBR 1 shown in Figure 8, the second network device may be PE 1 shown in Figure 8, the third network device may be ASBR 2 shown in Figure 8, and the fourth network device may be ASBR 3 shown in Figure 8.
[0584] The method 1600 may alternatively be applied to the network scenario shown in Figure 9. For example, when the method 1600 is applied to the scenario shown in Figure 9, in the method 1600, the first network device may be ASBR 1 shown in Figure 9, the second network device may be ASBR 3 shown in Figure 9, the third network device may be ASBR 4 shown in Figure 9, and the fourth network device may be PE 1 shown in Figure 9.
[0585] The method 1600 may alternatively be applied to the network scenario shown in Figure 12. For example, when the method 1600 is applied to the scenario shown in Figure 12, in the method 1600, the first network device may be the gateway 1 shown in Figure 12, the second network device may be the PE 1 shown in Figure 12, the third network device may be the PE 2 shown in Figure 12, and the fourth network device may be the PE 3 shown in Figure 12.
[0586] The method 1600 includes steps S1601 to S1603.
[0587] S1601: A first network device obtains a first packet sent by a fourth network device.
[0588] The first network device is a network device capable of forwarding packets within a network. For example, the first network device may be a network device having a packet forwarding function, such as a router, a switch, or a gateway.
[0589] The first network device can connect the first tunnel and the third tunnel and connect the second tunnel and the third tunnel. The first network device can perform stitching between the first tunnel and the third tunnel and stitching between the second tunnel and the third tunnel.
[0590] The first network device may obtain the packets through the third tunnel and then transmit the obtained packets through one or more of the first tunnel and the second tunnel.
[0591] In one example, the first network device may be an autonomous system boundary device and configured to connect two autonomous systems. The first network device may be an ASBR. For example, in the scenarios shown in Figures 4, 8, and 9, the first network device is ASBR 1.
[0592] In another example, the first network device may be a device in the network, for example, in the scenario shown in FIG.
[0593] The first network device and the fourth network device are connected through a third tunnel. The fourth network device may be an IBGP peer of the first network device. See, for example, the scenarios shown in Figures 4, 8, and 12. Alternatively, the fourth network device may be an EBGP peer of the first network device. See, for example, the scenario shown in Figure 9. When the fourth network device is an EBGP peer of the first network device, the third tunnel is an inter-AS tunnel.
[0594] The first network device receives a first packet transmitted by the fourth network device through a third tunnel, the first packet including a third VPN identifier.
[0595] S1602: The first network device processes the first packet based on the first correspondence to obtain a second packet.
[0596] After obtaining the first packet, the first network device can determine a first VPN identifier that corresponds to the third VPN identifier based on the third VPN identifier included in the first packet and the first correspondence.
[0597] The first network device processes the first packet based on the first correspondence to obtain a second packet that includes the first VPN identifier.
[0598] Among some possible implementations, this embodiment of the present application provides four specific implementations in which a first packet is processed based on a first correspondence to obtain a second packet.
[0599] In a first implementation, both the first packet and the second packet are MPLS packets.
[0600] In this case, both the third VPN identifier and the first VPN identifier are MPLS labels.
[0601] The first network device replaces the third VPN identifier included in the first packet with the first VPN identifier based on the first correspondence.
[0602] Specifically, the MPLS packet header of the first packet includes a third VPN identifier. The first network device removes the third VPN identifier included in the first packet and encapsulates the first VPN identifier in a packet obtained by removing the third VPN identifier to obtain a second packet. The second packet includes the first VPN identifier.
[0603] In a second implementation, both the first packet and the second packet are SRv6 packets.
[0604] In this case, both the third VPN identifier and the first VPN identifier are SRv6 SIDs.
[0605] The first network device replaces the third VPN identifier included in the first packet with the first VPN identifier.
[0606] Specifically, the destination address of the first packet is the third VPN identifier. ASBR 1 replaces the destination address of the first packet with the first VPN identifier to obtain a second packet. The destination address of the second packet is the first VPN identifier.
[0607] In a third implementation, the first packet is an MPLS packet and the second packet is an SRv6 packet.
[0608] In this case, the third VPN identifier is an MPLS label and the first VPN identifier is an SRv6 SID.
[0609] Specifically, the first network device decapsulates the first packet and removes the MPLS packet header to obtain a packet payload. The first network device performs SRv6 encapsulation on the obtained packet payload to obtain a second packet. The destination address of the second packet is the first VPN identifier.
[0610] In a fourth implementation, the first packet is an SRv6 packet and the second packet is an MPLS packet.
[0611] In this case, the third VPN identifier is an SRv6 SID and the first VPN identifier is an MPLS label.
[0612] Specifically, the first network device decapsulates the first packet and removes the IPv6 packet header to obtain a packet payload. The first network device performs MPLS encapsulation on the obtained packet payload to obtain a second packet. The MPLS packet header of the second packet includes the first VPN identifier.
[0613] In one possible implementation, in one example, the third VPN identifier may specifically be END.BM. END.BM indicates that the tunnel endpoint is bound to an SR-MPLS policy. In this embodiment of the present application, the first network device is used as an endpoint of the third tunnel and decapsulates the first packet based on the END.BM included in the first packet. The first network device reencapsulates the packet payload based on the SR-MPLS policy indicating the first tunnel to obtain a second packet.
[0614] S1603: The first network device sends a second packet to the second network device through the first tunnel.
[0615] The method for determining by the first network device to send the second packet to the second network device through the first tunnel is not limited in this embodiment of the present application. The following provides three possible implementations:
[0616] In one example, the first correspondence includes a correspondence between a first VPN identifier, a third VPN identifier, and a first tunnel ID. The first tunnel ID identifies the first tunnel. The first network device can determine, based on the first correspondence, to forward the second packet through the first tunnel identified by the first tunnel ID.
[0617] In another example, the first correspondence includes a correspondence between a first VPN identifier, a third VPN identifier, and a first interface ID. The first interface ID identifies an outbound interface of the first network device connected to the first tunnel. The first network device can determine, based on the first correspondence, to forward the second packet through the first tunnel connected to the outbound interface.
[0618] In yet another example, the first network device may pre-store a correspondence between a first VPN identifier and a first tunnel ID, the first tunnel ID identifying the first tunnel, and the first network device may determine, based on the correspondence between the first VPN identifier and the first tunnel ID, to forward the second packet including the first VPN identifier through the first tunnel identified by the first tunnel ID.
[0619] In one possible implementation, based on the first response and the second response, the network can support fast rerouting.
[0620] The second network device may be an active next hop, and the third network device may be a standby next hop. Before S1603 is performed, the first network device may determine that the second network device is reachable. The first network device performs packet forwarding based on the first correspondence stored in the forwarding plane.
[0621] In another possible implementation, the second VPN route is an active route and the third network device is an active next hop. The first VPN route is a standby route and the second network device is a standby next hop. Before S1603 is executed, the first network device can determine that the third network device is unreachable. The first network device performs packet forwarding based on the first correspondence stored in the forwarding plane to implement fast switching on the forwarding plane and perform packet transmission by using the standby route, thereby reducing the time during which packet transmission cannot be performed normally in the network due to the failure of the third network device.
[0622] In another possible implementation, based on the first response and the second response, the network may support load balancing.
[0623] See Fig. 16b. In addition to S1601-S1603, the packet forwarding method provided in this embodiment of the present application may further include S1604-S1606.
[0624] S1604: The first network device obtains a third packet sent by the fourth network device.
[0625] The manner in which the fourth network device generates the third packet is the same as the manner in which the fourth network device generates the first packet in S1601, and the details will not be described again in this specification.
[0626] The first network device receives a third packet transmitted by the fourth network device through the third tunnel, the third packet including a third VPN identifier, and the first network device can perform packet forwarding based on the third VPN identifier included in the third packet.
[0627] S1605: The first network device obtains a fourth packet based on the third packet and the second correspondence.
[0628] The first network device can process the third packet based on the correspondence between the third VPN identifier and the second VPN identifier included in the second correspondence to generate a fourth packet, the fourth packet including the second VPN identifier.
[0629] For different types of VPN identifiers, the manner in which the fourth packet is generated is different. The manner in which the first network device generates the fourth packet is similar to the above-mentioned manner in which the first network device generates the second packet. Please refer to the above description.
[0630] S1606: The first network device sends a fourth packet to the third network device.
[0631] The first network device sends the fourth packet through the second tunnel to the third network device.
[0632] The manner in which the first network device determines to send the fourth packet through the second tunnel is similar to the aforementioned manner in which the first network device determines to send the second packet through the first tunnel. The following provides three possible implementations:
[0633] In one example, the second correspondence includes a correspondence between a second VPN identifier, a third VPN identifier, and a second tunnel ID. The second tunnel ID identifies the second tunnel. The first network device can determine, based on the second correspondence, to forward the fourth packet through the second tunnel identified by the second tunnel ID.
[0634] In another example, the second correspondence includes a correspondence between a second VPN identifier, a third VPN identifier, and a second interface ID. The second interface ID identifies an outbound interface of the first network device connected to the second tunnel. The first network device can determine, based on the second correspondence, to forward the fourth packet through the second tunnel connected to the outbound interface.
[0635] In yet another example, the first network device can store a correspondence between a second VPN identifier and a second tunnel ID, the second tunnel ID identifying the second tunnel, and the first network device can determine, based on the correspondence between the second VPN identifier and the second tunnel ID, to forward the fourth packet through the second tunnel identified by the second tunnel ID.
[0636] FIG. 17 is a possible schematic diagram of the structure of the network device in the aforementioned embodiments. The network device may perform the functions of the first network device in the method 500, the method 800, the method 1000, the method 1300, and the method 1500. Refer to FIG. 17. The apparatus includes a transceiver module 1701 and a processing module 1702. These modules may perform the corresponding functions of the first network device in the examples of the method 500, the method 800, the method 1000, the method 1300, and the method 1500.
[0637] In one example, referring to FIG. 5, the transceiver module 1701 is configured to support the network device in performing S502, S503, and S507 of FIG. 5, and the processing module 1702 is configured to support the network device in performing S502 and S504-S506 of FIG. 5, and / or another process performed by the first network device in the technology herein. For example, the transceiver module 1701 is configured to perform various operations related to receiving and / or transmitting performed by the first network device in the aforementioned method embodiments; the processing module 1702 is configured to perform various processing operations of the first network device in the aforementioned method embodiments. For example, the transceiver module 1701 is configured to receive a first VPN route sent by PE 1, receive a second VPN route sent by PE 2, and advertise a third VPN route to ASBR 3. The processing module 1702 is configured to assign a third VPN identifier to the first VPN route, store the correspondence between the first VPN identifier and the third VPN identifier in the forwarding plane, assign a third VPN identifier to the second VPN route, and store the correspondence between the second VPN identifier and the third VPN identifier in the forwarding plane. For a specific execution process, please refer to the detailed description of the corresponding steps in the embodiment shown in Figure 5. The details will not be described again in this specification.
[0638] Similarly, the transceiver module 1701 may perform various operations related to reception and / or transmission performed by the first network device in the methods 800, 1000, 1300, and 1500; the processing module 1702 is configured to perform various processing operations of the first network device in the examples of the methods 600 to 1600. For specific execution processes, please refer to the detailed description of the corresponding steps in the embodiments shown in the methods 800, 1000, 1300, and 1500. The details will not be described again in this specification.
[0639] FIG. 18 is a possible schematic diagram of the structure of the network device in the aforementioned embodiments. The network device may perform the functions of the first network device in the methods 600, 900, 1100, 1400, and 1600. Refer to FIG. 18. The network device includes a transceiver module 1801 and a processing module 1802. These modules may perform the corresponding functions of the first network device in the examples of the methods 600, 900, 1100, 1400, and 1600.
[0640] In one example, referring to FIG. 6a, the transceiver module 1801 is configured to support the network device in executing S602 of FIG. 6a, and the processing module 1802 is configured to support the network device in executing S603 of FIG. 6a, and / or another process performed by the first network device in the technology herein. For example, the transceiver module 1801 is configured to perform various operations related to receiving and / or transmitting performed by the first network device in the aforementioned method embodiment; the processing module 1802 is configured to perform various processing operations of the first network device in the aforementioned method embodiment. For example, the transceiver module 1801 is configured to receive a first packet transmitted by ASBR 3 and transmit a second packet to PE 1. The processing module 1802 is configured to process the first packet based on the first correspondence to obtain a second packet. For the specific execution process, please refer to the detailed description of the corresponding step in the embodiment shown in FIG. 6a. The details will not be described again in this specification.
[0641] Similarly, the transceiver module 1801 may perform various operations related to reception and / or transmission performed by the first network device in the examples of the method 900, the method 1100, the method 1400, and the method 1600; the processing module 1802 is configured to perform various processing operations of the first network device in the method 900, the method 1100, the method 1400, and the method 1600. For specific execution processes, please refer to the detailed description of the corresponding steps in the embodiments shown in the method 900, the method 1100, the method 1400, and the method 1600. The details will not be described again in this specification.
[0642] It should be noted that in the embodiment of the present application, the division into modules is an example, and is merely a logical division of functions. In actual implementation, other division methods may be used. The functional modules in the embodiment of the present application may be integrated into one processing module, and each of the modules may exist physically alone, or two or more modules may be integrated into one unit. For example, in the above embodiment, the acquisition unit and the processing unit may be the same module or different modules. The integrated module may be implemented in the form of hardware or in the form of a software functional module.
[0643] Refer to FIG. 19. An embodiment of the present invention provides a network system 1900. The system 1900 is configured to implement the route advertisement method and the packet forwarding method in the aforementioned method embodiment. The system 1900 includes a network device 1901, a network device 1902, a network device 1903, and a network device 1904. The network device 1901 may implement the function of the first network device in the aforementioned method embodiment, the network device 1902 may implement the function of the second network device in the aforementioned method embodiment, the network device 1903 may implement the function of the third network device in the aforementioned method embodiment, and the network device 1904 may implement the function of the fourth network device in the aforementioned method embodiment. For the specific execution process, please refer to the detailed description of the corresponding steps in the aforementioned method embodiment. The details will not be described again one by one in this specification.
[0644] Fig. 20 is a schematic diagram of a structure of a device 2000 according to an embodiment of the present application. The network device 1700 of Fig. 17 and the network device 2000 of Fig. 18 may be implemented by using the device shown in Fig. 20. Referring to Fig. 20, the device 2000 includes at least one processor 2001, a communication bus 2002, and at least one network interface 2004. Optionally, the device 2000 may further include a memory 2003.
[0645] The processor 2001 may be a general-purpose central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits (ICs) configured to control program execution of the solutions in the present application. The processor may be configured to process packets and implement the packet transmission method provided in the embodiments of the present application.
[0646] For example, when the first network device of FIG. 15 is implemented by using the device shown in FIG. 20, the processor may be configured to assign a third VPN identifier to the first VPN route, store a first correspondence between the third VPN identifier and the first VPN identifier in the forwarding plane, and assign the third VPN identifier to the second VPN route, store a second correspondence between the third VPN identifier and the second VPN identifier in the forwarding plane. For specific functional implementation, please refer to the processing portion corresponding to the first network device in the method embodiment. In another example, when the first network device of FIG. 16 is implemented by using the device shown in FIG. 20, the processor may be configured to process the first packet based on the first correspondence to obtain a second packet. For specific functional implementation, please refer to the processing portion of the first network device in the method embodiment.
[0647] The communication bus 2002 is configured to transfer information between the processor 2001 , the network interface 2004 , and the memory 2003 .
[0648] The memory 2003 may be a read-only memory (ROM) or another type of static storage device that may store static information and instructions. The memory 2003 may alternatively be a random access memory (RAM) or another type of dynamic storage device that may store information and instructions, or may be, but is not limited to, a compact disc read-only memory (CD-ROM) or another optical disk storage, optical disk storage (including compact disks, laser disks, optical disks, digital versatile disks, Blu-ray® disks, etc.), disk storage media or another magnetic storage device, or any other medium that may be configured to carry or store anticipated program code in the form of instructions or data structures and that may be accessed by a computer. The memory 2003 may exist independently and is connected to the processor 2001 through a communication bus 2002. Alternatively, the memory 2003 and the processor 2001 may be integrated together.
[0649] Optionally, the memory 2003 is configured to store program codes or instructions for executing the solutions in the present application, and the processor 2001 controls the execution. The processor 2001 is configured to execute the program codes or instructions stored in the memory 2003. The program codes may include one or more software modules. Optionally, the processor 2001 may alternatively store program codes or instructions for executing the solutions in the present application. In this case, the processor 2001 does not need to read the program codes or instructions from the memory 2003.
[0650] The network interface 2004 may be a device, such as a transceiver, configured to communicate with another device or a communication network. The communication network may be an Ethernet, a radio access network (RAN), a wireless local area network (WLAN), or the like. In this embodiment of the present application, the network interface 2004 may be configured to receive packets sent by another node in the segment routing network, or may send packets to another node in the segment routing network. The network interface 2004 may be an Ethernet interface, a fast Ethernet (FE) interface, a gigabit Ethernet (GE) interface, or the like.
[0651] Among specific implementations, in one embodiment, device 2000 may include multiple processors, such as processor 2001 and processor 2005 in FIG. 20. Each processor may be a single-core (single-CPU) processor or a multi-core (multiple-CPU) processor. A processor herein may be one or more devices, circuits, and / or processing cores configured to process data (e.g., computer program instructions).
[0652] FIG. 21 is a schematic diagram of the structure of a device 2100 according to an embodiment of the present application. The first network device in the embodiment of the method described above can be implemented based on the device 2100. Please refer to the schematic diagram of the structure of the device shown in FIG. 21. The device 2100 includes a main control board and one or more interface boards. The main control board is communicatively connected to the interface boards. The main control board is also called a main processing unit (MPU) or a route processor card. The main control board includes a CPU and a memory, and is responsible for controlling and managing each component in the device 2100, including route calculation, and device management and maintenance functions. The interface board is also called a line processing unit (LPU) or a line card, and is configured to receive and transmit packets. In some embodiments, the main control board communicates with the interface boards through a bus, or the interface boards communicate with each other through a bus. In some embodiments, the interface boards communicate with each other through a switching board. In this case, the device 2100 also includes a switching board. The switching board is communicatively connected to the main control board and the interface boards and configured to transfer data between the interface boards. The switching board may be referred to as a switch fabric unit (SFU). The interface board includes a CPU, a memory, a forwarding engine, and an interface card (IC). The interface card may include one or more network interfaces. The network interface may be an Ethernet interface, a FE interface, a GE interface, etc. The CPU is communicatively connected to the memory, the forwarding engine, and the interface card. The memory is configured to store the correspondence.The forwarding engine is configured to forward the received packets based on the correspondence stored in the memory. The forwarding engine may be a network processor (NP). An interface card, also called a sub-card, may be installed on the interface board. The interface card is responsible for converting optical / electrical signals into data frames, checking the validity of the data frames, and forwarding the data frames to the forwarding engine for processing or to the CPU of the interface board. In some embodiments, the CPU may also perform the functions of the forwarding engine, such as implementing software forwarding based on a general-purpose CPU, so that a forwarding engine is not required in the interface board. In some embodiments, the forwarding engine may be implemented by using an ASIC or a field programmable gate array (FPGA). In some embodiments, the memory that stores the forwarding table may alternatively be integrated into the forwarding engine and used as part of the forwarding engine.
[0653] An embodiment of the present application further provides a chip system including a processor, the processor being coupled to a memory, the memory being configured to store a program or instruction, the program or instruction being executed by the processor, the chip system being enabled to perform the method performed by the first network device in the method embodiment described above.
[0654] Optionally, there may be one or more processors in the chip system. The processor may be implemented by using hardware or by using software. When the processor is implemented by using hardware, the processor may be a logic circuit, an integrated circuit, etc. When the processor is implemented by using software, the processor may be a general-purpose processor and is implemented by reading software code stored in a memory.
[0655] Optionally, there may be one or more memories in the chip system. The memory may be integrated with the processor or may be located separately from the processor. This is not limited in this application. For example, the memory may be a non-transitory processor, such as a read-only memory ROM. The memory and the processor may be integrated on the same chip or may be located separately on different chips. The type of memory and the manner of arranging the memory and the processor are not particularly limited in this application.
[0656] For example, the chip system may be an FPGA, an ASIC, a system on chip (SoC), a CPU, an NP, a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or another integrated chip.
[0657] It should be understood that the steps in the above-described method embodiments may be completed by using instructions in the form of hardware integrated logic circuits or software in a processor. The steps of the methods disclosed with reference to the embodiments of the present application may be performed and completed directly by a hardware processor, or may be performed and completed by using a combination of hardware and software modules in a processor.
[0658] An embodiment of the present application further provides a computer-readable storage medium containing instructions, which when executed on a computer, enable the computer to perform the method in the aforementioned embodiment.
[0659] In the specification, claims, and accompanying drawings of this application, terms such as "first," "second," "third," "fourth," etc. are intended to distinguish between similar objects, but do not necessarily indicate a particular sequence or order. It should be understood that such designated data are interchangeable in appropriate circumstances, and as a result, the embodiments described herein may be performed in an order other than that illustrated or described herein. Furthermore, the terms "comprise," "have," and any variations thereof are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or device that includes a list of steps or units is not necessarily limited to the steps or units expressly listed, and may include other steps or units that are not expressly listed or that are inherent in the process, method, product, or device.
[0660] As used herein, "at least one" means one or more, and "multiple" means two or more. "At least one of" or similar phrases refers to any combination of those items, including any combination of singular or multiple items. For example, at least one of a, b, or c may refer to a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, and c may be singular or plural. As used herein, "A and / or B" is considered to include A only, B only, and A and B.
[0661] For the sake of convenience, those skilled in the art can clearly understand that the detailed operation processes of the above-mentioned systems, devices and units may refer to the corresponding processes in the above-mentioned method embodiments, and the details will not be described again in this specification.
[0662] In some embodiments provided in the present application, it should be understood that the disclosed system, device, and method may be implemented in other manners. For example, the device embodiment described above is merely an example. For example, the division into units is merely a logical module division, and may be other divisions in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented. In addition, the shown or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces. Indirect couplings or communication connections between devices or units may be implemented electrically, mechanically, or in other ways.
[0663] The units described as separate parts may or may not be physically separate, and the parts shown as units may or may not be physical units, i.e., they may be located in one location or distributed over multiple network units. Some or all of the units may be obtained based on the actual requirements to achieve the objectives of the solutions of the embodiments.
[0664] In addition, the module units in the embodiments of the present application may be integrated into one processing unit, and each of the units may exist physically alone, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware or in the form of a software module unit.
[0665] When the integrated unit is implemented in the form of a software module unit and sold or used as an independent product, the integrated unit may be stored in a computer-readable storage medium. Based on such understanding, the technical solution in the present application, the part that contributes to the prior art, or all or part of the technical solution may be implemented in the form of a software product. The computer software product is stored in a storage medium and includes some instructions for instructing a computer device (which may be a personal computer, a server, a network device, etc.) to execute all or part of the steps of the method in the embodiments of the present application. The aforementioned storage medium includes any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0666] Those skilled in the art should recognize that the functions described in the present invention in one or more of the above examples can be implemented by hardware, software, firmware, or any combination thereof. When the functions are implemented by using software, the functions may be stored on a computer-readable medium or transmitted as one or more instructions or codes in a computer-readable medium. Computer-readable media include computer storage media and communication media. Communication media include any medium that allows a computer program to be transmitted from one place to another. Storage media may be any reachable medium accessible to a general-purpose or special-purpose computer.
[0667] The objectives, technical solutions and beneficial effects of the present invention are described in more detail in the above specific implementations. It should be understood that the above description is merely a specific implementation of the present invention.
[0668] In conclusion, the above embodiments are merely intended to describe the technical solutions in this application, and are not intended to limit the application. Although the present application has been described in detail with reference to the above embodiments, it should be understood that those skilled in the art can still make modifications to the technical solutions described in the above embodiments, or make equivalent substitutions to some technical features thereof. However, these modifications or substitutions do not cause the essence of the corresponding technical solutions to depart from the scope of the technical solutions in the embodiments of the present application.
Claims
1. 1. A route advertisement method, comprising: receiving, by a first network device, a first virtual private network VPN route sent by a second network device, the first VPN route including a first VPN identifier, a route prefix, a route discriminator RD, and a first next hop, the first next hop being the second network device, the first network device communicating with the second network device through a first tunnel, the first network device being a tunnel endpoint of the first tunnel, and the first VPN identifier being associated with a first VPN instance; receiving, by the first network device, a second VPN route sent by a third network device, the second VPN route including a second VPN identifier, the route prefix, the RD, and a second next hop, the second next hop being the third network device, the first network device communicating with the third network device through a second tunnel, the first network device being a tunnel endpoint of the second tunnel, the second VPN identifier being associated with a second VPN instance, and the first VPN instance and the second VPN instance being associated with a same VPN; assigning, by the first network device, a third VPN identifier to the first VPN route and storing a first correspondence between the third VPN identifier and the first VPN identifier on a forwarding plane, wherein the first network device assigns the same VPN identifier to received VPN routes having the same next hop and the same RD based on a one VPN identifier per next hop scheme; assigning, by the first network device, the third VPN identifier to the second VPN route and storing, on the forwarding plane, a second correspondence between the third VPN identifier and the second VPN identifier; advertising, by the first network device, a third VPN route to a fourth network device, the third VPN route including the third VPN identifier, the route prefix, the RD, and a third next hop, the third next hop being the first network device, the first network device communicating with the fourth network device through a third tunnel, the first network device being a tunnel endpoint of the third tunnel; method.
2. 2. The method of claim 1, wherein the first correspondence includes a correspondence between the third VPN identifier, the first VPN identifier, and a first tunnel identifier ID, where the first tunnel ID identifies the first tunnel; and the second correspondence includes a correspondence between the third VPN identifier, the second VPN identifier, and a second tunnel identifier ID, where the second tunnel ID identifies the second tunnel.
3. 3. The method of claim 1, wherein the first VPN route, the second VPN route, and the third VPN route are Ethernet Virtual Private Network EVPN routes, Virtual Private Network Version 4 VPNv4 routes, or Virtual Private Network Version 6 VPNv6 routes.
4. 4. The method of claim 1, wherein the first VPN identifier is a first MPLS label, the second VPN identifier is a second MPLS label, and the third VPN identifier is a third MPLS label.
5. 4. The method of claim 1, wherein the first VPN identifier is a first MPLS label, the second VPN identifier is a second MPLS label, and the third VPN identifier is a segment identifier SRv6 SID for segment routing over Internet Protocol version 6.
6. 4. The method of claim 1, wherein the first VPN identifier is a first SRv6 SID, the second VPN identifier is a second SRv6 SID, and the third VPN identifier is an MPLS label.
7. 4. The method of claim 1, wherein the first VPN identifier is a first SRv6 SID, the second VPN identifier is a second SRv6 SID, and the third VPN identifier is a third SRv6 SID.
8. The method further comprises: receiving, by the first network device, a first packet transmitted by the fourth network device through the third tunnel, the first packet including the third VPN identifier; processing, by the first network device, the first packet based on the first correspondence to obtain a second packet, the second packet including the first VPN identifier; transmitting, by the first network device, the second packet through the first tunnel to the second network device.
8. The method according to any one of claims 1 to 7.
9. The method of claim 1 , wherein the first VPN route and the second VPN route form a fast route change.
10. 10. The method of claim 9, wherein the first VPN route is an active route and the second VPN route is a standby route.
11. The first VPN route and the second VPN route form a fast route change, the first VPN route is a standby route, and the second VPN route is an active route, and the method further includes: determining, by the first network device after receiving the first packet and before processing the first packet based on the first correspondence, that the active route is unreachable. The method according to claim 8.
12. The method according to claim 1 , wherein the first VPN route and the second VPN route form a load balancer.
13. The first VPN route and the second VPN route form a load distribution, and the method further includes: receiving, by the first network device through the third tunnel, a third packet transmitted by the fourth network device, the third packet including the third VPN identifier; processing, by the first network device, the third packet based on the second correspondence to obtain a fourth packet, the fourth packet including the second VPN identifier; transmitting, by the first network device, the fourth packet through the second tunnel to the third network device. The method according to claim 8.
14. 14. The method of claim 1, wherein the first tunnel and the third tunnel form a suture tunnel.
15. 15. The method of claim 14, wherein the first tunnel and the third tunnel form an AS-interstitial suture tunnel.
16. 16. The method of claim 1, wherein the first network device is a first Autonomous System Boundary Router (ASBR), the fourth network device is a second ASBR, and an Exterior Border Gateway Protocol (EBGP) peer is established between the first ASBR and the second ASBR.
17. 16. The method of claim 1, wherein the first network device is a third ASBR, the fourth network device is a first Provider Edge PE device, and an Internal Border Gateway Protocol (IBGP) peer is established between the third ASBR and the first PE device.
18. 16. The method of claim 1, wherein the first network device is an extensible gateway xGW, the fourth network device is a second PE device, and an Internal Border Gateway Protocol (IBGP) peer is established between the xGW and the second PE device.
19. 1. A method for forwarding a packet, comprising: obtaining, by a first network device, a first packet transmitted by a fourth network device, the first packet including a third VPN identifier, the first network device communicating with the fourth network device through a third tunnel, the first network device being a tunnel endpoint of the third tunnel, the first network device communicating with a second network device through a first tunnel, the first network device being a tunnel endpoint of the first tunnel, the first network device communicating with a third network device through a second tunnel, the first network device being a tunnel endpoint of the second tunnel, a first correspondence between the first VPN identifier and the third VPN identifier and a second correspondence between the second VPN identifier and the third VPN identifier are stored on a forwarding plane of the first network device; processing, by the first network device, the first packet based on the first correspondence to obtain a second packet, the second packet including the first VPN identifier; transmitting, by the first network device, the second packet through the first tunnel to the second network device. method.
20. 20. The method of claim 19, wherein the first tunnel and the second tunnel form a fast reroute.
21. 21. The method of claim 20, wherein the first tunnel is an active tunnel and the second tunnel is a standby tunnel.
22. 21. The method of claim 20, wherein the first tunnel is a standby tunnel and the second tunnel is an active tunnel.
23. After the step of obtaining, by a first network device, a first packet transmitted by a fourth network device and before obtaining, by the first network device, a second packet based on the first packet and the first correspondence, the method further includes: determining, by the first network device, that the third network device is unreachable; 23. The method of claim 22.
24. The first tunnel and the second tunnel form a load balancer, and the method further includes: obtaining, by the first network device, a third packet, the third packet including the third VPN identifier; processing, by the first network device, the third packet based on the second correspondence to obtain a fourth packet, the fourth packet including the second VPN identifier; transmitting, by the first network device, the fourth packet through the second tunnel to the third network device.
20. The method of claim 19.
25. 25. The method of claim 19, wherein the first VPN identifier is a first MPLS label, the second VPN identifier is a second MPLS label, and the third VPN identifier is a third MPLS label.
26. 25. The method of claim 19, wherein the first VPN identifier is a first MPLS label, the second VPN identifier is a second MPLS label, and the third VPN identifier is a segment identifier SRv6 SID for segment routing over Internet Protocol version 6.
27. 25. The method of claim 19, wherein the first VPN identifier is a first SRv6 SID, the second VPN identifier is a second SRv6 SID, and the third VPN identifier is an MPLS label.
28. 25. The method of claim 19, wherein the first VPN identifier is a first SRv6 SID, the second VPN identifier is a second SRv6 SID, and the third VPN identifier is a third SRv6 SID.
29. 25. The method of any one of claims 19 to 24, wherein the first packet is a first MPLS packet and the second packet is a second MPLS packet.
30. 25. The method of claim 19, wherein the first packet is a first SRv6 packet and the second packet is a second SRv6 packet.
31. 25. The method of claim 19, wherein the first packet is a third MPLS packet and the second packet is a third SRv6 packet.
32. 25. The method of claim 19, wherein the first packet is a fourth SRv6 packet and the second packet is a fourth MPLS packet.
33. 33. The method of claim 19, wherein the first correspondence comprises a correspondence between the third VPN identifier, the first VPN identifier, and a first tunnel identifier ID, the first tunnel ID identifying the first tunnel; and the second correspondence comprises a correspondence between the third VPN identifier, the second VPN identifier, and a second tunnel ID, the second tunnel ID identifying the second tunnel.
34. 34. The method of any one of claims 19 to 33, wherein the first tunnel and the third tunnel form a suture tunnel.
35. 35. The method of claim 34, wherein the first tunnel and the third tunnel form an AS-interstitial suture tunnel.
36. 34. The method of claim 19, wherein the first network device is a first Autonomous System Boundary Router (ASBR), the fourth network device is a second ASBR, and an Exterior Border Gateway Protocol (EBGP) peer is established between the first ASBR and the second ASBR.
37. 34. The method of claim 19, wherein the first network device is a third ASBR, the fourth network device is a first Provider Edge PE device, and an Internal Border Gateway Protocol (IBGP) peer is established between the third ASBR and the first PE device.
38. 34. The method of claim 19, wherein the first network device is an extensible gateway xGW, the fourth network device is a second PE device, and an Internal Border Gateway Protocol IBGP peer is established between the xGW and the second PE device.
39. A network device, the network device having a transceiver module and a processing module, the transceiver module configured to perform receiving and transmitting operations in the route advertisement method according to any one of claims 1 to 18, and the processing module configured to perform processing operations in the route advertisement method according to any one of claims 1 to 18.
40. A network device, the network device having a transceiver module and a processing module, the transceiver module configured to perform receiving and transmitting operations in the packet forwarding method according to any one of claims 19 to 38, and the processing module configured to perform processing operations in the packet forwarding method according to any one of claims 19 to 38.
41. A network device, the network device having a processor and a memory, the memory configured to store instructions or program code, the processor configured to call the instructions or program code from the memory and execute the instructions or program code to perform the route advertisement method of any one of claims 1 to 18 or the packet forwarding method of any one of claims 19 to 38.
42. A network system comprising a network device according to claim 39 or 40.
43. A computer readable storage medium comprising instructions, a program or code, which, when executed on a processor, performs the route advertisement method of any one of claims 1 to 18 or the packet forwarding method of any one of claims 19 to 38.
44. A computer program product having a program, which, when executed on a processor, performs the route advertisement method according to any one of claims 1 to 18 or the packet forwarding method according to any one of claims 19 to 38.
