Distributed service chaining across multiple clouds

By using service containers and service classifiers in the data center to identify and forward the service chain of data messages, combined with service path identifiers and MAC redirection technology, the blocking problem of data message distribution between data centers is solved, and seamless forwarding and Flexible distribution plan modifications improve the scalability of the data center.

CN114342342BActive Publication Date: 2024-09-03VMWARE INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202080060199.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-10-30
Filing Date
2020-07-26
Publication Date
2024-09-03
Estimated Expiration
2040-07-26

AI Technical Summary

Technical Problem

There are blocking points in the data message distribution scheme between the application and service layers in existing data centers, and it is difficult to seamlessly modify the distribution scheme without affecting the server configuration.

Method used

Use service containers and service classifiers to execute on the host computer, forward data messages by identifying service chains and service nodes, use service path identifiers or MAC redirection to achieve seamless forwarding of data messages, and deploy between different data centers Service forwarding proxy to facilitate service processing across data centers.

Benefits of technology

It achieves seamless data message distribution between data centers, simplifies the modification process of the distribution plan, avoids server reconfiguration, and improves the flexibility and scalability of the data center.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114342342B_ABST
    Figure CN114342342B_ABST
Patent Text Reader

Abstract

Some embodiments of the present invention provide novel methods for performing services on data messages that traverse a network connecting one or more data centers, such as a software defined data center (SDDC). The methods of some embodiments use a service container executed on a host computer to perform different service chains (e.g., ordered sequences) on different data message streams. For data messages of a particular data message stream received or generated at a host computer, the method uses a service classifier executed on the host computer in some embodiments to identify a service chain that specifies several services to be performed on the data message. For each service in the identified service chain, the service classifier identifies a service container for performing the service. The service classifier then forwards the data message to a service forwarding element to forward the data message through the service container identified for the identified service chain. The service classifier and the service forwarding element are implemented in some embodiments as processes that are defined as hooks in a virtual interface endpoint (e.g., a virtual Ethernet port) of an operating system (e.g., a Linux operating system) of a host computer on which the service container executes.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Today's data centers use a static, configuration-intensive approach to distribute data messages between different application layers and to different service layers. A common approach today is to configure virtual machines to send packets to virtual IP addresses, and then configure forwarding elements and load balancers in the data center with forwarding rules that instruct them to forward VIP-addressed packets to the appropriate application and / or service layers. Another problem with existing message distribution schemes is that today's load balancers are often choke points for distributed traffic. Therefore, there is a need in the art for new methods to seamlessly distribute data messages between different application and / or service layers in a data center. Ideally, this new approach would allow the distribution scheme to be easily modified without reconfiguring the servers that transmit the data messages. Summary of the invention

[0002] Some embodiments of the present invention provide novel methods for performing services on data messages traversing a network that connects one or more data centers, such as a software defined data center (SDDC). The methods of some embodiments use a service container executed on a host computer to perform different service chains (e.g., ordered sequences) on different data message flows. For a data message in a particular data message flow received or generated at a host computer, the methods of some embodiments use a service classifier executed on the host computer to identify a service chain that specifies a number of services to be performed on the data message.

[0003] For each service in the identified service chain, the service classifier identifies the service node for performing the service. In some embodiments, some or all of the service nodes in the service chain are service containers. The service classifier then forwards the data message to the service forwarding element to forward the data message by the service node identified for the identified service chain. As further described below, the service classifier and the service forwarding element are implemented as processes in some embodiments, which are defined as hooks in the virtual interface endpoints (e.g., virtual Ethernet ports) of the operating system (e.g., Linux operating system) of the host computer on which the service container executes.

[0004] For a particular data message flow, in some embodiments, the service classifier identifies a service container for at least one service in the identified service chain by performing a load balancing operation to select a particular service container from a set of two or more candidate service containers for the service. In some embodiments, the service classifier performs this load balancing operation to select a service container from a plurality of candidate service containers for two or more (e.g., all) of the services in the identified service chain.

[0005] For a particular service, in some embodiments, the service classifier performs a load balancing operation by directing a load balancer designated for the particular service to select a container from a set of candidate service containers for the particular service. In some embodiments, the load balancing operation uses statistics about data messages processed by each container in the set of candidate containers to select a particular container from the set for a particular data message flow.

[0006] For a particular data message flow, in some embodiments, the service classifier specifies a service path identifier (SPI) that identifies a path that passes through containers selected to implement the identified service chain, and the service classifier provides this service path identifier to the service forwarding element to be used to perform its classification operation to forward the data messages of this flow. In other embodiments, the service forwarding element does not use the service path identifier to forward the data messages of a particular data message flow, but uses MAC redirection (redirect) to specify forwarding rules, which are used to guide the data messages of this flow between successive service containers in the service path.

[0007] In conjunction with any of these forwarding methods, some embodiments use a designated service path identifier to select a service path for a reverse data message flow sent in response to a particular data message flow (e.g., sent by the destination of the particular data message flow). This approach ensures that in these embodiments the same set of service containers examines both the initial data message flow in the forward direction and the response data message flow in the reverse direction.

[0008] In some embodiments that use the MAC redirection method to forward data messages to different service containers in a service path, the service forwarding element is implemented by: (1) a virtual interface endpoint in the OS namespace that is used to define a virtual forwarding element (e.g., a virtual switch or a virtual bridge) in the OS, and (2) a virtual interface endpoint in the container namespace of each service container. These virtual interface endpoints are configured to perform the match-action forwarding operations required to implement MAC redirection forwarding.

[0009] In some embodiments, these match-action operations include match classification operations that compare the layer 2 (L2) source and / or destination network addresses of the data message and the layer 3 (L3) source and / or destination network addresses of the data message to the selection criteria of the forwarding rule. The L3 source and / or destination network addresses are used in some embodiments to distinguish egress data messages leaving the subnet from ingress data messages entering the subnet. In some embodiments, the match-action operations include action operations that modify the L2 destination MAC address of the data message because these embodiments use MAC redirection to forward the data message to a successive service container.

[0010] The service classifier of some embodiments selects all service containers of the service chain to be located on the host computer of the service classifier. In other embodiments, different service containers of the service chain can operate on different host computers. Among some of these embodiments, different service containers can be executed on host computers in different data centers. In order to facilitate forwarding data messages between different data centers for service processing, some embodiments deploy a service forwarding proxy in the data center.

[0011] When service processing of a data message starts in a first data center and continues to a second data center, a service forwarding agent in the first data center encapsulates the data message with an encapsulation header and stores a service path identifier that identifies the service path to the second data center. In some embodiments, this SPI is a globally unique SPI that uniquely identifies the service path in each data center that has a service container on the service path. In some embodiments, the globally unique SPI includes a UUID (universally unique ID) for each service and a data center ID for each service UUID or each set of service UUIDs in each data center.

[0012] After receiving the encapsulated data message, the service forwarding agent in the second data center decapsulates the data message (removes the encapsulation header from the data message), removes the SPI embedded in the removed header, and uses the SPI to identify the next hop service container in the service path that should process the data message in the second data center.

[0013] In addition to the SPI, in some embodiments, the encapsulation header also includes a next-hop service identifier, which the service forwarding agent can use to identify the next service container in the service path that should process the data message. For example, when the global SPI has a UUID for each service container, the next-hop service identifier is a reference to the service container UUID location in the global SPI in some embodiments, or in other embodiments, the next-hop service identifier is set to the UUID of this container. In other embodiments, the encapsulation header does not include the next-hop service identifier because the service forwarding agent in the second data center is configured to identify the next-hop service node only from the received SPI.

[0014] In other embodiments, instead of using the SPI to identify the next-hop service container, the service forwarding agent in the second data center passes the SPI to a service forwarding element in the second data center to be used to identify the next-hop service container. In some embodiments, the forwarding element is a service forwarding element executed on a host computer that executes the next-hop service container.

[0015] In some embodiments, two service forwarding agents in two data centers can be used to forward many data message streams between the two data centers for service processing. Moreover, in some embodiments, the service forwarding agent in the data center can forward data messages to multiple other service forwarding agents in multiple other data centers and receive data messages from multiple other service forwarding agents in multiple other data centers to implement a service chain across different sets of data centers. In some embodiments, each service forwarding agent includes (1) a forwarding agent for encapsulating data messages and sending the encapsulated data messages to another service forwarding agent in another data center, and (2) a receiving agent for receiving the encapsulated data messages from another service forwarding agent in another data center and decapsulating the received data messages for processing in the data center of the receiving agent.

[0016] In some embodiments, a data center has (1) a number of service host computers that execute a collection of service containers to perform the same service chain on data message streams received at the data center, and (2) a collection of one or more forwarding elements (e.g., front-end load balancers) that randomly or deterministically distribute the data message streams to the host computers. Each service host computer then performs a service classification operation on each data message stream received by the service host computer to determine whether the service host computer should process the data message stream or whether it should redirect the data message stream to another service host computer.

[0017] For example, upon receiving a first data message stream, a first service host computer uses a set of attributes of the stream (e.g., a five-tuple identifier of the stream) to perform a first service classification operation that identifies a first set of services to be performed on the data message. Based on the identifier for the first set of services, the first service host computer determines that a set of service machines executing on a second host must perform the first set of services on the first data message stream. The first service host computer then forwards the data messages of the first data message stream to the second service host computer.

[0018] On the other hand, after receiving the second data message stream, the first service host computer uses the attribute set of the stream (e.g., the five-tuple identifier of the stream) to perform a second service classification operation, which identifies a second set of services to be performed on the data message. Based on the identifier for the second set of services, the first service host computer determines that a set of service machines executing on the first service host computer must perform the second set of services on the second data message stream. Then, the first service host computer forwards the data messages of the second data message stream to each service machine in the set of service machines on the first service host computer that must perform a service in the second set of services on the second data message stream.

[0019] The foregoing summary is intended to serve as a brief introduction to some embodiments of the present invention. This is not meant to be an introduction or overview of all inventive subject matter disclosed in this document. The following detailed description and the drawings mentioned in the detailed description will further describe the embodiments described in the summary of the invention as well as other embodiments. Therefore, in order to understand all embodiments described by this document, a comprehensive review of the summary of the invention, the detailed description, the drawings and the claims is required. Moreover, the claimed subject matter is not limited by the illustrative details in the summary of the invention, the detailed description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The novel features of the invention are set forth in the appended claims. However, for purposes of illustration, several embodiments of the invention are set forth in the following figures.

[0021] Figure 1 A software defined data center (SDDC) is illustrated that uses the service-execution methods of some embodiments to process data messages originating from and / or received at the SDDC.

[0022] Figure 2 Illustrated is how some embodiments implement a service forwarding element and a service classifier within a Linux operating system (OS) of a host computer.

[0023] Figure 3 The process performed by the service classifier in some embodiments is illustrated.

[0024] Figure 4 The service classifier of some embodiments is illustrated interacting with several other modules to perform service classification.

[0025] Figure 5 A process is presented that conceptually illustrates the operation of a service forwarding element in forwarding a data message across a service path identified by a service classifier.

[0026] Figure 6 It is illustrated that upon receiving the first data message stream, the virtual interface endpoint of the Linux OS of the first service host computer passes the data message to the service classifier registered as a hook in the callback mechanism of the OS.

[0027] Figure 7 Illustrated is the processing of a second data message stream that the top-of-rack switch initially forwards to a first serving host computer.

[0028] Figure 8 The diagram illustrates a process performed by a service host computer in some embodiments to perform a service operation on a received data message stream, or to redirect a data message to another service host computer for service processing.

[0029] Fig. 9 Further illustration Figure 6 and 7 Distributed service chain classification and forwarding architecture.

[0030] Fig.10 Examples are presented that illustrate the use of such a service forwarding proxy.

[0031] Fig.11 Additional properties of a service forward proxy in some embodiments are illustrated.

[0032] Fig.12 A process conceptually illustrating performing services associated with a service chain on a data message using service containers in different data centers is presented.

[0033] Fig.13 A computer system is conceptually illustrated with which some embodiments of the invention are implemented. DETAILED DESCRIPTION

[0034] In the following detailed description of the present invention, many details, examples and embodiments of the present invention are set forth and described. However, it will be clear and obvious to those skilled in the art that the present invention is not limited to the embodiments set forth, and the present invention can be practiced without some of the specific details and examples discussed.

[0035] Some embodiments of the present invention provide novel methods for performing services on data messages across a network that connects machines in one or more data centers, such as a software defined data center (SDDC). The methods of some embodiments use a service container executed on a host computer to perform different service chains on different data message flows. The service chain includes one or more service nodes, each of which performs a service in the service chain. In some embodiments, some or all of the service nodes are service containers.

[0036] In some embodiments, a container is a construct that runs on top of an operating system (OS) of a host computer. In some embodiments, the host operating system uses namespaces to isolate containers from each other and thus provide operating system-level isolation of different groups of applications operating in different containers. Examples of containers include Docker containers, rkt containers, and containers executed on top of a hypervisor such as ESXi.

[0037] As used in this document, a data message refers to a collection of bits in a specific format sent across a network. One of ordinary skill in the art will recognize that the term "data message" may be used herein to refer to a collection of bits in various formats that may be sent across a network, such as an Ethernet frame, an IP packet, a TCP segment, a UDP datagram, etc. Similarly, as used in this document, references to L2, L3, L4, and L7 layers (or Layer 2, Layer 3, Layer 4, Layer 7) are references to the second data link layer, the third network layer, the fourth transport layer, and the seventh application layer, respectively, of the OSI (Open Systems Interconnection) layer model.

[0038] Figure 1 An SDDC 100 is illustrated that uses the service-execution method of some embodiments to process data messages originating from and / or received at the SDDC. In some embodiments, the SDDC is part of a telecommunications network (e.g., a 5G telecommunications network), for which multiple network slices may be defined. Data message flows may be associated with network slices, and one or more service chains may be defined for each network slice. In some embodiments, each service chain specifies one or more ordered sequences of service operations (e.g., compute operations, forwarding operations, and / or middlebox service operations, etc.) to be performed on data message flows associated with the network slice of the chain.

[0039] In a 5G telecommunication network, service operations include virtual network functions (VNFs) that are performed on data messages. Examples of network slices for a 5G telecommunication network include a mobile broadband slice for processing broadband data, an IoT slice for processing IoT (Internet of Things) data, a telemetry slice for processing telemetry data, a VOIP (Voice over IP) slice for voice over IP data, a video conferencing slice for processing video conferencing data, a device navigation slice for processing navigation data, and the like.

[0040] As shown, SDDC 100 includes a host computer 105, a management server 110, an ingress gateway 115, and an egress gateway 120. Ingress / egress gateways 115 and 120 allow data messages to enter and leave the data center. In some embodiments, the same set of gateways can act as both ingress and egress gateways because they connect the SDDC to an external network (such as the Internet). In other embodiments, the ingress gateway and the egress gateway are different because the ingress gateway connects the SDDC to one network (e.g., a private telecommunications network) and the egress gateway connects the SDDC to another network (e.g., to the Internet). Moreover, in some embodiments, one or both of these sets of gateways (e.g., an ingress gateway or an egress gateway) are connected to two or more networks (e.g., an MPLS network and the Internet).

[0041] As further shown, the host computer executes an operating system 130, a service container 135, and a software forwarding element 140. In some embodiments, the operating system (OS) 130 is Linux. In some embodiments, this OS executes on top of a hypervisor, while in other embodiments, it executes locally on the host computer (without a hypervisor). The service container 135 and the software forwarding element 140 are deployed and configured by the management server 110 to implement a chain of service operations.

[0042] In some embodiments, management server 110 includes a manager by which service chains can be defined and managed, and a controller by which service container 135 and software forwarding element 140 can be configured. In other embodiments, both management operations and control operations are performed by a common set of servers. To operate service chains, in some embodiments, management server 110 configures each host computer 105 and its software forwarding element to implement service classifier 155 and service forwarding element 160.

[0043] For a data message in a particular data message flow received at a host computer, a service classifier 155 executing on the host computer 105 identifies a service chain that specifies a number of services to be performed on the data message. The received data message originates from a source machine executing on the host computer in some cases, and is forwarded by a forwarding element (e.g., a front-end load balancer) operating external to the host computer in other embodiments.

[0044] For each service in the identified service chain, the service classifier 155 identifies a service container 135 that performs the service. In some embodiments, the service classifier 155 of one host computer identifies all service containers of the service chain as being located on the host computer of the service classifier 155. In other embodiments, the service classifier may select service containers on different hosts to perform some or all of the service operations of the identified service chain. The set of service containers identified to implement the service chain represents a service path across the network.

[0045] After identifying the service chain and the service container that implements the service chain (e.g., after identifying the service path), the service classifier 155 passes the data message to the service forwarding element 160 to forward the data message to the service container identified for the identified service chain. In some embodiments, the service forwarding element 160 executes on the host computer of the service classifier. In other embodiments where the service containers in the identified service path can be located on different host computers, the service forwarding element 160 is a distributed forwarding element (e.g., a logical forwarding element) that spans multiple hosts that execute the service containers of the service path.

[0046] In some embodiments, the service forwarding element 160 performs an L2 matching operation with an L2 MAC redirect action operation to forward the data message to a different service container in the service path. In other embodiments, the service forwarding element performs its matching operation using a service path identifier (which identifies the service path), as further described below.

[0047] Figure 1It is illustrated that service classifier 155 selects two different service paths 142 and 144 for two different data message flows 146 and 148, and service forwarding element 160 forwards these data message flows along the service containers in each path. The service forwarding element forwards data message flow 146 along service containers SC1, SC2, and SC3 for service path 142, while forwarding data message flow 148 along service containers SC4 and SC5 for service path 144. The service forwarding element then forwards these two data message flows out of SDDC 100. Once the data message is processed by the service container of the service chain, in some embodiments, the service forwarding element may also forward the data message to another host computer or another machine, an application or middlebox service operating on the same host computer or a different host computer in the SDDC.

[0048] Figure 2 How some embodiments implement service forwarding elements and service classifiers in the Linux OS 230 of the host computer is illustrated. As shown, in some embodiments, the service classifier 155 is implemented as a hook function in the inlet side virtual interface endpoint 204 (e.g., Ethernet port) of the Linux OS 230. In some embodiments, this port 204 is used as an interface with the network interface controller (NIC) of the host computer. In some embodiments, the service forwarding element 160 is partially implemented by the Linux bridge 240 in its root namespace 215, and in another part by the virtual interface endpoint 206 (e.g., Ethernet port) of the service container 235 and the hook function in the virtual interface endpoint 208 defined in the Linux namespace.

