Srv6 packet encapsulation and forwarding method, chip and computer program product

By employing multiple IPv6 encapsulation and termination forwarding methods, the problem of older equipment and low-end chips being unable to support SRv6 was solved. This enabled the encapsulation and forwarding of SRv6 services without adding hardware, and utilized the existing functional characteristics of the chip to achieve flexible SRv6 packet forwarding.

CN121309262BActive Publication Date: 2026-07-24FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
Filing Date
2025-10-21
Publication Date
2026-07-24

Smart Images

  • Figure CN121309262B_ABST
    Figure CN121309262B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of communication, and discloses an SRv6 packet encapsulation and forwarding method, comprising: performing Ipv6 encapsulation on a to-be-processed packet to obtain a first packet; removing non-ip information in the IPv6 header information of the first packet, performing Ipv6 encapsulation on the processed first packet to obtain a second packet; repeating the above method several times to realize several times of loopback encapsulation on the first packet; inserting SRH information in the second packet after loopback encapsulation to obtain an SRv6 packet; and judging whether the SRv6 packet satisfies a terminal forwarding condition, and if the result of the judgment is yes, performing terminal forwarding on the SRv6 packet. The scheme disclosed in the present disclosure realizes the effect of SRv6 tunnel encapsulation through multiple times of IPv6 tunnel encapsulation, and can realize the SRv6 service encapsulation function on a device supporting IPv6 encapsulation but not supporting SRv6 encapsulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of communication technology, and in particular to an SRv6 message encapsulation and forwarding method, chip, and computer program product. Background Technology

[0002] As an emerging IP technology for the 5G and cloud era, SRv6 (Segment Routing IPv6) can effectively meet the needs of new services thanks to its powerful network programming capabilities. However, the SRv6 standard has been under development for less than ten years, and many old devices and low-end chips in the existing network cannot natively support SRv6. Some devices and chips can be upgraded to support SRv6 functionality through software upgrades, but a large number of them still cannot achieve full functionality even with software upgrades. Summary of the Invention

[0003] This disclosure aims to at least partially solve one of the technical problems in the aforementioned technologies, and to this end proposes an SRv6 message encapsulation and forwarding method, including:

[0004] The message to be processed is encapsulated with IPv6 to obtain the first message;

[0005] Remove non-IP information from the IPv6 header of the first packet, encapsulate the processed first packet with IPv6 to obtain the second packet; repeat the above method several times to achieve several loopback encapsulations of the first packet.

[0006] SRH information is inserted into the second message after loopback encapsulation to obtain the SRv6 message;

[0007] Determine whether the SRv6 message meets the termination forwarding condition. If the determination result is yes, then terminate forwarding the SRv6 message.

[0008] Furthermore, the IP information in the IPv6 header of the first message includes: dip information and sip information.

[0009] Furthermore, before encapsulating the processed first message with IPv6, the process also includes: removing the SIP information from the processed first message and retaining the DIP information in the processed first message.

[0010] Furthermore, the termination forwarding conditions include: the dip in the IPv6 header information of the SRv6 packet is a termination dip and the value of the SRH field of the SRv6 packet matches the preset field value.

[0011] Furthermore, the SRH field includes: an LA field for identifying the SID-LIST layer number, wherein the SID-LIST layer number depends on the number of loopback encapsulations performed on the first message;

[0012] Terminating and forwarding the SRv6 message includes:

[0013] Remove non-payload information from the SRv6 message based on the LA field;

[0014] The SRv6 message with the non-load information removed is looped back and encapsulated into an MPLS message to realize the mapping from SRv6 VPN to MPLS VPN.

[0015] Terminate and forward MPLS packets using SRv6 VPN.

[0016] Furthermore, the SRv6 VPN termination forwarding of MPLS packets includes: forwarding the MPLS packets according to the forwarding method corresponding to the MPLS label of the MPLS packets.

[0017] Furthermore, if it is determined that the SRv6 message does not meet the termination forwarding conditions, then it is routed and forwarded.

[0018] This disclosure also proposes a chip configured to perform the SRv6 message encapsulation and forwarding method described above.

[0019] Furthermore, the chip is configured as follows:

[0020] Remove the IPv6 header information from the second packet after loopback encapsulation;

[0021] Insert SRH information before the second packet after removing the IPv6 header information;

[0022] The second message with inserted SRH information is encapsulated with IPv6 to obtain an SRv6 message.

[0023] This disclosure also proposes a computer program product stored in a computer-readable storage medium, which, when executed by a processor, is used to at least implement the above-described SRv6 message encapsulation and forwarding method.

