Bidirectional Forwarding Detection (BFD) offload in virtual network interface controllers

By offloading the monitoring engine to the VNIC or PNIC and transmitting BFD packets directly through the data path, the problem of BFD packet discarding and processing resource consumption is solved, achieving more accurate connectivity detection and resource saving.

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

Patent Information

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

AI Technical Summary

Technical Problem

Existing connectivity detection protocols (such as BFD) can easily cause BFD packets to be dropped under heavy traffic, leading to false negative fault detection, and the monitoring engine consumes scarce processing resources of the virtualization software.

Method used

Offload the monitoring engine to a virtual network interface card (VNIC) or physical network interface card (PNIC) so that BFD packets pass directly through the VNIC or PNIC data path, reducing processing loops and reducing drop probability, while verifying the status of the application through active channels.

Benefits of technology

The BFD packet processing cycle is shortened, the probability of discarding is reduced, the accuracy of connectivity detection is improved, and processing resources are saved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114303349B_ABST
    Figure CN114303349B_ABST
Patent Text Reader

Abstract

Some embodiments provide a method for monitoring the status of a network connection between a first host computer and a second host computer. In some embodiments, the method is performed by a tunnel monitor executed on the first host computer, which also separately executes a machine, wherein the machine uses a tunnel to send messages to and receive messages from the second host computer. The method establishes an active channel with the machine to iteratively determine whether the first machine is operating normally. The method further establishes a monitoring session with the second host computer to iteratively determine whether the tunnel is operating normally. When it is determined through the active channel that the machine is no longer operating normally, the method terminates the monitoring session with the second host computer. When it is determined that the tunnel is no longer operating normally, the method notifies the machine through the active channel.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0001] In computer networking, connectivity detection protocols (such as Bidirectional Forwarding Detection or BFD) are used to detect connectivity failures between two endpoints at different network layers (e.g., from the physical layer all the way up to the application layer). These protocols generally receive and send control packets divided at small configurable time intervals over the data plane being monitored. Many network function virtualization (NFV) appliances rely on protocols such as BFD for detecting whether an application is operating normally inside a virtual machine (also known as "liveliness detection").

[0002] 1 conceptually illustrates a typical scenario of an application 105 running in a virtual machine (VM) 110, executing on a host computer 115, and using BFD to monitor its network connection with a network endpoint 120 (e.g., at another host computer or a network device). The application 105 runs a BFD engine (which implements a BFD state machine) 125, so when the network connection is operating, a BFD packet 127 must be transported from the network endpoint 120 all the way to the application 105 through a data path channel (e.g., through the host computer's physical network interface card or PNIC 130, a software forwarding element (SFE) 135 that performs switching and routing for all machines implemented by the host's virtualization software (e.g., a hypervisor), and a virtual network interface card or VNIC 140 associated with the VM 110) in order to be successfully detected. Data traffic (not shown) and BFD packets 127 between application 105 and network endpoint 120 traverse a data path through VNIC 140, logical ports of SFE 135 (conceptually depicted as black boxes), and PNIC 130. However, the BFD protocol does not support packet prioritization or quality of service (QoS) to ensure that BFD packets are identified and accelerated through the data path. This means that under heavy traffic, BFD packets 127 may be dropped by any intermediate forwarding devices or NICs 130-140 along the data path between application 105 and network endpoint 120, resulting in false negative fault detections. Furthermore, implementing the monitoring engine at the application level consumes scarce processing resources provided to VM 110 by virtualization software 137. Summary of the invention

[0003] Some embodiments of the present invention provide for offloading processing for a connectivity detection protocol (e.g., bidirectional forwarding detection or BFD) from an application in a VM. The connectivity protocol is implemented by a monitoring engine, which in some embodiments is offloaded to a virtual network interface card (VNIC) of a hypervisor. In other embodiments, the monitoring engine is offloaded to a physical network interface card (PNIC) of a host computer executing the hypervisor. The offloaded monitoring engine establishes a monitoring session on behalf of the application with a network endpoint with which the application is communicating.

[0004] In some embodiments, the monitoring engine establishes a communication channel with the application in order to periodically verify that the application is operating normally (also referred to as an "active channel"). The active channel can be a shared memory, an application programming interface (API), or other communication interface. In some embodiments, the application updates the monitoring engine with its operating status. For example, the monitoring engine periodically receives status messages from the application via the active channel. The monitoring engine then interprets the failure to receive the expected status message within the time interval as an application failure. In other embodiments, the monitoring engine polls the application for its operating status. For example, the monitoring engine periodically queries the application for its status via the active channel. Failure to reply to the query is then interpreted as an application failure. If the monitoring engine determines (e.g., via updating or polling) that the application has failed, the monitoring engine terminates the monitoring session.

[0005] As noted above, the monitoring engine establishes a monitoring session with a network endpoint with which the application is communicating (e.g., exchanging data messages). For example, the network endpoint can be another VM on another host computer. According to the connectivity detection protocol, the monitoring engine periodically exchanges control messages (e.g., monitoring packets) with the network endpoint during the session. In some embodiments, the network endpoint also executes the monitoring engine to send and receive control messages with the first monitoring engine. These control messages are sent over the data plane, in some embodiments, by using the same network connection as the data messages exchanged between the application and the network endpoint. The monitoring engine then interprets the failure to receive the expected control message as a failure in the network connection. If the monitoring engine determines that the monitoring session with the network endpoint has failed, the monitoring engine, in some embodiments, notifies the application via an active channel.