[0049] Figure 3 The diagram illustrates a process 300 performed by the service classifier 155 in some embodiments. The classifier performs this process each time it receives a data message. To perform this process, the service classifier 155 interacts with several other modules executing on its host computer. Figure 4 As shown in , in some embodiments, these other modules include a container selector 404 and an SPI generator 406.

[0050] As shown, process 300 begins (at 305) when service classifier 155 receives a data message to be processed. At 310, service classifier 155 determines whether service classifier 155 has previously processed another data message in the same flow as the received data message. If so, it transitions to 330 to pass the received data message to a first service container identified by a record previously created by the service classifier for the flow that was processed and stored in connection tracker 410, as described further below.

[0051] In some embodiments, records previously created in the connection tracker may be used for related flows in the reverse direction. Specifically, in some embodiments, records created by the service classifier for a first data message flow in a first direction (e.g., a flow leaving the SDDC) are used by the service classifier to process a second data message flow in a second direction (e.g., a flow entering the SDDC) that is received in response to the first data message flow, as further described below.

[0052] The service classifier does this so that the second flow in the reverse direction is processed using the same service path (e.g., the same set of service containers) as it did for the initial first flow. In these embodiments, the connection tracker record is used for bidirectional flows, not just for unidirectional flows. In other embodiments, the service classifier creates two records when processing the first data message flow, one for the forward direction and the other for the reverse direction, because the connection tracker records for the forward and reverse directions are related but not identical.

[0053] When the service classifier 155 determines (at 310) that it has not previously processed another data message in the same flow as the received data message, it performs (at 315) a classification operation using a set of attributes of the received data message (e.g., its header values) to identify a service chain identifier for the service chain that must be performed on the flow of the data message. In some embodiments, the set of attributes of the data message used for the classification matching operation is a five-tuple identifier of the data message flow (e.g., source and destination IPs, source and destination ports, and protocol), or a seven-tuple identifier thereof (i.e., its five-tuple identifier plus source and destination MAC addresses).

[0054] Figure 4 The service classifier 155 is shown performing its service classification operation by referring to the service classification rules 450 stored in the classification rule storage 455. As shown, each classification rule includes a match tuple 457 and an action tuple 459. The match tuple includes one or more header values ​​(e.g., a five-tuple or seven-tuple identifier), while the action tuple 459 includes a service chain identifier (SCI).

[0055] After matching the attribute set of the data message with the match tuple 457 of the service classification rule 450, the service container 155 retrieves (at 320) the SCI from the action tuple 459 of the matched service classification rule and uses the retrieved SCI to identify a record 465 in the SCI attribute store 460. Each record 465 in the SCI attribute store associates the SCI with an ordered list 444 of services of the service chain identified by the SCI and a list 446 of container selectors 404 for selecting containers that execute services in the chain.

[0056] At 320, in some embodiments, the service classifier 155 selects a service container for each service specified in the identified SCI record 465 in the storage device 460 by using the container selector 404 specified for the service in the identified SCI record. When there are multiple candidate service containers for executing a service, in some embodiments, the specified container selector for the service performs a load balancing operation to select a particular candidate service container for the received data message flow.

[0057] In some embodiments, this load balancing operation uses statistical information about the data messages processed by each candidate service container (which is stored in the container statistics storage device 424) to select the particular service container. As further described below, each time a data message is processed, the service classifier updates the statistical information for the container associated with the service path. In some embodiments, the load balancing operation of the container selector is designed to evenly distribute the message load across the candidate service containers, or unevenly distribute the data message load based on a weighted distribution scheme.

[0058] Moreover, in some embodiments, the container selectors for different services in a service chain work together to select containers in a service path, for example, in the following embodiments, i.e., the selection of a first service container for a first service in a service path necessarily necessitates the selection of a second service container for a second service in the service path. In some embodiments, this is also the case when a service container cannot be part of two different service paths (i.e., when two service paths cannot overlap).

[0059] Some embodiments group containers into pods, each pod including one or more service containers that are ensured to be co-located on the same host computer. In some embodiments, each pod is implemented by a virtual machine. In some embodiments, two or more of the service containers for a service path (e.g., all service containers for a service path) are in the same pod, and the two or more pods are candidates for implementing the same service chain. In some of these embodiments, the container selector 404 is a load balancing pod selector that selects a pod from several pods that are candidates for implementing the service path of the service chain identified by the service classifier 155.

[0060] Next, at 325, the service classifier generates an SPI for the service path specified by the container selected at 320, and stores the generated SPI in the connection tracker 410 for the flow identifier (e.g., its five-tuple or seven-tuple identifier) ​​of the received data message. To generate the SPI, the service classifier uses the SPI generator 406. In some embodiments, the SPI generator 406 uses a set of rules to define the SPI for the service path based on the identifier associated with the container selected at 320. For example, the SPI is defined in some embodiments as a concatenation of the UUIDs (universally unique IDs) of the service path containers. In some embodiments, the UUIDs are concatenated according to the order of the service containers in the service path.

[0061] The service classifier stores (at 325) the generated SPI in the connection tracker 410 for the flow identifier of the received data message so that it can later use this SPI to identify (in the SPI attribute storage 415) the service path for a subsequent data message in the same flow as the currently processed data message. To do this, the service classifier matches the flow ID of the subsequent data message (e.g., its five-tuple or seven-tuple identifier) ​​with the flow ID in the match tuple 492 of the record 494 in the connection tracker 410, and then retrieves the SPI specified by the operation tuple 496 of the record with the matching flow ID.

[0062] As mentioned above, in some embodiments, the service classifier uses the SPI records in the connection tracker 410 to process data messages in the flow that responds to the flow of data messages currently being processed. In some embodiments, the service classifier uses the same SPI records for the forward flow and the reverse flow. In other embodiments, the service classifier creates different connection tracker flows for the forward flow and the reverse flow. Some embodiments use the same SPI for the reverse flow to ensure that both the initial data message flow in the forward direction and the responsive data message flow in the reverse direction are checked by the same set of service containers.

[0063] After storing the record(s) in the connection tracker 410, the service classifier transitions to 330. The process also transitions from 310 to 330 when it determines that it has previously processed a flow of a received data message, identifies the SPI for this flow from the connection tracker, and then uses this SPI to identify a service container for the data message in the service path.

[0064] At 330, the service classifier passes the data message to the service forwarding element for forwarding to the first service container. In some embodiments, the service classifier provides the specified service path identifier to the service forwarding element to use to perform its classification operation to forward the data message of this flow. In other embodiments, the service forwarding element does not use the service path identifier to forward the data message of the specific data message flow, but instead uses a MAC redirection method.

[0065] In some embodiments, the service classifier specifies the destination MAC address of the data message as the MAC address of the first service container and provides the data message to the service forwarding element for forwarding to the first service container. In other embodiments, the service classifier specifies the destination MAC of the data message as a MAC address associated with a service forwarding element that uses the source MAC address of the data message to perform its service forwarding operations, as further described below. In some of these embodiments, the service classifier specifies the source MAC address as a MAC address associated with the beginning of a particular service path, thereby allowing the service forwarding element to identify the first service container for the service path.

[0066] After 330, the service classifier increments the statistics for the service containers in the identified service path. As mentioned above, the service classifier maintains these statistics in the statistics storage device 424. Different statistics are maintained in different embodiments. Examples of such statistics include the number of data messages, the number of bytes in the forwarded payload bytes, etc. Therefore, in some embodiments, the service classifier increments the statistics by incrementing the message count of each service container by one and / or adding the payload size of the processed message to the byte count of each service container in the service path. After 330, the process 300 ends.

[0067] Figure 5 Process 500 is presented, which conceptually illustrates the operation of the service forwarding element 160 in forwarding a data message traversing a service path identified by the service classifier 155. This forwarding operation uses MAC redirection and is implemented in part by the Linux bridge 240 within its root namespace 215, and in another part by hook functions in the service container's virtual interface endpoints (e.g., Ethernet port 206) and interface endpoints defined in the virtual Linux namespace (e.g., Ethernet port 208). These virtual interface endpoints are configured to perform the match-action forwarding operations required to implement MAC redirection forwarding.

[0068] As shown, process 500 begins (at 505) when it receives a data message to be forwarded through a service path. Next, at 510, the process performs a classification operation to identify a virtual interface endpoint of a Linux bridge associated with a first service node. As mentioned above, in some embodiments, the service classifier defines this destination MAC as the destination MAC of the virtual interface endpoint connected to the first service container. In some of these embodiments, the classification operation (at 510) compares the destination MAC of the data message with the matching criteria of a forwarding rule in a lookup table (which associates different destination MAC addresses with different virtual interface endpoint identifiers). Under this approach, the process retrieves an identifier for the next-hop virtual interface endpoint from a forwarding rule that uses the destination MAC of the data message as its matching criteria.

[0069] In other embodiments, process 500 performs classification operations in different ways. For example, in some embodiments, process 500 uses the following three classification operations 525-535, which first identify the direction of the service flow, then use the source MAC of the data message to identify the destination MAC of the first service node, and finally use the identified destination MAC to identify the virtual interface endpoint. In some of these embodiments, the service classifier does not set the destination MAC address of the data message to the MAC address of the first service node, but instead sets this address to the destination MAC address of the bridge.

