Message Processing Method, Apparatus, Electronic Device, and Computer-Readable Storage Medium

By presetting the queue mapping and congestion flag fields in NSH messages, NSH encapsulation and mapping of the original IP messages is solved, and the packet forwarding efficiency is improved.

CN116016344BActive Publication Date: 2025-07-25SUZHOU CENTEC COMM CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202211687231.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-27
Publication Date
2025-07-25
Estimated Expiration
2042-12-27

AI Technical Summary

Technical Problem

The prior art cannot queue mapping and congestion flags for NSH packets without vxlan headers and vlan tags, resulting in low packet forwarding efficiency.

Method used

The queue mapping field and congestion flag field are preset in the NSH message, the original IP message is NSH encapsulated through the classifier, and the mapping value of the quality of service priority is filled in the queue mapping field of the NSH message, the forwarding node parses the mapping value for queue mapping and congestion monitoring, and the terminator updates the congestion flag field for congestion feedback.

Benefits of technology

It realizes queue mapping and congestion flags for NSH packets without vxlan headers and vlan tags, improves packet forwarding efficiency and avoids the need to analyze inner layer IP packets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016344B_ABST
    Figure CN116016344B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a method, device, electronic device, and computer-readable storage medium for message processing, belonging to the field of communication technologies. A classifier in a service chain forwarding domain encapsulates the received original IP message, fills in the mapping value corresponding to the quality of service priority of the original IP message in the queue mapping field of the added NSH message, and forwards the obtained service chain message to a forwarding node. The forwarding node parses the NSH message of the service chain message to obtain the mapping value, so as to add the service chain message to the first target queue corresponding to the mapping value. Furthermore, the forwarding node performs congestion monitoring on the first target queue and updates the congestion flag field in the NSH message according to the congestion situation, so as to implement queue mapping and congestion flag for the NSH message without vxlan header and vlan tag. Furthermore, when performing message forwarding, only the NSH message needs to be parsed, and there is no need to parse the in-memory IP message, which can greatly improve the message forwarding efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technologies, and in particular, to a method and apparatus for processing packets, an electronic device, and a computer-readable storage medium. Background Art

[0002] SFC (Service Function Chain) is also known as a service chain, which is a technology that provides ordered services to the application layer and is used to connect services on network devices at the logical level to form an ordered service combination. SFC realizes that packets pass through service devices in sequence according to a specified path by adding service chain path information to the original packet. NSH (Network Service Header) is a way to implement the service chain function.

[0003] In the application scenario of the data center service chain, there are high requirements for QOS (Quality of Service), and low latency and lossless transmission are required, which involves priority mapping and congestion indication notification. For the NSH method, there are multiple networks carrying NSH packets, such as VLAN networks, VXLAN networks, and ordinary routing networks. However, the prior art cannot perform queue mapping and congestion marking on NSH packets without vxlan headers and vlan tags, so that the inner packet needs to be parsed during forwarding, which greatly reduces the packet forwarding efficiency. Summary of the Invention

[0004] In view of this, an object of the present invention is to provide a method and apparatus for processing packets, an electronic device, and a computer-readable storage medium, which can perform queue mapping and congestion marking on NSH packets without vxlan headers and vlan tags, and improve the problem of low packet forwarding efficiency.

[0005] To achieve the above object, the technical solutions adopted in the embodiments of the present invention are as follows:

[0006] In a first aspect, an embodiment of the present invention provides a method for processing packets, which is applied to a service chain forwarding domain. The service chain forwarding domain includes a classifier and a forwarding node. The method includes:

[0007] When receiving an original IP packet, the classifier performs NSH encapsulation on the original IP packet to add an NSH packet to the original IP packet;

[0008] The classifier obtains the service quality priority of the original IP packet, fills the mapping value corresponding to the service quality priority in the queue mapping field of the NSH packet to obtain a service chain packet, and transmits the service chain packet to the forwarding node;

[0009] The forwarding node parses the queue mapping field of the NSH packet to obtain the mapping value, and maps the NSH packet to the internal priority queue corresponding to the mapping value, so as to add the service chain packet to the first target queue;

[0010] The forwarding node monitors whether the first target queue is congested. If so, it updates the congestion flag field in the NSH packet, so as to perform congestion feedback on the device that generates the original IP packet according to the updated congestion flag field;

[0011] Wherein, both the queue mapping field and the congestion flag field are preset fields in the NSH packet.

[0012] Further, the service chain forwarding domain further includes a proxy node and a termination node. The termination node is connected to a plurality of second server nodes through the proxy node. The method further includes:

[0013] When the first value-added service for the service chain packet is completed, the forwarding node sends the service chain packet to the termination node;

[0014] The termination node parses the queue mapping field of the NSH packet to obtain the mapping value, and maps the NSH packet to the internal priority queue corresponding to the mapping value, so as to add the service chain packet to the second target queue;

[0015] The termination node sequentially transmits the service chain packets in the second target queue to the proxy node, and the proxy node strips the NSH packet in the service chain packet and then transmits it to the second service node to perform a second value-added service on the service chain packet;

