Port mirroring allows you to plug a laptop/pc into a switchport that mirrors the traffic on another port. This allows you to use a utility such as Wireshark to analyze the problem.
In this case I am troubleshooting a server plugged into interface 6/1 and plugging my laptop/monitoring tool into 3/1.
monitor session 2 source int Gi6/1 both monitor session 2 destination int Gi3/1
switchport switchport trunk encapsulation dot1q switchport mode trunk switchport nonegotiate no shut