A method for obtaining internet protocol version 6 segment routing, SRv6, tunnel information, comprising: sending, by a first network device, a request packet to a second network device, wherein the request packet is used to request to detect reachability of an SRv6 tunnel and obtain SRv6 tunnel information of the second network device, and the second network device is a network device on the SRv6 tunnel; receiving, by the first network device, a response packet from the second network device, wherein the response packet comprises the SRv6 tunnel information of the second network device; and obtaining, by the first network device, the SRv6 tunnel information of the second network device based on the response packet, wherein the request packet is a user datagram protocol, UDP, packet, the UDP packet comprises a first field, and the first field indicates to obtain the SRv6 tunnel information of the network device on the SRv6 tunnel, wherein the SRv6 tunnel information of the network device on the SRv6 tunnel comprises at least one of the following information: active segment identifier, SID, information of the network device on the SRv6 tunnel, segment routing, SR, policy information that is of the network device on the SRv6 tunnel and that is associated with a binding segment identifier, BSID, and service chain information of the network device on the SRv6 tunnel, wherein the UDP packet further comprises a second field, and the second field indicates to obtain at least one of the following information: the active SID information of the network device on the SRv6 tunnel, the SR policy information that is of the network device on the SRv6 tunnel and that is associated with the BSID, and the service chain information of the network device on the SRv6 tunnel. sending, by a first network device, a request packet to a second network device, wherein the request packet is used to request to detect reachability of an SRv6 tunnel and obtain SRv6 tunnel information of the second network device, and the second network device is a network device on the SRv6 tunnel; receiving, by the first network device, a response packet from the second network device, wherein the response packet comprises the SRv6 tunnel information of the second network device; and obtaining, by the first network device, the SRv6 tunnel information of the second network device based on the response packet, wherein the request packet is a user datagram protocol, UDP, packet, the UDP packet comprises a first field, and the first field indicates to obtain the SRv6 tunnel information of the network device on the SRv6 tunnel, wherein the SRv6 tunnel information of the network device on the SRv6 tunnel comprises at least one of the following information: active segment identifier, SID, information of the network device on the SRv6 tunnel, segment routing, SR, policy information that is of the network device on the SRv6 tunnel and that is associated with a binding segment identifier, BSID, and service chain information of the network device on the SRv6 tunnel, wherein the UDP packet further comprises a second field, and the second field indicates to obtain at least one of the following information: the active SID information of the network device on the SRv6 tunnel, the SR policy information that is of the network device on the SRv6 tunnel and that is associated with the BSID, and the service chain information of the network device on the SRv6 tunnel. the active SID information of the network device on the SRv6 tunnel, the SR policy information that is of the network device on the SRv6 tunnel and that is associated with the BSID, and the service chain information of the network device on the SRv6 tunnel.