[0070] Next, the process forwards the data message to the next service container via the identified virtual interface endpoint at 515. The service container performs its service operation (e.g., middlebox service operation, etc.) on the data message and then provides the data message back to the service forwarding element (at 520). In some embodiments, the service container 235, its associated Ethernet port 206, or the associated bridge interface endpoint 208 changes the source MAC address of the data message to a MAC address associated with the service container (e.g., associated with its Ethernet port 206) because the service forwarding element uses the source MAC address to perform the determination of the next hop service.

[0071] Process 500 then performs three classification operations at 525, 530, and 535, which were briefly mentioned above. The first classification operation (at 525) compares the L3 source and / or destination network addresses of the data message to classification rules defined to distinguish egress data messages from ingress data messages. For example, in some embodiments, one classification rule determines whether the source L3 address of the data message is in the CIDR of the SDDC subnet in order to determine whether the data message is part of an upstream flow leaving the subnet, while another classification rule determines whether the destination L3 address of the data message is in the CIDR of the SDDC subnet in order to determine whether the data message is part of a downstream flow entering the subnet.

[0072] In some embodiments, each of these classification rules identifies a different lookup table for performing a second classification operation at 530. Thus, after identifying the direction of the flow of the data message (upstream or downstream) in the first classification operation at 525, the process 500 performs a second lookup at 530 using the lookup table identified by the first classification operation, this time based on the current source MAC address of the data message. In some embodiments, this second classification rule matches the current source MAC address of the data message with the matching criteria (the matching criteria are specified with respect to the source MAC) of a classification rule that provides in its action tuple the destination MAC of the next hop along the service path. The source MAC identifies the previous service node in the service chain for the direction identified at 525 (e.g., in the table identified at 525), and can therefore be used to identify the next service node in the service chain.

[0073] In some embodiments, the second classification operation (at 530) changes the destination MAC address of the data message to the MAC address of the next hop in the service path. When the service path is not yet complete (i.e., the last service container has not yet processed the data message), the next hop in the service path is another service container. On the other hand, when the service path is complete (i.e., when the last service container has processed the data message), the next hop in the service path is an egress destination MAC that has been defined for the service path. In some embodiments, this egress destination MAC is a MAC address associated with a switch or router that forwards the data message to another destination in the SDDC, or a MAC address associated with a gateway that forwards the data message out of the SDDC or SDDC subnet.

[0074] After redefining the destination MAC of the data message at 530, the process performs (at 535) a third classification operation to identify the virtual interface endpoint of the Linux bridge associated with the destination MAC of the data message. In some embodiments, this classification operation compares the destination MAC of the data message to the matching criteria of a forwarding rule in a lookup table that associates different destination MAC addresses with different virtual interface endpoint identifiers. Under this approach, the process retrieves the identifier for the next-hop virtual interface endpoint from a forwarding rule that has the destination MAC of the data message as its matching criteria.

[0075] After 535, process 500 determines (at 540) whether the identified virtual interface endpoint identified at 535 is another service container. When the identified virtual interface endpoint is not another service container, the service path has been completed. In some embodiments, operation 540 is not actually performed by the service forwarding element, but it is included only for the purpose of Figure 5 The end of the service path is indicated in .

[0076] When the identified virtual interface endpoint identified at 535 is another service container, the service path forwarding of process 500 is not yet complete. Therefore, the process returns to 515 to forward the data message to the next service container on the path through its identified virtual interface endpoint. Otherwise, the service path forwarding process 500 ends. As mentioned above, when the service path is complete, the destination MAC address defined in the last iteration through 530 identifies the virtual interface endpoint of the egress port defined for the service path. Therefore, at the end of the service path in these embodiments, the Linux bridge forwards the data message to the virtual interface endpoint, from which the data message will be forwarded to its next destination.

[0077] refer to Figure 2 The following example of a host computer further illustrates the MAC redirection forwarding of the service forwarding element of some embodiments. In this example, the service path includes a service container 235a, followed by a service container 235b for an upstream data message, and two service operations must be performed on the data message on its path out of the SDDC. When the Linux bridge 240 receives this upstream data message, the data message has the destination MAC address of the vethx interface of the bridge because it needs to be processed by the service container 235a first.

[0078] Therefore, the bridge passes the data message to the vethx interface, which in turn forwards it to the service container 235a through the etho interface 206 of the service container 235a. The service container performs its service on the data message and passes it back to the vethx interface through the etho interface. When passing the data message back to the vethx interface, the service container or its associated etho interface specifies the source MAC address of the data message as the source MAC address of the etho interface.

[0079] The vethx interface then performs a first classification operation, which, based on the L3 source address of the data message being in the ingress CIDR, results in a determination that the data message is in the upstream direction. Based on this determination, the vethx interface performs a second classification operation on the upstream lookup table, which matches the current source MAC address with the next-hop forwarding rule that identifies the next-hop destination MAC address. After the vethx interface identifies that the next-hop address is the MAC address of the vethy interface, the bridge provides the data message to the vethy interface. The vethy interface forwards the data message to the service container 235b via the etho interface 206 of the service container 235b. The service container performs its service on the data message and passes it back to the vethy interface via the etho interface. Once again, the source MAC address of the data message is changed to the source MAC address of the etho interface of the service container 235b.

[0080] The vethy interface then performs a first classification operation that results in a determination that the data message is in an upstream direction based on the L3 source address of the data message being in the ingress CIDR. Based on this determination, the vethy interface performs a second classification operation on an upstream lookup table that matches the current source MAC address with a next-hop forwarding rule that identifies the destination MAC address of the next hop. In this case, the next-hop address is the egress L2 address of the bridge. Therefore, after the vethy interface identifies that the next-hop address is the egress MAC address of the bridge, the bridge provides the data message to its egress interface for forwarding out of the host computer.

[0081] In other embodiments, service forwarding element 160 uses other forwarding methods.For example, in some embodiments, service forwarding element uses SPI and current hop count (hop count) of the service path for identification to perform its forwarding operation.In certain embodiments, SPI and current hop count are values ​​that service classifier creates and is stored on host computer initially.For each service jump, service forwarding element compares SPI and current hop count with the matching criteria of next hop forwarding rule, and these forwarding rules have operation tuples, and these operation tuples provide the virtual endpoint interface identifier of the virtual interface that is connected to next hop.When service forwarding element forwards data message to pass through its service jump in succession, it adjusts (for example, decrements) its current hop count, to correspond with the next service container position in the service path.

[0082] In some embodiments, when the service containers are executed on different host computers and / or in different data centers, the service forwarding element uses an SPI / hop count approach. In some such embodiments, the SPI / hop count information is embedded in a tunnel header that encapsulates the data message as it is forwarded between different host computers and / or different data centers.

[0083] As mentioned above, in some embodiments, the SDDC 100 has several host computers that execute a set of service containers to perform the same service chain on data message streams received in the data center. In some such embodiments, the host computers only execute service containers that implement operations associated with the service chain, and do not execute any other data computing end nodes (i.e., any other containers or virtual machines that are source or destination machines for data message streams). Therefore, these host computers will be referred to as service host computers hereinafter. In these embodiments, the machines that are computing end nodes are executed by other host computers in the SDDC 1000.

[0084] In some embodiments, service classification, forwarding, and operation are distributed among these service host computers to distribute service load and provide fault tolerance in the event of failure of one or more service host computers. A collection of one or more front-end forwarding elements (e.g., load balancers) randomly or deterministically distributes data message streams to these service host computers, which then perform service classification operations on the data message streams they receive to determine whether they should service process the data message streams or redirect the data message streams to other service hosts for service processing.

[0085] Figure 6 and Figure 7An example of three service host computers 605, 607, and 609 performing the distributed service classification and forwarding operations of some embodiments is illustrated. In some embodiments, each of these service hosts executes two service container clusters to execute two different services. Each cluster in this example includes more than one container. Fig. 9 As further described, service classification and forwarding operations are distributed among service hosts 605, 607, and 609, such that these computers implement the same service classification and forwarding operations (eg, process the same service classification and forwarding rules) for similar service containers executed on them.

[0086] exist Figure 6 and Figure 7 In the example of , a top-of-rack (TOR) switch 615 selects a first service host computer 605 to process two different data message flows as part of its performance of load balancing operations (to distribute the load across different host computers executing service containers that perform service operations). This TOR is part of a cluster of two or more TORs that perform such front-end load balancing operations for a cluster 680 of three service host computers 605, 607, and 609. These front-end load balancing operations are deterministic in some embodiments (e.g., based on flow identifier hashing and hash table lookups) and random in other embodiments.

[0087] Figure 6 It is illustrated that upon receiving a first data message stream 622, the virtual interface endpoint 612 of the Linux OS 614 of the first service host computer 605 passes the data message to the service classifier 655, which has been registered as a hook in the XDP (fast data path) callback mechanism of this OS. The service classifier 655 of the first service host computer 605 uses the attribute set of the stream (e.g., a five-tuple or seven-tuple identifier) ​​to perform a first service classification operation, which identifies a first service chain that specifies a set of services to be performed on the data message.

[0088] Based on the identifier of the first service chain, the service classifier of the first service host computer determines that the service container executing on the first host 605 must perform a set of services of the first service chain on the first data message flow 622. For example, in some embodiments, the service classifier calculates a hash value based on the service chain identifier and then looks up this hash value in a hash lookup table that associates hash ranges with different service host computer identifiers. Some embodiments calculate the hash value based on other parameters in combination with or in place of the service chain identifier. Examples of such other parameters include source network address (e.g., source IP address), source port, SPI, etc.

