LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   how to calculate throughput using TCPSTAT command? (https://www.linuxquestions.org/questions/linux-networking-3/how-to-calculate-throughput-using-tcpstat-command-4175538270/)

rajes4india 03-30-2015 02:35 PM

how to calculate throughput using TCPSTAT command?
 
Hi Friends,

How to calculate throughput of the particular interface using "tcpstat" command. Is there any options available inbuilt or any logic for that.

my scenario:

By using CURL am posting a file to remote server. Before starting post i have started "tcpstat -i eth5 -f " udp and src port 22334". by using the above tcpstat option am able to capture like below,

Time:1427743264 n=127 avg=230.07 stddev=232.78 bps=46750.40
Time:1427743269 n=172 avg=198.94 stddev=200.50 bps=54747.20


But i want to calculate the throughput of the link. in my scenario i want to calculate the total bandwidth taken for posting the file. my file size is 2Mb.

thanks in advance.

--Rajesh

TB0ne 03-31-2015 09:07 AM

Quote:

Originally Posted by rajes4india (Post 5340040)
Hi Friends,
How to calculate throughput of the particular interface using "tcpstat" command. Is there any options available inbuilt or any logic for that. my scenario:

By using CURL am posting a file to remote server. Before starting post i have started "tcpstat -i eth5 -f " udp and src port 22334". by using the above tcpstat option am able to capture like below,

Time:1427743264 n=127 avg=230.07 stddev=232.78 bps=46750.40
Time:1427743269 n=172 avg=198.94 stddev=200.50 bps=54747.20


But i want to calculate the throughput of the link. in my scenario i want to calculate the total bandwidth taken for posting the file. my file size is 2Mb.

You can easily write a script to add numbers together, or perform any other mathematical operation. So, what have you done/tried of your own so far? You've been registered here for four years now, and asked about performing similar calculations two years ago:
http://www.linuxquestions.org/questi...le-4175455990/

Have you not progressed any in two years?? Can you not apply what you were told previously in this situation, by making a change to it? We will be happy to assist you, but we're not going to write your scripts for you. So show us what effort you've put into this so far, post your script, and tell us where you're stuck.

rajes4india 03-31-2015 09:35 AM

Quote:

Originally Posted by TB0ne (Post 5340365)
You can easily write a script to add numbers together, or perform any other mathematical operation. So, what have you done/tried of your own so far? You've been registered here for four years now, and asked about performing similar calculations two years ago:
http://www.linuxquestions.org/questi...le-4175455990/

Have you not progressed any in two years?? Can you not apply what you were told previously in this situation, by making a change to it? We will be happy to assist you, but we're not going to write your scripts for you. So show us what effort you've put into this so far, post your script, and tell us where you're stuck.

HI TB0ne,

thanks for replying back.

Little misunderstanding here, Yes in did scripting for calculating the each column , basically i did adding columns of Time, Packet count , bps. But i am not sure about the exact formula for calculating the throughput using the above three parameters. Basically i want to calculate the Bandwidth taken for the particular time period. like below in the link. https://www.switch.ch/network/tools/tcp_throughput/.

my assumption is

total BPS
--------- or total bps / total time * packet count.
total TIME


i know how to script the formula. i want to make sure the above formula will give the accurate throughput . let me know if you have something on this. really appreciated.

thanks for the help.

TB0ne 03-31-2015 12:59 PM

Quote:

Originally Posted by rajes4india (Post 5340381)
HI TB0ne,
Little misunderstanding here, Yes in did scripting for calculating the each column , basically i did adding columns of Time, Packet count , bps. But i am not sure about the exact formula for calculating the throughput using the above three parameters. Basically i want to calculate the Bandwidth taken for the particular time period. like below in the link. https://www.switch.ch/network/tools/tcp_throughput/.

my assumption is

total BPS
--------- or total bps / total time * packet count.
total TIME

i know how to script the formula. i want to make sure the above formula will give the accurate throughput . let me know if you have something on this. really appreciated.

There are over 96,000 hits in Google for "how to calculate tcp throughput", which gives you the formula you need. So if you can find the formula, and know how to script it, that's all you need, isn't it??? This is the second hit in Google:
http://bradhedlund.com/2008/12/19/ho...istance-links/

Did you try to look this up? There are also many other formulas that appear with that search...you don't say what language you want to script this in, what you've done/tried on your own so far, or what parameters you want to measure, so there's not much more detail anyone can give you.

But, since you say you know how to script it, what you need, and know how to find the formula(s) you want, it seems you've got all the pieces.


All times are GMT -5. The time now is 06:18 AM.