[0006] In some embodiments, the monitoring engine establishes a monitoring session after receiving a set of parameters from the application. In some such embodiments, these parameters are received via an active channel. The monitoring engine uses these parameters to configure the monitoring session. Examples of these parameters include the address of the VM operating the application, the address of the network endpoint, and the frequency of control messages sent over the network connection. The monitoring engine can also update the monitoring session configuration based on instructions received from the application, or terminate the session.

[0007] In some embodiments, the monitoring engine can establish monitoring sessions with multiple network endpoints on behalf of multiple applications. These applications can operate in the same VM or different VMs executed on the host computer. The network endpoints communicating with different applications can be different applications in different VMs on different host computers. These communications can be achieved through multiple network connections.

[0008] The foregoing summary is intended to serve as a brief introduction to some embodiments of the present invention. It is not intended to be an introduction or overview of all the subject matter disclosed in this document. The following specific embodiments and the drawings referenced in the specific embodiments will further describe the embodiments described in the summary and other embodiments. Therefore, in order to understand all the embodiments described in this document, it is necessary to review the summary, the specific embodiments, and the drawings in full. Moreover, the subject matter claimed is not limited by the illustrative details in the summary, the specific embodiments, and the drawings, but is defined by the appended claims, because the subject matter claimed may be implemented in other specific forms without departing from the spirit of the subject matter. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] 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 drawings.

[0010] FIG. 1 conceptually illustrates a prior art scenario of an application running in a virtual machine (VM) using BFD to monitor its network connection.

[0011] Figure 2 A scenario of some embodiments for offloading a BFD monitoring session from an application to a VNIC is conceptually illustrated.

[0012] Figure 3 The memory space of the hypervisor implementing VMs and VNICs of some embodiments is conceptually illustrated.

[0013] Figure 4 Conceptually illustrates the process performed by an application in some embodiments to offload a BFD monitoring session to a VNIC.

[0014] Figure 5 The process performed by a VNIC in some embodiments to establish an offloaded BFD monitoring session with a network endpoint is conceptually illustrated.

[0015] Figure 6 Conceptually illustrates the process of a monitoring engine for managing multiple monitoring sessions.

[0016] Figure 7 An electronic system for implementing an embodiment of the present invention is conceptually illustrated. DETAILED DESCRIPTION

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

[0018] Some embodiments of the present invention provide methods for offloading processing for a connectivity detection protocol from an application in a VM to an underlying hypervisor. The connectivity protocol is implemented by a monitoring engine, which in some embodiments is offloaded to a virtual network interface card (VNIC) of the hypervisor. In other embodiments, the monitoring engine is offloaded to a physical network interface card (PNIC) of a host computer executing the hypervisor. The offloaded monitoring engine establishes a monitoring session on behalf of an application with a network endpoint that the application is communicating with.

[0019] In some embodiments described in more detail below with reference to the figures and processes, the connectivity protocol is a Bidirectional Forwarding Detection (BFD) protocol. Figure 2 Conceptually illustrates offloading the BFD monitoring session from the application to the VNIC in some embodiments. In other embodiments, other connectivity protocols are used.

[0020] like Figure 2 As shown, in some embodiments, an application 205 running in a virtual machine (VM) 210 executed in a hypervisor 211 of a host computer 212 uses BFD to monitor its network connection with a network endpoint 213. In some embodiments, the network endpoint 213 is a tunnel endpoint such as a VLAN or VXLAN implemented by another host computer (e.g., another machine or another forwarding element executed on another host computer).

[0021] The monitoring engine 215 establishes a BFD session 216 with the BFD engine 217 at the network endpoint 213. However, unlike the prior art of FIG. 1 , the monitoring engine 215 (which incorporates the BFD engine and implements the BFD state machine) is executed by the VNIC 220 associated with the VM 210, rather than by the application 205. In some embodiments, the VNIC 220 is a software construct that operates within the memory space of the VM 210. Alternatively or in combination, in some embodiments, the VNIC has a component that operates within the memory space of the hypervisor 211. This is in Figure 2 2 is illustrated visually by depicting VNIC 220 as being partially within VM 210 and partially external to it in hypervisor 211. Figure 3 The memory spaces of the VM 210, hypervisor 211, and VNIC components are described in more detail.

[0022] In some embodiments, the data path between the application 205 and the network endpoint 213 includes the VNIC 220, the software forwarding element (SFE) 225 that performs switching and routing for all machines implemented by the hypervisor 211, and the PNIC 230 of the host computer 212. Data traffic messages (not shown) between the application 205 and the network endpoint 213, and BFD packets 235 between the monitoring engine 215 and the BFD engine 217 at the network endpoint 213, must all traverse the data path through the VNIC 220, the logical ports associated with the SFE 225 (conceptually depicted as black boxes), and the PNIC 230 in both directions. In some embodiments, the network connection between the application 205 and the network endpoint 213 is a tunnel with one tunnel endpoint at the SFE 225 and the other tunnel endpoint at the network endpoint 213.