[0089] After its hash lookup identifies the first host computer 605 as the service host computer that should process the received data message stream, the service classifier 655 of the first service host computer 605 selects the service containers 632 and 634 on the first host computer to implement a service path that performs the services in the identified service chain. The service classifier then hands over the data message stream 622 to the service forwarding element 642 executing on the first host computer 605 to sequentially forward the data messages of the first data message stream to the two identified service containers 632 and 634 on the first host computer 605 so that these service containers can perform their service operations on the data messages. After service processing, the data messages are forwarded to their next hop destinations (e.g., to the destinations identified by their original layer 3 and layer 4 header values).

[0090] Figure 7 The processing of the second data message stream 724 is illustrated, and the TOR 615 also initially forwards the second data message stream 724 to the first service host computer 605. After receiving the data message of the second data message stream 724 at the virtual interface endpoint 612, the data message is again forwarded to the service classifier 655 because it is registered as a hook function for this interface. The service classifier 655 then uses the attribute set of the stream (e.g., a five-tuple or seven-tuple identifier) ​​to perform a second service classification operation, which identifies a second service chain, and the second service chain specifies a second set of services to be performed on the data message.

[0091] Based on the identifier of the second service chain, the first host computer 605 determines that the service container on the second host computer 607 must perform a second set of services for the second data message flow 724. Again, in some embodiments, the service classifier calculates a hash value based on the service chain identifier and / or other parameters (such as source IP address, source port address, SPI, etc.), and then looks up this hash value in a hash lookup table that associates hash ranges with different service host computer identifiers. Figure 7 The hash lookup in identifies the second host computer 607 as the serving host computer that should process the received data message stream.

[0092] Therefore, in Figure 7 , the service classifier 655 hands the data message of the second flow 724 back to the virtual interface endpoint 612 for forwarding to the second host computer 607. Once the data message of the second flow is received at this virtual interface endpoint on the second host, it is passed to the service classifier 755 executing on this host, which then performs a classification operation to identify the identifier of the second service chain for this data message.

[0093] Based on the identifier of the second service chain (e.g., a hash of this identifier), the service classifier 755 on the second host computer 607 determines that the service container on the second host computer 607 must perform a second set of services on the received data message and its flow 724. The service classifier then identifies two service containers 736 and 738 on its host that must implement a service path that performs the services in the identified service chain. It then hands over the received data message of the second flow 724 to the service forwarding element 742 executing on the second host 607 to be sequentially forwarded to each of the two service containers 736 and 738 on the second host 607 so that these service containers can perform their service operations on the data messages. After service processing, the data messages are forwarded to their next hop destinations (e.g., to the destinations identified by their original layer 3 and layer 4 header values).

[0094] Figure 8 The process 800 that each service host computer (e.g., computer 605, 607, and 609) performs in some embodiments is illustrated to perform a service operation on a received data message stream, or redirect the data message to another service host computer for service processing. As shown, the process 800 begins (at 805) when the service classifier 155 of the service host computer receives a data message to be processed from the virtual interface endpoint 612 of its OS. The process then performs a classification operation (at 810) that matches the attribute set of the received data message (e.g., its five-tuple or seven-tuple identifier) ​​with the matching criteria of the service classification rule and retrieves the SCI from the action tuple of the matched rule.

[0095] The service classifier then uses (at 815) the retrieved SCI to determine whether the service container executing on its host computer should perform the service operation of the service chain identified by the SCI. To this end, in some embodiments, the service classifier calculates a hash value based on the SCI and one or more other parameters associated with the data message or the identified service chain (e.g., source IP address, source port, SPI, etc.), and then looks up this hash value in a hash lookup table that associates hash ranges with different service host computer identifiers. In some embodiments, when a service host computer fails, the hash range associated with the service host computer is automatically assigned to one or more other service host computers, which allows the service classification and forwarding operations of the service host computer to be fault-tolerant.

[0096] When the service classifier determines (at 815) that the service container of its host should perform the service operation of the identified service chain, the service classifier performs (at 825) operations 320-335 of process 300. On the other hand, when it determines (at 815) that the service container of another host should perform the service operation of the identified service chain, the service classifier hands the data message back to the virtual interface endpoint of its host OS for forwarding to the other host computer (at 820). After 820 and 825, process 800 ends.

[0097] In some embodiments, the process 800 configures one or more front-end forwarding elements (e.g., front-end load balancing TOR 615) each time a classification operation is performed on a new data message flow. Specifically, after performing its classification operation at 810, the process 800 sends an in-band or out-of-band data message (sending the message via a data path or via a control path) that associates the flow identifier (e.g., a five-tuple or seven-tuple identifier) ​​of the data message with the identifier of the service host computer that performs the service chain on the data message flow identified by the process (at 810). The front-end forwarding element that receives such a message creates a record in its connection tracker that associates the received flow identifier with the received host identifier, and then uses this record to process subsequent data messages in the flow that it receives after creating the record.

[0098] Fig. 9 Further illustration Figure 6 and Figure 7 A distributed service chain classification and forwarding architecture is provided. The architecture eliminates separate service chain classifiers and service forwarding elements by replacing them with distributed service classification logic and forwarding on service host computers 605, 607, and 609 that execute service containers (e.g., service containers that implement VNFs in 5G telecommunications networks). The service host computers are also referred to as backend servers in this document.

[0099] As shown, the server set 110 provides the same set of service classification rules and service forwarding rules to each of the service host computers 605, 607 and 609, and configures the virtual interface endpoints on these computers to use these rules. By providing the same set of service classification rules and forwarding rules to each of these service host computers, the server set configures these host computers to implement distributed service classification and forwarding operations, such as Fig. 99 and 909. These classification and forwarding operations are distributed because they are performed identically on the service host computers 605, 607, and 609 based on identical sets of classification and forwarding rules on the service host computers 605, 607, and 609.

[0100] In some embodiments, each service host computer (backend server) obtains from server set 110: (1) a service classification rule that associates a flow identifier with a service chain identifier, (2) a list of service identifiers for each service chain identifier, (3) a list of container identifiers that identify service containers that are candidates for implementing each service identified on the list of service identifiers, (4) a MAC address for each service container identified on the list of container identifiers, (5) a list of other service host computers for receiving redirected data message flow traffic, (6) a MAC address for each of these other service host computers, (7) a hash function for generating a hash value for a received data message, and (8) a hash lookup table that associates the hash value with an identifier of the service host computer.

[0101] In some embodiments, the server set 110 collects statistics generated by the service classifier 955 on the service host computer. In some embodiments, these statistics are pushed (published) from the service host computer to the server set, and they are pulled (retrieved) from the service host computer by the server set 110. The server set analyzes these statistics and based on this analysis, adds or removes service host computers to clusters that execute one or more service chains. Moreover, in some embodiments, the server set deploys and configures multiple clusters of service host computers and uses different service host computer clusters for different sets of service chains. In some such embodiments, the server set can move a service chain from one service host computer cluster to another service host computer cluster.

[0102] The service classifier of some embodiments selects all service containers for the service chain to be located on the host of the service classifier. In other embodiments, different service containers for the service chain can be operated on different host computers. Among some of these embodiments, different service containers can be executed on host computers in different data centers. In order to facilitate forwarding data messages between different data centers for service processing, some embodiments deploy a service forwarding agent in the data center. In some embodiments, the service agent is another service node in the service chain, and the operation of the service agent involves forwarding the data message to another service agent in a subsequent data center or receiving the data message from another service agent in a previous data center.

[0103] Fig.10 An example illustrating the use of such a service forwarding proxy is presented. Specifically, this figure illustrates a logical view 1005 of a service chain executed by two service containers 1020 and 1022. It also illustrates a multi-cloud implementation 1010 of the service chain, wherein a first service container 1020 executes on a first service host computer 1030 in a first data center 1040, and a second service container 1022 executes on a second service host computer 1032 in a second data center 1042. As further described below, this multi-cloud implementation 1010 uses service forwarding proxies 1050 and 1052 in the first and second data centers 1040 and 1042 to pass data messages from the first service container 1020 in the first data center 1040 to the second service container 1022 in the second data center 1042.

[0104] exist Fig.10 In the example of , service processing of data message 1056 begins in first data center 1040 and ends in second data center 1042. In the first data center, service classifier 1090 executed on first service host computer 1030 identifies the service chain for the data message and the service container that implements the service chain. It then generates an SPI that identifies the service path including the identified service container, and then stores the SPI in the memory of the first host computer for later use by service agent 1050.

[0105] After the service classifier 1090 identifies the service path, it then passes the data message to the first service container 1020 through the service forwarding element 1070 executed on the first host computer 1030. The first service container 1020 then performs its operations and passes the message back to the service forwarding element 1070. Based on its forwarding rules, the service forwarding element then determines that the next service node in the service chain is the service forwarding agent 1050 for forwarding the data message to another data center. In some embodiments, the service forwarding agent is implemented as a container. In other embodiments, the service forwarding agent is implemented as a function in the OS (just like the service classifier and the service forwarding element), and the service forwarding element passes the data message to the service forwarding agent through a shared memory.

[0106] The service forwarding agent 1050 then encapsulates the data message with an encapsulation header and stores a service path identifier (SPI) identifying the service path for the second data center. In some embodiments, this SPI is a globally unique SPI that uniquely identifies the service path in each data center that has a service container on the service path. Fig.10 In the example of , the SPI uniquely identifies the service path in the first and second data centers 1040 and 1042.