[0024] Compared with the prior art, the beneficial effects of this disclosure are:

[0025] (1) The SRv6 message encapsulation scheme proposed in this disclosure achieves the effect of SRv6 tunnel encapsulation through multiple IPv6 tunnel encapsulations, and can implement SRv6 service encapsulation function on devices that support IPv6 encapsulation but do not support SRv6 encapsulation.

[0026] (2) The SRv6 message termination and forwarding scheme proposed in this disclosure identifies the SRv6 message through the access control list and terminates the SRv6 header before re-encapsulating it into the corresponding internal MPLS message. Then, the SRv6 service termination function is implemented by MPLS termination and forwarding. The SRv6 service termination function can be implemented on devices that do not support SRv6 service forwarding.

[0027] (3) The SRv6 packet encapsulation and termination forwarding scheme proposed in this disclosure utilizes some functional characteristics of the chip itself to flexibly apply IPv6 tunnel encapsulation function, loopback processing function, access control list function, and MPLS function, and combine them to create an SRv6 packet forwarding function. This scheme does not require additional hardware, only consumes the original resources of the chip, and only requires software development to achieve the desired effect.

[0028] Other features and advantages of this disclosure will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the disclosure. The objects and other advantages of this disclosure may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings. The technical solutions of this disclosure will be further described below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0029] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the embodiments of the present disclosure to explain the disclosure and do not constitute a limitation thereof. In the drawings:

[0030] Figure 1 This is a schematic diagram of the SRv6 message encapsulation and forwarding method given in the embodiment;

[0031] Figure 2 This is a schematic diagram of the IPv6 encapsulation process of the message to be processed, as shown in the embodiment.

[0032] Figure 3 This is a schematic diagram of the IPv6 message loopback encapsulation process given in the example.

[0033] Figure 4 A schematic diagram of the IPv6 message loopback encapsulation process is provided for another embodiment;

[0034] Figure 5 This is a schematic diagram illustrating the encapsulation process from IPv6 to SRv6 messages, as shown in the example.

[0035] Figure 6 This is a schematic diagram of the SRv6 message termination process given in the example.

[0036] Figure 7 This is a schematic diagram of the SRv6 message termination and forwarding process given in the example. Detailed Implementation

[0037] The present disclosure will be described below with reference to the accompanying drawings. The preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present disclosure.

[0038] Figure 1 The SRv6 message encapsulation and forwarding method disclosed herein includes:

[0039] The message to be processed is encapsulated with IPv6 to obtain the first message;

[0040] Remove non-IP information from the IPv6 header of the first packet, encapsulate the processed first packet with IPv6 to obtain the second packet; repeat the above method several times to achieve several loopback encapsulations of the first packet.

[0041] SRH information is inserted into the second message after loopback encapsulation to obtain the SRv6 message;

[0042] Determine whether the SRv6 message meets the termination forwarding condition. If the determination result is yes, then terminate forwarding the SRv6 message.

[0043] According to some embodiments of this disclosure, such as Figure 2 As shown, when a regular packet is forwarded using L2 or L3 and requires SRv6 tunnel encapsulation, IPv6 tunnel encapsulation is performed directly first, followed by loopback encapsulation: the IPv6 header information of the packet after IPv6 tunnel encapsulation is stripped down to retain only the IP information of the IPv6 header. After stripping, IPv6 tunnel encapsulation is performed again, and then the above method is repeated to achieve loopback encapsulation.

[0044] Furthermore, the IP information in the IPv6 header of the first message includes: dip information and sip information.

[0045] According to some embodiments of this disclosure, the IPv6 header information of the packet in the loopback encapsulation includes IP information. The purpose of stripping down to the IP information that only retains the IPv6 header is to treat the IP information of the IPv6 header as the SID-LIST information of the SRv6 packet.

[0046] Furthermore, before encapsulating the processed first message with IPv6, the process also includes: removing the SIP information from the processed first message and retaining the DIP information in the processed first message.