[0023] As a result of implementing the monitoring engine 215 at the VNIC 220, the BFD packets 235 only need to traverse the data path up to the VNIC 220, rather than being required to be carried all the way to the application 205. BFD operates on top of any data protocol (network layer, link layer, tunnel, etc.) used to exchange data messages between the application 205 and the network endpoint 213. In some embodiments, it operates in unicast, point-to-point mode. The BFD packets 235 can be carried as payloads of any encapsulation protocol (e.g., VXLAN, VLAN, GRE, etc.) suitable for the medium and network. In some embodiments, BFD operates at multiple layers in the system (e.g., TCP / IP layer, or Open Systems Interconnection layer).

[0024] BFD can provide fault detection for any kind of path between systems, including direct physical links, virtual circuits, tunnels, MPLS label switched paths (LSPs), multi-hop routed paths, and unidirectional links (as long as some return path exists). When multiple paths between the same pair of systems exist in at least one direction, multiple BFD sessions can be established between them, even if a smaller number of paths are available in the other direction (e.g., multiple parallel unidirectional links or MPLS LSPs). The BFD protocol is described in more detail in Internet Engineering Task Force (IETF) RFC 5880, entitled "Bidirectional Forwarding Detection (BFD)", which is incorporated herein by reference.

[0025] In some embodiments, the network endpoint 213 is another application running in a different VM on the same host computer 212, or in other embodiments, a VM running on a different host computer (not shown). In some embodiments, the host computer 212 is an edge appliance and the monitoring engine 215 is used for south-north services, where the network endpoint 213 is outside the network. In other embodiments, the monitoring engine can also be used for east-west services within the network. If the host computer 212 executes VMs for different logical routers, then in some embodiments, each logical router has its own BFD session, which needs to be isolated from each other accordingly. The logical context of the BFD session is constrained by the encapsulation of the network connection or link that each BFD session is monitoring.

[0026] In general, because BFD packets are delivered via the data path, they are prone to being dropped due to network congestion. The BFD protocol does not support packet prioritization or quality of service (QoS) to ensure that BFD packets are identified and expedited. The signatures of BFD packets can be analyzed to detect them and apply priority, but as described in more detail in US Patent Publication 2018 / 015790, entitled “Prioritizing Flows in Software Defined Networks,” which is incorporated herein by reference, this requires proprietary hardware support at the PNIC level. For most systems, this solution is not available because computing resources are very limited at the PNIC.

[0027] By offloading the monitoring engine to the VNIC, the round trip of the BFD packets from the VNIC to the application and back (as seen in FIG. 1 of the prior art) is shortened, which saves considerable processing cycles from the VM kernel perspective and reduces the probability of BFD packets being dropped. However, the separation of the application 205 from the monitoring engine 215 introduces the requirement for communication between the application and the VNIC to communicate the operational state (also referred to as "activity") of the application to the monitoring engine, and to communicate the state of the network connection to the application. In some embodiments, the monitoring engine handles this communication by establishing an activity channel 240, as described below with reference to FIG. Figure 3 Described in more detail.

[0028] In some embodiments, VNIC 220 is implemented by virtualization software (eg, hypervisor) 211 executing on host computer 212. In some embodiments, the same hypervisor 211 also runs VM 210. Figure 3 The memory space 300 of the hypervisor implementing VMs and VNICs of some embodiments is conceptually illustrated. For clarity, the memory space 300 of FIG. 1 and FIG. 2 is omitted from this figure. Figure 2 Figure 1 shows a software forwarding element (SFE) and ports depicted in Figure 1.

[0029] The hypervisor memory space 300 allocates separate areas in memory for each VM and each associated VNIC. These areas are referred to as VM memory space 305 and VNIC memory space 310. Application 205 is executed in VM memory space 305, and VNIC emulation is executed in VNIC memory space 310. VNIC emulation 315 is a software-based emulation of a physical NIC executed on host 212 (e.g., in a hypervisor 211 executed on the host). In some embodiments, there are multiple applications running in the memory space of a given VM, and there are multiple VMs running in the memory space of the hypervisor. In some embodiments, these multiple VMs have their own associated VNIC emulations, or in other embodiments, share VNIC emulations.

[0030] In some embodiments, a guest VNIC driver 320 is also executed in the VM memory space 305. As depicted by the dashed lines, the driver provides a software interface (e.g., an API) for use by the VNIC emulation 315 of the application in the VM. To facilitate communication between the VM and the network endpoint 213, the guest VNIC driver 320 in the VM exchanges data with the VNIC emulation 315 in the VNIC memory space 310 (as depicted by the dotted lines), and the VNIC emulation 315 exchanges data with the PNIC (not shown).

[0031] As discussed above, the monitoring engine 215 of some embodiments (which incorporates the BFD engine and implements the BFD state machine) is offloaded to the VNIC, so it executes within the VNIC memory space 310, rather than within the VM memory space 305. As a result, the application is no longer directly aware of the state of the BFD monitoring session, as it is located in a separate memory space. Likewise, the monitoring engine is now separate from the application, so there is no way to determine whether the application is operating normally.

