Data packet transmission method based on hybrid label protocol stack, gateway device and data packet transmission system based on hybrid label protocol stack

By encapsulating multiple protocol labels and mixed control headers in data packets, the label limitation problem of network transmission in existing technologies is solved, efficient data transmission and flexible path control are achieved, and network resource utilization and adaptability are improved.

CN119728811BActive Publication Date: 2025-09-30PENG CHENG LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411308657.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-09-30
Estimated Expiration
2044-09-19

AI Technical Summary

Technical Problem

Existing network transmission technologies face label limitations when processing different network domains, resulting in increased processing burden on network devices, increased path complexity, and low efficiency in fault recovery and network resource utilization.

Method used

A data packet transmission method based on a hybrid label protocol stack is adopted to generate multiple protocol labels and hybrid control headers in the data packet to be transmitted, and insert them into the data packet structure. The data packet is transmitted through the first gateway device to the second gateway device for recovery and finally reaches the terminal device.

Benefits of technology

It achieves efficient data transmission and flexible path control across different network technology domains, improves data transmission efficiency and network resource utilization, and enhances the network's adaptability and fault recovery capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728811B_ABST
    Figure CN119728811B_ABST
Patent Text Reader

Abstract

The present application discloses a data packet transmission method based on a hybrid label protocol stack, a gateway device, a system and a storage medium. The present application discloses a data packet transmission method based on a hybrid label protocol stack, which is applied to a first gateway device. The method includes: when the label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type, generating multiple protocol labels and a hybrid control header, and inserting the message structure of the data packet to generate a target data packet; transmitting the target data packet to a second gateway device, and the second gateway device is used to recover the target data packet and forward the recovered data packet to the terminal device. Through the above method, multiple protocol labels are encapsulated in a single data packet, achieving efficient data transmission and flexible path control across different network technology domains, and can dynamically adapt to changes in the network environment, improve data transmission efficiency and network resource utilization, and enhance the network's adaptability and fault recovery capabilities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a data packet transmission method based on a hybrid label protocol stack, a gateway device, and a data packet transmission system based on a hybrid label protocol stack. Background Art

[0002] In modern network communications, data transmission efficiency and flexibility are key metrics for measuring network performance. Currently, widely used technologies include traditional routing, MPLS (Multi-Protocol Label Switching), and SRv6 (Segment Routing over IPv6). Each technology has its own unique advantages, but also faces numerous limitations and challenges. Traditional routing technologies face increasing path complexity in large-scale networks. As network scale expands, the number of routing table entries rapidly increases, increasing the processing burden on network devices. Furthermore, traditional routing technologies lack adaptability to dynamic network state changes, rapid link failure recovery, and network congestion control, which impacts network quality of service. While MPLS technology provides fast and efficient forwarding and supports priority management and path control for multiple transport protocols, its flexibility in fast failure recovery and dynamic quality of service adjustments still needs improvement. SRv6 technology leverages the high scalability and low-latency transmission characteristics of the IPv6 (Internet Protocol version 6) address space to address its shortcomings in dynamic path control, but this also introduces complexity in implementation and maintenance. With the rapid growth of IPv6 networks, the evolution of IPv4 networks to IPv6 has become a critical issue. In the process of evolving from IPv4 (Internet Protocol version 4) to IPv6, various transition solutions have been proposed to carry IPv4 network traffic, such as tunneling and dual-stack technologies. However, these solutions still face many technical challenges in implementation, including network device compatibility, path selection complexity, and efficient utilization of network resources.

[0003] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is prior art. Summary of the Invention

[0004] The main purpose of this application is to provide a data packet transmission method based on a hybrid label protocol stack, a gateway device and a data packet transmission system based on a hybrid label protocol stack, aiming to solve the technical problem of the limitations of network transmission technology in the existing technology when processing labels in different network domains.

[0005] To achieve the above objectives, the present application proposes a data packet transmission method based on a hybrid label protocol stack, which is applied to a first gateway device. The data packet transmission method based on the hybrid label protocol stack includes:

[0006] When the label encapsulation type corresponding to the data packet to be transmitted is a mixed encapsulation type, generating multiple protocol labels and a mixed control header;

[0007] Inserting each protocol label and the hybrid control header into the message structure of the data packet to be transmitted to generate a target data packet;

[0008] The target data packet is transmitted to a second gateway device, which is used to recover the target data packet according to a control flag and forward the recovered data packet to be transmitted to a terminal device. The control flag is determined based on a mixed control header in the target data packet.

[0009] In one embodiment, the step of inserting each protocol label and the hybrid control header into the message structure of the data packet to be transmitted to generate the target data packet includes:

[0010] Determining an initial Ethernet header and a location of the initial Ethernet header according to the message structure of the data packet to be transmitted;

[0011] Determining a label insertion position according to the position of the initial Ethernet header;

[0012] inserting each protocol label and the hybrid control header into the message structure of the data packet to be transmitted according to the label insertion position to obtain a first data packet;

[0013] Setting the Ethernet type value in the initial Ethernet header according to the hybrid encapsulation type to obtain a target Ethernet header;

[0014] A target data packet is generated according to the target Ethernet header and the first data packet.

[0015] In one embodiment, the step of transmitting the target data packet to the second gateway device includes:

[0016] The target data packet is sent to an intermediate gateway device, and the intermediate gateway device is used to transmit the target data packet to a second gateway device according to forwarding decision information. The forwarding decision information is obtained after the intermediate gateway device parses the target protocol label. The target protocol label is determined by the intermediate gateway device based on the label indication field in the hybrid control header. The hybrid control header is located in the target data packet.

[0017] In one embodiment, when the label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type, before the step of encapsulating the MLPS label and the second protocol label, the step further includes:

[0018] When the original data packet is obtained, the original data packet is initialized to obtain a data packet to be transmitted;