[0107] In some embodiments, the service forwarding agent 1050 performs one or more classification operations to identify the global SPI and destination address for the service forwarding agent 1052 in the subsequent data center 1042. The service forwarding agent 1050 encapsulates the data message with an encapsulation header that includes the global SPI and the network address of the service forwarding agent 1052 (e.g., the layer 3 network address of the agent 1052), and then passes the data message to the intermediate network for forwarding to the service forwarding agent 1052.

[0108] In some embodiments, the globally unique SPI includes a UUID (unique universal identifier) ​​for each service and a data center ID for each service UUID. In some embodiments, the globally unique SPI is generated by the service classifier 1090 of the first data center 1040. In other embodiments, the service classifier 1090 generates a local SPI for the first data center 1040, and the service forwarding agent 1050 converts this local SPI into a globally unique SPI.

[0109] Using the global SPI, in some embodiments, the service forwarding agent 1050 includes a next service hop identifier in the encapsulation header that identifies the next service or next service container used to process the data message. For example, when the global SPI has a UUID for each service container, in some embodiments, the next service hop identifier is a reference to the service container UUID location in the global SPI, or in other embodiments, the next service hop identifier is set to the UUID of this container. In other embodiments, the service forwarding agent 1050 does not include the next service hop identifier in the encapsulation header.

[0110] After receiving the encapsulated data message, the service forwarding agent 1052 in the second data center 1042 decapsulates the data message (removes the encapsulation header from the data message), extracts the embedded SPI and next hop identifier from the removed header, and uses the SPI and next hop identifier to identify the next hop service container in the service path that should process the data message in the second data center. It then looks up the network address (e.g., MAC address) of the identified service container in the second data center, and then provides the data message to the service forwarding element 1072 executed on the second service host computer 1032 to forward to the service container 1022.

[0111] In other embodiments, the service forwarding agent 1052 does not need a next hop identifier because it is configured to identify the next service node in the service chain based on the global SPI it extracts from the encapsulation header. In some of these embodiments, the service forwarding agent 1052 performs a classification operation based on the extracted global SPI to identify the next hop container. In other embodiments, the service forwarding agent 1052 does not use the extracted SPI to identify the next hop service container, but instead passes the SPI (and the next hop identifier (if a next hop identifier is provided)) to the service forwarding element 1072 for identifying the next hop service container. In these embodiments, the service forwarding elements 1070 and 1072 perform their next hop lookups based on the SPI (and the next hop identifier (if a next hop identifier is provided)).

[0112] Once the service container 1022 processes the data message, the service processing of the service path is complete. In some embodiments, the service forwarding element 1072 sets the destination MAC address to identify the virtual interface endpoint of the egress port defined for the service path. For example, at the end of the service path in these embodiments, the Linux bridge forwards the data message to its virtual interface endpoint, from which it will be forwarded to its next destination.