[0032] In some embodiments, to address this gap, the monitoring engine establishes a communication channel with the application to periodically verify that the application is operating properly (e.g., referred to as an "active" channel). In some embodiments, the application 205 updates the monitoring engine 215 with its operating status. In some embodiments, the monitoring engine 215 polls (e.g., queries) the application 205 for its operating status. If the monitoring engine 215 determines that the application 205 has failed (e.g., via an update or poll), the monitoring engine 215 terminates the monitoring session.

[0033] For example, in some embodiments, the active channel is an application programming interface (API) of the VNIC. In other embodiments, the active channel 240 is a shared memory 325 defined in the VNIC memory space 310. Both the application 205 and the monitoring engine 215 have read access to the shared memory 325 (in Figure 3 325). For example, in some embodiments, the monitoring engine 215 periodically receives status messages from the application 205 via the active channel 240. In such embodiments, the application 205 also has write access to the shared memory 325. Therefore, in some embodiments, the status messages are periodically written to the shared memory 325 by the application 205. The monitoring engine 215 periodically reads the shared memory 325 to determine whether the status message has been written within a configurable time period. The monitoring engine 215 then interprets the failure to receive the expected status message as a failure of the application 205.

[0034] In some embodiments, the status message is a timestamp indicating the last known time that the application 205 was operating normally. After reading the timestamp, the monitoring engine 215 calculates the time that has passed since the timestamp and compares the time to a configurable time period (e.g., a failure threshold). If the elapsed time is less than the failure threshold, the application is considered to be operating normally. If the elapsed time is greater than the failure threshold, the application is considered to have failed.

[0035] As another example, the monitoring engine 215 in some embodiments periodically queries the application 205 via the activity channel 240 and then waits for a reply from the application within a period of time. Failure to reply to the query within the period of time is interpreted by the monitoring engine 215 as a failure of the application 205. In some embodiments, the query and reply are written to and read from the shared memory 325 by the application 205 and the monitoring engine 215. In some embodiments, the monitoring engine 215 queries the application after failing to receive a status update as described above, as a verification method before inferring that the application has failed. In other embodiments, the monitoring engine 215 communicates directly with the application 205, or communicates via the VNIC emulation 315, in order to query or poll the application for its activity status.

[0036] Figure 4 Conceptually illustrating a process 400 performed by application 205 in some embodiments to offload a BFD monitoring session to VNIC 220. Process 400 begins at 405 by instructing the VNIC to establish a BFD session with network endpoint 213. In some embodiments, process 400 uses an API of the VNIC (e.g., VNIC emulation 315 executed in VNIC memory space 310) for this instruction. As described below with reference to Figure 5As discussed in more detail, in some embodiments the instructions include a set of parameters that define the configuration of the BFD session.

[0037] In some embodiments, the application determines that a session is necessary after initiating a connection to exchange data messages with network endpoint 213. This determination is automatic in some embodiments, or part of a configuration process for the application or the VM that operates it in other embodiments.

[0038] Process 400 notifies the VNIC of its operational status at 410. As discussed above, in some embodiments, the application performing process 400 notifies the VNIC of its operational status by sending a status update to the VNIC via active channel 240. In some embodiments, the status update is a timestamp or other incrementing value. In some embodiments where the application includes several different components, the application provides a separate status update for each component.

[0039] Process 400 determines at 415 whether the application still requires a BFD session. In some embodiments, the application no longer requires a session because the application has stopped exchanging data with network endpoint 213. If the process determines that a BFD session is still required, process 400 returns to 410 described above. In some embodiments, the determination of whether a BFD session is still required is performed at regular, configurable intervals.

[0040] If process 400 determines that the BFD session is no longer needed, the process instructs the VNIC to tear down the BFD session with network endpoint 213 at 420. In some embodiments, process 400 uses an API of the VNIC (e.g., VNIC emulation 315 executing in VNIC memory space 310) for this instruction. Process 400 then ends.

[0041] As noted above, in some embodiments, the monitoring engine 215 establishes a BFD session with the network endpoint 213 (e.g., another VM or another host computer) with which the application 205 is communicating. The monitoring engine 215 then periodically exchanges control messages (e.g., BFD packets) with the network endpoint 213 during the session, according to the BFD protocol. In some embodiments, the network endpoint is another VM or another forwarding element on another host computer. In some embodiments, the network endpoint 213 also executes its own monitoring engine (e.g., at another VM or another forwarding element) to send and receive BFD packets with the first monitoring engine 215. These BFD packets are sent over the data plane, in some embodiments, by using the same network connection as the data messages exchanged by the application 205 and the network endpoint 213. The monitoring engine 215 then interprets the failure to receive the expected BFD packet as a failure of the network connection. If the monitoring engine 215 determines that the BFD session with the network endpoint 213 has failed, then in some embodiments the monitoring engine 215 notifies the application 205 via the active channel 240.

[0042] Figure 5 Conceptually illustrates a process 500 performed by VNIC 220 in some embodiments to establish an offloaded BFD monitoring session with network endpoint 213. In some embodiments, process 500 is performed by monitoring engine 215 executing on VNIC 220.

