Efficient flow guiding method, device, equipment, system and storage medium

文档序号:1508531 发布日期:2020-02-07 浏览:10次 中文

阅读说明:本技术 流量高效引流方法、装置、设备、系统及存储介质 (Efficient flow guiding method, device, equipment, system and storage medium ) 是由 陈晓帆 古亮 于 2018-07-27 设计创作,主要内容包括:本发明公开了一种微服务架构下的流量高效引流方法,包括以下步骤:当接收到外部访问端的数据包时,SDN交换设备查找本地流表,确定当前接收到的数据包对应的第一流表项;SDN交换设备基于所述第一流表项,将当前接收到的数据包转发至对应的微服务实例;当接收到微服务实例的数据包时,SDN交换设备查找本地流表,确定当前接收到的数据包对应的第二流表项;SDN交换设备基于所述第二流表项,将当前接收到的数据包转发至对应的下一微服务实例,或将当前接收到的数据包转发至对应外部访问端。本发明还公开了一种微服务架构下的流量高效引流装置、SDN交换设备及计算机可读存储介质。本发明提升了微服务引流效率、减少了网络中的通信流量。(The invention discloses a flow high-efficiency drainage method under a micro-service architecture, which comprises the following steps: when a data packet of an external access terminal is received, searching a local flow table by the SDN switching equipment, and determining a first flow table item corresponding to the currently received data packet; the SDN switching equipment forwards the currently received data packet to a corresponding micro-service instance based on the first flow table item; when a data packet of a micro-service instance is received, searching a local flow table by the SDN switching equipment, and determining a second flow table item corresponding to the currently received data packet; and forwarding the currently received data packet to a corresponding next micro-service instance or forwarding the currently received data packet to a corresponding external access terminal by the SDN switching device based on the second flow table entry. The invention also discloses a flow high-efficiency flow guiding device under the micro-service architecture, SDN switching equipment and a computer readable storage medium. The method and the system improve the drainage efficiency of the micro-service and reduce the communication flow in the network.)

1. A flow efficient drainage method under a micro-service architecture is characterized by comprising the following steps:

when a data packet of an external access terminal is received, searching a local flow table by the SDN switching equipment, and determining a first flow table item corresponding to the currently received data packet;

the SDN switching equipment forwards the currently received data packet to a corresponding micro-service instance based on the first flow table item;

when a data packet of a micro-service instance is received, searching a local flow table by the SDN switching equipment, and determining a second flow table item corresponding to the currently received data packet;

and forwarding the currently received data packet to a corresponding next micro-service instance or forwarding the currently received data packet to a corresponding external access terminal by the SDN switching device based on the second flow table entry.

2. The method of flow efficient drainage of claim 1, further comprising:

when a data packet of an external access terminal which accords with service chain drainage is received, adding a service chain packet header label to the currently received data packet by SDN switching equipment based on a preset service chain, wherein the service chain is a forwarding path set with a specified forwarding sequence;

based on the service chaining packet header label, the SDN switching device searches a local flow table and determines a third flow table item corresponding to the current data packet;

and forwarding the data packet with the service chaining header label to the corresponding micro-service instance by the SDN switching device based on the third flow table item, so that the micro-service instance can process the data packet.

3. The method of flow efficient drainage of claim 2, further comprising:

when a data packet with a service chaining header tag is received, searching a local flow table by the SDN switching device based on the service chaining header tag, and determining a fourth flow table entry corresponding to the current data packet;

and forwarding the current data packet to the next SDN switching device by the SDN switching device based on the fourth flow table item, or forwarding the current data packet to the corresponding next micro-service instance, or forwarding the currently received data packet to the corresponding external access terminal after removing a service chaining header label.

4. The method of flow efficient drainage of claim 1, further comprising:

before the drainage, the SDN switching device receives a flow table configured and issued by the SDN controller and stores the flow table locally.

5. A flow efficient drainage device under a micro-service architecture is applied to SDN switching equipment, and is characterized by comprising:

the flow table item determining module is used for searching a local flow table when receiving a data packet of an external access terminal, and determining a first flow table item corresponding to the currently received data packet;

the flow diversion module is used for forwarding the currently received data packet to the corresponding micro-service instance based on the first flow table item;

the flow table entry determination module is further to: when a data packet of a micro-service instance is received, searching a local flow table, and determining a second flow table item corresponding to the currently received data packet;

