A message processing method, device, electronic device and storage medium

By using the ACL matching and forwarding table search methods in the first node, the received messages are edited and the target messages are generated, which solves the problem of NSH messages being processed and encapsulated in any network in the prior art, and realizes the problem of NSH messages being processed and encapsulated in any network. NSH bearer in any encapsulation format.

CN115714823BActive Publication Date: 2025-02-07SUZHOU CENTEC COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110956742.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-19
Publication Date
2025-02-07
Estimated Expiration
2041-08-19

AI Technical Summary

Technical Problem

The prior art is difficult to effectively process and encapsulate packets with network service headers (NSH) in any network, and it is impossible to implement NSH bearers in any encapsulated format.

Method used

By matching the received packets based on the access control list (ACL) in the first node, service service data and NSH index values ​​are obtained, and forwarding tables are searched based on the message address information to obtain the port information of the next hop node. and message edit index value. Then, the message is edited using these index values ​​and editing information to generate the target message.

Benefits of technology

It realizes the carrying of NSH packets in any network and supports NSH in any encapsulated format, enhancing the flexibility and adaptability of message processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115714823B_ABST
    Figure CN115714823B_ABST
Patent Text Reader

Abstract

The present invention discloses a message processing method, device, electronic device and storage medium. The method comprises: matching a received first message based on an access control list (ACL) to obtain service business data and a network service header (NSH) index value; searching a forwarding table (FT) based on address information in the first message to obtain port information of a second node and a message editing index value; obtaining first editing information associated with the second node based on the message editing index value and obtaining second editing information associated with the second node based on the NSH index value; editing the first message based on the first editing information, the second editing information and the service business data to obtain a target message.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet communication technology, and in particular to a message processing method, device, electronic equipment and storage medium. Background Art

[0002] In the field of Internet communications, when data messages carrying information are transmitted, they need to pass through various set service nodes in sequence to ensure that the network can provide users with safe, fast and stable network services according to the design requirements. The established path formed by passing through each service node in sequence is called a service function chain (SFC). Its core technology lies in the encapsulation of a network service header (NSH) in the message. At present, there is an urgent need for a chip implementation method for such a message encapsulated with NSH. Summary of the invention

[0003] In view of this, the main purpose of the present invention is to provide a message processing method, device, electronic device and storage medium, which can enable NSH messages to be carried in any network and can implement NSH in any encapsulation format.

[0004] To achieve the above object, the technical solution of the present invention is achieved as follows:

[0005] In a first aspect, the present invention provides a message processing method, which is applied to a first node, where the first node is any node in a first service chain SFC, and the method includes:

[0006] Based on access control list (ACL , Access Control Lists) matches the received first message to obtain service business data and a network service packet header NSH index value; the first message is a message containing the destination service data sent by the active terminal to the destination terminal;

[0007] Searching a forwarding table (FT) based on the address information in the first message to obtain port information and a message editing index value of a second node; the second node is a next hop node after the first node in the first SFC;

[0008] obtaining first editing information associated with the second node based on the message editing index value; and obtaining second editing information associated with the second node based on the NSH index value; the first editing information is related to the type of the first message; the second editing information is related information required to assemble the NSH sub-message;

[0009] The first message is edited based on the first editing information, the second editing information and the service business data to obtain a target message; the target message is a message sent by the first node to the second node.

[0010] In the above solution, before matching the received first message based on the access control list ACL to obtain the service data and the network service header NSH index value, the method further includes:

[0011] Parsing the first message;

[0012] Determining whether the type of the first message is an overlay network based on the analysis result;

[0013] When it is determined that the type of the first message is an OverLay network, the first message is decapsulated.

[0014] In the above scheme, the matching process of the received first message based on the access control list ACL to obtain the service business data and the network service header NSH index value includes:

[0015] Searching the ACL based on the matching condition to obtain the service business data and the NSH index value;

[0016] Among them, the matching condition is the first matching condition or the second matching condition; when the first node is the initial node in the first SFC, the first matching condition is the address information obtained based on the first message or the five-tuple information obtained based on the first message; when the first node is a node other than the initial node in the first SFC, the second matching condition is a service path number (SPI, Service Path Identify) and a first service index (SI, Service Index); the SPI is used to represent the identification code of the first SFC; the first SI is used to represent the position of the first node in the first SFC.

[0017] In the above solution, the method further includes:

[0018] Determining, based on a destination Media Access Control (MAC) address included in the first message, whether the first node performs Layer 2 forwarding or Layer 3 forwarding on the first message;

[0019] When the destination MAC address included in the first message is a wireless routing destination MAC address, the first node performs layer 2 forwarding on the first message;

[0020] Correspondingly, searching the forwarding table FT based on the address information in the first message to obtain the port information and the message editing index value of the second node includes: performing an IP address search in the three-layer routing forwarding table according to the destination Internet Protocol (IP) address in the first message to obtain the port information and the message editing index value of the second node;

[0021] When the destination media access control MAC address included in the first message is not a wireless routing destination MAC address, the first node performs layer 3 forwarding on the first message;

[0022] Correspondingly, searching the forwarding table FT based on the address information in the first message to obtain the port information of the second node and the message editing index value includes: performing a MAC address search in the layer 2 forwarding table according to the destination MAC address to obtain the port information of the second node and the message editing index value.