[0043] In some embodiments, process 500 queries the physical NIC (PNIC) of the host computer to see if it supports BFD offload at 502. If the process determines at 503 that the PNIC supports BFD offload, the physical NIC performs the remainder of process 500 at 504. The process then ends at VNIC 220. If the process determines at 503 that the PNIC does not support BFD offload, process 500 continues at VNIC 220.

[0044] Process 500 establishes a BFD session with network endpoint 214 at 505. In some embodiments, the process establishes the session after receiving an instruction from application 205 that exchanges data messages with network endpoint 213 over a network connection. Process 500 may also terminate the session based on instructions received from the application (e.g., if the application determines that the BFD session is no longer necessary, as described above in Figure 4 415 of process 400 described in detail above).

[0045] In some embodiments, process 500 uses a set of parameters received from application 205 to establish a BFD session. In some such embodiments, these parameters are received via active channel 240. Process 500 uses these parameters to configure the BFD session. Examples of these parameters include the network address of the VM operating application 205, the network address of the network endpoint, and the frequency of control messages sent over the network connection. Process 500 also updates the BFD session configuration with additional parameters (if received from application 205).

[0046] In some embodiments, a BFD session is established with a network endpoint using a BFD handshake, which is an exchange of Hello message packets. During the handshake, process 500 sends a first message containing a unique identifier (e.g., the Internet Protocol address of VNIC 220) to network endpoint 213. Upon receiving the first message, network endpoint 213 replies with its own Hello message, which contains its own unique identifier and the unique identifier of VNIC 220. At this point, process 500 knows that the endpoint received its message because it contains the unique identifier of the VNIC and transitions from the peer state to the active monitoring state. Process 500 then sends another Hello message to network endpoint 213, which contains the unique identifier of the endpoint from the second Hello message (unlike the first message, which does not have the identifier of the network endpoint). When network endpoint 213 receives this third Hello message, it also knows that the VNIC received its message because it contains the unique identifier of the endpoint and likewise transitions from the peer state to the active monitoring state. In some embodiments, the BFD session is initiated by the network endpoint, not process 500, in which case the roles are reversed.

[0047] Once both process 500 and network endpoint 213 have entered the active monitoring state, process 500 monitors the status of the established BFD session at 510. In some embodiments, this is accomplished by routinely sending and receiving BFD packets to and from the network endpoint at regular, configurable intervals. Process 500 exchanges BFD packets with network endpoint 213 over the same network connection that application 205 uses to exchange data messages.

[0048] In some embodiments, the network connection is a tunnel, so process 500 encapsulates BFD packets for the tunnel exported to the network endpoint and decapsulates BFD packets received from the network endpoint. In some such embodiments, the tunnel endpoint address is among the configuration parameters received from application 205. For example, in some such embodiments, network endpoint 213 is another application executed in a VM on another host computer, and the BFD session is therefore established through a tunnel to the other host computer.

[0049] The process determines at 515 whether the BFD session being monitored is operating normally. In some embodiments, if the process 500 has received a BFD packet within the expected interval, the BFD session is considered to be operating normally. If the process 500 does not receive the expected BFD packet, the session is considered to have failed and the process continues to 520 described below. This determination is performed at a configurable frequency, cyclically in some embodiments. In some embodiments, the frequency is one of the configuration parameters received from the application 205.

[0050] After determining that the BFD session has failed, process 500 notifies application 205 at 520. In some embodiments, process 500 uses active channel 240 to notify application 205. In some embodiments, process 500 uses a method of notifying the application with a higher priority, such as an interrupt message.

[0051] Otherwise, if process 500 determines that the BFD session is operating normally, then in some embodiments, the process notifies application 205. In some embodiments, the application is notified of the operational status of the session at regular configurable intervals. In some embodiments, the interval is one of the configuration parameters received from application 205. In such embodiments, failure to notify the application of normal operation of the session within the interval is interpreted by the application as a failure of the session.

[0052] The process 500 also monitors the operating status of the application 205 at 525. Figure 3 As discussed, the process monitors activity through the activity channel 240, in some embodiments by receiving updates from the application 205, or in other embodiments by polling the application. As described above, the activity channel can be an API of the VNIC, or can be a shared memory space to which both the process 500 and the application 205 have read and / or write permissions.

[0053] The process 500 determines at 530 whether the application 205 is operating normally (i.e., the application is "alive") or has failed. In some embodiments, the application is determined to be operating normally if the application is periodically updating the shared memory space 325. In some other embodiments, the application is determined to be operating normally if the process 500 receives a reply to the liveness query. If the application 205 is determined to be operating normally (e.g., the application has not failed), the process 500 returns to 510 described above.

[0054] In some embodiments, if process 500 does not receive an expected status message from the application, and / or does not receive a reply to a liveness query, then application 205 is determined to be not operating normally. After determining that the application is not operating normally, process 500 tears down the BFD session at 535. Process 500 then ends.

[0055] Those skilled in the art will appreciate that operations 510-520 related to determining the state of a BFD session are independent of operations 525-535 related to determining the state of an application. In some embodiments, some of these operations occur in a different order or are omitted.

