FlowMonitor and FlowProbe - access to its parameters

48 views
Skip to first unread message

Felipe Fideles

unread,
Apr 16, 2015, 3:56:18 PM4/16/15
to ns-3-...@googlegroups.com
Hello,

I hope someone can help me out with this issue.

I am trying to simulate delays over mobile networks. For this, I need to know how delay are modeled in ns3 (using 3.22 version here).

I am using Flow Monitor module. It contains a class called FlowProbe, that has parameters such as delayFromFirstProbeSum, packets and bytes.

The problem is that although these parameters can be sent to a xml file, I have not found examples that access these parameters directly.

The following piece of code tries to declare a probe related to a node:

  Ptr<Ipv4FlowProbe> probe0 = nodes.Get(0)->GetObject<Ipv4FlowProbe>();

  Ipv4FlowProbe::Stats stats0 = probe0->GetStats();

What I get is a bad allocation problem: 

 Starting program: /home/felipe/repos/ns-allinone-3.22/ns-3.22/build/scratch/wifi-hidden-terminal 

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Hidden station experiment with RTS/CTS disabled:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc

Program received signal SIGABRT, Aborted.
0x00007fffebf18cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.

Backtrace from gdb gives me that:

#0 0x00007fffebf18cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007fffebf1c0d8 in __GI_abort () at abort.c:89
#2 0x00007fffeca426b5 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007fffeca40836 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007fffeca40863 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007fffeca40af6 in __cxa_rethrow () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff4a03b0b in std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_M_create_node (this=0x7fffffffe1c0, __x=...) at /usr/include/c++/4.8/bits/stl_tree.h:387
#7 0x00007ffff4a03741 in std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_M_clone_node (this=0x7fffffffe1c0, __x=0x7241c0) at /usr/include/c++/4.8/bits/stl_tree.h:429
#8 0x00007ffff4a02ef0 in std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_M_copy (this=0x7fffffffe1c0, __x=0x7241c0, __p=0x7fffffffe1c8) at /usr/include/c++/4.8/bits/stl_tree.h:1087
#9 0x00007ffff4a02ad2 in std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_Rb_tree (this=0x7fffffffe1c0, __x=...) at /usr/include/c++/4.8/bits/stl_tree.h:659
#10 0x00007ffff4a026e9 in std::map, std::allocator > >::map (this=0x7fffffffe1c0, __x=...) at /usr/include/c++/4.8/bits/stl_map.h:181
#11 0x00007ffff4a01d71 in ns3::FlowProbe::GetStats (this=0x722790) at ../src/flow-monitor/model/flow-probe.cc:71
#12 0x0000000000411756 in experiment (enableCtsRts=false) at ../scratch/wifi-hidden-terminal.cc:156
#13 0x0000000000412b2d in main (argc=1, argv=0x7fffffffe408) at ../scratch/wifi-hidden-terminal.cc:211

I tried to implement this over wifi-hidden-terminal.cc example. The modified code is attached.

Please let me know if you need more details about this problem.

Best Regards,

Felipe Fideles


wifi-flow-monitor.cc
Reply all
Reply to author
Forward
0 new messages