[0023] In the above solution, the obtaining the first editing information associated with the second node based on the message editing index value includes:

[0024] Searching the memory of the first node to obtain a next hop table corresponding to the second node based on the message editing index value;

[0025] Reading first editing information associated with the second node from the next hop table;

[0026] The first editing information includes at least one of the following: layer 2 editing information of the message, layer 3 editing information of the message, and layer 4 editing information of the message.

[0027] In the above solution, the obtaining the second editing information associated with the second node based on the NSH index value includes:

[0028] Searching in the memory of the first node to obtain an NSH edit table based on the NSH index value;

[0029] reading second edit information associated with the second node from the NSH edit table;

[0030] The second editing information at least includes: a service path number SPI of the first SFC, a second SI corresponding to the second node, and an operation type; the operation type includes one of the following: encapsulation, update, and decapsulation.

[0031] In the above solution, the step of editing the first message based on the first editing information, the second editing information and the service business data to obtain the target message includes:

[0032] Performing a first editing process on the first message based on the first editing information to obtain a first edited sub-message;

[0033] Performing a second editing process on the first editing sub-message based on the second editing information and the service business data to obtain a target message;

[0034] Among them, the first editing process includes at least one of the following: performing second-layer editing of the message based on the second-layer editing information, performing third-layer editing of the message based on the third-layer editing information, and performing fourth-layer editing of the message based on the fourth-layer editing information; the second editing process includes: assembling the NSH sub-message based on the second editing information, and encapsulating the NSH sub-message in the first editing sub-message to form the target message.

[0035] In a second aspect, the present invention further provides a message processing device, applied to a first node, the first node being any node in a first service chain SFC, the device comprising: a matching unit, a search unit, a first obtaining unit, a second obtaining unit and an encapsulation unit, wherein;

[0036] The matching unit is used to match the received first message based on the access control list ACL to obtain the service business data and the network service packet header NSH index value; the first message contains the destination service data sent by the source terminal to the destination terminal;

[0037] The search unit is used to search the forwarding table FT based on the address information in the first message to obtain the port information and message editing index value of the second node; the second node is the next hop node after the first node in the first SFC;

[0038] The first obtaining unit is configured to obtain first editing information associated with the second node based on the message editing index value; the first editing information is related to the type of the first message;

[0039] The second obtaining unit is used to obtain second editing information associated with the second node based on the NSH index value; the second editing information is related information required to assemble the NSH sub-message;

[0040] The encapsulation unit is used to edit the first message based on the first editing information, the second editing information and the service business data to obtain a target message; the target message is a message sent by the first node to the second node.

[0041] In the above solution, the device further comprises: a parsing unit, a first judgment unit and a decapsulation unit, wherein;

[0042] The parsing unit is used to parse the first message;

[0043] The first judgment unit is used to judge whether the type of the first message is an OverLay network based on the analysis result;

[0044] The decapsulation unit is configured to decapsulate the first message when it is determined that the type of the first message is an OverLay network.

[0045] In the above scheme, the matching unit is used to search in the ACL based on the matching condition to obtain the service business data and the NSH index value;

[0046] Among them, the matching condition is the first matching condition or the second matching condition; when the first node is the initial node in the first SFC, the first matching condition is the address information obtained based on the first message or the five-tuple information obtained based on the first message; when the first node is a node other than the initial node in the first SFC, the second matching condition is the service path number SPI and the first service index SI; the SPI is used to represent the identification code of the first SFC; the first SI is used to represent the position of the first node in the first SFC.

[0047] In the above scheme, the device further includes: a second judgment unit, used to judge whether the first node performs layer 2 forwarding or layer 3 forwarding on the first message based on the destination media access control MAC address included in the first message; when the destination media access control MAC address included in the first message is a wireless routing destination MAC address, the first node performs layer 2 forwarding on the first message; when the destination media access control MAC address included in the first message is not a wireless routing destination MAC address, the first node performs layer 3 forwarding on the first message;

[0048] The search unit is used to perform an IP address search in a layer-3 routing forwarding table according to the destination Internet Protocol IP address in the first message to obtain the port information and message editing index value of the second node when the destination media access control MAC address included in the first message is a wireless routing destination MAC address; and to perform a MAC address search in a layer-2 forwarding table according to the destination MAC address to obtain the port information and message editing index value of the second node when the destination media access control MAC address included in the first message is not a wireless routing destination MAC address.

[0049] In the above scheme, the first obtaining unit is used to search the memory of the first node for the next hop table corresponding to the second node based on the message editing index value; read the first editing information associated with the second node from the next hop table; wherein the first editing information includes at least one of the following: the second-layer editing information of the message, the third-layer editing information of the message, and the fourth-layer editing information of the message.

[0050] In the above scheme, the second obtaining unit is used to search and obtain the NSH editing table in the memory of the first node based on the NSH index value; read the second editing information associated with the second node from the NSH editing table; wherein the second editing information at least includes: the service path number SPI of the first SFC, the second SI corresponding to the second node, and the operation type; the operation type includes one of the following: encapsulation, update, and decapsulation.

