The ping (Packet Internet Groper) command can be used to test end-to-end connectivity from a switch to a remote host. The IP ping uses ICMP type 8 requests and ICMP type 0 replies.
The traceroute or Layer 3 traceroute command can be used to discover the routers along the path that packets are taking to a destination. An IP traceroute uses UDP probe packets on port 33434.
The l2trace or Layer 2 traceroute command can be used to discover the physical path that a packet will take through a switched network.
l2trace looks up the destination in the forwarding table, and then contacts the next neighboring switch via CDP. Each switch hop is queried in a similar fashion.
l2trace is only supported on Catalyst 4000, 5000, and 6000 (COS ...