[0019] The label encapsulation type corresponding to the data packet to be transmitted is determined according to the destination address of the data packet to be transmitted.

[0020] In addition, to achieve the above-mentioned purpose, the present application proposes a data packet transmission method based on a hybrid label protocol stack, which is applied to a second gateway device. The data packet transmission method based on the hybrid label protocol stack includes:

[0021] upon receiving a target data packet transmitted by a first gateway device, determining a data packet type of the target data packet based on a target Ethernet header of the target data packet, wherein the target data packet is generated by the first gateway device by inserting a plurality of protocol labels and a hybrid control header into a message structure of a data packet to be transmitted, wherein the hybrid control header and the protocol labels are generated when a label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type;

[0022] When the data packet type is a mixed label data packet, recovering the target data packet according to the mixed control header of the target data packet to obtain the data packet to be transmitted;

[0023] The data packet to be transmitted is sent to the terminal device.

[0024] In one embodiment, the step of recovering the target data packet according to the hybrid control header of the target data packet to obtain the data packet to be transmitted includes:

[0025] Extracting information from the hybrid control header of the target data packet to obtain a control flag;

[0026] Determining the protocol tag to be removed according to the control flag;

[0027] The protocol label to be removed in the target data packet is removed to obtain a data packet to be transmitted.

[0028] In addition, to achieve the above objectives, the present application also proposes a first gateway device, which includes:

[0029] A generating module, configured to generate a plurality of protocol labels and a hybrid control header when the label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type;

[0030] An insertion module, configured to insert each protocol label and the hybrid control header into the message structure of the data packet to be transmitted to generate a target data packet;

[0031] A transmission module is used to transmit the target data packet to a second gateway device, and the second gateway device is used to recover the target data packet according to a control flag and forward the recovered data packet to be transmitted to a terminal device, wherein the control flag is determined based on a mixed control header in the target data packet.

[0032] In addition, to achieve the above objectives, the present application also proposes a second gateway device, which includes:

[0033] a processing module configured to, upon receiving a target data packet transmitted by a first gateway device, determine a data packet type of the target data packet based on a target Ethernet header of the target data packet, wherein the target data packet is generated by the first gateway device by inserting a plurality of protocol labels and a hybrid control header into a message structure of a data packet to be transmitted, wherein the hybrid control header and the protocol labels are generated when a label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type;

[0034] a recovery module, configured to, when the data packet type is a mixed label data packet, recover the target data packet according to the mixed control header of the target data packet to obtain the data packet to be transmitted;

[0035] The sending module is used to send the data packet to be transmitted to the terminal device.

[0036] In addition, to achieve the above objectives, the present application also proposes a data packet transmission system based on a hybrid label protocol stack, wherein the data packet transmission system based on the hybrid label protocol stack includes the first gateway device and the second gateway device as described above.

[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, on which a data packet transmission program based on a hybrid label protocol stack is stored. When the data packet transmission program based on the hybrid label protocol stack is executed by a processor, the data packet transmission method based on the hybrid label protocol stack as described above is implemented.

[0038] The present application provides a data packet transmission method based on a hybrid label protocol stack. The data packet transmission method based on a hybrid label protocol stack of the present application is applied to a first gateway device, and the method includes: when the label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type, generating multiple protocol labels and hybrid control headers; inserting each protocol label and the hybrid control header into the message structure of the data packet to be transmitted to generate a target data packet; transmitting the target data packet to a second gateway device, and the second gateway device is used to recover the target data packet according to a control flag and forward the recovered data packet to be transmitted to a terminal device, and the control flag is determined according to the hybrid control header in the target data packet. In the above manner, multiple protocol labels are encapsulated in a single data packet, which realizes efficient data transmission and flexible path control across different network technology domains, and can dynamically adapt to changes in the network environment, improve data transmission efficiency and network resource utilization, and enhance the network's adaptability and fault recovery capabilities. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

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

[0041] Figure 1 A flowchart illustrating a method for transmitting a data packet based on a hybrid label protocol stack according to an embodiment of the present invention is provided;

[0042] Figure 2 A schematic diagram of the hybrid label protocol stack structure of the data packet transmission method based on the hybrid label protocol stack provided in Example 1 of the present application;

[0043] Figure 3 A flow chart illustrating a second embodiment of a method for transmitting data packets based on a hybrid label protocol stack according to the present invention;

[0044] Figure 4 A schematic diagram of a simplified flow chart of a data packet transmission method based on a hybrid label protocol stack provided in Example 2 of the present application;

[0045] Figure 5 A schematic diagram of the encapsulation mechanism flow of the data packet transmission method based on the hybrid label protocol stack provided in Example 2 of the present application;

[0046] Figure 6A schematic diagram of a processing mechanism flow of a data packet transmission method based on a hybrid label protocol stack provided in Example 2 of the present application;

[0047] Figure 7 A schematic diagram of the decapsulation mechanism flow of the data packet transmission method based on the hybrid label protocol stack provided in Example 2 of the present application;

[0048] Figure 8 This is a schematic diagram of the module structure of the first gateway device according to an embodiment of the present application;

[0049] Figure 9 This is a schematic diagram of the module structure of the second gateway device according to an embodiment of the present application;

[0050] Figure 10 This is a schematic diagram of the device structure of a data packet transmission system based on a hybrid label protocol stack according to an embodiment of the present application.

[0051] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0052] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.

[0053] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0054] The main solution of the embodiment of the present application is: when the label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type, multiple protocol labels and hybrid control headers are generated; each protocol label and the hybrid control header are inserted into the message structure of the data packet to be transmitted to generate a target data packet; the target data packet is transmitted to a second gateway device, and the second gateway device is used to restore the target data packet according to a control flag and forward the restored data packet to be transmitted to the terminal device, and the control flag is determined according to the hybrid control header in the target data packet.

[0055] Currently, widely used network transmission technologies include traditional routing, MPLS (Multi-Protocol Label Switching), and SRv6 (Segment Routing over IPv6). Each technology has its own unique advantages, but also faces numerous limitations and challenges. Traditional routing technologies face increasing path complexity in large-scale network environments. As network scale expands, the number of routing table entries rapidly increases, increasing the processing burden on network devices. Furthermore, traditional routing technologies lack adaptability to dynamic network state changes, rapid link failure recovery, and network congestion control, which affects network quality of service. While MPLS technology provides fast and efficient forwarding capabilities and supports priority management and path control for multiple transport protocols, its flexibility in fast failure recovery and dynamic quality of service adjustments still needs improvement. SRv6 technology leverages the high scalability and low-latency transmission characteristics of the IPv6 (Internet Protocol version 6) address space to address its shortcomings in dynamic path control, but this also brings complexity in implementation and maintenance. With the rapid growth of IPv6 networks, the evolution of IPv4 networks to IPv6 has become a critical issue. In the process of evolving from IPv4 (Internet Protocol version 4) to IPv6, various transition solutions have been proposed to carry IPv4 network traffic, such as tunneling and dual-stack technologies. However, these solutions still face many technical challenges in implementation, including network device compatibility, path selection complexity, and efficient utilization of network resources.

[0056] This application achieves efficient data transmission and flexible path control across different network technology domains by encapsulating multiple protocol labels in a single data packet. At the same time, it can dynamically adapt to changes in the network environment, improve data transmission efficiency and network resource utilization, and enhance the network's adaptability and fault recovery capabilities.

[0057] Based on this, the embodiment of the present application provides a data packet transmission method based on a hybrid label protocol stack, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the data packet transmission method based on the hybrid label protocol stack of the present application.

[0058] In this embodiment, the data packet transmission method based on the hybrid label protocol stack is applied to a first gateway device, and the method includes steps S10 to S30:

[0059] Step S10: When the label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type, multiple protocol labels and a hybrid control header are generated.

[0060] The data packet transmission system based on the hybrid label protocol stack of this embodiment includes a first gateway device, a second gateway device and an intermediate gateway device. The first gateway device in the data packet transmission system based on the hybrid label protocol stack is used to encapsulate the original data packet; the intermediate gateway device is a gateway device located on the transmission path between the first gateway device and the second gateway device, and is used to forward the encapsulated data packet sent by the first gateway device, so that the encapsulated data packet reaches the second gateway device. In this embodiment, there can be one or more intermediate gateway devices, and the specific number is set according to actual needs; the second gateway device is used to restore the encapsulated data packet, obtain the original data packet, and forward the original data packet to the target host. In this embodiment, the gateway device can be an edge router or an edge gateway, or other device that can perform network transmission. The gateway device can support multiple network domains. The first gateway device, the intermediate gateway device and the second gateway device can support different network domains respectively, or they can support the same network domain. This embodiment does not limit this.

[0061] It is understandable that the data packet to be transmitted refers to the original data packet that has been initialized. When the original data packet needs to be transmitted from the first gateway device to the second gateway device, the original data packet is first initialized through the first gateway device. The original data packet contains an Ethernet header, an IP header, and a payload. The IP header contains information for routing and transmission control. The Ethernet header contains the destination MAC address, the source MAC address, and the Ethernet type field (EtherType). When the data packet only contains an MPLS label, the EtherType field is set to a standard MPLS type value, such as 0x8847; when the data packet contains both MPLS and SRv6 labels, the EtherType field is set to a special type value, such as 0x88D7, to distinguish such data packets; when the data packet only contains an SRv6 label, the EtherType field is set to a standard MPLS type value, such as 0x86dd.

[0062] In a specific implementation, a data packet to be transmitted can simultaneously contain multiple protocol labels, such as an SR-MPLS label and an SRv6 label. This approach allows data packets to be seamlessly transmitted across different types of networks, achieving efficient path control and flexible traffic management.

[0063] It should be noted that the label encapsulation type of the data packet to be transmitted can be determined based on the destination address of the data packet to be transmitted. Label encapsulation types include, but are not limited to, single encapsulation types and mixed encapsulation types. Single encapsulation types include, but are not limited to, MLPS label encapsulation types and SRv6 label encapsulation types, and can be set based on the specific protocol type label. In this embodiment, when the label encapsulation type is MPLS label encapsulation type, it indicates that the data packet only contains MPLS labels; when the label encapsulation type is SRv6 label encapsulation type, it indicates that the data packet only contains SRv6 labels; mixed encapsulation type indicates that the data packet contains both MPLS and SRv6 labels. In addition, mixed encapsulation types can also encapsulate other types of labels, which is not limited in this embodiment.

[0064] It is understandable that in this embodiment, the MPLS label stack contains one or more MPLS labels. Traditional MPLS labels are designed to support fast label switching technology. Each label consists of a fixed-length field, usually 20 bits, including a label value, a 3-bit traffic category field, a 1-bit bottom label indicator, and an 8-bit time-to-live value. If the data packet contains an SRv6 label, an IPv6 header is attached after the MPLS label stack. The IPv6 header contains the source IPv6 address, the destination IPv6 address, and the next header field (Next Header), where the Next Header field indicates the subsequent SRv6 extension header (i.e.). The extensibility of the IPv6 address is used to implement the segment routing function. Each SRv6 segment is represented by a 128-bit IPv6 address, which can support complex path control and policy routing. The segment routing extension contains a segment list and a segment routing label, which are used to indicate the forwarding path of the data packet in the SRv6 network.

