Question about Throughput calculation

738 views
Skip to first unread message

Konstantinos

unread,
Mar 2, 2011, 11:36:58 AM3/2/11
to ns-3-...@googlegroups.com
Hey,

I want to calculate the throughput in a wifi scenario.
From examples/wireless/hidden-terminal.cc I found this code. This "10.0" i suppose is the time of the simulation. Shouldn't this be (timeLastRxPacket - timeFirstRxPacket).GetSeconds() ??

...
line 159: std::cout << "  Throughput: " << i->second.rxBytes * 8.0 / 10.0 / 1024 / 1024  << " Mbps\n";
...

Mathieu Lacage

unread,
Mar 6, 2011, 10:11:30 AM3/6/11
to ns-3-...@googlegroups.com
On Wed, Mar 2, 2011 at 17:36, Konstantinos <dinos.k...@gmail.com> wrote:

> I want to calculate the throughput in a wifi scenario.
> From examples/wireless/hidden-terminal.cc I found this code. This "10.0" i
> suppose is the time of the simulation. Shouldn't this be (timeLastRxPacket -
> timeFirstRxPacket).GetSeconds() ??

I suspect that it really depends on what your definition of throughput
is. In this case, the numeric result should not change much since the
applications start sending packets really early in the simulation.

Mathieu
--
Mathieu Lacage <mathieu...@gmail.com>

idrees.a...@gmail.com

unread,
Apr 13, 2013, 12:15:02 PM4/13/13
to ns-3-...@googlegroups.com
Sir Konstantinos and Mathieu Lacage

i am trying to simulate a research paper on wimax whose title is "Dynamic QoS based bandwidth allocation framework for broadband wireless networks", i have created topology for it. sir its scheduler is based on two primary parameters  i.e. throughput and allocated bandwidth, sir in my implementation i have added flow monitor and i am getting values of throughput, but i have two questions:
1) how to get throughput of each packet sent or received  and
2) while getting the values of throughput i have to call scheduler so is it possible to call scheduler after flow monitor implementation?

Konstantinos Katsaros

unread,
Apr 13, 2013, 7:26:15 PM4/13/13
to ns-3-...@googlegroups.com
Hi

1) Throughput is a statistical metric, not calculated per packet. Throughput means how many packets/bytes/bits per unit of time.
2) You can put FlowMonitor inside your scheduler and get throughput statistics e.g. every 1, 2, 3 .. seconds.

Regards,

Konstantinos Katsaros

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/p1j_-IFSrNg/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

idrees.a...@gmail.com

unread,
Apr 14, 2013, 2:40:23 PM4/14/13
to ns-3-...@googlegroups.com
Sir
thanks alot for clarification and giving such a kind advice.

dio...@gmail.com

unread,
Apr 15, 2013, 11:45:43 AM4/15/13
to ns-3-...@googlegroups.com
Hi Konstantinos,

I am not sure if this is the right place to ask this question. However, based on your answer I was wondering if someone is able to define freely what is a "flow" for him/her.
I mean that, I may want to define as flow1 the data transferred from node A and node B from t1 = 5 until t2 = 15 seconds. Based on this definitition, I can use FlowMonitor and estimate the throughput (what I consider as throughput) for this specific flow1.

Thanks in advance,
Dionysios

Konstantinos

unread,
Apr 15, 2013, 12:23:01 PM4/15/13
to ns-3-...@googlegroups.com
Dear Dionysios,

A flow is well defined in terms of transport layer (either TCP or UDP) [1] and is the combination of 5 elements: source IP, source port, destination IP, destination port and the protocol type.
FlowMonitor uses the same classification but I think it leaves out the protocol type (not sure though). So you can identify your flow (flow1) if you know those 4 parameters.
You can configure FlowMonitor to start 'looking' into the packets at t1=5sec using the start function of flowmonitor and make it stop at t2=15sec with the stop. For more information read the documentation [2].

void Start (const Time &time)
 Set the time, counting from the current time, from which to start monitoring flows.

void Stop (const Time &time)
 Set the time, counting from the current time, from which to stop monitoring flows.


Regards,
Konstantinos

[1] http://en.wikipedia.org/wiki/Traffic_flow_%28computer_networking%29
[2] http://www.nsnam.org/doxygen/classns3_1_1_flow_monitor.html

salma subh

unread,
Jun 27, 2013, 7:33:32 PM6/27/13
to ns-3-...@googlegroups.com
is there any example about how to calculate instantaneous throughput using flow monitor sir ?

Andres Glücksberg

unread,
Jul 3, 2013, 10:57:14 AM7/3/13
to ns-3-...@googlegroups.com
hello Konstantinos,

what do the number in the line 159 mean?


 8.0 / 10.0 / 1024 / 1024  
thanks

Konstantinos

unread,
Jul 3, 2013, 11:04:33 AM7/3/13
to ns-3-...@googlegroups.com
Hi Andres,

The first 8.0 is to convert the bytes in bits (because the "second.rxBytes" returns you the total received bytes
The 10 (which was also my initial question) should be the time difference from the first received packet till the last.
The last two 1024 is to convert the bits into kbits and Mbits respectively.

hafza kareem

unread,
Apr 16, 2020, 12:48:35 AM4/16/20
to ns-3-users
Hello Konstantinos,

Could you please share the answer for this question if you have figured it.
Reply all
Reply to author
Forward
0 new messages