[0056] As noted above, in some embodiments, at least a portion of process 500 is performed by the PNIC, rather than the VNIC, when the process determines (at 503) that the PNIC supports BFD offload. In some such embodiments, the PNIC uses an active channel separate from the VNIC to determine the operational state of the application. In other such embodiments, the PNIC accesses the same active channel as the VNIC uses to determine the operational state of the application (e.g., by using an API of the VNIC). Such an active channel is in Figure 3 3 is illustrated as a shared memory space 325 in a VNIC. Alternatively or in conjunction, a PNIC may use VNIC emulation 315 to relay liveness information.

[0057] In some embodiments, monitoring engine 215 establishes multiple BFD sessions on behalf of a mix of multiple different network endpoints. One or more applications execute process 400 as described above to establish each different BFD session with a corresponding network endpoint. Figure 6 Conceptually illustrates a process 600 for monitoring engine 215 to manage multiple monitoring sessions. In some embodiments, as described above with reference to Figure 5 Process 600 is performed by a VNIC (or PNIC) as part of operations 515 - 520 of process 500 as described.

[0058] Process 600 selects a BFD session from a plurality of monitoring sessions at 605. The selected session is between a specific application and a specific network endpoint. In some embodiments, the plurality of monitoring sessions are with a plurality of network endpoints. These network endpoints may be tunnel endpoints (e.g., VXLAN, VLAN, GRE, etc.) implemented by a forwarding element or machine executed on one or more host computers. In some embodiments, some of these plurality of network endpoints are located at different host computers and are therefore established and maintained through different corresponding VXLAN, VLAN, GRE, etc. network connections. Alternatively or in combination, in some embodiments, some of these plurality of network endpoints are located at different machines or applications on a single host computer and are therefore able to share at least one network connection. In some embodiments, different BFD sessions sharing a network connection are isolated from each other by embedding additional context (e.g., destination IP or MAC address, VXLAN or VLAN tag, tunnel endpoint identifier, etc.) into the encapsulation of their respective BFD packets.

[0059] In some embodiments, the multiple monitoring sessions represent multiple different applications. The different applications are operated in the same machine or in different machines on the same host computer 212. In some embodiments, the multiple applications are completely separated applications. In other embodiments, the different applications are different application components, such as different application components in a multi-layer software architecture in which different components implement different functions (e.g., web, database, and application logic). These components are implemented as different processes executed in a single virtual machine in some embodiments, or as completely separated virtual machines in other embodiments. In some such embodiments, the monitoring engine 215 establishes separate active channels with different applications or application components. In some embodiments, the monitoring engine 215 establishes a single active channel with a given machine, which is shared by all applications operating in the machine. In some such embodiments, any single application (or application component) failure will be interpreted by the monitoring engine as a failure of the machine as a whole, and all associated sessions in the machine need to be terminated.

[0060] The process 600 monitors the selected session by exchanging BFD packets with the corresponding network endpoint at 610. In some embodiments, each BFD session has a unique identifier that is used by the process 600 to isolate BFD packets from different sessions and endpoints. The unique identifier is written into the outgoing BFD packet header by the monitoring engine at the VNIC and is read from the incoming BFD packet header from the corresponding network endpoint for the selected session.

[0061] Process 600 determines whether the selected session is down at 615. As noted above, in some embodiments, if process 600 has received BFD packets corresponding to the selected session within the expected interval, the selected BFD session is considered to be operating normally, and the process proceeds to 625, described below. If process 600 has not received the expected BFD packets, the session is considered to have failed, and the process proceeds to 620, described below.

[0062] After determining that the selected BFD session has failed, the process 600 notifies the corresponding application 205 of the failure at 620. In some embodiments, the process 600 uses the active channel 240 to notify the application 205. In some embodiments, the process 600 uses a method of notifying the corresponding application with a higher priority, such as an interrupt message. In some embodiments, if the BFD session is operating normally, the process 600 also notifies the corresponding application.

[0063] Process 600 determines at 625 whether there are additional BFD sessions to be managed. If there are additional BFD sessions, process 600 returns to operation 605 described above. If there are no additional BFD sessions, process 600 ends. In some embodiments, process 600 loops through all available BFD sessions and then starts again from the first BFD session. Process 600 can also perform operations 610-620 in parallel for different BFD sessions.

[0064] As used in this document, the term data packet, packet, data message, or message refers to a set of bits in a specific format that is sent over a network. It should be understood that the term data packet, packet, data message, or message may be used herein to refer to various formatted sets of bits that may be sent over a network, such as Ethernet frames, IP packets, TCP segments, UDP datagrams, etc. Although the above examples mention data packets, packets, data messages, or messages, it should be understood that the present invention should not be limited to any specific format or type of data message.

[0065] Many of the features and applications described above are implemented as software processes that 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 processors, or other processing units), they cause the 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 wirelessly or through wired connections.

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

[0067] Figure 7 An electronic system 700 for implementing some embodiments of the present invention is conceptually illustrated. The electronic system 700 may be a computer (e.g., a desktop computer, a personal computer, a tablet computer, a server computer, a mainframe, a blade computer, etc.), a phone, a PDA, or any other kind of electronic device. Such an electronic system includes various types of computer-readable media and interfaces for various other types of computer-readable media. The electronic system 700 includes a bus 705, a processing unit (one or more) 710, a system memory 725, a read-only memory 730, a permanent storage device 735, an input device 740, and an output device 745.