[0047] According to some embodiments of this disclosure, when stripping IPv6 packets in loopback encapsulation, the stripping is performed until only the IPv6 header's DIP information or SIP+DIP information is retained, corresponding to stripping the first 8+16=24 bytes or 8 bytes of the IPv6 header. Figure 3 In the loopback encapsulation, the first 8 bytes of the IPv6 packet are stripped, while the SIP+DIP information is retained. Figure 4 In this process, when stripping the IPv6 header, only the first 24 bytes are removed, leaving only the .dip portion. This means that only one layer of SID-LIST encapsulation can be completed each time IPv6 tunnel encapsulation is performed. This differs from... Figure 3 Only the sip+dip part is retained (two layers of SID-LIST encapsulation can be performed each time). Figure 4 The advantage of the corresponding loopback encapsulation method is that it can solve the problem of insufficient hardware entries for SIP during IPv6 tunnel encapsulation (for example, for a chip, the SIP field is used as the device's source IP for packet encapsulation, and this source IP is usually not very numerous, so the corresponding entries in the hardware design are generally not very large). The disadvantage is that it consumes more chip resources because when encapsulating the same SID-LIST, Figure 4 The method described above would require more loopback encapsulation operations.

[0048] Furthermore, the termination forwarding conditions include: the dip in the IPv6 header information of the SRv6 packet is a termination dip and the value of the SRH field of the SRv6 packet matches the preset field value.

[0049] According to some embodiments of this disclosure, the SRv6 packet termination process includes: performing matching identification, the identified information including the SRv6 packet's dip and key information in the SRH header, and when it is determined that the dip in the IPv6 header information of the SRv6 packet is the termination dip and the SRH field value matches a preset value (for example, the SRH field includes the LA field, and the value of the LA field should be 0), it is determined that the SRv6 packet meets the termination forwarding conditions.

[0050] Furthermore, the SRH field includes: an LA field for identifying the SID-LIST layer number, wherein the SID-LIST layer number depends on the number of loopback encapsulations performed on the first message;

[0051] Terminating and forwarding the SRv6 message includes:

[0052] Remove non-payload information from the SRv6 message based on the LA field;

[0053] The SRv6 message with the non-load information removed is looped back and encapsulated into an MPLS message to realize the mapping from SRv6 VPN to MPLS VPN.

[0054] Terminate and forward MPLS packets using SRv6 VPN.

[0055] According to some embodiments of this disclosure, such as Figure 6 As shown, when an SRv6 packet needs to be terminated and forwarded, the process first searches for the destination MAC address to enter L3 forwarding (a basic condition for L3 forwarding). Then, it identifies whether the SRv6 packet meets the termination forwarding conditions and matches the termination SID (END_DT4 / 6, END_DX2 / DT2, etc.). Based on the LA in the SRH field (which also includes Next-Header, Length, SL, etc.), it obtains the SID-LIST layer number to determine the corresponding packet processing action. The SRv6 packet requiring termination has its SRv6 header removed, retaining only the PAYLOAD portion. Then, it performs internal MPLS packet mapping and encapsulation and forwards it to the loopback interface, mapping the SRv6 VPN to an internal MPLS VPN. Finally, it performs SRv6 VPN termination forwarding on the MPLS packet.

[0056] Furthermore, the SRv6 VPN termination forwarding of MPLS packets includes: forwarding the MPLS packets according to the forwarding method corresponding to the MPLS label of the MPLS packets.

[0057] According to some embodiments of this disclosure, such as Figure 7 As shown, after the MPLS packet is mapped, encapsulated, and forwarded to the loopback interface, the MPLS label is searched. If the search is successful, the packet is terminated and forwarded accordingly based on the information obtained after the MPLS label is matched. For example, if the information in the MPLS is Nexthop, VPWS forwarding is performed; if the information in the MPLS is VSI, VPLS forwarding is performed; and if the information in the MPLS is VRF, L3VPN forwarding is performed.

[0058] Furthermore, if it is determined that the SRv6 message does not meet the termination forwarding conditions, then it is routed and forwarded.

[0059] According to some embodiments of this disclosure, such as Figure 6 As shown, when an SRv6 message does not meet the termination forwarding conditions, it is routed and forwarded.

[0060] The above technical solution will be further explained below using the 7-layer SID-LIST encapsulation as an example. The encapsulation process for other layers of SID-LIST is the same as this example, with only the number of loops differing, which will not be explained in detail in this disclosure.

[0061] The SRv6 message encapsulation process proposed in this disclosure is as follows:

[0062] S1: When a packet is forwarded to the NNI side via L2 or L3 and needs to be encapsulated with SRv6, an index `nexthop_id1` is first obtained. This index is used to encapsulate an IPv6 tunnel. The DIP information in the IPv6 tunnel is the outermost TXSID 2011::7 of the SRv6 tunnel, and the SIP information is the local source IPv6 address. After encapsulating the IPv6 tunnel, ARP encapsulation is performed according to the ARP index attached to the IPv6 tunnel, and the packet is sent to the loopback interface. A specified index (idx_1) is also carried back through the loopback interface. This index information is used to find the next IPv6 tunnel encapsulation information in the next loop of the pipeline.