[0065] It is understandable that when the label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type, multiple protocol labels and hybrid control headers under different protocol types are generated. In this embodiment, the hybrid control header is used to indicate the label type and other control information of the data packet. This header structure can be between the network layer (L3) and the data link layer (L2), or as part of the IPv6 extension header. The hybrid control header contains the following fields: Next Label Type: used to indicate the label type to be parsed by the data packet, for example, 0 for MPLS and 1 for SRv6; Control Flags: used for other control information, such as label stripping and priority; Reserved: used for message header extension. In this embodiment, the protocol labels under multiple different protocol types include but are not limited to MPLS labels and SRv6 labels, but in this embodiment, under the hybrid encapsulation type, labels under two protocol types, MPLS labels and SRv6 labels, are used as an example for explanation.

[0066] In the specific implementation, the encapsulation mechanism of this embodiment consists of an original data packet containing an Ethernet header, an IP header, and a payload. When the label encapsulation type is MPLS label encapsulation, only the MPLS label is encapsulated. An MPLS label is generated and inserted between the Ethernet header and the IP header. The EtherType value in the Ethernet header is set to a standard MPLS type value, such as 0x8847. The packet's structure now consists of an Ethernet header, an MPLS label stack, an IP header, and a payload.

[0067] In a feasible implementation manner, before step S10, steps A11 to A13 may be included:

[0068] Step A11: When the original data packet is obtained, the original data packet is initialized to obtain a data packet to be transmitted.

[0069] Step A12: determining a label encapsulation type corresponding to the data packet to be transmitted according to a destination address of the data packet to be transmitted.

[0070] It should be noted that after the first gateway device obtains the original data packet, it initializes the original data packet to obtain an initialized original data packet. The label encapsulation type of the data packet to be transmitted can be determined based on the destination address of the data packet to be transmitted. In this embodiment, the destination address can be determined based on the Ethernet header of the data packet to be transmitted. Label encapsulation types include hybrid encapsulation types and single encapsulation types. Single encapsulation types can be divided into first label encapsulation type, second label encapsulation type, etc., depending on the specific protocol label.

[0071] Step S20: inserting each protocol label and the hybrid control header into the message structure of the data packet to be transmitted to generate a target data packet.

[0072] It should be noted that, in this embodiment, protocol labels under multiple different protocol types and hybrid control headers are inserted into the message structure of the data packet to be transmitted, thereby obtaining a target data packet containing hybrid labels and hybrid control information.

[0073] In a feasible implementation manner, step S20 may include steps B11 to B15:

[0074] Step B11: determining an initial Ethernet header and a location of the initial Ethernet header according to the message structure of the data packet to be transmitted.

[0075] Step B12: determining a label insertion position according to the position of the initial Ethernet header.

[0076] Step B13: inserting each protocol label and the hybrid control header into the message structure of the data packet to be transmitted according to the label insertion position to obtain a first data packet.

[0077] Step B14: Setting the Ethernet type value in the initial Ethernet header according to the mixed encapsulation type to obtain a target Ethernet header.

[0078] Step B15: Generate a target data packet according to the target Ethernet header and the first data packet.

[0079] It should be noted that the Ethernet type field (EtherType) in the initial Ethernet header is not set according to the label encapsulation type. In this case, the position of the initial Ethernet header is obtained to determine the insertion positions of the protocol labels for multiple different protocol types and the hybrid control header. In this embodiment, the label insertion positions include the insertion positions of each protocol label and the hybrid control header.

[0080] It can be understood that in this embodiment, the insertion position of the hybrid control header is located after the Ethernet header, the MLPS label is located after the hybrid control header, and the SRv6 label is attached after the MLPS label, thereby obtaining a first data packet into which the MLPS label, the SRv6 label, and the hybrid control header are inserted. At the same time, in order to distinguish the hybrid label data packet, the Ethernet type value corresponding to the Ethernet type field in the initial Ethernet header is set to the value corresponding to the hybrid encapsulation type, such as 0x88D7, thereby obtaining the target Ethernet header. In this embodiment, the target Ethernet header is used to replace the initial Ethernet header in the first data packet to obtain the target data packet. The message structure of the target data packet is as follows: Figure 2As shown, it includes the Ethernet header, hybrid control header, MLPS label stack, IPv6 header, SRv6 extension header and payload.

[0081] Step S30: transmitting the target data packet to a second gateway device, wherein the second gateway device is used to recover the target data packet and forward the recovered data packet to be transmitted to the terminal device.

[0082] It should be noted that the first gateway device forwards the target data packet to the intermediate gateway device according to the hybrid control header in the target data packet, and the intermediate gateway device forwards the target data packet to the next network node according to the hybrid control header in the target data packet until it reaches the second gateway device.

[0083] It is understandable that when the target data packet enters a network domain that no longer requires SRv6 processing, the second gateway device removes the SRv6 label. The second gateway device determines the label that needs to be removed based on the control_flags field of the hybrid control header. At this time, the message structure of the target data packet becomes an Ethernet header, MPLS label stack, IP header and payload. When the target data packet is about to reach the destination or enters a network segment that no longer requires MPLS processing, the second gateway device removes the MPLS label. The second gateway device determines whether the label needs to be removed based on the BOS (Bottom of Stack flag) flag of the label stack. Finally, the message structure is restored to the Ethernet header, IP header and payload. At the final second gateway device, all attached labels are removed and the data packet to be transmitted is restored. The second gateway device parses the IP header, extracts information such as the source IP address and destination IP address, and forwards it to the final target terminal device.

[0084] In a feasible embodiment, the step S30 may include step C11: sending the target data packet to an intermediate gateway device, the intermediate gateway device being used to transmit the target data packet to a second gateway device according to forwarding decision information, the forwarding decision information being obtained by the intermediate gateway device after parsing the target protocol label, the target protocol label being determined by the intermediate gateway device based on a label indication field in a hybrid control header, and the hybrid control header being located in the target data packet.

