Data forwarding method and apparatus, electronic device, and storage medium
By carrying data forwarding information in the IPv6 Flow Label field and combining it with the policy management of the SDN controller, the problem of excessively large packet headers caused by SRH is solved, thereby improving packet transmission efficiency and processing speed.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- CHINA TELECOM CLOUD TECH CO LTD
- Filing Date
- 2025-11-25
- Publication Date
- 2026-06-04
AI Technical Summary
In existing technologies, segmented routing (SR) results in excessively large packet headers due to the addition of path information to the packet header, which affects packet transmission efficiency and processing speed.
By carrying key information about data forwarding in the IPv6 Flow Label field and combining it with the policy management of the Software Defined Networking (SDN) controller, the Flow Label field can be used as a field to carry network data forwarding information, reducing packet header overhead and enabling path control and forwarding processes.
It reduces packet header overhead, improves network transmission efficiency and packet processing speed, and enables precise control and rapid response of the packet forwarding process.
Smart Images

Figure CN2025137506_04062026_PF_FP_ABST
Abstract
Description
Data forwarding methods, devices, electronic equipment and storage media
[0001] Cross-reference to related applications
[0002] This application claims priority to Chinese Patent Application No. 202411739543.5, filed on November 29, 2024, entitled “Data forwarding method, apparatus, electronic device and storage medium”, the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application belongs to the field of network communication technology, specifically relating to a data forwarding method, a data forwarding device, an electronic device, and a computer-readable storage medium. Background Technology
[0004] Segment Routing (SR) is a network traffic management technology that allows network administrators to control the transmission path of data packets by inserting a series of "segment" information into the packet header. Specifically, it relies on the Segment Routing Header (SRH) to add path information to the packet header, thereby controlling the transmission path of the data packets.
[0005] SRH adds a series of IPv6 (Internet Protocol Version 6) addresses to the packet header to indicate the packet's forwarding path. These IPv6 addresses form the Segment List. Since each IPv6 address is typically 128 bytes, the length of the IPv6 address directly affects the length of the packet header. However, as the complexity of the packet transmission path increases, the length of the SRH packet header also increases. This excessively large header increases the complexity of packet processing and memory consumption, thus affecting data transmission efficiency and processing speed. Summary of the Invention
[0006] In view of this, this application aims to propose a data forwarding method, apparatus, electronic device and storage medium to solve the problem that the current data packet forwarding relies on SRH to add data packet forwarding path address for path control, resulting in excessively large data packet headers, which affects data packet transmission efficiency and processing speed.
[0007] According to a first aspect of this application, a data forwarding method is provided, applied to a network device, wherein the network device communicates with a network controller, and the data forwarding method includes:
[0008] Receive data packets to be forwarded and extract the policy index value from the traffic label of the data packets;
[0009] Within the path policy set pre-issued by the network controller, determine the target path policy set corresponding to the policy index value; the target path policy set includes the next-hop network device address and the next-hop policy index value.
[0010] The next-hop network device for the data packet to be forwarded is determined based on the next-hop network device address;
[0011] Based on the next-hop policy index value, update the traffic label of the data packet and forward the updated data packet to the next-hop network device.
[0012] In some embodiments of this application, receiving a data packet to be forwarded and extracting the policy index value from the traffic label of the data packet includes:
[0013] Upon receiving a data packet to be forwarded, determine the traffic label of the data packet;
[0014] The traffic labels are parsed to extract the policy index value from the traffic labels; the policy index value is pre-configured by the network controller.
[0015] In some embodiments of this application, determining the target path policy set corresponding to the policy index value in a path policy set pre-issued by the network controller includes:
[0016] Receive the path policy set and the corresponding policy index value pre-issued by the network controller;
[0017] Generate and store a mapping table between path policy sets and policy index values;
[0018] The target path policy set corresponding to the policy index value is determined by looking up the mapping table using the policy index value.
[0019] In some embodiments of this application, after generating and storing the mapping table between the path policy set and the policy index value, the method further includes:
[0020] In response to receiving an updated path policy set and the corresponding policy index value from the network controller, the mapping table is updated.
[0021] In some embodiments of this application, updating the traffic label of a data packet according to the next-hop policy index value and forwarding the updated data packet to the next-hop network device includes:
[0022] Update the policy index value in the traffic label of the data packet to the next-hop policy index value;
[0023] The updated data packet is forwarded to the next-hop network device using the next-hop network device address.
[0024] In some embodiments of this application, after determining the next-hop network device of the data packet to be forwarded based on the next-hop network device address, the method further includes:
[0025] If the next-hop network device is determined to be the target network device for which the data packet is to be forwarded, then the data packet is forwarded to the target network device.
[0026] In some embodiments of this application, before updating the traffic label of the data packet according to the next-hop policy index value and forwarding the updated data packet to the next-hop network device, the method further includes:
[0027] In response to receiving an updated path policy set from the network controller, the next-hop network device is redefined, wherein the path policy set is updated when the network controller detects congestion or failure in the next-hop network device.
[0028] According to a second aspect of this application, a data forwarding apparatus is provided, applied to a network device that communicates with a network controller. The data forwarding apparatus includes:
[0029] The policy index extraction module is used to receive data packets to be forwarded and extract the policy index value from the traffic label of the data packets;
[0030] The path policy determination module is used to determine the target path policy set corresponding to the policy index value from the path policy set pre-issued by the network controller; the path policy set includes the next-hop network device address and the next-hop policy index value;
[0031] The network device determination module is used to determine the next-hop network device of the data packet to be forwarded based on the next-hop network device address.
[0032] The data forwarding module is used to update the traffic label of data packets according to the next-hop policy index value and forward the updated data packets to the next-hop network device.
[0033] According to another aspect of this application, an electronic device is also provided, comprising:
[0034] processor;
[0035] Memory used to store processor-executable instructions;
[0036] The processor is configured to execute instructions to implement the data forwarding method described above.
[0037] According to another aspect of this application, a readable storage medium is also provided, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the data forwarding method described above.
[0038] The data forwarding method provided in this application receives a data packet to be forwarded, extracts the policy index value from the traffic label of the data packet, determines the target path policy set corresponding to the policy index value in a path policy set pre-issued by the network controller, the target path policy set includes the next-hop network device address and the next-hop policy index value, determines the next-hop network device of the data packet to be forwarded based on the next-hop network device address, updates the traffic label of the data packet based on the next-hop policy index value, and forwards the updated data packet to the next-hop network device. This application utilizes the traffic label field of the data packet as a key information carrier indicating the path forwarding policy, avoiding the addition of an extra SRH to the data packet, thereby reducing the header overhead of the data packet. The network controller centrally manages the path policy and can dynamically update the path policy set, enabling network devices to find the target path policy set based on the policy index value in the traffic label without carrying the path policy set, reducing the processing burden on network devices and the amount of non-effective payload data transmitted in the network. The network device accurately forwards the data packet according to the forwarding policy of the path policy set, achieving precise control and rapid response in the data packet forwarding process, improving the transmission efficiency and processing speed of the data packet.
[0039] The above description is merely an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description
[0040] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of some embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0041] Figure 1 is a flowchart of a data forwarding method provided in an embodiment of this application;
[0042] Figure 2 is a flowchart of step 101 in the data forwarding method provided in the embodiment of this application in Figure 1;
[0043] Figure 3 is a flowchart of step 102 in the data forwarding method provided in the embodiment of this application in Figure 1;
[0044] Figure 4 is a flowchart of step 104 in the data forwarding method provided in the embodiment of this application in Figure 1;
[0045] Figure 5 is a flowchart of another data forwarding method provided in an embodiment of this application;
[0046] Figure 6 is a flowchart of another data forwarding method provided in an embodiment of this application;
[0047] Figure 7 is a schematic diagram of a scenario for the data forwarding method provided in an embodiment of this application;
[0048] Figure 8 is a schematic diagram of a data forwarding device provided in an embodiment of this application;
[0049] Figure 9 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been presented in the various embodiments of this application to enable readers to better understand this application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in this application can be implemented. The division of the various embodiments below is for the convenience of description and should not constitute any limitation on the specific implementation of this application. The various embodiments can be combined with and referenced by each other without contradiction.
[0051] Referring to Figure 1, a flowchart of the data forwarding method provided in this application embodiment is shown. This method is applied to a network device, which communicates with a network controller. The method may include:
[0052] Step 101: Receive the data packet to be forwarded and extract the policy index value from the traffic label of the data packet.
[0053] In this embodiment, to address the problem that current packet forwarding relies on SRH to add packet forwarding path addresses for path control, resulting in excessively large packet headers and impacting packet transmission efficiency and processing speed, this embodiment utilizes the Flow Label field in IPv6 to carry key information for data forwarding. By using the Flow Label as a field carrying network data forwarding information and combining it with the policy management of the SDN (Software Defined Network) controller, path control and forwarding of packets are achieved. This eliminates the need for SRH, instead utilizing the SDN controller and the Flow Label field in IPv6 to achieve network data forwarding, reducing packet header overhead and thus improving network transmission efficiency and packet processing speed.
[0054] This application uses a network architecture based on Internet Protocol version 6 (IPv6) as an example for illustration. In this network architecture, the network consists of multiple network devices, including but not limited to routers, switches, and firewalls. These devices are connected through a high-speed network to form a complex network topology. Each network device is equipped with a policy interpreter capable of understanding and executing SDN policies, as well as a forwarding plane capable of processing data packets. The network controller, i.e., the SDN controller, is the central management unit of the network, used to maintain a global view of the network and generate and issue segment values according to network policies. The SDN controller establishes a connection with the policy interpreters of all network devices in the network through a custom southbound interface. The SDN controller communicates with the policy interpreters of each network element device through the network to issue policy updates and routing instructions.
[0055] Specifically, referring to Figure 7, a schematic diagram of a data forwarding method provided in this application embodiment is shown. In this case, multiple network devices communicate with the network controller. The network devices receive data packets to be forwarded and extract the policy index value from the flow label of the data packets. This application embodiment takes the network devices on the data packet forwarding path, including router A, router B, router C to the destination router D, as an example. The current network device, namely router A, receives the data packets to be forwarded and extracts the policy index value from the flow label of the data packets. This application embodiment does not specifically limit the type of data packets forwarded by the network devices. The network devices receive the data packets, process the data packets, and extract the policy index value carried in the flow label. The flow label is a field in the IPv6 header used to identify and distinguish different data flows.
[0056] In this embodiment, the Flow Label field is used as the key information carrier of Segment Routing. After removing the 2 reserved bits, there are 18 bits left in the Flow Label field, which can represent the value range from 0 to 262143. The value of the Flow Label in this application will be used as the policy index value Segment key. Each policy index value Segment key corresponds to the path policy set Segment Value. The path policy set includes the forwarding policies predefined by the network controller.
[0057] Step 102: Determine the target path policy set corresponding to the policy index value in the path policy set pre-issued by the network controller; the target path policy set includes the next-hop network device address and the next-hop policy index value.
[0058] In this embodiment, the network controller pre-issues a path policy set to each network device. The path policy set is managed by the SDN controller. The forwarding policy of the path policy set includes forwarding operations, such as the next-hop address or interface, the next-hop segment key, QoS (Quality of Service) requirements, and congestion management and fault recovery policies. The SDN controller issues the forwarding policy of each segment to the policy interpreter of the network device through the southbound interface. The policy interpreter of the network device contains the mapping relationship between the segment key and the segment value, so as to determine the target path policy set corresponding to the policy index value in the path policy set pre-issued by the network controller.
[0059] Specifically, network devices, based on the policy index value in the path policy set pre-issued by the network controller, look up the target path policy set corresponding to the policy index value. There is a one-to-one correspondence between the policy index value and the path policy set; therefore, a unique path policy set can be determined based on the policy index value. This path policy set is then designated as the target path policy set. The target path policy set includes the next-hop network device address and the next-hop policy index value. At each hop network device, the policy interpreter in the network device looks up the segment value based on the segment key in the current Flow Label value of the data packet and executes the corresponding forwarding policy in the segment value. For example, when an IP (Internet Protocol) data packet arrives at the network device, the policy interpreter in the network device checks the Flow Label field of the data packet, extracts the policy index value (Segment key), and looks up the corresponding Segment value based on the Segment key.
[0060] Step 103: Determine the next-hop network device for the data packet to be forwarded based on the next-hop network device address.
[0061] In this embodiment of the application, the target path policy set includes the next-hop network device address and the next-hop policy index value. After determining the target path policy set corresponding to the policy index value, the next-hop network device of the data packet to be forwarded is determined according to the next-hop network device address in the target path policy set.
[0062] Step 104: Update the traffic label of the data packet according to the next-hop policy index value, and forward the updated data packet to the next-hop network device.
[0063] In this embodiment, after the policy interpreter in the network device determines the target path policy set, it guides the forwarding plane of the network device to process data packets based on the forwarding policy in the segment value. The current network device forwards the data packet to the next-hop network device. Before forwarding, the policy interpreter of the network device updates the flow label of the data packet according to the next-hop policy index value, that is, updates the flow label to the segment key of the next hop according to the path planning of the next segment, and forwards the updated data packet to the next-hop network device so that the next-hop network device can determine the path forwarding policy to be forwarded to the next-next-hop network device again according to the updated policy index value of the data packet.
[0064] The data forwarding method provided in this application receives a data packet to be forwarded, extracts the policy index value from the traffic label of the data packet, determines the target path policy set corresponding to the policy index value in a path policy set pre-issued by the network controller, the target path policy set includes the next-hop network device address and the next-hop policy index value, determines the next-hop network device of the data packet to be forwarded based on the next-hop network device address, updates the traffic label of the data packet based on the next-hop policy index value, and forwards the updated data packet to the next-hop network device. This application utilizes the traffic label field of the data packet as a key information carrier indicating the path forwarding policy, avoiding the addition of an extra SRH to the data packet, thereby reducing the header overhead of the data packet. The network controller centrally manages the path policy and can dynamically update the path policy set, enabling network devices to find the target path policy set based on the policy index value in the traffic label without carrying the path policy set, reducing the processing burden on network devices and the amount of non-effective payload data transmitted in the network. The network device accurately forwards the data packet according to the forwarding policy of the path policy set, achieving precise control and rapid response in the data packet forwarding process, improving the transmission efficiency and processing speed of the data packet.
[0065] Furthermore, referring to Figure 2, a flowchart of step 101 in a data forwarding method provided in Figure 1 is shown. This method is basically the same as the data forwarding method provided in some embodiments of this application. Step 101 may include:
[0066] Step 1011: Receive the data packet to be forwarded and determine the traffic label of the data packet.
[0067] Step 1012: Parse the traffic labels and extract the policy index value from the traffic labels; the policy index value is pre-configured by the network controller.
[0068] In this embodiment, a network device (such as router A) receives a data packet to be forwarded. The IPv6 header of the data packet contains a Flow Label field. The network device extracts the value of the Flow Label field from the IPv6 header and parses the extracted Flow Label field. The Flow Label field is a 20-bit value, where 18 bits represent values from 0 to 262143, used to configure the policy index value Segment key. The network device extracts the policy index value Segment key from the Flow Label field. The Segment key is a predefined value used to identify a specific path forwarding policy, so that the network device can look up the pre-configured path policy set according to the extracted Segment key. The policy index value is pre-configured by the SDN controller, and each policy index value corresponds to a specific path policy set. The path policy set contains various policies and rules, such as QoS policies, routing policies, congestion policies, etc.
[0069] This application embodiment utilizes the flow label of data packets to store the policy index value (Segment key), enabling network devices to locate path policy sets based on the policy index value. Using the Flow Label field to carry the Segment key reduces the header overhead of data packets and lowers the processing burden on network devices.
[0070] Furthermore, referring to Figure 3, a flowchart of step 102 in a data forwarding method provided in Figure 1 is shown. This method is basically the same as the data forwarding method provided in some embodiments of this application. Step 102 may include:
[0071] Step 1021: Receive the path policy set and the corresponding policy index value pre-issued by the network controller.
[0072] In this embodiment, the network controller predefines a set of packet forwarding policies, including packet forwarding paths, QoS (Quality of Service) requirements, etc., and maps these policies to a path policy set Segment value. The network controller sends the Segment value and the corresponding policy index value Segment key to the policy interpreter of each relevant network device through a preset communication protocol. The policy interpreter of the network device receives the path policy set and the corresponding policy index value pre-sent by the network controller.
[0073] Step 1022: Generate and store a mapping table between the path policy set and the policy index value.
[0074] In this embodiment, the SDN controller generates path policy sets according to network requirements and policy configuration. The SDN controller assigns a unique policy index value (Segment key) to each path policy set (Segment value). The policy index value is used to identify and distinguish different path policy sets. The SDN controller sends the path policy sets and corresponding policy index values to network devices (such as routers or switches). The policy interpreter of the network device receives and stores the path policy sets and corresponding policy index values.
[0075] Specifically, the network device's policy interpreter generates a mapping table based on the received path policy set and policy index value. The mapping table records the mapping relationship between each policy index value and the corresponding path policy set. The policy interpreter stores the generated mapping table in the network device's local storage.
[0076] Step 1023: Use the policy index value to look up the mapping table and determine the target path policy set corresponding to the policy index value.
[0077] Specifically, at each hop of network device, the policy interpreter looks up the path policy set based on the policy index value in the current Flow Label and executes the corresponding forwarding policy. That is, when a network device receives a data packet to be forwarded, the policy interpreter extracts the policy index value from the traffic label of the data packet. The policy interpreter looks up the locally stored mapping table based on the extracted policy index value. Based on the records in the mapping table, it determines the target path policy set corresponding to the policy index value. The target path policy set contains a set of predefined path policies, such as routing policies, QoS policies, security policies, etc. The network device processes the data packet accordingly based on the determined target path policy set.
[0078] This application embodiment uses policy index values and mapping tables to enable network devices to quickly find and apply predefined path policy sets. This allows network devices to find the target path policy set based on the policy index values in the traffic labels, eliminating the need to carry the path policy set. This reduces the processing burden on network devices, reduces the amount of non-payload data transmitted in the network, and improves the transmission efficiency and processing speed of data packets.
[0079] Specifically, after generating and storing the mapping table between the path policy set and the policy index value in step 1022, the method further includes updating the mapping table in response to receiving the updated path policy set and the policy index value corresponding to the path policy set from the network controller.
[0080] In this embodiment, the policy interpreter of the network device receives an updated path policy set and corresponding policy index value from the SDN controller. The update of the SDN controller includes a new path policy set, a modified path policy set, or a deleted path policy set. The policy interpreter receives the new path policy set and the corresponding policy index value, and updates the mapping table stored locally. The update operation includes adding new mapping relationships, modifying existing mapping relationships, or deleting mapping relationships that are no longer needed. The updated mapping table is stored in the local storage of the network device and takes effect immediately so that the network device can process data packets according to the new mapping table. When a data packet containing a policy index value is received, the policy interpreter looks up the corresponding path policy set according to the updated mapping table and applies the corresponding policy.
[0081] This application embodiment enables network devices to dynamically respond to SDN controller policy updates by updating the mapping table in real time. This allows path forwarding policies to be dynamically adjusted according to actual forwarding needs, improving the flexibility and adaptability of data forwarding. By dynamically updating the mapping table, network devices can promptly apply the latest path policy set, which significantly improves network performance, especially in application scenarios requiring low latency and high bandwidth.
[0082] Furthermore, referring to Figure 4, a flowchart of step 104 in a data forwarding method provided in Figure 1 is shown. This method is basically the same as the data forwarding method provided in some embodiments of this application. Step 104 may include:
[0083] Step 1041: Update the policy index value in the traffic label of the data packet to the next-hop policy index value.
[0084] In this embodiment, the network device extracts the current policy index value (segment key) from the flow label of the received data packet. The current policy index value is used to identify the current path policy set. The network device determines the policy index value of the next-hop network device based on the current path policy set. The next-hop policy index value is used to identify the path policy set that the next-hop network device should apply. The network device updates the policy index value in the flow label of the data packet to the next-hop policy index value. The updated flow label will be used to guide the data packet processing of the next-hop network device.
[0085] When a data packet is ready to be sent, the SDN controller sets an initial Flow Label value in the IPv6 header of the data packet. For example, the Flow Label is set to 000001. This value corresponds to the first Segment value on the path in the policy interpreter. The initial Segment value points to the network device address of the next hop and contains QoS requirements.
[0086] Step 1042: Using the next-hop network device address, forward the updated data packet to the next-hop network device.
[0087] Specifically, the network device determines the next-hop network device based on the address of the next-hop network device in the current path policy set. The next-hop network device address is used to identify the target device to which the data packet should be forwarded. The network device re-encapsulates the updated data packet, ensuring that the policy index value in the traffic label has been updated to the next-hop policy index value. The encapsulated data packet contains the updated traffic label. Based on the next-hop network device address, the updated data packet is forwarded to the next-hop network device. After receiving the updated data packet, the next-hop network device looks up the local mapping table based on the policy index value in the traffic label. The next-hop network device then applies the corresponding path policy set and continues to process the data packet.
[0088] For example, the policy interpreter of router A reads the policy index value 000001 in the Flow Label. According to the policy table mapping, the Segment value corresponding to the policy index value 000001 contains the next-hop indication for forwarding to router B and sets the QoS requirements. Router A forwards the packet to router B. Before forwarding, the policy interpreter updates the Flow Label to the Segment key 000010 of the next-hop network device according to the path planning of the next segment.
[0089] This application embodiment dynamically updates the policy index value in the traffic label, enabling network devices to transmit path policy sets in real time, ensuring that the correct policy is always applied during data packet transmission.
[0090] Referring to Figure 5, a flowchart of another data forwarding method provided in an embodiment of this application is shown. This method is basically the same as the data forwarding method provided in some embodiments of this application, except that the data forwarding method may further include:
[0091] Step 101: Receive the data packet to be forwarded and extract the policy index value from the traffic label of the data packet.
[0092] Step 102: Determine the target path policy set corresponding to the policy index value in the path policy set pre-issued by the network controller; the target path policy set includes the next-hop network device address and the next-hop policy index value.
[0093] Step 103: Determine the next-hop network device for the data packet to be forwarded based on the next-hop network device address.
[0094] Steps 101 to 103 described above are the same as those previously mentioned and will not be repeated here.
[0095] Step 105: If the next-hop network device is determined to be the target network device for which the data packet is to be forwarded, then the data packet is forwarded to the target network device.
[0096] In this embodiment, the network device determines whether the next-hop network device is the target network device to which the data packet is to be forwarded, based on the current path policy set. The target network device is the device to which the data packet will ultimately arrive, typically the destination of the data packet. If the next-hop network device is the target network device (i.e., the last-hop network device), the network device no longer updates the policy index value in the traffic label of the data packet; that is, the data packet has reached its final destination and no longer needs to transmit the path policy set. Specifically, the network device forwards the data packet directly to the target network device based on the address of the target network device. After receiving the data packet, the target network device looks up the local mapping table based on the policy index value in the traffic label, and applies the corresponding path policy set to complete the final processing of the data packet.
[0097] For example, the policy interpreter of router C reads the policy index value 000011 of the Flow Label, where the next-hop network device in the path policy set pointed to by the policy index value 000011 is the destination of the packet forwarding and indicates low-latency processing. Router C recognizes this as the final transmission destination and forwards the packet directly to the target network device at the transmission destination.
[0098] When there are faults or congestion on the forwarding path, the SDN controller can dynamically update the mapping relationship between segment key and segment value, and reset the next hop or QoS requirements. The network controller will periodically synchronize or dynamically push updated segment values and segment keys according to network status to ensure that the policy interpreters of all devices keep pace with the global view of the network controller. 一 To.
[0099] Compared with the prior art, the embodiments of this application, based on achieving the beneficial effects of the first embodiment, enable network devices to dynamically respond to network congestion or failures and adjust the transmission path of data packets by updating the path policy set in real time and redetermining the next-hop network device. This improves the flexibility and adaptability of the network, simplifies the configuration and management process of network devices, and enhances the overall performance and stability of the network. It has significant advantages, especially in scenarios where dynamic path adjustment and network performance improvement are required.
[0100] Referring to Figure 6, a flowchart of another data forwarding method provided in an embodiment of this application is shown. This method is basically the same as the data forwarding methods provided in some embodiments of this application, except that the data forwarding method may further include:
[0101] Step 101: Receive the data packet to be forwarded and extract the policy index value from the traffic label of the data packet.
[0102] Step 102: Determine the target path policy set corresponding to the policy index value in the path policy set pre-issued by the network controller; the target path policy set includes the next-hop network device address and the next-hop policy index value.
[0103] Step 103: Determine the next-hop network device for the data packet to be forwarded based on the next-hop network device address.
[0104] Step 106: In response to receiving an updated path policy set from the network controller, the next-hop network device is re-determined, wherein the path policy set is updated when the network controller detects congestion or failure of the next-hop network device.
[0105] In this embodiment, the policy interpreter of the network device receives an updated path policy set from the SDN controller. The path policy set is updated because the network controller detects congestion or a fault in the next-hop network device. The policy interpreter parses the received update information, extracts the new path policy set and the corresponding policy index value, and redetermines the next-hop network device. The network device then redetermines the next-hop network device based on the updated path policy set. The path policy set is updated when the network controller detects congestion or a fault in the next-hop network device. The redetermined next-hop network device is selected based on network load conditions, choosing a path and device with lower load, detecting and eliminating faulty devices and selecting available devices, or selecting a path and device that meets QoS requirements, which will not be elaborated further here.
[0106] Specifically, if the re-determined next-hop network device is different from the previous one, the network device updates the policy index value in the flow label of the data packet to the new policy index value. The updated flow label will be used to guide the packet processing of the new next-hop network device. For example, when router B reads the policy index value 000010 in the new flow label, 000010 points to the address of the next-hop router C in the policy interpreter and indicates the traffic priority. If the network controller detects congestion on the path from router B to router C, the network controller updates the path policy set and, based on the congestion management indication of the segment value, re-determines the next-hop network device. In response to receiving the updated path policy set from the network controller, router B can choose to update the forwarding path or reduce the transmission rate. Before forwarding, router B can update the policy index value 000010 in the flow label to the policy index value 000011 for re-determining the next-hop network device.
[0107] Step 104: Update the traffic label of the data packet according to the next-hop policy index value, and forward the updated data packet to the next-hop network device.
[0108] Steps 101 to 104 above are the same as those described above and will not be repeated here.
[0109] Compared with the prior art, the implementation method of this application, based on the beneficial effects brought by the first implementation method, does not need to update the policy index value when the data packet reaches the last hop network device. It directly forwards the data packet to the target network device, which simplifies the data packet processing process, improves the forwarding efficiency of data packets and the overall performance of the network, and further improves the flexibility of data forwarding.
[0110] Referring to Figure 8, a schematic diagram of a data forwarding device according to an embodiment of this application is shown. This device is applied to a network device that communicates with a network controller. The data forwarding device includes:
[0111] The policy index extraction module 201 is used to receive data packets to be forwarded and extract the policy index value from the traffic label of the data packets;
[0112] The path policy determination module 202 is used to determine the target path policy set corresponding to the policy index value in the path policy set pre-issued by the network controller; the path policy set includes the next-hop network device address and the next-hop policy index value.
[0113] The network device determination module 203 is used to determine the next-hop network device of the data packet to be forwarded based on the next-hop network device address;
[0114] The data forwarding module 204 is used to update the traffic label of the data packet according to the next-hop policy index value and forward the updated data packet to the next-hop network device.
[0115] Furthermore, the extraction strategy index module 201 includes:
[0116] The first receiving submodule is used to receive data packets to be forwarded and determine the traffic label of the data packets;
[0117] The extraction submodule is used to parse the traffic tags and extract the policy index value from the traffic tags; wherein the policy index value is pre-configured by the network controller.
[0118] Furthermore, the path determination strategy module 202 includes:
[0119] The second receiving submodule is used to receive the path policy set and the policy index value corresponding to the path policy set pre-issued by the network controller;
[0120] The generation submodule is used to generate and store a mapping table between path policy sets and policy index values;
[0121] The lookup submodule is used to look up the mapping table using the policy index value to determine the target path policy set corresponding to the policy index value.
[0122] Furthermore, the path determination strategy module 202 also includes:
[0123] The first update submodule is used to update the mapping table in response to receiving the updated path policy set and the corresponding policy index value from the network controller.
[0124] Furthermore, the data forwarding module 204 includes:
[0125] The second update submodule is used to update the policy index value in the traffic label of the data packet to the next-hop policy index value;
[0126] The first forwarding submodule is used to forward the updated data packet to the next-hop network device using the next-hop network device address.
[0127] Furthermore, the data forwarding device also includes:
[0128] The second forwarding submodule is used to forward the data packet to the target network device if it is determined that the next-hop network device is the target network device to which the data packet is to be forwarded.
[0129] Furthermore, the data forwarding device also includes:
[0130] The second device determination module is used to re-determine the next-hop network device in response to receiving an updated path policy set from the network controller, wherein the path policy set is updated when the network controller detects congestion or failure of the next-hop network device.
[0131] The data forwarding apparatus provided in this application receives data packets to be forwarded, extracts the policy index value from the traffic label of the data packet, determines the target path policy set corresponding to the policy index value in a path policy set pre-issued by the network controller, the target path policy set includes the next-hop network device address and the next-hop policy index value, determines the next-hop network device of the data packet to be forwarded based on the next-hop network device address, updates the traffic label of the data packet based on the next-hop policy index value, and forwards the updated data packet to the next-hop network device. This application utilizes the traffic label field of the data packet as a key information carrier indicating the path forwarding policy, avoiding the addition of an extra SRH to the data packet, thereby reducing the header overhead of the data packet. The network controller centrally manages the path policy and can dynamically update the path policy set, enabling network devices to find the target path policy set based on the policy index value in the traffic label without carrying the path policy set, reducing the processing burden on network devices and the amount of non-payload data transmitted in the network. The network devices accurately forward data packets according to the forwarding policy of the path policy set, achieving precise control and rapid response in the data packet forwarding process, improving the transmission efficiency and processing speed of data packets.
[0132] Referring to FIG9, this application embodiment also provides an electronic device, as shown in FIG9, including a processor 301, a communication interface 302, a memory 303, and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304.
[0133] Processor 301, memory 303 for storing processor-executable instructions;
[0134] The processor 301 is configured to execute instructions to implement the following data forwarding method:
[0135] Receive data packets to be forwarded and extract the policy index value from the traffic label of the data packets;
[0136] Within the path policy set pre-issued by the network controller, determine the target path policy set corresponding to the policy index value; the target path policy set includes the next-hop network device address and the next-hop policy index value.
[0137] The next-hop network device for the data packet to be forwarded is determined based on the next-hop network device address;
[0138] Based on the next-hop policy index value, update the traffic label of the data packet and forward the updated data packet to the next-hop network device.
[0139] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0140] The communication interface is used for communication between the aforementioned terminal and other devices.
[0141] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. In some embodiments of this application, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0142] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0143] In some embodiments provided in this application, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements any of the data forwarding methods described above.
[0144] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs (Digital Video Discs)), or semiconductor media (e.g., solid-state drives (SSDs)).
[0145] In this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, without necessarily requiring or implying any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0146] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0147] The above descriptions are merely some embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A data forwarding method, characterized in that, Applied to a network device that communicates with a network controller, the method includes: Receive the data packet to be forwarded and extract the policy index value from the traffic label of the data packet; In the path policy set pre-issued by the network controller, the target path policy set corresponding to the policy index value is determined; the target path policy set includes the next-hop network device address and the next-hop policy index value. The next-hop network device of the data packet to be forwarded is determined based on the next-hop network device address; Based on the next-hop policy index value, update the traffic label of the data packet, and forward the updated data packet to the next-hop network device.
2. The method according to claim 1, characterized in that, The step of receiving the data packet to be forwarded and extracting the policy index value from the traffic label of the data packet includes: Upon receiving a data packet to be forwarded, determine the traffic label of the data packet; The traffic label is parsed to extract the policy index value from the traffic label; wherein the policy index value is pre-configured by the network controller.
3. The method according to claim 1, characterized in that, The step of determining the target path policy set corresponding to the policy index value from the path policy set pre-issued by the network controller includes: Receive the path policy set and the policy index value corresponding to the path policy set pre-issued by the network controller; Generate and store a mapping table between path policy sets and policy index values; The mapping table is searched using the policy index value to determine the target path policy set corresponding to the policy index value.
4. The method according to claim 3, characterized in that, After generating and storing the mapping table between the path policy set and the policy index value, the method further includes: In response to receiving the updated path policy set and the corresponding policy index value from the network controller, the mapping table is updated.
5. The method according to claim 1, characterized in that, The step of updating the traffic label of the data packet according to the next-hop policy index value and forwarding the updated data packet to the next-hop network device includes: Update the policy index value in the traffic label of the data packet to the next-hop policy index value; The updated data packet is forwarded to the next-hop network device using the next-hop network device address.
6. The method according to claim 1, characterized in that, After determining the next-hop network device of the data packet to be forwarded based on the next-hop network device address, the method further includes: If the next-hop network device is determined to be the target network device for which the data packet is to be forwarded, then the data packet is forwarded to the target network device.
7. The method according to claim 1, characterized in that, Before updating the traffic label of the data packet according to the next-hop policy index value and forwarding the updated data packet to the next-hop network device, the method further includes: In response to receiving an updated path policy set from the network controller, the next-hop network device is re-determined, wherein the path policy set is updated when the network controller detects congestion or failure in the next-hop network device.
8. A data forwarding device, characterized in that, Applied to network devices that communicate with a network controller, the device includes: The policy index extraction module is used to receive data packets to be forwarded and extract the policy index value from the traffic label of the data packets; The path policy determination module is used to determine the target path policy set corresponding to the policy index value from the path policy set pre-issued by the network controller; the path policy set includes the next-hop network device address and the next-hop policy index value. A network device determination module is used to determine the next-hop network device of the data packet to be forwarded based on the next-hop network device address. The data forwarding module is used to update the traffic label of the data packet according to the next-hop policy index value, and forward the updated data packet to the next-hop network device.
9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements the data forwarding method as described in any one of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the data forwarding method as described in any one of claims 1-7.