[0051] In the above scheme, the encapsulation unit is used to perform a first editing process on the first message based on the first editing information to obtain a first edited sub-message; perform a second editing process on the first edited sub-message based on the second editing information and the service business data to obtain a target message; wherein the first editing process includes at least one of the following: performing second-layer editing of the message based on the second-layer editing information, performing third-layer editing of the message based on the third-layer editing information, and performing fourth-layer editing of the message based on the fourth-layer editing information; the second editing process includes: assembling the NSH sub-message based on the second editing information, and encapsulating the NSH sub-message in the first editing sub-message to form the target message.

[0052] In a third 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 steps of any of the above methods are implemented.

[0053] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising: a processor and a memory for storing a computer program that can be run on the processor, wherein the processor executes the steps of any one of the above methods when running the computer program.

[0054] The embodiment of the present invention provides a message processing method, device, electronic device and storage medium. The method is applied to a first node, the first node is any node in a first service chain SFC, and the method includes: matching the received first message based on the access control list ACL to obtain service business data and network service header NSH index value; the first message is a message containing destination business data sent by an active terminal to a destination terminal; searching the forwarding table FT based on the address information in the first message to obtain the port information and message editing index value of the second node; the second node is the next hop node after the first node in the first SFC; obtaining the first editing information associated with the second node based on the message editing index value; and obtaining the second editing information associated with the second node based on the NSH index value; the first editing information is related to the type of the first message; the second editing information is the relevant information required to assemble the NSH sub-message; editing the first message based on the first editing information, the second editing information and the service business data to obtain the target message; the target message is the message sent by the first node to the second node. The method and device provided by the embodiment of the present invention obtain the service business data encapsulated in the NSH and the editing information encapsulated in the NSH through ACL matching, obtain the port information and message editing information of the next node by searching the forwarding table through the address in the received first message, and encapsulate the first message using the aforementioned service business data and the two editing information to form a target message transmitted to the next node. In this way, the editing information and service business data of the NSH are obtained from the ACL, so the editing of the NSH is separated from the message editing of the destination business data, so that the NSH can be carried not only in the virtual extended local area network (VXLAN, Virtual Extensible Local Area Network) network, but also in other OverLay networks, such as the network generic routing encapsulation (GRE, Generic RoutingEncapsulation) network, and can also be carried in non-OverLay networks, so as to realize NSH of any encapsulation format, such as being carried in a VLAN network. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 A schematic diagram of a flow chart of a message processing method provided by an embodiment of the present invention;

[0056] Figure 2 A schematic diagram of the structure of an NSH message provided in an embodiment of the present invention;

[0057] Figure 3 A schematic diagram of the structure of a VXLAN message provided in an embodiment of the present invention;

[0058] Figure 4 Another schematic diagram of a flow chart of a message processing method provided by an embodiment of the present invention;

[0059] Figure 5 A schematic diagram of a structure in which an NSH message encapsulated in an embodiment of the present invention is carried on a VXLAN network;

[0060] Figure 6 A schematic diagram of the structure of a message processing device provided by an embodiment of the present invention;

[0061] Figure 7 A schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0062] To make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the specific technical solution of the invention will be further described in detail below in conjunction with the drawings in the embodiments of the present invention. The following embodiments are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0063] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0064] Figure 1 A schematic diagram of a message processing method provided by an embodiment of the present invention. Figure 1 As shown, the method is applied to a first node, the first node is any node in a first service chain SFC, and the method may specifically include:

[0065] S101: Matching a received first message based on an access control list ACL to obtain service data and a network service header NSH index value; the first message is a message containing destination service data sent by an active terminal to a destination terminal.

[0066] It should be noted that when a data message carrying information is transmitted in the network, it often needs to pass through various service nodes to ensure that the network can provide users with safe, fast and stable network services according to the design requirements. These service nodes include firewalls, intrusion detection systems (IPS, Intrusion Prevention System), load balancing (LB, Load Balancing), deep packet inspection (DPI, Deep Packet Inspection) and the like. In general, data messages carrying information need to pass through these service nodes in the established order required by the business logic to achieve the required security business. Such a path in an established order is called SFC, and each business node in the SFC is called a service function (SF, Service Function) node, and the SF node refers to the aforementioned Firewall, IPS, LB, and DPI. The first SFC mentioned here can refer to the path that the message carrying the destination business data needs to pass through in an established order. The first node can refer to any service node in the first SFC. In other words, the method is a process of processing the message when the message carrying the destination business data is transmitted at each node in the first SFC. It should be understood that in SFC, the core technology is NSH, which is a packaging technology with a format such as Figure 2 As shown, the content includes three parts: basic header information, service path information and optional metadata information, among which;

[0067] The basic header information contains the following information:

[0068] Ver: NSH version number, occupies 2 bits;

[0069] o (1 bit): o bit = 1, indicating that the content of this NSH packet is operation administration and maintenance (OAM) information;

[0070] u (1 bit): ubit = 1, indicating that the metadata contains metadata information customized by the user according to the tag length variable value (TLV, Tag-Length-Value);

[0071] TTL: Time To Live, occupies 6 bits;

[0072] length: the total length of the NSH message;

[0073] u(4bit): reserved field;