[0085] It should be noted that the first gateway device sends the target data packet to the intermediate gateway device. The intermediate gateway device first parses the Ethernet header in the target data packet and identifies the type of the target data packet through EtherType. If EtherType is a special value corresponding to the hybrid encapsulation type, such as 0x88D7, the intermediate gateway device parses the hybrid control header. Based on the next_label_type field in the hybrid control header, it determines whether to parse the MPLS label or the SRv6 label. The intermediate gateway device parses the target protocol label and obtains forwarding decision information. It then makes a forwarding decision based on the forwarding decision information and forwards the data packet to the next hop. At each network node, the above parsing and forwarding process is repeated until the target data packet (i.e., the data packet) reaches the second gateway device. In this embodiment, when the target protocol label is an MLPS label, the forwarding decision information includes the label value and the BOS flag; when the target protocol label is an SRv6 label, the forwarding decision information refers to the segment routing information in the SRv6 label. The target protocol label is the protocol label that the intermediate gateway device is about to parse; the label indication field refers to the next_label_type field in the hybrid control header.

[0086] It can be understood that if the label indication field is 0, the intermediate gateway device extracts the MPLS label and forwards based on the forwarding decision information including the label value and the bottom of the stack flag BOS; if the label indication field is 1, the intermediate gateway device extracts the SRv6 label and makes forwarding decisions based on the segment routing information in the SRv6 label.

[0087] In the specific implementation, if the type of the target data packet is an MPLS labeled data packet, the intermediate gateway device extracts the MPLS label and makes a forwarding decision based on the label value and the bottom of the stack (BOS); if the type of the target data packet is an SRv6 labeled data packet, the intermediate gateway device extracts the SRv6 label and makes a forwarding decision based on the segment routing information in the SRv6 label until the data packet reaches the second gateway device.

[0088] This embodiment provides a data packet transmission method based on a hybrid label protocol stack. The data packet transmission method based on a hybrid label protocol stack of this embodiment is applied to a first gateway device. The data packet transmission method based on a hybrid label protocol stack includes: when the label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type, generating multiple protocol labels and hybrid control headers; inserting each protocol label and the hybrid control header into the message structure of the data packet to be transmitted to generate a target data packet; transmitting the target data packet to a second gateway device, the second gateway device is used to restore the target data packet according to a control flag and forward the restored data packet to be transmitted to a terminal device, the control flag is determined according to the hybrid control header in the target data packet. Through the above method, multiple protocol labels are encapsulated in a single data packet, achieving efficient data transmission and flexible path control across different network technology domains, and at the same time being able to dynamically adapt to changes in the network environment, improving data transmission efficiency and network resource utilization, and enhancing the network's adaptability and fault recovery capabilities.

[0089] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 3 In this embodiment, the data packet transmission method based on the hybrid label protocol stack is applied to the second gateway device, and the method includes steps S21 to S23:

[0090] Step S21, when receiving the target data packet transmitted by the first gateway device, the data packet type of the target data packet is determined according to the target Ethernet header of the target data packet, the target data packet is generated by the first gateway device inserting multiple protocol labels and a hybrid control header into the message structure of the data packet to be transmitted, and the hybrid control header and each protocol label are generated when the label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type.

[0091] It should be noted that when the second gateway device receives the target data packet transmitted by the first gateway device, it obtains the Ethernet type field in the target Ethernet header of the target data packet and determines the packet type of the target data packet based on the Ethernet type value in the Ethernet type field. For example, when the Ethernet type value is 0x8847, the packet type is an MLPS labeled data packet; when the Ethernet type value is x88D7, the packet type is a mixed labeled data packet; and when the Ethernet type value is 0x86dd, the packet type is an SRv6 labeled data packet. The above values ​​and types are merely examples for ease of understanding and can be set according to actual needs.

[0092] It can be understood that after obtaining the original data packet, the first gateway device initializes the original data packet, and then determines the corresponding label encapsulation type based on the destination address of the data packet to be transmitted. When the label encapsulation type of the data packet to be transmitted is a mixed encapsulation type, multiple protocol labels and mixed control headers are generated and encapsulated to obtain the target data packet.

[0093] Step S22: When the data packet type is a mixed label data packet, the target data packet is restored according to the mixed control header of the target data packet to obtain the data packet to be transmitted.

[0094] It should be noted that when the data packet type is a mixed label data packet, it means that the target data packet contains protocol labels under multiple protocol types. At this time, the second gateway device determines the label that needs to be removed based on the control_flags field of the mixed control header. At this time, the message structure of the target data packet becomes an Ethernet header, MPLS label stack, IP header and payload. When the target data packet is about to reach the destination or enters a network segment that no longer requires MPLS processing, the second gateway device removes the MPLS label. The second gateway device determines whether the label needs to be removed based on the BOS (Bottom of Stack flag) flag of the label stack. Finally, the message structure is restored to the Ethernet header, IP header and payload to obtain the data packet to be transmitted.

[0095] In a feasible implementation manner, the step S22 may include steps D11 to D13:

[0096] Step D11: extract information from the hybrid control header of the target data packet to obtain a control flag.

[0097] Step D12: determining the protocol tag to be removed according to the control flag.

[0098] Step D13: remove the protocol label to be removed from the target data packet to obtain the data packet to be transmitted.

[0099] It should be noted that the second gateway device extracts information from the hybrid control header, obtains a control flag, determines the protocol tag to be removed, decapsulates the protocol tag, and after the removal is complete, determines the next protocol tag to be removed based on the control flag, decapsulates it, and decapsulates the protocol tag under each protocol type layer by layer to ultimately obtain the data packet to be transmitted. In this embodiment, the control flag refers to the control_flags field of the hybrid control header.

[0100] It can be understood that when the data packet type is an MPLS label data packet, the second gateway device decapsulates the MPLS label; if the data packet type is an SRv6 label data packet, the second gateway device decapsulates the SRv6 header and SID, and restores it to an IPv6 data packet, thereby obtaining the data packet to be transmitted.

