A method for detecting a path, comprising: receiving, by a first forwarding device , a first detection packet sent from a previous hop forwarding device on a path of a designated service flow and used for detecting the path of the designated service flow, wherein forwarding information in a header of the first detection packet is the same as forwarding information in a header of the designated service flow, and a device address of at least one forwarding device on the path of the designated service flow is carried in a payload of the first detection packet; obtaining, by the first forwarding device, a second detection packet by adding a device address of the first forwarding device to the payload of the first detection packet, and forwarding, by the first forwarding device, the second detection packet to a next hop forwarding device on the path of the designated service flow based on the forwarding information in a header of the second detection packet, such that the next hop forwarding device takes the second detection packet including the device address of the first forwarding device as a new first detection packet and generates a new forwarding error message corresponding to the new first detection packet; and obtaining, by the first forwarding device, a forwarding error message by updating a Time To Live, TTL, as zero in the header of the first detection packet, and sending, by the first forwarding device, to a Software Defined Network, SDN, controller the forwarding error message in which the device address of the at least one forwarding device in the payload of the first detection packet is carried, such that the SDN controller determines the path of the designated service flow based on the device address carried in the forwarding error message. receiving, by a first forwarding device , a first detection packet sent from a previous hop forwarding device on a path of a designated service flow and used for detecting the path of the designated service flow, wherein forwarding information in a header of the first detection packet is the same as forwarding information in a header of the designated service flow, and a device address of at least one forwarding device on the path of the designated service flow is carried in a payload of the first detection packet; obtaining, by the first forwarding device, a second detection packet by adding a device address of the first forwarding device to the payload of the first detection packet, and forwarding, by the first forwarding device, the second detection packet to a next hop forwarding device on the path of the designated service flow based on the forwarding information in a header of the second detection packet, such that the next hop forwarding device takes the second detection packet including the device address of the first forwarding device as a new first detection packet and generates a new forwarding error message corresponding to the new first detection packet; and obtaining, by the first forwarding device, a forwarding error message by updating a Time To Live, TTL, as zero in the header of the first detection packet, and sending, by the first forwarding device, to a Software Defined Network, SDN, controller the forwarding error message in which the device address of the at least one forwarding device in the payload of the first detection packet is carried, such that the SDN controller determines the path of the designated service flow based on the device address carried in the forwarding error message. <EOS>