[0068] Bus 705 generally represents all system, peripheral, and chipset buses that communicatively connect the many internal devices of electronic system 700. For example, bus 705 communicatively connects processing unit(s) 710 with read-only memory 730, system memory 725, and permanent storage device 735.

[0069] From these various memory units, processing unit(s) 710 retrieves instructions to execute and data to process in order to perform the processes of the present invention.In different embodiments, the processing unit(s) may be a single processor or a multi-core processor.

[0070] The read-only memory (ROM) 730 stores static data and instructions required by the processing unit (s) 710 and other modules of the electronic system. On the other hand, the permanent storage device 735 is a read-write memory device. This device is a non-volatile memory unit that stores instructions and data even when the electronic system 700 is turned off. Some embodiments of the present invention use a mass storage device (such as a magnetic disk or optical disk and its corresponding disk drive) as the permanent storage device 735.

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

[0072] The bus 705 is also connected to an input device 740 and an output device 745. The input device enables a user to transmit information and selection commands to the electronic system. The input device 740 includes an alphanumeric keyboard and a pointing device (also referred to as a "cursor control device"). The output device 745 displays images generated by the electronic system. Output devices include printers and display devices, such as cathode ray tubes (CRTs) or liquid crystal displays (LCDs). Some embodiments include devices that function as both input devices and output devices, such as touch screens.

[0073] Finally, bus 705 also couples electronic system 700 to a network 765 via a network adapter (not shown). In this manner, the computer may be part of a computer network, such as a local area network ("LAN"), a wide area network ("WAN"), or an intranet, or a network of networks, such as the Internet. Any or all of the components of electronic system 700 may be used in conjunction with the present invention.