[0101] Step S23: sending the data packet to be transmitted to the terminal device.

[0102] It should be noted that the second gateway device removes all attached labels, recovers the data packet to be transmitted, parses the IP header of the data packet to be transmitted, extracts information such as the source IP address and destination IP address, and forwards the data packet to the final terminal device (ie, the target host).

[0103] This embodiment provides a data packet transmission method based on a hybrid label protocol stack. The data packet transmission method based on a hybrid label protocol stack of this embodiment is applied to a second gateway device. The data packet transmission method based on a hybrid label protocol stack includes: when receiving a target data packet transmitted by a first gateway device, determining the data packet type of the target data packet according to the target Ethernet header of the target data packet, the target data packet is generated by the first gateway device inserting multiple protocol labels and a hybrid control header into the message structure of the data packet to be transmitted, and the hybrid control header and each protocol label are generated when the label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type; when the data packet type is a hybrid label data packet, recovering the target data packet according to the hybrid control header of the target data packet to obtain the data packet to be transmitted; and sending the data packet to be transmitted to the terminal device. Through the above method, multiple protocol labels are encapsulated in a single data packet, achieving efficient data transmission and flexible path control across different network technology domains, and at the same time being able to dynamically adapt to changes in the network environment, improving data transmission efficiency and network resource utilization, and enhancing the network's adaptability and fault recovery capabilities.

[0104] For example, in order to help understand the implementation process of the data packet transmission method based on the hybrid label protocol stack obtained by combining this embodiment with the above embodiment 1, please refer to Figure 4 , Figure 4 A brief flowchart of a data packet transmission method based on a hybrid label protocol stack is provided. Specifically:

[0105] In this embodiment, if Figure 5As shown in the figure, in the encapsulation mechanism: the initial message contains an Ethernet header, an IP header, and a payload. When the network device decides to encapsulate an MPLS label, it first generates an MPLS label and inserts it between the Ethernet header and the IP header. The EtherType is set to the standard MPLS type value (for example, 0x8847). At this point, the structure of the data message becomes an Ethernet header, an MPLS label stack, an IP header, and a payload. If the data message needs to be transmitted in an SRv6 network segment, an SRv6 label is appended after the MPLS label. To distinguish such mixed-label data messages, the EtherType field is set to a special value (for example, 0x88D7). The encapsulated data message structure includes the Ethernet header, mixed control header, MPLS label stack, IPv6 header (including the SRv6 extension header), and payload.

[0106] like Figure 6 As shown in the figure, in the processing mechanism, when a data packet enters an intermediate network device, the device first parses the Ethernet header and identifies the data packet type using the EtherType field. If the EtherType field is a special value (0x88D7), the device parses the hybrid control information header. Based on the next_label_type field in the hybrid control information header, the device determines whether to parse an MPLS label or an SRv6 label. The device extracts the parsed label information and makes a forwarding decision based on the label, forwarding the data packet to the next hop. This parsing and forwarding process repeats at each network node until the data packet reaches the destination network device.

[0107] like Figure 7 As shown in the figure, in the decapsulation mechanism: when a data packet enters a network domain that no longer requires SRv6 processing, the device removes the SRv6 label. The device determines which label to remove based on the control_flags field in the hybrid control information header. At this point, the data packet structure becomes an Ethernet header, MPLS label stack, IP header, and payload. When the data packet is about to reach its destination or enters a network segment that no longer requires MPLS processing, the device removes the MPLS label. The device determines whether to remove the label based on the BOS flag in the label stack. Ultimately, the data packet structure is restored to an Ethernet header, IP header, and payload. At the final destination device, all attached labels are removed, restoring the original data packet. The device parses the IP header, extracts information such as the source IP address and destination IP address, and forwards it to the final destination terminal.

[0108] The implementation steps of this embodiment are as follows: 1. Based on the transmission path and requirements of the data packet, determine whether to encapsulate an MPLS label, an SRv6 label, or a mixture of the two. 2. If an MPLS label is required, generate an MPLS label and insert it between the Ethernet header and the IP header, setting the EtherType value to the standard MPLS type (e.g., 0x8847). If an MPLS label is not required, determine whether an SRv6 label is required. 3. If an SRv6 label is required, encapsulate the SRv6 label directly after the Ethernet header and set the EtherType value to the IPv6 type value (0x86DD). If the data packet needs to be transmitted in an SRv6 network segment and has already been encapsulated with an MPLS label, append the SRv6 label after the MPLS label and set the EtherType value to a special value (e.g., 0x88D7). Simultaneously, add the corresponding control field to the hybrid control information header for subsequent parsing and forwarding decisions. 4. Perform appropriate processing and forwarding based on the encapsulated label information. The network device parses the Ethernet header, identifies the packet type based on the Ethernet type value, parses the corresponding MPLS or SRv6 label, and performs path selection and forwarding.