[0016] The termination node monitors whether the second target queue is congested. If so, it updates the congestion flag field in the NSH packet, so as to perform congestion feedback on the device that generates the original IP packet according to the updated congestion flag field.

[0017] Further, the method further includes:

[0018] The proxy node receives the processed packet returned by any one of the second service nodes, performs NSH encapsulation on the processed packet, and then sends it to the termination node;

[0019] When the second value-added service for the service chain packet is completed, the termination node restores the service chain packet to an IP packet, and forwards the IP packet to the next-hop device.

[0020] Further, the step of restoring the service chain packet to an IP packet includes:

[0021] Strip the NSH packet from the service chain packet to obtain the original IP packet, and update the DSCP field in the original IP packet according to the queue mapping field in the NSH;

[0022] Update the ECN field of the original IP packet according to the congestion flag field in the NSH packet to obtain the IP packet.

[0023] Further, the step of updating the ECN field of the original IP packet according to the congestion flag field in the NSH packet to obtain the IP packet includes:

[0024] Judge whether the congestion flag field indicates congestion. If not, keep the ECN field of the original IP packet unchanged;

[0025] If so, when the ECN field of the original IP packet indicates concern about congestion, update the ECN field according to the congestion flag field to obtain the IP packet.

[0026] Further, the step of filling the mapping value corresponding to the quality of service priority in the queue mapping field of the NSH packet includes:

[0027] Determine the queue ID of the internal priority corresponding to the quality of service priority according to the preset corresponding relationship, and convert the queue ID into a mapping value based on the number of bits of the queue mapping field.

[0028] Further, the forwarding node is associated with multiple first service nodes;

[0029] After the step of mapping the NSH packet to the internal priority queue corresponding to the mapping value to add the service chain packet to the first target queue, the method further includes:

[0030] The forwarding node sequentially transmits the service chain packets in the first target queue to the first service node to perform a first value-added service on the service chain packets;

[0031] Wherein, the first value-added service includes security detection and load balancing.

[0032] In a second aspect, an embodiment of the present invention provides a packet processing device, which is applied to a service chain forwarding domain. The service chain forwarding domain includes a classifier and a forwarding node, and the packet processing device includes a classification module and a forwarding module;

[0033] The classification module is configured to, when receiving an original IP packet, perform NSH encapsulation on the original IP packet through the classifier to add an NSH packet to the original IP packet;

[0034] The classification module is further configured to obtain the quality of service priority of the original IP packet through the classifier, fill in the mapping value corresponding to the quality of service priority in the queue mapping field of the NSH packet to obtain a service chain packet, and transmit the service chain packet to the forwarding node;

[0035] The forwarding module is configured to parse the queue mapping field of the NSH packet through the forwarding node to obtain the mapping value, and map the NSH packet to the internal priority queue corresponding to the mapping value, so as to add the service chain packet to the first target queue;

[0036] The forwarding module is further configured to monitor whether the first target queue is congested through the forwarding node. If so, update the congestion flag field in the NSH packet, so as to perform congestion feedback on the device that generates the original IP packet according to the updated congestion flag field;

[0037] Wherein, the queue mapping field and the congestion flag field are both preset fields in the NSH packet.

[0038] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor, and the processor can execute the machine-executable instructions to implement the packet processing method as described in the first aspect.

[0039] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the packet processing method as described in the first aspect is implemented.

[0040] The packet processing method, apparatus, electronic device, and computer-readable storage medium provided by the embodiments of the present invention preset a queue mapping field and a congestion flag field in the NSH packet in advance. The classifier in the service chain forwarding domain encapsulates the received original IP packet to add the NSH packet, fills the mapping value corresponding to the quality of service priority of the original IP packet into the queue mapping field of the added NSH packet, and forwards the obtained service chain packet to the forwarding node. The forwarding node parses the mapping value obtained from the NSH packet, thereby mapping the NSH packet to the internal priority queue of the mapping value pair, that is, adding the service chain packet to the first target queue corresponding to the mapping value. Furthermore, the forwarding node performs congestion monitoring on the first target queue and updates the congestion flag field in the NSH packet according to the congestion situation, so as to perform queue mapping and congestion flagging on the NSH packet (NSH encapsulation) without vxlan header and vlan tag, so that when forwarding packets in the service chain forwarding domain, only the NSH packet needs to be parsed, and there is no need to parse the memory IP packet, which can greatly improve the packet forwarding efficiency.

[0041] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, makes a detailed description as follows. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.

[0043] Figure 1 Shows a schematic structural diagram of queue mapping and congestion marking of different bearer networks provided by the embodiments of the present invention.

[0044] Figure 2 Shows a block diagram of the packet processing system provided by the embodiments of the present invention.

[0045] Figure 3 Shows a first schematic flowchart of the packet processing method provided by the embodiments of the present invention.

[0046] Figure 4 Shows a second schematic flowchart of the packet processing method provided by the embodiments of the present invention.

[0047] Figure 5 Shows Figure 4 A schematic flowchart of some sub-steps of step S23 in

[0048] Figure 6 ShowsFigure 5 Schematic flow diagram of some sub-steps of step S232 in

[0049] Figure 7 Block diagram showing a message processing apparatus provided by an embodiment of the present invention.