[0074] 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, read-only compact disk (CD-ROM), recordable compact disk (CD-R), rewritable compact disk (CD-RW), read-only digital versatile disk (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 Blu-ray discs, and the like. A computer readable medium may store a computer program executable by at least one processing unit and include a set of instructions for performing various operations. Examples of computer programs or computer code include machine code such as generated by a compiler, and files including higher-level code that are executed by a computer, electronic component, or microprocessor using an interpreter.

[0075] Although the above discussion mainly refers to microprocessors or multi-core processors that execute software, some embodiments are performed by one or more integrated circuits, such as application specific integrated circuits (ASICs) or field programmable gate arrays (FPGAs). In some embodiments, such integrated circuits execute instructions stored on the circuits themselves.

[0076] As used in this specification, the terms "computer", "server", "processor" and "memory" all refer to electronic devices or other technical devices. These terms do not include people or groups of people. For the purpose of this specification, the term "display" means displaying on an electronic device. As used in this specification, the terms "computer-readable medium", "computer-readable medium" and "machine-readable medium" are entirely limited to tangible physical objects that store information in a computer-readable form. These terms exclude any wireless signals, wired download signals and any other transient signals.

[0077] This specification always refers to computing and network environments including virtual machines (VMs). However, a virtual machine is only one example of a data computing node (DNC) or a data computing terminal node (also known as an addressable node). A DCN may include non-virtualized physical hosts, virtual machines, containers that run on top of a host operating system without a hypervisor or a separate operating system, and a hypervisor kernel network interface module.

[0078] In some embodiments, VMs operate on a host using the host's resources virtualized by virtualization software (e.g., hypervisors, virtual machine monitors, etc.) and with their own guest operating systems. Tenants (i.e., owners of VMs) can choose which applications to operate on top of the guest operating system. On the other hand, some containers are structures that run on top of the host operating system and do not require a hypervisor or a separate guest operating system. In some embodiments, the host operating system isolates containers for different tenants, thereby providing operating system-level separation of different application groups operating in different containers. This separation is similar to the VM separation provided in a hypervisor virtualized environment, and therefore can be viewed as a virtualized form of isolating different application groups operating in different containers. Such containers are lighter than VMs.

[0079] The hypervisor kernel network interface module is, in some embodiments, a non-VM DCN that includes a network stack with a hypervisor kernel network interface and receive / transmit threads. An example of a hypervisor kernel network interface module is the vmknic module that is part of VMware's ESX hypervisor.

[0080] Those skilled in the art will recognize that, although the present specification refers to VMs, the examples given may be any type of DCN, including physical hosts, VMs, non-VM containers, and hypervisor kernel network interface modules. In fact, in some embodiments, the example network may include a combination of different types of DCNs.

[0081] Although the present invention has been described with reference to many specific details, it will be appreciated by those skilled in the art that the present invention may be implemented in other specific forms without departing from the spirit of the present invention. In addition, at least one figure illustrates a process conceptually. The specific operations of such a process may not be performed in the exact order shown and described. The specific operations may not be performed in a continuous series of operations, and different operations may be performed in different embodiments. In addition, the process may be implemented using several subprocesses, or may be implemented as a part of a larger macroprocess. Therefore, it will be appreciated by those skilled in the art that the present invention is not limited by the foregoing illustrative details, but is limited by the appended claims.

Claims

1. A method for monitoring a status of a tunnel between a first host computer and a second host computer, the method comprising: At a tunnel monitor executing on the first host computer, wherein the first host computer also separately executes a machine that uses the tunnel to send messages to or receive messages from the second host computer, wherein the machine is a virtual machine: establishing an active channel with the machine to iteratively determine whether the machine is operating normally; establishing a monitoring session with the second host computer to iteratively determine whether the tunnel is operating normally; terminating the monitoring session with the second host computer when it is determined through the active channel that the machine is no longer operating normally; as well as When it is determined that the tunnel is no longer operating normally, notifying the machine via the active channel; wherein a forwarding element is executed on the first host computer separately from the machine, the forwarding element being a software forwarding element for forwarding messages between the machine and the second host computer; wherein the forwarding element serves as an endpoint of the tunnel; and A virtual network interface card is executed on the first host computer to provide messages to the machine and the forwarding element, wherein the virtual network interface card includes the tunnel monitor.

2. The method of claim 1, wherein the first host computer includes a physical network interface card, wherein establishing a monitoring session with the second host computer includes determining that the physical network interface card does not support execution of a tunnel monitor.

3. The method of claim 1, wherein determining that the machine is no longer operating properly through the established active channel comprises determining that an application that is a source or destination of a data message has failed.

4. The method of claim 3, further comprising receiving a set of status messages from the application via the active channel while the application is operating normally, wherein determining that the application has failed comprises determining that no status messages have been received via the active channel within a specific time period.

5. The method of claim 3, wherein determining that the application has failed comprises: sending a status query to the application via the active channel; as well as It is determined that a reply to the status query has not been received via the active channel within a specific time period.

6. The method of claim 3, wherein the application is a first application among a plurality of applications operating in the machine, wherein the monitoring session is a first monitoring session among a plurality of monitoring sessions with a plurality of other hosts that exchange data messages with the plurality of applications, the method further comprising providing a status update to the machine for each monitoring session.

7. The method of claim 1, wherein establishing the monitoring session comprises exchanging a set of control messages with the second host computer through the tunnel.

8. The method of claim 7, wherein determining through the monitoring session that the tunnel is no longer operating properly comprises determining that a control message has not been received from the second host computer within a particular period of time.

9. The method of claim 1, wherein the machine is a first machine, wherein a second machine executes on the second host computer, wherein the second machine exchanges data messages with the first machine.

10. The method of claim 9, wherein establishing the monitoring session comprises exchanging a set of control messages with the second machine.

11. The method of claim 9, wherein the forwarding element is a first forwarding element, wherein a second forwarding element executes on the second host computer separately from the second machine, wherein establishing the monitoring session comprises exchanging control messages with the second forwarding element.

12. The method of claim 1, wherein the active channel comprises an application programming interface.

13. A non-transitory machine-readable medium storing a program that, when executed by a processing unit, monitors a state of a tunnel between a first host computer and a second host computer, the program comprising a set of instructions for: At a tunnel monitor executing on the first host computer, wherein the first host computer also separately executes a machine that uses the tunnel to send messages to or receive messages from the second host computer, wherein the machine is a virtual machine: establishing an active channel with the machine to iteratively determine whether the machine is operating normally; establishing a monitoring session with the second host computer to iteratively determine whether the tunnel is operating normally; terminating the monitoring session with the second host computer when it is determined through the active channel that the machine is no longer operating normally; as well as When it is determined that the tunnel is no longer operating normally, notifying the machine via the active channel; wherein a forwarding element is executed separately from the machine on the first host computer, the forwarding element being a software forwarding element for forwarding messages between the machine and the second host computer; wherein the forwarding element serves as an endpoint of the tunnel; and A virtual network interface card is executed on the first host computer to provide messages to the machine and the forwarding element, wherein the virtual network interface card includes the tunnel monitor.

14. The non-transitory machine-readable medium of claim 13, wherein determining that the machine is no longer operating through the established active channel comprises determining that an application that is a source or destination of a data message has failed, wherein the application is a first application among a plurality of applications operating in the machine, wherein the monitoring session is a first monitoring session among a plurality of monitoring sessions with a plurality of other hosts that exchange data messages with the plurality of applications, and wherein the program further comprises a set of instructions for providing a status update to the machine for each monitoring session.

15. The non-transitory machine-readable medium of claim 13, wherein the set of instructions for establishing a monitoring session with the second host computer comprises a set of instructions for: receiving a set of parameters from the machine via the active channel; and Using the received set of parameters, the monitoring session is configured.

16. The non-transitory machine-readable medium of claim 15, wherein the received set of parameters includes an address of the machine, an address of the second host computer, and a frequency of control messages exchanged with the second host computer over the monitoring session.

17. The non-transitory machine-readable medium of claim 13, wherein the program further comprises a set of instructions for: receiving a notification from the machine that the monitoring session is no longer required; and Based on the notification, the monitoring session with the second host computer is terminated.

18. An electronic device, comprising: a set of processing units; as well as A non-transitory machine-readable medium storing a program which, when implemented by at least one of the processing units, implements the method according to any one of claims 1-12.

19. An electronic system comprising means for implementing the method according to any one of claims 1-12.

20. A computer program product comprising instructions which, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 12.