[0109] For ease of understanding, let's take the example of a data packet traveling from network A (supporting SR-MPLS) to destination C via network B (supporting SRv6) to provide a more detailed explanation: Step S201: Initialize the data packet, including the Ethernet header, IP header, and payload. Step S202: Determine whether to encapsulate a hybrid label. If yes, execute step s202(a); if not, execute step s202(b); Step S202(a): Insert the hybrid control information header, set the next_label_type and other control information, set the EtherType to 0x88D7, and encapsulate the MPLS and SRv6 labels; Step S202(b): Encapsulate the MPLS or SRv6 label and set the EtherType according to the label type; Step S203: After receiving the data packet, the network device first parses the Ethernet header and checks the EtherType; Step S204: Enter the corresponding parsing state based on the EtherType value. If the EtherType is 0x88D7, execute step S204(a); if the EtherType is 0x8847, execute step S204(b); if the EtherType is 0x86DD, execute step S204(c). Step S204(a): Based on the next_label_type field in the hybrid control information header, the device determines whether to parse the MPLS label or the SRv6 label. If next_label_type is 0, execute step S204(b); if next_label_type is 1, execute step S204(c). Step S204(b): The device extracts the MPLS label and makes a forwarding decision based on the label value and the bottom-of-stack flag (BOS). Step S204(c): The device extracts the SRv6 label and makes a forwarding decision based on the segment routing information in the SRv6 label. Step S205: At each network node, the parsing and forwarding process from steps S203 to S204 is repeated until the packet reaches the destination network device. Step S206: When the data packet arrives at the destination device, the device first identifies the packet type based on the Ethernet type value. If it is a mixed-label packet, execute step S206(a); if it is an MPLS-labeled packet, execute step S206(b); if it is an SRv6-labeled packet, execute step S206(c). Step S206(a): According to the instructions in the mixed control information header, the MPLS label and SRv6 label are decapsulated layer by layer, ultimately restoring the original data packet. Step S206(b): The device decapsulates the MPLS label. Step S206(c): The device decapsulates the SRv6 header and SID, restoring the original IPv6 datagram. Step S207: The original data packet is forwarded to the destination host.

[0110] The approach of this embodiment significantly improves the efficiency and flexibility of network data transmission, enabling seamless transmission and flexible routing control across multiple network technology domains. The hybrid label protocol stack simultaneously encapsulates MPLS and SRv6 labels in a single packet, enabling seamless transmission across different network technology domains. This approach allows for efficient packet forwarding in IPv4-enabled network domains while leveraging the flexible path control capabilities of SRv6 in IPv6 network domains. This flexibility significantly improves overall network transmission efficiency and path selection accuracy. Different Ethernet type values ​​are used to distinguish the label types contained in packets, enabling network devices to quickly identify and process different types of packets. The introduction of a hybrid control header further enhances the flexibility and efficiency of packet processing. The hybrid control header contains fields such as the next label type and control flags, indicating the label type and other control information contained in the packet. When a packet is generated, the corresponding MPLS label is generated and encapsulated into the packet based on routing policies and quality of service requirements. If the packet needs to traverse an SRv6 network domain, an SRv6 label is appended after the MPLS label. By combining MPLS and SRv6 labels, the method of this embodiment achieves more efficient path selection and traffic management, significantly improving the network's quality of service and data transmission reliability.

[0111] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the data packet transmission method based on the hybrid label protocol stack of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0112] This application also provides a gateway device, please refer to Figure 8 , the first gateway device includes:

[0113] The generating module 10 is configured to generate a plurality of protocol labels and a hybrid control header when the label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type.

[0114] The inserting module 20 is configured to insert each protocol label and the hybrid control header into the message structure of the data packet to be transmitted, so as to generate a target data packet.

[0115] The transmission module 30 is used to transmit the target data packet to a second gateway device, and the second gateway device is used to recover the target data packet and forward the recovered data packet to be transmitted to the terminal device.

[0116] Optionally, the insertion module 20 is further used to:

[0117] An initial Ethernet header and a position of the initial Ethernet header are determined according to the message structure of the data packet to be transmitted; a label insertion position is determined according to the position of the initial Ethernet header; each protocol label and the hybrid control header are inserted into the message structure of the data packet to be transmitted according to the label insertion position to obtain a first data packet; an Ethernet type value in the initial Ethernet header is set according to the hybrid encapsulation type to obtain a target Ethernet header; and a target data packet is generated according to the target Ethernet header and the first data packet.

[0118] Optionally, the transmission module 30 is further configured to:

[0119] The target data packet is sent to an intermediate gateway device, and the intermediate gateway device is used to transmit the target data packet to a second gateway device according to forwarding decision information. The forwarding decision information is obtained after the intermediate gateway device parses the target protocol label. The target protocol label is determined by the intermediate gateway device based on the label indication field in the hybrid control header. The hybrid control header is located in the target data packet.

[0120] Optionally, the generating module 10 is further configured to:

[0121] When the original data packet is obtained, the original data packet is initialized to obtain the data packet to be transmitted; and the label encapsulation type corresponding to the data packet to be transmitted is determined according to the destination address of the data packet to be transmitted.

[0122] The first gateway device provided by this application adopts the data packet transmission method based on the hybrid label protocol stack in the above-mentioned embodiment, which can solve the technical problem of the limitations of network transmission technology in the prior art when processing labels in different network domains. Compared with the prior art, the beneficial effects of the first gateway device provided by this application are the same as the beneficial effects of the data packet transmission method based on the hybrid label protocol stack provided by the above-mentioned embodiment, and the other technical features of the first gateway device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0123] This application also provides a second gateway device, please refer to Figure 9 , the second gateway device includes:

[0124] The processing module 40 is used to determine the data packet type of the target data packet based on the target Ethernet header of the target data packet when receiving the target data packet transmitted by the first gateway device. The target data packet is generated by the first gateway device inserting multiple protocol labels and a hybrid control header into the message structure of the data packet to be transmitted. The hybrid control header and each protocol label are generated when the label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type.

[0125] The recovery module 50 is configured to recover the target data packet according to the hybrid control header of the target data packet to obtain the data packet to be transmitted when the data packet type is a hybrid label data packet.

[0126] The sending module 60 is configured to send the data packet to be transmitted to the terminal device.

[0127] Optionally, the recovery module 50 is further configured to extract information from the hybrid control header of the target data packet to obtain a control flag; determine a protocol label to be removed based on the control flag; and remove the protocol label to be removed from the target data packet to obtain a data packet to be transmitted.