the flow diversion module is further configured to: and forwarding the currently received data packet to a corresponding next micro service instance or forwarding the currently received data packet to a corresponding external access terminal based on the second flow table entry.

6. The flow efficient drainage device of claim 5, further comprising: a service chain adding module;

the service chain adding module is used for: when a data packet of an external access terminal which accords with service chain drainage is received, adding a service chain packet header label to the currently received data packet based on a preset service chain, wherein the service chain is a forwarding path set with a specified forwarding sequence;

the flow table entry determination module is further to: based on the service chain packet header label, searching a local flow table, and determining a third flow table item corresponding to the current data packet;

the flow diversion module is further configured to: and forwarding the data packet with the service chain packet header label to the corresponding micro-service instance based on the third flow table, so as to be processed by the micro-service instance.

7. The flow efficient drainage device of claim 6,

the flow table entry determination module is further to: when a data packet with a service chain packet header tag is received, searching a local flow table based on the service chain packet header tag, and determining a fourth flow table entry corresponding to the current data packet;

the flow diversion module is further configured to: and forwarding the current data packet to a next SDN switching device based on the fourth flow table entry, or forwarding the current data packet to a corresponding next micro-service instance, or forwarding the currently received data packet to a corresponding external access terminal after removing a service chaining header label.

8. An SDN switching device comprising a memory, a process, and a traffic efficient steering program stored on the memory and executable on the processor, the traffic efficient steering program when executed by the processor implementing the steps of the traffic efficient steering method of any one of claims 1-4.

9. A flow efficient drainage system under a micro-service architecture, the flow efficient drainage system comprising: SDN controllers for issuing flow tables to the SDN switching device and managing micro-services and micro-service instances under a micro-service architecture, and SDN switching devices according to claim 8.

10. A computer-readable storage medium having stored thereon a flow efficient drainage program which, when executed by a processor, performs the steps of the flow efficient drainage method of any one of claims 1-4.

Technical Field

The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, a system, and a storage medium for efficiently draining traffic under a micro service architecture.

Background

With the continuous growth of cloud computing services, the defects of single application become more obvious, the single application has poor expansibility and low reliability, and agility development and deployment cannot be completed. Micro-service technology for solving the problems of expansibility and reliability of single-body application is produced. Benefits of the microservice architecture include: (1) the complexity problem is solved for multiple service methods by decomposing a large monolithic application. With no changes in functionality, the application is broken down into multiple manageable branches or services, with a single service being easily developed, understood, and maintained. (2) The microservice architecture schema is a deployment where each microservice is independent. Developers no longer need to coordinate the impact of other service deployments on the present service. Such changes may speed deployment. (3) The microservice architecture model allows each service to be independently extended. The scale to meet the demand can be deployed according to the scale of each service.

However, in the micro-service architecture, compared with the monolithic application, the number of services is much larger under the same number of applications, which results in greatly increased traffic between services. Therefore, how to effectively reduce the traffic between services and efficiently drain the traffic becomes an important problem to be solved in the popularization of the micro-service architecture.

The micro-service framework in the industry at present mainly includes the following two types:

1. based on a single API gateway, as shown in fig. 1, the API gateway is typically deployed on a separate physical server or virtual machine. All external accesses pass through the API gateway, which then sends the request to an instance of the first microservice, such as service 1.1. After the request is processed by the service 1.1, it returns to the API gateway and is forwarded by the API gateway to the next microservice.

The biggest problems with this architecture are: (1) after a data packet passes through a micro service every time, the data packet needs to return to an API gateway to be forwarded to the next service, the triangular drainage mode is low in efficiency, and meanwhile, the flow in a micro service network is multiplied, which is the biggest problem in the flow communication of the existing micro service architecture; (2) the processing power of a single API gateway can become a performance bottleneck of the entire application system; (3) a single API gateway is also a single point of failure for the entire system, and if the API gateway fails, the entire system cannot operate.

2. Based on the API gateway cluster, as shown in fig. 2, to solve the performance bottleneck and single point failure problem of the API gateway in the micro service architecture, the API gateway may be deployed in a cluster manner. For large-flow access, the API gateway cluster may load balance different API gateways, or may distribute different API gateways according to different access types (for example, API gateway 1 handles mobile terminal access specifically, and API gateway 2 handles web services specifically). The cluster deployment can effectively solve the problems of performance and single-point failure, but the drainage mode of communication flow is a triangular mode, and the problems of low efficiency and multiplied communication traffic exist.