[0050] Figure 8 Block diagram showing an electronic device provided by an embodiment of the present invention.

[0051] Icons: 100 - Message processing system; 110 - Message processing apparatus; 120 - Classification module; 130 - Forwarding module; 140 - Termination module; 150 - Proxy module; 160 - Electronic device. Detailed implementation manners

[0052] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The components of the embodiments of the present invention described and illustrated herein can be arranged and designed in various different configurations.

[0053] Therefore, the detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.

[0054] It should be noted that relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the presence of additional identical elements in the process, method, article or device including the element.

[0055] In the application scenario of the data center service chain, there are high requirements for QoS (Quality of Service), and low latency and lossless transmission are required, which involves priority mapping and congestion indication notification.

[0056] Different packets use different ways to represent QoS priorities. For example, VLAN packets use 802.1p for representation, and IP packets use DSCP (Differentiated Service Code Point). When packets pass through different networks, in order to maintain the packet priorities, it is necessary to configure the mapping relationships of these priority fields at the gateways connecting different networks.

[0057] Priority mapping realizes the mapping from QoS priority to internal priority (or local priority) or from internal priority to QoS priority, and uses the DiffServ domain to manage and record the mapping relationship between QoS priority and service level. For the packets entering the device, the device maps the priority carried by the packet or the port priority to the internal priority, and then determines the queue that the packet enters according to the mapping relationship between the internal priority and the queue, so as to perform traffic shaping, congestion avoidance, queue scheduling, etc. on the queue, and can modify the priority carried by the packet when it is sent out according to the configuration, so that other devices can provide corresponding QoS services according to the priority of the packet.

[0058] ECN (Explicit Congestion Notification) senses network congestion through the value of the ECN field in the packet and notifies the upstream device of the network congestion. After receiving the notification, the upstream device will reduce the packet sending rate to avoid the aggravation of congestion.

[0059] When the bearer network is VXLAN, the processing methods of queue mapping and congestion marking can be as Figure 1 shown in (a). Generally, queue mapping is performed through the DSCP value of the outer IP packet in the VXLAN header, and ECN is used to mark whether congestion occurs. However, the outer ECN mark cannot be inherited to the inner IP packet, and the inner IP packet cannot sense whether congestion occurs during the forwarding process in the SFC forwarding domain.

[0060] When the bearer network is VLAN, the processing methods of queue mapping and congestion marking can be as Figure 1 shown in (b). Generally, queue mapping is performed through the pri field in the VLAN header. Since there is no field in the VLAN header for congestion marking, if congestion marking is to be performed, only the ECN field of the inner IP packet can be used for marking, which requires parsing the inner packet and will reduce the forwarding efficiency.

[0061] When the bearer network is a general routing network, as Figure 1As shown in (c), since the ordinary routing network does not have the DSCP field of the outer IP packet and does not have the pri field of the VLAN header, only the DSCP and ECN fields of the inner IP packet can be used for queue mapping and congestion marking. This requires parsing the inner packet, which will reduce the packet forwarding efficiency.

[0062] Therefore, there is an urgent need for a method that can perform queue mapping and congestion marking and improve the packet forwarding efficiency. Based on the above considerations, an embodiment of the present invention provides a packet processing method. Hereinafter, this packet processing method will be introduced.

[0063] The packet processing method provided by the embodiment of the present invention can be applied to a Figure 2 packet processing system 100 as shown in the figure. The packet processing system 100 includes a first device, a second device, a service chain forwarding domain, and a third device. The first device is connected to the second device through a network, the second device is connected to the service chain forwarding domain through a network, and the service chain forwarding domain is also connected to the third device through a network.

[0064] Among them, the service chain forwarding domain (SFC domain) includes a classifier (Service Classifier, SC), a forwarding node (Service Function Forwarder, SFF), a termination node (SFF), and a proxy node (SFC Proxy). The classifier is connected to the forwarding node, and the forwarding node is connected to the termination node. The forwarding node is associated with multiple first service nodes (first SFs), that is, it is communicatively connected to multiple first server nodes, and all the first service nodes are NSH aware SFs. The termination node is communicatively connected to multiple second service nodes (second SFs) through the proxy node, and all the second service nodes are NSH-unaware SFs.

[0065] It should be noted that the forwarding node and the termination node can be the same electronic device or different electronic devices.

[0066] The first device can send an original IP packet to the second device through the application software A (or application program) running on itself. The destination device of the original IP packet can be the third device, and the second device forwards the received original IP packet to the service chain forwarding domain.

[0067] The service chain forwarding domain is used to process the original IP packet by using the packet processing method provided by the embodiment of the present invention.

[0068] The third device is used to receive the IP packet sent by the service chain forwarding domain after the processing is completed.

[0069] Among them, the first device and the second device can both be: mobile phones, personal computers, laptop computers, tablet computers, portable wearable terminal devices, servers, etc. The second device and the third device can both be but are not limited to: gateways such as routers and switches. The service chain forwarding domain can also be composed of gateways such as routers and / or switches.

