An in-situ flow detection method, applied to a network device, the method comprising: receiving a first service packet carrying a first packet header, wherein the first packet header comprises at least a first in-situ flow detection option which is added to the first packet header by an ingress node of a first network domain and is for indicating an in-situ flow detection, wherein the first network domain further comprises a forwarding node, wherein the forwarding node is configured to receive and forward the first service packet carrying the first in-situ flow detection option, obtain corresponding data based on a data type indicated the first in-situ flow detection option, and report the corresponding data to an analyzer; and when the network device is an ingress node of a second network domain, forwarding a second service packet in the second network domain; wherein the received first service packet is forwarded by the forwarding node of the first network domain to the network device, and wherein the network device which is the ingress node of the second network domain is a node different from the ingress node of the first network domain, the second service packet is obtained by encapsulating a second packet header in an outer layer of the first service packet by the network device which is the ingress node of the second network domain, and wherein the second packet header comprises at least a second in-situ flow detection option, and the second in-situ flow detection option is for indicating that the in-situ flow detection is performed on a same service flow in a same in-situ flow detection mode as the first in-situ flow detection option in the first packet header. receiving a first service packet carrying a first packet header, wherein the first packet header comprises at least a first in-situ flow detection option which is added to the first packet header by an ingress node of a first network domain and is for indicating an in-situ flow detection, wherein the first network domain further comprises a forwarding node, wherein the forwarding node is configured to receive and forward the first service packet carrying the first in-situ flow detection option, obtain corresponding data based on a data type indicated the first in-situ flow detection option, and report the corresponding data to an analyzer; and when the network device is an ingress node of a second network domain, forwarding a second service packet in the second network domain; wherein the received first service packet is forwarded by the forwarding node of the first network domain to the network device, and wherein the network device which is the ingress node of the second network domain is a node different from the ingress node of the first network domain, the second service packet is obtained by encapsulating a second packet header in an outer layer of the first service packet by the network device which is the ingress node of the second network domain, and wherein the second packet header comprises at least a second in-situ flow detection option, and the second in-situ flow detection option is for indicating that the in-situ flow detection is performed on a same service flow in a same in-situ flow detection mode as the first in-situ flow detection option in the first packet header. <EOS>