Disclosure of Invention

The invention mainly aims to provide a method, a device, equipment, a system and a storage medium for efficiently draining flow under a micro-service architecture, and aims to solve the technical problem of improving the flow drainage efficiency of the flow under the micro-service architecture.

In order to achieve the above object, the present invention provides a method for efficiently draining a flow under a micro-service architecture, which is characterized in that the method for efficiently draining a flow comprises the following steps:

when a data packet of an external access terminal is received, searching a local flow table by the SDN switching equipment, and determining a first flow table item corresponding to the currently received data packet;

the SDN switching equipment forwards the currently received data packet to a corresponding micro-service instance based on the first flow table item;

when a data packet of a micro-service instance is received, searching a local flow table by the SDN switching equipment, and determining a second flow table item corresponding to the currently received data packet;

and forwarding the currently received data packet to a corresponding next micro-service instance or forwarding the currently received data packet to a corresponding external access terminal by the SDN switching device based on the second flow table entry.

Optionally, the flow-efficient drainage method further comprises:

when a data packet of an external access terminal which accords with service chain drainage is received, adding a service chain packet header label to the currently received data packet by SDN switching equipment based on a preset service chain, wherein the service chain is a forwarding path set with a specified forwarding sequence;

based on the service chaining packet header label, the SDN switching device searches a local flow table and determines a third flow table item corresponding to the current data packet;

and forwarding the data packet with the service chaining header label to the corresponding micro-service instance by the SDN switching device based on the third flow table item, so that the micro-service instance can process the data packet.

Optionally, the flow-efficient drainage method further comprises:

when a data packet with a service chaining header tag is received, searching a local flow table by the SDN switching device based on the service chaining header tag, and determining a fourth flow table entry corresponding to the current data packet;

and forwarding the current data packet to the next SDN switching device by the SDN switching device based on the fourth flow table item, or forwarding the current data packet to the corresponding next micro-service instance, or forwarding the currently received data packet to the corresponding external access terminal after removing a service chaining header label.

Optionally, the flow-efficient drainage method further comprises:

before the drainage, the SDN switching device receives a flow table configured and issued by the SDN controller and stores the flow table locally.

Further, to achieve the above object, the present invention further provides a device for efficiently draining traffic under a micro-service architecture, which is applied to an SDN switching device, and the device for efficiently draining traffic includes:

the flow table item determining module is used for searching a local flow table when receiving a data packet of an external access terminal, and determining a first flow table item corresponding to the currently received data packet;

the flow diversion module is used for forwarding the currently received data packet to the corresponding micro-service instance based on the first flow table item;

the flow table entry determination module is further to: when a data packet of a micro-service instance is received, searching a local flow table, and determining a second flow table item corresponding to the currently received data packet;

the flow diversion module is further configured to: and forwarding the currently received data packet to a corresponding next micro service instance or forwarding the currently received data packet to a corresponding external access terminal based on the second flow table entry.

Optionally, the flow efficient drainage device further comprises: a service chain adding module;

the service chain adding module is used for: when a data packet of an external access terminal which accords with service chain drainage is received, adding a service chain packet header label to the currently received data packet based on a preset service chain, wherein the service chain is a forwarding path set with a specified forwarding sequence;

the flow table entry determination module is further to: based on the service chain packet header label, searching a local flow table, and determining a third flow table item corresponding to the current data packet;

the flow diversion module is further configured to: and forwarding the data packet with the service chain packet header label to the corresponding micro-service instance based on the third flow table, so as to be processed by the micro-service instance.

Optionally, the flow table entry determining module is further configured to: when a data packet with a service chain packet header tag is received, searching a local flow table based on the service chain packet header tag, and determining a fourth flow table entry corresponding to the current data packet;

the flow diversion module is further configured to: and forwarding the current data packet to a next SDN switching device based on the fourth flow table entry, or forwarding the current data packet to a corresponding next micro-service instance, or forwarding the currently received data packet to a corresponding external access terminal after removing a service chaining header label.

Further, to achieve the above object, the present invention also provides an SDN switching device, which includes a memory, a processor, and a traffic efficient flow-steering program stored in the memory and executable on the processor, and when executed by the processor, the traffic efficient flow-steering program implements the steps of the traffic efficient flow-steering method according to any one of the above.

