I'm supposed to use gopacket to run some network tests like measure the bandwidth of a TCP/UDP connection. I'm aware of the fact that the lib allows the capture, injection and analysis of packets, but I can't think of a proper way to measure the bandwidth. I looked for some standard approaches like transferring a 'large' file from one system to another system and measure the time required to complete the transfer, but I find it hardly convincing (maybe due to my limited networking knowledge).
Can sending a big number of packets (instead of file) and measuring the time required for completion be an option ?
Thanks.