[0070] In a possible implementation manner, the embodiment of the present invention provides a packet processing method. Referring to Figure 3 , the following steps may be included. In this embodiment, an example is given by applying the packet processing method to the service chain forwarding domain in Figure 2 .

[0071] S11, when receiving an original IP packet, the classifier performs NSH encapsulation on the original IP packet to add an NSH packet to the original IP packet.

[0072] It should be noted that the NSH packet refers to NSH (Network Service Header), also known as the NSH header. The classifier extracts the forwarding path information of the original IP packet and performs NSH encapsulation to add an NSH packet to the original IP packet.

[0073] S12, the classifier obtains the quality of service priority of the original IP packet, fills in the mapping value corresponding to the quality of service priority in the queue mapping field of the NSH packet to obtain a service chain packet, and transmits the service chain packet to the forwarding node.

[0074] It should be noted that the quality of service priority refers to the QoS priority. The quality of service priority can be the QoS priority configured for the original IP packet according to a preset priority configuration rule based on the nature of the original IP packet itself (including but not limited to function, request type, generating device, etc.) when the service chain forwarding domain receives the original IP packet, or the QoS priority configured on the second device or the first device, or the QoS priority configured by the network administrator.

[0075] S13, the forwarding node parses the queue mapping field of the NSH packet to obtain the mapping value, and maps the NSH packet to the internal priority queue corresponding to the mapping value to add the service chain packet to the first target queue.

[0076] S14, the forwarding node monitors whether the first target queue is congested. If so, it updates the congestion flag field in the NSH packet to perform congestion feedback on the device that generates the original IP packet according to the updated congestion flag field.

[0077] Among them, both the queue mapping field and the congestion flag field are preset fields in the NSH packet.

[0078] The queue mapping field and the congestion flag field may be composed of bits that are not used during NSH encapsulation in the NSH packet. In this embodiment, no specific limitation is imposed. Considering that bits 17 to 20 in the NSH basic header are not used in NSH encapsulation, thus, in one possible embodiment, bits 17 to 19 are used as the queue mapping field, and bit 20 is used as the congestion flag field.

[0079] When the second device receives the original IP packet generated and sent by the first device with the destination device being the third device, it sends the original IP packet to the service chain forwarding domain. After the service chain forwarding domain receives the original IP packet, the classifier (SC) extracts the forwarding path information in the original IP packet and performs NSH encapsulation based on this forwarding path information. At the same time, by configuring the QoS priority or extracting the QoS priority from the DSCP field of the original IP packet and other means, the quality of service priority of the original IP packet is obtained, and the mapping value corresponding to the quality of service priority is filled into the queue mapping field of the NSH packet (in this embodiment, bits 17 to 18 of the NSH packet), obtaining the service chain packet.

[0080] The classifier (SC) forwards the service chain packet to the forwarding node. The forwarding node parses the mapping value from the NSH packet of the service chain packet, thereby obtaining the internal priority corresponding to the mapping value, and then maps the NSH packet of the service chain packet to the queue of this internal priority, that is, adds the service chain packet to the queue corresponding to this internal priority, namely the first target queue. Furthermore, the forwarding node monitors the congestion situation of the first target queue. For example, it counts the total number of packets in the first target queue. When the total number of packets exceeds the congestion threshold, it is considered that congestion has occurred; otherwise, no congestion has occurred.

[0081] The forwarding node updates the congestion flag field in the NSH packet according to the congestion situation. For example, if congestion has occurred, the congestion flag field in the NSH packet (i.e., bit 20) is set to 1; otherwise, it is set to 0. Furthermore, the forwarding node or the service chain forwarding domain can, according to the value of the congestion flag field, feedback the congestion situation to the first device along the forwarding path of the original IP packet. When congestion occurs, when the first device receives the congestion feedback, it will reduce the packet sending rate to avoid, to a certain extent, the congestion of the first target queue from intensifying.

[0082] Compared with the message processing method where the traditional bearer network is a Vlan network or a general routing network, in the message processing method provided by the embodiments of the present invention, a queue mapping field is configured in the NSH message (NSH header) for queue mapping, and a congestion flag field is configured in the NSH message for congestion flagging, so as to implement queue mapping and congestion flagging for the NSH message (NSH encapsulation) without a vxlan header and a vlan tag. Furthermore, when forwarding messages in the service chain forwarding domain, only the NSH message needs to be parsed, without the need to parse the memory IP message, which can greatly improve the message forwarding efficiency.

[0083] For step S12, the way of filling the mapping value corresponding to the quality of service priority in the queue mapping field of the NSH message can be flexibly set. For example, it can be converted according to a preset rule, or obtained by using a neural network. In this embodiment, no specific limitation is made.

[0084] Considering that in the original IP message, the DSCP value of the ECN field in the original IP message represents the quality of service priority (QoS priority), or the QoS priority is directly configured by the network administrator's configuration policy, a corresponding relationship between the DSCP value representing the quality of service priority and the internal priority queue can be preset, and this corresponding relationship can be stored in the classifier.

[0085] In a possible implementation manner, the corresponding relationship between the DSCP value representing the quality of service priority and the internal priority queue is introduced in the process of obtaining the mapping value. Specifically, the way of determining the mapping value in step S12 can be further implemented as: according to the preset corresponding relationship, determine the queue ID of the internal priority corresponding to the quality of service priority, and based on the number of bit positions of the queue mapping field, convert the queue ID into a mapping value.

[0086] Taking the queue mapping field in the NSH message as the 17th to 19th bits as an example, first determine the queue ID of the internal priority corresponding to the quality of service priority, and then convert the queue ID into a mapping value represented by three binary digits. The corresponding relationship can be as shown in Table 1 below.

[0087] Table 1

[0088]

[0089] Similarly, after receiving the service chain message, the forwarding node reads the mapping value in the queue mapping field of the NSH message, and determines the first target queue according to the corresponding relationship between the mapping value and the queue. For example, the corresponding relationship between the mapping value and the queue can be as shown in Table 2 below. The queue ID value in Table 2 is obtained after restoring the mapping value.

[0090] Table 2

[0091] Queue ID value Mapped queue priority 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7

[0092] For a forwarding node (SFF), it has an unchangeable internal priority. Each internal priority has a queue for message queuing, and the queue where the message is located determines the processing order of the message. For the first service node associated with the forwarding node in the service chain forwarding domain, each first service node is used to perform one or more first value-added services on the message. The first value-added services include, but are not limited to, security detection, load balancing, application acceleration, legality interception, and network address translation (NAT), etc.

[0093] After the forwarding node adds the service chain message to the first target queue, when the forwarding node processes the first target queue in the order of internal priority, it sequentially transmits the service chain messages in the first target queue to the first service node to perform the first value-added service on the service chain message. For example, first send the service chain message to the first first service node. After receiving the service chain message processed by the first service node, it will forward the service chain message to the second second server node, and so on until the first value-added service is completed.

[0094] Further, for the message processing method provided by the embodiments of the present invention, refer to Figure 4 , and it further includes the following steps.

[0095] S21, when the first value-added service for the service chain message is completed, the forwarding node sends the service chain message to the termination node.

[0096] S22, the termination node parses the queue mapping field of the NSH message to obtain a mapping value, and maps the NSH message to the internal priority queue corresponding to the mapping value to add the service chain message to the second target queue.

[0097] S23, the termination node monitors whether the second target queue is congested. If so, it updates the congestion flag field in the NSH message to perform congestion feedback on the device that generates the original IP message according to the updated congestion flag field.

[0098] S24, the termination node sequentially transmits the service chain messages in the second target queue to the proxy node, and the proxy node strips the NSH message in the service chain message and then transmits it to the second service node to perform the second value-added service on the service chain message.

[0099] Among them, step S23 and step S24 can be executed simultaneously or sequentially.

[0100] It should be noted that when the termination node receives the service chain message, it can first update the ECN field in the inner original IP message according to the value of the mapping flag field of NSH in the service chain message, so as to avoid the congestion flag field value obtained by the forwarding node being overwritten when step S23 is executed. In addition, when the forwarding node and the termination node are the same node, their internal priorities are the same. At this time, the second target queue is the first target queue, and there is no need to execute steps S21 - S23. After completing the first value-added service for the service chain message, directly execute step S24. If the forwarding node and the termination node are independent of each other, steps S21 - S24 need to be fully executed.

[0101] Perform one or more second value-added services for each second service node connected to the termination node through the proxy node. The second value-added services also include, but are not limited to, security detection, load balancing, application acceleration, legality interception, and network address translation (NAT), etc. However, since the second service node is an NSH-unaware SF, it can only process messages without an NSH header.

[0102] After the termination node adds the service chain message to the second target queue, when the termination node processes the second target queue in the order of its own internal priority, it sequentially transmits the service chain messages in the second target queue to the proxy node. When the proxy node receives the service chain message sent by the termination node, it strips the NSH message in the service chain message and then transmits it to the second service node to perform the second value-added service on the service chain message.

[0103] After completing all value-added services for the service chain message, the message needs to be forwarded out of the service chain forwarding domain. In order to prevent the added messages in the service chain forwarding domain from affecting the forwarding efficiency of the message in the subsequent process, in a possible implementation manner, when the termination node forwards the message, it first strips the NSH message. Specifically, please continue to refer to Figure 4 The message processing method provided by the embodiment of the present invention may further include the following steps.

[0104] S25, The proxy node receives the processed message returned by any second service node, performs NSH encapsulation on the processed message, and then sends it to the termination node.

[0105] S26, When completing the second value-added service for the service chain message, the termination node restores the service chain message to an IP message and forwards the IP message to the next-hop device.

[0106] Taking the case where there is only one second service node as an example, the termination node sends the received service chain message to the proxy node. The proxy node strips the NSH message in the service chain message and then sends it to the second service node. After the second service node finishes processing the message, it returns it to the proxy node. The proxy node then adds NSH encapsulation information to the returned message to obtain the service chain message again, and returns the service chain message to the termination node. After receiving the service chain message that has completed the second value-added service, the termination node restores the service chain message to an IP message and forwards the IP message to the next-hop device. For example, Figure 1 the third device in