Further, to achieve the above object, the present invention further provides a flow efficient drainage system under a micro-service architecture, where the flow efficient drainage system includes: the SDN controller is used for issuing a flow table to the SDN switching device and managing micro-services and micro-service instances under a micro-service architecture.

Further, to achieve the above object, the present invention also provides a computer readable storage medium, on which a flow efficient drainage program is stored, which when executed by a processor implements the steps of the flow efficient drainage method according to any one of the above items.

The invention provides a method for realizing micro-service drainage based on an SDN (software defined network) network aiming at the defects of an API (application program interface) gateway drainage mode under the existing micro-service architecture, wherein a control surface and a forwarding surface of the API gateway are separated, the control surface is centralized on an SDN controller, and the forwarding surface is realized through physical or virtual SDN switching equipment. The invention avoids the problem that the API gateway needs to occupy the server resource independently, and because the data packet can be drained in the SDN switching device, the triangle drainage problem in the API gateway architecture can be avoided, the micro-service drainage efficiency is improved, and the communication flow in the network is reduced.

Drawings

FIG. 1 is a diagram illustrating a micro-service architecture based on a single API gateway;

FIG. 2 is a schematic diagram of a micro-service architecture based on an API gateway cluster;

fig. 3 is a schematic structural diagram of a hardware operating environment of an SDN switching device according to an embodiment of the present invention;

FIG. 4 is a schematic view of a micro-service architecture corresponding to an embodiment of a high-efficiency flow diversion system under the micro-service architecture of the present invention;

FIG. 5 is a schematic diagram illustrating a triangle forwarding scenario of traffic in a micro service architecture based on an API gateway;

FIG. 6 is a schematic flow chart illustrating an embodiment of a method for efficiently draining traffic under a micro-service architecture according to the present invention;

fig. 7 is a scene schematic diagram of implementing service chain drainage based on an SDN in an embodiment of a method for efficiently draining traffic under a micro-service architecture according to the present invention;

FIG. 8 is a functional block diagram of a first embodiment of a flow efficient drainage device under a micro-service architecture according to the present invention;

fig. 9 is a functional module diagram of a second embodiment of the flow efficient drainage device under the micro-service architecture according to the present invention.

The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.

Detailed Description

It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

The invention provides SDN switching equipment.

Referring to fig. 3, fig. 3 is a schematic structural diagram of a device hardware operating environment according to an embodiment of the SDN switching device of the present invention.

The SDN switching device is a device of a forwarding layer in a software defined network and is responsible for table look-up forwarding work of network data packets.

As shown in fig. 3, the SDN switching device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a memory device separate from the processor 1001 described above.

Those skilled in the art will appreciate that the hardware architecture of the SDN switching device shown in fig. 3 does not constitute a limitation of the SDN switching device, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.

As shown in fig. 3, a memory 1005, which is a type of computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a traffic efficient drainage program therein. The operating system is a program for managing and controlling SDN switching equipment and software resources, and supports the operation of a network communication module, a user interface module, a flow high-efficiency flow guiding program and other programs or software; the network communication module is used to manage and control the network interface 1004; the user interface module is used to manage and control the user interface 1003.

In the SDN switching device hardware structure shown in fig. 3, the network interface 1004 is mainly used for connecting to a system background and performing data communication with the system background; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; the SDN switching device invokes, through the processor 1001, the traffic efficient flow director stored in the memory 1005, and performs the following operations:

when a data packet of an external access terminal is received, searching a local flow table, and determining a first flow table item corresponding to the currently received data packet;

based on the first flow table item, forwarding the currently received data packet to a corresponding micro service instance;

when a data packet of a micro-service instance is received, searching a local flow table, and determining a second flow table item corresponding to the currently received data packet;

and forwarding the currently received data packet to a corresponding next micro service instance or forwarding the currently received data packet to a corresponding external access terminal based on the second flow table entry.

Further, the SDN switching device, by the processor 1001, invokes the traffic efficient drainage program stored in the memory 1005, further performs the following operations:

when a data packet of an external access terminal which accords with service chain drainage is received, adding a service chain packet header label to the currently received data packet based on a preset service chain, wherein the service chain is a forwarding path set with a specified forwarding sequence;

based on the service chain packet header label, searching a local flow table, and determining a third flow table item corresponding to the current data packet;