[0063] S2: Packets entering from the loopback interface are matched against the access control list using idx_1 carried on the loopback interface. Partial information from the outer IPv6 header is removed (only the DIP content of the IPv6 header, i.e., 2011::7), resulting in an IPv6 tunnel encapsulation index nexthop_id2. Then, IPv6 tunnel encapsulation (DIP 2011::6) and ARP encapsulation are performed based on nexthop_id2 before being sent to the loopback interface, carrying a specified index (idx_2) on the loopback interface. This initiates the next pipeline processing flow.

[0064] S3: Repeat the above process. After matching idx_2, remove some packet information and keep only 2011::6, and obtain the IPv6 tunnel index nexthop_id3. Then perform IPv6 tunnel encapsulation (DIP is 2011::5), forward it to the loopback interface and carry the index information (idx_3).

[0065] S4: Repeat the above process. After matching idx_3, remove some packet information and keep only 2011::5, and obtain the IPv6 tunnel index nexthop_id4. Then perform IPv6 tunnel encapsulation (DIP is 2011::4), forward it to the loopback interface and carry the index information (idx_4).

[0066] S5: Repeat the above process. After matching idx_4, remove part of the packet information and keep only 2011::4, and obtain the IPv6 tunnel index nexthop_id5. Then perform IPv6 tunnel encapsulation (DIP is 2011::3), forward it to the loopback interface and carry the index information (idx_5).

[0067] S6: Repeat the above process. After matching idx_5, remove part of the packet information and keep only 2011::3, and obtain the IPv6 tunnel index nexthop_id6. Then perform IPv6 tunnel encapsulation (DIP is 2011::2), forward it to the loopback interface and carry the index information (idx_6).

[0068] S7: Repeat the above process. After matching idx_6, remove some packet information and keep only 2011::2, and obtain the IPv6 tunnel index nexthop_id7. Then perform IPv6 tunnel encapsulation (DIP is 2011::1, this DIP can be VPNSID), forward it to the loopback interface and carry the index information (idx_7).

[0069] S8: Packets entering from the loopback interface are matched against the access control list using the idx_7 carried on the loopback interface. The outer IPv6 header is stripped (only the DIP content of the IPv6 header is retained, i.e., 2011::1 is retained), and the specified SRH header information is inserted (8F0E040606000000 / 040E040606000000 / 290E040606000000, the three SRH information correspond to the PAYLOAD type of ETH / IPv4 / IPv6 respectively). The next IPv6 tunnel index nexthop_id8 is obtained, and then the IPv6 tunnel encapsulation continues. At this time, the DIP information of the IPv6 tunnel is the outermost TXSID 2011::7 of the SRv6 tunnel. Then, ARP encapsulation is performed according to the exit information obtained from the IPv6 tunnel entry, and then it is forwarded. At this time, the encapsulation of the SRv6 packet is completed.

[0070] The SRv6 message termination procedure proposed in this disclosure is as follows:

[0071] S1: The access control list matches and identifies SRv6 packets. The main information identified includes the DIP of the SRv6 packet and key information in the SRH header (Next-Header, Length, SL, LA). SL should be 0, and Length or LA indicates the SID-LIST level. Different SID-LIST levels correspond to different access control list stripping actions. For example, with a 1-level SID-LIST, 40 + 8 + 16 = 64 bytes of SRv6 header need to be stripped, while with a 10-level SID-LIST, 40 + 8 + 16 * 10 = 208 bytes of SRv6 header need to be stripped. If the stripping cannot be completed in one go, it can be performed in multiple steps using a loopback mechanism. Under the same DIP matching condition, it is also necessary to configure SID-LIST matching entries from layers 0 to 10 sequentially (assuming the maximum possible SID-LIST layer is 10) to exhaustively list all possible SRv6 packet formats corresponding to the local SID. In other words, multiple access control list entries are needed to jointly implement the matching function for a single local SID. The DIP in the SRv6 termination packet is usually a VPN-SID, corresponding to local SID processing actions such as END.DT2 / END.DX2 / END.DT4 / END.DT6, etc. After the access control list matches the DIP of the SRv6 packet, different local SID processing indices are obtained. Subsequent chip processing can then be performed based on these indices. If no access control list entry matches, the normal routing and forwarding process begins.

