One of the best ways to measure TCP maximum bandwidth is to use the iperf tool, which you can download from here.

Source code is available, and there's executables for Windows XP to Windows 10, Linux x86 and Linux x64, Mac OS X, x86 Solaris and SPARC Solaris.