and forwarding the data packet with the service chain packet header label to the corresponding micro-service instance based on the third flow table, so as to be processed by the micro-service instance.

Further, the SDN switching device, by the processor 1001, invokes the traffic efficient drainage program stored in the memory 1005, further performs the following operations:

when a data packet with a service chain packet header tag is received, searching a local flow table based on the service chain packet header tag, and determining a fourth flow table entry corresponding to the current data packet;

and forwarding the current data packet to a next SDN switching device based on the fourth flow table entry, or forwarding the current data packet to a corresponding next micro-service instance, or forwarding the currently received data packet to a corresponding external access terminal after removing a service chaining header label.

Further, the SDN switching device, by the processor 1001, invokes the traffic efficient drainage program stored in the memory 1005, further performs the following operations:

and before drainage, receiving a flow table configured and issued by the SDN controller and storing the flow table locally.

The invention also provides a flow high-efficiency drainage system under the micro-service architecture.

Referring to fig. 4, fig. 4 is a schematic view of a micro service architecture corresponding to an embodiment of a system for efficiently draining traffic under the micro service architecture of the present invention.

In this embodiment, the high-efficient drainage system of flow includes: several SDN controllers and several SDN switching devices. Fig. 4 is a schematic diagram of a new microservice architecture built by introducing an SDN controller and an SDN switching device.

In this embodiment, a control plane and a forwarding plane of an API gateway in an original micro service architecture are separated, the control plane is centralized on an SDN controller, the forwarding plane is implemented by a physical or virtual SDN switching device, and the SDN switching device and the SDN controller may be deployed in a stand-alone manner or in a cluster manner.

In this embodiment, all the microservices and their instances are registered in the SDN controller (cluster) when they are online, and are logged out when they are offline, and a timeout mechanism is provided to discover the failed microservices as soon as possible.

In this embodiment, the SDN controller (cluster) uses a flow table pre-issuing mechanism to issue flow table entries for flow diversion to the SDN switching device in advance according to a forwarding policy predefined by a user and a micro-service instance state in a current micro-service architecture. And only when the micro-service instance is connected with the network, the forwarding strategy is changed, and the first flow packet which cannot be matched exists, the SDN controller updates the flow table on the SDN switching device.

After the flow table is updated, all externally accessed flow is forwarded according to the flow table entry on the SDN switching device, that is, the data plane drainage process does not need the participation of an SDN controller. Even if the micro-service instance is frequently on and off, the amount of data caused when the configuration of the control plane (configuration flow table entry) is updated is small compared with the data plane traffic, and therefore, the SDN controller (cluster) cannot become a performance bottleneck and a single point of failure in the micro-service architecture.

By the SDN switching device, the problem of triangle forwarding in the existing micro service architecture based on the API gateway can be solved. The schematic diagram of the triangle forwarding problem is shown in fig. 5, and when the traffic represented by the arrow passes through the micro service instance 1.1 and the micro service instance 2.2, the traffic must first return to the API gateway to know where the next micro service instance is, and then forward to the next micro service instance. Because the data packet can be guided in the SDN switching device, the interaction process between the switching device and the API gateway can be omitted, and compared with triangular forwarding in the existing micro-service architecture, the micro-service architecture built by the invention can reduce communication time delay, improve flow forwarding rate and reduce communication flow among micro-services.

The invention also provides a flow high-efficiency drainage method under the micro-service architecture.

Referring to fig. 6, fig. 6 is a schematic flow chart of an embodiment of a method for efficiently draining a flow under a micro-service architecture according to the present invention. In this embodiment, the flow efficient drainage method includes the following steps:

step S10, when receiving a data packet of an external access terminal, the SDN switching device searches a local flow table, and determines a first flow table entry corresponding to the currently received data packet;

step S20, forwarding, by the SDN switching device, the currently received packet to the corresponding micro-service instance based on the first flow entry;

in this embodiment, the SDN switching device is a device in a forwarding layer in a software-defined network, and may be a physical entity or a software program, and is mainly responsible for table lookup and forwarding operations of network data packets.

A flow table can be regarded as an abstraction of the data forwarding function of a network device, and a plurality of flow entries are contained in one flow table, and each flow entry mainly consists of the following three parts:

(1) a Header field (headers Fields) for packet matching and identifying the packet corresponding to the flow entry;

(2) counters (Counters) for counting the number of matching packets;

(3) actions (Actions) that show how the matching packets are processed, such as forwarded or dropped.