[0074] MD-type: also known as Context header, refers to the format of metadata, which occupies 4 bits. The metadata format can be a fixed format or a variable format. In the fixed format, the length of the metadata is 4 bytes (Word).

[0075] Next-protocol: The format of the payload content carried by NSH can be Internet Protocol Version 4 (IPv4), Internet Protocol Version 6 (IPv6), Multi-Protocol Label Switching (MPLS), etc.

[0076] The service path information includes the following information:

[0077] Service path number: also known as the SPI, indicating a service chain, for example, the first SFC mentioned above;

[0078] Service index: the aforementioned SI, which indicates the position of a certain SF node in a service chain. For example, the SI of the first node indicates the position of the first node in the first SFC. It should be understood that the SI decreases by 1 every time a SF node is passed.

[0079] Optional metadata information: also known as Context header, which can be the basic data exchanged between the front and back SF nodes in the service chain, that is, the aforementioned service business data.

[0080] Here, the first message may be a message received by the first node containing destination service data sent by the source terminal to the destination terminal, wherein the source terminal may refer to an electronic device to send data; the destination terminal may refer to an electronic device to eventually receive the data sent by the source terminal, and the electronic device may be a mobile phone, a computer, a tablet computer (iPad), etc. The NSH index value is used to index the NSH edit table described later to obtain information such as SPI and SI to be encapsulated in the NSH sub-message described later.

[0081] In actual application, S101 may include:

[0082] Searching the ACL based on the matching condition to obtain the service business data and the NSH index value;

[0083] Among them, the matching condition is the first matching condition or the second matching condition; when the first node is the initial node in the first SFC, the first matching condition is the address information obtained based on the first message or the five-tuple information obtained based on the first message; when the first node is a node other than the initial node in the first SFC, the second matching condition is the service path number SPI and the first service index SI; the SPI is used to represent the identification code of the first SFC; the first SI is used to represent the position of the first node in the first SFC.

[0084] It should be noted that ACL may refer to a packet filtering access control technology, which can filter data packets on an interface according to set conditions, allowing them to pass or discard them; it can also obtain the data that the user wants to obtain according to set matching conditions. In the embodiment of the present invention, the user has set the ACL, and according to the matching conditions, the service business data and the NSH index value can be searched and obtained.

[0085] Here, the matching conditions are different according to the different positions of the first node in the first SFC, and are roughly divided into a first matching condition and a second matching condition.

[0086] When the first node is at the initial position in the first SFC, since at this time, the first message received by the first node is not encapsulated with the NSH message, then at this time, the first message does not contain SPI, SI and other information. At this time, the address information obtained based on the first message or the five-tuple information obtained based on the first message can be used as a matching condition for matching to obtain the service business data and the NSH index value; when the first node is at the middle position and the end position of the first SFC, since at this time, the first message received by the first node is an NSH message encapsulated with NSH information, then at this time, SPI, SI and other information can be used as a matching condition for matching to obtain the service business data and the NSH index value.

[0087] In actual application, before matching the received first message based on the access control list ACL to obtain the service data and the network service header NSH index value, the method further includes:

[0088] Parsing the first message;

[0089] Determine whether the type of the first message is an OverLay network based on the analysis result;

[0090] When it is determined that the type of the first message is an OverLay network, the first message is decapsulated.

[0091] It should be noted that OverLay network can simply refer to application layer network, which is application layer-oriented and does not consider or rarely considers network layer and physical layer issues. It is a mode of superimposing virtualization technology on the traditional network structure. It can realize the carrying of applications on the network without large-scale modification of the basic network, and can be separated from other network services, and is mainly based on IP-based basic network technology. When the first message of this type is received, the outer layer needs to be encapsulated and unpacked.

[0092] In some embodiments, judging whether the type of the first message is an OverLay network based on the parsing result may refer to judging based on the fields included in the parsing result. For example, when the first message is a VXLAN message, its format may be as follows: Figure 3 In this case, by parsing the first message, the format of the first message is as follows Figure 3 After the fields shown in are read, it is determined that the first message is a message in the OverLay network format. For another example, when the first message is a GRE message, by parsing the first message to obtain fields matching the format of the GRE message, it is determined that the first message is an OverLay network.

[0093] The decapsulation process is related to the type of the OverLay network to which the first message belongs. For example, if the first message is the aforementioned VXLAN message, the decapsulation process is processed according to the VXLAN protocol; for another example, if the first message is a GRE message, the decapsulation process is processed according to the GRE protocol. In other words, messages belonging to the OverLay network type are also divided into multiple types, each with its own message format, and are parsed and decapsulated according to the corresponding protocol to obtain the information contained in each field of the first message.

[0094] S102: searching a forwarding table FT based on the address information in the first message to obtain port information and a message editing index value of a second node; the second node is a next hop node after the first node in the first SFC.

