Wireshark is a free and open-source packet analyzer. It is used for network troubleshooting, analysis, software and communications protocol development, and education.
Originally named Ethereal, in May 2006 the project was renamed Wireshark due to trademark issues.
Wireshark is software that "understands" the structure of different networking protocols.
Thus, it is able to display the encapsulation and the fields along with their meanings of different packets specified by different networking protocols. Wireshark uses pcap to capture packets, so it can only capture the packets on the types of networks that pcap supports.