Optionally, before performing drainage, the SDN switching device receives a flow table configured and issued by the SDN controller and performs local storage. That is, the SDN controller adopts a flow table pre-issuing mechanism, configures a flow table entry according to a pre-defined forwarding policy and a micro-service instance state, and issues the flow table to the SDN switching device in advance.

In this embodiment, an external access terminal initiates an access request service, and after receiving a data packet corresponding to the access request service initiated by the external access terminal, the SDN switching device needs to forward the data packet to a micro-service instance for processing. The SDN switching device searches a local flow table, and determines a flow table item corresponding to a data packet through data packet matching.

And the SDN switching equipment forwards the data packet corresponding to the access request service initiated by the external access terminal and received currently to the corresponding micro-service instance for processing based on the corresponding action in the flow table entry, and the micro-service instance returns a new data packet to the SDN switching equipment after being processed.

Step S30, when receiving the data packet of the micro-service instance, the SDN switching device searches a local flow table, and determines a second flow table entry corresponding to the currently received data packet;

step S40, the SDN switching device forwards the currently received packet to the corresponding next microservice instance, or forwards the currently received packet to the corresponding external access terminal, based on the second flow entry.

In this embodiment, after the micro service instance returns a new data packet to the SDN switching device, the SDN switching device searches the local flow table again, determines a flow table entry corresponding to the current data packet through data packet matching, and then forwards the data packet returned by the currently received micro service instance to the next micro service instance or returns the data packet to the corresponding external access terminal based on a corresponding action in the flow table entry.

Based on the difference between the micro-service architecture and the request service type, after the data packet of a micro-service instance is processed by a micro-service instance, the data packet may have already completed the service request of the access terminal and thus needs to be returned to the corresponding access terminal, or may also need to be processed continuously by other micro-service instances and thus needs to be forwarded to the next micro-service instance for further processing.

To facilitate understanding of the present invention, the present invention will be exemplified below based on fig. 4.

For example, the external access 1 transmits a service request data packet to the SDN switching device, the SDN switching device searches a local flow table, determines a flow table entry matched with the data packet, and forwards the data packet to the micro-service instance 1.1 for processing based on the searched flow table entry; after the data packet is processed by the micro-service instance 1.1, a new data packet is returned to the SDN switching device, the SDN switching device continues to search a local flow table, a flow table item matched with the data packet is determined, and the data packet is forwarded to the micro-service instance 2.2 for processing based on the searched flow table item; after the data packet is processed by the micro-service instance 2.2, a new data packet is returned to the SDN switching device, the SDN switching device continues to search the local flow table, determines the flow table entry matched with the data packet, and returns the data packet to the external access 1 initiating the service request based on the searched flow table entry.

The embodiment provides a method for implementing micro-service drainage based on an SDN network, which is used for solving the defects of API gateway drainage modes under the existing micro-service architecture, and separates a control plane and a forwarding plane of an API gateway, wherein the control plane is centralized on an SDN controller, and the forwarding plane is implemented by physical or virtual SDN switching equipment. The invention avoids the problem that the API gateway needs to occupy the server resource independently, and because the data packet can be drained in the SDN switching device, the triangle drainage problem in the API gateway architecture can be avoided, the micro-service drainage efficiency is improved, and the communication flow in the network is reduced.

Further, in another embodiment of the flow efficient drainage method under the micro-service architecture, in order to further improve drainage efficiency of the SDN, the flow is implemented in an SDN service chain manner, so that a data packet can pass through a plurality of micro-service instances according to a predetermined sequence, and thus, the flow efficiency of the data packet is improved.

For example, a data packet requesting a service is sent from an external access terminal, passes through the SDN switching device, and passes through different microservice instances according to a predetermined sequence, and a reply result is returned to the external access terminal through the SDN switching device, which actually forms a service chain. As shown in fig. 7, the service chain is: external access > SDN switching device- > microservice 1.1- > SDN switching device- > microservice 2.2- > SDN switching device- > external access.

When the data message is transmitted in the network, the data message needs to pass through various functional nodes, so that the network can be ensured to provide safe, rapid and stable network service for users according to design requirements. Physical or virtual functional components are chained in a certain order, and a Service Function Chain (SFC) is formed when a specific flow passes through the functional components in a predetermined order.

In this embodiment, SDN service chain drainage is specifically implemented through the following processes:

(1) when a data packet of an external access terminal which accords with service chain drainage is received, adding a service chain packet header label to the currently received data packet by the SDN switching equipment based on a preset service chain;

a service chain is a set of forwarding paths with a specified forwarding order. Such as the service chain described above: external access > SDN switching device- > microservice 1.1- > SDN switching device- > microservice 2.2- > SDN switching device- > external access, the corresponding forwarding path comprising: external access > SDN switching device > microservice 1.1, microservice 1.1 > SDN switching device > microservice 2.2, microservice 2.2 > SDN switching device > external access.

The present embodiment is not limited to setting the forwarding path in the service chain, for example, the forwarding path is set based on the source MAC address, the source IP address, the destination MAC address, and the destination IP address. It should be noted that the setting of the forwarding path needs to be associated with a flow entry, so that the SDN switching device implements the forwarding path through the associated flow entry.

(2) Based on the service chaining packet header label, the SDN switching device searches a local flow table and determines a third flow table item corresponding to the current data packet;

(3) and forwarding the data packet with the service chaining header label to the corresponding micro-service instance by the SDN switching device based on the third flow table item, so that the micro-service instance can process the data packet.

In this embodiment, after adding a service chaining header tag to a received data packet of an external access terminal, the SDN switching device matches a corresponding flow entry in the flow table based on the service chaining header tag, and then forwards the data packet with the service chaining header tag to a corresponding micro-service instance based on the matched flow entry, so as to process the data packet with the service chaining header tag by the micro-service instance.

Further, in another embodiment of the method for efficiently draining traffic under the micro-service architecture, the flow of the SDN service chain is also implemented through the following processes:

(1) when a data packet with a service chaining header tag is received, searching a local flow table by the SDN switching device based on the service chaining header tag, and determining a fourth flow table entry corresponding to the current data packet;

(2) forwarding, by the SDN switching device, the current packet to:

A. a next SDN switching device;

B. a corresponding next microservice instance;

C. and corresponding to an external access terminal, wherein the packet head label of the service chain is removed before the data packet is forwarded.

In this embodiment, a data packet with a service chaining header tag received by the SDN switching device may be forwarded by the previous SDN switching device, or may be returned by a micro service instance. The SDN switching device matches a corresponding flow table item in the flow table through the service chain packet header tag, and then forwards the data packet with the service chain packet header tag to the next SDN switching device or a corresponding next micro-service instance or a corresponding external access terminal based on the matched flow table item, so that a service chain drainage mode that flow is drained according to a specified sequence is realized.

The invention also provides a flow high-efficiency drainage device under the micro-service architecture.

Referring to fig. 8, fig. 8 is a functional module diagram of a first embodiment of the flow efficient drainage device under the micro-service architecture of the present invention. In this embodiment, the efficient traffic diversion device is applied to an SDN switching device, and includes the following functional modules:

the flow table entry determining module 10 is configured to, when a data packet of an external access end is received, search a local flow table, and determine a first flow table entry corresponding to the currently received data packet;

the flow diversion module 20 is configured to forward the currently received data packet to the corresponding micro-service instance based on the first flow table entry;

in this embodiment, an external access terminal initiates an access request service, and after receiving a data packet corresponding to the access request service initiated by the external access terminal, the flow entry determining module 10 needs to forward the data packet to a micro service instance for processing through the flow steering module 20. The flow table entry determining module 10 searches a local flow table, and determines a flow table entry corresponding to a packet through packet matching.

Based on the corresponding action in the flow table entry, the flow diversion module 20 forwards the data packet corresponding to the access request service initiated by the external access terminal, which is currently received, to the corresponding micro-service instance for processing, and after the micro-service instance is processed, a new data packet is returned.

The flow table entry determination module 10 is further configured to: when a data packet of a micro-service instance is received, searching a local flow table, and determining a second flow table item corresponding to the currently received data packet;

the flow diversion module 20 is further configured to: and forwarding the currently received data packet to a corresponding next micro service instance or forwarding the currently received data packet to a corresponding external access terminal based on the second flow table entry.

In this embodiment, after the micro service instance returns a new data packet, the flow table entry determining module 10 searches the local flow table again, determines the flow table entry corresponding to the current data packet through data packet matching, and then the flow diversion module 20 forwards the data packet returned by the currently received micro service instance to the next micro service instance or returns the data packet to the corresponding external access terminal based on the corresponding action in the flow table entry.