[0107] Considering that when there is congestion in the first target queue or the second target queue, it is necessary to feedback the congestion situation to the device that generates the original IP message, and the congestion flag value representing the congestion situation is stripped in the NSH. Therefore, in order to enable the feedback function to work properly, in a possible implementation manner, referring to Figure 5 , the method of restoring the service chain message to an IP message in step S26 can be further implemented as the following steps.

[0108] S231, strip the NSH message in the service chain message to obtain the original IP message, and update the DSCP field in the original IP message according to the queue mapping field in the NSH.

[0109] S232, update the ECN field of the original IP message according to the congestion flag field in the NSH message to obtain the IP message.

[0110] Regarding step S231, when restoring the service chain message, if the queue mapping field in the NSH message is obtained according to the quality of service priority of the original IP message, the quality of service priority after the update is still that of the original IP message. If it is manually configured or configured according to rules by the network administrator after reaching the service chain forwarding domain, the quality of service priority of the original IP message is updated to the value configured in the service chain forwarding domain, so that subsequent forwarding devices can process it according to this quality of service priority.

[0111] Taking the 17th to 19th bits in the NSH message as the queue mapping field as an example, when updating the DSCP field in the original IP message, it can be updated according to the corresponding relationship in Table 3 below.

[0112] Table 3

[0113] NSH queue id value Queue mapping field Mapped Dscp value 0 000 0 1 001 8 2 010 16 3 011 24 4 100 32 5 101 40 6 110 48 7 111 56

[0114] Regarding step S232, its implementation method can be flexibly selected in practical applications. For example, it can be directly replaced or replaced according to certain rules. In this implementation manner, no specific limitation is made.

[0115] Considering that if direct overwriting is performed, it will affect the congestion situation determined by the intermediate devices before the service chain forwarding domain. To avoid overwriting the congestion feedback of the intermediate devices passed by the original IP packet before, in a possible implementation manner, referring to Figure 6 , the above step S232 can be further implemented as the following steps.

[0116] S2321, determine whether the congestion flag field indicates congestion. If not, execute step S2322; otherwise, execute step S2323.

[0117] S2322, when the ECN field of the original IP packet indicates concern about congestion, update the ECN field according to the congestion flag field to obtain an IP packet.

[0118] S2323, keep the ECN field of the original IP packet unchanged.

[0119] Generally, the ECN field can be the following several arrays: 00, 01, 10, and 11. Among them, 00 indicates that the device generating the original IP packet does not concern about the congestion situation, 01 and 10 indicate no congestion, and 11 indicates congestion. On this basis, when updating the ECN field, the following Table 4 can be referred to.

[0120] Table 4

[0121] NSH congestion flag field ECN field of the original IP packet Modified ECN field 0 00 00 0 01 01 0 10 10 0 11 11 1 00 00 1 01 11 1 10 11 1 11 11

[0122] As can be seen from the above Table 4, the update rule is: if the NSH congestion flag field is 0, the ECN field in the original IP packet is not modified; if the congestion flag bit is 1, the ECN field in the original IP packet is modified to 11 only when the ECN field of the original IP packet is 01 or 10, and in other cases, the ECN field of the original IP packet remains unchanged.

[0123] It should be emphasized that when the termination node (SFF) receives the service chain packet, it can first update the ECN field in the inner-layer original IP packet according to the value of the mapping flag field of NSH in the service chain packet, and can also adopt the above step S2323 and its related implementation manners.

[0124] Through the above method, when the forwarding node forwards the service chain packet, the termination node forwards the service chain packet, and congestion occurs in the egress queue of the forwarding node or the egress queue of the termination node, the above step S2323 and its related implementation manners are all adopted to update the DSCP field of the IP packet, so as to be able to feedback the congestion generated in the service chain forwarding domain without overwriting the congestion feedback of the intermediate devices passed by the original IP packet before.

[0125] Through the packet processing method provided by the embodiments of the present invention, the problem that the service chain NSH packets without vxlan headers and vlan tags cannot perform queue mapping and congestion marking through the NSH header is solved. In practical applications, without parsing the inner IP packet, there is no need to modify the inner IP packet in the forwarding node (SFF), and differential services can be provided for NSH packets with different priorities, improving the packet forwarding efficiency. At the same time, it is also possible to record whether congestion occurs in the SFC forwarding domain for the NSH packet, so that when the NSH is terminated, the congestion flag field is mapped to the original IP packet, inheriting the congestion attribute in the SFC forwarding domain, and better managing the congestion of the entire service chain.

[0126] Based on the same inventive concept of the above packet processing method, in a possible implementation manner, an embodiment of the present invention further provides a packet processing apparatus 110, which can be applied to Figure 2 in the service chain forwarding domain. Referring to Figure 7 , the packet processing apparatus 110 may include a classification module 120 and a forwarding module 130.

[0127] The classification module 120 is configured to, when receiving an original IP packet, perform NSH encapsulation on the original IP packet through a classifier to add an NSH packet to the original IP packet.

[0128] The classification module 120 is further configured to obtain the quality of service priority of the original IP packet through the classifier, fill the mapping value corresponding to the quality of service priority in the queue mapping field of the NSH packet to obtain a service chain packet, and transmit the service chain packet to the forwarding node.

[0129] The forwarding module 130 is configured to parse the queue mapping field of the NSH packet through the forwarding node to obtain a mapping value, and map the NSH packet to the internal priority queue corresponding to the mapping value to add the service chain packet to the first target queue.

[0130] The forwarding module 130 is further configured to monitor whether congestion occurs in the first target queue through the forwarding node. If so, update the congestion flag field in the NSH packet to perform congestion feedback on the device that generates the original IP packet according to the updated congestion flag field.

[0131] It should be noted that both the queue mapping field and the congestion flag field are preset fields in the NSH packet.

[0132] Further, the packet processing apparatus 110 may further include a termination module 140 and an agent module 150.

[0133] The classification module 120 is further configured to, when the first value-added service for the service chain packet is completed, send the service chain packet to the termination node through the forwarding node.

[0134] The termination module 140 is configured to obtain a mapping value by parsing the queue mapping field of the NSH packet through a termination node, and map the NSH packet to the internal priority queue corresponding to the mapping value, so as to add the service chain packet to the second target queue.

[0135] The termination module 140 is further configured to sequentially transmit the service chain packets in the second target queue to the proxy node through the termination node.

[0136] The proxy module 150 is further configured to strip the NSH packet in the service chain packet through the proxy node and then transmit it to the second service node, so as to perform a second value-added service on the service chain packet.

[0137] The termination module 140 is further configured to monitor whether the second target queue is congested through the termination node. If so, update the congestion flag field in the NSH packet, so as to perform congestion feedback on the device that generates the original IP packet according to the updated congestion flag field.

[0138] In the above packet processing device 110, through the cooperation of the classification module 120 and the forwarding module 130, a queue mapping field is configured in the NSH packet (NSH header) for queue mapping, and a congestion flag field is configured in the NSH packet for congestion flagging, so as to perform queue mapping and congestion flagging on the NSH packet (NSH encapsulation) without a vxlan header and a vlan tag. Furthermore, when forwarding packets, only the NSH packet needs to be parsed, without parsing the memory IP packet, which can greatly improve the packet forwarding efficiency.

[0139] For the specific limitations of the packet processing device 110, reference can be made to the limitations on the packet processing method in the above text, which will not be elaborated here. Each module in the above packet processing device 110 can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the electronic device in hardware form or independent of it, or stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to the above modules.

[0140] In one embodiment, an electronic device 160 is provided. The electronic device 160 can be a terminal, and its internal structure diagram can be as Figure 8As shown. The electronic device 160 includes a processor, a memory, a communication interface, a display screen, and an input device connected via a system bus. Among them, the processor of the electronic device 160 is used to provide computing and control capabilities. The memory of the electronic device 160 includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device 160 is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be achieved through WIFI, a carrier network, near field communication (NFC), or other technologies. When the computer program is executed by the processor, it implements the message processing method provided in the above-mentioned embodiment.

[0141] Figure 8 The structure shown in the figure is only a block diagram of some structures related to the solution of the present invention, and does not constitute a limitation on the electronic device 160 to which the solution of the present invention is applied. Specifically, the electronic device 160 may include more or fewer components than Figure 8 shown in the figure, or combine some components, or have different component arrangements.

[0142] In one embodiment, the message processing device 110 provided by the present invention can be implemented in the form of a computer program, and the computer program can run on an electronic device 160 as Figure 8 shown. One or more program modules constituting the message processing device 110 can be stored in the memory of the electronic device 160. For example, Figure 7 the classification module 120 and the forwarding module 130 shown in the figure. The computer program composed of each program module enables the processor to execute the steps in the message processing method described in this specification.

[0143] For example, Figure 8 the electronic device 160 shown in the figure can execute step S11 through the classification module 120 in the message processing device 110 as Figure 7 shown. The electronic device 160 can execute steps S12 - S14 through the forwarding module 130.

[0144] In one embodiment, an electronic device 160 is provided, including a memory and a graphics processor. The memory stores machine-executable instructions. When the processor executes the machine-executable instructions, the following steps are implemented: When receiving an original IP packet, a classifier performs NSH encapsulation on the original IP packet to add an NSH packet to the original IP packet; the classifier obtains the quality of service priority of the original IP packet, fills in the mapping value corresponding to the quality of service priority in the queue mapping field of the NSH packet to obtain a service chain packet, and transmits the service chain packet to a forwarding node; the forwarding node parses the queue mapping field of the NSH packet to obtain the mapping value, and maps the NSH packet to the internal priority queue corresponding to the mapping value to add the service chain packet to a first target queue.

[0145] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a graphics processor, the following steps are implemented: When receiving an original IP packet, a classifier performs NSH encapsulation on the original IP packet to add an NSH packet to the original IP packet; the classifier obtains the quality of service priority of the original IP packet, fills in the mapping value corresponding to the quality of service priority in the queue mapping field of the NSH packet to obtain a service chain packet, and transmits the service chain packet to a forwarding node; the forwarding node parses the queue mapping field of the NSH packet to obtain the mapping value, and maps the NSH packet to the internal priority queue corresponding to the mapping value to add the service chain packet to a first target queue.

