CN116846991A - Network application data forwarding method and device - Google Patents

Network application data forwarding method and device Download PDF

Info

Publication number
CN116846991A
CN116846991A CN202310847334.1A CN202310847334A CN116846991A CN 116846991 A CN116846991 A CN 116846991A CN 202310847334 A CN202310847334 A CN 202310847334A CN 116846991 A CN116846991 A CN 116846991A
Authority
CN
China
Prior art keywords
data
network application
plane
data request
protocol stack
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310847334.1A
Other languages
Chinese (zh)
Other versions
CN116846991B (en
Inventor
代彦龙
李玮
荆慧
黄明亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yusur Technology Co ltd
Original Assignee
Yusur Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yusur Technology Co ltd filed Critical Yusur Technology Co ltd
Priority to CN202310847334.1A priority Critical patent/CN116846991B/en
Priority claimed from CN202310847334.1A external-priority patent/CN116846991B/en
Publication of CN116846991A publication Critical patent/CN116846991A/en
Application granted granted Critical
Publication of CN116846991B publication Critical patent/CN116846991B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/566Grouping or aggregating service requests, e.g. for unified processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/03Protocol definition or specification 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/12Protocol engines

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application provides a network application data forwarding method and device, wherein the method comprises the following steps: intercepting a data request sent by a network application from outside the network application, wherein the data request comprises the plane type of the data request in the network application; forwarding the data request to a target protocol stack corresponding to the plane type to which the data request belongs; if the reply data for the data request returned by the target protocol stack is received, forwarding the reply data to a corresponding plane in the network application according to the plane type to which the data request belongs. The application can effectively improve the efficiency and reliability of data processing of the network application on the basis of not needing to independently develop the network application to adapt to the protocol stack, can effectively save time and labor cost, and improves the convenience of later maintenance of the network application.

Description

Network application data forwarding method and device
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and an apparatus for forwarding network application data.
Background
The network application is a relatively traditional application program for processing network data, is responsible for network message traffic receiving and transmitting and data analysis and processing, and comprises a current open source network processing application (Nginx, envoy, suricata and the like) and a network traffic model application which is automatically researched and developed by enterprises and the like, so as to receive and transmit, analyze, proxy, manage and control the data traffic and the like. With the development of software technology, particularly the occurrence of cloud computing, big data and other services, a large amount of network data is in the process of real-time transmission. For network applications on a host, message processing is usually required to be implemented based on a kernel protocol stack, and the kernel protocol stack needs to consume a very high proportion of CPU resources such as 60% in a high-traffic scenario to process a message-triggered interrupt, copy of a message from a kernel mode to a user mode, and the like, which is a great consumption for traditional network applications, and needs to meet a very high processing performance requirement. Therefore, if CPU resources consumed in a high-traffic scenario are saved for an application processing message to improve the data processing efficiency of a network application, it is one of the key points of current research.
Currently, a network application data forwarding mode of modifying a code of a network application to adapt to a protocol stack such as DPDK can be adopted to improve efficiency and reliability of data processing of the network application, and the network application such as Nginx, envoy, suricata adapts the protocol stack by modifying the code. However, this approach not only requires modification of a large number of codes to achieve hard compatibility, consumes a large amount of time and labor costs, and is inconvenient for post-maintenance of network applications. Therefore, there is a need to design a network application data forwarding method that can ensure the efficiency and reliability of data processing of a network application and can effectively improve the maintenance convenience.
Disclosure of Invention
In view of this, embodiments of the present application provide a method and apparatus for forwarding network application data, so as to obviate or improve one or more disadvantages in the prior art.
One aspect of the present application provides a network application data forwarding method, including:
intercepting a data request sent by a network application from outside the network application, wherein the data request comprises a plane type which the data request belongs to in the network application;
forwarding the data request to a target protocol stack corresponding to the plane type to which the data request belongs;
And if the reply data for the data request returned by the target protocol stack is received, forwarding the reply data to a corresponding plane in the network application according to the plane type to which the data request belongs.
The forwarding the data request to a target protocol stack corresponding to a plane type to which the data request belongs includes:
determining a protocol stack corresponding to the plane type to which the data request belongs as a current target protocol stack based on a preset corresponding relation between each plane type and each protocol stack, wherein each protocol stack comprises: and the kernel protocol stack and the DPDK network protocol stack.
In some embodiments of the present application, before the forwarding the data request to the target protocol stack corresponding to the plane type to which the data request belongs, the method further includes:
and receiving and storing the corresponding relation between each plane type and each protocol stack which are customized by a user, or automatically generating the corresponding relation between each plane type and each protocol stack according to each acquired plane type in the network application.
In some embodiments of the present application, if each plane type in the network application includes a management plane, a control plane, and a data plane, the correspondence between each plane type and each protocol stack includes: the management plane and the control plane respectively correspond to the calling relations between the kernel protocol stacks, and the data plane corresponds to the calling relations between the DPDK network protocol stacks.
In some embodiments of the present application, if reply data for the data request returned by the target protocol stack is received, forwarding the reply data to a corresponding plane in the network application according to a plane type to which the data request belongs, including:
if the reply data for the data request returned by the DPDK network protocol stack is received, adding a target address corresponding to the reply data into a local lock-free communication queue to wait for uploading;
and dequeuing the target address in the lock-free communication queue, and uploading reply data corresponding to the target address and aiming at the data request to a corresponding plane in the network application according to the plane type to which the data request belongs.
In some embodiments of the present application, before the adding the destination address corresponding to the recovered data to the local lock-free communication queue to wait for the upload, the method further includes:
receiving a memory pool specification configuration parameter;
applying for a memory space based on the memory pool specification configuration parameter, and pre-distributing the content space based on a memory pool;
and packaging the communication queue according to the memory space after the pre-allocation processing, and performing locking-free processing on the communication queue based on the atomic operation to obtain the locking-free communication queue.
In some embodiments of the present application, intercepting, from outside the network application, a data request sent by the network application includes:
intercepting a data request sent by a network application from outside the network application based on a first data interface, wherein the first data interface is an interface which is packaged locally in advance and is the same as a data sending interface of the network application;
correspondingly, the step of uploading reply data corresponding to the target address and aiming at the data request to a corresponding plane in the network application includes:
and sending reply data corresponding to the target address and aiming at the data request to a corresponding plane in the network application based on a second data interface, wherein the second data interface is an interface which is packaged locally in advance and is the same as a data receiving interface of the network application.
Another aspect of the present application provides a network application data forwarding apparatus, including:
the request interception module is used for intercepting a data request sent by the network application from outside the network application, wherein the data request comprises a plane type which the data request belongs to in the network application;
the data forwarding module is used for forwarding the data request to a target protocol stack corresponding to the plane type to which the data request belongs;
And the data uploading module is used for forwarding the reply data to the corresponding plane in the network application according to the plane type to which the data request belongs if the reply data which is returned by the target protocol stack and is aimed at the data request is received.
A third aspect of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the network application data forwarding method when executing the computer program.
A fourth aspect of the application provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the network application data forwarding method.
The application provides a network application data forwarding method, which intercepts a data request sent by a network application from outside the network application, wherein the data request comprises a plane type which the data request belongs to in the network application; forwarding the data request to a target protocol stack corresponding to the plane type to which the data request belongs; if the reply data for the data request returned by the target protocol stack is received, forwarding the reply data to a corresponding plane in the network application according to the plane type to which the data request belongs, so that the efficiency and reliability of data processing of the network application can be effectively improved on the basis that the network application does not need to be independently developed to adapt to the protocol stack, the time and labor cost can be effectively saved, and the convenience of post maintenance of the network application is improved.
Additional advantages, objects, and features of the application will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and drawings.
It will be appreciated by those skilled in the art that the objects and advantages that can be achieved with the present application are not limited to the above-described specific ones, and that the above and other objects that can be achieved with the present application will be more clearly understood from the following detailed description.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate and together with the description serve to explain the application. The components in the figures are not necessarily to scale, emphasis instead being placed upon illustrating the principles of the application. Corresponding parts in the drawings may be exaggerated, i.e. made larger relative to other parts in an exemplary device actually manufactured according to the present application, for convenience in showing and describing some parts of the present application. In the drawings:
fig. 1 is a general flow chart of a network application data forwarding method according to an embodiment of the present application.
Fig. 2 is a schematic flow chart of a network application data forwarding method according to an embodiment of the present application.
FIG. 3 is a schematic diagram of an Envoy architecture according to an embodiment of the present application.
Fig. 4 is a schematic diagram of an exemplary architecture of an existing network application Envoy adapted DPDK protocol stack.
Fig. 5 is a preferred schematic diagram of the correspondence between each of the plane types and each of the protocol stacks in an embodiment of the present application.
Fig. 6 is a schematic flow chart of another embodiment of a network application data forwarding method according to the present application.
Fig. 7 is a schematic structural diagram of a network application data forwarding device according to an embodiment of the present application.
FIG. 8 is a schematic diagram of the structure of a DCL library according to an embodiment of the present application.
Fig. 9 is a schematic diagram of the structural relationship between the DCL library and the network application and protocol stack of an application example of the present application.
Detailed Description
The present application will be described in further detail with reference to the following embodiments and the accompanying drawings, in order to make the objects, technical solutions and advantages of the present application more apparent. The exemplary embodiments of the present application and the descriptions thereof are used herein to explain the present application, but are not intended to limit the application.
It should be noted here that, in order to avoid obscuring the present application due to unnecessary details, only structures and/or processing steps closely related to the solution according to the present application are shown in the drawings, while other details not greatly related to the present application are omitted.
It should be emphasized that the term "comprises/comprising" when used herein is taken to specify the presence of stated features, elements, steps or components, but does not preclude the presence or addition of one or more other features, elements, steps or components.
It is also noted herein that the term "coupled" may refer to not only a direct connection, but also an indirect connection in which an intermediate is present, unless otherwise specified.
Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
In order to solve the problems that the existing network application data forwarding mode adopts the mode of modifying the codes of the network application to adapt to the protocol stack such as DPDK and the like, although the efficiency and the reliability of data processing of the network application can be ensured, but a large number of codes need to be modified to realize hard compatibility, a large amount of time and labor cost are consumed, the later maintenance of the network application is inconvenient, and the like, the embodiment of the application respectively provides a network application data forwarding method, a network application data forwarding device, entity equipment and a computer readable storage medium for executing the network application data forwarding method, can realize the scheduling of the protocol stack without changing any codes, can be suitable for all network applications, can avoid the problem that different network applications need to independently adapt to develop a set of adapting protocol stack, can effectively avoid the problem that the codes of the network application are modified to adapt to the protocol stack by calling the design of interception processing operation, further can solve the problem that the later upgrading and maintenance are difficult, and saves a large amount of labor, namely time cost.
The following examples are provided to illustrate the application in more detail.
Based on this, an embodiment of the present application provides a network application data forwarding method that may be implemented by a network application data forwarding device, referring to fig. 1, where the network application data forwarding method specifically includes the following contents:
step 100: intercepting a data request sent by a network application from outside the network application, wherein the data request comprises the plane type of the data request in the network application.
In step 100, the network application data forwarding device may intercept data requests for the network application by adopting an interceptor manner such as an interface or a filter, and it is understood that the data requests mentioned in one or more embodiments of the present application refer to data call, query or storage requests sent by any one of the respective planes of the network application, and the network application data forwarding device performs real-time monitoring and interception for each plane of the network application.
The plane type included in the data request and belonging to the network application refers to a type corresponding to a plane sending the data request in the network application.
The network application data forwarding method provided by the application is a general method which is independent of the network application and does not need to carry out code adaptation modification on the network application, so that the method is suitable for various network applications, such as Nginx, envoy, suricata and the like.
Based on the above, the network application data forwarding method provided by the application is also suitable for network applications with different plane type division modes, namely, the network application data forwarding method provided by the application is suitable for network applications regardless of the division of the network applications into two, three, four or even more than four planes.
Step 200: and forwarding the data request to a target protocol stack corresponding to the plane type to which the data request belongs.
In one or more embodiments of the present application, a protocol stack specifically refers to a sum of protocols of layers in a network, and is used to reflect a procedure of file transmission in a network.
In step 200, the target protocol stack corresponding to the plane type to which the data request belongs may be a user-defined and changeable protocol stack in advance, or may be a fixed protocol stack.
In addition, it should be noted that, the network application data forwarding device intercepts the data request outside the network application, and forwards the data request outside the network application to the protocol stack, that is, the protocol stack obviously does not need to be integrated with the network application, which can further improve the convenience and the applicability of the network application data forwarding.
After the network application data forwarding device performs step 200, two situations may occur depending on the type of data request it is currently forwarding:
the first case is: if the data request is a data storage or response request, the reply data does not need to be acquired from the protocol stack, so that in this case, the network application data forwarding device will not receive the reply data for the data request.
The second case is opposite: if the data is a data query or call request, the protocol stack is required to return the reply data, the network application data forwarding device may receive the reply data, and then execute step 300 described below.
Step 300: and if the reply data for the data request returned by the target protocol stack is received, forwarding the reply data to a corresponding plane in the network application according to the plane type to which the data request belongs.
In step 300, the network application data forwarding device forwards the reply data to a corresponding plane in the network application outside the network application, and the specific forwarding may use an interface or the like.
As can be seen from the above description, the network application data forwarding method provided by the embodiment of the present application may be suitable for various network applications, and can avoid that different network data processing applications all need to individually adapt and develop a set of adapting DPDK, and by invoking the interception processing operation, can avoid adapting DPDK by modifying a large amount of codes of the adapting network data processing application, can solve the problem of difficult post-upgrade maintenance, can save a large amount of labor cost, and effectively improve the efficiency and reliability of data processing performed by the network application.
In order to further improve flexibility and efficiency of network application data forwarding, in one embodiment of the network application data forwarding method provided by the present application, referring to fig. 2, step 200 in the network application data forwarding method specifically includes the following:
step 210: determining a protocol stack corresponding to the plane type to which the data request belongs as a current target protocol stack based on a preset corresponding relation between each plane type and each protocol stack, wherein each protocol stack comprises: and the kernel protocol stack and the DPDK network protocol stack.
The correspondence between each plane type and each protocol stack may be preset before step 210 to improve flexibility in selecting the target protocol stack.
In step 210, the network application data forwarding device sets a plurality of protocol stacks in advance and selects one protocol stack, so that data requests sent by different types of planes can not be processed from the same protocol stack, thereby not only reducing the resource occupation rate of the protocol stack for data processing, but also improving the efficiency of data forwarding and calling. The network application adaptation protocol stack can be realized, a plurality of planes simultaneously run the same protocol stack, and the unstable problems of overtime and the like of network data processing application configuration receiving and processing caused by large flow of a later system are avoided.
It will be appreciated that the DPDK (Data Plane Development Kit) network protocol stack is an open source software development suite for accelerating packet processing and packet forwarding application development. It provides a set of high performance user state libraries and drivers that enable web applications to run at very high speeds on Intel x86 architecture generic servers.
In step 210, each protocol stack may at least include a Kernel protocol stack (i.e., kernel stack) and the DPDK network protocol stack, and may also include other types of protocol stacks, which may be specifically set according to an actual application situation.
In order to further improve flexibility and efficiency of forwarding network application data, in one embodiment of the network application data forwarding method provided by the present application, referring to fig. 2, before step 200 in the network application data forwarding method, the method specifically includes the following:
step 010: and receiving and storing the corresponding relation between each plane type and each protocol stack which are customized by a user, or automatically generating the corresponding relation between each plane type and each protocol stack according to each acquired plane type in the network application.
Specifically, there are two ways to obtain the correspondence between each plane type and each protocol stack:
one is: the network application data forwarding device directly receives and stores the corresponding relation between each plane type and each protocol stack which are customized by the user, the method has the advantages that the user can customize, the user can customize the technology of the protocol stacks of each plane for processing the network data based on the self scene, and the DPDK protocol stack or the Kernel stack can be selected.
The second step is: the network application data forwarding device receives each plane type in the network application to be forwarded, and then automatically generates the corresponding relation between the plane types and each protocol stack according to the corresponding relation, and the method has the advantages that: even if the user does not know the characteristics and advantages of different protocol stacks, the configuration of the corresponding relation between the plane type and each protocol stack can be realized by only giving each plane type in the network application.
Based on this, the network application data forwarding device can implement configuration based on preset preferred configuration logic to improve the response efficiency of the non-service request, which is described in detail in the next embodiment.
In order to further improve flexibility and efficiency of forwarding network application data, in one embodiment of the network application data forwarding method provided by the present application, if each plane type in the network application includes a management plane, a control plane, and a data plane, a correspondence between each plane type and each protocol stack includes: the management plane and the control plane respectively correspond to the calling relations between the kernel protocol stacks, and the data plane corresponds to the calling relations between the DPDK network protocol stacks. For example, the data request issued by the management plane may be an information viewing request, and may view the current traffic specification (current memory information) stored in the memory of the application program, so as to find the statistical information through the kernel stack. The data request issued by the control plane can be a flow configuration control request, and is used for controlling and managing configuration information through the kernel stack. The data request issued by the data plane is a service processing request, and is used for retrieving reply data corresponding to the service processing request through a DPDK protocol stack.
Envoy is illustrated as an example of a network application, where Envoy is an open-source high-performance proxy that is typically used as the data plane of a service grid, responsible for the actual request forwarding and handling. The Envoy architecture is divided into a data plane, a management plane and a control plane, wherein the control plane is used for managing policies and configurations related to traffic routing and forwarding; the management plane obtains the latest flow configuration information through a standard API; traffic forwarding at the data plane is based on configuration rules issued by the control plane. Specifically, the control plane is used for managing policies and configurations related to traffic routing and forwarding; the management plane obtains the latest flow configuration information through a standard API; traffic forwarding of the data plane is based on configuration rules issued by the control plane, see fig. 3 for Envoy architecture.
If the network application adapts to the DPDK, all the services of the data plane, the control plane and the management plane go away from the DPDK protocol stack, see fig. 4, the DPDK protocol stack can cause the problem that the network data processing application receives the slow configuration and even the timeout interruption of the management plane and the control plane in the scene of large service volume, thus the concept that the data plane, the control plane and the management plane are mutually independent is violated, and only the performance of the network data processing application system is improved, and the reliability of the system is reduced.
Based on this, in the embodiment of the present application, when the framework of the network application is divided into three planes, the network application data forwarding device configures the correspondence between each of the plane types and each of the protocol stacks as: the management plane and the control plane correspond to the call relations between the kernel protocol stacks respectively, and the data plane corresponds to the call relations between the DPDK network protocol stacks, as shown in fig. 5, the phenomenon that the control plane and the management plane walk through the DPDK protocol stacks simultaneously after the network data processing application adapts to the DPDK can be avoided, and the problem that the network data processing application configuration receiving process is unstable due to overtime and the like caused by large flow of a later system is avoided.
In order to avoid blocking caused by locking a queue in data transmission in a lock-free manner, improve the performance of the queue and further improve the overall performance of application service processing, in one embodiment of the network application data forwarding method provided by the application, referring to fig. 2, step 300 in the network application data forwarding method specifically includes the following contents:
step 310: and if the reply data for the data request returned by the DPDK network protocol stack is received, adding a target address corresponding to the reply data into a local lock-free communication queue to wait for uploading.
Step 320: and dequeuing the target address in the lock-free communication queue, and uploading reply data corresponding to the target address and aiming at the data request to a corresponding plane in the network application according to the plane type to which the data request belongs.
In order to avoid the consumption of dynamic application memory in data processing and improve the application reliability of the lock-free queue, in one embodiment of the network application data forwarding method provided by the present application, referring to fig. 2, before step 300 in the network application data forwarding method, the method further specifically includes the following contents:
Step 020: and receiving the specification configuration parameters of the memory pool.
Step 030: and applying for the memory space based on the memory pool specification configuration parameters, and pre-distributing the content space based on the memory pool.
Step 040: and packaging the communication queue according to the memory space after the pre-allocation processing, and performing locking-free processing on the communication queue based on the atomic operation to obtain the locking-free communication queue.
In order to achieve the imperceptible interception and forwarding, in one embodiment of the network application data forwarding method provided by the present application, referring to fig. 6, step 100 in the network application data forwarding method further specifically includes the following contents:
step 110: intercepting a data request sent by a network application from outside the network application based on a first data interface, wherein the first data interface is an interface which is packaged locally in advance and is the same as a data sending interface of the network application.
Correspondingly, referring to fig. 6, step 320 in the network application data forwarding method further specifically includes the following:
step 321: and dequeuing the target address in the lock-free communication queue, and uploading reply data corresponding to the target address and aiming at the data request to a corresponding plane in the network application based on a second data interface, wherein the second data interface is an interface which is packaged locally in advance and is the same as a data receiving interface of the network application.
Specifically, the network application data forwarding device receives and transmits data from the network application data forwarding device through encapsulating a set of processing interfaces which are completely consistent with a C library (libc) socket used by the network application, and the network application is enabled to realize the non-perception of the network application through the calling interfaces, namely, the network application needs to receive data and process the data, and the network application calls the data receiving interface of the network application data forwarding device when the network application sends the data, so that the network application can not perceive middleware, namely, the network application data forwarding device, a DPDK protocol stack and the like, and the network application does not need to adapt and modify codes of the network data processing application, thereby improving maintainability of the network data processing application system, being applicable to the service scene which is novel in technology, frequently needs to be maintained and upgraded, being convenient for later-stage upgrading and maintenance, saving upgrading and maintenance cost and improving data processing efficiency.
In terms of software, the present application further provides a network application data forwarding device for executing all or part of the network application data forwarding method, referring to fig. 7, where the network application data forwarding device specifically includes the following contents:
A request interception module 10, configured to intercept, from outside a network application, a data request sent by the network application, where the data request includes a plane type to which the data request belongs in the network application;
a data forwarding module 20, configured to forward the data request to a target protocol stack corresponding to a plane type to which the data request belongs;
and the data uploading module 30 is configured to, if receiving reply data for the data request returned by the target protocol stack, forward the reply data to a corresponding plane in the network application according to the plane type to which the data request belongs.
The embodiment of the network application data forwarding device provided by the application can be specifically used for executing the processing flow of the embodiment of the network application data forwarding method in the embodiment, and the functions of the embodiment of the network application data forwarding device are not repeated herein, and can be referred to in the detailed description of the embodiment of the network application data forwarding method.
The part of the network application data forwarding device for forwarding the network application data can be executed in a server or can be completed in client equipment. Specifically, the selection may be made according to the processing capability of the client device, and restrictions of the use scenario of the user. The application is not limited in this regard. If all operations are performed in the client device, the client device may further include a processor for specific processing of network application data forwarding.
The client device may have a communication module (i.e. a communication unit) and may be connected to a remote server in a communication manner, so as to implement data transmission with the server. The server may include a server on the side of the task scheduling center, and in other implementations may include a server of an intermediate platform, such as a server of a third party server platform having a communication link with the task scheduling center server. The server may include a single computer device, a server cluster formed by a plurality of servers, or a server structure of a distributed device.
Any suitable network protocol may be used between the server and the client device, including those not yet developed on the filing date of the present application. The network protocols may include, for example, TCP/IP protocol, UDP/IP protocol, HTTP protocol, HTTPS protocol, etc. Of course, the network protocol may also include, for example, RPC protocol (Remote Procedure Call Protocol ), REST protocol (Representational State Transfer, representational state transfer protocol), etc. used above the above-described protocol.
As can be seen from the above description, the network application data forwarding device provided by the embodiment of the present application can effectively improve the efficiency and reliability of data processing of a network application on the basis of not needing to independently develop the network application to adapt to a protocol stack, can effectively save time and labor costs, and improves convenience of post maintenance of the network application.
On the basis, in order to further explain the network application data forwarding method provided by the embodiment of the application, aiming at the defects of low performance and poor maintainability of the network application, an application example of the application also provides a process for performing configuration and forwarding of network application data forwarding by adopting a DCL (DPDK Connection Lib) library, which can be used for solving the problems that the maintainability of an application system is reduced due to the improvement of the application performance of the network application, the reliability of the application system is reduced due to the improvement of the application performance of the network application and the compatibility of the network application with DPDK is required to be independently developed and adapted.
In this application example, the DCL library may specifically be a specific implementation example of the foregoing network application data forwarding device, where the DCL library at least can be a function of each functional module in the network application data forwarding device, and in order to further refine a function of each functional module in the network application data forwarding device, referring to fig. 8 and fig. 9, the DCL library specifically includes a configuration parsing module 1, a memory pool module 2, a communication queue module 3, a call interception module 4, a dual stack processing parsing module 5, and a data transceiver module 6. The specific functions of the modules are described as follows:
(1) Configuration analysis module 1: and the configuration analysis of the user is responsible for analyzing stack configuration parameter items selected by a control plane, a data plane and a configuration plane of the user configuration network application, and analyzing memory pool specification configuration parameter items. The user can select the data processing stack (Kernel, DPDK) by the form of configuration parameters based on the scene needs.
(2) Memory pool module 2: and initializing and applying for a memory space with a certain specification in advance according to parameters configured by a user, and maintaining dequeuing and enqueuing of the memory space. Memory pre-allocation is performed in advance through a memory pool, so that consumption caused by dynamic application of memory in data processing is avoided, service processing delay is reduced, and overall performance is improved.
(3) Communication queue module 3: and realizing a lock-free queue for message data transmission between the network application and the DPDK. The blocking caused by locking the queue in the data transmission is avoided in a locking-free mode, the performance of the queue is improved, and the overall performance of the service is further improved.
(4) Call interception module 4: and packaging a set of processing interfaces which are completely consistent with the Libc socket used by the network application, and intercepting a calling interface of the network application data transceiver module by calling. The network application can not sense the existence of the middleware DCL and the DPDK, so that no adaptation is needed to modify the codes of the network application, the maintainability of a network application system is improved, the network application system is applicable to the service scene with novel technology and frequent updating and maintenance, the later updating and maintenance can be facilitated, the updating and maintenance cost is saved, and the data processing efficiency is improved.
(5) Double stack processing parsing module 5: and intercepting the corresponding data processing stack by combining the user-defined configuration parameters. For example, the user may configure the data plane to run the DPDK protocol stack, while the management and control planes to run the kernel stack: the method ensures that the data surface reduces the performance consumption of operations such as message copying, interrupt processing and the like, improves the CPU utilization rate of network application, can avoid DPDK from influencing the flow data of the network application management surface and the control surface in a large-flow scene, and improves the reliability of the system while improving the performance of the network application system.
(6) Data message receiving and transmitting module 6: and the network application is responsible for receiving and transmitting data from the DPDK and the network application, for example, a message data address received from the DPDK is copied to a memory allocated in advance by a memory pool module, and then the data is transmitted to the network application through a locking-free mechanism of a communication queue module.
In this application example, the specific flow of the configuration and forwarding process for performing network application data forwarding by using the DCL library is as follows:
s1: initialization phase
(1) The DCL library firstly calls a configuration analysis module 1 to carry out user configuration analysis, wherein analysis parameters mainly comprise two parts, one part is a parameter related to double stacks and is used for specifying which sockets walk a DPDK stack and which sockets walk a kernel stack; another part of the parameters are memory related parameters.
(2) The DCL library calls the memory pool module 2 to initialize the memory, and the memory with the specified specification is initialized according to the memory parameters analyzed in the above process (1), and the memory serves the communication queue module 3.
(3) The DCL library then invokes the communication queue module 3 to initialize the queue, where the module performs enqueuing and dequeuing operations based on the memory packages previously applied in the memory pool, and implements lockless based on the atomic operations.
S2: dual stack configuration processing stage
(1) After the initialization stage is completed, the DCL enters a dual stack configuration stage, the DCL firstly calls a call interception module 4, the call interception module 4 externally realizes a set of unified libc socket processing interfaces for the universal network application, and the module provides a mechanism of a dynamic link library to realize that the universal network application does not sense the interface change of the bottom layer, so that call interception is realized under the condition of not changing any code of the universal network application.
(2) Calling a function for intercepting a pre-configured dynamic link library: the call interception module 4 calls an interface provided by the dual-stack processing analysis module 5 in the unified libc socket processing interface provided by the outside, the inside of the dual-stack processing analysis module 5 carries out corresponding processing operation based on the dual-stack parameters analyzed in the early-stage initialization node, and if the designated socket is a DPDK stack, the module calls a stack interface of the DPDK; conversely, if a kernel stack is specified, the module may call the kernel stack interface internally. Thus, the effects of the interface of the data plane, the control plane and the management plane of the general network data plane and the interface of the kernel stack are achieved.
S4: message receiving and transmitting processing stage
If the designated Socket walks away the DPDK stack, the DCL library invokes the data messaging module 6, which will send the data mbuf address received from the DPDK interface to the enqueuing operation provided by the communication queue module 3, and the other end of the queue is the dual stack processing parsing module 5 to perform the dequeuing operation, and finally, send the dequeuing operation to the specific general network application.
Based on this, the problems of the existing network application data forwarding method are as follows: the network application code is modified to adapt the DPDK, so that service coupling is serious, all the function codes of the network application are required to be transplanted to the DPDK, and the method is characterized in that the network application code and the DPDK modified code are strong in invasiveness, so that the network application is inconvenient to maintain and upgrade in the later stage, especially, the scene of novel technology and frequent iteration of community version update is inconvenient, the performance of the network application is improved only so that the maintainability of the later stage of the network application is reduced, the scheme is only suitable for the technical field of perfect technology stack and no later iteration update is required, and is not suitable for the field of frequent technology iteration, such as Envoy applied to a service grid scene, the service grid technology belongs to the technology which is novel, frequent in updating iteration and rapid development, and a large amount of manpower is wasted for development, adaptation and test no matter the updating or the technology modification is required after the DPDK is adapted. The application example of the application provides a DCL library and a configuration and forwarding method for network application data forwarding realized by adopting the DCL library, which relates to a general means for improving the reliability and maintainability of a system while improving the service performance of an application based on network application, and can be applied to all network applications, thereby avoiding the need of independently adapting and developing a set of adaptation DPDK for different network applications; by calling the interception processing operation, a large number of codes applied by the adaptation network are prevented from being modified to adapt to the DPDK, the problem of difficult maintenance in later-stage upgrading is solved, and a large number of labor costs are saved; meanwhile, through the selection processing operation of the custom data processing stack, the phenomenon that the control plane and the management plane walk through the DPDK stack simultaneously after the network application adapts to the DPDK is avoided, and the unstable problems of overtime and the like of network application configuration receiving processing caused by large flow of a later system are avoided.
That is, the application example of the present application has at least the following advantages:
(1) Aiming at the DPDK universal adaptation framework technology of the network application, the scheduling of the DPDK can be realized without changing any code after all the network applications use the DCL library.
(2) Aiming at the non-invasive call interception technology of the network application, the upper layer network application does not need to perceive the realization below, does not need to modify any code, and is convenient for later maintenance and upgrading.
(3) The user can customize the technology of the network application control plane, the data plane and the management plane data flow processing stack based on the needs of the own scene, and can select a DPDK stack or a Kernel stack.
(4) The technical point of a memory pool for dynamic application of the memory can be reduced, the performance consumption caused by dynamic application of the memory in the data transmission process can be reduced, and the overall performance is further improved.
(5) The memory mapping technology point can reduce the performance consumption caused by copying the data message, save CPU and memory resources and further improve the service performance of the service grid system.
In a word, the application example of the application ensures that the network application improves the application service performance and simultaneously improves the maintainability and reliability of the application service.
The embodiment of the application also provides an electronic device, which may include a processor, a memory, a receiver and a transmitter, where the processor is configured to execute the network application data forwarding method mentioned in the foregoing embodiment, and the processor and the memory may be connected by a bus or other manners, for example, through a bus connection. The receiver may be connected to the processor, memory, by wire or wirelessly.
The processor may be a central processing unit (Central Processing Unit, CPU). The processor may also be any other general purpose processor, digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof.
The memory, as a non-transitory computer readable storage medium, may be used to store a non-transitory software program, a non-transitory computer executable program, and modules, such as program instructions/modules corresponding to the network application data forwarding method in the embodiments of the present application. The processor executes various functional applications of the processor and data processing by running non-transitory software programs, instructions and modules stored in the memory, i.e., implementing the network application data forwarding method in the method embodiments described above.
The memory may include a memory program area and a memory data area, wherein the memory program area may store an operating system, at least one application program required for a function; the storage data area may store data created by the processor, etc. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory may optionally include memory located remotely from the processor, the remote memory being connectable to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the memory that, when executed by the processor, perform the network application data forwarding method of the embodiments.
In some embodiments of the present application, a user equipment may include a processor, a memory, and a transceiver unit, which may include a receiver and a transmitter, the processor, the memory, the receiver, and the transmitter may be connected by a bus system, the memory being configured to store computer instructions, the processor being configured to execute the computer instructions stored in the memory to control the transceiver unit to transmit and receive signals.
As an implementation manner, the functions of the receiver and the transmitter in the present application may be considered to be implemented by a transceiver circuit or a dedicated chip for transceiver, and the processor may be considered to be implemented by a dedicated processing chip, a processing circuit or a general-purpose chip.
As another implementation manner, a manner of using a general-purpose computer may be considered to implement the server provided by the embodiment of the present application. I.e. program code for implementing the functions of the processor, the receiver and the transmitter are stored in the memory, and the general purpose processor implements the functions of the processor, the receiver and the transmitter by executing the code in the memory.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, which when being executed by a processor, implements the steps of the aforementioned network application data forwarding method. The computer readable storage medium may be a tangible storage medium such as Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disk, a removable memory disk, a CD-ROM, or any other form of storage medium known in the art.
Those of ordinary skill in the art will appreciate that the various illustrative components, systems, and methods described in connection with the embodiments disclosed herein can be implemented as hardware, software, or a combination of both. The particular implementation is hardware or software dependent on the specific application of the solution and the design constraints. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, a plug-in, a function card, or the like. When implemented in software, the elements of the application are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine readable medium or transmitted over transmission media or communication links by a data signal carried in a carrier wave.
It should be understood that the application is not limited to the particular arrangements and instrumentality described above and shown in the drawings. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between steps, after appreciating the spirit of the present application.
In the present application, features that are described and/or illustrated with respect to one embodiment may be used in the same way or in a similar way in one or more other embodiments and/or in combination with or instead of the features of the other embodiments
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, and various modifications and variations can be made to the embodiments of the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method for forwarding network application data, comprising:
intercepting a data request sent by a network application from outside the network application, wherein the data request comprises a plane type which the data request belongs to in the network application;
forwarding the data request to a target protocol stack corresponding to the plane type to which the data request belongs;
and if the reply data for the data request returned by the target protocol stack is received, forwarding the reply data to a corresponding plane in the network application according to the plane type to which the data request belongs.
2. The network application data forwarding method according to claim 1, wherein forwarding the data request to a target protocol stack corresponding to a plane type to which the data request belongs comprises:
determining a protocol stack corresponding to the plane type to which the data request belongs as a current target protocol stack based on a preset corresponding relation between each plane type and each protocol stack, wherein each protocol stack comprises: and the kernel protocol stack and the DPDK network protocol stack.
3. The network application data forwarding method according to claim 2, further comprising, before forwarding the data request to a target protocol stack corresponding to a plane type to which the data request belongs:
And receiving and storing the corresponding relation between each plane type and each protocol stack which are customized by a user, or automatically generating the corresponding relation between each plane type and each protocol stack according to each acquired plane type in the network application.
4. A network application data forwarding method according to claim 2 or 3, wherein if each plane type in the network application includes a management plane, a control plane, and a data plane, the correspondence between each plane type and each protocol stack includes: the management plane and the control plane respectively correspond to the calling relations between the kernel protocol stacks, and the data plane corresponds to the calling relations between the DPDK network protocol stacks.
5. The method for forwarding data of a network application according to claim 2, wherein if receiving reply data for the data request returned by the target protocol stack, forwarding the reply data to a corresponding plane in the network application according to a plane type to which the data request belongs, includes:
if the reply data for the data request returned by the DPDK network protocol stack is received, adding a target address corresponding to the reply data into a local lock-free communication queue to wait for uploading;
And dequeuing the target address in the lock-free communication queue, and uploading reply data corresponding to the target address and aiming at the data request to a corresponding plane in the network application according to the plane type to which the data request belongs.
6. The method for forwarding network application data according to claim 5, further comprising, before adding the destination address corresponding to the recovered data to the local lock-free communication queue to wait for forwarding:
receiving a memory pool specification configuration parameter;
applying for a memory space based on the memory pool specification configuration parameter, and pre-distributing the content space based on a memory pool;
and packaging the communication queue according to the memory space after the pre-allocation processing, and performing locking-free processing on the communication queue based on the atomic operation to obtain the locking-free communication queue.
7. The method for forwarding data of a network application according to claim 5, wherein intercepting the data request sent by the network application from outside the network application comprises:
intercepting a data request sent by a network application from outside the network application based on a first data interface, wherein the first data interface is an interface which is packaged locally in advance and is the same as a data sending interface of the network application;
Correspondingly, the step of uploading reply data corresponding to the target address and aiming at the data request to a corresponding plane in the network application includes:
and sending reply data corresponding to the target address and aiming at the data request to a corresponding plane in the network application based on a second data interface, wherein the second data interface is an interface which is packaged locally in advance and is the same as a data receiving interface of the network application.
8. A network application data forwarding apparatus, comprising:
the request interception module is used for intercepting a data request sent by the network application from outside the network application, wherein the data request comprises a plane type which the data request belongs to in the network application;
the data forwarding module is used for forwarding the data request to a target protocol stack corresponding to the plane type to which the data request belongs;
and the data uploading module is used for forwarding the reply data to the corresponding plane in the network application according to the plane type to which the data request belongs if the reply data which is returned by the target protocol stack and is aimed at the data request is received.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the network application data forwarding method of any of claims 1 to 7 when the computer program is executed by the processor.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements a network application data forwarding method according to any of claims 1 to 7.
CN202310847334.1A 2023-07-11 Network application data forwarding method and device Active CN116846991B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310847334.1A CN116846991B (en) 2023-07-11 Network application data forwarding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310847334.1A CN116846991B (en) 2023-07-11 Network application data forwarding method and device

Publications (2)

Publication Number Publication Date
CN116846991A true CN116846991A (en) 2023-10-03
CN116846991B CN116846991B (en) 2024-09-27

Family

ID=

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108900327A (en) * 2018-06-20 2018-11-27 昆明理工大学 A kind of chronometer data acquisition and real-time processing method based on DPDK
CN109889468A (en) * 2017-12-06 2019-06-14 腾讯科技(武汉)有限公司 Transmission method, system, device, equipment and the storage medium of network data
CN110535813A (en) * 2018-05-25 2019-12-03 网宿科技股份有限公司 Kernel state protocol stack and User space protocol stack simultaneously deposit treating method and apparatus
CN111614631A (en) * 2020-04-29 2020-09-01 江苏深网科技有限公司 User mode assembly line framework firewall system
US20200304368A1 (en) * 2019-03-20 2020-09-24 Arista Networks, Inc. Accessing processing devices of a network device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109889468A (en) * 2017-12-06 2019-06-14 腾讯科技(武汉)有限公司 Transmission method, system, device, equipment and the storage medium of network data
CN110535813A (en) * 2018-05-25 2019-12-03 网宿科技股份有限公司 Kernel state protocol stack and User space protocol stack simultaneously deposit treating method and apparatus
CN108900327A (en) * 2018-06-20 2018-11-27 昆明理工大学 A kind of chronometer data acquisition and real-time processing method based on DPDK
US20200304368A1 (en) * 2019-03-20 2020-09-24 Arista Networks, Inc. Accessing processing devices of a network device
CN111614631A (en) * 2020-04-29 2020-09-01 江苏深网科技有限公司 User mode assembly line framework firewall system

Similar Documents

Publication Publication Date Title
CN109561171B (en) Configuration method and device of virtual private cloud service
US10698717B2 (en) Accelerator virtualization method and apparatus, and centralized resource manager
US10866846B2 (en) Application interaction method, apparatus, and system, and physical machine
CN108270813B (en) Heterogeneous multi-protocol stack method, device and system
CN102339234B (en) Device for operating protocol stack and method
US7305493B2 (en) Embedded transport acceleration architecture
US8291486B2 (en) Gateway device having socket library for monitoring, communication method of gateway device having socket library for monitoring, and communication program of gateway device having socket library for monitoring
EP3748934B1 (en) Mirror pull method and system therefor
EP4322483A1 (en) System architecture for implementing dds communication on basis of autosar, communication method, and device
US20240069977A1 (en) Data transmission method and data transmission server
US7751401B2 (en) Method and apparatus to provide virtual toe interface with fail-over
CN111756791A (en) Techniques for accelerated function as service network device load balancer
CN101764843A (en) Processing method and system for remote process call, client end and server
CN116800616B (en) Management method and related device of virtualized network equipment
US7412701B1 (en) Method for network management using a virtual machine in a network device
Luo et al. Eliminating communication bottlenecks in cross-device federated learning with in-network processing at the edge
US20030231657A1 (en) System and method for a multi-data network layer transmit interface
CN116846991B (en) Network application data forwarding method and device
US11895196B1 (en) Efficient update mechanism in IoT event driven architectures
CN116846991A (en) Network application data forwarding method and device
WO2021022947A1 (en) Method for deploying virtual machine and related device
CN112783675A (en) IPC communication method
US11151022B1 (en) Testing of executable code for local device coordinator
CN113328874B (en) Data acceleration method, device and system applied to NFV system
WO2023035777A1 (en) Network configuration method, proxy component, controller, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant