How to test network performance between two devices?

Testing network performance is essential to ensure reliable and efficient data transfer between nodes e.g. during data migrations.