[0113] In some embodiments, the service forwarding agent operates on a different computer than the host service computer that executes the service classifier and / or service container. However, in other embodiments (such as Fig.10 In some embodiments, the service forwarding proxy is implemented in a distributed manner, as is the service classifier and the service forwarding element. Moreover, in some embodiments, multiple service containers on multiple service host computers in a data center implement a portion of the service path. In some such embodiments, when the service path spans multiple data centers and the data message stream must be forwarded to another data center to continue its service processing along the service path, the service forwarding proxy operates on the last service host computer in the data center.

[0114] In some embodiments, a service classifier in a first data center (in which a first service container of a service path operates) identifies all service containers used to implement a service chain, including other service containers in any subsequent data center(s), as described above with reference to Fig.10 However, in other embodiments, the initial service classifier selects only the service container(s) in its own data center, and leaves the selection of the service container(s) in the other data center(s) to the service classifier(s) in the subsequent data center(s).

[0115] exist Fig.10 In the figure, each data center is shown as including a service container that performs one service operation of a very simple service chain. In other embodiments, the service chain can be much larger. For example, in some embodiments, before the data message is forwarded to another data center, multiple service containers in one data center (e.g., in a first data center) perform multiple service operations of the service chain on the data message. Then, one or more service containers in the other data center can perform one or more service operations on the data message, and then forward the data message to another data center for further service processing of the service chain. Each time a data message is passed from one data center to another, in some embodiments, it is encapsulated with a global SPI (and a next hop identifier if a next hop identifier is used) to allow the new data center to identify the service path and the next service container in the service path.

[0116] Fig.11 Additional properties of the service forwarding proxy in some embodiments are illustrated. As shown, in some embodiments, two service forwarding proxies in two data centers (e.g., proxies 1050 and 1052 in data centers 1040 and 1042) can be used to forward many data message streams between the two data centers for service processing. Moreover, in some embodiments, the service forwarding proxy in the data center can forward data messages to multiple other service forwarding proxies in multiple other data centers, and receive data messages from the multiple other service forwarding proxies, thereby realizing service chains across different data center sets.

[0117] For example, the service forwarding agent 1050 in the data center 1040 encapsulates and forwards the data message stream to the service forwarding agent 1052 in the data center 1042, and encapsulates and forwards the data message stream to the service forwarding agent 1114 in the data center 1124. The service forwarding agent 1050 in the data center 1040 also receives and decapsulates the data message stream from the service forwarding agent 1052 in the data center 1042, and receives and decapsulates the data message stream from the service forwarding agent 1114 in the data center 1124.

[0118] like Fig.11 As shown in , in some embodiments, each service forwarding agent includes (1) a forwarding agent 1130 for encapsulating a data message and sending the encapsulated data message to another service forwarding agent in another data center, and (2) a receiving agent 1132 for receiving the encapsulated data message from another service forwarding agent in another data center and decapsulating the received data message for processing in its data center.

[0119] Fig.12A process 1200 conceptually illustrating the use of service containers in different data centers to perform services associated with a service chain on a data message is presented. As shown, the process 1200 begins (at 1205) when a host computer receives a data message to be processed by a service. In some embodiments, this data message is forwarded to a service host computer (e.g., forwarded from a front-end load balancer), while in other embodiments, the data message is generated by a machine (e.g., a container or a virtual machine) executing on the host computer.

[0120] Next, at 1210, the service classifier 155 executing on the host computer performs a service classification operation to identify (1) a service chain for the data message, (2) a service path that implements the service chain, and (3) an SPI that identifies the service path. In some embodiments, the service classifier 155 performs the following steps: Figure 3 300 to perform this operation. Moreover, in some embodiments, the SPI specified by the service classifier is a globally unique SPI across data centers, while in other embodiments, it is a local SPI that is converted to a global SPI by the service forwarding agent at a later stage. In some embodiments, the service classifier stores the specified SPI (at 1210) in its host computer memory for later use by its associated service forwarding element and / or service forwarding agent, as further described below.

[0121] for Fig.12 In the embodiment shown in , the classification operation (at 1210) specifies the destination MAC address of the data message as the MAC address of the first service container, and provides this data message to the service forwarding element executing on its host computer for forwarding to the first service container. As mentioned above, in some embodiments, the service classifier specifies the destination MAC address of the data message as the MAC address of the service forwarding element because, in these embodiments, the service forwarding element performs its service forwarding based on the source MAC of the data message. In some embodiments, the service classifier also specifies the source MAC address as the MAC address associated with the beginning of a particular service path to allow the service forwarding element to identify the first service container for the service path.

[0122] In some embodiments, the service classifier provides a specified service path identifier to a service forwarding element to use to perform its classification operation to forward the data message of this flow. In some of these embodiments, the service classifier provides a next-hop service index (which identifies the next service to be performed in the service path) that the service forwarding element uses to (1) perform its next-hop determination and (2) make adjustments (e.g., decrements) when passing the data message to the service container to perform its subsequent next-hop determination.

[0123] At 1215, the service forwarding element performs a classification operation to identify a virtual interface endpoint of a Linux bridge associated with the next service node. In some embodiments, the classification operation (at 1215) compares the destination MAC of the data message to the matching criteria of a forwarding rule in a lookup table that associates different destination MAC addresses with different virtual interface endpoint identifiers. Under this approach, the process retrieves the identifier for the next hop virtual interface endpoint from a forwarding rule that has the destination MAC of the data message as its matching criteria.

[0124] In other embodiments, process 1200 performs the classification operation (at 1215) in a different manner. For example, in some embodiments, process 1200 uses the above three classification operations 525-535 of process 500, which first identify the direction of the service flow, then use the source MAC of the data message to identify the destination MAC of the next service node, and finally use the identified destination MAC to identify the virtual interface endpoint.

[0125] After identifying the virtual interface endpoint connected to the next service container, the service forwarding element forwards the data message to this service container through the identified virtual interface endpoint (at 1215). The service container performs its service operation (e.g., middlebox service operation, etc.) on the data message and then provides the data message back to the service forwarding element (at 1220). In some embodiments, the service container, its associated Ethernet port 206, or the associated bridge interface endpoint 208 changes the source MAC address of the data message to a MAC address associated with the service container (e.g., associated with its Ethernet port 206) because the service forwarding element uses the source MAC address to perform its next hop service determination.

[0126] The service forwarding element then performs (at 1225) a set of classification operations. A first classification operation compares the L3 source and destination network addresses of the data message to classification rules (which are defined to distinguish egress data messages from ingress data messages). As described above, in some embodiments, each of these classification rules identifies a different lookup table for performing a second classification operation.

[0127] After identifying the direction of the flow of the data message (upstream or downstream) in the first classification operation, the service forwarding element uses the lookup table identified by the first classification operation to perform a second classification operation, this time based on the current source MAC address of the data message. This second classification operation matches the current source MAC address of the data message with the matching criteria of the classification rule (the matching criteria are specified with respect to the source MAC), and the classification rule provides a next hop identifier in its action tuple, which the process can use at 1230 to determine whether the next hop is in the current data center or another data center.

[0128] In some embodiments, this next hop identifier is the destination MAC of the next hop (e.g., the next service node along the service path, or the egress port defined for the service path). In other embodiments, the next hop identifier includes a data center identifier that identifies the data center of the next hop service node along the service path. In still other embodiments, the next hop identifier takes a different form.

[0129] After the classification operation at 1225, process 1200 determines (at 1230) whether the next hop service node is in the same data center. If so, the process performs (at 1232) a set of one or more classification operations to define the destination MAC address of the data message as the MAC address of the next hop service node (e.g., service container) and identify a virtual interface endpoint for this new destination MAC address. In some embodiments, this classification operation compares the identified next hop destination MAC to the matching criteria of a forwarding rule in a lookup table that associates different destination MAC addresses with different virtual interface endpoint identifiers. Under this approach, the process retrieves an identifier for the next hop virtual interface endpoint from a forwarding rule that has the destination MAC of the data message as its matching criteria.

[0130] Next, at 1235, the process determines whether the service path has been completed. If not, the process forwards the data message to the next service node (e.g., the next service container) (at 1237) and then transitions to 1220. When the process 1200 determines (at 1235) that the service path has been completed, the process 1200 ends. When the service path is completed, the destination MAC address defined in the previous iteration through 1232 is the egress destination MAC that has been defined for the service path.

[0131] In some embodiments, this egress destination MAC is a MAC associated with a switch or router that forwards the data message to its next destination (e.g., another destination in or outside the SDDC, or to a gateway that forwards the data message out of the SDDC). In some embodiments, the egress destination MAC identifies the egress virtual interface endpoint defined for the service path. Thus, in these embodiments, at the end of the service path, the Linux bridge forwards the data message to the virtual interface endpoint, from which the data message will be forwarded to its next destination. In some embodiments, operations 1230 and 1235 are not actually performed by the service forwarding element, but are included here merely to illustrate the end of a service path in a data center or the final end of a service path.

[0132] When the process (at 1230) determines that the next service node is in another data center, the service forwarding element (at 1240) provides the data message to a service forwarding agent (e.g., an agent on the same host computer as the service forwarding element). This determination is made in different ways in different embodiments. For example, in some embodiments, when the next hop destination MAC specified at 1225 belongs to a virtual interface endpoint of a bridge associated with the service forwarding agent, the process determines that the next service node is in another data center. In other embodiments, the next hop lookup at 1225 provides another identifier that specifies that the next hop service node is in another data center.

[0133] Next, at 1245, the service forwarding agent performs a classification operation based on the header value of the received data message (e.g., all or part of the seven-tuple identifier of the data message) to identify a globally unique SPI that identifies the service path for the next data center. As mentioned above, in some embodiments, the globally unique SPI is generated by the service classifier of the first data center. In other embodiments, the service classifier generates a local SPI for the first data center, and the service forwarding agent converts this local SPI into a globally unique SPI.

[0134] Using the global SPI, in some embodiments, the service forwarding agent (at 1245) identifies a service hop identifier that identifies the next service or next service container to process the data message. For example, when the global SPI has a UUID for each service container, in some embodiments, the next service hop identifier is a reference to the next service container UUID in the global SPI, or in other embodiments, the next service hop identifier is set to the UUID of this container. The classification operation of the agent at 1245, or another classification operation performed by the agent at 1245, provides the network address of the service forwarding agent at the next data center.

[0135] At 1250, the service forwarding agent utilizes an encapsulation header to encapsulate the data message, and the identified global SPI is stored in this header. In an embodiment using a service hop identifier, the service forwarding agent also includes the service hop identifier in the encapsulation header (at 1250). Then, it forwards the encapsulated data message to the service forwarding agent of the next data center (at 1250). In some embodiments, the encapsulation header is a tunnel header, which is associated with a tunnel established between two service forwarding agents (e.g., between virtual interfaces executed on a host computer executing the service forwarding agent). This tunnel header allows data messages to pass through an intermediate network architecture (e.g., an intermediate router and switch) to reach other service forwarding agents.

[0136] At 1255, upon receiving the encapsulated data message, the service forwarding agent in the other data center (referred to as the new data center) decapsulates the data message (removes the encapsulation header from the data message), extracts the embedded SPI (and the next hop identifier, if included), and uses the extracted parameters (e.g., SPI) to identify the next hop service container in the service path that should process the data message in the second data center.

[0137] It then looks up (at 1255) the network address (e.g., MAC address) of the identified service container in the second data center, and then provides (at 1215) the data message to the service forwarding element executing on its host computer for forwarding to the service container associated with this network address. Once the service forwarding element receives the data message, process 1200 repeats its operations starting at 1215.

[0138] In other embodiments, process 1200 performs its operations differently at 1255. For example, in some embodiments, the service forwarding agent (at 1255) specifies the destination MAC address of the data message as the MAC address of the service forwarding element because, in these embodiments, the service forwarding element performs its service forwarding based on the source MAC of the data message. In some of these embodiments, the service forwarding agent (at 1255) specifies the source MAC address as the MAC address associated with the beginning of a particular service path to allow the service forwarding element to identify the first service container for the service path.

[0139] In still other embodiments, instead of using the SPI to identify the next-hop service container, the service forwarding agent in the new data center passes the SPI (and the next-hop identifier (when included)) to its associated service forwarding element to be used to identify the next-hop service container. In these embodiments, the service forwarding elements perform their next-hop lookups based on the SPI and the next-hop identifier. When the service path spans more than two data centers, process 1200 will loop through 1240-1255 multiple times, each time transitioning to a new data center.

[0140] Many of the above features and applications are implemented as software processes, which are specified as sets of instructions recorded on a computer-readable storage medium (also referred to as a computer-readable medium). When these instructions are executed by one or more processing units (e.g., one or more processors, cores of a processor, or other processing units), they cause the (one or more) processing units to perform the actions indicated in the instructions. Examples of computer-readable media include, but are not limited to, CD-ROMs, flash drives, RAM chips, hard drives, EPROMs, etc. Computer-readable media do not include carrier waves and electronic signals transmitted over wireless or wired connections.

[0141] In this specification, the term "software" refers to firmware residing in a read-only memory or an application stored in magnetic storage that can be read into a memory for processing by a processor. In addition, in some embodiments, multiple software inventions can be implemented as sub-parts of a larger program while maintaining different software inventions. In some embodiments, multiple software inventions can also be implemented as separate programs. Finally, any combination of separate programs that implement the software inventions described herein together is within the scope of the present invention. In some embodiments, when a software program is installed to operate on one or more electronic systems, the software program defines one or more specific machine implementations that perform the operations of the software program.

[0142] Fig.13 A computer system 1300 is conceptually shown that implements some embodiments of the present invention. The computer system 1300 can be used to implement any of the above-described hosts, controllers, and managers. Thus, it can be used to perform any of the above-described processes. The computer system includes various types of non-transitory machine-readable media and interfaces for various other types of machine-readable media. The computer system 1300 includes a bus 1305, (one or more) processing units 1310, a system memory 1325, a read-only memory 1330, a permanent storage device 1335, an input device 1340, and an output device 1345.

[0143] Bus 1305 collectively represents all system, peripheral, and chipset buses that communicatively connect the numerous internal devices of computer system 1300. For example, bus 1305 communicatively connects processing unit(s) 1310 with read-only memory 1330, system memory 1325, and permanent storage device 1335.

[0144] From these various memory units, the processing unit(s) 1310 retrieves instructions to be executed and data to be processed in order to perform the processes of the present invention. The processing unit(s) may be a single processor or a multi-core processor in different embodiments. Read-only memory (ROM) 1330 stores static data and instructions required by the processing unit(s) 1310 and other modules of the computer system. On the other hand, permanent storage device 1335 is a read and write memory device. This device is a non-volatile storage unit that stores instructions and data even when the computer system 1300 is turned off. Some embodiments of the present invention use a mass storage device (such as a magnetic or optical disk and its corresponding disk drive) as a permanent storage device 1335.

[0145] Other embodiments use removable storage devices (such as floppy disks, flash drives, etc.) as permanent storage devices. Like permanent storage device 1335, system memory 1325 is a read and write memory device. However, unlike storage device 1335, system memory is a volatile read and write memory, such as random access memory. System memory stores some instructions and data that the processor needs at run time. In some embodiments, the processing of the present invention is stored in system memory 1325, permanent storage device 1335, and / or read-only memory 1330. From these various memory units, (one or more) processing unit 1310 retrieves instructions to be executed and data to be processed in order to perform the processing of some embodiments.

[0146] The bus 1305 is also connected to input and output devices 1340 and 1345. Input devices enable a user to communicate information and select commands to the computer system. Input devices 1340 include an alphanumeric keyboard and a pointing device (also known as a "cursor control device"). Output devices 1345 display images generated by the computer system. Output devices include printers and display devices, such as cathode ray tubes (CRTs) or liquid crystal displays (LCDs). Some embodiments include devices such as touch screens that function as both input and output devices.

[0147] Finally, if Fig.13As shown in FIG. 1 , bus 1305 also couples computer system 1300 to a network 1365 via a network adapter (not shown). In this manner, the computer may be part of a network of computers (such as a local area network ("LAN"), a wide area network ("WAN"), or an intranet, or a network such as the Internet), and any or all components of computer system 1300 may be used in conjunction with the present invention.

[0148] Some embodiments include electronic components such as microprocessors, storage devices and memories that store computer program instructions in machine-readable or computer-readable media (alternatively referred to as computer-readable storage media, machine-readable media, or machine-readable storage media). Some examples of such computer-readable media include RAM, ROM, compact disk-read only (CD-ROM), compact disk-recordable (CD-R), compact disk-rewritable (CD-RW), digital versatile disk-read only (e.g., DVD-ROM, dual-layer DVD-ROM), various recordable / rewritable DVDs (e.g., DVD-RAM, DVD-RW, DVD+RW, etc.), flash memory (e.g., SD card, mini SD card, micro SD card, etc.), magnetic and / or solid-state hard drives, read-only and recordable A computer readable medium may store a computer program that is executable by at least one processing unit and includes a set of instructions for performing various operations. Examples of computer programs or computer code include machine code such as produced by a compiler, and files including higher-level code that is executed by a computer, electronic component, or microprocessor using an interpreter.

[0149] Although the above discussion mainly refers to a microprocessor or multi-core processor that executes software, some embodiments are performed by one or more integrated circuits, such as an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA). In some embodiments, such an integrated circuit executes instructions stored on the circuit itself.