[0095] Specifically, after the first message is received by the first node, the first node's ingress packet processing pipeline (IPPP) processes it, and when it reaches the egress packet processing pipeline (EPPP) through caching and scheduling, it needs to obtain the FT of the destination port. IPPP will tell EPPP the destination port information of the first message, that is, the sending port number, which is also the port information of the second node mentioned in the embodiment of the present invention. At the same time, it will also provide the message editing and processing information required by the first message in the next switching process, that is, the switch of the next node connected to the first node. This editing and processing information is stored in the next hop table, which means that it is necessary to obtain this next hop table. Therefore, IPPP provides the index value nextHopPtr of this next hop table, which is also the message editing index value mentioned in the embodiment of the present invention. The port information of the second node is the index value of the FT of the destination port.

[0096] In actual application, the forwarding of the first message may be performed through layer 2 forwarding or layer 3 forwarding. Therefore, in some embodiments, the method further includes:

[0097] Determine, based on a destination media access control MAC address included in the first message, whether the first node performs layer 2 forwarding or layer 3 forwarding on the first message;

[0098] When the destination media access control MAC address included in the first message is a wireless routing destination MAC address, the first node performs layer 2 forwarding on the first message;

[0099] Correspondingly, searching the forwarding table FT based on the address information in the first message to obtain the port information and the message editing index value of the second node includes: performing an IP address search in the three-layer routing forwarding table according to the destination Internet Protocol IP address in the first message to obtain the port information and the message editing index value of the second node;

[0100] When the destination media access control MAC address included in the first message is not a wireless routing destination MAC address, the first node performs layer 3 forwarding on the first message;

[0101] Correspondingly, searching the forwarding table FT based on the address information in the first message to obtain the port information of the second node and the message editing index value includes: performing a MAC address search in the layer 2 forwarding table according to the destination MAC address to obtain the port information of the second node and the message editing index value.

[0102] What is described here is that, according to whether the destination MAC address carried in the first message is the MAC of the router, if so, the first node forwards the first message using layer 3 (L3), and if not, the first node forwards the first message using layer 2 (L2). According to different forwarding situations, the port information of the next node and the message editing index value are searched.

[0103] S103: Obtain first editing information associated with the second node based on the message editing index value; and obtain second editing information associated with the second node based on the NSH index value; the first editing information is related to the type of the first message; the second editing information is the relevant information required to assemble the NSH sub-message.

[0104] With respect to S103, in some embodiments, obtaining the first editing information associated with the second node based on the message editing index value may include:

[0105] Searching the memory of the first node to obtain a next hop table corresponding to the second node based on the message editing index value;

[0106] Reading first editing information associated with the second node from the next hop table;

[0107] The first editing information includes at least one of the following: layer 2 editing information of the message, layer 3 editing information of the message, and layer 4 editing information of the message.

[0108] It should be noted that the aforementioned first editing information is related to the type of the first message, which may mean that the first editing information is different according to the type of the first message. For example, when the type of the first message is a VXLAN message, the first editing information includes the second layer editing information of the message, the third layer editing information of the message, and the fourth layer editing information of the message, wherein the second layer editing information may include the editing of the destination MAC address, the source MAC address, the inner VLAN and the outer VLAN; the third layer editing information may include the editing information of the destination IP address, the editing information of the source IP address, etc.; the fourth layer editing information may include the editing information of the user datagram protocol (UDP) or the transmission control protocol (TCP) editing information, etc. For another example, if the first message is a VLAN message, the first editing information may include the second layer editing information of the message. It should be noted that the first editing information may be the information required for any editing behavior related to the first message except the NSH sub-message.

[0109] In some embodiments, obtaining the second editing information associated with the second node based on the NSH index value may include:

[0110] Searching in the memory of the first node to obtain an NSH edit table based on the NSH index value;

[0111] reading second edit information associated with the second node from the NSH edit table;

[0112] The second editing information at least includes: a service path number SPI of the first SFC, a second SI corresponding to the second node, and an operation type; the operation type includes one of the following: encapsulation, update, and decapsulation.

[0113] It should be noted that if the ACL matches the service chain rule, the NSH operation will not be performed on the first message, and only ordinary data message forwarding will be performed. If the ACL matches the service chain rule, the NSH operation will be performed. If it is at the initial node, the NSH encapsulation operation will be performed, that is, the non-NSH message will be encapsulated into an NSH message. If it is at the intermediate node, the incoming message is already an NSH message, and you only need to update the SPI / SI and other information in the NSH. If it is a terminal node, the NSH will be terminated, that is, the incoming message is an NSH message, which will be decapsulated and become a non-NSH message. Among them, the acquisition of the three operation types of encapsulation, update, and decapsulation is obtained by reading the nshOperationType in the NSH editing table. When the nshOperationType value is 1, it indicates that the operation type is encapsulation; when the nshOperationType value is 2, it indicates that the operation type is update; when the nshOperationType value is 3, it indicates that the operation type is decapsulation.

[0114] S104: Edit the first message based on the first editing information, the second editing information and the service business data to obtain a target message; the target message is a message sent by the first node to the second node.

[0115] In some embodiments, S104 may include:

[0116] Performing a first editing process on the first message based on the first editing information to obtain a first edited sub-message;

[0117] Performing a second editing process on the first editing sub-message based on the second editing information and the service business data to obtain a target message;

[0118] Among them, the first editing process includes at least one of the following: performing second-layer editing of the message based on the second-layer editing information, performing third-layer editing of the message based on the third-layer editing information, and performing fourth-layer editing of the message based on the fourth-layer editing information; the second editing process includes: assembling the NSH sub-message based on the second editing information, and encapsulating the NSH sub-message in the first editing sub-message to form the target message.

