Two Questions: 1) Best way to measure TCP goodput speed 2) Help with debugging via gdb

331 views
Skip to first unread message

bcraw...@gmail.com

unread,
Dec 27, 2008, 7:38:43 PM12/27/08
to ns-3-...@googlegroups.com
Hi All,

My 1st question doesn't relate directly to NS3 but I thought many of you would have the answer to this.
If I have the pcap trace file are there any good tools that would give me high level statistics on it? (i.e average speed , number of dropped packets, timeouts ??)  If not what is the basic method for finding out say the average good put ?
My second question relates to debugging in GDB... sorry if this is noobish as I have little experience with this debugger or how NS-3 is built
to debug I just go to /build/debug/scratch and run gdb my-app ...
when I try to set a break point for one of the files I have defined (b file-request-server.cc:20)  it states that this file could not be found ... what am I doing wrong here? Is that file compiled into a library or something? do I need to specify the path within src to that file?? i.e b /src/applications/file-request-server.cc??
Thanks
B

fbil

unread,
Dec 27, 2008, 9:03:23 PM12/27/08
to ns-3-users
Hi,
For the question, you can refer the example, ./example/wifi-ap.cc
It adds a trace point on the wifi device level, then all the rx
packets can be catched.
In the same way, you can use a trace point at packet sink of the
application level by modifying
the config::conect as
---
Config::Connect ("/NodeList/*/ApplicationList/*/$ns3::PacketSink/Rx",
MakeCallback (&DevRxTrace));

DevRxTrace (std::string context, Ptr<const Packet> p, const Address
&address)
{
uint8_t buf[6];
address.CopyTo (buf);
Ipv4Address ipv4 = Ipv4Address::Deserialize (buf);
uint16_t port = buf[4] | (buf[5] << 8);
Ipv4Address MonitorAdd ("10.1.0.1"); //catch the TCP packets from
10.1.0.1

if (ipv4.IsEqual(MonitorAdd))
{
//do something
}
}
----
As a result, you can calculate you desire TCP throughput measurement
by counting these catched packet.

Best,
Scott

Mathieu Lacage

unread,
Dec 28, 2008, 7:11:32 AM12/28/08
to ns-3-...@googlegroups.com
On Sat, 2008-12-27 at 16:38 -0800, bcraw...@gmail.com wrote:

> My second question relates to debugging in GDB... sorry if this is
> noobish as I have little experience with this debugger or how NS-3 is
> built
> to debug I just go to /build/debug/scratch and run gdb my-app ...
> when I try to set a break point for one of the files I have defined (b
> file-request-server.cc:20) it states that this file could not be
> found ... what am I doing wrong here? Is that file compiled into a
> library or something? do I need to specify the path within src to that
> file?? i.e b /src/applications/file-request-server.cc??

the following should work:

./waf --shell
gdb ./build/debug/scratch/my-app

This needs to be in the FAQ :)

Mathieu

Reply all
Reply to author
Forward
0 new messages