0

im trying to calculate the bandwidth of a network

currently i am measure the time taken for a message, that varies in sizes to be sent to the machine and back, a ping,

here is the that does that :

this is the code i am using to measure the ping :

EDIT, Now using the code in the comment below

How can i measure the bandwidth of the system, i did ask a simular question before, but could not get it to work

it must be done in java, its for a project

Thanks

user2065929
  • 1,065
  • 4
  • 21
  • 35

1 Answers1

0

I think this approach is too naive to give you a useful approach or measurement, and will result in variable output numbers depending on when you run it, how many hops are between you and the destination system, how congested your network is, and lots of other variables that are built into the protocol itself. You would be better served using existing tools rather than building your own.

Also, it's important to understand a lot more about the TCP protocol (or UDP if that's what you want to use) in order to provide the proper context for measuring the right metric(s) in the right situation. Modern networks just aren't as simple as sending as much possible data through a pipe and considering that the maximum effective speed because so much can be configured and changed, and there are so many steps between you and the destination system that can play a heavily variable role in your resulting throughput.

Security Now Episodes 317 and 323 and would be a great place to start if you're actually deeply interested in how TCP works as they provide a great introduction to the details. They are both technically interesting and approachable. My next step would be the wikipedia article on TCP, and then RFCs 793 and 2581 for an authoritative and deeply technical reference (there may be other RFCs involved in TCP, these are just the two that I found quickly).

Community
  • 1
  • 1
jefflunt
  • 33,527
  • 7
  • 88
  • 126