1

when some packets are transmitted on our interface how get the current packet transmission speed through a c program and display it.

Currently im collecting statistics after complete traffic generation from /sys/class/net/eth0/statistics/tx_bytes and shoing speed using following formulae

speed = (tx_bytes*8)/(60*1024*1024) for showing in mbps (mega bits per second) but the actual speed shown on bmon (bandwidth monitor) program and what im getting using this calculation are different.

valmiki
  • 701
  • 9
  • 24
  • There is no standard C library for doing this. Anything would be operating system dependent. What platform are you trying to run this on? I think you're looking at the actual number of bytes transmitted - which isn't going to give you the speed it's capable of. – xaxxon Aug 24 '13 at 10:11
  • Duplicate: http://stackoverflow.com/questions/2872058/get-link-speed-programmatically?lq=1 http://stackoverflow.com/questions/10777866/get-network-link-type-and-speed-programmatically-in-c – Nirmoy Aug 24 '13 at 13:15

0 Answers0