[0072] S2: After the stripping process in the previous step, the SRv6 packet now only contains the PAYLOAD portion. The PAYLOAD portion may be a complete ETH packet (L2VPN forwarding) or an IP packet without an ETH header (L3VPN forwarding). Internal MPLS label encapsulation is then performed based on the Index value obtained in the previous step.

[0073] S3: After encapsulating an internal MPLS label on the PAYLOAD packet, and then encapsulating it with a loopback ARP header, it becomes a standard MPLS packet and is sent to the loopback interface. The purpose of this step is to map the SRv6 VPN to an internal MPLS VPN, and then implement the SRv6 VPN termination forwarding through MPLS VPN termination forwarding. Adding an MPLS label to the PAYLOAD packet resolves the issue of the chip being unable to parse the PAYLOAD information. If forwarding is performed directly without adding an MPLS label, the encapsulated ETH_TYPE value may be abnormal during L3VPN forwarding because the PAYLOAD information is unknown, and the ETH_TYPE field cannot be correctly filled when encapsulating the ETH header.

[0074] S4: MPLS packets entering through the loopback interface undergo an internal MPLS label lookup (located in a different space than public MPLS labels, eliminating label conflicts). Upon successful lookup, further processing information is obtained. For example, VPWS forwarding yields the next-hop index, VPLS forwarding yields VFI information, and L3VPN (Layer 3 Virtual Private Network) forwarding yields VRF information. The packet can then be terminated and forwarded according to the pre-mapped MPLSVPN termination configuration. Overall, SRv6 packets implement the termination and forwarding function.

[0075] Based on the same technical concept, this disclosure also proposes a chip configured to perform the above-described SRv6 message encapsulation and forwarding method.

[0076] This disclosure also proposes a computer program product stored in a computer-readable storage medium, which, when executed by a processor, is used to at least implement the above-described SRv6 message encapsulation and forwarding method.

[0077] It is obvious that those skilled in the art can make various modifications and variations to this disclosure without departing from its spirit and scope. Therefore, if such modifications and variations fall within the scope of the claims of this disclosure and their equivalents, this disclosure is also intended to include such modifications and variations.

Claims

1. An SRv6 message encapsulation and forwarding method, characterized in that, include: The message to be processed is encapsulated with IPv6 to obtain the first message; Remove non-IP information from the IPv6 header of the first packet, encapsulate the processed first packet with IPv6 to obtain the second packet; repeat the above method several times to achieve several loopback encapsulations of the first packet. SRH information is inserted into the second message after loopback encapsulation to obtain the SRv6 message; Determine whether the SRv6 message meets the termination forwarding condition. If the determination result is yes, then terminate forwarding the SRv6 message. The termination forwarding conditions include: the dip in the IPv6 header information of the SRv6 packet is a termination dip and the value of the SRH field of the SRv6 packet matches the preset field value; The SRH field includes an LA field for identifying the SID-LIST layer number, wherein the SID-LIST layer number depends on the number of loopback encapsulations of the first message; Terminating and forwarding the SRv6 message includes: Remove non-payload information from the SRv6 message based on the LA field; The SRv6 message with the non-load information removed is looped back and encapsulated into an MPLS message to realize the mapping from SRv6 VPN to MPLS VPN. Terminate and forward MPLS packets using SRv6 VPN.

2. The method as described in claim 1, characterized in that, The IP information in the IPv6 header of the first message includes: dip information and sip information.

3. The method as described in claim 2, characterized in that, Before encapsulating the processed first packet with IPv6, the process also includes: removing the SIP information from the processed first packet and retaining the DIP information from the processed first packet.

4. The method as described in claim 1, characterized in that, Terminating and forwarding MPLS packets using an SRv6 VPN includes forwarding the MPLS packets according to the forwarding method corresponding to the MPLS label of the MPLS packet.

5. The method as described in claim 1, characterized in that, If the SRv6 message does not meet the termination forwarding conditions, it is then routed and forwarded.

6. A chip, characterized in that, The chip is configured to perform the SRv6 message encapsulation and forwarding method as described in any one of claims 1-5.

7. The chip as described in claim 6, characterized in that, The chip is configured as follows: Remove the IPv6 header information from the second packet after loopback encapsulation; Insert SRH information before the second packet after removing the IPv6 header information; The second message with inserted SRH information is encapsulated with IPv6 to obtain an SRv6 message.

8. A computer program product, said computer program product being stored in a computer-readable storage medium, characterized in that, When the computer program product is executed by a processor, it is used to implement at least the method described in any one of claims 1-5.