Based on the difference between the micro-service architecture and the request service type, after the data packet of a micro-service instance is processed by a micro-service instance, the data packet may have already completed the service request of the access terminal and thus needs to be returned to the corresponding access terminal, or may also need to be processed continuously by other micro-service instances and thus needs to be forwarded to the next micro-service instance for further processing.

The embodiment provides a method for implementing micro-service drainage based on an SDN network, which is used for solving the defects of API gateway drainage modes under the existing micro-service architecture, and separates a control plane and a forwarding plane of an API gateway, wherein the control plane is centralized on an SDN controller, and the forwarding plane is implemented by physical or virtual SDN switching equipment. The invention avoids the problem that the API gateway needs to occupy the server resource independently, and because the data packet can be drained in the SDN switching device, the triangle drainage problem in the API gateway architecture can be avoided, the micro-service drainage efficiency is improved, and the communication flow in the network is reduced.

Referring to fig. 9, fig. 9 is a functional module diagram of a second embodiment of the flow efficient drainage device under the micro-service architecture of the present invention. In this embodiment, the high-efficient drainage device of flow still includes:

the service chain adding module 30 is configured to add a service chain header tag to a currently received data packet based on a preset service chain when receiving the data packet of the external access end that conforms to the service chain drainage;

a service chain is a set of forwarding paths with a specified forwarding order. Such as the service chain described above: external access- > SDN switching device- > microservice 1.1- > SDN switching device- > microservice 2.2- > SDN switching device- > external access, the corresponding forwarding path includes: external access- > SDN switch device- > microservice 1.1, microservice 1.1- > SDN switch device- > microservice 2.2, microservice 2.2- > SDN switch device- > external access.

The present embodiment is not limited to setting the forwarding path in the service chain, for example, the forwarding path is set based on the source MAC address, the source IP address, the destination MAC address, and the destination IP address. It should be noted that the setting of the forwarding path needs to be associated with a flow entry, so that the SDN switching device implements the forwarding path through the associated flow entry.

The flow table entry determination module 10 is further configured to: based on the service chain packet header label, searching a local flow table, and determining a third flow table item corresponding to the current data packet;

the flow diversion module 20 is further configured to: and forwarding the data packet with the service chain packet header label to the corresponding micro-service instance based on the third flow table, so as to be processed by the micro-service instance.

In this embodiment, after adding a service chain header tag to a received data packet at an external access end, the flow table entry determining module 10 matches a corresponding flow table entry in the flow table based on the service chain header tag, and then the flow steering module 20 forwards the data packet with the service chain header tag to a corresponding micro-service instance based on the matched flow table entry, so as to process the data packet with the service chain header tag by the micro-service instance.

Further, in an embodiment, the flow entry determining module 10 is further configured to: when a data packet with a service chain packet header tag is received, searching a local flow table based on the service chain packet header tag, and determining a fourth flow table entry corresponding to the current data packet;

the flow diversion module 20 is further configured to: and forwarding the current data packet to a next SDN switching device based on the fourth flow table entry, or forwarding the current data packet to a corresponding next micro-service instance, or forwarding the currently received data packet to a corresponding external access terminal after removing a service chaining header label.

In this embodiment, the data packet with the service chaining header tag received by the flow table entry determining module 10 may be forwarded by the previous SDN switching device, or may be returned by a certain micro-service instance. The flow table entry determining module 10 matches a corresponding flow table entry in the flow table through the service chaining header tag, and then the flow diversion module 20 forwards the data packet with the service chaining header tag to the next SDN switching device or the corresponding next micro-service instance or the corresponding external access terminal based on the matched flow table entry, thereby implementing a service chaining diversion mode in which the flow is diverted in the designated order.

The invention also provides a computer readable storage medium.

In this embodiment, the computer readable storage medium has stored thereon a flow efficient drainage program, which when executed by a processor implements the steps of the flow efficient drainage method as described in any of the above embodiments.

Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM), and includes instructions for causing a terminal (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.

The present invention is described in connection with the accompanying drawings, but the present invention is not limited to the above embodiments, which are only illustrative and not restrictive, and those skilled in the art can make various changes without departing from the spirit and scope of the invention as defined by the appended claims, and all changes that come within the meaning and range of equivalency of the specification and drawings that are obvious from the description and the attached claims are intended to be embraced therein.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:API网关限流方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!