Question on the tutorial (Release ns-3.23 Page 43)

96 views
Skip to first unread message

marana...@gmail.com

unread,
Sep 11, 2015, 3:30:52 AM9/11/15
to ns-3-users
Hi

I was learning the command line help facility in the tutorial.


 $ ./waf --run "scratch/myfirst --PrintHelp"
General Arguments:
   
--PrintGlobals:              Print the list of globals.
   
--PrintGroups:               Print the list of groups.
   
--PrintGroup=[group]:        Print all TypeIds of group.
   
--PrintTypeIds:              Print all TypeIds.
   
--PrintAttributes=[typeid]:  Print all attributes of typeid.
   
--PrintHelp:                 Print this help message.


I selected 'PrintGroup' from the General Arguments list, but left it open as below
./waf --run "scratch/myfirst --PrintGroup="



hoping it will print me all the modules (groups) in 'myfirst' program. But the result of the command line was the following lists. I am quite confused with the lists below. In myfirst program (which is actually the first.cc program) these lists of modules are not included, except the Ipv4Interface module. And I am confused since I do not see the PointToPoint module among the lists. Could someone explain me why? Thanks in advance

Waf: Entering directory `/home/tenager/Desktop/ns-allinone-3.23/ns-3.23/build'
Waf: Leaving directory `
/home/tenager/Desktop/ns-allinone-3.23/ns-3.23/build'
'
build' finished successfully (3.356s)
TypeIds in group :
    ns3::AcousticModemEnergyModel
    ns3::Dcf
    ns3::Dot11sStack
    ns3::DsrRoutingHeader
    ns3::FlameStack
    ns3::HalfDuplexIdealPhy
    ns3::Ipv4Interface
    ns3::LinearWifiTxCurrentModel
    ns3::ListPositionAllocator
    ns3::LteEnbNetDevice
    ns3::LteHelper
    ns3::LteHexGridEnbTopologyHelper
    ns3::LteNetDevice
    ns3::LteRadioBearerInfo
    ns3::LteUeNetDevice
    ns3::ObjectBase
    ns3::PositionAllocator
    ns3::PropagationLossModel
    ns3::RandomPropagationLossModel
    ns3::RangePropagationLossModel
    ns3::SimpleOfdmWimaxPhy
    ns3::SubscriberStationNetDevice
    ns3::ThreeLogDistancePropagationLossModel
    ns3::TwoRayGroundPropagationLossModel
    ns3::UeManager
    ns3::WimaxNetDevice



Tommaso Pecorella

unread,
Sep 11, 2015, 4:46:44 AM9/11/15
to ns-3-users
Hi,

actually it's a typo, but thanks (because it give us a nice system to check another thing).
Your typo is "--PrintGroup=" instead of "--PrintGroups". Basically you asked to print the TypeIds without a group, not the groups used in your program.
With the proper "PrintGroups" your output should be something like:
Registered TypeId groups:
   
   
Applications
   
Bridge
   
ConfigStore
   
Core
   
Internet
   
Mpi
   
Network
   
PointToPoint
   
Stats

They are more than one could at first think because there are hidden dependencies. Not a big issue.

Cheers,

T.

marana...@gmail.com

unread,
Sep 11, 2015, 5:49:27 AM9/11/15
to ns-3-users
Hi Tommaso

Thanks for the reply. Good to know that there are hidden dependencies. So, if I understood it clearly, to list the groups in my program I should rather type $ ./waf --run "scratch/myfirst --PrintGroups" , right?
I put that command and got the following group list. The list is similar to the one you posted, but a bit longer list with additional groups in my case. Did you intentionally leave them?  I'm a beginner and ignoring simple issues as this one leaves me with a feeling of incompleteness and doubt.

Registered TypeId groups:
   
   
Antenna
   
Aodv
   
Applications
   
Bridge
   
Buildings
   
ConfigStore
   
Core
   
Csma
   
Dsdv
   
Dsr
   
Energy
   
FdNetDevice
   
FlowMonitor
   
Internet
   
LrWpan
   
Lte
   
Mesh
   
Mobility
   
Mpi
   
Network
   
NixVectorRouting
   
Olsr
   
PointToPoint
   
Propagation
   
SixLowPan
   
Spectrum
   
Stats
   
TapBridge
   
TopologyReader
   
Uan
   
VirtualNetDevice
   
Visualizer
   
Wave
   
Wifi
   
Wimax







Br

Tommaso Pecorella

unread,
Sep 11, 2015, 7:26:28 AM9/11/15
to ns-3-users
Hi,

having doubts and wanting to understand is good. However there are too many independent variables, and sometimes one can only do best guesses.
Let me explain. It's not magic, but it's almost magic.

The TypeId list shows what objects are registered with the ns-3 factory. Thus, which ones you can create in your program. The ObjectFactory rely on the TypeIds, static structures inside each class.
Now, the list shown above depends on what classes are included in your program. However, this is not a simple matter of "what did I use as #include", it's a problem of the Linker. The linker is the one responsible for deciding what objects are packed in your program. As a consequence, the list can vary from computer to computer and from compiler to compiler. The important thing is that the modules you plan to use are there :)

Hope this helps,

Cheers,

T.




On Friday, September 11, 2015 at 11:49:27 AM UTC+2, marana...@gmail.com wrote:
Hi Tommaso

Thanks for the reply. Good to know that there are hidden dependencies. So, if I understood it clearly, to list the groups in my program I should rather type $ ./waf --run "scratch/myfirst --PrintGroups" , right?
I put that command and got the following group list. The list is similar to the one you posted, but a bit longer list with additional groups in my case. Did you intentionally leave them?  I'm a beginner and ignoring simple issues as this one leaves me with a feeling of incompleteness and doubt.

Reply all
Reply to author
Forward
0 new messages