[0128] The second gateway device provided in this application adopts the data packet transmission method based on the hybrid label protocol stack in the above-mentioned embodiment, which can solve the technical problem of the limitations of network transmission technology in the prior art when processing labels in different network domains. Compared with the prior art, the beneficial effects of the second gateway device provided in this application are the same as the beneficial effects of the data packet transmission method based on the hybrid label protocol stack provided in the above-mentioned embodiment, and the other technical features of the second gateway device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0129] This application provides a data packet transmission system based on a hybrid label protocol stack, please refer to Figure 10 , the data packet transmission system based on the hybrid label protocol stack includes: a first gateway device and a second gateway device.

[0130] The data packet transmission system based on the hybrid label protocol stack provided by the present application adopts the data packet transmission method based on the hybrid label protocol stack in the above-mentioned embodiment, which can solve the technical problem of the limitations of network transmission technology in the prior art when processing labels in different network domains. Compared with the prior art, the beneficial effects of the data packet transmission system based on the hybrid label protocol stack provided by the present application are the same as the beneficial effects of the data packet transmission method based on the hybrid label protocol stack provided by the above-mentioned embodiment, and the other technical features of the data packet transmission system based on the hybrid label protocol stack are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0131] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A data packet transmission method based on a hybrid label protocol stack, characterized in that: The data packet transmission method based on the hybrid label protocol stack is applied to a first gateway device, and the method includes: When the label encapsulation type corresponding to the data packet to be transmitted is a mixed encapsulation type, generating multiple protocol labels and a mixed control header; Inserting each protocol label and the hybrid control header into the message structure of the data packet to be transmitted to generate a target data packet; The target data packet is transmitted to a second gateway device, which is used to recover the target data packet according to a control flag and forward the recovered data packet to be transmitted to a terminal device. The control flag is determined based on a mixed control header in the target data packet.

2. The method according to claim 1, wherein The step of inserting each protocol label and the hybrid control header into the message structure of the data packet to be transmitted to generate a target data packet includes: Determining an initial Ethernet header and a location of the initial Ethernet header according to the message structure of the data packet to be transmitted; Determining a label insertion position according to the position of the initial Ethernet header; inserting each protocol label and the hybrid control header into the message structure of the data packet to be transmitted according to the label insertion position to obtain a first data packet; Setting the Ethernet type value in the initial Ethernet header according to the hybrid encapsulation type to obtain a target Ethernet header; A target data packet is generated according to the target Ethernet header and the first data packet.

3. The method according to claim 1, wherein The step of transmitting the target data packet to the second gateway device includes: The target data packet is sent to an intermediate gateway device, and the intermediate gateway device is used to transmit the target data packet to a second gateway device according to forwarding decision information. The forwarding decision information is obtained after the intermediate gateway device parses the target protocol label. The target protocol label is determined by the intermediate gateway device based on the label indication field in the hybrid control header. The hybrid control header is located in the target data packet.

4. The method according to any one of claims 1 to 3, characterized in that When the label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type, before the step of encapsulating the MLPS label and the second protocol label, the method further includes: When the original data packet is obtained, the original data packet is initialized to obtain a data packet to be transmitted; The label encapsulation type corresponding to the data packet to be transmitted is determined according to the destination address of the data packet to be transmitted.

5. A data packet transmission method based on a hybrid label protocol stack, characterized in that: The data packet transmission method based on the hybrid label protocol stack is applied to a second gateway device, and the method includes: upon receiving a target data packet transmitted by a first gateway device, determining a data packet type of the target data packet based on a target Ethernet header of the target data packet, wherein the target data packet is generated by the first gateway device by inserting a plurality of protocol labels and a hybrid control header into a message structure of a data packet to be transmitted, wherein the hybrid control header and the protocol labels are generated when a label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type; When the data packet type is a mixed label data packet, recovering the target data packet according to the mixed control header of the target data packet to obtain the data packet to be transmitted; The data packet to be transmitted is sent to the terminal device.

6. The method according to claim 5, wherein The step of recovering the target data packet according to the hybrid control header of the target data packet to obtain the data packet to be transmitted comprises: Extracting information from the hybrid control header of the target data packet to obtain a control flag; Determining the protocol tag to be removed according to the control flag; The protocol label to be removed in the target data packet is removed to obtain a data packet to be transmitted.

7. A first gateway device, characterized in that: The first gateway device includes: A generating module, configured to generate a plurality of protocol labels and a hybrid control header when the label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type; An insertion module, configured to insert each protocol label and the hybrid control header into the message structure of the data packet to be transmitted to generate a target data packet; A transmission module is used to transmit the target data packet to a second gateway device, and the second gateway device is used to recover the target data packet according to a control flag and forward the recovered data packet to be transmitted to a terminal device, wherein the control flag is determined based on a mixed control header in the target data packet.

8. A second gateway device, characterized in that: The second gateway device includes: a processing module configured to, upon receiving a target data packet transmitted by a first gateway device, determine a data packet type of the target data packet based on a target Ethernet header of the target data packet, wherein the target data packet is generated by the first gateway device by inserting a plurality of protocol labels and a hybrid control header into a message structure of a data packet to be transmitted, wherein the hybrid control header and the protocol labels are generated when a label encapsulation type corresponding to the data packet to be transmitted is a hybrid encapsulation type; a recovery module, configured to, when the data packet type is a mixed label data packet, recover the target data packet according to the mixed control header of the target data packet to obtain the data packet to be transmitted; The sending module is used to send the data packet to be transmitted to the terminal device.

9. A data packet transmission system based on a hybrid label protocol stack, characterized in that: The data packet transmission system based on the hybrid label protocol stack includes the first gateway device according to claim 7 and the second gateway device according to claim 8.

10. A storage medium, characterized in that: The storage medium stores a data packet transmission program based on a hybrid label protocol stack. When the data packet transmission program based on a hybrid label protocol stack is executed by a processor, the data packet transmission method based on a hybrid label protocol stack as described in any one of claims 1 to 4 or 5 to 6 is implemented.