[0119] It should be noted that what is described here is that after editing the first message based on the editing information obtained above, the target message sent by the first node to the second node is obtained. The specific editing process may be to first perform a first editing process based on the first editing information, and then perform a second editing process based on the second editing information. The order of the two editing processes mentioned above can also be reversed; that is to say, there is no obvious order between the two, and the two can be edited at the same time and then integrated into the destination message.

[0120] An embodiment of the present invention provides a message processing method, which obtains service business data encapsulated in NSH and editing information encapsulated in NSH through ACL matching, obtains port information and message editing information to the next node by searching the forwarding table according to the address in the received first message, and encapsulates the first message using the aforementioned service business data and two editing information to form a target message transmitted to the next node. In this way, the editing information and service business data of NSH are obtained from ACL, so the editing of NSH is separated from the message editing of the destination business data, so that NSH can be carried not only in VXLAN network, but also in other OverLay networks, such as GRE network, and can also be carried in non-OverLay network, such as VLAN network, to realize NSH of any encapsulation format.

[0121] In order to understand the present invention, Figure 4 As shown, it shows another flow chart provided by an embodiment of the present invention. Figure 4 The message processing flow is as follows:

[0122] Step 1: The message enters IPPP processing. If it is an OverLay message, it is first decapsulated. Otherwise, the corresponding port information and data message editing information, that is, the message editing index value nexthopptr, are directly checked in the forwarding table. Then, the ACL is searched. The matching condition (key) of the ACL can be IPSA / IPDA and other information. After matching the ACL, the corresponding service chain business information is output. The information includes the NSH edit table item (that is, the aforementioned NSH edit table), the NSH index value and the Contextheader information (that is, the aforementioned service business information). This information is carried to EPPP through the packetheader for processing.

[0123] Step 2: After arriving at EPPP, the Dsnexthop table entry (the aforementioned next hop table) is indexed by nexthopptr to edit the data packets such as MAC header, VLAN, IP, OverLay encapsulation, etc., and then the DsNshedit table is indexed according to the index value carried from IPE, and the NSH header content is assembled according to the SPI, SI and Context header information carried by IPPP in the table. Then, NSH operations are performed according to the processing type in the table, including NSH encapsulation, NSH header update, and NSH decapsulation. Since the Context header is defined as 128 bits (can be larger) in the NSH protocol, if it is directly taken from the DsNshedit table, the memory occupied by the table entry will be very large. If it is taken through ACL, the resources of the DsNshedit table entry can be reduced, so as to achieve reasonable resource utilization.

[0124] Step 3: Since NSH is encapsulated behind the layer 2 header, after editing NSH, you need to edit the layer 2 header. If NSH is carried, the corresponding Enther-type needs to be changed to 0x894f. Otherwise, Enther-type is changed to the value corresponding to the carried layer 3 message. Finally, the data message editing information and NSH editing information are integrated to recompose a new message and forward it.

[0125] In summary, in the implementation scheme of message processing in the chip provided by the present invention, NSH editing information is obtained based on business matching, and corresponding encapsulation, update and decapsulation operations can be performed according to the divided business rules. Since the DsNshedit table entry index is not obtained from the forwarding table, but from the ACL, NSH editing is separated from data message editing, so that NSH can not only be carried in the VXLAN network (the message format carried in the VXLAN network is as follows Figure 5As shown in the figure), it can also be carried in other OverLay networks such as GRE, and can also be carried in non-OverLay networks, such as VLAN networks, that is, it can implement NSH in any encapsulation format. At the same time, the Context header information in the NSH message is also output from the ACL, not from the DsNshedit table entry, which realizes the separation of the Context header and the DsNshedit table entry. At this time, the DsNshedit table entry only needs to output SPI, SI, ttl information, operation type, etc., which generally occupies about 100 bits, and no 256-bit Context header is required, thereby greatly saving DsNshedit table entry resources.

[0126] Based on the same inventive concept as above, Figure 6 As shown, it shows the structure of a message processing device provided by the present invention. Figure 6 In the embodiment, the device 60 is applied to a first node, which is any node in a first service chain SFC, and includes: a matching unit 601, a search unit 602, a first obtaining unit 603, a second obtaining unit 604 and an encapsulation unit 605, wherein;

[0127] The matching unit 601 is used to match the received first message based on the access control list ACL to obtain the service business data and the network service header NSH index value; the first message contains the destination service data sent by the source terminal to the destination terminal;

[0128] The search unit 602 is used to search the forwarding table FT based on the address information in the first message to obtain the port information and message editing index value of the second node; the second node is the next hop node after the first node in the first SFC;

[0129] The first obtaining unit 603 is used to obtain first editing information associated with the second node based on the message editing index value; the first editing information is related to the type of the first message;

[0130] The second obtaining unit 604 is configured to obtain second editing information associated with the second node based on the NSH index value; the second editing information is related information required to assemble the NSH sub-message;

[0131] The encapsulation unit 605 is used to edit the first message based on the first editing information, the second editing information and the service business data to obtain a target message; the target message is a message sent by the first node to the second node.

