1

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.

med.b
  • 465
  • 2
  • 12
  • 21
  • 1
    You seem to be misusing the word "bandwidth." I think you mean throughput. Bandwidth is a function of the layer-1 interface. For example, 1000Base-T (gigabit ethernet) has a bandwidth of 1 Gbps, and you can get that from the interface. – Ron Maupin Jul 16 '20 at 13:42
  • I see. but is there is standard approach to implement the measurement of the throughput by using a lib like gopacket ? – med.b Jul 16 '20 at 22:25
  • 1
    The problem is that the throughput is affected by a huge number of constantly changing parameters. Even measuring twice in a row can give wildly differing results. How busy is the client, server, intermediate devices (routers switches), how congested is the network path, and does it change, is there QoS that changes or drops certain packet classifications under congestion, etc. You cannot simply take a measurement and think that is the throughput because it could change at any moment. – Ron Maupin Jul 16 '20 at 22:31

0 Answers0