Message forwarding method and equipment in heterogeneous segmented routing network
By using policy context information to index encapsulation information during the encapsulation phase in heterogeneous segmented routing networks, the problem of high forwarding complexity in heterogeneous segmented routing networks is solved, enabling unified forwarding and flexible deployment of devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NEW H3C TECH CO LTD
- Filing Date
- 2026-03-15
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies lack a unified forwarding mechanism in heterogeneous segmented routing networks, resulting in high device implementation complexity and limited policy expansion capabilities and network deployment flexibility.
By indexing the binding of another segment routing policy of the heterogeneous segmented routing network in the first encapsulation stage, and indexing the encapsulation information in the next encapsulation stage using policy context information, the segment routing encapsulation processing of the heterogeneous segmented routing network device is realized.
It enables unified forwarding processing for heterogeneous segmented routing network devices, reducing device implementation complexity and improving policy expansion capabilities and network deployment flexibility.
Smart Images

Figure CN122053469A_ABST
Abstract
Description
Technical Field
[0001] This application relates to communication technology, specifically a message forwarding method and device in a heterogeneous segmented routing network. Background Technology
[0002] Segment routing is a network technology that enables programmable forwarding of routes by carrying path segment information in packets. Segment routing primarily includes implementations based on multiprotocol label switching (MPLS) and IPv6, namely SR-MPLS (segment routing over multiprotocol labelswitching) and SRv6 (segment routing over IPv6). Due to differences in encapsulation methods and network deployment scenarios, operators and large networks often coexist with both SR-MPLS and SRv6 networks, resulting in complex network environments with a hybrid deployment of multiple SR technologies.
[0003] In cross-domain or heterogeneous SR networks, end-to-end path control is typically achieved through policies. For example, SR policies (segment routing policies) orchestrate the forwarding paths of packets, ensuring that packets reach the target node hop-by-hop according to a pre-defined segment list. In some typical scenarios, a combination of inner SR policies and outer SRv6 or SR-MPLS policies can be used to achieve path connectivity between different SR technology domains, thus enabling cross-domain forwarding.
[0004] However, in actual network deployments, there may be various different policy stacking orders. For example, in some scenarios, SR-MPLS policies need to be encapsulated first before SRv6 policies are executed; in other scenarios, SRv6 policies need to be executed first before SR-MPLS policies; and in some service access scenarios, packets may also be encapsulated with Virtual Private Network Labels (VPN Labels) before entering the SR policy forwarding process. To achieve multi-stage policy processing, devices typically need to use a loopback mechanism to reintroduce partially encapsulated packets into the forwarding process, thereby continuing to execute subsequent policies.
[0005] Existing technologies often rely on different dedicated implementations when handling different encapsulation orders and multi-stage SR policy coordination, lacking a unified forwarding mechanism to support various policy combination scenarios. This results in high device implementation complexity and limits policy expansion capabilities and network deployment flexibility. Therefore, a universal packet forwarding method is needed to support unified forwarding processing in various policy encapsulation orders and heterogeneous SR network environments. Summary of the Invention
[0006] The purpose of this application is to address the problems of complex implementation and lack of a unified processing mechanism in the existing technology for multi-policy combination scenarios in heterogeneous segmented routing network environments.
[0007] To achieve the above objectives, this application provides a packet forwarding method in a heterogeneous segmented routing network. The method includes: searching a first SR-MPLS policy routing table entry based on the destination IP address of a first IP packet; encapsulating a first MPLS label stack in the first IP packet based on the first SR-MPLS policy routing table entry; replacing the first original outer label of the first MPLS label stack with a first designated label; binding the first designated label to a first SRv6 policy route in the first heterogeneous segmented routing network; encapsulating a first loop header and sending it through a loop port; based on the outermost first designated label of the loop-processed first IP packet, finding a matching first label exchange entry, exchanging the first designated label with the first original outer label, and obtaining the pointed-to first SRv6 policy routing table entry; based on the first SRv6 policy routing table entry, encapsulating a first SRv6 segment routing header and a first outer IPv6 header outside the MPLS label stack, and encapsulating a first outer Ethernet header according to the next-hop SID of the SIDList of the first SRv6 segment routing header; and sending a first IP packet with an inner MPLS label stack and an outer first SRv6 segment routing header.
[0008] To achieve the above objectives, this application also provides a packet forwarding device in a heterogeneous segmented routing network; the device includes a processor, a machine-readable storage medium, an application-specific integrated circuit (ASIC), and a network interface. An application-specific integrated circuit (ASIC) is configured to: look up a first SR-MPLS policy routing table entry based on the destination IP address of a first IP packet; encapsulate a first MPLS label stack in the first IP packet using the first SR-MPLS policy routing table entry; replace the first original outer label of the first MPLS label stack with a first designated label; bind the first designated label to a first SRv6 policy route in a first heterogeneous segmented routing network; encapsulate a first loop header and send it through a loop port; based on the outermost first designated label of the loop-processed first IP packet, find a matching first label switching entry, switch the first designated label to the first original outer label, and obtain the pointed-to first SRv6 policy routing table entry; based on the first SRv6 policy routing table entry, encapsulate a first SRv6 segment routing header and a first outer IPv6 header outside the MPLS label stack, encapsulate a first outer Ethernet header according to the next-hop SID of the SID List in the first SRv6 segment routing header; and send a first IP packet with an inner MPLS label stack and an outer first SRv6 segment routing header.
[0009] The beneficial effect of this application is that it achieves segment route encapsulation processing of heterogeneous segmented routing network devices by indexing another segment routing policy of the heterogeneous segmented routing network through the first encapsulation stage and indexing the encapsulation information through the policy context information in the next encapsulation stage. Attached Figure Description
[0010] Figure 1 A flowchart illustrating an embodiment of a packet forwarding method in a heterogeneous segmented routing network provided in this application; Figure 2 A schematic diagram of an embodiment of the heterogeneous segmented routing network provided in this application; Figures 3A-3B for Figure 2 Schematic diagram of heterogeneous forwarding encapsulation for mid-edge devices; Figure 4 A schematic diagram of another heterogeneous segmented routing network embodiment provided in this application; Figure 5 for Figure 4 Schematic diagram of heterogeneous forwarding encapsulation for mid-edge devices; Figure 6 This is a schematic diagram of a packet forwarding and processing device in a heterogeneous segmented routing network provided in an embodiment of this application. Detailed Implementation
[0011] The following detailed description will be provided with reference to several examples illustrated in the accompanying figures. In this detailed description, numerous specific details are used to provide a comprehensive understanding of the present application. Known methods, steps, components, and circuits are not described in detail in the examples to avoid obscuring their meaning.
[0012] In the terminology used, the term "including" means including but not limited to; the term "containing" means including but not limited to; the terms "above," "within," and "below" include the number itself; the terms "greater than" and "less than" mean not including the number itself. The term "based on" means based on at least a portion of them.
[0013] Figure 1 A flowchart illustrating an embodiment of a packet forwarding method in a heterogeneous segmented routing network provided in this application; the embodiment includes the following steps: Step 101: Perform the first-stage encapsulation on the IP packet to generate an IP packet with the first encapsulation. Step 102: Obtain the policy context information pointing to the policy route encapsulated in the second stage; Step 103: Loop back an IP packet with the first encapsulation that carries policy context information; Step 104: Based on the policy context information pointing to the policy route of the second stage encapsulation, perform the second stage encapsulation to generate an IP packet with an outer second encapsulation and an inner first encapsulation.
[0014] The beneficial effect of this application is that it enables segment route encapsulation processing of heterogeneous segmented routing network devices by indexing another segment routing policy of the heterogeneous segmented routing network in the first encapsulation stage and indexing the encapsulation information in the next encapsulation stage through the policy context.
[0015] Figure 2 This is a schematic diagram of an embodiment of the heterogeneous segmented routing network provided in this application.
[0016] Figure 2 In this network, the SRv6 network 100 and the SR-MPLS network 200 between PE1 and PE2 constitute a heterogeneous segmented routing network.
[0017] P2 serves as a boundary node and possesses both SRv6 and SR-MPLS capabilities.
[0018] Device PE1 is configured with the SR-MPLS policy POLICY-MPLS-100, with device P2 as the head point and device PE2 as the end point. The end point address is set to PE2's loopback address 2.2.2.2, the color is 100, and the explicit path is specified as P2 → P3 → PE2. For device PE1, this policy assigns the candidate path next-hop index NHP-101.
[0019] The PE1 device is configured with the SRv6 policy POLICY-SRv6-800, with PE1 as the head node and P2 as the destination node. The destination address is set to the SRv6 address of PE2, 2001:db8::2, the color is 100, the explicit segment path is specified as PE1 → P1 → P2, and the SID sequence is [AC::100, BC::200]. The PE1 device allocates a binding specification tag 9999 to POLICY-SRv6-800 for jumping into the second encapsulation stage index POLICY-SRv6-800, and allocates the candidate path next-hop index NHP-801 to POLICY-SRv6-800.
[0020] The PE1 device establishes SR-MPLS policy entries in the SR-MPLS Policy table shown in Table 1-1: Table 1-1 For PE1 equipment, create a Candidate Path entry for NHP-1001 in the Candidate Path table shown in Table 1-2: Table 1-2 The PE1 device creates a Segment List entry for NHP-102 in the Segment List package table shown in Table 1-3: Table 1-3 The PE1 device establishes routing table entries in the VRF-A routing table shown in Table 1-4: Table 1-4 The PE1 device creates an entry in the SRv6 Policy table shown in Table 1-5, pointing to the next-hop index NHP-801 of the POLICY-SRv6-800 candidate path.
[0021] Table 1-5 The PE1 device creates an entry in the SRv6 Candidate Path table shown in Table 1-6, recording segment list NHP-802: Table 1-6 The PE1 device creates a package entry in the SRv6 Segment List package table shown in Table 1-7: Table 1-7 PE1 sets up a tag exchange entry in the ILM table shown in Table 1-8: Table 1-8 The PE2 device is configured with the SRv6 policy POLICY-SRv6-700, with the head node being the P2 device and the destination being the PE1 device. The destination address is set to the SRv6 address of PE1, 2001:db8::1, with a color of 100. The explicit segment path is specified as P2 → P1 → PE1 (SID sequence [BC::200, AC::100]). The system assigns a candidate path next-hop index NHP-701 to this SRv6 policy POLICY-SRv6-700. The PE2 device is configured with the SR-MPLS policy POLICY-MPLS-500, with the PE2 device as the head node and the P2 device as the destination. The destination address is set to the P2 loopback address 1.2.2.2, the color is 100, and the explicit path is specified as PE2→P3→P2. The system assigns a candidate path next-hop index NHP-501 for this policy.
[0022] The PE2 device establishes routing table entries in the VRF-A routing table shown in Table 2-1: Table 2-1 The PE2 device assigns the candidate path next-hop index NHP-701 to the POLICY-SRv6-700 policy and creates an entry in the SRv6 Policy table shown in Table 2-2: Table 2-2 The PE2 device creates an entry in the SRv6 Candidate Path table shown in Table 2-3: Table 2-3 The PE2 device creates a package entry in the SRv6 Segment List package table shown in Table 2-4: Table 2-4 The PE2 device establishes SR-MPLS policy entries in the SR-MPLS Policy table shown in Table 2-5: Table 2-5 The PE2 device creates a Candidate Path entry for NHP-501 in the Candidate Path table shown in Table 2-6: Table 2-6 The PE2 device creates a Segment List entry for NHP-502 in the Segment List package table shown in Table 2-7: Table 2-7 Figures 3A-3B for Figure 2 A schematic diagram of heterogeneous forwarding encapsulation for mid-edge devices.
[0023] After PE1 receives the service packet carrying IP packet 21 from CE1, it determines the VRF to which the service packet belongs as VRF-A based on the ingress interface.
[0024] Based on the destination IP address of IP packet 21, the PE1 device performs a table lookup in the routing table of VRF-A, hits the routing table entry shown in Table 1-4, and obtains the associated SR-MPLS policy identifier POLICY-SR-MPLS-100.
[0025] The PE1 device finds the corresponding policy entry in the SR-MPLS Policy table shown in Table 1-1 based on POLICY-SR-MPLS-100, and obtains the next-hop identifier NHP-101 of the candidate path.
[0026] The PE1 device looks up NHP-101 in the Candidate Path table shown in Table 1-2 to determine that its member is NHP-102; then it looks up NHP-102 in the Segment List encapsulation table shown in Table 1-3 to obtain encapsulation information with encapsulation type MPLS tunnel and tag stack [1601,1602].
[0027] like Figure 3AAs shown, PE1 encapsulates the IP packet 21 with a label stack of [1601, 1602]. The outer label 1601 is replaced with the specified label 9999 bound to POLICY-SR-MPLS-100. A loopback header 22 is added based on the loopback header encapsulation entry a1 and sent to the loopback interface.
[0028] When the PE1 device receives the message after loopback processing, it re-parses the message received by the loopback interface based on the loopback header 22 and performs table lookup and forwarding again. Therefore, based on the outermost specified label 9999, it finds the exchange label entry shown in Table 1-8 in the ILM table, replaces the specified label 9999 back with the outermost label label 1601 in the label stack, and obtains the POLICY-SRv6-800 pointed to by the exchange label entry.
[0029] Based on POLICY-SRv6-800, PE1 searches for a matching policy entry in the SRv6 Policy table shown in Table 1-5 to obtain the next-hop identifier NHP-801 for the Candidate Path. Further, PE1 searches the SRv6 Candidate Path table shown in Table 1-6 based on NHP-801 to determine its member as NHP-802; then, based on NHP-2002, it searches the SRv6 Segment List encapsulation table shown in Table 1-7 to obtain encapsulation information with an encapsulation type of SRv6 tunnel and a SID list of [AC::100, BC::200].
[0030] Figure 3A In this process, the PE1 device, based on encapsulation information, encapsulates an SRv6 segment routing header (SRH, Segment Routing Header) outside the MPLS label stack. The next-hop SID in the SID List is AC::100. An outer IPv6 header is then encapsulated outside the SRv6 segment routing header, with the destination IP address of the outer IPv6 header being AC:100 of the next-hop P1 device. PE1 resolves the next-hop outgoing interface / neighbor based on the next-hop SIDAC::100, encapsulates it with an outer Ethernet header, and sends it to the Egress Pipeline for processing. This results in the packet, containing both public SRv6 and public SR-MPLS encapsulation, being sent to the next-hop P1 device.
[0031] Figure 2 After receiving the service packet carrying IP packet 23 from CE2, PE2 determines the VRF to which the service packet belongs as VRF-A based on the ingress interface.
[0032] The PE2 device looks up the routing table in VRF-A based on the destination IP address of IP packet 23, and finds the entry shown in Table 2-1, obtaining POLICY-SRv6-700. It then searches the SRv6 Policy table shown in Table 2-2 for a matching policy entry, obtaining the next-hop identifier NHP-801 for the Candidate Path. Further, the PE2 device looks up NHP-801 in the SRv6 Candidate Path table shown in Table 2-3, determining its member to be NHP-802. Then, based on NHP-802, it looks up NHP-802 in the SRv6 Segment List encapsulation table shown in Table 2-4, obtaining encapsulation information with an encapsulation type of SRv6 tunnel and an SRv6 segment route header SID list of [BC::200, AC::100], obtaining the pointed-to POLICY-MPLS-500, and the extended loopback header encapsulation entry a2.
[0033] Figure 3B In the IP packet, the PE2 device encapsulates an SRv6 segment routing header outside of IP packet 23, where the next-hop SID of the SID List is BC::100. An outer IPv6 header is then encapsulated outside the SRv6 segment routing header, with the destination IP address being the next-hop P2 device's BC::200.
[0034] PE2 encapsulates entry a2 based on the extended loopback header, and encapsulates the extended loopback header 24 outside the SRv6 segment routing header, carrying POLICY-MPLS-500, and sends it through the loopback interface.
[0035] The PE2 device receives the message after loopback processing, restores POLICY-MPLS-500 from the extended loopback header, and removes the loopback header.
[0036] The PE2 device finds the corresponding policy entry in the SR-MPLS Policy table shown in Table 2-5 based on POLICY-SR-MPLS-500, and obtains the next-hop identifier NHP-501 of the candidate path.
[0037] The PE2 device looks up NHP-501 in the Candidate Path table shown in Table 2-6 to determine that its member is NHP-502; then it looks up NHP-502 in the Segment List encapsulation table shown in Table 2-7 to obtain encapsulation information with encapsulation type MPLS tunnel and tag stack [1602,1601].
[0038] PE2 uses the outer tag 1602 of the tag stack as an index to find the interface and next-hop information, encapsulates the outer Ethernet header, and sends it to the Egress Pipeline for processing, thereby sending the packets with SR-MPLS encapsulated public network and SRv6 encapsulated public network to the next-hop P3 device.
[0039] Figure 2 In the architecture shown, if the PE1 device receives the MPLS private network label published by the PE2 ( Figure 2 (Not shown), update the VRF-A routing table shown in Table 1-4 to Table 1-4-1: Table 1-4-1 The PE1 device updates the SR-MPLS policy entries in the SR-MPLS Policy table of Table 1-1 as shown in Table 1-1-1: Table 1-1-1.
[0040] When the PE1 device finds the routing table entry shown in Table 1-4-1, it encapsulates the private network label Label 5000 inside the SR-MPLS label stack. PE1 will not process the private network label in the first stage of SR-MPLS encapsulation and the second stage of SRv6 segment routing encapsulation, thus sending a packet with a private network MPLS label, public network SRv6 encapsulation and public network SR-MPLS encapsulation.
[0041] exist Figure 2 In another example, the PE2 device receives a private network SRv6 SID published by the PE1 device ( Figure 2 (not shown), the PE2 device updates the routing table entries shown in Table 2-1 to those shown in Table 2-1-1: Table 2-1-1 The PE2 device will update the SRv6 Policy entries shown in Table 2-2 to those shown in Table 2-2-1: Table 2-2-1 When the PE2 device finds the routing table entry shown in Table 2-1-1, it encapsulates the private network SRV6 SID HI:500 into the outer layer of IP packet 23 with a separate SRV6 segment routing header, and then encapsulates the destination IP address as the private network SRV6 SID HI:500 into an inner IPv6 header. Finally, it encapsulates the POLICY-SRv6-700 corresponding SRv6 segment routing header and the outer IPv6 header. The PE2 device does not process this private network SRv6 segment routing header carrying the private network SID HI:500 during the first-stage SRv6 segment routing encapsulation and the second-stage SR-MPLS label encapsulation, thus sending a packet with a private network SID label, public network SR-MPLS encapsulation, and public network SRv6 encapsulation.
[0042] Figure 4 This is a schematic diagram of another heterogeneous segmented routing network embodiment provided in this application.
[0043] Figure 4 In the configuration, PE1 device is set to the SRv6 policy POLICY-SRv6-700, with PE1 device as the head node, PE2 device as the destination node, the destination address is set to the SRv6 address of PE2 2001:db8::2, the color is 100, the specified explicit segment path is PE1 → P1 → P2 → P3 → PE2, and the SID sequence is [AC::100, BC::200, DC::300, EC::400].
[0044] The PE1 device assigns a binding label 7777 to POLICY-SRv6-700, binds it to POLICY-SRv6-700, and assigns a candidate path next-hop index NHP-701 to POLICY-SRv6-700. PE1 learns from the private network MPLS label 6000 published by PE2 and establishes a routing table entry in the VRF-A routing table shown in Table 3-1: Table 3-1 The PE1 device generates private network tag encapsulation table entries based on the private network tag encapsulation table shown in Table 3-2: Table 3-2 PE1 sets the label pop-up table item in the ILM table shown in Table 3-3: Table 3-3 The PE1 device creates an entry in the SRv6 Policy table shown in Table 3-4, pointing to the next-hop index NHP-2001 of the POLICY-SRv6-700 selected path.
[0045] Table 3-4 The PE1 device creates an entry in the SRv6 Candidate Path table shown in Table 3-5: Table 3-5 The PE1 device creates a package entry in the SRv6 Segment List package table shown in Table 3-6: Table 3-6 The PE2 device uses the SRv6 policy POLICY-SRv6-800, with PE2 as the head node and PE1 as the destination. The destination address is set to the SRv6 address 2001:db8::1 of PE1, the color is 100, and the explicit segment path is specified as PE2 → P3 → P2 → P1 → PE1, with the SID sequence [EC::400, DC::300, BC::200, AC::100]. The PE2 device assigns a binding label 8888 to POLICY-SRv6-800, binds it to POLICY-SRv6-800, and assigns the candidate path next-hop index NHP-801 to POLICY-SRv6-800.
[0046] The PE2 device learns the private network MPLS label 50000 published by PE1 and creates a routing table entry in the VRF-A routing table shown in Table 4-1: Table 3-1 The PE2 device generates private network tag encapsulation table entries based on the private network tag encapsulation table shown in Table 4-2: Table 3-2 For PE2 devices, set the label pop-up entries in the ILM table shown in Table 4-3: Table 4-3 The PE2 device creates an entry in the SRv6 Policy table shown in Table 4-4, pointing to the next-hop index NHP-801 of the POLICY-SRv6-800 selected path.
[0047] Table 4-4 The PE2 device creates an entry in the SRv6 Candidate Path table shown in Table 4-5: Table 4-5 The PE2 device creates a package entry in the SRv6 Segment List package table shown in Table 4-6: Table 4-6 After receiving the service packet carrying IP packet 31 from CE1, PE1 determines the VRF to which the service packet belongs as VRF-A based on the ingress interface.
[0048] Based on the destination IP address of IP packet 31, the PE1 device looks up the routing table in VRF-A, finds the routing table entry shown in Table 3-1, obtains the next-hop index NHP-6000 in the routing table entry, and further searches for the private network label encapsulation table entry shown in Table 3-2.
[0049] Figure 5 In the middle, PE1 is an IP packet 31 encapsulation type of MPLS private network label encapsulation, and the private network label is label6000. Label 7777 is bound in the private network label encapsulation Label 6000. A loopback header 32 is added based on the loopback header encapsulation entry a3 and sent to the loopback interface.
[0050] When the PE1 device receives the message after loopback processing, it re-parses the message based on the loopback header 32 and performs table lookup forwarding again. Therefore, based on the outermost specified tag 7777, it finds the pop-up tag entry shown in Table 3-3 in the ILM table, pops the specified tag 7777, and obtains the POLICY-SRv6-700 pointed to from the pop-up tag entry.
[0051] Based on POLICY-SRv6-700, the PE1 device finds the matching policy entry in the SRv6 Policy table shown in Table 3-4 and obtains the next-hop identifier NHP-701 of the Candidate Path.
[0052] Furthermore, PE1 looks up NHP-701 in the SRv6 Candidate Path table shown in Table 3-5 to determine that its member is NHP-702; then, based on NHP-702, it looks up NHP-702 in the SRv6 Segment List encapsulation table shown in Table 3-6 to obtain encapsulation information with encapsulation type SRv6 tunnel and SRv6 segment route header SID list as [AC::100, BC::200, DC::300, EC::400].
[0053] Figure 5In the SRv6 segment routing header, PE1 encapsulates the SID based on the SID. The next-hop SID of the SID List is AC::100. An outer IPv6 header is encapsulated outside the SRv6 segment routing header, and the destination IP address is AC::100 of the next-hop P1 device.
[0054] PE1 parses the next-hop output interface / neighbor based on the next-hop SIDAC::100, encapsulates the outer Ethernet header, and sends it to the Egress Pipeline for processing. Thus, the P1 device sent to the next hop has a private network MPLS label and a public network SRv6 encapsulated packet.
[0055] When the IP packet in the service message received by PE2 matches the routing table entry in Table 4-1, PE2 encapsulates the private network MPLS label in the first stage and the public network SRv6 segment routing header in the second stage in the same way as the PE1 device. The heterogeneous segment routing network topology and explicit path shown in the above embodiments of this application are only used to illustrate the processing flow; this application is not limited to a specific network topology, explicit path, or whether ECMP is used. The forwarding table entries given in each forwarding stage in the embodiments are only examples and are not the inventive point of this application, but are used to help illustrate the carrying, transmission, recovery, and indexing mechanism of policy routing context information in different encapsulation stages. In actual deployment, the relevant forwarding table entries may vary depending on the planning of the heterogeneous segment routing network, the configuration of the explicit path, and the device implementation.
[0056] In the above embodiments, the outer label applied in the first encapsulation stage is bound to the segment routing policy (or its policy routing index information) in the second stage, and is used to carry and indicate the policy context of the next stage. After the packet enters the second forwarding / encapsulation stage, the device performs label processing operations such as popping, replacing or exchanging the outer label to complete the indexing and positioning of the segment routing policy in the second stage, thereby triggering and obtaining the encapsulation parameters of the second stage.
[0057] In the above embodiments, the segment routing policy of the second stage, which is indexed in the first encapsulation stage, is carried to the next stage as the policy context of the next stage through the extended loopback header. This is used to index the segment routing policy of the second stage, thereby triggering and obtaining the encapsulation parameters of the second stage.
[0058] Therefore, in this application, the segment routing policy for the next forwarding stage is indexed in the first forwarding stage and carried in the form of a context identifier, which can be in the form of a tag or encapsulated in the recycling / loopback header or internal device metadata; then, the next forwarding stage is entered through a stage switching mechanism, so that the device executes another segment routing policy encapsulation for the heterogeneous segment routing network in the next forwarding stage.
[0059] Figure 5This is a schematic diagram of an embodiment of a packet forwarding device in a heterogeneous segmented routing network provided in this application; the device 60 includes a processor 61, a machine-readable storage medium 62, an application-specific integrated circuit (ASIC) 63, and a network interface 631.
[0060] The application-specific integrated circuit 63 is also configured to: look up a first SR-MPLS policy routing table entry based on the destination IP address of the first IP packet; encapsulate a first MPLS label stack in the first IP packet using the first SR-MPLS policy routing table entry; replace the first original outer label of the first MPLS label stack with a first designated label; bind the first designated label to the first SRv6 policy route of the first heterogeneous segmented routing network; encapsulate a first loop header and send it through the loop interface (cycle port); based on the outermost first designated label of the loop-processed first IP packet, find a matching first label switching entry, switch the first designated label to the first original outer label, and obtain the pointed-to first SRv6 policy routing table entry; based on the first SRv6 policy routing table entry, encapsulate a first SRv6 segment routing header and a first outer IPv6 header outside the MPLS label stack, encapsulate a first outer Ethernet header according to the next-hop SID of the SID List of the first SRv6 segment routing header; and send a first IP packet with an inner MPLS label stack and an outer first SRv6 segment routing header.
[0061] The application-specific integrated circuit 63 is also configured to: find the second SR-MPLS policy routing table entry and the first private network label based on the destination IP address of the second IP packet; encapsulate the first MPLS private network label for the second IP packet; encapsulate the second MPLS label stack for the second IP packet based on the second SR-MPLS policy routing table entry; replace the second designated label with the second original outer label of the second MPLS label stack; bind the second designated label to the second SRv6 policy route of the second heterogeneous segmented routing network; encapsulate the second loopback header and send it through the loopback interface; find the matching second label switching table entry based on the second designated label of the loopback-processed second IP packet; switch the outermost second designated label of the second MPLS label stack to the second original outer label to obtain the pointed second SRv6 policy routing table entry; and encapsulate the second SRv6 segment routing header and the outer second IPv6 header outside the second MPLS label stack based on the SID of the second SRv6 segment routing header. The next-hop SID of the List is encapsulated in a second outer Ethernet header; a second IP packet with an inner second MPLS label stack and an outer second SRv6 segment routing header is sent.
[0062] Application-Specific Integrated Circuit 63 (ASIC) locates the second MPLS private network label based on the destination IP address of the third IP packet, encapsulates the second MPLS private network label into the third IP packet; adds a third designated label to the outer layer of the MPLS private network label; binds the third designated label to the third SRv6 policy route of the third heterogeneous segmented routing network; encapsulates a third loopback header and sends it through the loopback interface; based on the third designated label of the loopback-processed third IP packet, locates a matching pop-up label switching entry, pops the third designated label, and obtains the pointed-to third SRv6 policy routing entry; based on the third SRv6 policy routing entry, encapsulates a third SRv6 segment routing header and a third outer IPv6 header outside the MPLS private network label, encapsulates an outer Ethernet header according to the next-hop SID of the SIDList of the third SRv6 segment routing header; and sends a third IP packet with an inner MPLS private network label and an outer third SRv6 segment routing header.
[0063] The application-specific integrated circuit 63 is also configured to: look up a fourth SRv6 routing table entry based on the destination IP address of the fourth IP packet; encapsulate a fourth SRv6 segment routing header in the fourth IP packet based on the fourth SRv6 routing table entry to obtain the pointed fourth SR-MPLS route; encapsulate a first extended loopback header carrying the fourth SR-MPLS route and send it through the loopback interface; obtain the fourth SR-MPLS routing table entry pointed to by the fourth SR-MPLS route based on the first extended loopback header of the loopback-processed fourth IP packet; encapsulate a fourth MPLS label stack on the outer layer of the fourth SRv6 segment routing header based on the fourth SR-MPLS routing table entry; determine the next-hop node according to the outer label of the fourth MPLS label stack, encapsulate an outer Ethernet header, and send a fourth IP packet encapsulated with an inner SRv6 segment routing header and an outer fourth MPLS label stack.
[0064] Application-Specific Integrated Circuit 63 is also configured to: look up the fifth SRv6 routing table entry and the private network SRv6 SID based on the destination IP address of the fifth IP packet; encapsulate the inner SRv6 segment routing header and the inner IPv6 header based on the private network SRv6 SID; encapsulate the fifth SRv6 segment routing header outside the inner SRv6 segment routing header based on the fifth SRv6 routing table entry to obtain the pointed fifth SR-MPLS route; encapsulate the second extended loopback header carrying the fifth SR-MPLS route and send it through the loopback interface; obtain the fifth SR-MPLS routing table entry pointed to by the fifth SR-MPLS route based on the second extended loopback header of the fifth IP packet after loopback processing; encapsulate the fifth MPLS label stack outside the fifth SRv6 segment routing header based on the fifth SR-MPLS routing table entry; determine the next-hop node according to the outer label of the fifth MPLS label stack, encapsulate the outer Ethernet header, and send the fifth IP packet encapsulated with the inner SRv6 segment routing header and the outer fifth MPLS label stack.
[0065] In this disclosure, a machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device used to store or contain information (such as executable instructions, data, etc.). For example, any machine-readable storage medium herein can be any type of random access memory (RAM), volatile memory, non-volatile memory, flash memory, storage drive (such as a hard disk drive), solid-state drive, any type of optical disc (such as an optical disc, DVD, etc.), and similar devices, or combinations thereof. Furthermore, any machine-readable storage medium herein can be a non-transitory machine-readable storage medium.
[0066] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A packet forwarding method in a heterogeneous segmented routing network, characterized in that, The method includes, The first SR-MPLS policy routing table entry is looked up based on the destination IP address of the first IP packet; The first SR-MPLS policy routing table entry is used to encapsulate the first MPLS label stack in the first IP packet; The first original outer label of the MPLS label stack is replaced with a first designated label; the first designated label is bound to the first SRv6 policy route of the first heterogeneous segmented routing network. Encapsulate the first cycle header and send it through the cycle port; Based on the first specified label of the outermost layer of the first IP packet after loopback processing, a matching first label switching table entry is found, the first specified label is swapped with the first original outer label, and the first SRv6 policy routing table entry is obtained. Based on the first SRv6 policy routing table entry, a first SRv6 segment routing header and a first outer IPv6 header are encapsulated outside the MPLS label stack, and a first outer Ethernet header is encapsulated according to the next-hop SID of the SID List of the first SRv6 segment routing header. Send a first IP packet with the inner MPLS label stack and the outer first SRv6 segment routing header.
2. The method according to claim 1, characterized in that, The method further includes; The second SR-MPLS policy routing table entry and the first private network label are found based on the destination IP address of the second IP packet; Encapsulate the second IP packet with the first MPLS private network label; The second SR-MPLS policy routing table entry is used to encapsulate the second MPLS label stack for the second IP packet; The second original outer label of the second MPLS label stack is replaced with the second designated label; the second designated label is bound to the second SRv6 policy route of the second heterogeneous segmented routing network; The second loopback header is encapsulated and sent through the loopback interface; Based on the second specified label of the second IP packet after loopback processing, a matching second label switching table entry is found, the second specified label of the outermost layer of the second MPLS label stack is swapped with the second original outer label, and the second SRv6 policy routing table entry is obtained. Based on the second SRv6 policy routing table entry, outside the second MPLS label stack, a second SRv6 segment routing header and an outer second IPv6 header are encapsulated, and a second outer Ethernet header is encapsulated according to the next-hop SID of the SID List of the second SRv6 segment routing header. Send a second IP packet with an inner second MPLS label stack and an outer second SRv6 segment routing header.
3. The method according to claim 1, characterized in that, The method also includes, The second MPLS private network label is found based on the destination IP address of the third IP packet, and the second MPLS private network label is encapsulated in the third IP packet; A third designated label is added to the outer layer of the MPLS private network label; the third designated label is bound to the third SRv6 policy route of the third heterogeneous segmented routing network; Encapsulate the third loopback header and send it through the loopback interface; Based on the third specified label of the third IP packet after loopback processing, a matching pop label switching table entry is found, the third specified label is popped, and the pointed third SRv6 policy routing table entry is obtained. Based on the third SRv6 policy routing table entry, outside the MPLS private network label, a third SRv6 segment routing header and a third outer IPv6 header are encapsulated, and an outer Ethernet header is encapsulated according to the next-hop SID of the SID List in the third SRv6 segment routing header. Send a third IP packet with the inner MPLS private network label and the outer third SRv6 segment routing header.
4. The method according to claim 1, characterized in that, The method also includes, The fourth SRv6 routing table entry is looked up based on the destination IP address of the fourth IP packet; Based on the fourth SRv6 routing table entry, the fourth IP packet is encapsulated with a fourth SRv6 segment routing header to obtain the pointed fourth SR-MPLS route; The first extended loopback header carrying the fourth SR-MPLS route is encapsulated and sent through the loopback interface; Based on the first extended loopback header of the fourth IP packet after loopback processing, obtain the fourth SR-MPLS routing table entry pointed to by the fourth SR-MPLS route; The fourth SR-MPLS label stack is encapsulated in the outer layer of the fourth SRv6 segment routing header based on the fourth SR-MPLS routing table entry; The next-hop node is determined based on the outer label of the fourth MPLS label stack, and an outer Ethernet header is encapsulated. A fourth IP packet containing the inner SRv6 segment routing header and the outer fourth MPLS label stack is then sent.
5. The method according to claim 1, characterized in that, The method also includes, Based on the destination IP address of the fifth IP packet, look up the fifth SRv6 routing table entry and the private network SRv6 SID; The inner SRv6 segment routing header and inner IPv6 header are encapsulated based on the private network SRv6 SID; Based on the fifth SRv6 routing table entry, a fifth SRv6 segment routing header is encapsulated outside the inner SRv6 segment routing header to obtain the pointed fifth SR-MPLS route; Encapsulate and send the second extended loopback header carrying the fifth SR-MPLS route through the loopback interface; Based on the second extended loopback header of the fifth IP packet after loopback processing, obtain the fifth SR-MPLS routing table entry pointed to by the fifth SR-MPLS route; Based on the fifth SR-MPLS routing table entry, the fifth MPLS label stack is encapsulated in the outer layer of the fifth SRv6 segment routing header; The next-hop node is determined based on the outer label of the fifth MPLS label stack, and an outer Ethernet header is encapsulated. A fifth IP packet containing the inner SRv6 segment routing header and the outer fifth MPLS label stack is then sent.
6. A packet forwarding device in a heterogeneous segmented routing network, comprising a processor, a machine-readable storage medium, an application-specific integrated circuit (ASIC), and a network interface; characterized in that, The processor performs the following operations by executing machine-executable instructions recorded on the machine-readable storage medium. The application-specific integrated circuit is also configured to look up the first SR-MPLS policy routing table entry based on the destination IP address of the first IP packet; The first SR-MPLS policy routing table entry is used to encapsulate the first MPLS label stack in the first IP packet; The first original outer label of the MPLS label stack is replaced with a first designated label; the first designated label is bound to the first SRv6 policy route of the first heterogeneous segmented routing network. Encapsulate the first cycle header and send it through the cycle port; Based on the first specified label of the outermost layer of the first IP packet after loopback processing, a matching first label switching table entry is found, the first specified label is swapped with the first original outer label, and the first SRv6 policy routing table entry is obtained. Based on the first SRv6 policy routing table entry, a first SRv6 segment routing header and a first outer IPv6 header are encapsulated outside the MPLS label stack, and a first outer Ethernet header is encapsulated according to the next-hop SID of the SID List of the first SRv6 segment routing header. Send a first IP packet with the inner MPLS label stack and the outer first SRv6 segment routing header.
7. The device according to claim 6, characterized in that, The application-specific integrated circuit is also configured to find the second SR-MPLS policy routing table entry and the first private network label based on the destination IP address of the second IP packet; Encapsulate the second IP packet with the first MPLS private network label; The second SR-MPLS policy routing table entry is used to encapsulate the second MPLS label stack for the second IP packet; The second original outer label of the second MPLS label stack is replaced with the second designated label; the second designated label is bound to the second SRv6 policy route of the second heterogeneous segmented routing network; The second loopback header is encapsulated and sent through the loopback interface; Based on the second specified label of the second IP packet after loopback processing, a matching second label switching table entry is found, the second specified label of the outermost layer of the second MPLS label stack is swapped with the second original outer label, and the second SRv6 policy routing table entry is obtained. Based on the second SRv6 policy routing table entry, outside the second MPLS label stack, a second SRv6 segment routing header and an outer second IPv6 header are encapsulated, and a second outer Ethernet header is encapsulated according to the next-hop SID of the SID List of the second SRv6 segment routing header. Send a second IP packet with an inner second MPLS label stack and an outer second SRv6 segment routing header.
8. The device according to claim 6, characterized in that, The application-specific integrated circuit (ASIC) finds the second MPLS private network label based on the destination IP address of the third IP packet and encapsulates the second MPLS private network label into the third IP packet. A third designated label is added to the outer layer of the MPLS private network label; the third designated label is bound to the third SRv6 policy route of the third heterogeneous segmented routing network; Encapsulate the third loopback header and send it through the loopback interface; Based on the third specified label of the third IP packet after loopback processing, a matching pop label switching table entry is found, the third specified label is popped, and the pointed third SRv6 policy routing table entry is obtained. Based on the third SRv6 policy routing table entry, outside the MPLS private network label, a third SRv6 segment routing header and a third outer IPv6 header are encapsulated, and an outer Ethernet header is encapsulated according to the next-hop SID of the SID List in the third SRv6 segment routing header. Send a third IP packet with the inner MPLS private network label and the outer third SRv6 segment routing header.
9. The device according to claim 6, characterized in that, The application-specific integrated circuit is also configured to look up the fourth SRv6 routing table entry based on the destination IP address of the fourth IP packet; Based on the fourth SRv6 routing table entry, the fourth IP packet is encapsulated with a fourth SRv6 segment routing header to obtain the pointed fourth SR-MPLS route; The first extended loopback header carrying the fourth SR-MPLS route is encapsulated and sent through the loopback interface; Based on the first extended loopback header of the fourth IP packet after loopback processing, obtain the fourth SR-MPLS routing table entry pointed to by the fourth SR-MPLS route; The fourth SR-MPLS label stack is encapsulated in the outer layer of the fourth SRv6 segment routing header based on the fourth SR-MPLS routing table entry; The next-hop node is determined based on the outer label of the fourth MPLS label stack, and an outer Ethernet header is encapsulated. A fourth IP packet containing the inner SRv6 segment routing header and the outer fourth MPLS label stack is then sent.
10. The device according to claim 6, characterized in that, The application-specific integrated circuit is also configured to look up the fifth SRv6 routing table entry and the private network SRv6 SID based on the destination IP address of the fifth IP packet; The inner SRv6 segment routing header and inner IPv6 header are encapsulated based on the private network SRv6 SID; Based on the fifth SRv6 routing table entry, a fifth SRv6 segment routing header is encapsulated outside the inner SRv6 segment routing header to obtain the pointed fifth SR-MPLS route; Encapsulate and send the second extended loopback header carrying the fifth SR-MPLS route through the loopback interface; Based on the second extended loopback header of the fifth IP packet after loopback processing, obtain the fifth SR-MPLS routing table entry pointed to by the fifth SR-MPLS route; Based on the fifth SR-MPLS routing table entry, the fifth MPLS label stack is encapsulated in the outer layer of the fifth SRv6 segment routing header; The next-hop node is determined based on the outer label of the fifth MPLS label stack, and an outer Ethernet header is encapsulated. A fifth IP packet containing the inner SRv6 segment routing header and the outer fifth MPLS label stack is then sent.