[0132] In the above solution, the device 60 further includes: a parsing unit, a first judgment unit and a decapsulation unit, wherein;

[0133] The parsing unit is used to parse the first message;

[0134] The first judgment unit is used to judge whether the type of the first message is an OverLay network based on the analysis result;

[0135] The decapsulation unit is configured to decapsulate the first message when it is determined that the type of the first message is an OverLay network.

[0136] In the above scheme, the matching unit is used to search in the ACL based on the matching condition to obtain the service business data and the NSH index value;

[0137] Among them, the matching condition is the first matching condition or the second matching condition; when the first node is the initial node in the first SFC, the first matching condition is the address information obtained based on the first message or the five-tuple information obtained based on the first message; when the first node is a node other than the initial node in the first SFC, the second matching condition is the service path number SPI and the first service index SI; the SPI is used to represent the identification code of the first SFC; the first SI is used to represent the position of the first node in the first SFC.

[0138] In the above scheme, the device further includes: a second judgment unit, used to judge whether the first node performs layer 2 forwarding or layer 3 forwarding on the first message based on the destination media access control MAC address included in the first message; when the destination media access control MAC address included in the first message is a wireless routing destination MAC address, the first node performs layer 2 forwarding on the first message; when the destination media access control MAC address included in the first message is not a wireless routing destination MAC address, the first node performs layer 3 forwarding on the first message;

[0139] The search unit 602 is used to perform an IP address search in a layer-3 routing forwarding table according to the destination Internet Protocol IP address in the first message to obtain the port information and message editing index value of the second node when the destination media access control MAC address included in the first message is a wireless routing destination MAC address; and to perform a MAC address search in a layer-2 forwarding table according to the destination MAC address to obtain the port information and message editing index value of the second node when the destination media access control MAC address included in the first message is not a wireless routing destination MAC address.

[0140] In the above scheme, the first obtaining unit 603 is used to search the memory of the first node for the next hop table corresponding to the second node based on the message editing index value; read the first editing information associated with the second node from the next hop table; wherein the first editing information includes at least one of the following: the second-layer editing information of the message, the third-layer editing information of the message, and the fourth-layer editing information of the message.

[0141] In the above scheme, the second obtaining unit 604 is used to search and obtain the NSH editing table in the memory of the first node based on the NSH index value; read the second editing information associated with the second node from the NSH editing table; wherein the second editing information at least includes: the service path number SPI of the first SFC, the second SI corresponding to the second node, and the operation type; the operation type includes one of the following: encapsulation, update, and decapsulation.

[0142] In the above scheme, the encapsulation unit 605 is used to perform a first editing process on the first message based on the first editing information to obtain a first edited sub-message; perform a second editing process on the first edited sub-message based on the second editing information and the service business data to obtain a target message; wherein the first editing process includes at least one of the following: performing second-layer editing of the message based on the second-layer editing information, performing third-layer editing of the message based on the third-layer editing information, and performing fourth-layer editing of the message based on the fourth-layer editing information; the second editing process includes: assembling the NSH sub-message based on the second editing information, and encapsulating the NSH sub-message in the first editing sub-message to form the target message.

[0143] It should be noted that the message processing device provided in the embodiment of the present invention and the message processing method provided in the aforementioned embodiment of the present invention belong to the same inventive concept, and the meanings of the terms appearing here have been described in detail above and will not be repeated here.

[0144] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the above-mentioned method embodiment are implemented. The aforementioned storage medium includes: a mobile storage device, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0145] An embodiment of the present invention further provides an electronic device, comprising: a processor and a memory for storing a computer program that can be run on the processor, wherein the processor executes the steps of the above method embodiment stored in the memory when running the computer program.

[0146] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention, the electronic device 70 includes: at least one processor 701, a memory 702, and optionally, the electronic device 70 may further include at least one communication interface 703. The various components in the electronic device 70 are coupled together through a bus system 704. It can be understood that the bus system 704 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 704 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in Figure 7 Various buses are labeled as bus system 704 .

[0147] It can be understood that the memory 702 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus random access memory (DRRAM).The memory 702 described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memories.

[0148] The memory 702 in the embodiment of the present invention is used to store various types of data to support the operation of the electronic device 70. Examples of such data include: any computer program for operating on the electronic device 70, such as determining that when a new user service is received, a new shortest link for communication with the OLT is selected based on the updated communication link table, etc. The program for implementing the method of the embodiment of the present invention may be included in the memory 702.

[0149] The method disclosed in the above embodiment of the present invention can be applied to the processor 701, or implemented by the processor 701. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiment of the present invention. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present invention, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0150] In an exemplary embodiment, the electronic device 70 can be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the above method.

[0151] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms. The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, the functional units in the embodiments of the present invention may be all integrated in one processing unit, or each unit may be a separate unit, or two or more units may be integrated in one unit; the above integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0152] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention.

Claims