[0146] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of devices, methods, and computer program products according to multiple embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0147] In addition, in each embodiment of the present invention, each functional module may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.

[0148] If the above-mentioned function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.

[0149] The foregoing are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A message processing method, characterized in that, Applied to the service chain forwarding domain, the service chain forwarding domain includes a classifier and forwarding nodes, and the method includes: When receiving an original IP packet, the classifier performs NSH encapsulation on the original IP packet to add an NSH packet to the original IP packet; The classifier obtains the quality of service priority of the original IP packet, fills the mapping value corresponding to the quality of service priority in the queue mapping field of the NSH packet to obtain a service chain packet, and transmits the service chain packet to the forwarding node; The forwarding node parses the queue mapping field of the NSH packet to obtain the mapping value, and maps the NSH packet to the internal priority queue corresponding to the mapping value to add the service chain packet to the first target queue; The forwarding node monitors whether the first target queue is congested. If so, it updates the congestion flag field in the NSH packet to perform congestion feedback on the device that generates the original IP packet according to the updated congestion flag field; When completing the first value-added service for the service chain packet, the forwarding node sends the service chain packet to the termination node; The termination node parses the queue mapping field of the NSH packet to obtain the mapping value, and maps the NSH packet to the internal priority queue corresponding to the mapping value to add the service chain packet to the second target queue; The termination node monitors whether the second target queue is congested. If so, it updates the congestion flag field in the NSH packet to perform congestion feedback on the device that generates the original IP packet according to the updated congestion flag field; The termination node sequentially transmits the service chain packets in the second target queue to the proxy node, and the proxy node strips the NSH packet in the service chain packet and then transmits it to the second service node to perform the second value-added service on the service chain packet; The proxy node receives the processed packet returned by any second service node, performs NSH encapsulation on the processed packet and then sends it to the termination node; When completing the second value-added service for the service chain packet, the termination node restores the service chain packet to an IP packet and forwards the IP packet to the next-hop device, specifically including: Stripping the NSH packet in the service chain packet to obtain the original IP packet, and updating the DSCP field in the original IP packet according to the queue mapping field in the NSH; Updating the ECN field of the original IP packet according to the congestion flag field in the NSH packet to obtain an IP packet; Determine whether the congestion flag field indicates congestion. If not, keep the ECN field of the original IP packet unchanged; If so, when the ECN field of the original IP packet indicates concern about congestion, update the ECN field according to the congestion flag field to obtain the IP packet.

2. The message processing method according to claim 1, wherein The step of filling the mapping value corresponding to the quality of service priority in the queue mapping field of the NSH packet includes: According to the preset correspondence, determine the queue ID of the internal priority corresponding to the quality of service priority, and convert the queue ID into a mapping value based on the number of bits of the queue mapping field.

3. The message processing method according to claim 1, wherein The forwarding node is associated with multiple first service nodes; After the step of mapping the NSH packet to the internal priority queue corresponding to the mapping value to add the service chain packet to the first target queue, the method further includes: The forwarding node sequentially transmits the service chain packets in the first target queue to the first service node to perform a first value-added service on the service chain packets; Wherein, the first value-added service includes security detection and load balancing.

4. A message processing device, characterized in that, Applied to the service chain forwarding domain of the packet processing system, the service chain forwarding domain includes a classifier and a forwarding node, the packet processing system further includes a first device, a second device and a third device, the second device is respectively communicatively connected to the first device and the service chain forwarding domain, and the packet processing device includes a classification module and a forwarding module to implement the packet processing method according to any one of claims 1 to 3; The classification module is configured to, when receiving an original IP packet, perform NSH encapsulation through the classifier according to the forwarding path information in the original IP packet to add an NSH packet to the original IP packet; wherein, the original IP packet is forwarded by the first device through the second device to the service chain forwarding domain; The classification module is further configured to obtain the quality of service priority of the original IP packet through the classifier, fill in the mapping value corresponding to the quality of service priority in the queue mapping field of the NSH packet to obtain a service chain packet, and transmit the service chain packet to the forwarding node; The forwarding module is configured to parse the queue mapping field of the NSH packet through the forwarding node to obtain the mapping value, and map the NSH packet to the internal priority queue corresponding to the mapping value to add the service chain packet to the first target queue; The forwarding module is further configured to monitor whether the first target queue is congested through the forwarding node. If so, update the congestion flag field in the NSH packet to feedback the congestion situation to the first device according to the forwarding path of the original IP packet. When the first device receives the congestion feedback, it reduces the packet sending rate; Wherein, both the queue mapping field and the congestion flag field are preset fields in the NSH packet.

5. An electronic device, characterized in that, It includes a processor and a memory, the memory stores machine-executable instructions that can be executed by the processor, and the processor can execute the machine-executable instructions to implement the packet processing method according to any one of claims 1 to 3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the packet processing method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • QoS implementation method and device

    CN105591971A

  • QoS control method based on OF-DiffServ model and QoS control system thereof

    CN107454015A

  • Explicit congestion control method based on queuing delay

    CN108965151A

  • SFC service data forwarding method and SFC network system

    CN110557343A

  • Service function chaining congestion tracking

    CN111801911A