Message forwarding control method and device, storage medium and electronic device
Through parallel search and intelligent result summary methods, the problem of low multi-jump forwarding processing of SRv6 packets is solved, and the forwarding efficiency and bandwidth utilization of network communication are improved.
Patent Information
- Application Number
- CN202411637840.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-11-15
AI Technical Summary
In a network communication environment, the multi-hop forwarding processing efficiency of SRv6 packets is low, resulting in increased forwarding delay and waste of bandwidth resources.
By detecting the remaining forwarding parameters of the target message, using parallel search and intelligent result summary, the forwarding and de-encapsulation operations of the message between multiple forwarding devices are controlled to avoid serial search and loopback processing.
Improve the efficiency of forwarding and processing of packets on nodes, reducing forwarding delay and waste of bandwidth resources.
Smart Images

Figure CN119299359A_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 communication environment, operators' bearer networks are facing explosive growth in data traffic and users' increasing demand for network service quality. SRv6 (Segment Routing over Internet Protocol version 6) technology provides network path flexibility and policy control capabilities by embedding the Segment Routing Header (SRH) in IPv6 packets. With the increase in network complexity, multi-hop forwarding processing of SRv6 packets has become a key bottleneck for improving network performance.
[0003] In the prior art, the forwarding of SRv6 messages mainly relies on a serial search mechanism, that is, each time the chip processes a SID (Segment ID), it needs to update the message's IPv6 DA (Destination Address) and perform a search. This mechanism works well when processing a single SID, but when multiple SIDs in the Segment List are located on the same node, the efficiency is significantly reduced. The node must use loopback technology, that is, process messages in an internal loop, and perform SID searches and actions in sequence. This process not only increases the forwarding delay, but also severely limits the message forwarding processing capabilities due to the bandwidth limitation of the loopback channel.
[0004] In view of the problems in related technologies such as low efficiency in message forwarding and processing at nodes, no effective solution has been proposed yet. 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, so as to at least solve the problem of low efficiency of message forwarding processing on a node in the related art.
[0006] According to an 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, and the method is applied to a target forwarding device among the multiple forwarding devices, including:
[0007] When the target message is received, detecting whether the 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;
[0008] In the case where 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, 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 to perform the forwarding operation 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] In a case where 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, generating a first control operation, 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] The first control operation is performed 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] In a case where 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, generating a second control operation according to 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;
[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 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;
[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] In a case where the second search result is used to indicate that reference decapsulation information matching the destination address information is found from 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 message, 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] In a case where 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 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 the decapsulation operation from being performed on the target message, 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 message 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 from the forwarding information set maintained by the target forwarding device whether there is forwarding information matching the current target address information of the target message, and obtaining a first search result;
[0027] In a case where the first search result is used to indicate that reference forwarding information matching the current target address information of the target message is found in the forwarding information set, generating a sixth control operation according to 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 embodiment of the present application, a control device for message forwarding 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 detect, upon receiving the target message, 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, when it is detected that the remaining forwarding parameter is less than or equal to 1, search from the forwarding information set maintained by the target forwarding device to see whether there is forwarding information that matches the current target address information of the target message, and obtain a first search result. At the same time, search from the decapsulation information set maintained by the target forwarding device to see whether there is 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.
[0032] The first execution module is used to execute a target control operation matching the first search result and the second search result on the target message, 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 control method for message forwarding through the computer program.
[0035] In an embodiment of the present application, a control method for message forwarding is proposed, in which 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 forwarding information set maintained by the target forwarding device is searched for whether there is forwarding information matching the current target address information of the target message, and a first search result is obtained. At the same time, a decapsulation information set maintained by the target forwarding device is searched for whether there is decapsulation information matching 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, and 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, a target control operation matching the first search result and the second search result is performed on the target message. 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. Different from the serial search in the prior art, the forwarding operation is directly performed according to the address of the next forwarding device found, and then the address of the next forwarding device is returned to the current forwarding device through loopback processing when the address of the next forwarding device is the address of the current forwarding device. In the process of multi-hop forwarding of the message, the present solution takes into account parallel search and intelligent result aggregation, and controls whether to perform the forwarding operation on the target message through the target control operation, rather than 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 is adopted to solve the problems of low forwarding processing efficiency of the message on the node in the related technology, and achieves the technical effect of improving the forwarding processing efficiency of the message on the node. 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 drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0038] Figure 1 It is a hardware environment schematic diagram of a method for controlling message forwarding according to an embodiment of the present application;
[0039] Figure 2 is a flow chart of a method for controlling message forwarding according to an embodiment of the present application;
[0040] Figure 3 It is a schematic diagram of a flow of a message forwarding process according to an embodiment of the present application;
[0041] Figure 4 It is a schematic diagram of a processing flow of a target forwarding device in a message forwarding process according to an embodiment of the present application;
[0042] Figure 5 It is a schematic diagram of a processing flow of parallel search in a message forwarding process according to an embodiment of the present application;
[0043] Figure 6 It is a schematic diagram of a processing flow when SL is equal to 1 or 0 in a message forwarding process according to an embodiment of the present application;
[0044] Figure 7 It 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 It 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] Fig. 9 It is a schematic diagram of a control method flow of a message forwarding according to an embodiment of the present application;
[0047] Fig.10 It is a schematic diagram of a control operation determination process of message forwarding according to an embodiment of the present application;
[0048] Fig.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 solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present 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 sequence. 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 of their variations 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 Schematic diagram of the hardware environment of 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 in the figure) processor 102 (processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) 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 can 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. Figure 1 More or fewer components as shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 A different configuration with more features is shown.
[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, to implement the above 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 examples, the memory 104 may further include a memory remotely arranged 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 send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can 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, wherein a message sending device sequentially forwards a target message to be transmitted to a message receiving device through multiple forwarding devices, and 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, when the target message is received, detecting whether the 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 from the forwarding information set maintained by the target forwarding device whether there is forwarding information that matches the current target address information of the target message, and obtain a first search result. At the same time, search from the decapsulation information set maintained by the target forwarding device whether there is 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;
[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 prior art, this scheme takes into account parallel search and intelligent result aggregation in the process of multi-hop forwarding of messages, 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 scheme is adopted to solve the problems of low forwarding processing efficiency of messages on nodes in related technologies, and achieves the technical effect of improving the forwarding processing efficiency of messages on nodes.
[0059] Optionally, in this embodiment, the target message may be, but is not limited to, a data packet that can carry various types of information, and may be forwarded through routers, switches and other devices in the network until it reaches the destination; the type of the target message may be, but is not limited to, an SRv6 message and an MPLS message, etc. Since the SRv6 message and the MPLS message are different in message encapsulation format, there are differences in the names of the information / parameters used for forwarding. For example, the MPLS message forwarding mechanism uses labels to guide the forwarding of data packets, while the SRv6 message uses SID 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 the SRv6 message as an example of the target message to explain the message forwarding control method, without limiting the type of the target message.
[0060] Optionally, in this embodiment, Figure 3 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 the 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 an SRH (segment routing extension header) in the target message header, and constructing a 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 is 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), and its initial value is the number of SIDs; the target address information can include, but is not limited to, IPv6 DA (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 to be 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 purpose 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, it is assumed 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 the encapsulation and segment list construction of the target message, it sends the target message to the network. Each forwarding device performs forwarding or decapsulation operations on the target message according to the SID in the target message until the target message reaches the message receiving device. During the target message forwarding process, each time the target message reaches a forwarding device, the SL field and IPv6DA values in SRH will be updated. First, the SL field will be reduced by 1, indicating that another SID has been processed, and then the IPv6DA value will be updated to Segment List [SL] according to the SL field until the SL field is 0, that is, the SIDs in the SIDList have been processed one by one, and the target message reaches the message receiving device.
[0063] Optionally, in this embodiment, Figure 4 is a schematic diagram of a processing flow of a target forwarding device in 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 in a message forwarding process 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 a 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 a 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, the maintained forwarding information set is compared 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 according to the first search result and the second search result, including forwarding operation, decapsulation operation or prohibition of decapsulation operation, etc., wherein 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 is detected 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 table1, and when the corresponding forwarding information SID is found (search 1 matches), 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 IPv6DA (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 key table 2 for the last SID corresponding to when the SL field is 0, and when the corresponding decapsulation information SID is found (search 2 matches), determines the final operation to be performed (End.DT4 SID or End.DT6 SID), 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 a first search result and a second search result can be performed on a 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 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, search 1 matches and search 2 also matches, then the forwarding operation is skipped and the decapsulation operation is performed directly 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 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 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 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, it means that when the target message reaches the second-to-last node, that is, the second-to-last node is the target forwarding device, after the SRH and SID List are removed from the target message, both Lookup 1 and Lookup 2 use the IPv6 DA of the target message for matching.
[0073] Optionally, in this embodiment, it is assumed 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 a message receiving device, then the target control operation is determined based on the matching situation of the 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 has been 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 has not been 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 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 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 from being performed 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, searching the forwarding information set maintained by the target forwarding device to see whether there is forwarding information that matches the current target address information of the target message, and obtaining a first search result; when the first search result is used to indicate that reference forwarding information that matches the current target address information of the target message has been 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; performing the sixth control operation on the target message, and reducing the remaining forwarding parameter by 1.
[0080] Optionally, in this embodiment, Figure 8 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. Fig. 9 is a schematic diagram of a control method flow for message forwarding according to an embodiment of the present application, such as Fig. 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 is detected 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 destination address information (SID List[0]) to perform a search in the decapsulation information set (key table2 set). These two searches are intended to find 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. Fig.10 is a schematic diagram of a control operation determination process for message forwarding according to an embodiment of the present application, such as Fig.10 As shown, five situations can be obtained by summarizing the search results of search 1 and search 2:
[0082] Case 1: If both search 1 and search 2 match, the forwarding operation is skipped and the decapsulation operation is performed directly on the target message;
[0083] Case 2: If search 1 matches but search 2 does not match, the target message is forwarded according to the search result of search 1.
[0084] Case 3: If search 1 fails to match and the IPv6 DA of the target packet is the same as SID List[0], search 2 matches, and the decapsulation operation corresponding to the matching SID is performed on the target packet;
[0085] Case 4: If search 1 fails to match, and the IPv6 DA of the target packet is the same as SID List[0], and search 2 fails to match, 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 match result of Lookup 2 is not considered and decapsulation of the target packet is prohibited.
[0087] Through the above-mentioned method, parallel search and intelligent result aggregation are taken into account in the process of multi-hop forwarding of messages, thereby avoiding the increase of 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 a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an 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 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] Fig.11 is a structural block diagram of a control device for message forwarding according to an embodiment of the present application; Fig.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 is used to detect whether a current remaining forwarding parameter of the target message is less than or equal to 1 when the target message is received, 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;
[0091] The first search module 1104 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, 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;
[0092] The first execution module 1106 is used to 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.
[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 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, 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;
[0095] The 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 generate a second control operation according to the candidate forwarding information, 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, 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;
[0098] The second execution unit is used 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, when the first search result indicates 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;
[0101] The third execution unit executes the target control operation on the target message.
[0102] In an exemplary embodiment, the third generating unit is used to:
[0103] In a case where the second search result is used to indicate that reference decapsulation information matching the destination address information is found from 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 message, 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 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 different from the address indicated by the destination address information, wherein the fifth control operation is used to prohibit the decapsulation operation from being performed on the target message, and the target control operation includes the fifth control operation;
[0107] The fourth execution unit executes the fifth control operation on the target message.
[0108] In an exemplary embodiment, the apparatus further comprises:
[0109] A second search module is used for, after detecting whether the current remaining forwarding parameter of the target message is less than or equal to 1, searching from the forwarding information set maintained by the target forwarding device whether there is forwarding information matching the current target address information of the target message when detecting that the remaining forwarding parameter is greater than 1, to obtain a first search result;
[0110] a generating module, configured to generate a sixth control operation according to the reference forwarding information when the first search result indicates that reference forwarding information matching the current target address information of the target message is found in the forwarding information set, 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;
[0111] The second execution module is used 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, search from the forwarding information set maintained by the target forwarding device whether there is forwarding information that matches the current target address information of the target message, and obtain a first search result. At the same time, search from the decapsulation information set maintained by the target forwarding device whether there is 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;
[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, including a memory and a processor, wherein a computer program is stored in the memory, 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 perform 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, search from the forwarding information set maintained by the target forwarding device whether there is forwarding information that matches the current target address information of the target message, and obtain a first search result. At the same time, search from the decapsulation information set maintained by the target forwarding device whether there is 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;
[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, the 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 modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein 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 implementation 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, and the method is applied to the target forwarding device among the multiple forwarding devices, including: When the target message is received, detecting whether the 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; In the case where 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, 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 to perform the forwarding operation 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: In a case where 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, generating a first control operation, 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; The first control operation is performed 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: In a case where 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, generating a second control operation according to 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; The second control operation is performed on the target message.
4. 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 the target control operation according to the second search result 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 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: In a case where the second search result is used to indicate that reference decapsulation information matching the destination address information is found from 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 message, 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: In a case where 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 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 the decapsulation operation from being performed on the target message, 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 from the forwarding information set maintained by the target forwarding device whether there is forwarding information matching the current target address information of the target message, and obtaining a first search result; In a case where the first search result is used to indicate that reference forwarding information matching the current target address information of the target message is found in the forwarding information set, generating a sixth control operation according to 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 control device for 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, and the device is applied to the target forwarding device among the multiple forwarding devices, including: A detection module, configured to detect, upon receiving the target message, 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 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 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 matching 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. The first execution module is used to execute a target control operation matching the first search result and the second search result on the target message, 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
Packet Processing Method, Controller, and Forwarding Device
US20200403910A1
Packet processing system and method, device, and storage medium
WO2023221452A1