Message forwarding control method and device, storage medium and electronic device
By detecting the remaining forwarding parameters in the forwarding device and performing parallel search and intelligent result aggregation, the problem of low multi-hop forwarding efficiency of SRv6 packets is solved, and efficient forwarding processing and resource utilization are achieved.
Patent Information
- Application Number
- CN202411637840.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-11-15
AI Technical Summary
SRv6 message forwarding and processing efficiency at nodes is low, especially during multi-hop forwarding, which significantly reduces efficiency and leads to increased forwarding delay and wasted bandwidth resources.
By detecting the remaining forwarding parameters in the forwarding device, performing parallel searches and intelligent result aggregation, the forwarding and decapsulation operations of the message are controlled, avoiding serial searches and loopback processing.
It improves the forwarding processing efficiency of messages on nodes, reduces forwarding delay and bandwidth resource waste, and improves network performance.
Smart Images

Figure CN119299359B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communications, and in particular to a method and device for controlling message forwarding, a storage medium, and an electronic device. Background Art
[0002] In today's network communications environment, carriers' bearer networks face explosive growth in data traffic and users' increasing demands for higher quality of service. SRv6 (Segment Routing over Internet Protocol version 6) technology, which embeds the Segment Routing Header (SRH) extension in IPv6 packets, provides path flexibility and policy control capabilities. As network complexity increases, multi-hop forwarding of SRv6 packets has become a key bottleneck in improving network performance.
[0003] In existing technologies, SRv6 message forwarding relies primarily on a serial lookup mechanism, meaning that each time the chip processes a SID (Segment ID), it needs to update the message's IPv6 DA (Destination Address) and perform a lookup. This mechanism works well when processing a single SID, but its efficiency decreases significantly when multiple SIDs in the Segment List are located on the same node. Nodes must use loopback technology, processing messages in an internal loop, performing SID lookups and actions in sequence. This process not only increases forwarding latency, but also severely limits message forwarding processing capabilities due to bandwidth limitations on the loopback channel.
[0004] In the related technologies, there is no effective solution to the problem of low efficiency in message forwarding and processing at nodes. Summary of the Invention
[0005] The embodiments of the present application provide a method and device for controlling message forwarding, a storage medium, and an electronic device to at least solve the problem of low message forwarding processing efficiency at a node in the related art.
[0006] According to one embodiment of the present application, a method for controlling message forwarding is provided, wherein a message sending device sequentially forwards a target message to be transmitted to a message receiving device through multiple forwarding devices. The method is applied to a target forwarding device among the multiple forwarding devices, and includes:
[0007] Upon receiving the target message, detecting whether a current remaining forwarding parameter of the target message is less than or equal to 1, wherein the remaining forwarding parameter is used to indicate a number of times the target message needs to be forwarded before being forwarded to the message receiving device;
[0008] When it is detected that the remaining forwarding parameter is less than or equal to 1, the forwarding information set maintained by the target forwarding device is searched to see whether there is forwarding information that matches the current target address information of the target message, and a first search result is obtained. At the same time, the decapsulation information set maintained by the target forwarding device is searched to see whether there is decapsulation information that matches the current destination address information of the target message, and a second search result is obtained, wherein the target address information is used to indicate the address of the next forwarding device to which the target message is currently to be forwarded, and the destination address information is used to indicate the address of the last forwarding device to which the target message is currently to be forwarded, and the target forwarding device is used to perform a forwarding operation on a message whose target address information matches the forwarding information in the forwarding information set, and to perform a decapsulation operation on a message whose destination address information matches the decapsulation information in the decapsulation information set;
[0009] A target control operation matching the first search result and the second search result is performed on the target message, wherein the target control operation is used to control whether the forwarding operation is performed on the target message.
[0010] Optionally, the performing a target control operation on the target message that matches the first search result and the second search result includes:
[0011] generating a first control operation when the first search result indicates that target forwarding information matching the target address information is found from the forwarding information set, and when the second search result indicates that target decapsulation information matching the destination address information is found from the decapsulation information set, wherein the first control operation is used to skip performing the forwarding operation on the target message and directly perform the decapsulation operation on the target message, and the target control operation includes the first control operation;
[0012] Perform the first control operation on the target message.
[0013] Optionally, the performing a target control operation on the target message that matches the first search result and the second search result includes:
[0014] If the first search result indicates that candidate forwarding information matching the target address information is found from the forwarding information set, but the second search result indicates that decapsulation information matching the destination address information is not found from the decapsulation information set, generating a second control operation based on the candidate forwarding information, wherein the second control operation is used to perform the forwarding operation indicated by the candidate forwarding information on the target packet, and the target control operation includes the second control operation;
[0015] The second control operation is performed on the target message.
[0016] Optionally, the performing a target control operation on the target message that matches the first search result and the second search result includes:
[0017] generating the target control operation according to the second search result when the first search result indicates that no forwarding information matching the target address information is found in the forwarding information set, and the target address information of the target message is the same as the address indicated by the destination address information;
[0018] The target control operation is performed on the target message.
[0019] Optionally, generating the target control operation according to the second search result includes:
[0020] If the second search result indicates that reference decapsulation information matching the destination address information is found in the decapsulation information set, generating a third control operation according to the reference decapsulation information, wherein the third control operation is used to perform the decapsulation operation indicated by the reference decapsulation information on the target packet, and the target control operation includes the third control operation;
[0021] When the second search result is used to indicate that no decapsulation information matching the destination address information is found from the decapsulation information set, a fourth control operation is generated, wherein the fourth control operation is used to prohibit the decapsulation operation from being performed on the target message, and the target control operation includes the fourth control operation.
[0022] Optionally, the performing a target control operation on the target message that matches the first search result and the second search result includes:
[0023] If the first search result indicates that no forwarding information matching the destination address information is found in the forwarding information set, and the destination address information of the target packet is different from the address indicated by the destination address information, discarding the second search result and generating a fifth control operation, wherein the fifth control operation is used to prohibit performing the decapsulation operation on the target packet, and the target control operation includes the fifth control operation;
[0024] The fifth control operation is performed on the target message.
[0025] Optionally, after detecting whether the current remaining forwarding parameter of the target packet is less than or equal to 1, the method further includes:
[0026] When it is detected that the remaining forwarding parameter is greater than 1, searching the forwarding information set maintained by the target forwarding device for forwarding information that matches the current target address information of the target message to obtain a first search result;
[0027] If the first search result indicates that reference forwarding information matching the current destination address information of the target message is found in the forwarding information set, generating a sixth control operation based on the reference forwarding information, wherein the sixth control operation is used to perform the forwarding operation indicated by the reference forwarding information on the target message, and the target control operation includes the sixth control operation;
[0028] Perform the sixth control operation on the target message, and reduce the remaining forwarding parameter by 1.
[0029] According to another embodiment of the present application, a message forwarding control device is further provided, wherein a message sending device sequentially forwards a target message to be transmitted to a message receiving device through multiple forwarding devices, and the device is applied to a target forwarding device among the multiple forwarding devices, including:
[0030] a detection module, configured to, upon receiving the target message, detect whether a current remaining forwarding parameter of the target message is less than or equal to 1, wherein the remaining forwarding parameter is used to indicate a number of times the target message needs to be forwarded before being forwarded to the message receiving device;
[0031] The first search module is used to search whether there is forwarding information that matches the current target address information of the target message from the forwarding information set maintained by the target forwarding device when it is detected that the remaining forwarding parameter is less than or equal to 1, and obtain a first search result. At the same time, it searches whether there is decapsulation information that matches the current destination address information of the target message from the decapsulation information set maintained by the target forwarding device, and obtain a second search result, wherein the target address information is used to indicate the address of the next forwarding device to which the target message is currently to be forwarded, and the destination address information is used to indicate the address of the last forwarding device to which the target message is currently to be forwarded, and the target forwarding device is used to perform a forwarding operation on a message whose target address information matches the forwarding information in the forwarding information set, and to perform a decapsulation operation on a message whose destination address information matches the decapsulation information in the decapsulation information set.
[0032] The first execution module is configured to execute a target control operation on the target message that matches the first search result and the second search result, wherein the target control operation is used to control whether to execute the forwarding operation on the target message.
[0033] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned message forwarding control method when running.
[0034] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-mentioned message forwarding control method through the computer program.
[0035] In an embodiment of the present application, a method for controlling message forwarding is proposed, wherein a message sending device forwards a target message to be transmitted to a message receiving device in sequence through multiple forwarding devices, and a target forwarding device among the multiple forwarding devices first detects whether the current remaining forwarding parameter of the target message is less than or equal to 1 when receiving the target message, and the remaining forwarding parameter can indicate the number of times the target message needs to be forwarded before being forwarded to the message receiving device; then, when it is detected that the remaining forwarding parameter is less than or equal to 1, a search is performed from the forwarding information set maintained by the target forwarding device to determine whether there is forwarding information that matches the current target address information of the target message, and a first search result is obtained. At the same time, a search is performed from the decapsulation information set maintained by the target forwarding device to determine whether there is decapsulation information that matches the current destination address information of the target message, and a second search result is obtained. The target address information can indicate the address of the next forwarding device to which the target message is currently to be forwarded, and the destination address information can indicate the address of the last forwarding device to which the target message is currently to be forwarded. The target forwarding device can perform a forwarding operation on a message whose target address information matches the forwarding information in the forwarding information set, and perform a decapsulation operation on a message whose destination address information matches the decapsulation information in the decapsulation information set. encapsulation operation; finally, performing a target control operation on the target message that matches the first search result and the second search result. The target control operation can control whether to perform a forwarding operation on the target message. That is, when it is detected that the current remaining forwarding parameter of the target message is less than or equal to 1, the corresponding target control operation is performed on the target message according to the matching of the current target address information and the destination address information of the target message with the forwarding information in the forwarding information set and the decapsulation information in the decapsulation information set maintained by the target forwarding device, respectively. This is different from the serial search in the prior art, which directly performs the forwarding operation based on the address of the next forwarding device found, and then returns to the current forwarding device through loopback processing when the address of the next forwarding device is the address of the current forwarding device. This solution takes into account parallel search and intelligent result aggregation in the multi-hop forwarding process of the message, and controls whether to perform the forwarding operation on the target message through the target control operation instead of directly performing the forwarding operation, thereby avoiding the increase in forwarding delay and waste of bandwidth resources caused by serial search and loopback processing in the prior art. The above technical solution solves the problems of low forwarding processing efficiency of messages on nodes in the related art, and achieves the technical effect of improving the forwarding processing efficiency of messages on nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] 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.
[0037] 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.
[0038] Figure 1 Schematic diagram of a hardware environment for a method for controlling message forwarding according to an embodiment of the present application;
[0039] Figure 2 This is a flow chart of a method for controlling message forwarding according to an embodiment of the present application;
[0040] Figure 3 This is a schematic diagram of a message forwarding process according to an embodiment of the present application;
[0041] Figure 4 This is a schematic diagram of a processing flow of a target forwarding device during a message forwarding process according to an embodiment of the present application;
[0042] Figure 5 This is a schematic diagram of a processing flow of parallel search during message forwarding according to an embodiment of the present application;
[0043] Figure 6 This is a schematic diagram of a processing flow when SL is equal to 1 or 0 during message forwarding according to an embodiment of the present application;
[0044] Figure 7 1 is a schematic diagram of a processing flow in a PSP case during a message forwarding process according to an embodiment of the present application;
[0045] Figure 8 This is a schematic diagram of a processing flow when SL is greater than 1 during message forwarding according to an embodiment of the present application;
[0046] Figure 9 This is a schematic diagram of a method for controlling message forwarding according to an embodiment of the present application;
[0047] Figure 10 1 is a schematic diagram of a control operation determination process for message forwarding according to an embodiment of the present application;
[0048] Figure 11 It is a structural block diagram of a control device for message forwarding according to an embodiment of the present application. DETAILED DESCRIPTION
[0049] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0050] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0051] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal, a device terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 FIG. 1 is a schematic diagram of a hardware environment for a method for controlling message forwarding according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data. In an exemplary embodiment, the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. For example, the computer terminal may also include Figure 1 More or fewer components than shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 Shown are different configurations with more functionality.
[0052] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for sending message push in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0053] The transmission device 106 is used to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by a computer terminal's communications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0054] In this embodiment, a method for controlling message forwarding is provided. A message sending device sequentially forwards a target message to be transmitted to a message receiving device through multiple forwarding devices. The method is applied to a target forwarding device among the multiple forwarding devices. Figure 2 is a flow chart of a method for controlling message forwarding according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0055] Step S202: upon receiving the target message, detecting whether a current remaining forwarding parameter of the target message is less than or equal to 1, wherein the remaining forwarding parameter is used to indicate the number of times the target message needs to be forwarded before being forwarded to the message receiving device;
[0056] Step S204, when it is detected that the remaining forwarding parameter is less than or equal to 1, search whether there is forwarding information that matches the current target address information of the target message from the forwarding information set maintained by the target forwarding device, and obtain a first search result. At the same time, search whether there is decapsulation information that matches the current destination address information of the target message from the decapsulation information set maintained by the target forwarding device, and obtain a second search result, wherein the target address information is used to indicate the address of the next forwarding device to which the target message is currently to be forwarded, and the destination address information is used to indicate the address of the last forwarding device to which the target message is currently to be forwarded, and the target forwarding device is used to perform a forwarding operation on a message whose target address information matches the forwarding information in the forwarding information set, and to perform a decapsulation operation on a message whose destination address information matches the decapsulation information in the decapsulation information set;
[0057] Step S206: Perform a target control operation on the target message that matches the first search result and the second search result, wherein the target control operation is used to control whether to perform the forwarding operation on the target message.
[0058] Through the above steps, when it is detected that the current remaining forwarding parameter of the target message is less than or equal to 1, the corresponding operation is performed on the target message according to the matching of the current target address information and the destination address information of the target message with the forwarding information in the forwarding information set and the decapsulation information in the decapsulation information set maintained by the target forwarding device. Compared with the existing technology, this solution takes into account parallel search and intelligent result aggregation in the multi-hop forwarding process of the message, thereby avoiding the increase in forwarding delay and waste of bandwidth resources caused by serial search and loopback processing in the existing technology. The above technical solution is adopted to solve the problems of low forwarding processing efficiency of messages at nodes in related technologies, and achieves the technical effect of improving the forwarding processing efficiency of messages at nodes.
[0059] Optionally, in this embodiment, the target message can be, but is not limited to, a data packet that can carry various types of information and can be forwarded through routers, switches, and other devices in the network until it reaches the destination; the type of the target message can be, but is not limited to, an SRv6 message and an MPLS message, etc. Since SRv6 messages and MPLS messages differ in message encapsulation format, the names of the information / parameters used for forwarding are different. For example, the MPLS message forwarding mechanism uses labels to guide the forwarding of data packets, while SRv6 messages use SIDs to guide the forwarding of data packets. However, the information used for forwarding, such as "labels" and "SIDs", are different detailed names for different types of messages when applying the message forwarding control method proposed in this application. The forwarding mechanisms of SRv6 messages and MPLS messages are both applicable to the message forwarding control method proposed in this application. The following text uses SRv6 messages as the target message as an example to explain the message forwarding control method, without limiting the type of the target message.
[0060] Optionally, in this embodiment, Figure 3 This is a schematic diagram of a message forwarding process according to an embodiment of the present application, such as Figure 3As shown, the message sending device may be, but is not limited to, a terminal device (such as terminal device A) that generates and sends a target message, an SRv6 source node (Source SRv6 node), and multiple forwarding devices may be, but are not limited to, multiple SRv6 nodes, wherein the first SRv6 node among the multiple SRv6 nodes is the SRv6 source node, and the SRv6 source node is used to initialize the target message in the SRv6 network architecture and send the initialized target message to the next SRv6 node, wherein the method of initializing the target message may include the following steps: encapsulating the SRH (segment routing extension header) in the target message header, and constructing a Segment List (segment list) in the SRH, wherein the Segment List is a list composed of a series of SIDs (segment IDs), and different types of SIDs represent different operations that need to be performed after the target message arrives at a node; the message receiving device can be, but is not limited to, the terminal device to which the target message is to be forwarded (such as terminal device B), and the intermediate device responsible for forwarding messages between the message sending device (such as terminal device A) and the message receiving device (such as terminal device B) is a forwarding device (device also called a node), such as an SRv6 node chip; the target forwarding device represents the node currently processing the target message; the remaining forwarding parameter can indicate the number of forwarding devices that the target message needs to reach before reaching the message receiving device, which can be, but is not limited to, SL (Segment Left, the number of remaining segments), and its initial value is the number of SIDs; the target address information can include, but is not limited to, IPv6 DA (Destination Address, destination address), and its initial value is set to the value of Segment List [SL], which is equivalent to the SID pointed to by the SL field in the local SID table, that is, SID List [SL], which is used to identify the next forwarding device to which the target message is currently forwarded; the destination address information can include, but is not limited to, Segment List[0], namely SID List[0], is used to identify the last node to which the target message is currently to be forwarded, namely the message receiving device.
[0061] Optionally, in this embodiment, the SID may include, but is not limited to, the following types: End SID (identifying a target node in the network); End.X SID (identifying a link in the network); End.T SID (identifying a specific destination in the network); End.DT4 SID (identifying an IPv4 VPN instance in the network, decapsulating the message, and searching the IPv4 VPN instance routing table for forwarding); End.DT6 SID (identifying an IPv6 VPN instance in the network, decapsulating the message, and searching the IPv6 VPN instance routing table for forwarding).
[0062] Optionally, in this embodiment, if Figure 3 As shown in the figure, assuming that n forwarding devices need to be accessed, that is, the initial value of SL is n, and the initial value of IPv6 DA is set to Segment List [n]. After the source node completes encapsulation and segment list construction for the target message, it sends the target message to the network. Each forwarding device forwards or decapsulates the target message based on the SID in the target message until the target message reaches the message receiving device. During the target message forwarding process, the SL field and IPv6 DA value in the SRH are updated each time the target message reaches a forwarding device. First, the SL field is decremented by 1, indicating that another SID has been processed. Then, the IPv6 DA value is updated to Segment List [SL] based on the SL field. This process continues until the SL field reaches 0, indicating that all SIDs in the SID List have been processed one by one, and the target message reaches the message receiving device.
[0063] Optionally, in this embodiment, Figure 4 FIG. 1 is a schematic diagram of a processing flow of a target forwarding device during a message forwarding process according to an embodiment of the present application, such as Figure 4 As shown, the target message initialized by the SRv6 source node may include but is not limited to the following contents: an outer PIv6 header (Outer IPv6 Header), SRH, SID List, and an inner IPv6 header (InnerIPv6 Header). The inner IPv6 header may be but is not limited to generating and sending the target message for the above-mentioned message sending device, and the remaining outer PIv6 header, SRH, and SID List may be but are not limited to header encapsulation added by the above-mentioned SRv6 source node.
[0064] Optionally, in this embodiment, Figure 5 is a schematic diagram of a processing flow of parallel search during message forwarding according to an embodiment of the present application, such as Figure 5As shown, the information maintained by the target forwarding device is divided into two parts according to different functions, including a forwarding information set specifically used to match the forwarding operation and a decapsulation information set specifically used to match the decapsulation operation, wherein the forwarding information set may include but is not limited to a set consisting of SIDs that identify the forwarding operation, such as the set key table1 containing End SID, End.X SID and End.T SID, and the decapsulation information set may include but is not limited to a set consisting of SIDs that identify the decapsulation operation, such as the set keytable2 containing End.DT4 SID and End.DT6 SID. When the target forwarding device receives the target message and detects that the SL field is less than or equal to 1 at this time, it compares the maintained forwarding information set with the IPv6 DA of the target message, that is, search 1, and the corresponding matching result is determined as the first search result, and the maintained decapsulation information set and the SID of the target message are compared. The matching situation of List[0], that is, search 2, the corresponding matching result is determined as the second search result; the target control operation can be but is not limited to the operation performed by the target forwarding device on the target message based on the first search result and the second search result, including forwarding operation, decapsulation operation or prohibition of decapsulation operation, etc., where the forwarding operation includes Sid Swap processing, and the decapsulation operation includes Tunnel Decap processing.
[0065] Optionally, in this embodiment, the forwarding operation may include but is not limited to the following steps: first, the target forwarding device checks whether the SL field is greater than 0, and when it detects that the SL field is greater than 0, uses the current IPv6 DA value SegmentList[SL] to perform search 1, searches for the corresponding SID in key table 1, and when the corresponding forwarding information SID is found (search 1 match), performs a corresponding forwarding operation (End SID, End.X SID, or End.T SID) according to the search result, and updates the SL field (SL minus 1) and IPv6 DA (updated to the next SID in the Segment List, that is, the SID pointed to after the SL is updated, Segment List[SL]).
[0066] Optionally, in this embodiment, the decapsulation operation may include, but is not limited to, the following steps: first, the target forwarding device checks whether the SL field is equal to 0, and when it detects that the SL field is equal to 0, uses the current IPv6 DA value Segment List[0] to perform search 2, searches for the last SID corresponding to when the SL field is 0 in key table 2, and when the corresponding decapsulation information SID is found (search 2 match), determines the final operation to be performed (End.DT4 SID or End.DT6 SID), and removes the outer PIv6 header, SRH and SID List from the target message, and transfers out the inner IPv6 header.
[0067] In an exemplary embodiment, a target control operation matching the first search result and the second search result can be performed on the target message in the following manner, but is not limited to: when the first search result is used to indicate that target forwarding information matching the target address information is found from the forwarding information set, and the second search result is used to indicate that target decapsulation information matching the destination address information is found from the decapsulation information set, a first control operation is generated, wherein the first control operation is used to skip performing the forwarding operation on the target message and directly perform the decapsulation operation on the target message, and the target control operation includes the first control operation; and the first control operation is performed on the target message.
[0068] Optionally, in this embodiment, Figure 6 1 is a schematic diagram of a processing flow when SL is equal to 1 or 0 during a message forwarding process according to an embodiment of the present application, such as Figure 6 As shown, assuming that the forwarding information set maintained by the target forwarding device matches the IPv6 DA of the target message, and the decapsulation information set also matches the destination address information (SID List[0]) of the target message, that is, lookup 1 matches and lookup 2 also matches, then the forwarding operation is skipped and the decapsulation operation is directly performed on the target message, and this operation is determined as the first control operation.
[0069] In an exemplary embodiment, a target control operation matching the first search result and the second search result can also be performed on the target message in the following manner, but not limited to: when the first search result is used to indicate that candidate forwarding information matching the target address information is found from the forwarding information set, but the second search result is used to indicate that decapsulation information matching the destination address information is not found from the decapsulation information set, a second control operation is generated based on the candidate forwarding information, wherein the second control operation is used to perform the forwarding operation indicated by the candidate forwarding information on the target message, and the target control operation includes the second control operation; and the second control operation is performed on the target message.
[0070] Optionally, in this embodiment, it is assumed that the forwarding information set maintained by the target forwarding device matches the IPv6 DA of the target message, but the decapsulation information set does not match the destination address information (SID List[0]) of the target message, that is, search 1 matches and search 2 does not match, then a forwarding operation is performed on the target message according to the search result of search 1, and this operation is determined as the second control operation.
[0071] In an exemplary embodiment, a target control operation matching the first search result and the second search result can also be performed on the target message in the following manner, but is not limited to: when the first search result is used to indicate that no forwarding information matching the target address information is found from the forwarding information set, and the target address information of the target message is the same as the address indicated by the destination address information, the target control operation is generated according to the second search result; and the target control operation is performed on the target message.
[0072] Optionally, in this embodiment, considering the PSP (Penultimate Segment Pop) situation, Figure 7 FIG. 1 is a schematic diagram of a processing flow in a PSP case during a message forwarding process according to an embodiment of the present application, such as Figure 7 As shown in the figure, when the target packet reaches the penultimate node, that is, the penultimate node is the target forwarding device, after the SRH and SID List are removed from the target packet, both Lookup 1 and Lookup 2 use the IPv6 DA of the target packet for matching.
[0073] Optionally, in this embodiment, assuming that the forwarding information set maintained by the target forwarding device does not match the IPv6 DA of the target message, but the target address information IPv6 DA of the target message is the same as the destination address information SID List[0], that is, the next node is the message receiving device, then the target control operation is determined based on the matching situation of IPv6 DA and key table2.
[0074] In an exemplary embodiment, a target control operation can be generated based on the second search result in the following manner, but is not limited to: when the second search result is used to indicate that reference decapsulation information matching the endpoint address information is found from the decapsulation information set, a third control operation is generated based on the reference decapsulation information, wherein the third control operation is used to perform the decapsulation operation indicated by the reference decapsulation information on the target message, and the target control operation includes the third control operation; when the second search result is used to indicate that decapsulation information matching the endpoint address information is not found from the decapsulation information set, a fourth control operation is generated, wherein the fourth control operation is used to prohibit the decapsulation operation from being performed on the target message, and the target control operation includes the fourth control operation.
[0075] Optionally, in this embodiment, when search 1 does not match, but the target address information IPv6DA of the target message is the same as the end address information SID List[0], the target control operation is determined according to search 2 (matching of IPv6 DA and key table2). If search 2 matches the corresponding SID, the decapsulation operation corresponding to the matching SID is performed on the target message, and this operation is determined as the third control operation. For example, if the reference decapsulation information matched by the second search result is End.DT4, the decapsulation operation of End.DT4 is performed; if the reference decapsulation information matched by the second search result is End.DT6, the decapsulation operation of End.DT6 is performed.
[0076] Optionally, in this embodiment, when search 1 does not match, but the target address information IPv6DA of the target message is the same as the destination address information SID List[0], the target control operation is determined according to search 2 (matching of IPv6 DA and key table2). If search 2 does not match the corresponding SID, the decapsulation operation on the target message is prohibited, and this operation is determined as the fourth control operation.
[0077] In an exemplary embodiment, a target control operation matching the first search result and the second search result can also be performed on the target message in the following manner, but is not limited to: when the first search result is used to indicate that forwarding information matching the target address information is not found from the forwarding information set, and the target address information of the target message is different from the address indicated by the destination address information, the second search result is discarded and a fifth control operation is generated, wherein the fifth control operation is used to prohibit the decapsulation operation on the target message, and the target control operation includes the fifth control operation; and the fifth control operation is performed on the target message.
[0078] Optionally, in this embodiment, when search 1 does not match and the target address information IPv6DA of the target message is also different from the destination address information SID List[0], whether search 2 matches the corresponding SID is not considered, and the decapsulation operation on the target message is prohibited, and this operation is determined as the fifth control operation.
[0079] In an exemplary embodiment, the remaining forwarding parameter can be updated in the following manner, but is not limited to: when it is detected that the remaining forwarding parameter is greater than 1, the forwarding information set maintained by the target forwarding device is searched to see whether there is forwarding information that matches the current target address information of the target message, and a first search result is obtained; when the first search result is used to indicate that reference forwarding information that matches the current target address information of the target message is found in the forwarding information set, a sixth control operation is generated based on the reference forwarding information, wherein the sixth control operation is used to perform the forwarding operation indicated by the reference forwarding information on the target message, and the target control operation includes the sixth control operation; the sixth control operation is performed on the target message, and the remaining forwarding parameter is reduced by 1.
[0080] Optionally, in this embodiment, Figure 8 1 is a schematic diagram of a processing flow when SL is greater than 1 during message forwarding according to an embodiment of the present application, such as Figure 8 As shown, when it is detected that the remaining forwarding parameter SL field is greater than 1, the current IPv6 DA value Segment List[SL] is used to perform search 1, and the first search result indicates whether a SID matching Segment List[SL] is found in key table 1. When a SID matching Segment List[SL] is found, the forwarding operation indicated by Segment List[SL] is performed on the target message, and this operation is determined as the sixth control operation.
[0081] In this embodiment, a method for controlling message forwarding is provided. Figure 9 FIG. 1 is a schematic diagram of a method for controlling message forwarding according to an embodiment of the present application. Figure 9As shown, it mainly includes the following steps: First, the information maintained by the target forwarding device is divided into two parts according to different functions, including a forwarding information set key table1 (including End SID, End.X SID and End.T SID) specifically used to match the forwarding operation and a decapsulation information set key table2 (End.DT4 SID and End.DT6 SID) specifically used to match the decapsulation operation. Then, the target forwarding device detects the SL field in the SRH of the target message. When it detects that the SL field is equal to 1, it triggers two parallel search processes, namely search 1 and search 2. Search 1 uses the destination address information (IPv6 DA) of the target message to perform a search in the forwarding information set (key table1 set), and search 2 uses the end address information (SID List[0]) to perform a search in the decapsulation information set (key table2 set). These two searches are aimed at finding the SIDs corresponding to IPv6 DA and SID List[0] in key table1 and key table2 respectively. Finally, the results of the two searches are summarized to determine the final target control operation. Figure 10 FIG. 1 is a schematic diagram of a control operation determination process for message forwarding according to an embodiment of the present application, such as Figure 10 As shown, based on the summary processing of the search results of search 1 and search 2, five situations can be obtained:
[0082] Case 1: If both lookup 1 and lookup 2 match, the forwarding operation is skipped and the target message is directly decapsulated.
[0083] Case 2: If the packet matches the query result in Lookup 1 but not in Lookup 2, the target packet is forwarded based on the query result in Lookup 1.
[0084] Case 3. If there is no match in search 1 and the IPv6 DA of the target packet is the same as SID List[0], and there is a match in search 2, then the decapsulation operation corresponding to the matching SID is performed on the target packet;
[0085] Case 4: If there is no match in search 1 and the IPv6 DA of the target packet is the same as SID List[0], and there is no match in search 2, then decapsulation of the target packet is prohibited;
[0086] Case 5. If there is no match in Lookup 1 and the IPv6 DA of the target packet is different from SID List[0], the matching result of Lookup 2 is not considered and decapsulation of the target packet is prohibited.
[0087] Through the above approach, parallel search and intelligent result aggregation are taken into account during the multi-hop forwarding process of the message, thereby avoiding the increase in forwarding delay and waste of bandwidth resources caused by serial search and loopback processing in the prior art.
[0088] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0089] Figure 11 is a structural block diagram of a control device for message forwarding according to an embodiment of the present application; Figure 11 As shown, the message sending device forwards the target message to be transmitted to the message receiving device in sequence through multiple forwarding devices, and the device is applied to the target forwarding device among the multiple forwarding devices, including:
[0090] a detection module 1102, configured to, upon receiving the target message, detect whether a current remaining forwarding parameter of the target message is less than or equal to 1, wherein the remaining forwarding parameter is used to indicate a number of times the target message needs to be forwarded before being forwarded to the message receiving device;
[0091] The first search module 1104 is configured to, when detecting that the remaining forwarding parameter is less than or equal to 1, search the forwarding information set maintained by the target forwarding device for forwarding information that matches the current target address information of the target message, and obtain a first search result. At the same time, search the decapsulation information set maintained by the target forwarding device for decapsulation information that matches the current destination address information of the target message, and obtain a second search result, wherein the target address information is used to indicate the address of the next forwarding device to which the target message is currently to be forwarded, and the destination address information is used to indicate the address of the last forwarding device to which the target message is currently to be forwarded, and the target forwarding device is configured to perform a forwarding operation on a message whose target address information matches the forwarding information in the forwarding information set, and to perform a decapsulation operation on a message whose destination address information matches the decapsulation information in the decapsulation information set;
[0092] The first execution module 1106 is configured to execute a target control operation on the target message that matches the first search result and the second search result, wherein the target control operation is used to control whether to execute the forwarding operation on the target message.
[0093] In an exemplary embodiment, the first execution module includes:
[0094] a first generating unit, configured to generate a first control operation when the first search result indicates that target forwarding information matching the target address information is found from the forwarding information set, and the second search result indicates that target decapsulation information matching the destination address information is found from the decapsulation information set, wherein the first control operation is configured to skip performing the forwarding operation on the target message and directly perform the decapsulation operation on the target message, and the target control operation includes the first control operation;
[0095] A first execution unit is configured to execute the first control operation on the target message.
[0096] In an exemplary embodiment, the first execution module includes:
[0097] a second generating unit, configured to, if the first search result indicates that candidate forwarding information matching the target address information is found from the forwarding information set, but the second search result indicates that decapsulation information matching the destination address information is not found from the decapsulation information set, generate a second control operation based on the candidate forwarding information, wherein the second control operation is configured to perform the forwarding operation indicated by the candidate forwarding information on the target packet, and the target control operation includes the second control operation;
[0098] A second execution unit is configured to execute the second control operation on the target message.
[0099] In an exemplary embodiment, the first execution module includes:
[0100] a third generating unit, configured to generate the target control operation according to the second search result, if the first search result indicates that no forwarding information matching the target address information is found in the forwarding information set, and the target address information of the target message is the same as the address indicated by the destination address information;
[0101] The third execution unit performs the target control operation on the target message.
[0102] In an exemplary embodiment, the third generating unit is configured to:
[0103] If the second search result indicates that reference decapsulation information matching the destination address information is found in the decapsulation information set, generating a third control operation according to the reference decapsulation information, wherein the third control operation is used to perform the decapsulation operation indicated by the reference decapsulation information on the target packet, and the target control operation includes the third control operation;
[0104] When the second search result is used to indicate that no decapsulation information matching the destination address information is found from the decapsulation information set, a fourth control operation is generated, wherein the fourth control operation is used to prohibit the decapsulation operation from being performed on the target message, and the target control operation includes the fourth control operation.
[0105] In an exemplary embodiment, the first execution module includes:
[0106] a discarding unit, configured to discard the second search result and generate a fifth control operation if the first search result indicates that no forwarding information matching the destination address information is found in the forwarding information set, and the destination address information of the destination message is different from the address indicated by the destination address information, wherein the fifth control operation is configured to prohibit performing the decapsulation operation on the destination message, and the destination control operation includes the fifth control operation;
[0107] The fourth execution unit performs the fifth control operation on the target message.
[0108] In an exemplary embodiment, the apparatus further comprises:
[0109] A second search module is configured to, after detecting whether the current remaining forwarding parameter of the target message is less than or equal to 1, search, if detecting that the remaining forwarding parameter is greater than 1, whether there is forwarding information matching the current target address information of the target message from the forwarding information set maintained by the target forwarding device, to obtain a first search result;
[0110] a generating module configured to, when the first search result indicates that reference forwarding information matching the current destination address information of the target message is found in the forwarding information set, generate a sixth control operation based on the reference forwarding information, wherein the sixth control operation is configured to perform the forwarding operation indicated by the reference forwarding information on the target message, and the target control operation includes the sixth control operation;
[0111] The second execution module is configured to execute the sixth control operation on the target message and reduce the remaining forwarding parameter by 1.
[0112] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0113] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0114] S1, upon receiving the target message, detecting whether a current remaining forwarding parameter of the target message is less than or equal to 1, wherein the remaining forwarding parameter is used to indicate the number of times the target message needs to be forwarded before being forwarded to the message receiving device;
[0115] S2. When it is detected that the remaining forwarding parameter is less than or equal to 1, the forwarding information set maintained by the target forwarding device is searched for forwarding information that matches the current target address information of the target message, and a first search result is obtained. At the same time, the decapsulation information set maintained by the target forwarding device is searched for decapsulation information that matches the current destination address information of the target message, and a second search result is obtained, wherein the target address information is used to indicate the address of the next forwarding device to which the target message is currently to be forwarded, and the destination address information is used to indicate the address of the last forwarding device to which the target message is currently to be forwarded, and the target forwarding device is used to perform a forwarding operation on a message whose target address information matches the forwarding information in the forwarding information set, and to perform a decapsulation operation on a message whose destination address information matches the decapsulation information in the decapsulation information set;
[0116] S3. Perform a target control operation on the target message that matches the first search result and the second search result, wherein the target control operation is used to control whether to perform the forwarding operation on the target message.
[0117] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0118] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0119] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0120] S1, upon receiving the target message, detecting whether a current remaining forwarding parameter of the target message is less than or equal to 1, wherein the remaining forwarding parameter is used to indicate the number of times the target message needs to be forwarded before being forwarded to the message receiving device;
[0121] S2. When it is detected that the remaining forwarding parameter is less than or equal to 1, the forwarding information set maintained by the target forwarding device is searched for forwarding information that matches the current target address information of the target message, and a first search result is obtained. At the same time, the decapsulation information set maintained by the target forwarding device is searched for decapsulation information that matches the current destination address information of the target message, and a second search result is obtained, wherein the target address information is used to indicate the address of the next forwarding device to which the target message is currently to be forwarded, and the destination address information is used to indicate the address of the last forwarding device to which the target message is currently to be forwarded, and the target forwarding device is used to perform a forwarding operation on a message whose target address information matches the forwarding information in the forwarding information set, and to perform a decapsulation operation on a message whose destination address information matches the decapsulation information in the decapsulation information set;
[0122] S3. Perform a target control operation on the target message that matches the first search result and the second search result, wherein the target control operation is used to control whether to perform the forwarding operation on the target message.
[0123] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0124] Optionally, specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0125] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present application can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices. Optionally, they can be implemented using program code executable by the computing device, so that they can be stored in a storage device and executed by the computing device. In some cases, the steps shown or described can be performed in a different order than herein, or they can be made into individual integrated circuit modules, or multiple modules or steps can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0126] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for controlling message forwarding, characterized in that: The message sending device forwards the target message to be transmitted to the message receiving device in sequence through multiple forwarding devices. The method is applied to the target forwarding device among the multiple forwarding devices, including: Upon receiving the target message, detecting whether a current remaining forwarding parameter of the target message is less than or equal to 1, wherein the remaining forwarding parameter is used to indicate a number of times the target message needs to be forwarded before being forwarded to the message receiving device; When it is detected that the remaining forwarding parameter is less than or equal to 1, the forwarding information set maintained by the target forwarding device is searched to see whether there is forwarding information that matches the current target address information of the target message, and a first search result is obtained. At the same time, the decapsulation information set maintained by the target forwarding device is searched to see whether there is decapsulation information that matches the current destination address information of the target message, and a second search result is obtained, wherein the target address information is used to indicate the address of the next forwarding device to which the target message is currently to be forwarded, and the destination address information is used to indicate the address of the last forwarding device to which the target message is currently to be forwarded, and the target forwarding device is used to perform a forwarding operation on a message whose target address information matches the forwarding information in the forwarding information set, and to perform a decapsulation operation on a message whose destination address information matches the decapsulation information in the decapsulation information set; A target control operation matching the first search result and the second search result is performed on the target message, wherein the target control operation is used to control whether the forwarding operation is performed on the target message.
2. The method according to claim 1, characterized in that The performing a target control operation on the target message that matches the first search result and the second search result includes: generating a first control operation when the first search result indicates that target forwarding information matching the target address information is found from the forwarding information set, and when the second search result indicates that target decapsulation information matching the destination address information is found from the decapsulation information set, wherein the first control operation is used to skip performing the forwarding operation on the target message and directly perform the decapsulation operation on the target message, and the target control operation includes the first control operation; Perform the first control operation on the target message.
3. The method according to claim 1, characterized in that The performing a target control operation on the target message that matches the first search result and the second search result includes: If the first search result indicates that candidate forwarding information matching the target address information is found from the forwarding information set, but the second search result indicates that decapsulation information matching the destination address information is not found from the decapsulation information set, generating a second control operation based on the candidate forwarding information, wherein the second control operation is used to perform the forwarding operation indicated by the candidate forwarding information on the target packet, and the target control operation includes the second control operation; The second control operation is performed on the target message.
4. The method according to claim 1, wherein The performing a target control operation on the target message that matches the first search result and the second search result includes: generating the target control operation according to the second search result when the first search result indicates that no forwarding information matching the target address information is found in the forwarding information set, and the target address information of the target message is the same as the address indicated by the destination address information; The target control operation is performed on the target message.
5. The method according to claim 4, characterized in that Generating the target control operation according to the second search result includes: If the second search result indicates that reference decapsulation information matching the destination address information is found in the decapsulation information set, generating a third control operation according to the reference decapsulation information, wherein the third control operation is used to perform the decapsulation operation indicated by the reference decapsulation information on the target packet, and the target control operation includes the third control operation; When the second search result is used to indicate that no decapsulation information matching the destination address information is found from the decapsulation information set, a fourth control operation is generated, wherein the fourth control operation is used to prohibit the decapsulation operation from being performed on the target message, and the target control operation includes the fourth control operation.
6. The method according to claim 1, characterized in that The performing a target control operation on the target message that matches the first search result and the second search result includes: If the first search result indicates that no forwarding information matching the destination address information is found in the forwarding information set, and the destination address information of the target packet is different from the address indicated by the destination address information, discarding the second search result and generating a fifth control operation, wherein the fifth control operation is used to prohibit performing the decapsulation operation on the target packet, and the target control operation includes the fifth control operation; The fifth control operation is performed on the target message.
7. The method according to claim 1, characterized in that After detecting whether the current remaining forwarding parameter of the target message is less than or equal to 1, the method further includes: When it is detected that the remaining forwarding parameter is greater than 1, searching the forwarding information set maintained by the target forwarding device for forwarding information that matches the current target address information of the target message to obtain a first search result; If the first search result indicates that reference forwarding information matching the current destination address information of the target message is found in the forwarding information set, generating a sixth control operation based on the reference forwarding information, wherein the sixth control operation is used to perform the forwarding operation indicated by the reference forwarding information on the target message, and the target control operation includes the sixth control operation; Perform the sixth control operation on the target message, and reduce the remaining forwarding parameter by 1.
8. A message forwarding control device, characterized in that: The message sending device forwards the target message to be transmitted to the message receiving device in sequence through multiple forwarding devices. The apparatus is applied to the target forwarding device among the multiple forwarding devices, including: a detection module, configured to, upon receiving the target message, detect whether a current remaining forwarding parameter of the target message is less than or equal to 1, wherein the remaining forwarding parameter is used to indicate a number of times the target message needs to be forwarded before being forwarded to the message receiving device; The first search module is used to search the forwarding information set maintained by the target forwarding device for forwarding information that matches the current target address information of the target message when it is detected that the remaining forwarding parameter is less than or equal to 1, and obtain a first search result. At the same time, it searches the decapsulation information set maintained by the target forwarding device for decapsulation information that matches the current destination address information of the target message, and obtain a second search result, wherein the target address information is used to indicate the address of the next forwarding device to which the target message is currently to be forwarded, and the destination address information is used to indicate the address of the last forwarding device to which the target message is currently to be forwarded, and the target forwarding device is used to perform a forwarding operation on a message whose target address information matches the forwarding information in the forwarding information set, and to perform a decapsulation operation on a message whose destination address information matches the decapsulation information in the decapsulation information set. The first execution module is configured to execute a target control operation on the target message that matches the first search result and the second search result, wherein the target control operation is used to control whether to execute the forwarding operation on the target message.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.
Citation Information
Patent Citations
Method for forwarding message in SRv6 network and related device
CN118214704A
Message forwarding method and device, computer equipment and storage medium
CN118353824A