Patent attributes
Some embodiments provide a method for providing a continuous mirroring session between a monitored data compute node (DCN) and a monitoring DCN. The method provides such uninterrupted mirroring session regardless of relocations of the DCNs during the mirroring session. In some embodiments, the method dynamically switches between local mirroring and remote mirroring based on the positions of the monitored DCN and the monitoring DCN. Upon receiving a data message from a port of a forwarding element (i.e., a monitored port), to which a monitored DCN is coupled, the method duplicates the data message. The method then sends the duplicated data message either to a monitoring DCN that executes on the same host machine, or adds particular tunneling data to the duplicated data message and tunnels the duplicated data message to a remote host machine, on which the monitoring DCN executes.