[0150] As used in this specification, the terms "computer", "server", "processor", and "memory" all refer to electronic or other technical devices. These terms do not include people or groups of people. For the purposes of this specification, the terms display or being displayed mean displayed on an electronic device. As used in this specification, the terms "computer-readable medium", "multiple computer-readable media" and "machine-readable medium" are completely limited to tangible, physical objects that store information in a form that is readable by a computer. These terms do not include any wireless signals, wired download signals, and any other transient or temporary signals.

[0151] Although the present invention has been described with reference to many specific details, those skilled in the art will recognize that the present invention may be embodied in other specific forms without departing from the spirit of the present invention. For example, instead of selecting a service container to implement a service path, the service classifier of some embodiments selects a service virtual machine to implement a service path. Therefore, those skilled in the art will understand that the present invention is not limited by the above illustrative details, but is defined by the appended claims.

Claims

1. A method for performing a service on a data message, the method comprising: At the service classifier, identifying a service chain for the data message, the service chain comprising a plurality of services to be performed on the data message; identifying, for each service in the identified service chain, a service container for executing the service; as well as forwarding the data message to a service forwarding element to forward the data message through the service container identified for the identified service chain, in: A set of service containers executes on top of the host computer's operating system OS; The operating system OS includes an OS namespace, and the OS namespace is used to perform a match-action forwarding operation; Each service container includes a container namespace; and The service forwarding element is implemented by configuring a virtual interface endpoint in the OS namespace for each service container in the group and by configuring a virtual interface endpoint in the container namespace of each service container.

2. The method of claim 1, wherein: Identifying a service container for each service in the identified service chain includes performing at least one load balancing operation to select a particular service container from a set of two or more candidate service containers for at least one particular service.

3. The method of claim 2, wherein: Performing a load balancing operation includes directing a load balancer designated for the particular service to select a container from the set of candidate service containers for the particular service.

4. The method of claim 2, wherein: Performing the load balancing operation includes selecting a particular container for the data message from the set of containers using statistical information related to the data messages processed by each container in the set of containers.

5. The method of claim 1, wherein: The data message is a first data message, and the method further comprises: associating the first data message with a service path identifier, the service path identifier identifying a container selected to implement the identified service chain for the first data message; The service path identifier is provided to the service forwarding element to be provided to another service classifier to be used to select a service path for a second data message sent in response to the first data message.

6. The method of claim 1, wherein: At least one set of match-action forwarding operations includes: (i) a match classification operation, which compares the layer 2 destination network address of the data message and the layer 3 source or destination network address of the data message with the selection criteria of the forwarding rule, and (ii) an action operation, which modifies the layer 2 destination network address of the data message.

7. The method of claim 1, wherein: The operating system is a Linux operating system, and the namespace of the Linux operating system performs a bridge forwarding operation.

8. The method of claim 1, wherein: Identifying a service chain includes comparing a set of attributes associated with the data message to at least one selection criterion of at least one service-chain identification rule to identify a service-chain identification rule that matches the data message and specifies a service chain for the matching data message.

9. The method of claim 1, wherein The service-chain identification rule that is matched identifies a service-container selector for each service identified by the service-chain identification rule; and Identifying a service container for each service in the identified service chain includes: The service-container selector is directed to select a particular service container from a set of two or more candidate service containers for the service.

10. A machine-readable medium storing a service classification program, the service classification program being executed by at least one processing unit to perform services on data messages traversing a network, the program comprising a set of instructions for: identifying a service chain for the data message, the service chain comprising a plurality of services to be performed on the data message; identifying, for each service in the identified service chain, a service container for executing the service; and forwarding the data message to a service forwarding element to forward the data message through the service container identified for the identified service chain, in: A set of service containers executes on top of the host computer's operating system OS; The operating system OS includes an OS namespace, and the OS namespace is used to perform a match-action forwarding operation; Each service container includes a container namespace; and the service forwarding element is implemented by configuring a virtual interface endpoint in the OS namespace for each service container in the group and by configuring a virtual interface endpoint in the container namespace of each service container.

11. The machine-readable medium of claim 10, wherein: The set of instructions for identifying a service container for each service in the identified service chain includes a set of instructions for performing at least one load balancing operation to select a particular service container from a set of two or more candidate service containers for at least one particular service.

12. The machine-readable medium of claim 11, wherein: The set of instructions for performing a load balancing operation includes a set of instructions for directing a load balancer designated for the particular service to select a container from the set of candidate service containers for the particular service.

13. The machine-readable medium of claim 11, wherein: The set of instructions for performing a load balancing operation includes a set of instructions for selecting a particular container for the data message from the set of containers using statistical information about the data messages processed by each container in the set of containers.

14. The machine-readable medium of claim 10, wherein: The data message is a first data message, and the program further includes an instruction set for: associating the first data message with a service path identifier, the service path identifier identifying a container selected to implement the identified service chain for the first data message; The service path identifier is provided to the service forwarding element to be provided to another service classifier to be used to select a service path for a second data message sent in response to the first data message.

15. The machine-readable medium of claim 10, wherein: At least one set of match-action forwarding operations includes: (i) a match classification operation, which compares the layer 2 destination network address of the data message and the layer 3 source or destination network address of the data message with the selection criteria of the forwarding rule, and (ii) an action operation, which modifies the layer 2 destination network address of the data message.

16. The machine-readable medium of claim 10, wherein: The operating system is a Linux operating system, and the namespace of the Linux operating system performs a bridge forwarding operation.

17. The machine-readable medium of claim 10, wherein: An instruction set for identifying a service chain includes an instruction set for comparing a set of attributes associated with the data message with at least one selection criterion of at least one service-chain identification rule to identify a service-chain identification rule that matches the data message and specifies a service chain for the matching data message.

18. The machine-readable medium of claim 10, wherein The service-chain identification rule that is matched identifies a service-container selector for each service identified by the service-chain identification rule; and The set of instructions for identifying a service container for each service in the identified service chain includes a set of instructions for directing the service-container selector to select a particular service container from a set of two or more candidate service containers for the service.

19. A method for performing a service on a data message, the method comprising: At the service classifier, identifying a service chain for the data message, the service chain comprising a plurality of services to be performed on the data message; and identifying, for each service, a service node for performing each service in the identified service chain, wherein identifying at least one specific service node for at least one specific service comprises: performing a load balancing operation to select the specific service node from a set of two or more candidate service nodes for the specific service; forwarding the data message to a service node identified for a first service in the identified service chain, in: A set of service containers executes on top of the host computer's operating system OS; The operating system OS includes an OS namespace, and the OS namespace is used to perform a match-action forwarding operation; Each service container includes a container namespace; and The service forwarding element is implemented by configuring a virtual interface endpoint in the OS namespace for each service container in the group and by configuring a virtual interface endpoint in the container namespace of each service container.

20. A machine-readable medium storing a service classifier program, the service classifier program being executed by at least one processing unit to perform services on data messages traversing a network, the program comprising a set of instructions for: identifying a service chain for the data message, the service chain comprising a plurality of services to be performed on the data message; Identifying, for each service, a service node for executing each service in the identified service chain, wherein identifying at least one specific service node for at least one specific service comprises: performing a load balancing operation to select a particular service node from a set of two or more candidate service nodes for the particular service; as well as forwarding the data message to a service node identified for a first service in the identified service chain, in: A set of service containers executes on top of the host computer's operating system OS; The operating system OS includes an OS namespace, and the OS namespace is used to perform a match-action forwarding operation; Each service container includes a container namespace; and the service forwarding element is implemented by configuring a virtual interface endpoint in the OS namespace for each service container in the group and by configuring a virtual interface endpoint in the container namespace of each service container.

21. An electronic device comprising: a set of processing units; as well as A machine-readable medium storing a program which, when implemented by at least one of the processing units, implements the method of any one of claims 1-9 and 19.

22. A system comprising means for implementing the method of any one of claims 1-9 and 19.

23. A computer program product comprising instructions which, when executed by a computer, cause the computer to perform the method of any one of claims 1-9 and 19.