I want to use iperf to send some packets and receive the same at the client (which might have gone through different OSI layer processings). I want to check the packets sent are same as the received ones.
Or is there any other better way of doing this?
You can use Wireshark to perform the capture, select the packets of each stream and export to text files (one per stream):
File -> Export -> as "Plain Text" file:
- Check "Selected packet only"
- Check "Packet summary line"
- Check "Packet details: All expanded"
Then perform the diff with regular text tools as gnu diff, WinMerge or gvimdiff.