1. A message processing method, characterized in that: Applied to a first node, where the first node is any node in a first service chain SFC, the method includes: Matching the received first message based on the access control list ACL to obtain service business data and a network service packet header NSH index value; the first message is a message containing the destination service data sent by the active terminal to the destination terminal; Searching the forwarding table FT based on the address information in the first message to obtain the port information and message editing index value of the second node; the second node is the next hop node after the first node in the first SFC; obtaining first editing information associated with the second node based on the message editing index value; and obtaining second editing information associated with the second node based on the NSH index value; the first editing information is related to the type of the first message; the second editing information is related information required to assemble the NSH sub-message; The first message is edited based on the first editing information, the second editing information and the service business data to obtain a target message; the target message is a message sent by the first node to the second node.

2. The method according to claim 1, characterized in that Before matching the received first message based on the access control list ACL to obtain the service data and the network service header NSH index value, the method further includes: Parsing the first message; Determine whether the type of the first message is an OverLay network based on the analysis result; When it is determined that the type of the first message is an OverLay network, the first message is decapsulated.

3. The method according to claim 2, characterized in that The matching process of the received first message based on the access control list ACL to obtain the service business data and the network service packet header NSH index value includes: Searching the ACL based on the matching condition to obtain the service business data and the NSH index value; Among them, the matching condition is the first matching condition or the second matching condition; when the first node is the initial node in the first SFC, the first matching condition is the address information obtained based on the first message or the five-tuple information obtained based on the first message; when the first node is a node other than the initial node in the first SFC, the second matching condition is the service path number SPI and the first service index SI; the SPI is used to represent the identification code of the first SFC; the first service index SI is used to represent the position of the first node in the first SFC.

4. The method according to claim 1, characterized in that The method further comprises: Determine, based on a destination media access control MAC address included in the first message, whether the first node performs layer 2 forwarding or layer 3 forwarding on the first message; When the destination media access control MAC address included in the first message is a wireless routing destination MAC address, the first node performs layer 2 forwarding on the first message; Correspondingly, searching the forwarding table FT based on the address information in the first message to obtain the port information and the message editing index value of the second node includes: performing an IP address search in the three-layer routing forwarding table according to the destination Internet Protocol IP address in the first message to obtain the port information and the message editing index value of the second node; When the destination media access control MAC address included in the first message is not a wireless routing destination MAC address, the first node performs layer 3 forwarding on the first message; Correspondingly, searching the forwarding table FT based on the address information in the first message to obtain the port information of the second node and the message editing index value includes: performing a MAC address search in the layer 2 forwarding table according to the destination MAC address to obtain the port information of the second node and the message editing index value.

5. The method according to claim 4, characterized in that The obtaining, based on the message editing index value, first editing information associated with the second node includes: Searching the memory of the first node to obtain a next hop table corresponding to the second node based on the message editing index value; Reading first editing information associated with the second node from the next hop table; The first editing information includes at least one of the following: layer 2 editing information of the message, layer 3 editing information of the message, and layer 4 editing information of the message.

6. The method according to claim 5, characterized in that The obtaining, based on the NSH index value, second editing information associated with the second node includes: Searching in the memory of the first node to obtain an NSH edit table based on the NSH index value; reading second edit information associated with the second node from the NSH edit table; The second editing information at least includes: a service path number SPI of the first SFC, a second service index SI corresponding to the second node, and an operation type; the operation type includes one of the following: encapsulation, update, and decapsulation.

7. The method according to claim 5 or 6, characterized in that: The step of editing the first message based on the first editing information, the second editing information and the service business data to obtain a target message includes: Performing a first editing process on the first message based on the first editing information to obtain a first edited sub-message; Performing a second editing process on the first editing sub-message based on the second editing information and the service business data to obtain a target message; Among them, the first editing process includes at least one of the following: performing second-layer editing of the message based on the second-layer editing information, performing third-layer editing of the message based on the third-layer editing information, and performing fourth-layer editing of the message based on the fourth-layer editing information; the second editing process includes: assembling the NSH sub-message based on the second editing information, and encapsulating the NSH sub-message in the first editing sub-message to form the target message.

8. A message processing device, characterized in that: Applied to a first node, the first node is any node in a first service chain SFC, the device comprises: a matching unit, a search unit, a first obtaining unit, a second obtaining unit and an encapsulation unit, wherein; The matching unit is used to match the received first message based on the access control list ACL to obtain the service business data and the network service packet header NSH index value; the first message contains the destination service data sent by the source terminal to the destination terminal; The search unit is used to search the forwarding table FT based on the address information in the first message to obtain the port information and message editing index value of the second node; the second node is the next hop node after the first node in the first SFC; The first obtaining unit is configured to obtain first editing information associated with the second node based on the message editing index value; the first editing information is related to the type of the first message; The second obtaining unit is used to obtain second editing information associated with the second node based on the NSH index value; the second editing information is related information required to assemble the NSH sub-message; The encapsulation unit is used to edit the first message based on the first editing information, the second editing information and the service business data to obtain a target message; the target message is a message sent by the first node to the second node.

9. A computer-readable storage medium, characterized in that: The readable storage medium stores a computer program; when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. An electronic device, characterized in that: The electronic device comprises: a processor and a memory for storing a computer program that can be run on the processor, wherein the processor executes the steps of the method according to any one of claims 1 to 7 when running the computer program.

Citation Information

Patent Citations

  • Method and system for accessing entity gateway to virtual home gateway

    CN110099011A

  • KR20210089744A