the question about Iperf3 algorithm

189 views
Skip to first unread message

niye...@gmail.com

unread,
May 19, 2014, 9:01:30 PM5/19/14
to iper...@googlegroups.com
Dear anthor of Iperf3:
  I'm work in network information center of Comunication University of China, recently I want to do some research on tcp and udp tests with iperf3. Firstly, I admit that iperf3 is a very powerful tools and it can do lots of things, but I need do some change in the source code to implement   available bandwith testing. So I spend lots of times to reading the source code, and I can't find the algorithm in iperf3. Would you mind sending some relative works to me, or tell me what's the method in iperf3. I want know how the iperf3 implement udp and tcp testing.  Thank you for your assistance. 
 Best wishes

niye...@gmail.com

unread,
May 21, 2014, 8:38:39 PM5/21/14
to iper...@googlegroups.com
anyone can help me???

在 2014年5月20日星期二UTC+8上午9时01分30秒,niye...@gmail.com写道:

Bruce A. Mah

unread,
May 22, 2014, 5:54:05 PM5/22/14
to iper...@googlegroups.com
Hello--

I'd like to help you out, but it's not clear to me what you need help
with. You basically asked "how does it work?" but it's difficult to
answer given the lack of a specific question, or what you are trying to
accomplish.

Ultimately, the source code describes the behavior of what iperf3 does.
If you want to see the actual sending and receiving code, there is some
protocol-independent stuff in src/iperf_api.c (functions iperf_send()
and iperf_recv()). These in turn call protocol-specific (for TCP, UDP,
etc.) functions via the sp->snd and the sp->rcv function pointers.
These do the actual sending and receiving of one block's worth of
data...for example iperf_tcp_send() and iperf_tcp_recv(). Those call
some lower-level socket functions called Nread() and Nwrite().

I left out the control protocol that the client and server use to
coordinate their actions because I figured that wasn't important to you.

There's not a lot of algorithm involved. iperf3 sends a bunch of data
and measures how long it takes...it divides bytes by time to get a bitrate.

You mentioned you want to make some changes to the source code. What do
you want iperf3 to do differently?

Bruce.


signature.asc

niye...@gmail.com

unread,
May 23, 2014, 5:18:14 AM5/23/14
to iper...@googlegroups.com
Hello:
  Thanks a lot for your reply.  
  I want to measure the performance of an end-to-end network, such as  available bandwidth, delay, loss and jitter which are very important in stream media playout. The project like this: there is a server which can provide video service, and a daemon that can measure the end-to-end performance running in the server. When a client send a request to the server, the server will firstly begin a network performance measurement. The result (available bandwidth, delay or jitter, and loss ) will indicate which kind (high definition or low definition ) of video stream should send to the client. And one server should provide stream service to many client. 
  As I konw, the iperf3 has a daemon model, and can get bandwidth, delay jitter, pkt loss. So I decide to use iperf3 in my project. After I read the source code, I found that the bandwidth result maybe not like the available bandwidth, so I want to do some change in the source code, now I found it is a difficult work. 
  I see the functions you mentioned, but I thought maybe I missed something. Now I have some new question, first, when iperf3 use TCP to estimate bandwidth, does the iperf3 use up the whole bandwidth?  If it is true, why I can use ftp service when the test is going. Second, I use pathload to test the available bandwidth in the same path  when  the iperf3 is going with UDP. I change the paramater -b from 8M to16M, from 16M to 32M, but in pathload result, I don't find some different? I was confused about this. Third, do you have some advice or recommend tools or solutions to accomplish my goal. 
  My experimental environment in a lan , but not in the same vlan, there is a 100M bandwidth between server and client, and 4 hops from client to server.
  I am looking forward your soonest reply.
 
在 2014年5月23日星期五UTC+8上午5时54分05秒,Bruce A. Mah写道:

Bruce A. Mah

unread,
May 27, 2014, 4:11:36 PM5/27/14
to iper...@googlegroups.com
If memory serves me right, niye...@gmail.com wrote:
> Hello:
> Thanks a lot for your reply.
> I want to measure the performance of an end-to-end network, such as
> available bandwidth, delay, loss and jitter which are very important in
> stream media playout. The project like this: there is a server which can
> provide video service, and a daemon that can measure the end-to-end
> performance running in the server. When a client send a request to the
> server, the server will firstly begin a network performance measurement.
> The result (available bandwidth, delay or jitter, and loss ) will
> indicate which kind (high definition or low definition ) of video stream
> should send to the client. And one server should provide stream service
> to many client.
> As I konw, the iperf3 has a daemon model, and can get bandwidth, delay
> jitter, pkt loss. So I decide to use iperf3 in my project. After I read
> the source code, I found that the bandwidth result maybe not like the
> available bandwidth, so I want to do some change in the source code, now
> I found it is a difficult work.
> I see the functions you mentioned, but I thought maybe I missed
> something. Now I have some new question, first, when iperf3 use TCP to
> estimate bandwidth, does the iperf3 use up the whole bandwidth? If it
> is true, why I can use ftp service when the test is going.

iperf3 uses TCP to estimate the available bandwidth, basically just by
sending data as fast as it can. You can get into some situations (such
as what we see in the R&E networking community) where the end hosts, not
the network, are the bottleneck.

As you (hopefully) know, TCP streams sharing a bottleneck link will
adjust their sending rates in various ways to share the bottleneck link
(some more efficient than others, some more fair than others). IP
networks do not allocated a fixed amount of bandwidth to TCP connections.

> Second, I use
> pathload to test the available bandwidth in the same path when the
> iperf3 is going with UDP. I change the paramater -b from 8M to16M, from
> 16M to 32M, but in pathload result, I don't find some different? I was
> confused about this.

pathload uses a different mechanism and algorithm from iperf3. It's
very possible that it's measuring something different from what iperf3
measures, and that's why you're getting different results.

> Third, do you have some advice or recommend tools
> or solutions to accomplish my goal.

If you're sending video, presumably the video data contains timestamps
to indicate when video frames should be displayed. You could have your
receiver watch the timestamps during playback to see if they're going
slower than real-time, which might indicate that the sender is sending
data too fast, and adjust its resolution (and therefore data rate)
accordingly while the video is playing. I'm pretty (but not absolutely)
sure this is how streaming video systems work today.

Good luck,

Bruce.

> My experimental environment in a lan , but not in the same vlan, there
> is a 100M bandwidth between server and client, and 4 hops from client to
> server.
> I am looking forward your soonest reply.
>
> 在 2014年5月23日星期五UTC+8上午5时54分05秒,Bruce A. Mah写道:
>
> --
> You received this message because you are subscribed to the Google
> Groups "iperf-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to iperf-dev+...@googlegroups.com
> <mailto:iperf-dev+...@googlegroups.com>.
> To post to this group, send email to iper...@googlegroups.com
> <mailto:iper...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/iperf-dev.
> For more options, visit https://groups.google.com/d/optout.


signature.asc

niye...@gmail.com

unread,
May 29, 2014, 9:13:50 PM5/29/14
to iper...@googlegroups.com
Hi:
  Thanks again. I decide to use pathchirp to estimate the avail-bw, and 
I want to add one-way-delay and loss packet rate in the pathchirp report. 
Do you know how to adjust encoding rate base on avail-bw with a real-time 
requirement. I even consider hadoop, but it didn't support real-time  Could 
you give me some advice about distributed transcoding (or encoding) system
which can transcode or encode as soon as possible then can approach 
real-time.
  

在 2014年5月28日星期三UTC+8上午4时11分36秒,Bruce A. Mah写道:
You mean I adjust the application in the client? That is a reasonable ideal 
but I can't do this, I only in charge of the network-aware module. I have no 
right to develop the application. I will use the network parameters 
(such as avail-bw,  loss, delay) and   CPE (Customer Terminal Equipmet) 
parameters (CPU, screen size, OS) to indicate how to adjust our streaming 
rate. Do you know how to modeling network parameters and CPE parameters
in one function? 
By the way, I want to be a visitor scholar in next two years. Are you working in 
an university? Could you give me an opportunity to do some relative research 
in your lab? I can offer all the fee on  my self. Thank you.

niye...@gmail.com

unread,
May 29, 2014, 9:13:59 PM5/29/14
to iper...@googlegroups.com


在 2014年5月20日星期二UTC+8上午9时01分30秒,niye...@gmail.com写道:

Bruce A. Mah

unread,
May 30, 2014, 12:13:12 PM5/30/14
to iper...@googlegroups.com
If memory serves me right, niye...@gmail.com wrote:

> Thanks again. I decide to use pathchirp to estimate the avail-bw, and
> I want to add one-way-delay and loss packet rate in the pathchirp report.
> Do you know how to adjust encoding rate base on avail-bw with a real-time
> requirement. I even consider hadoop, but it didn't support real-time Could
> you give me some advice about distributed transcoding (or encoding) system
> which can transcode or encode as soon as possible then can approach
> real-time.

I'm sorry, but this discussion of video encoding is going way off-topic
from iperf3. You'd probably be best off doing your own research or
posting your questions to another, more appropriate, discussion list.

Good luck,

Bruce.



signature.asc

niye...@gmail.com

unread,
Jun 1, 2014, 5:48:43 AM6/1/14
to iper...@googlegroups.com
Ok, I have a little worry about my project. Back to iperf3, I want to use iperf3's api 
do an udp test, which api I should use? 
  In last mail, I write that:
By the way, I want to be a visitor scholar in next two years. Are you working in 
an university? Could you give me an opportunity to do some relative research 
in your lab? I can offer all the fee on  my self. Thank you.
  I don't know if you see it? Thanks again.  

在 2014年5月31日星期六UTC+8上午12时13分12秒,Bruce A. Mah写道:
Reply all
Reply to author
Forward
0 new messages